torque-2.4.16/0000777000113300011330000000000011614035205010113 500000000000000torque-2.4.16/contrib/0000777000113300011330000000000011614035164011557 500000000000000torque-2.4.16/contrib/README.pestat0000664000113300011330000000345011272401247013655 00000000000000# README.pestat # contributed by David Singleton # updated Sep 23, 2004 pestat version 1.0 Summary: provides status information about PBS compute nodes Supported systems: all systmes where PBS builds Build/Install: Edit the Makefile: Change PBSHOME to point to your PBS source directory, since pestat.c needs several header files from the PBS source distribution. Look at the supported architectures and uncomment the relevant lines. Check that the include and lib paths point to the correct directory. Type "make" to generate the executable "pestat". Run pestat to verify the correct operation. Copy pestat to a directory in your PATH, such as /usr/local/bin. Linux notes: ------------ The OpenPBS 2.3 RPM-package installs include and lib files in the directory /usr/pbs. You will also need to unpack the source distribution, since pestat.c needs several header files from the PBS distribution. Usage: Example output (from Linux): # pestat node state load pmem ncpu mem resi usrs jobs jobids p01 free 0.15 511 1 0 0 6/3 0 p02 free 0.00 511 1 0 0 0/0 0 p03 free 0.00 511 1 0 0 0/0 0 p04 free 0.00 511 1 0 0 0/0 0 p05 free 0.00 511 1 0 0 0/0 0 p06 free 0.00 511 1 0 0 0/0 0 p07 excl 0.73 511 1 0 0 1/1 1 219 p08 excl 0.94 511 1 0 0 1/1 1 217 p09 excl 0.99 511 1 0 0 1/1 1 217 Availability: Originally written by David.Singleton@anu.edu.au (ANU Supercomputer Facility, Australian National University). download latest from ftp://ftp.fysik.dtu.dk/pub/PBS/ send questions to Ole Holm Nielsen, Ole.H.Nielsen@fysik.dtu.dk (Technical University of Denmark). torque-2.4.16/contrib/README.pbstools0000664000113300011330000001163611536204360014227 00000000000000PBS Tools Website: http://www.nics.tennessee.edu/~troy/pbstools/ SVN repo: http://svn.nics.utk.edu/repos/pbstools/ PBS Tools is a collection of utilities that have been developed at OSC, NICS, and elsewhere to aid in the administration and management of PBS variants (including OpenPBS, PBS Pro, and TORQUE). They have been developed primarily on Linux clusters, but most of them should be applicable to virtually any system running PBS. User tools: ----------- bin/ja -- Job accounting within a PBS job; similar to "ja" in NQE. bin/pbsdcp -- Distributed copy command within a PBS job. This can optionally include an MPI-based scatter functionality that should scale better than the default rcp-based approach. bin/qps -- ps for PBS jobs; relies on the "all" command. bin/qpeek -- Allows users to look at spooled output of running jobs. bin/qexec -- Workalike for SGE qlogin/qrsh/qsh bin/parallel-command-processor -- An MPI program for running an array of serial jobs in the context of a single parallel job (a.k.a. the poor man's job arrays). bin/supermover -- A highly configurable data movement tool that can wrap scp, globus-url-copy, hsi, and a host of other data movement utilities. bin/dmsub -- Submits data movement jobs using a variety of batch and data movement back-ends; understands the transfer description formats of RFT, DMover, and Stork. May rely on supermover, depending on how it's configured. bin/dagsub -- A workalike for condor_submit_dag. This allows the submission of large, complex sets of dependent jobs using a relatively simple syntax. Relies on dmsub for emulating Stork data movement jobs. Admin tools: ------------ bin/js -- Command line lookup of job scripts in the accounting database. bin/jobinfo -- Command line lookup of usage data in the accounting database. sbin/dezombify -- Requeue a "running" PBS job that's not actually running because it had JOIN JOB failures. Relies on the "all" command; requires root privilege. sbin/qtracejob.pbs-server -- Wrapper around the tracejob command to give a time-sorted list of log messages from all hosts involved. Must run on host where pbs_server resides; requires root privilege. sbin/reaver -- Find (and optionally clean up) processes on a host which have not been allocated jobs on that host; requires root privilege. sbin/showscript.pbs-server -- Show the script associated with a jobid. Must run on host where pbs_server resides; requires root privilege. Reporting tools: ---------------- sbin/jobstats -- Generate an HTML report summarizing PBS job statistics over a period of months. Relies on gnuplot; requires root privilege. sbin/find-outlyers -- Extract statistical outlyers from the jobdist.dat file generated by jobstats. Database/web tools: ------------------- Note: these all assume a MySQL DB back end running on the same server as pbs_server and PHP-enabled httpd. etc/create-tables.sql -- Create "pbsacct" database, table, and two user accounts (pbsacct and webapp) used by the other DB tools. To initialize, run "mysql -u root -p passwd or Doug Johnson . Copyright: ---------- PBS Tools are copyright 2005-2009 Ohio Supercomputer Center and/or copyright 2008-2011 University of Tennessee, and are licensed under the terms of the GNU GPL v2. torque-2.4.16/contrib/README.pbstop0000664000113300011330000000216311272401247013664 00000000000000# README.pbstop # contributed by Garrick Staples - University of Southern California # updated Nov 14, 2004 pbstop is a curses-based TORQUE/OpenPBS monitoring utility. The curses module can be found at cpan.org. Usage is described below: Usage: pbstop [-c columns] [-s seconds] [options] [@host ...] Version: 4.05 Copyright 2002-2004 University of Southern California garrick@usc.edu http://www-rcf.usc.edu/~garrick/pbstop grep FIXME `which pbstop` if you want to help out -s seconds between refreshes -c number of columns to display in the grid -m max number of cpus in a node before it gets its own grid -u show only a user's jobs -C toggle colorization -S toggle state summary display -G toggle grid display -Q toggle queue display -t toggle showing queued jobs in queue display -[0-9]... cpu numbers for grid display -J toggle jobs in grid display -V print version and exit A demo screen shot is available at http://www-rcf.usc.edu/~garrick/pbstop.png see http://www-rcf.usc.edu/~garrick/perl-PBS for the latest release Please send comments to garrick@usc.edu. torque-2.4.16/contrib/README.qpeek0000664000113300011330000000064611272401247013466 00000000000000# README.qpeek # contributed by Troy Baer - Ohio Supercomputing Center # updated Mar 31, 2004 qpeek allows a user to view the output files of a job which is still running. Options allow display of the start, end or full file, allowing 'tailing', and allow viewing of error files. qpeek requires perl. see http://www.osc.edu/~troy/pbs/qpeek for latest release For suggestions and bug fixes contact troy@osc.edu torque-2.4.16/contrib/pestat-1.0/0000777000113300011330000000000011614035164013353 500000000000000torque-2.4.16/contrib/pestat-1.0/pestat.c0000664000113300011330000002354211272401247014742 00000000000000/* David.Singleton@anu.edu.au ANU Supercomputer Facility Phone: +61 2 6249 4389 Australian National University Fax: +61 2 6279 8199 Canberra, ACT, 0200, Australia */ #include /* the master config generated by configure */ #include #include #include #include #include #include "portability.h" #include "pbs_ifl.h" #include #define MIN(a,b) ( (a) > (b) ? (b) : (a) ) #define DOWN 0 #define LIST 1 #define CLEAR 2 #define OFFLINE 3 #define RESET 4 #define ALL 5 /* node-attribute values (state,ntype) */ #define ND_free "free" #define ND_offline "offline" #define ND_down "down" #define ND_reserve "reserve" #define ND_job_exclusive "job-exclusive" #define ND_job_sharing "job-sharing" #define ND_state_unknown "state-unknown" #define ND_timeshared "time-shared" #define ND_cluster "cluster" struct state_map { char *rname; char *p_rname; }; struct state_map pstate[] = { { "free", "free" }, { "offline", "off " }, { "down", "down" }, { "reserve", "rsrv" }, { "job-exclusive", "excl" }, { "job-sharing", "shrd" }, { "state-unknown", "unkn" }, { "time-shared", "ts " }, { "cluster", "clus" }, { NULL, NULL } }; int quiet = 0; const char *res_to_get[] = { "loadave", /* the current load average */ "physmem", /* total memory size in KB */ "ncpus", /* number of cpus */ #ifdef TRU64 /* The resources require Mohan's MOM-patches, see the README */ "freemem", /* free memory size in KB */ "ubcmem", /* UBC memory size in KB */ #else "mem", /* memory size in KB */ "resi", /* resident memory size in KB */ #endif "nsessions", /* number of sessions in the system */ "nusers" /* number of users in the system */ }; /* number of indicies in the res_to_get array */ const int num_resget = sizeof(res_to_get) / sizeof(char *); void sort_stats(struct batch_status **first); const int pbs_rm_port = 15003; int ShowUsage(void) { fprintf(stderr, "pestat [ -q ] [ -d ] [ -h ]\n"); exit(1); } /* END ShowUsage() */ /* usage: pestat [ -q ] [ -d ] [ -h ] */ int main( int argc, char *argv[]) { struct batch_status *bstatus = NULL; struct batch_status *jstat = NULL, *job; int con; char *def_server; int errflg = 0; char *errmsg; int i; extern char *optarg; extern int optind; char **pa; struct batch_status *pbstat; int flag = DOWN; char *mom_ans; /* the answer from mom - getreq() */ char *node_state; struct attrl *pat; struct state_map *sm; char *value; struct attrl *jatt; char jstate; int jcpu; char *on_this_node; char joblist[16]; int nrun, nsus, node_cpu; char c; struct attrl retattr[] = { NULL, ATTR_exechost, NULL, NULL }; retattr[0].next = &retattr[1]; retattr[1].next = &retattr[2]; /* get default server, may be changed by -s option */ def_server = pbs_default(); if (def_server == NULL) def_server = ""; while ((c = getopt(argc, argv, "dh:qx-:")) != EOF) { switch (c) { case 'd': DEBUG = TRUE; break; case 'h': /* NYI */ break; case 'q': quiet = TRUE; break; default: /* NO-OP */ ShowUsage(); break; } /* END switch (c) */ } con = cnt2server(def_server); if (con <= 0) { if (!quiet) { fprintf(stderr, "%s: cannot connect to server %s, error=%d\n", argv[0], def_server, pbs_errno); } exit(1); } bstatus = pbs_statnode(con, "", NULL, NULL); if (bstatus == NULL) { if (pbs_errno != 0) { if ((errmsg = pbs_geterrmsg(con)) != NULL) fprintf(stderr, "%s: %s\n", argv[0], errmsg); else fprintf(stderr, "%s: Error %d\n", argv[0], pbs_errno); exit(1); } else { fprintf(stderr, "%s: No nodes found\n", argv[0]); exit(0); } } jstat = pbs_statjob(con, "", NULL, NULL); if (jstat == NULL) { if (pbs_errno) { if ((errmsg = pbs_geterrmsg(con)) != NULL) fprintf(stderr, "%s: %s\n", argv[0], errmsg); else fprintf(stderr, "%s: Error %d\n", argv[0], pbs_errno); exit(1); } } sort_stats(&bstatus); /* Sort the nodes into name order for readability */ #ifdef TRU64 printf(" node state load pmem ncpu frmem ubcmem usrs jobs jobids\n"); #else printf(" node state load pmem ncpu mem resi usrs jobs jobids\n"); #endif for (pbstat = bstatus; pbstat; pbstat = pbstat->next) { node_state = 0; for (pat = pbstat->attribs; pat && !node_state; pat = pat->next) { if (strcmp(pat->name, ATTR_NODE_state) == 0) node_state = pat->value; } if (strstr(node_state, ND_down)) printf("%6s down\n", pbstat->name); else { int mom_sd; double testd; /* used to convert string -> double */ int testi; /* used to convert string -> int */ char *endp; /* used with strtol() */ double loadave; printf("%6s ", pbstat->name); for (sm = pstate; sm->rname; sm++) { if (strcmp(sm->rname, node_state) == 0) break; } if (sm->rname) printf(" %4s", sm->p_rname); else printf("UNKN "); if ((mom_sd = openrm(pbstat->name, pbs_rm_port)) < 0) { printf("No connection to mom on %s\n", pbstat->name); continue; } else for (i = 0; i < num_resget; i++) addreq(mom_sd, (char *) res_to_get[i]); for (i = 0; i < num_resget && (mom_ans = getreq(mom_sd)) != NULL; i++) { value = index(mom_ans, '=') + 1; if (!strcmp(res_to_get[i], "loadave")) { loadave = strtod(value, NULL); /* Add a flag "*" after the loadave for nodes needing attention */ if (!strncmp(node_state, "free", 4)) /* Node is "free" */ { if (loadave < 0.5) printf(" %s ", value); /* Lightly loaded free node */ else printf(" %s*", value); /* Heavily loaded free node */ } else if (loadave < 0.5 || loadave > 1.5) printf(" %s*", value); /* Alert for a low/high load */ else printf(" %s ", value); /* Normal load, or free node */ } else if (!strcmp(res_to_get[i], "physmem")) printf(" %6d", (strtol(value, &endp, 10)) / 1024); #ifdef TRU64 else if (!strcmp(res_to_get[i], "freemem")) printf(" %6d", (strtol(value, &endp, 10)) / 1024); else if (!strcmp(res_to_get[i], "ubcmem")) printf(" %6d", (strtol(value, &endp, 10)) / 1024); #else else if (!strcmp(res_to_get[i], "mem")) printf(" %6d", (strtol(value, &endp, 10)) / 1024); else if (!strcmp(res_to_get[i], "resi")) printf(" %6d", (strtol(value, &endp, 10)) / 1024); #endif else if (!strcmp(res_to_get[i], "ncpus")) printf(" %2d", MIN(atoi(value), 99)); else if (!strcmp(res_to_get[i], "nsessions")) printf(" %1d", MIN(atoi(value), 9)); else if (!strcmp(res_to_get[i], "nusers")) printf("/%1d ", MIN(atoi(value), 9)); free(mom_ans); fflush(stdout); } closerm(mom_sd); joblist[0] = '\0'; jcpu = 0; nrun = 0; nsus = 0; node_cpu = 0; for (job = jstat; job; job = job->next) { jatt = job->attribs; on_this_node = NULL; while (jatt) { if (!strcmp(jatt->name, ATTR_state)) jstate = jatt->value[0]; else if (!strcmp(jatt->name, ATTR_exechost)) on_this_node = strstr(jatt->value, pbstat->name); else if (!strcmp(jatt->name, ATTR_l)) if (!strcmp(jatt->resource, "cpupercent")) jcpu = atoi(jatt->value); jatt = jatt->next; } if (on_this_node) { nrun += jstate == 'R'; nsus += jstate == 'S'; if (joblist[0] != '\0') strcat(joblist, ","); if (strlen(joblist) < 15) strncat(joblist, strtok(job->name, "."), 15 - strlen(joblist)); node_cpu += jcpu; } } /* printf(" %1d/%1d %3.3d %s\n",MIN(nrun,9), MIN(nsus,9), node_cpu, joblist); */ printf(" %2d %s\n", MIN(nrun, 99), joblist); } } } #define NODE_T struct batch_status #define SIZE(n) (atoi(n->name+4)) #define SORTLIST sort_stats void SORTLIST(NODE_T **first) { /* ----------------------------------------------------------------------- sorts a "one-way" list of NODE_Ts on component SIZE in ascending order struct node{ SIZE; ... struct node *next; } NODE_T; ----------------------------------------------------------------------- */ NODE_T *done, *i, *j; if ((*first)->next != NULL) { for (done = *first; done->next != NULL;) /* Sort on size*/ { j = done->next; /* extract the next "undone" */ done->next = j->next; /* node from the list */ if (SIZE(j) < SIZE((*first))) /* Goes first */ { j->next = *first; *first = j; } else /* find it splace */ { for (i = *first; i != done && SIZE(i->next) <= SIZE(j) ; i = i->next){ }; j->next = i->next; i->next = j; if (i == done) done = done->next; } } } } torque-2.4.16/contrib/pestat-1.0/README0000664000113300011330000000774511272401247014165 00000000000000 pestat - a tool to monitor resources on all PBS nodes ----------------------------------------------------- The pestat code contacts every node served by the given PBS server and retrieves resource information such as CPU load and memory usage (any resource information can be programmed into the code, if you need it). A single summary line is printed for each node. The latest version of this code is available from ftp://ftp.fysik.dtu.dk/pub/PBS/ The code has been tested on the following architectures: o Linux (the default) o Compaq Tru64 UNIX 4.0F Example output (from Linux): # pestat node state load pmem ncpu mem resi usrs jobs jobids p01 free 0.15 511 1 0 0 6/3 0 p02 free 0.00 511 1 0 0 0/0 0 p03 free 0.00 511 1 0 0 0/0 0 p04 free 0.00 511 1 0 0 0/0 0 p05 free 0.00 511 1 0 0 0/0 0 p06 free 0.00 511 1 0 0 0/0 0 p07 excl 0.73 511 1 0 0 1/1 1 219 p08 excl 0.94 511 1 0 0 1/1 1 217 p09 excl 0.99 511 1 0 0 1/1 1 217 p10 excl 0.99 511 1 0 0 1/1 1 217 Example output (from Tru64 UNIX): # pestat node state load pmem ncpu frmem ubcmem usrs jobs jobids asrv free 1.24* 640 1 274 62 5/4 0 acmp free 0.00 1536 1 1139 75 9/9 0 a01 excl 0.00* 512 1 311 24 1/1 1 14371 a02 excl 0.01* 512 1 314 24 1/1 1 14371 a03 excl 1.00 512 1 323 24 1/1 1 14263 a04 excl 0.97 512 1 97 24 1/1 1 14298 a05 excl 1.00 512 1 309 24 1/1 1 14371 a06 excl 0.60 512 1 361 17 1/1 1 14582 a07 excl 0.56 512 1 355 18 1/1 1 14582 a08 excl 1.00 512 1 143 24 1/1 1 14598 a09 free 0.00 512 1 438 14 0/0 0 Some nodes have an asterisk (*) next to the "load" column. This indicates a node whose load is "unexpected", i.e., a free node with a high load or a busy node with low load. The "acceptable" load-range for a busy node has arbitrarily been taken as 0.5-1.5, but this can of course be changed in the code (look for the loadave variable). Installation ------------ Edit the Makefile: Change PBSHOME to point to your PBS source directory, since pestat.c needs several header files from the PBS source distribution. Look at the supported architectures and uncomment the relevant lines. Check that the include and lib paths point to the correct directory. Type "make" to generate the executable "pestat". Run pestat to verify the correct operation. Copy pestat to a directory in your PATH, such as /usr/local/bin. Linux notes: ------------ The OpenPBS 2.3 RPM-package installs include and lib files in the directory /usr/pbs. You will also need to unpack the source distribution, since pestat.c needs several header files from the PBS distribution. Compaq Tru64 UNIX notes: ------------------------ The Makefile assumes that you have copied the relevant PBS files to /usr/local/include and /usr/local/lib, so edit this if necessary. One snag is that you can't link with "-lnet" because that would incorrectly pick up /usr/shlib/libnet.so. The pestat.c code has some "#ifdef TRU64" sections that assume that the resources named "freemem" and "ubcmem" are available. The latter refers to the Tru64 UBC (Unified Buffer Cache) memory reservation. These resources requires that you have compiled PBS with the MOM-patches written by Mohan . These patches should become available on http://www.mcs.anl.gov/openpbs/. Author: ------- Originally written by David.Singleton@anu.edu.au (ANU Supercomputer Facility, Australian National University). Questions: Ole Holm Nielsen, Ole.H.Nielsen@fysik.dtu.dk (Technical University of Denmark). Please send bug reports, support for other architectures, etc. to Ole. torque-2.4.16/contrib/pestat-1.0/Makefile0000664000113300011330000000077011272401247014734 00000000000000 # Configure PBSHOME so that it points to your PBS source directory PBSHOME = $$HOME/src/PBS/OpenPBS/OpenPBS_2_3_2/src # Linux (with OpenPBS RPM installed) CFLAGS = -g -I$(PBSHOME)/include LDFLAGS = -g LIBS = -L/usr/pbs/lib -lnet -lpbs -lcmds # Compaq Tru64 UNIX 4.0F # CFLAGS = -g -DTRU64 -I/usr/local/include -I$(PBSHOME)/include # LDFLAGS = -g -L/usr/local/lib # LIBS = /usr/local/lib/libnet.a -lpbs -lcmds pestat: pestat.o $(CC) -o $@ pestat.o $(LDFLAGS) $(LIBS) clean: rm -f pestat *.o core torque-2.4.16/contrib/pam_authuser.tar.gz0000664000113300011330000001244311272401247015324 00000000000000Epam_authuser.tarYce(*G%y,X.ɌowxȒcT%kf4ē$ak˔vhw:۝.nw:_U6:nw7`g+$`clk߬[[_L}wv}&w{o{mwv:;=K` e0p;@ԱBg]da#WnvøJ| gNn\/80T!=l[DU[XO1=d|:!!Ͱʏ&2 JV0!X1Djx$8 p:7Gc;LO5!0oC!ED#ϯ[o  x bDUzξiBL-[qn(2Mg֍ Pر g4@9<MiJ0x8enBD( idDp2 Cd`&p8Ñ;NB'0 i)4h^N`hITGo0V\DpC/̍^ o]Dތj[G:/&@pH$yr4H>ΔQ7.re2H|CJGD)-,w5|d(Ң8xdKYONDq[sdf؄"gi&k'jb߲WV ,Ë,&ljl$ohWnoܦK(;WsHI3ān, ȵ]RrHp O |ih^# nf2,~IhFsf"L2Q%h~Idj7o 'e$yT%퉲ORmlI`\.;4ʹ3εeX2Saq&"DVlOD +NPk-У&9B:U1$g$F\6,%63&+lcpĽQZrQDdb0!@Ow[NuwnKk&vr6[4`7t[ĮvNyl(,>}{HDa#n F:k'Ȳb aZq$9+4A>;yյm&ULPx%ԹȳƑ±]`n i )-1ȂF3-6%"3 zl,ҋĜh@1A'm.2ԁvӗd{è?MerT0ޢו(6[OT,f%mc3:\|qEq0m4:axtMj">8z<0քLBL?㜙CTD^ou|%ĽDOdt4$97663Y|{;Aw#KTp7{nHg.˫ k@aD<"}}|LE 2&t~WU)`L'TJd$R;Bo!VwWA(o# ۟wR+X}~<9dv fpOH'1v,;93!ԑ03D?M=_ÉVezjyʄKYOE,$4"QDuFKEkڡ"X*nNsur4'n .XЋXyJ?pʣ}k*%"Bs t]"+Sty/cb_Rb+*OdWhYB1Hw.嗒`טվJ!+1ec%DFayFᛢaƒ"^h$4cVZC z:d =JU%EoVsQefkAI\Qh@? [l ¬lbIpQN$'r8@!O6k: TR-N.TyEm(~jUʝo݅b]IsQD L`-b&yaĒ"?D(U";qӃ՞NPr7'/L)Ƽ%前 m5-ge4Efx=0SkH) V;$j}\;(3J)8agEߦJFT*pq`i643uÊZKʤ n/qnmt烇P"ču,޹^>FB6EјP=\\VZN WT+JY!@,,.*i1s:U+EA."$T=j~q}UOOw767Ӳ YL}UXv)s~GΑe#^ O:r(ӛlzS78pVް|-.T9X.HSw䈑fGc(FfgiRv.+{t)im}wJLoh PKTJPJť#{;>㎌|P^JDsj1=GbtS|?_b/66C7ŧ|%gkK.bW(n,7_rLP| /@?l}A?Ȑ> #"8B{[~kw"C%F3~ x3Ht6U3?gi!E[M눩*A/ʗd$ |~w-}']𧞜[v& ^w`tвeézSCqp=M-!]ש34+V?8o%a;ת[>߽q=;mmꔎD)M%>G&O(I5n=~AES*đJ3Kz8A(_X=gCWW[ P]THa#3\yS%蒅ܨK T嫫/4toXD„|Bgyli(Bw4SҸtozBg݄%oPEH V00"r)fN1J7#&wpƜW(՛Ђ׉Kj.2_9ͨ+Dmt42nR-{ZAzćc4KcGH&M'tE^kxQFtw}=umw(NF1m4TI'*wlhLQC"0Ġ8tbk O㚋XF.4~"]C {G(bLo&Cø"FŞ.^hhm4l=:gV)kxG|P}NwvvNgS?(l ݠE1A*ߙ#O>3sR8v~jVBz`<{&u@L|?a/ "v̹9*_2#G\"7gFa zpȀ @|e ó'|C)+=X9*oo/98yC;E =/`#SAR>Um$t!$:fwmcu !& S*shШ; torque-2.4.16/contrib/blcr/0000777000113300011330000000000011614035164012501 500000000000000torque-2.4.16/contrib/blcr/restart_script0000775000113300011330000001261011272401247015414 00000000000000#! /usr/bin/perl ################################################################################ # # Usage: restart_script # # This script is invoked by pbs_mom to restart a job. # ################################################################################ use strict; use Sys::Syslog; # Customize the following variables # Customize the PATH to include location of blcr checkpoint commands # (e.g. cr_restart), torque client commands (e.g. qalter), # and pbs_mom checkpoint/restart scripts (e.g. restart_script,run_on_success) $ENV{PATH} .= ":/usr/local/bin:/opt/torque/bin:/var/torque/mom_priv"; my $logLevel = 3; # 0 = none, 1 = fail, 2 = info, 3 = debug logPrint(2, "Invoked: $0 " . join(' ', @ARGV) . "\n"); my ($sessionId, $jobId, $userId, $groupId, $checkpointDir, $checkpointName); my $usage = "Usage: $0 \n"; if (@ARGV == 6) { ($sessionId, $jobId, $userId, $groupId, $checkpointDir, $checkpointName) = @ARGV; } else { logDie(1, $usage); } # Set of cr_restart hooks for flagging the job with various error conditions my $runOnSuccessCmd = "qalter -W checkpoint_restart_status=\"Successfully restarted job from checkpoint\" $jobId"; my $runOnFailTempCmd = "qalter -W checkpoint_restart_status=\"Temporary failure restarting job from checkpoint\" $jobId"; my $runOnFailPermCmd = "qalter -W checkpoint_restart_status=\"Permanent failure restarting job from checkpoint\" $jobId"; my $runOnFailArgsCmd = "qalter -W checkpoint_restart_status=\"Argument failure restarting job from checkpoint\" $jobId"; my $runOnFailEnvCmd = "qalter -W checkpoint_restart_status=\"Environment failure restarting job from checkpoint\" $jobId"; my $runOnFailureCmd = "qalter -W checkpoint_restart_status=\"General failure restarting job from checkpoint\" $jobId"; # Drop privileges to the job owner my $gid = getgrnam($groupId); logDie(1, "Unable to resolve group id ($groupId)\n") unless defined $gid; $( = $gid; $) = $gid; logDie(1, "Unable to set gid: $gid") unless $gid == $(; my $uid = getpwnam($userId); logDie(1, "Unable to resolve user id ($userId)\n") unless defined $uid; $< = $uid; $> = $uid; logDie(1, "Unable to set uid: $uid") unless $uid == $<; # Change to the checkpoint directory where we want the checkpoint to be created chdir $checkpointDir or logDie(1, "Unable to cd to checkpoint dir ($checkpointDir): $!\n") if $logLevel; my $cmd = "cr_restart"; $cmd .= " --run-on-success='$runOnSuccessCmd'" if $runOnSuccessCmd; $cmd .= " --run-on-fail-perm='$runOnFailPermCmd'" if $runOnFailPermCmd; $cmd .= " --run-on-fail-temp='$runOnFailTempCmd'" if $runOnFailTempCmd; $cmd .= " --run-on-fail-args='$runOnFailArgsCmd'" if $runOnFailArgsCmd; $cmd .= " --run-on-fail-env='$runOnFailEnvCmd'" if $runOnFailEnvCmd; $cmd .= " --run-on-failure='$runOnFailureCmd'" if $runOnFailureCmd; $cmd .= " $checkpointName"; my $restartOutput = `$cmd 2>&1`; my $restartRc = $? >> 8; if ($restartRc) { logPrint(1, "Subcommand ($cmd) failed with rc=$restartRc:\n$restartOutput") if $logLevel >= 1; # Check whether this was a cr_restart error # We need to do this before updating the error with qalter my $cmd = "qstat -as $jobId"; my $output = `$cmd 2>&1`; my $rc = $? >> 8; if ($rc) { logPrint(1, "Subcommand ($cmd) failed with rc=$rc:\n$output") if $logLevel >= 1; } else { logPrint(3, "Subcommand ($cmd) yielded rc=$rc:\n$output") if $logLevel >= 3; } if ($output =~ m/^(.*failure restarting job.*)$/m) { my $comment = "$1: $restartOutput"; # Attach restart error message to job # Before attaching message we first replace carriage returns with spaces $comment =~ s/\n/ /g; # Perl automatically enables a set of special security checks, # called taint mode, when it detects its program running with # differing real and effective user or group IDs. # We must therefore untaint the output. if ($comment =~ m/(.*)/) { $comment = $1; } # Build qalter command my $cmd = "qalter -W comment=\"\\\"$comment\\\"\" $jobId"; my $output = `$cmd 2>&1`; my $rc = $? >> 8; if ($rc) { logPrint(1, "Subcommand ($cmd) failed with rc=$rc:\n$output") if $logLevel >= 1; } else { logPrint(3, "Subcommand ($cmd) yielded rc=$rc:\n$output") if $logLevel >= 3; } } } else { logPrint(3, "Subcommand ($cmd) yielded rc=$restartRc:\n$restartOutput") if $logLevel >= 3; } # Exit with exit code of cr_restart command exit $restartRc; ################################################################################ # logPrint($message) # Write a message (to syslog) and die ################################################################################ sub logPrint { my ($level, $message) = @_; my @severity = ('none', 'warning', 'info', 'debug'); return if $logLevel < $level; openlog('restart_script', '', 'user'); syslog($severity[$level], $message); closelog(); } ################################################################################ # logDie($message) # Write a message (to syslog) and die ################################################################################ sub logDie { my ($level, $message) = @_; logPrint($level, $message); die($message); } torque-2.4.16/contrib/blcr/checkpoint_script0000775000113300011330000000660611272401247016067 00000000000000#! /usr/bin/perl ################################################################################ # # Usage: checkpoint_script # # This script is invoked by pbs_mom to checkpoint a job. # Errors are logged to syslog # ################################################################################ use strict; use Sys::Syslog; # Customize the following script variables # Customize the PATH to include location of blcr cr_checkpoint command $ENV{PATH} .= ":/usr/local/bin"; my $logLevel = 3; # 0 = none, 1 = fail, 2 = info, 3 = debug logPrint(2, "Invoked: $0 " . join(' ', @ARGV) . "\n"); my ($sessionId, $jobId, $userId, $groupId, $signalNum, $checkpointDir, $checkpointName, $checkpointDepth); my $usage = "Usage: $0 \n"; # Note that depth is not used in this script but could control a limit to the # number of checkpoint image files that are preserved on the disk. # # Note also that a request was made to identify whether this script was invoked # by the job's owner or by a system administrator. While this information is # known to pbs_server, it is not propagated to pbs_mom and thus it is not # possible to pass this to the script. Therefore, a workaround is to invoke # qmgr and attempt to set a trivial variable. This will fail if the invoker is # not a manager. if (@ARGV == 8) { ($sessionId, $jobId, $userId, $groupId, $checkpointDir, $checkpointName, $signalNum, $checkpointDepth) = @ARGV; } else { logDie(1, $usage); } # Drop privileges to the job owner my $gid = getgrnam($groupId); logDie(1, "Unable to resolve group id ($groupId)\n") unless defined $gid; $( = $gid; $) = $gid; logDie(1, "Unable to set gid: $gid") unless $gid == $(; my $uid = getpwnam($userId); logDie(1, "Unable to resolve user id ($userId)\n") unless defined $uid; $< = $uid; $> = $uid; logDie(1, "Unable to set uid: $uid") unless $uid == $<; # Change to the checkpoint directory where we want the checkpoint to be created chdir $checkpointDir or logDie(1, "Unable to cd to checkpoint dir ($checkpointDir): $!\n") if $logLevel; # Build blcr checkpoint command my $cmd = "cr_checkpoint"; $cmd .= " --signal $signalNum" if $signalNum; $cmd .= " --tree $sessionId"; $cmd .= " --file $checkpointName"; my $output = `$cmd 2>&1`; my $rc = $? >> 8; if ($rc) { logPrint(1, "Subcommand ($cmd) failed with rc=$rc:\n$output") if $logLevel >= 1; } else { logPrint(3, "Subcommand ($cmd) yielded rc=$rc:\n$output") if $logLevel >= 3; } exit $rc; ################################################################################ # logPrint($message) # Write a message (to syslog) and die ################################################################################ sub logPrint { my ($level, $message) = @_; my @severity = ('none', 'warning', 'info', 'debug'); return if $logLevel < $level; openlog('checkpoint_script', '', 'user'); syslog($severity[$level], $message); closelog(); } ################################################################################ # logDie($message) # Write a message (to syslog) and die ################################################################################ sub logDie { my ($level, $message) = @_; logPrint($level, $message); die($message); } torque-2.4.16/contrib/pbstop0000664000113300011330000022452011272401247012733 00000000000000#!/usr/bin/perl # Copyright 2002, 2003, 2004 University of Southern California # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Latest version of this software may be found at: # http://www-rcf.usc.edu/~garrick/perl-PBS # Please send comments to garrick@usc.edu. # configurable defaults # Don't change the defaults here, instead make yourself a config file, see pbstop(1) my $columns = 30; # columns in grid my $sleeptime = 20; # seconds between refreshes my $colorize = 1; # 1 or 0 my $show_summary = 1; # 1 or 0 my $compact_summary = 0; # 1 or 0 my $show_grid = 1; # 1 or 0 my $show_queue = 1; # 1 or 0 my $show_qqueue = 1; # 1 or 0 my $show_jobs = 1; # 1 or 0 my $show_user = "all"; # show only a given user's jobs my @show_cpu = ("0"); # list of cpu numbers my @host = (); # leave empty for localhost my $maxrows = 300; # maximum number of rows my $maxcolumns = 200; # maximum number of columns my $maxnodegrid = 7; # maximum number of CPUs on a node before it gets # its own grid. my $qmgr = "/usr/local/pbs/bin/qmgr"; my $qstat = "/usr/local/pbs/bin/qstat"; my $pbsnodes = "/usr/local/pbs/bin/pbsnodes"; ######################################################### ### Nothing else to adjust below here # Here's some neat perl magic... we'll use PBS if we have it. # And if we have it, we might just find it not-yet-installed # if we are running it out of the source directory. And if # we _are_ running it out of the source tree, assume we are just # testing it and enable warnings! BEGIN { use vars qw/$use_perlPBS/; use ExtUtils::testlib; eval "use PBS qw/:monitor/"; if ($@) { $use_perlPBS=0; } else { $use_perlPBS=1; } } # enable warnings if running under testing. if ( -d $INC[0] ) { $^W=1; } use strict; use vars qw/$VERSION/; use Curses; $VERSION = "4.05"; # init a few global vars my %Job_of_letter; my @Colors = (); my $masterletters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; my $letters = $masterletters; my $underline = 0; my %searchobject=(); my ( $y, $x, $Y, $X, $py, $px, $ly, $lx, $subY, $subX ) = ( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); if ($use_perlPBS) { my $defaulthost=pbs_default(); if ($defaulthost) { @host=($defaulthost); } undef $defaulthost; } readrc("/etc/pbstoprc"); readrc("$ENV{HOME}/.pbstoprc"); if (!$use_perlPBS) { -e $qmgr or chomp( $qmgr = `which qmgr 2>/dev/null` ); -e $qmgr or die "qmgr: Command not found\n"; -e $qstat or chomp( $qstat = `which qstat 2>/dev/null` ); -e $qstat or die "qstat: Command not found\n"; -e $pbsnodes or chomp( $pbsnodes = `which pbsnodes 2>/dev/null` ); -e $pbsnodes or die "pbsnodes: Command not found\n"; } # argument processing my @argvhosts=(); while ( my $arg = shift @ARGV ) { if ( $arg eq '-c' ) { $columns = shift @ARGV; $columns =~ /^\d+$/ or $ARGV[0] = '-h'; $columns > 0 or $ARGV[0] = '-h'; } elsif ( $arg eq '-s' ) { $sleeptime = shift @ARGV; $sleeptime =~ /^\d+$/ or $ARGV[0] = '-h'; $sleeptime > 0 or $ARGV[0] = '-h'; } elsif ( $arg eq '-m' ) { $maxnodegrid = shift @ARGV; $maxnodegrid =~ /^\d+$/ or $ARGV[0] = '-h'; $maxnodegrid > 0 or $ARGV[0] = '-h'; } elsif ( $arg eq '-C' ) { $colorize = !$colorize; } elsif ( $arg eq '-S' ) { $show_summary = !$show_summary; } elsif ( $arg eq '-G' ) { $show_grid = !$show_grid; } elsif ( $arg eq '-Q' ) { $show_queue = !$show_queue; } elsif ( $arg eq '-t' ) { $show_qqueue = !$show_qqueue; } elsif ( $arg eq '-J' ) { $show_jobs = !$show_jobs; } elsif ( $arg eq '-u' ) { if (defined $ARGV[0] and $ARGV[0] =~ /^([^-]+)/) { $show_user=join(' ', split(',', shift)); } else { $ARGV[0] = '-h'; } } elsif ( $arg =~ /^-(\d+)$/ ) { @show_cpu = split ( //, $1 ); } elsif ( $arg =~ /^@(.*)/ ) { push(@argvhosts, $1); } elsif ( $arg eq '-V' ) { print "pbstop $VERSION\nCopyright 2002, 2003, 2004 University of Southern California\n"; exit(0); } else { print "Usage: pbstop [-c columns] [-s seconds] [-m numcpus] [options] [\@host ...]\n"; print " Version: $VERSION\n"; print " Copyright 2002, 2003, 2004 University of Southern California\n"; print " garrick\@usc.edu http://www-rcf.usc.edu/~garrick/pbstop\n"; print " grep FIXME `which pbstop` if you want to help out\n\n"; print " -s seconds between refreshes\n"; print " -c number of columns to display in the grid\n"; print " -m max number of cpus in a node before it gets its own grid\n"; print " -u show only a user's jobs\n"; print " -C toggle colorization\n"; print " -S toggle state summary display\n"; print " -G toggle grid display\n"; print " -Q toggle queue display\n"; print " -t toggle showing queued jobs in queue display\n"; print " -[0-9]... cpu numbers for grid display\n"; print " -J toggle jobs in grid display\n"; print " -V print version and exit\n"; exit(1); } } if(scalar @argvhosts > 0) { @host=@argvhosts; } undef @argvhosts; if (!$use_perlPBS) { defined($host[0]) or $host[0] = defined $ENV{"PBS_DEFAULT"} ? $ENV{"PBS_DEFAULT"} : `hostname`; } chomp( @host ); if ($show_user eq "all") { $show_user=0; } elsif ($show_user =~ /\bme\b/) { $show_user=~ s/\bme\b/$ENV{USER}/; } use vars qw/$SIGWINCH/; $SIGWINCH=0; $SIG{'WINCH'} = sub {$SIGWINCH=1; }; $SIG{'INT'} = sub { endwin; exit(0); }; $SIG{'TERM'} = sub { endwin; exit(0); }; #FIXME# Can someone tell me how to use filter() correctly? -t STDOUT or filter(); # Is this portable? my $CTRL_B=chr(ord("B")-ord("@")); my $CTRL_F=chr(ord("F")-ord("@")); my $CTRL_L=chr(ord("L")-ord("@")); my $CTRL_G=chr(ord("G")-ord("@")); my $CTRL_H=chr(ord("H")-ord("@")); initscr; cbreak; noecho; getmaxyx( $Y, $X ); start_color; $colorize=$colorize && has_colors(); my $pr = 0; # This is every possible color combo list below. Over time, I've commented out # color pairs that don't look very good. If your eyes disagree with my eyes, # you are free to play around with this list. But don't forget... only the # first $COLOR_PAIRS uncommented combos apply. $COLOR_PAIRS is set by your # curses implementation. pbstop's help screen (hit 'h' in pbstop) will tell # you the value of $COLOR_PAIRS. init_pair( ++$pr, COLOR_RED, COLOR_BLACK ); init_pair( ++$pr, COLOR_GREEN, COLOR_BLACK ); init_pair( ++$pr, COLOR_YELLOW, COLOR_BLACK ); init_pair( ++$pr, COLOR_BLUE, COLOR_BLACK ); init_pair( ++$pr, COLOR_MAGENTA, COLOR_BLACK ); init_pair( ++$pr, COLOR_CYAN, COLOR_BLACK ); init_pair( ++$pr, COLOR_WHITE, COLOR_BLACK ); #init_pair( ++$pr, COLOR_BLACK, COLOR_BLACK ); #init_pair( ++$pr, COLOR_RED, COLOR_WHITE ); #init_pair( ++$pr, COLOR_GREEN, COLOR_WHITE ); #init_pair( ++$pr, COLOR_YELLOW, COLOR_WHITE ); #init_pair( ++$pr, COLOR_BLUE, COLOR_WHITE ); #init_pair( ++$pr, COLOR_MAGENTA, COLOR_WHITE ); #init_pair( ++$pr, COLOR_CYAN, COLOR_WHITE ); #init_pair( ++$pr, COLOR_WHITE, COLOR_WHITE ); init_pair( ++$pr, COLOR_BLACK, COLOR_WHITE ); #init_pair( ++$pr, COLOR_RED, COLOR_YELLOW ); #init_pair( ++$pr, COLOR_GREEN, COLOR_YELLOW ); #init_pair( ++$pr, COLOR_YELLOW, COLOR_YELLOW ); #init_pair( ++$pr, COLOR_BLUE, COLOR_YELLOW ); init_pair( ++$pr, COLOR_MAGENTA, COLOR_YELLOW ); #init_pair( ++$pr, COLOR_CYAN, COLOR_YELLOW ); #init_pair( ++$pr, COLOR_WHITE, COLOR_YELLOW ); #init_pair( ++$pr, COLOR_BLACK, COLOR_YELLOW ); init_pair( ++$pr, COLOR_RED, COLOR_CYAN ); #init_pair( ++$pr, COLOR_GREEN, COLOR_CYAN ); init_pair( ++$pr, COLOR_YELLOW, COLOR_CYAN ); #init_pair( ++$pr, COLOR_BLUE, COLOR_CYAN ); init_pair( ++$pr, COLOR_MAGENTA, COLOR_CYAN ); #init_pair( ++$pr, COLOR_CYAN, COLOR_CYAN ); init_pair( ++$pr, COLOR_WHITE, COLOR_CYAN ); init_pair( ++$pr, COLOR_BLACK, COLOR_CYAN ); init_pair( ++$pr, COLOR_RED, COLOR_MAGENTA ); init_pair( ++$pr, COLOR_GREEN, COLOR_MAGENTA ); # current 16th init_pair( ++$pr, COLOR_YELLOW, COLOR_MAGENTA ); init_pair( ++$pr, COLOR_BLUE, COLOR_MAGENTA ); #init_pair( ++$pr, COLOR_MAGENTA, COLOR_MAGENTA ); init_pair( ++$pr, COLOR_CYAN, COLOR_MAGENTA ); init_pair( ++$pr, COLOR_WHITE, COLOR_MAGENTA ); #init_pair( ++$pr, COLOR_BLACK, COLOR_MAGENTA ); #init_pair( ++$pr, COLOR_RED, COLOR_RED ); init_pair( ++$pr, COLOR_GREEN, COLOR_RED ); init_pair( ++$pr, COLOR_YELLOW, COLOR_RED ); init_pair( ++$pr, COLOR_BLUE, COLOR_RED ); init_pair( ++$pr, COLOR_MAGENTA, COLOR_RED ); init_pair( ++$pr, COLOR_CYAN, COLOR_RED ); init_pair( ++$pr, COLOR_WHITE, COLOR_RED ); init_pair( ++$pr, COLOR_BLACK, COLOR_RED ); init_pair( ++$pr, COLOR_RED, COLOR_GREEN ); #init_pair( ++$pr, COLOR_GREEN, COLOR_GREEN ); #init_pair( ++$pr, COLOR_YELLOW, COLOR_GREEN ); init_pair( ++$pr, COLOR_BLUE, COLOR_GREEN ); #init_pair( ++$pr, COLOR_MAGENTA, COLOR_GREEN ); init_pair( ++$pr, COLOR_CYAN, COLOR_GREEN ); init_pair( ++$pr, COLOR_WHITE, COLOR_GREEN ); init_pair( ++$pr, COLOR_BLACK, COLOR_GREEN ); sub init_colors { return ( 1 .. ($COLOR_PAIRS-1 > $pr ? $pr : $COLOR_PAIRS-1) ); } my $pad = newpad( $maxrows, $maxcolumns ); my $cmdwin = newwin( 1, $X - 1, $Y - 1, 0 ); keypad( $cmdwin, 1 ); my $subwin=0; main_loop(\@host); # The original color set that I actually spent some time planning # "\033[07;34m", "\033[07;35m", "\033[07;36m", # "\033[07;37m", "\033[01;37m", "\033[35m", # "\033[36m", "\033[37m", "\033[34m", # "\033[33m", "\033[32m", "\033[01;36;45m", # "\033[01;30;47m", "\033[01;30;46m", "\033[36;45m", # "\033[30;47m", "\033[30;46m", "\033[01;33m", # "\033[01;34m", "\033[01;35m", "\033[01;36m", # "\033[01;31m", "\033[01;32m", ############################################################### ## All subroutines below here ############################################################### # main_loop() will 1) gather all of our data from pbs_server, 2) prep it a bit # in letterize() and colorize(), 3) call update_display to draw our pretty # grids and stuff, and finally calls 4) top_sleep which is where we spend most # of our time. # 1) We have two ways of gathering data: calling the perl-PBS module which # connects directly to pbs_server and requests the desired data, or parsing the # output of qmgr and qstat. Clearly the former is desired. The latter is only # called if perl-PBS can't be found. These subroutines are get_info_modPBS() # and get_info_cmdline(). Since this data is kept between cycles around the # main loop, we take some care to remove old data. The result is two large structures, one for Jobs and one for Nodes, which will carry us through the rest of the entire program. # 2) letterize() and colorize() are fairly unexciting, but they do assign # letters and colors to each running job. This info is stored in the large Job # structure. letterize() has probably the only original code left. # 3) update_display(), by itself, is pretty coring. It calls the functions # responsible for the summary, colorful grid, and the job listing at the # bottom. show_grid() is pretty exciting; it first finds every node over # $maxnodegrid, calls them "timesharing" and shoves them aside, draws a big # colorful grid for what's left, and draws another colorful grid for the # timesharing nodes. # 4) top_sleep() is a big giant mess. It is far too monolithic. If anyone # wants chop it up a bit, feel free to send me patches! Anyways, it loops # around on user input until the time expires and it is time to return back up # to main_loop(). In the meantime, it does everything the user requests, # including griding through the main data structures looking for stuff. All of # the code responsible for moving around the giant pad is here. sub main_loop { my $host = shift; my $maxlen; my %Nodes; my %Jobs; my %State_count; # temp vars my $node; # Main event loop. while (1) { %State_count = (); $State_count{_nodes} = 0; $State_count{_anodes} = 0; $State_count{_procs} = 0; $State_count{_aprocs} = 0; $State_count{_mprocs} = 0; $State_count{_rjobs} = 0; $State_count{_njobs} = 0; foreach my $server (@$host) { if ($use_perlPBS) { get_info_modPBS($server, \%Nodes, \%Jobs, \%State_count); } else { get_info_cmdline($server, \%Nodes, \%Jobs, \%State_count); } # trim out old nodes that are no longer seen foreach my $node (keys %{$Nodes{$server}}) { if ($Nodes{$server}{$node}{seen} != 1) { delete $Nodes{$server}{$node}; } else { $Nodes{$server}{$node}{seen}=0; } } } # trim out old jobs that are no longer seen foreach my $job (keys %Jobs) { if (!exists $Jobs{$job}{seen} or !defined $Jobs{$job}{seen} or $Jobs{$job}{seen} != 1) { delete $Jobs{$job}; } else { $Jobs{$job}{seen}=0; } } $maxlen |= getmaxkeylen( \%Nodes ); letterize( \%Jobs ); colorize( \%Jobs ); update_display( \%State_count, \%Nodes, \%Jobs, $maxlen, $State_count{"_mprocs"} ); -t STDOUT or do { endwin; exit; }; top_sleep( \%State_count, \%Nodes, \%Jobs, $maxlen, $State_count{"_mprocs"} ); } } sub get_info_modPBS { my ($server, $Nodes, $Jobs, $State_count) = @_; my $con=pbs_connect($server); if ($con <= 0) { printwarning("Connect to $server failed: $PBS::pbs_errno\n"); return; } my $qmgr=pbs_statnode($con, undef, undef, undef); my $qstat=pbs_statjob($con, undef, undef, undef); pbs_disconnect($con); my $jobs; my $status; my $statuses; my $node; my $job; my $name; my $value; my $node=""; foreach (@{$qmgr}) { $node=$_->{name}; delete $Nodes->{$server}{$node}; $Nodes->{$server}{$node}{seen}=1; $State_count->{_nodes}++; foreach (@{ $_->{attribs} }) { $name=$_->{name}; $value=$_->{value}; $name eq $PBS::ATTR_NODE_np and do { $Nodes->{$server}{$node}{np} = $value; $State_count->{_procs} += $value; $State_count->{_mprocs} = $State_count->{_mprocs} > $value ? $State_count->{_mprocs} : $value; }; $name eq $PBS::ATTR_NODE_state and do { $Nodes->{$server}{$node}{state} = $value; $State_count->{$value}++; }; $name eq $PBS::ATTR_NODE_properties and $Nodes->{$server}{$node}{properties} = $value; $name eq $PBS::ATTR_NODE_ntype and $Nodes->{$server}{$node}{ntype} = $value; $name eq $PBS::ATTR_NODE_jobs and do { $State_count->{"_anodes"}++; foreach my $job ( split ( /, /, $value ) ) { if ( $job =~ m{(\d+)/(\d+)} ) { $Nodes->{$server}{$node}{job}{$1} = $2; $State_count->{"_aprocs"}++; } } }; $name eq $PBS::ATTR_NODE_status and do { foreach my $status ( split ( /,/, $value ) ) { if ( $status =~ m{(.+)=(.+)} ) { $Nodes->{$server}{$node}{status}{$1} = $2; } } }; } } my $job; foreach (@{ $qstat }) { ( $job = $_->{name} ) =~ s/\..*//; $Jobs->{$job}{seen}=1; foreach (@{ $_->{attribs} }) { $_->{name} eq $PBS::ATTR_server and $Jobs->{$job}{server} = $_->{value}; $_->{name} eq $PBS::ATTR_owner and ($Jobs->{$job}{user} = $_->{value})=~s/\@.*//; $_->{name} eq $PBS::ATTR_queue and $Jobs->{$job}{queue} = $_->{value}; $_->{name} eq $PBS::ATTR_N and $Jobs->{$job}{jname} = $_->{value}; $_->{name} eq "$PBS::ATTR_l.nodect" and $Jobs->{$job}{ncount} = $_->{value}; $_->{name} eq "$PBS::ATTR_l.walltime" and $Jobs->{$job}{reqt} = $_->{value}; $_->{name} eq $PBS::ATTR_state and $Jobs->{$job}{state} = $_->{value}; $_->{name} eq "$PBS::ATTR_used.walltime" and $Jobs->{$job}{elpt} = $_->{value}; } if (exists $Jobs->{$job}{state} and $Jobs->{$job}{state} eq "R") { $State_count->{"_rjobs"}++; } $State_count->{"_njobs"}++; } } sub get_info_cmdline { my ($server, $Nodes, $Jobs, $State_count) = @_; my @qmgr = `$qmgr -c 'l n \@$server' $server 2>/dev/null`; # find out everything $? and do { printwarning("Connection to $server failed.") }; my @qstat = `$qstat -a \@$server 2>/dev/null`; $? and do { printwarning("Connection to $server failed.") }; my $jobs; my $eatingjobs=0; my $status; my $statuses; my $eatingstatus=0; my $node=""; foreach (@qmgr) { chomp; #FIXME# Should store node names in an array to preserve order. if (/^Node /) { $node = $'; delete $Nodes->{$server}{$node}; $Nodes->{$server}{$node}{seen}=1; $State_count->{_nodes}++; $eatingjobs=0; $eatingstatus=0; } elsif (/\s+np = (.*)/) { $Nodes->{$server}{$node}{np} = $1; $State_count->{_procs} += $1; $State_count->{_mprocs} = $State_count->{_mprocs} > $1 ? $State_count->{_mprocs} : $1; $eatingstatus=0; $eatingjobs=0; } elsif (/\s+properties = (.*)/) { $Nodes->{$server}{$node}{properties} = $1; $eatingstatus=0; $eatingjobs=0; } elsif (/\s+ntype = (.*)/) { $Nodes->{$server}{$node}{ntype} = $1; $eatingstatus=0; $eatingjobs=0; } elsif (/\s+state = (.*)/) { $Nodes->{$server}{$node}{state} = $1; $State_count->{$1}++; $eatingstatus=0; $eatingjobs=0; } elsif (/\s+jobs = (.*)/) { $eatingjobs=1; $eatingstatus=0; $jobs = $1; $State_count->{"_anodes"}++; foreach my $job ( split ( /, /, $jobs ) ) { if ( $job =~ m{(\d+)/(\d+)} ) { $Nodes->{$server}{$node}{job}{$1} = $2; $State_count->{"_aprocs"}++; } } } elsif (/\s+status = (.*)/) { $eatingstatus=1; $eatingjobs=0; $statuses = $1; foreach my $status ( split ( /,/, $statuses ) ) { if ( $status =~ m{(.+)=(.+)} ) { $Nodes->{$server}{$node}{status}{$1} = $2; } } } elsif ($eatingjobs) { if ($_ =~ /\w/) { /^\s+(.*)$/; $jobs = $1; foreach my $job ( split ( /, /, $jobs ) ) { if ( $job =~ m{(\d+)/(\d+)} ) { $Nodes->{$server}{$node}{job}{$1} = $2; $State_count->{"_aprocs"}++; } } } else { $eatingjobs=0; } } elsif ($eatingstatus) { if ($_ =~ /\w/) { /^\s+(.*)$/; $statuses = $1; foreach my $status ( split ( /,/, $statuses ) ) { if ( $status =~ m{(.+)=(.+)} ) { $Nodes->{$server}{$node}{status}{$1} = $2; } } } else { $eatingstatus=0; } } } my $job; foreach (@qstat) { my @qs = split ( " ", $_ ); if ( scalar @qs == 11 and $qs[0] =~ /^\d+/ ) { ( $job = $qs[0] ) =~ s/(\d+)\.[a-z0-9A-Z-.]+/$1/; ( $server = $qs[0] ) =~ s/\d+\.([a-z0-9A-Z-.]+)/$1/; $Jobs->{$job}{seen}=1; $Jobs->{$job}{server} = $server; $Jobs->{$job}{user} = $qs[1]; $Jobs->{$job}{queue} = $qs[2]; $Jobs->{$job}{jname} = $qs[3]; $Jobs->{$job}{ncount} = $qs[5]; $Jobs->{$job}{reqt} = $qs[8]; $Jobs->{$job}{state} = $qs[9]; $Jobs->{$job}{elpt} = $qs[10]; $qs[9] eq "R" and $State_count->{"_rjobs"}++; $State_count->{"_njobs"}++; } } } sub update_display { my $foo; move( $pad, 0, 0 ); getmaxyx( $Y, $X ); $y = 0, $x = 0; $show_summary and show_state_summary( $_[0] ); $show_grid and show_grid( $_[2], $_[1], $_[3], $_[4] ); $show_queue and show_queue( $_[2] ); $show_grid and addstr( $pad, ++$y, 0, "[?] unknown [@] busy [*] down [.] idle [%] offline [!] other" ); getyx( $pad, $ly, $foo ); clrtobot($pad); pnoutrefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); mvwin( $cmdwin, $Y - 1, 0 ); refresh($cmdwin); update_subwin(@_); doupdate(); } sub show_state_summary { my $t = 1; my $t2 = 1; addstr $pad, sprintf( "Usage Totals: %d/%d %s, %d/%d %s, %d/%d %s", ${ $_[0] }{_aprocs}, ${ $_[0] }{_procs}, "Procs", ${ $_[0] }{_anodes}, ${ $_[0] }{_nodes}, "Nodes", ${ $_[0] }{_rjobs}, ${ $_[0] }{_njobs}, "Jobs Running" ); my ( $y1, $x1 ); getyx( $pad, $y1, $x1 ); addstr $pad, " " x ( $X - $x1 - 8 ); # Asbed asked for the time addstr $pad, sprintf( "%02d:%02d:%02d", ( localtime() )[ 2, 1, 0 ] ); my $line; my @states = sort grep !/^_/, keys %{ $_[0] }; if ( $compact_summary ) { move( $pad, ++$y, $x = 0 ); addstr( $pad, 1, 0, "Node States:" ); for ( my $i = 0 ; defined $states[$i] ; $i++ ) { $line= " ".${ $_[0] }{ $states[$i] }." ". $states[$i]; $line.= defined $states[$i+1] ? "," : ""; getyx( $pad, $y1, $x1 ); if ( $X-$x1-1 < length($line) ) { clrtoeol($pad); move( $pad, ++$y, $x = 0 ); addstr ($pad, " " x 12); } addstr ($pad, $line); } move( $pad, ++$y, $x = 0 ); clrtoeol($pad); } else { for ( my $i = 0 ; defined $states[$i] ; $i++ ) { move( $pad, ++$y, $x = 0 ); $line = " " x 14; $line.= sprintf( "%4s %-20s", ${ $_[0] }{ $states[$i] }, $states[$i] ); $i++; $line .= sprintf( "%4s %-20s", ${ $_[0] }{ $states[$i] }, $states[$i] ) if defined $states[$i]; $line .= " " x ( $X - ( length($line) + 14 ) ); clrtoeol($pad); addstr $pad, $line; } addstr( $pad, 1, 0, "Node States:" ); move( $pad, ++$y, $x = 0 ); } } sub show_grid { my ( $jobs, $allnodes, $maxlen, $maxprocs ) = @_; my ( $foo, $tmpx ); $lx = 0; clrtoeol($pad); move( $pad, ++$y, $x = 0 ); if ( !scalar @show_cpu ) { addstr $pad, " No CPUs selected!"; clrtoeol($pad); return; } printvcpuline($maxlen); foreach my $server (keys %$allnodes ) { my (@cluster, @ts); foreach my $node ( sort keys %{$allnodes->{$server}} ) { $$allnodes{$server}{$node}{np} > $maxnodegrid ? push(@ts, $node) : push(@cluster, $node); } # loop through each node, in lines and columns my $col = 0; if(defined $cluster[0]) { my $headerspaces = scalar @show_cpu; printnumberline ( $maxlen, $headerspaces, $columns ); printdashline( $maxlen, $headerspaces, $columns ); foreach my $node ( @cluster ) { $col = 0 if $col >= $columns; (addstr $pad, sprintf " %${maxlen}s ", $node) if $col == 0; addstr $pad, " " if ( $col != 0 and $col % 10 == 0 ); foreach my $this_cpu (@show_cpu) { if ( $this_cpu > $$allnodes{$server}{$node}{np} - 1 ) { addstr $pad, " "; } else { my $state = $$allnodes{$server}{$node}{state}; if (exists $$allnodes{$server}{$node}{job}{$this_cpu}) { my $job = $$allnodes{$server}{$node}{job}{$this_cpu}; if (exists $$jobs{$job} and exists $$jobs{$job}{letter} and ($show_user ? $show_user =~ /\b$$jobs{$job}{user}\b/ : 1)) { my $letter= $$jobs{$job}{letter}; my $color = $$jobs{$job}{color}; my $underline = $jobs->{$job}{underline}; printcpustate($job, $letter, $state, $color, $underline); } else { # The job was deleted in between the time we captured # the node info and the job info from pbs. printcpustate(0,0,$state,0,0); } } else { printcpustate(0,0,$state,0,0); } } } addstr $pad, " "; $col++; getyx( $pad, $foo, $tmpx ); $lx = $lx > $tmpx ? $lx : $tmpx; clrtoeol($pad); move( $pad, ++$y, $x = 0 ) if $col >= $columns; #return if $y >= $Y; } clrtoeol($pad); move( $pad, ++$y, $x = 0 ) if $col != $columns; printdashline( $maxlen, $headerspaces, $columns ); clrtoeol($pad); move( $pad, ++$y, $x = 0 ); } foreach my $node (@ts) { my $headerspaces=1; printnumberline ( $maxlen, $headerspaces, $columns ); printdashline( $maxlen, $headerspaces, $columns ); my $col = 0; foreach my $this_cpu (0 .. $$allnodes{$server}{$node}{np}-1) { $col = 0 if $col >= $columns; (addstr $pad, sprintf " %${maxlen}s ", $node) if $col == 0; addstr $pad, " " if ( $col != 0 and $col % 10 == 0 ); my $state = $$allnodes{$server}{$node}{state}; if (exists $$allnodes{$server}{$node}{job}{$this_cpu}) { my $job = $$allnodes{$server}{$node}{job}{$this_cpu}; if (exists $$jobs{$job} and exists $$jobs{$job}{letter} and ($show_user ? $show_user =~ /\b$$jobs{$job}{user}\b/ : 1)) { my $letter= $jobs->{$job}{letter}; my $color = $jobs->{$job}{color}; my $underline = $jobs->{$job}{underline}; printcpustate($job, $letter, $state, $color, $underline); } else { printcpustate(0,0,$state,0,0); } } else { printcpustate(0,0,$state,0,0); } addstr $pad, " "; $col++; getyx( $pad, $foo, $tmpx ); $lx = $lx > $tmpx ? $lx : $tmpx; clrtoeol($pad); move( $pad, ++$y, $x = 0 ) if $col >= $columns; } clrtoeol($pad); move( $pad, ++$y, $x = 0 ) if $col != $columns; printdashline( $maxlen, 1, $columns ); clrtoeol($pad); move( $pad, ++$y, $x = 0 ); } } clrtoeol($pad); } # Print out the job queue sub show_queue { my $jobs = shift; move( $pad, ++$y, $x = 0 ); #return if $y >= $Y; attron( $pad, A_BOLD ); addstr( $pad, " Job# Username Queue Jobname Nodes S Elapsed/Requested" ); attroff( $pad, A_BOLD ); clrtoeol($pad); move( $pad, ++$y, $x = 0 ); # Note: we never print our the server name, it is expected that the user will # recognize jobs by their jobid or queue name. foreach my $job ( # Sort first by server, then by queue, last by jobid sort { defined $jobs->{$a}{server} && defined $jobs->{$b}{server} && $jobs->{$a}{server} cmp $jobs->{$b}{server} or defined $jobs->{$a}{queue} && defined $jobs->{$b}{queue} && $jobs->{$a}{queue} cmp $jobs->{$b}{queue} or $a <=> $b } keys %{$jobs} ) { my $l = $jobs->{$job}{letter}; my $color = $jobs->{$job}{color}; my $underline = $jobs->{$job}{underline}; if ( defined $jobs->{$job}{user} ) { next unless $show_user ? $show_user =~ /\b$jobs->{$job}{user}\b/ : 1; if ( !( $jobs->{$job}{state} =~ /Q|H/ and !$show_qqueue ) ) { addstr $pad, " "; if ( defined $l and $jobs->{$job}{state} eq "R" ) { print_colored_letter($l, $color, $underline); addstr $pad, " = "; } else { addstr $pad, " "; } # The job is erroring, grab an eyeball if ($jobs->{$job}{state} eq "E") { attron($pad, A_REVERSE); } addstr $pad, sprintf( "%-5s %-8.8s %-8.8s %-10.10s %5.5s %1s %8.8s/%8.8s ", $job, $jobs->{$job}{user}, $jobs->{$job}{queue}, $jobs->{$job}{jname}, exists $jobs->{$job}{ncount} ? $jobs->{$job}{ncount} : "", $jobs->{$job}{state}, exists $jobs->{$job}{elpt} ? $jobs->{$job}{elpt} : "", exists $jobs->{$job}{reqt} ? $jobs->{$job}{reqt} : ""); if ($jobs->{$job}{state} eq "E") { attroff($pad, A_REVERSE); } clrtoeol($pad); move( $pad, ++$y, $x = 0 ); } } } clrtoeol($pad); } # Pass in a reference to all jobs, and we'll assign a letter to each one. sub letterize { my $Jobs = shift; # The original pbstop only used one letter per job, and this info was held # in %Job_of_letter. Now that we've thrown out that limitation, it is only # used to note the fact that _someone_ is using that letter. If a job gets # a letter that is already assigned, the second one will be noted in # %Job_of_letter, but that's ok because we don't care _who_ has that letter. # remove info about old jobs and jobs already assigned a letter foreach my $l ( keys %Job_of_letter ) { delete $Job_of_letter{$l} if ( exists $Jobs->{ $Job_of_letter{$l} }{user} ); } # pick a letter if not already choosen foreach my $job ( keys %{$Jobs} ) { next if !defined $Jobs->{$job}{state}; next if $Jobs->{$job}{state} eq "Q"; my $user = $Jobs->{$job}{user}; if ( !exists $Jobs->{$job}{letter} ) { # find a letter that isn't already taken my $l = substr( $user, 0, 1 ); if ( exists $Job_of_letter{$l} ) { $l = uc($l); if ( exists $Job_of_letter{$l} ) { if (length $letters <= 0) { # replenish our supply of letters $colorize or printwarning("Reusing letters on B&W terminal."); $letters = $masterletters; $underline=!$underline; } $letters =~ s/(.)//; $l = $1; } } $Job_of_letter{$l} = $job; $Jobs->{$job}{letter} = $l; $Jobs->{$job}{underline} = $underline; $letters =~ s/$l//; } } } # Pass in a reference to all jobs, and we'll assign a color to each one. sub colorize { my $Jobs = shift or return; foreach my $job ( keys %{$Jobs} ) { next if defined $Jobs->{$job}{color}; scalar @Colors == 0 and @Colors = init_colors(); $Jobs->{$job}{color} = shift @Colors; } } # This sucks, I wanted to seperate printing from colors, # but I can't just pass back color escape strings. # I'm forced to combine them here. sub print_colored_letter { my ($letter, $color, $underline) = @_; $colorize or do { addstr $pad, $letter; return }; attron( $pad, A_BOLD | COLOR_PAIR( $color ) | ($underline && A_UNDERLINE) ); addstr $pad, $letter; attroff( $pad, A_BOLD | COLOR_PAIR( $color ) | ($underline && A_UNDERLINE) ); } # Used to find the longest hostname to align the left side of the node grid sub getmaxkeylen { my $maxlen = 0; my $server; foreach $server ( keys %{ $_[0] } ) { foreach ( keys %{${ $_[0] }{$server}} ) { $maxlen = length($_) > $maxlen ? length($_) : $maxlen; } } return $maxlen; } # This is each character inside the node grid. sub printcpustate { my ($job, $letter, $state, $color, $underline) = @_; if ($job) { printwarning("$job has no letter") unless $letter; $letter='&' unless $letter; } #FIXME# I'm ignoring job-sharing here because I've never seen it used. #FIXME# It would be more correct to use the constants defined in #FIXME# pbs_ifl.h, but that would break compatibility with non-perl-PBS #FIXME# environs. if ( $state =~ /down/ and $job ) { print_colored_letter( $letter, $color, $underline ); } elsif ( $job and $show_jobs ) { print_colored_letter( $letter, $color, $underline ); } elsif ( $state =~ /offline/ ) { addch $pad, "%"; } elsif ( $state =~ /down/ ) { print_colored_letter( "*", 1, 0 ); # 1 is red on black } elsif ( $state =~ /job-exclusive/ ) { addch $pad, '@'; } elsif ( $state =~ /busy/ ) { addch $pad, "@"; } elsif ( $state =~ /reserve/ ) { addch $pad, "@"; } elsif ( $state =~ /unknown/i ) { print_colored_letter( "?", 1, 0 ); } elsif ( $state =~ /free/ ) { addch $pad, "."; } else { print_colored_letter( "!", 1, 0 ); } } # Print the list of visible CPUs above the node grid. sub printvcpuline { my $maxlen=shift; # inform the user of the visible CPUs. if ( scalar @show_cpu == 1 ) { addstr $pad, " CPU $show_cpu[0]" . " " x ( $maxlen - 4 ); } #elsif ( scalar @show_cpu == $maxprocs ) { #addstr " " . " " x ($maxlen); #} else { addstr $pad, " " x ( $X - 1 ); move( $pad, $y, 0 ); addstr $pad, " visible CPUs: " . join ( ",", @show_cpu ); } clrtoeol($pad); move( $pad, ++$y, $x = 0 ); } # Print the line of dashes above and below the node grid. sub printdashline { my $maxlen = shift; my $spaces = shift; my $columns = shift; my $line = " " . " " x $maxlen; for ( my $i = 0 ; $i < $columns ; $i++ ) { $line .= "--" if ( $i != 0 and $i % 10 == 0 ); $line .= "-" . "-" x $spaces; } $line =~ s/-$//; # oops, we printed one extra, erase it addstr $pad, $line; clrtoeol($pad); move( $pad, ++$y, $x = 0 ); } # Print the repetitive line of numbers along the top of the node grid. sub printnumberline { my $maxlen = shift; my $spaces = shift; my $columns = shift; my $line = " " . " " x $maxlen; for ( my $i = 0, my $j = 0 ; $i < $columns ; $i++, $j++ ) { if ( $i != 0 and $i % 10 == 0 ) { $line .= " "; $j = 0; } $line .= ( ( $j + 1 ) % 10 ) . " " x $spaces; } addstr $pad, $line; clrtoeol($pad); move( $pad, ++$y, $x = 0 ); } # This is used in top_sleep to annoy the user. sub printwarning { attron( $cmdwin, A_REVERSE ); addstr $cmdwin, 0, 0, join(" ", @_); attroff( $cmdwin, A_REVERSE ); refresh($cmdwin); } # This is used in top_sleep to solicit the user. sub getstring { my $input=""; my $ch; my $x=0; addstr $cmdwin, 0, 0, join(" ", @_); $x=length join(" ", @_); clrtoeol($cmdwin); refresh($cmdwin); echo; nodelay( $cmdwin, 0 ); #getstr( $cmdwin, $input ); $ch=getch($cmdwin); while (1) { $ch=getch($cmdwin); if ($ch eq ERR) { # ERR returned on timeout next; # why is this so freaking complicated?? } elsif ($ch eq KEY_BACKSPACE or $ch eq KEY_DC or $ch eq $CTRL_H) { if (length $input) { $x--; move($cmdwin, 0, $x); delch($cmdwin); refresh($cmdwin); $input=~s/.$// ; } elsif ($ch eq KEY_BACKSPACE) { move($cmdwin, 0, $x); } } elsif ($ch eq $CTRL_G) { # user abort $input=""; last; } elsif ($ch eq "\n") { last; } else { $x++; $input.=$ch; } } noecho; move( $cmdwin, 0, 0 ); clrtoeol($cmdwin); refresh($cmdwin); return $input; } sub print_serverstatus_window { my $server=shift; if (!$use_perlPBS) { destroy_subwin(); printwarning("This information is not available without perl-PBS"); return; } my $con=pbs_connect($server); if ($con <= 0) { destroy_subwin(); printwarning("Connect to $server failed: $PBS::pbs_errno\n"); return; } my $ref=pbs_statserver($con, undef, undef); pbs_disconnect($con); print_status_window("$server", $ref->[0]->{attribs}); } # since we don't store enough info about jobs in %Jobs, go ahead and get # it from the server sub print_jobstatus_window { my $job=shift; my $server=shift; if (!$use_perlPBS) { destroy_subwin(); printwarning("This information is not available without perl-PBS"); return; } my $con=pbs_connect($server); if ($con <= 0) { destroy_subwin(); printwarning("Connect to $server failed: $PBS::pbs_errno\n"); return; } my $ref=pbs_statjob($con, "$job.$server", undef, undef); pbs_disconnect($con); print_status_window("$job.$server", $ref->[0]->{attribs}, "'l' for node load report"); } sub print_jobloadstatus_window { my $job=shift; my $server=shift; my $allnodes=shift; my @loads; my $value; my $freephys; my $sessions; foreach $server ( sort keys %{ $allnodes } ) { NODE: foreach my $node ( sort keys %{$allnodes->{$server}} ) { foreach my $this_cpu (0 .. $allnodes->{$server}{$node}{np}-1) { if (exists $allnodes->{$server}{$node}{job}{$this_cpu} and exists $allnodes->{$server}{$node}{status}{loadave}) { if ($job eq $allnodes->{$server}{$node}{job}{$this_cpu}) { $value ="load: ".$allnodes->{$server}{$node}{status}{loadave}; { # yes, I'm TOTALLY cheating here. Sue me. local $^W=0; $freephys=int(($allnodes->{$server}{$node}{status}{physmem} - ($allnodes->{$server}{$node}{status}{totmem} - $allnodes->{$server}{$node}{status}{availmem}))/1024); $sessions=($allnodes->{$server}{$node}{status}{nsessions} =~ /^\?/) ? 0 : $allnodes->{$server}{$node}{status}{nsessions}; #: scalar (split / /,$allnodes->{$server}{$node}{status}{sessions}); $value.=" physmem: ".int($allnodes->{$server}{$node}{status}{physmem}/1024)."MB"; $value.=" avail: ${freephys}MB"; $value.=" sessions: $sessions"; } push(@loads, { name => $node, value => $value }); next NODE; } } } } } if (scalar @loads < 1) { push(@loads, { name => "load report", value => "The job has ended, or the server is too old"}); } print_status_window("$job Load Report", \@loads, "'l' for job details"); } # We already have everything we need to know about nodes in our big Nodes # struct, so just pull info from there. sub print_nodestatus_window { my $nodename=shift or return; my $ref=shift or return; my (@attrs, $name, $value); while (($name, $value) = each %{$ref->{status}}) { push(@attrs, { name => $name, value => $value }); } push(@attrs, { name => "ntype", value => $ref->{ntype} }); push(@attrs, { name => "state", value => $ref->{state} }); if (exists $ref->{properties}) { push(@attrs, { name => "properties", value => $ref->{properties} }); } #FIXME# only offer the 'j' option when only one job running, and not just on CPU0 my $multiplejob=0; foreach my $cpu ( sort {$multiplejob||=$ref->{job}{$a}!=$ref->{job}{$b};$a <=> $b} keys %{$ref->{job}}) { push(@attrs, { name => "CPU$cpu: job#", value => $ref->{job}{$cpu} }); } #push(@attrs, { name => "multiple", value => $multiplejob }); print_status_window("$nodename", \@attrs, "'j' for job details on CPU0"); } # This is used by the 4 subs above here to actually paint the subpad sub print_status_window { my $title=shift; my $ref=shift; my $epilogue=shift; my $line=1; my $string; my $maxlinelen; my $pat; my $indent; my $name; my $value; # this subwin's width is 10 fewer than the main win, and with 2 chars padding inside, # each line will be 14 chars fewer than the width of the main window. #FIXME# do we need to properly destroy the subpads? $subwin = subpad( $pad, $maxcolumns-4, $X-10, 2, 5 ); $subwin or die; move($subwin, $line, 0); clrtoeol($subwin); move($subwin, $line, 2); foreach my $attr ( @{$ref}) { $name=$attr->{name}; $value=$attr->{value}; $indent=length($name)+2+3; # 2 for padding, 3 for " = " $maxlinelen=($X-14)-$indent; $pat=".{1,$maxlinelen}"; addstr($subwin, $name." = "); $string=$value; if ( (length($string)+$indent) > $maxlinelen) { while (length($string)) { move ($subwin, $line, $indent); $string=~s/($pat)// or die "can't match '$string' with '$pat'"; addstr $subwin, "$1"; clrtoeol($subwin); move($subwin, ++$line, 0); clrtoeol($subwin); move($subwin, $line, 2); $indent=7; $maxlinelen=($X-14)-$indent; $pat=".{1,$maxlinelen}"; } move($subwin, $line, 0); clrtoeol($subwin); move($subwin, $line, 2); } else { addstr $subwin, $string; clrtoeol($subwin); move($subwin, ++$line, 0); clrtoeol($subwin); move($subwin, $line, 2); } } move($subwin, ++$line, 0); clrtoeol($subwin); move($subwin, $line, 2); if (defined $epilogue) { addstr $subwin, "'q' to exit $epilogue"; } else { addstr $subwin, "'q' to exit this window"; } move($subwin, ++$line, 0); clrtoeol($subwin); # make a nice box window border for our output resize($subwin, $line+2, $X-10); attron( $subwin, COLOR_PAIR( 1 )); box($subwin, &ACS_VLINE, &ACS_HLINE); move($subwin, 0, 3); addch($subwin, &ACS_RTEE); addstr $subwin, "$title"; addch($subwin, &ACS_LTEE); attroff( $subwin, COLOR_PAIR( 1 )); $subY=$line+4; $subX=$X-10; # currently not used (since the subwin is always smaller than the terminal) } sub update_subwin { $subwin or return; if ($searchobject{TYPE} eq "SERVER") { print_serverstatus_window($searchobject{VALUE}); } elsif ($searchobject{TYPE} eq "NODE") { print_nodestatus_window($searchobject{VALUE}, $_[1]->{$searchobject{SERVER}}{$searchobject{VALUE}}); } elsif ($searchobject{TYPE} eq "JOB") { print_jobstatus_window($searchobject{VALUE}, $searchobject{SERVER}); } elsif ($searchobject{TYPE} eq "JOBLOAD") { print_jobloadstatus_window($searchobject{VALUE}, $searchobject{SERVER}, $_[1]); } else { printwarning("oddly, I'm on line ".__LINE__); } pnoutrefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } sub destroy_subwin { $subwin=0; %searchobject=(); $subY=0; $subX=0; if ($py >= $ly - $Y + 2) { $py = $ly - $Y + 3; pnoutrefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } } #FIXME# top_sleep() is a kludge, I know it... It just keeps growing #FIXME# as I add new commands. *shrug* sub top_sleep { my $targettime = time() + $sleeptime; while ( time() < $targettime ) { halfdelay(1); my $input = getch($cmdwin); if ($SIGWINCH) { $SIGWINCH=0; endwin; refresh(); update_display(@_); } if ( defined $input ) { if ( $input eq "q" ) { if ($subwin) { destroy_subwin(); update_display(@_); } else { endwin; exit(0); } } # why doesn't curses do this automatically?? elsif ( $input eq $CTRL_L ) { clear($pad); clrtoeol($cmdwin); update_display(@_); } #FIXME# $helpwin should be a scrollable pad elsif ( $input eq "h" || $input eq "?" ) { my $helpwin = newwin( 0, 0, 0, 0 ); attron( $helpwin, A_REVERSE|COLOR_PAIR(6) ); addstr $helpwin, "pbstop v$VERSION"; attroff( $helpwin, A_REVERSE|COLOR_PAIR(6) ); if ($use_perlPBS) { addstr $helpwin, " Backend: PBS $PBS::VERSION " . ($^W ? "(testing mode)" : ""); } else { addstr $helpwin, " Backend: cmdline utils (perl-PBS not installed)"; } move( $helpwin, 2, 0 ); addstr $helpwin, "Seconds Refresh "; attron( $helpwin, A_BOLD ); addstr $helpwin, "$sleeptime"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nGrid Columns "; attron( $helpwin, A_BOLD ); addstr $helpwin, "$columns"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nColorization "; attron( $helpwin, A_BOLD ); addstr $helpwin, $colorize ? "on" : "off"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nState Summary Display "; attron( $helpwin, A_BOLD ); addstr $helpwin, $show_summary ? "on" : "off"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nGrid Display "; attron( $helpwin, A_BOLD ); addstr $helpwin, $show_grid ? "on" : "off"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nGrid Job Display "; attron( $helpwin, A_BOLD ); addstr $helpwin, $show_jobs ? "on" : "off"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nShow CPU Number "; attron( $helpwin, A_BOLD ); addstr $helpwin, join ( " ", @show_cpu ); attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nQueue Display "; attron( $helpwin, A_BOLD ); addstr $helpwin, $show_queue ? "on" : "off"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nShow Queued Jobs "; attron( $helpwin, A_BOLD ); addstr $helpwin, $show_qqueue ? "on" : "off"; attroff( $helpwin, A_BOLD ); addstr $helpwin, "\nNumber of possible colors "; attron( $helpwin, A_BOLD ); addstr $helpwin, $COLOR_PAIRS; attroff( $helpwin, A_BOLD ); if ($show_user) { addstr $helpwin, "\nLimiting job view to "; attron( $helpwin, A_BOLD ); addstr $helpwin, $show_user; attroff( $helpwin, A_BOLD ); } addstr $helpwin, <<"__EOHELP__"; Interactive commands are: space Update Display / Search for a server, node, or job and display details q Quit h Print this help c Grid Columns u Limit view to specific users' jobs s Seconds to refresh, accepts math operators (ie: 2*60) C Toggle Colorization S Toggle State Summary G Toggle Grid Display Q Toggle Queue Display t Toggle Queued Jobs in Queue Display J Toggle Show Jobs in Grid 0-9 CPU number to display l Node load report Press any key to continue... __EOHELP__ refresh($helpwin); # wait for the user to hit the any key. cbreak; nodelay( $helpwin, 0 ); getch($helpwin); halfdelay(1); prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); move( $cmdwin, 0, 0 ); clrtoeol($cmdwin); refresh($cmdwin); delwin($helpwin); } # change the visible CPUs #FIXME# Don't allow the user to display CPUs that don't exist on any node elsif ( $input =~ /^\d$/ ) { if ( grep /^$input$/, @show_cpu ) { @show_cpu = grep !/$input$/, @show_cpu; } else { my %seen = (); foreach ( @show_cpu, $input ) { $seen{$_} = 1; } @show_cpu = sort keys %seen; } update_display(@_); } elsif ( $input eq "s" ) { $input=getstring("Number of seconds for refresh[$sleeptime]? "); if ($input) { my $tmp; # *grin* I love this use of eval if ( $tmp = eval $input and $tmp > 0 ) { $sleeptime = $tmp; $targettime = time() + $sleeptime; } else { printwarning("Invalid number!"); } } } elsif ( $input eq "c" ) { $input=getstring("Number of columns[$columns]? "); if ($input) { if ( $input =~ /^\d+$/ and $input > 0 ) { $columns = $input; update_display(@_); } else { printwarning("Invalid number!"); } } } elsif ( $input eq "u" ) { $input=getstring("Limit view to \"all\", \"me\", a or username? "); if ($input) { if ($input eq "all" or $input eq "a") { $show_user=0; } elsif ($input eq "me" or $input eq "m") { $show_user=$ENV{USER}; } elsif ($input =~ /^\+(.*)/) { if ($1 eq "me" or $1 eq "m") { $show_user.= " ".$ENV{USER}; } else { $show_user.= " $1"; } $show_user =~ s/^ / /g; } elsif ($input =~ /^-(.*)/) { if ($1 eq "me" or $1 eq "m") { $show_user =~ s/\b$ENV{USER}\b//; } else { $show_user =~ s/\b$1\b//; } $show_user =~ s/ / /g; $show_user =~ s/^ / /g; $show_user =~ s/ $/ /g; } else { $show_user=$input; } update_display(@_); } } elsif ( $input eq "n" ) { $input=getstring("Node name? "); if ($input) { foreach my $server (%{ $_[1] }) { if ( exists $_[1]->{$server}{$input} ) { print_nodestatus_window($input, $_[1]->{$server}{$input}); } } } } elsif ( $input eq "j" and $subwin and $searchobject{TYPE} eq "NODE" ) { my $jobid=$_[1]->{$searchobject{SERVER}}{$searchobject{VALUE}}{job}{"0"}; $searchobject{TYPE}="JOB"; $searchobject{VALUE}=$jobid; $searchobject{SERVER}=$_[2]->{$jobid}{server}; $py = 0; $px = 0; update_subwin(@_); doupdate(); } elsif ( $input eq "l" ) { if ($subwin and $searchobject{TYPE} eq "JOBLOAD") { # We are currently looking a jobload report detail, immediately switch # this to a job detail window $searchobject{TYPE}="JOB"; $py = 0; $px = 0; update_subwin(@_); doupdate(); } elsif ($subwin and $searchobject{TYPE} eq "JOB") { # We are currently looking at a job detail, immediately switch this # to a jobload report $searchobject{TYPE}="JOBLOAD"; $py = 0; $px = 0; update_subwin(@_); doupdate(); } else { $input=getstring("Job ID Number? "); if ($input) { my @objects=(); my $searchtype=""; my $searchserver=""; # what other information can we extract? if ($input =~ /^\d+$/ ) { $searchtype||="job"; } elsif ($input =~ /^\d+\./ ) { $searchtype||="job"; ($input, $searchserver)=split(/\./, $input, 2); } # we know everything we can, now go find stuff if ($searchtype eq "job") { foreach my $job (%{ $_[2] }) { if ( $input eq $job and (!$searchserver or $_[2]->{$job}{server} =~ /^$searchserver/)) { push(@objects, $job); $searchobject{TYPE}= "JOBLOAD"; $searchobject{SERVER}=$_[2]->{$job}{server}; $searchobject{VALUE}="$job"; } } } # if we have anything useful, go display it if (scalar @objects > 1) { printwarning("Multiple objects found. Please narrow your search."); } elsif (scalar @objects < 1) { printwarning("no objects found"); } elsif (exists $searchobject{TYPE} && defined $searchobject{TYPE}) { $subwin=1; $py = 0; $px = 0; update_subwin(@_); doupdate(); } } } } # Just about all of this should be moved out of here #FIXME# need to unify these searches somehow elsif ( $input eq "/" ) { $input=getstring("Search string? "); if ($input) { my @objects=(); my $searchtype=""; my $searchserver=""; # did the user specify a pattern? if ($input =~ s/^~(.)\s?//) { if ($1 eq "s") { $searchtype="server"; } elsif ($1 eq "j") { $searchtype="job"; } elsif ($1 eq "n") { $searchtype="node"; } else { printwarning("Invalid search pattern"); next; } } # what other information can we extract? if ($input =~ /^\d+$/ ) { $searchtype||="job"; } elsif ($input =~ /^\d+\./ ) { $searchtype||="job"; ($input, $searchserver)=split(/\./, $input, 2); } elsif ($input =~ /^[a-z]+\s+\w/) { $searchtype||="node"; ($input, $searchserver) = split(/\s+/,$input, 2); } # we know everything we can, now go find stuff if ($searchtype eq "job") { foreach my $job (%{ $_[2] }) { if ( $input eq $job and (!$searchserver or $_[2]->{$job}{server} =~ /^$searchserver/)) { push(@objects, $job); $searchobject{TYPE}="JOB"; $searchobject{SERVER}=$_[2]->{$job}{server}; $searchobject{VALUE}="$job"; } } } else { foreach my $server (%{ $_[1] }) { if ( $server =~ /^$input/ and (!$searchtype or $searchtype eq "server")) { push(@objects, $input); $searchobject{TYPE}="SERVER"; $searchobject{SERVER}="$server"; $searchobject{VALUE}="$server"; } if ( exists $_[1]->{$server}{$input} and (!$searchtype or $searchtype eq "node") and (!$searchserver or $server =~ /^$searchserver/)) { push(@objects, $input); $searchobject{TYPE}="NODE"; $searchobject{SERVER}="$server"; $searchobject{VALUE}="$input"; } } } # if we have anything useful, go display it if (scalar @objects > 1) { printwarning("Multiple objects found. Please narrow your search."); } elsif (scalar @objects < 1) { printwarning("no objects found matching $input"); } elsif (exists $searchobject{TYPE} && defined $searchobject{TYPE}) { $subwin=1; $py = 0; $px = 0; update_subwin(@_); doupdate(); } } } #FIXME# had to remove the offline/clear options when I started #FIXME# to support multiple servers. I haven't figured out #FIXME# a decent replacement interface yet #elsif ( $input eq "o" ) { #$input=getstring("Node to mark offline? "); # #if ($input) { #if ( exists $_[1]->{$input} ) { #system( $pbsnodes, "-o", "$input", "-s", "$host" ); #} #else { #printwarning("Invalid nodename!"); #} #} #} #elsif ( $input eq "r" ) { #$input=getstring("Node to clear offline? "); # #if ($input) { #if ( exists $_[1]->{$input} ) { #system( $pbsnodes, "-r", "$input", "-s", "$host" ); #} #else { #printwarning("Invalid nodename!"); #} #} #} # all of these toggles should be self-explanatory elsif ( $input eq "C" ) { $colorize = !$colorize; if ($colorize && !has_colors() ) { printwarning("Terminal doesn't support colors"); $colorize=0; } update_display(@_); } elsif ( $input eq "G" ) { $show_grid = !$show_grid; update_display(@_); } elsif ( $input eq "S" ) { $show_summary = !$show_summary; update_display(@_); } elsif ( $input eq "Q" ) { $show_queue = !$show_queue; update_display(@_); } elsif ( $input eq "t" ) { $show_qqueue = !$show_qqueue; update_display(@_); } elsif ( $input eq "J" ) { $show_jobs = !$show_jobs; update_display(@_); } #FIXME# my home keyboard sends FIND and SELECT instead of HOME and END, weird? elsif ( $input eq KEY_HOME or $input eq KEY_SHOME or $input eq KEY_FIND ) { $py = 0; $px = 0; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq KEY_END or $input eq KEY_SEND or $input eq KEY_SELECT) { $py = ($ly>$subY?$ly:$subY) + 2 - $Y; $px = 0; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq KEY_PPAGE or $input eq KEY_SPREVIOUS or $input eq $CTRL_B) { $py -= $Y -2; $py <= 0 and $py = 0; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq KEY_NPAGE or $input eq KEY_SNEXT or $input eq $CTRL_F) { $py += $Y - 2; $py >= ($ly>$subY?$ly:$subY) - $Y + 2 and $py = ($ly>$subY?$ly:$subY) + 2 - $Y; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq "k" or $input eq KEY_UP ) { $py <= 0 and $py = 0, next; $py--; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq "j" or $input eq KEY_DOWN) { $py >= ($ly>$subY?$ly:$subY) - $Y + 2 and next; $py++; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq "h" or $input eq KEY_LEFT ) { $px <= 0 and $px = 0, next; $px -= 2; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq "l" or $input eq KEY_RIGHT ) { $px >= $lx - $X + 1 and next; $px += 2; prefresh( $pad, $py, $px, 0, 0, $Y - 2, $X - 1 ); } elsif ( $input eq " " ) { addstr $cmdwin, 0, 0, "Updating..."; clrtoeol($cmdwin); refresh($cmdwin); move( $cmdwin, 0, 0 ); clrtoeol($cmdwin); return; } #else { #addstr $cmdwin, 0, 0, ord($input); #} } } } sub readrc { my ($f)=shift or return; return unless (-f $f); open(F, $f) or die "$f: $!\n"; while ($_=) { chomp; s/#.*//; next unless $_; my ($name, $value) = split (/=/); $name =~ s/\s//g; $value =~ s/\s//g; next if (length($name) <=0 or length($value) <=0); if ($name eq "host" or $name eq "show_cpu" ) { # /em cringes eval "\@$name=(\"".join('","', split(',', $value))."\")"; } elsif ($name eq "show_user" ) { eval "\$$name=join(' ', split(',', \"$value\"))"; } else { eval "\$$name=$value"; } } close F; } __END__ =head1 NAME pbstop - monitoring utility for OpenPBS or Torque =head1 SYNOPSIS pbstop [OPTION]... [@hostname]... =head1 DESCRIPTION Draws a full-terminal display of your nodes and jobs. The default grid shows each node's 1st CPU as a single character. The specific character denotes the state of the node or identifies the job running on that CPU. The job listing shows the job name, queue name, state, etc. and, on the far left, the character used to identify nodes in the upper grid. Pressing a number key will toggle the display of that CPU on all of the nodes. This program runs best if the C module is installed. While there are currently no loss of features if it isn't installed, it will run much faster with it. If you are unsure if PBS is installed, run this program, hit C, and look for the B information at the top right. =head1 COMMAND-LINE OPTIONS =over 4 =item B<-s> num seconds between refreshes =item B<-c> num number of columns to display in the grid =item B<-m> num max number of cpus in a node before it gets its own grid =item B<-u> usernames for limiting the view of the grid and job list. Can be a comma-seperated list of usernames or C. C is a pseudonym for the username running pbstop(1). =item B<-C> toggle colorization =item B<-S> toggle state summary display =item B<-G> toggle grid display =item B<-Q> toggle queue display =item B<-t> toggle showing queued jobs in queue display =item B<-[0-9]...> cpu numbers for grid display =item B<-J> toggle jobs in grid display =item B<-V> print version and exit =back =head1 INTERACTIVE COMMANDS Several single-key commands are recognized while pbstop(1) is running. The arrow keys, PageUp, and PageDown keys will scroll the display if it doesn't fit in your terminal. When prompted to type something, ctrl-g can be used to cancel the command. =over 4 =item B Immediately update display =item B Quit pbstop(1) =item B Display help screen, version, and current settings =item B Prompts for the number of columns to display the node grid =item B Prompts for the number of seconds to wait between display updates =item B Prompts for a username. The grid and job listing will be limited to the named user. Input C will remove all limitations (the default), and C will limit to the current username running pbstop(1). If the username or C is prefixed with a C<+> or C<->, the username will be added or removed from the list of usernames to be limited. C and C are shortcuts for C and C. =item B Prompts the user for a search string, for displaying the details of. The search can optionally begin with one of the following pattern specifiers (think: mutt): C<~s> for a server, C<~n> for a node, or C<~j> for a job number. If no pattern specifier is found, pbstop will attempt to find the object that best matches the search string. The string can be a server name, nodename, or a job number. Nodenames can optionally be followed by a space and the server name. Job numbers may optionally be followed by a dot and the server name. If an object is found, a subwindow will be opened displaying details. Hit C to exit the window. When viewing a job detail subwindow, pressing C is a shortcut for jumping directly to the associated job's node load subwindow. (Mnemonic: like using / to search for text in vi or less) =item B Prompts the user for a job id. A B subwindow will be displayed for the given jobid. This subwindow shows the current load average, the physical and available memory, and the number of sessions. Available physical memory will be negative in the event of swapping. If the number of sessions is 0, that might indicate a problem on that node. Pressing C in this subwindow jumps you directly to the associated job detail subwindow; as if the user typed C. (Mnemonic: load average) =item B Toggle the use of the colors in the display =item B Toggle the display of the state summary =item B Toggle the display of the node grid =item B Toggle the display of the job queue =item B Toggle the display of currently queued (not running) jobs in the display. This can reduce the size of the queue display considerably in some environments. (Mnemonic: I don't know, toggle? C was already used for something more important) =item B Toggle the display of job letters in the node grid. This handy because you can see the node state "hidden" behind the job letter. For example, use this to see which nodes are not yet "busy" that have jobs. =item B Toggle display of that CPU number in the display. This is confusing at first, but useful in SMP environments (See SMP section below). =back =head1 STARTUP pbstop(1) has many configuration variables that can set on the command line, interactively, or from configuration files. When pbstop(1) starts, it first initializes these variables with built-in defaults, then reads in F, the reads F<~/.pbstoprc>, and finally parses the command line arguments. Note that several of the command line arguments and interactive commands are toggles, they don't directly set the value of the configuration. In contrast, the configuration files are not toggles. The configuration files may contain following name=value pairs: =over 4 =item B Number of columns in the node grid, positive integer =item B Number of seconds to pause between display updates, positive integer =item B Use colors in the display, 1 or 0 =item B Display the summary at the top of the display, 1 or 0 =item B Show node state summary on one line, 1 or 0 =item B Show the node grid, 1 or 0 =item B Show the job queue, 1 or 0 =item B Show queued (not running) jobs in the queue display, 1 or 0 =item B Show job and color information in the node grid, 1 or 0 =item B Comma seperated list of CPU numbers to display =item B Usernames to limit the view in the grid and job list. Can be a comma-seperated list of users, C, or C. It might be reasonable for a site to have C in F and for admin users to have C in their own F<~/.pbstoprc>. Members of a group might want all of their teammate's usernames in their own F<~/.pbstoprc>. =item B Comma seperated list of hostnames running pbs_server =item B Number of rows in the large scrollable panel =item B Number of columns in the large scollable panel =item B Nodes with more than this number of CPUs will be represented by a seperate grid =back A sample configuration file: # I'm grumpy and don't like color colorize=0 # my 6 CPU machine should get a seperate grid maxnodegrid=5 # all of my Torque servers host=teraserver,bigbird,testhpc =head1 SMP ENVIRONMENTS pbstop(1) was developed with three specific clusters in mind, these are a 1000 node cluster of dual SMP machines, a 64 proc SMP with 16 single node machines, and a 21 node cluster of single procs without nicely numbered hostnames. With this kind of pedigree, pbstop(1) is fairly flexible. By default, the node grid will show the state of the first CPU of 30 nodes in each row. The number of columns in the grid can be shrunk or expanded on the command line with C<-C>, or interactively with C. Additional CPUs can be displayed by pressing the appropriate number key. Using the number keys is confusing at first, but if you try it a few times it will became natural. By default, nodes with 8 or more CPUs are displayed in a seperate grid. The first two clusters mentioned above display well with the defaults. The third is typically displayed with the number of columns set to "1". =head1 FILES =over 4 =item F The global configuration file =item F<~/.pbstoprc> The personal configuration file. =back =head1 ENVIRONMENTAL VARIABLES =over 4 =item PBS_DEFAULT The server's hostname (same as most PBS client commands) =back =head1 SEE ALSO =over 4 =item PBS(3pm), qstat(1B) =back =head1 BUGS The large Job structure uses the servername supplied by the user, the Job structure uses the servername returned by the server... so they don't match up (this makes the jobloadreport imprecise). The curses code is very ineffecient, the screen flickers too much. grep FIXME from pbstop for more! =head1 AUTHOR pbstop(1) was originally written by Garrick Staples Egarrick@usc.eduE. The node grid and lettering concept is from Dennis Smith. Thanks to Egan Ford and the xCAT mailing list for testing and feedback. torque-2.4.16/contrib/qpool.gz0000664000113300011330000000562311272401247013176 00000000000000bJqpoolY{sHߟQ\X&~$ܱu88@-P${UY۳+(~=3z^ bk7ȳ\c@*soL&PzQ.~|?>\D?{8<>9y* e$E. Y@^TJ2K]&)FTq,r< dJ \iG|aq@XP cC n)b\,B(\,L ` <C^7GIG hQ_.D %_  -p+O ` Peq_FiU鐭rI_N2I|OIˏo~fȽiw*7ĒO ?w^Bg2U5L{a ?2dlODp$3Di, 2lS4VN^&7Fޭ=.2'EDLGHxW@ zȜ#"O/Rd^Bb+Ҿ qKG֐DaɈaJj(%]kLc:FYy(" Gӣ0mipRE 8-\')tT0,Egx?)bIBS"ga:`4:~DŽQCrb{3!%G,(5F2Ӄ>'0aCSf6o pa2s@Zޣg >I*^g4Qkh~e|f\DZGޔ?;\;5m<}7)sJ74"'b{z_hʟIJ mwd,Y5r˸ls#~,(s81( ܪ1QpD m6d"TzT5LLYvѠG +sBj"l7,|UU2Wl1y10WOdq?Jv}>1#>V%))zX?=g= Ƅ8|!ORk7 ĥ (3P"\,ç XblI0̸xb!cW`<V1[j2W/:U/:o!1-ʖ)4^*2o|%wNb8@&gJ DGeSPS0 ~i MᴡE3y%QJ/DU!':jqp>3L\(mv yTU AMDiuי3gy?byי-Ss{e:|fko~zU5YhRbH詹_u 6n %!M} KM4 F6HZ*׆,4Ҭic^5YҲ. וVo.Gvo+&*I3pta+w4:=pfC > ևo..|񣙯Ϩ(ut$K*J.p\׼:=[B7,qEԚ}7ĮX pE٤Rg'/%)˗pQ7+rGyt1UgrnW#q}>`2ˏYp,zҨb46yڹ=L𔷟I:bb D2iz]eAѷfޛ۫]( Qxljڅs^ Ǥ=8NSXK zeP% h=Ft7_˪Μ86 rߣW;%dTKKnw_OO? &Np $1~oS ϦP_#{QȂ)Bt-vkڵsO*YOmJT5xtj{8֛v."rFe)+oLSvgt1o iHhk4Ӝw S&\~̚;cbkVSK5=ۺsϿj0CodJy^Hvi*ӽU+EE#Wẑ](whӼ15wG"~\ZJcWKarl?z;./2^$>~@tP 2։VpНi0ʺTӫ|WC;Udb qyЍ.γ~E/t?xoӛq,]a)y/L4F8?}7@@܌" {{T?KD8A4 !~-~ߗ`IA56~ `跠kV{. N.Bg/lke :i0DɆ5Ⱦ"EN]H torque-2.4.16/contrib/README.pbs_python0000664000113300011330000000366411272401247014551 00000000000000# README.pbs_python # contributed by Bas van der Vlies # updated Dec 1, 2006 The latest stable pbs_python interface is available from: ftp://ftp.sara.nl/pub/outgoing/pbs_python.tar.gz Information, documentation and reporting bugs for the package: https://subtrac.sara.nl/oss/pbs_python ===== Brief description ========================================= Pbs_python interface is a wrapper class for the OPENPBS/TORQUE C LIB API. Now you can write utilities/extensions in Python instead of C. The Python wrapper class is tested on: - Intel cluster debian GNU/LINUX woody/sarge OPENPBS 2.3.16, TORQUE 1.0.1p4, 1.1.0p4 and up - For X86_64 systems you have to compile torque/openpbs with the -fPIC option. Else you can not build the python module - TRU64 system, NOTE: must rename libnet.a to libpbs_net.a and edit setup.py to reflect the change. There is also a system wide libnet.so. - It should run on different OSes. In the past our Alpha cluster was redhat (6.2) and we had to add '-lots' to the LIBS line --- Compile and install the package: (Require python 2.1 and higher) As for python version 1.6 and higher the procedure is: ./configure make make install Debian package: debian/rules binary --- Testing the package: The test programs are include as a reference how to use the pbs python module. You have to edit some test programs to reflect your PBS/Torque installation. pbsmon.py - ascii xpbsmon rack_pbsmon.py - ascii xpbsmon by rack layout pbsnodes-a.py - pbsnodes -a pbs_version.py - print server version set_property.py - set some node properties resmom_info.py - queries the pbs_mom daemon on the nodes logpbs.py - Shows the usage of the PBS logging routines new_interface.py - Example how to use PBSQuery module PBSQuery.py - python /PBSQuery.py (has builtin demo) For more info about SARA see: http://www.sara.nl/index_eng.html torque-2.4.16/contrib/pbsweb-lite-0.95.tar.gz0000664000113300011330000047370511272401247015451 00000000000000pZ@Y \LiۿiO/jT3}F$IBJ%ej$dJ1-)IDI`bay8Szwyﱞ{\sus\uuf"EELMHqM(*ōFC'7ӻ8Q(ήT7 wrqv2/O69%| Sb>lO)ǮZsAR_^Ó#c%E8RŸJuF1wsssu J]Ŝs4MGGGyy9KNN^reHH5a4NM?{T--N@ 4%@ho.ЀG~| B/q`kbAVե}gcJ|d7"Q%\)g xt.'pE:1d"r}aZ-KqY0$xN/^գag9o2z,X~v0sfR3f!!r\C^;uz//d@â_g]r4q_,_s@Q;6񤼥uxk^.$'3 ,5!&'G?8Pdu#wC;V0j2 TXYQLE8~0Gd\`x5>} 繓F<nX8؊lZVeE~|694 ?3 |,70{S˂bVUߛ3%e !cRRᷕs(ấ"yjm,v/Wue jFקs\6.[r4mC;MYcI ɸcHQѣURool՟y 03?Wxdu Z܄cX$=1'?p|})W`+xeMᔃ!ZIf#4oV[ޕu7.o9ZJ2&O!vukyiDn[X.u]@K)^f9 ;<3\Jk utd D1+ QZc_>w(mu9xvЯ)7I HmQɉҦo &9)owQ|!n]Ms^=GX_^rkgFm>z"*8A27`] NpsA}+ k͎A~پL|o,:Er;vaX: [鿘dtH'I`5fMVl ZBo.S9~_C|뛾ӡ;A$\PsAQ8&|Q8"jr(ӾK$Z= { NN[-4/Wʨ%z`獓2LD`mgovn_!|R޸~v"(U4ib c1{ct>qן^+khn.nJ~msKcFobVtoqmU9=2ݡv7۞/u UYfQ WVVrT}`6a%h֟p,{t& 6J!ش5zo_q齿fR:;L=8eECji&zB0HӟYWN%aL7?>#LO\i}ۣG_AC?!HH4Me7Kz pњGdPNoZބ7:2*N gecG'@t.:71PWo] ؀` a@ᆣ ;:/k01Diԁ]9 9(a|iqB'<(70  N-$-[Za< LQR+ B$-C&c^t@id.)˦4,`\ I -қ@Fh|uʹXXD_00nhnAfvw(d;,*#Xwh$Gb@lfø0tbIi.2aR@IMl!<ڳc!Naa'CSa .aZr-t,,X:0Zy!$Zy0,0,Dԁg:-,6$ng*)6>S=>}~ ;a9ǧ0sz)OW'o'.4!t7V!o8|OO;CE" ͜5=mkPO)n*KitMmtwwvvww7K;C6#()rG+e%ږ 5Ax |RV *KL$ L*JR\&V+uJH%)B\ J!RR*V*yJ)TJHBJF*Z-DPFjAA *XDoS*Z:Z:eO&oV(vKhWՊvKR*Uf]jVQ]SUk!Tw!HC>eD@O_}Kiy! DOt[͟@pG8Bއm9Zwd:|'k9ϻB ݞ<FRqCYvw-@alt;F5+^3W-*8GvU]õ:m=wgwX8~ʨwmJXƬh2pYu+!m} w\ٚڱq|?m&3'e6ʞUPvp`m༓doG$ r< LFc[`V\ͻal,F 2h囝Hm;ȒE&{9s>.cW$Aځ3i} 2Jͫ w?ez<m"z``Zgs}曤]:olrHNiIur2sc̝oRIbt^:c|u=n9'0k0H'(sp4j;o[23o-5G6 #猽i5'K,w߉l:!D(nzX4{fp-*l%`/-ywoJS0s$&ouS1SgQh1,>Ga߻їĄO2.n47ٕez`;k V C0vV2C]+ DOv)9fPLpMm]0CCBzzBN !" 5"Ey99w}ﹿ19fYs fcCSڟ϶߿3gQkko~_cD#LkUdoٷ{21kunݻyőo|lLjmOGH~{}/0Ϲθš1ᔶ !#$__" 2A=f?""RwFB}n/  HU)O$_T_ȟUh_m ?J :A=jhbB{3{tekic @ z{`/u"(BpB0 /dB20}W"D #`M{};;fAA{_Ep @_R=!1Q>Dppe BiΛgeX>:y_7r2~uʥ˞އo?Uw'v毉 נCz=>ssxj469N祔_ɟGм#>>wz %FpXWȇw__h*(b-cxrq[1t^PA#/Qkh'|7-ZņT^K=Oad`_G2(8`TBhvNn ū0A0#4y[J:*e)tւ򐒱U]~co]d 8:iG9Pob%\ 镝{vMY Ms̐lEĨ1;q 'y.kI$΂~9t7$xMGmGnc5:ڼ0N7}m` ~#Ó<ſQ b뢴zteLܳ7Gz.;/)kRŤ ^6t1_d-3eM-sd/y$I>eKCWR-80r}\J@J}-z"z՗CW6c@B@MScLPhq5ӀZ. Iu ߦAS! EG䎗~-y|6F΍MHy*ƥ~)gQ/j[g¬<;η W 8hȲ3rZ12\ ;ۗKg#Vl<_9#uR[^?{~Ԫ.S bî8^)s媔lܒ_e٬۶&Z$۫ =S}\2EF[WLZTthoqMڲ>3w4rK _l ezoܙSߦlk|g=3G JԼt:~3f󈒰BCa׹C\k*<^,zT p<`z{iitb=D7YC7H> g[[&Z_hoPB># .YfI_C۟v{\p91NSWӓը2\[W>gW2. xq&²tԣvn 8sLcbU6W,i^%ٯ.ң9ul&>SuFF Ü{Vsa^ -šnI_(nc@ج!Jv.I:N2 ]}"N1JL<Mۺ☛!:=$fl -I#Gq/AxXeS7N}uF'z.ß.;PuM3&nXuu7JѪ;f19euSk- 2myٮf$ 8fsKK^J1'ʳ c hq$FMݹa٢i撐[719X7o~!ᗜ9JH8'G)t vnD)Fӻkפ7`Sr}LmeήȕuY+)e٤SF3&+m鱛j˺"jwz窱ހH)~̡$ZD/+~KoY:Kި\-2Yp$X>&6q׆*;Xlau֒7m:F$. 41me.׶UT7>&<~0㱧uqYWށK\]u;?duɳej\ /Zb8sS̞˵TݫY J>c~LVɺ|-.Ԡ<93v󒍾$y2!Z`áN3쐿 {@knC31,oD'HH,G _C7[,9ateIDsgƊφ&ϟ$TZ/z?a!GX)2cleg0koq1_ īBO'_4H] \쯘{[og9+,Øe7ԯ]T-Yx.Lx [öՃmsW\^/:z4輵H u9 l>=8c-;7]WUˣa#7NIE/E386<G֪s/2F,yl#BĨ*w<;\9؟D rۏ]S1.3鏾4hXdڻhpB97BΪ˚vsV0)F\֓=LUs쵹^+qx{~~y7ћ-/b]3̻|PQg]\v\ígsn==R) B?6 v1@u2KPލLl~ɢÜδ%OeZ-3`x&[_™nQ'ǁhYd:4+&bJeSZ9hg }9䑨rf#~:u<]};rc`#4%/SYJ(t/ ˁTc:ƒ]cRK;d4FG=+ 7jM #y<753z HlZ|s qϯOC[GI{#L}@虵8}l.sgc|ve)` n2QYi,{Ǵ%"sؑӔ:~E\vP+<1E ˳k6w]WKP۾ikNuMBW~Wr)BcLJ2kͰ_s,}MY&⽧x+^gsmf mQ6 Gc ` G/|x^cR+<V5Ѥ۴|ge>EsYlx~H.hP^VF-Ǔ,+y,Z8Y۷wts"-MltZY+2 L zB/|i3&p?.ͦ!WF=2esUϰFh[ԏM,TqnFGW.T8؇qA9 DƛdIy]DˀfKc(PG!v 5B3GVM]OdU 8l?״8 kZM8~kF4jn_;n|ʄ拐h:;q՟,,KlFc 0)H~!rH-'ӴU%iJYAV5`Ӝ\Wn<o!F?a!Dp?D SvbRg@1baZHDŽD}|+`!:–ٖ |ݺnGB3ylTqepH!ךD=K򶵯4L&8D+nCv9htx%=7T3j9t<  xc;_W38tinM:s.*`&vpJ̧g(,uN}ړ$D[2), R/FtiKsW a҅(Fz)G[zpK❟RJ|f~&^%*WpEEqc'':!;YsxL볱w \ZKw',,4 P!eA6 uO잜QQ[u$5<|[yꄦӳ@1D& 3H-}Vs]q9+>%l9nU|M;l?N' :( `~ Ѻ` 7{o?UM?s`Mx8~dwkEzׁr}ʑݷ^&QCq&v4xسnXǢ./9d|+繻3y 3+-BnV\٣]PǮ]'s87KW~xܫ7Gw79C$dEW%?^6Das^y7xXT_Ɍgk!ۻ;GB|5wӃ8/w,ԣfg8͗l^ニNu,=Rռ9/w4looݍ#.^ ='sw/i>_?^|*Vç?Hg+uБ`Yՙ_UǞ:?Y٤ܼDgQgLd^g**V;.7jukW5Cb.޼uOR:1ߊ rUzU.GKoWh\Ԯ  y9?5EtԘdg.Nfs)eԚlm3#[{(wnd Lc,C̸eZ6ueM{ijr .{RK_[Jg?"H>% g.B>d[WZ~{dQT \-dg?mpAM D+QBgsήik{4H&r`6,CYx)ޤA>2&*.J '䇩%&C jgq]Ik93J => BT!òLUCsB9>z 9 š8z&GV RKOӲE⛲|W!*P^1,BIgr`4+e| pDzZbyZ_#Ym"PF|~h&9*QዡdM0;A lyy$W51S#7d ˸br}wXS}l0N2R+5C#hL\V)]{:ȉ?z6YD i:b07B[{t;~m֔g3t=a#Pn 3\m7=Jp(zа5-uAׯAt0{S/>0]i'f&PB/QLalˊ&;E ]|9/)I͚&" vnݽ%n5,q%ggna\)cɒZtmqu_cc7R9o/!kTք;DK&uьaZ#;yŌJeʉnY z(ua"ZP~ 'VU Sf@D f$5-KS`I ]e[3f%9;%mIS Ȁ@ |#BY&;Pl{ Qt˶{⃑h 2yFQc?K:n1~@t4 #'BB재=dsdD䦲CXT*{$ky@9rռ9āO.5cv eEJ=ԼLB"qmM~$ 6ݔaaGgT; :ck>Er1&f+Ԣb7-XӦTa6w9}j|λRd1,}7tb}#˗` =5 ksNڔ>\WerMZa`&Bӱ_(Q]0 C$Rqh`NV訋aLh PN &Ja*REpHz.M:a2d=g%rme3 B0]\lX͖Jp+o7!'!C4 fc7`璪Ipl 6b*TFAuaF1pt HǢ za# X͜Mofi "co!߫J_WS:w; F0=EET5d9;R@|( YmѶh [ptK  ƪ4A@ؓ5bQU:[g0o* HgRDOҡe/I7)/l m`/M(W  Ci:~='lAv{f<<T/P@Yxv0ɦR TFיHX*KɏV+tEC +a/1P,m0UAi"^R dB1&Nhmp`r1m{&xAm_ <50BE!r`HR)[ Z ^tAVF Xҁk 5;3s)4Є0Y$ %kjN3=GXGOm>!"D D޹pKd݁+Hx g0bˁ`,%-X~0 f>A\{l"U)nj`LT0:۹^ 3P~D[>E|`/"`F?)w`/J rXiB!B^ѡQXGDEa-գ"?TVxءw ɣX m؟U3g]ƛ:t80&*IcQ;SCoc ycdju3ebd9>\V-_7( aC.;Dpېa*B# "@Ȣ'~ՎScgzKz7mTlNC[)95. Th /^^{m~PGkm|v=1q$W5" "L'i("T U\@03Ȍe4Á,}44-+n8Fw.IҲZz(۳f"?ܩ<圴N|v,n.iGXD6=smԽ-_\'qd'acOe6@r4>ǮtdBi'YȡB it1nBO6\~103XW*aPIN緽ۏvNڵʒV6 fHU69p@ {YLYI134hݗ"  o;eJ+HE=- ȒƑ ش\G.@X,رBx<-f"Q"X1K#Y5q# X򥴂)rN鈋E-.;|Ώ?:u-%zW5&Cy8򚖇C c|+Fy &Q4 w `J0RbTCF &5C!ކ!8?JY0^8dH (-`4? ɵb$^M|vv<}>z(>r6@_ؿLÁ^\G5(vu{S\<% 6pذڳO '.[emAMKP(+K[>GwV>xdHE􃻋_6@\GxE'sWf4>J$´Y氍y+)KNmp9Y;,%5t΂$^@Bv vνUF)I Z9m?vik,Eʰូ'Kk5'x%[\\/s{ѫ:sbb!^>Y*uɡU.=8]Oe?jD̈́fZ-?nVsq8j',E?ON`Ժ:Ӳ<9?Yl^"2E(QExǐyi*`7j#qbRݗV`8^8bz.fp b5)_hi4RX-n,ܲ`p' 0{Q$ʻO]M`-55{ F|~Qev+@P_6Qs۔lCAjX5L,bpn H=E[~m]]j]:l\MzDdžX TlBN$e]z<6me$]eDhVl7B%y%"[֌:A"08*S\Jn sSEaDdgC؅GZǽgxǍ[7{>?=' OOz<;>xĻ3O_ ?X~>|{zw f租{248ŵљчO ݺI}lٙ3ON/L?2Ezɉ񱙇3D{ͅH׋6>~T[yyKIS(*+.ܮjmlmh[Wu|[Ӿxw/_P_zjC枎7ooilkvޕ+wݛsgJsgw==}02dppJ{Gf&ho|Ç=~4<11?/xٳ?~~۷_|ʓ'ӿ6ۗ/_vvv777766߽{녅W^=|ffE& j#-f'FkE K;[ ,T۴I[1quo1k=m_k!OX@MLՖQSt8_y;!&8F{uK-63cK[HGʬ>pW-pt;AvuZW3vV-V'4>e,:]e,JCNx /EF>%I[S{o.(rˏ9`{Oʤo^|h8MM]aX_53lH,%C6{\B"*>`1 #P(tΔ&}f!n=.AƸ=tTn;E.^ i|6"*C@CɎڟ,H4fdqÆn)Kt<(0Pi!GbB>]5Ѐ K&,#lID\'ڰ8<֖s9# >@ ܭoqmf*ح#|7PlA\ A ټr,\ݝ[GK)I'`:cMV&wuv`bٗnVĠhKhXbE,5aA-Y}qK6VAGܭ2%t{cΰMKn~DCpM3[S`s퉷C¸# fY6<{T$7m;)DQUUeGpChp7aV}@9:"bWg1"o7ţQuvZH!)ىp؅y =]Xa5$)5B_EDt/T2G5$1pTcgNXΧBtkI|td`j!/aK Ц5h^.~cYl>wsZPQa"><ϋJ>0Ʋr7R_!] =>l)W=g`$˻ؤ&PglӪ(ps0v709Sox(rTArp*Ʃ@|:U2a1bQ[SA)jo|+M쟾LG$8\Y_0&<@44* /h\M9+Xz})U9ѦY]/TYC Ɠ7AيJA ΟNiG`E+Q>~ng1ٍ-gsu,OlU`:eƂ ,T( wIsȑ >c'M+P=KtMT[Ni& &bhjdרc~,YdD|@H5jD b I=&$,`+[1Al !d Ast5!ǘ;nKj,m4<) mB]ˬP3n9 b#Jt=lޢpJtpZ|r3LjXVr74 N3yvs=UgCid_Qڨyoo7 #j;p/[Z6j;uCD/ccfyLN JPYؾ`>]Oc'ŰLvSƩ̠ybboNV;e!E93"^c_36D2_hb&z ⑅6Rnžɖ@k>3%d:լI#ivIqjuHvVrR%aHC'[ǎ9g@| j}fٲ9N:mR࠹5~D3l4$T 5qLؾL"l5)do<-4 ,-N{SĄxK] ټMVɠ,0LA|TS1'- 솛!@j`*|0Ld,>RBO $m%P\5 \ >1}4˩aUcDbCo N},hRB 0b+k4Y­ PEU ou&+;Fs,H$kAh t(7H\ŸY#r])&Rb?kG(>olesK1cI$ d)SYhJbO%} !lQ(dSGIgѽqݯY"&v2PͷLȧЃgB6+'hG Hp: 0Q"vsAʙFPijyLzA$F%BKDІT䈺l vsCH#bd;kFMp:Ast! Zq/8q0K¥}SxӳR?c7jn!6PXtXCM݀duն麁L,'U,+#>ǭU ,%%EH5ڎ;hzx#BDvubX_,'s$k4 y Ȃ&8LhO]j;81+d@ 1ό<烂\Ý8jZ ~J)2vr}rQx)EXoMt# b\{e5}NB&*ZN zCQk]>e#btyQ@#Z%ɧB) ~{9Xd6>Ջ~AA`J5D:3?` pݘd5, ,),M?bNRY%z/ 8 uOܤ g)~0|[TX/NV(d'{yk) saG8{c|ځIab<)KܲX">$ޞdfZcd۝،;rSRAѯz|G +8all |U,J'7x]:~ !hthc 2@^dLg{Gp0R7 Cb6% -굏eAkf";qf\I8YaSI[M'UBЬF>oc-ŸJ}c iM^Y&"t֒Ji3MR70&cY❡(@ i̕(7Ջ5/?r (b ?O+1䝆ksAqSǼG=eV?BzhWE-a%Fu+-fGP\E(bۑuy&O7ԚQnt;d]-|F<7B 9yzÙ!s{Y 'Vg;w`FFPgݽ&-ލ%7({{kL~#voի;1@lч>H0mS`"ټNk\Cd G\R 9Iv1?q z$¡_cpׄ_0Y L\"H>"s3, "*͙8{9}xXoJYf/~a_zyܜe<ػ =6[h3NP fᮁjְFd]Bᙞs-jwIn@-^6Қ93$7ʙU߱ڬOʂDț;)J%b%^eWٕ} >{k>KK}e$ q0r" :%U J33V@OuUƯ_c,t_K4-xٜCrgip^k'B0$k uVI]a‡7Z"x]gqy [m=\ky[rߗ2թK3rk[CW>Dň;}QaqsVL"*@Q )_\dhFw$]nxD(!D94DU?$6O{ C_ [8hJ(ߤJr:ȉc.uqOTT<]:%,l7qQg9.&ezl_2ol;q*xqfd3Y EO»aWjf@n7ƏAّMŲP]V؞7Z$iH;JH)3~i#;e'o N>PY'^~xPiC*>ZHE7P"> CޑpRu/n܋! :;Fj^RSߨ=ib edӭv>PjC[e<,%_ eT GTYgߐn&5pKpeЦ`EZ 7ͅ}'\;K<,0]| T:qYi]aF=Ώ˭>:2 _xi<rR !>SV[%{#@+Fّ9i'L0 %?Ti5HjKMV싾S=yF0EZԁ,R|gCDu_ LM̦L)#S9+㡢LJyr&E,B$F 2?N2}|tk->sE2fGx2;WjHIVt;GOĪ艊Q7 G,'X[5ʽ-XO Q{Z$e֢CDcYݥD_&rs 8>g_#]bk=8E3t¥,qYD[߱"I C &@`HZM¥JὛ\`RA'dZ>U$7:mH~\$C\3qЕ@90wҁCnW1Iy[ye2V/s5 [wz(A8Ǫkl{yǀA#<@X`R}2ՄC frkx䪮1@o`m͆ x%?U+=I 8?= k= C&w< I8wң-yB9꿽~>Zx-\h qc:}K=iE+Z &jՇjt{EAL|3ψW\7Vk,h.J3S5Qs2t ܴ7m$|C\IQD*9'S ,UacڡJ !iCo,?!taSNeULYtvt=f,ՀE9I](ς{9u-I1bV^bej m|Ul)4A-XP&d:!G.^E%- LBi"{){=/tbD =Qe"T̥F)2^T TN4k翏k5riՙe 5s,U;e `q6:|B\{>jd0|5p-BleD3fU;A\9#fJ'Nt&*[xwxV  &:l:{sT 9G'1ׯW`tj`o3FH#xkٲnc ,8jʒp9^{aiW;pcWt*8\Jqq<7زQ $s$ldIzu21)I3K*LLN52€FđLBnO|=,(9λEGT!Y⭑E@{ @:YljW41w$\8-=!)!Ox=,ꓱ dE W>@#@8cDL<;F#S(F2MP>g=YD44 ]ej̆GMd6Pv 6KPÒ+c #YBI!%̀S^f4C<w뀙{^FSDp=ph&(_>tlb 7vDרS 8̌Pv4&K<1<%`//JbL@9^7W>k 5B}B`F>lW?ꙟcM YGe'kG.9_p(345J RIҭF0`eD E0Buq6Ix jA@gxHaĮXM!x[9%ZX++vɤxDNjn1؏bWbWeL\Sscp S'=Jƈ pj X *Crקq}Nmq*E4%Gk "PYh8hibYi$U}J6u9x '%Yv'!D0*K&@-gwAaYOQ|ۙWø^q[L"FJExh@S.XؔM[1.3CW3 50n ʮ\ w߼t!ITpoU6U2((fB~Zkd<""Ƨ} Q}|ſ_!P ?QVSh0O*u \gǪmk\){pf+Wꖸ/)tG0gAbA|*3no6GŨgg@vg`5O%7.'/*&*odׁS[Ե]'3(r6Z"\\?'U.^iV9e96$grf,1Is~2>o6۪1,vs{ at`$gWSs.<5,BF|L[ƙK 52\V#0(9/d Y8 sgZE4iyPy3 DQR~v]8ICUّ3Ө8 4 ώD.*{`)w wDU =.=y o9w$0jqFbNx=E${BMvGő;%+/oᎻQ/l;VpցC;C(P"9+}.GL9,{j\Y"B?f0hѩ 0k##/m&X/%Iy:(d]M:3oGyugtQQy26;&( FrkI^&R*gϔ@:щᱛLxJ^-ht7`I$"ְ(ȝܮW%I/#jNbG ^=yrBy܄^C V)c$YX}O4bxF =<~~r7FT~!/#&@j*\F`^& LeڈNwėh-1&x[E s>@5dOtlH;zk)Pj^X7u䪐I\s ݅yH91a˽#֞{! GxoDPr:sy@N;c,?2gO #s"n> tT/.(<,χͶ8 :!;sU7z`;+iC{ZC ^3;,HKeP 0L!0⢷ƽLη.Cj\@cAHEox\2p?#FVDE+sv]R"Y xnCa>#)˃Wtçq?[wauɄ<~!fj2+"O`S;Nv,q H#\kjF׽Aڪ!RE v-@{oyU>>]"𼮕!7[ pBRyN:vH̻K^ [rCv)´wZf $ֲb ZvIP; j9t*VhV`y4FSءLbImI^!O'uD'isdd+rur"w=[ό~3Ϝ3"z=4-73yaDOԃ/;M;dV#ONs{js/KqV{,7$rR.`R6tQ}Ce]Nhmyoedo\\8$ӓj٪Yw՗I5xغA32 ݘ gOՒjyE?u991Ǜkw<苹P;@A .Z~?S, &T󬴘Mj:DTI*_<}qV`Sh,, uy30 eN+3xzq!*:%^9c:Յ(a&# ,IG=^7 U|?䧯.`*dmF^/h28C*Gbib$9S J7M@kFD:Ot}DJ @HmUz LE_/Y?v÷T5,Jюq3礑Q8EI>Z/\Y28Ulyƹձ##=aQy5 3`׏uM3rQsI'ɢ=|=ZB tlf[oqq6F(n+" pLh78D :)x=U$'@m >T}]KŲ:[0KMY{9[ o$mlqE{zVX5s&t_D B\EG:rqEKdVD>z} ruY!"t,P' yf@H^ON֊h7!"nP /QdB$\>ɀx[u9csj.*&1 ,ޏS7oյ602%1$eh/aLٓ6 ?Z}JrWM~_GcogSgEWO=[!Z){. *_- CUnq0p, u-5?zεkD^$$"ԗdb>9Q TSŹzCI.tMj2Lhb<k9JbP4 _3eA60eNb%h৊>YʂCڹ>U,ޫdI| r'bi3 iby N8.p[=>7չQx+`9OK^jի}DSTjjÎpe.Je eH?Uf'u<ٶiANEIer,]e c;7[ DSaPPg>0\Z>*ļF -W0T*oMi?hBɽ^k_8x9f0H-L;$",@vHo^=*5`OGa@U'=߳Gt(!B|ձLjVMfj): p&^A܏{M]99XBt삠 ̊; {`=+Lkժ󜙻Btb)5r=T`8w:R#F}Q Eyu-d2)WK:r7;Vr&W, ܃9Pē9դ e8Sou$BhwvƗIQ>+2T0g @43,\Fq0AyjC9ʡjBޱ.݃OP,Bȑh' Y<)LbA\!&">%:aPuIZՒW6! eVpVmTodq OaKLػf_E^vH)SC^g}. ( 9Yh&0ޯ!lA1)|5 AެZn-3xS Ϥls*oo`75̒6U9A<:a:}Z^ȓky#.W+:QGf0gLaY(j7cTV58^ku`j~N}C6{I2z#D/ UOҫ T7i׫֞)KS} BvbO'(|;nHbyQn?_s *,j O85Uqafp7]%lv%ˎsfڒȘF%¸@,ME|^He:;Ț]3=zZ4q١yban$G[HF/G">\ ufX̳`Z {sԍݱ,~WIMpܹ53yMʞP=+̇XJ_p:(1ȗѢ%;#%1=3Y|T7|cLf#z!zYOع$'cw&cXH6 b퓊],6Vڙ6$^{T~y3is؉\XNf|kgvGz.s 9*Djኚz嚭;19.#©.U:jIjuoΙ2x9 .E T ;"3cPݯM$pƹ@DtJ#(a+jMbc^i̓r$ 3+a+ʧ+W䪽q%rg-EjêMVjȗp"s!9Ho.D+_ $+bF"$860 MM%1èU5Դu~S?@,&3,_S~ȿʿ! +mf?ӳS߿Ve7v1$D2 ٙ#l|ܜ|̿ϟO &&V++׍(+ QIb! b񾔰G M~08Ϟ篳%A0 C0';*ơ 3q TsԶJHr;kgM!J]6?%hԵfK[]Lt[Fi)S^~j`֥Ol&n54mq(%o?`2!0"r@%焩epybC]2p>>̅;(Ai;}!.[i%,%Xc!1Zj#%'+T #+>ݕw,?b׾F#R#JΗKm$/IѶ {&7~ ce9pWZW;h{t2yN"|˯K_Dι%uL ,}=cmW h±&Xx5]z]nX)fM`UG|p[AVX 9tc{@ݕm_EػKhI$hK7>}[Ϲ+I\vҽ.n`:?i·3;ʧc)E˦d.VY^p >|ľ1qα @gwjA_9}l=3{1Y:Lc270^&0],(re?ӈ鸯r0YK]D[輥9CD1x])Zȩ_EyzjE<̦sD>IʪE& 4X%GCÃׅ-OZ qZj/]kmG=`g@֗rln{Vo),x/=GӹeR*䂥.,,kF J׼G4a OMG$8ʎ?9W\^09x|8(xX~ڭ'ϞvdvtZ! >JQϪҋ/sNB_O[e=Y96Qt[jZzJ1#)?#Fdt^u/lV/ov.Mmn8Vn,?*uv>[9.]w/ɧ^=x yNQ,zk]1$_ި`LJ NHk[Ż=]mUA՘Ud= y©$c- egmۮavDOB弴p׷cy$_sv'϶MNxnގ ;yzuo$k:1XDG)?`Ǽٶ,wFVw+!!BUK b %$+\zd8D}m6StI=77nȷ+_A_ɶݙ,= VUc{O#ԚnXJFhtO wcQ}ÃOJ^g_mk`}>[]zjy`:[ς?z|ZW;#E{ /bw$~Ή~:b\@\znҬ zظUG]{zEkq+5(6ç Y}W?:-/G&YV%x}7}ί1PՖܻ];0/w*h_?'{6 eov=?7S{y4?~Ag{uxҿXØG,(o篕Ko7_nߩnv3#X:~dQw@j+B~߽D4ߕNs7O_9[, v5E巯0O?[ NcD  #BתPc~p_ؤ;%CtF.$4_ݦP؟O  IpKoؿ66P|l?@C1!1I.f _cnXĐҧB G_/CC\-<]#bp(? D׀Cc ُh`jo?fO7 ?MQx+xrH| ?g }o3UYۯ)4`/. }>qJCpOBm@Y ysX%&TTb~EbUR*8 _|sOl(i'[LJ;G1NJi?ĐtHB/T}tjtTL^z/XE;Hb= OD)()+CCRb#Ѫʚ2I9[Pς(+RQU)PJHI HUI3^_>=c?#FNH A/ eƒutB1JZjJJ:!JAA!j2;`osG DG6V<6():$&gKeOOG]UK=PG{_L@~TS}Ui<ߙߙߙߙߙߙߙW3aU($&P&Ehohicgۀlm F@tLb)T (`bU 3t~ ?/*% #_{\|Cc1/ }>?9 }>79<$e%_oqE$$C_9xWg}̇ј eKHZ6HI ILTWJ@|0,67q-z_ZZZJjʪKEUpN 3O߅}ݐV@G='&YlvѿW{_xH/E /)J/xOKoAQI>Vύq/sHhH|H~ Vshc"cG0?>q#.~r2>͎C7?a,0!Lfraa Ap/x<^?'mP@"DD.qq1xE2!EjHK72nafQeR +M +5uSa & [m#:`'oowlok_f? 889pwN8NKΪ·]8]]]v\M]]ɺ%70({x|%vn9W7wԃax|3{c@]vM`uFYЙ`lpyJaHiPC{n^1:BHˑ{QQ7ȘX !@Ӌ; !p03k25$4l|6y7=-=5&u4M>xtKЌb319R{t4h1ccoVḺ,LViVGm0HẔʹ˚4O?B>4?<?OxP)8]0IՓ'BƋϓtqIc){izb}٭rtS8} 㙤3 JJr'gMި>^\/_(&f֪Vt/\jjh(hq92ѹqIY JҕWi̯u^W^{F$QV[-ӭZtڮKWyVڭzWDmWm7(߹-}.R޽{T]>SNG,Mt׻@ACF5GoiHQ'Mv{`gx)OLLM<}J Y,ٷ9܉_ {%]~w|~_G{$@ L; ]g0{9uߺ{ꮪ_ ڄnnml?M٣+8>:;9~pz)i٧s eU55=qKv[z'x7xudFP0=_d?,'lG?_l#Kɟ'O,Y.tߓ)A:X/?| _s̑ '/%  nOb`yF[ .B nZxHԜIM%xz7@A _]dL44ټ4 vMa^;,hq"$,+'YZY۸{xzyHJNIMK(,*.)-+olj  /,.-l^woȪ}3$@9歄*1ӋρDjy&h =덈[ԥP. mp5 4 ޕM=}\JE80JFP{jDeοy52'S0 /J34@@ t_@sΈE.4`Lo9 ѮS;Eر#2cǜFy! Kh8 Ip6l D>Y_Gr$K-s%zRԑ(YhA|+|d5<2Ҹ4SF[kЀX{"( gE TSLD(?堚nʚЀh7QŁK\F8c(me:4দOX0O$twBW9ﬡ/vގa S4@Ń o 8@ 6\?pBJ ЀfC/t5ݸ\&RY I%co5ak=l2$h] `(w}un|@;MObN'-a4g@ ۆ_|I>"=koO.r X+ JSC U ەcedo!Uݏ؛$J^t^-.,8,GL4G% @c=qtkZGN<罸13:EZ%CuQS?6?>?fӀ^1Z/ w7@̧}m10j9Z C9Kp'EsXON:oz 3pG9?=uYSuԋkKNj v;u%r^Unוk~^j/~bME`Zb ~YX)!k̲l(ip[KoPP~C sRo,qWf墔F9ϋ[ lFzA.dtsis|T$jh@:~ͿW6كO 3#X H;>}н H)_`F+'K= CYlub*w/l~egn-, :ks!)TS߭E?ѭmbuG^v% {mHE"p.H'b)LHu-XX|CB-¨OFAX97h@r¶es ~]9[_ D*Jl!K9[n/Xͮ3cҨۀ oG }eDeX}B# J$` pf4Bi&Ed`z`bGGļ5Q[BSe8pia=SDрC)]?7r}y}WHW  v)G#Tõ^?,yzo@rljn-0#qжgOvds_c቙w_#?U Mavw,ت{9ͭҦX}9pǤ$hi3\ZaGթIrJ3&^Y+X,(u|A.Pu 3/SS^5O<}-JN43tV(9 ̹B;[}ݫ> =i ! h[n!!ֿprovM$v2/ 1vxb lV͸m3UIhpiWΟPN;(. ڋCj-"d֤g<]g}e >=M)Ј3d{ q{mhg.s *#6>侙U™RMo5;h/('~bL*t z ZJYVĨ,2 ϛk̈ hF#GNupX5ܑksIi>?+(Y:R0cgnIlC"2GtG$yP̧pUܽ>8PNI<2eM_naԢ=T<;V׻sBCUpB} KƠ4B|oܟ4tp_?ފ^x4}zA!ng>vto'* 51!ohUfTKqlLu$Ř'M/%OWedC//LNzPkao'5vUs md+ikN.%Zuuei,4 q"]|MާϞi'|R4DkZJYhSf2{u?8^Y}le-FTznǶE@=(c<"!/C臅` 918CGjaXn*CҧT?x{y8\VNS0F 8t5< } +S+6 =*lHS;v's{"x*%!ç`z”lR]\mF Ʀ#uvjl0R?16Gꄢկh5B}xALte30*/l֡w "&% AC~v=־y`Hit1>-ACحֽ!2s1B?E%`ģXyC _r:EEuǦLgglkcuVEPM/6aH}piQ삌 G  ^-wMzblm}?m>+F6 K1L8YׅH_=5uDU+TGE#[ubM~_,uWefWʡ?Rձ9dߒ%S+EͻQv *<T)tUXg(]S65cZOتMw~߻5"(n~=L,h1AWN6mxn7PCJK_dZYz1$׈K|\v1Z5Fm8#G#s-XZV:VA=:EE͠qdkgmd|1Q5ǛB0կw$]vycEX#Ud=X]g΢4 (GQjfMW8]JWW«šMEp ߄F @"@D(nwJ @{$'R@1 URrsb_ \2s:|}⦄>)Lti}FjMdb}pY}^\-l^M{{HJ ]nV]A5ļ =h%\tqjFV'dVҩXcE'oZeky*#_̂ ^U︶Z<6CMEZJfQ݌Eݤ:=@%77Pno7NrE< )C5 섎QQg_t7u8 Ju|7+v3t_itzk?W~̦|ٙyJkCÝy{+L@A'!\yL֐3c!4m'/ChEti;zNɎvIYwς>P|3YX]YG55VaE[XޥW`fzm%qY+JGNs2h>Ɍ qXl Z% TY2G|R5)\֝¨B(7yY=,OLjIǬ􎦞f~-M+F;119=U9ug’Cܫ&6GXFn13b˿/Qxoo x5GVve4':d CP8!mG'|sĞ.F"V)f3 rx" L_wLmS?bqvUd۪`MyeAa? z(a]G >>6iAysJ>dD 72X#auXy|TF. $[+c6bj2Lē;˼)^n[Ztb mh}.9<>K#sy֓Fbl],DeF>WKo/>8-D 0YԖgg?x`s7of=Jw:)]0J-!5GC@ {?A"~D6=OHa& .W⥴cHj+L $ >j{HƄ$ct·rфwo<S32<6! &YDJ(SʠrA9ԩi:]:24ʤزt.'iܘC':w4T ?ghg=49M-RP#U>FBuӰ{{Y5-Iiu@Wݍ5q?Wzbڻ2ݓqe5!?q\ .y\T':@~ V=˿/s?+M1AINJOO)!.̵wx1Q\=m(.F9JN:^y0iT&/N-ZX]k9)BwŃN/!mV7;%cQNȠ .^.QK,lҾk؛J~Q)bl{E:/LVrSWh<'`7^#׳[Y2hL:)$4JkqL|^: 0@i,CB{Z, ~=^Ӣv~~iyj2P ʑwBHa.s~љ ) 8\݉g 8Lpq47-+J"Y-7J#$\I4gIDոCK]-\<5;m(nbgr^L^A.8CJ:Wi U gY|kN2hI}iϵy  ۃzŞ#Wz?*kDK0@Sl)|FuÂInA&1E2~Hh_/?Vnm^2Qe?ps>WS1{?2~Lv,\+P!|LvwgXوӎ \'ϼhp[O-I͗n ϹWw4o6;cBYH'.GNLyΏG/26Fx':Q TvO_S*t)GAɁMr҆ t!T>Vʵ̹t񷫉p> ! ;P0,>,t+e>PꝎ^Jfl0 *!CEZ ۭY 3ѥ l# Y*65x>4 "~SFb}t:1=R'IIxF-C?؇EIgɚ)e$.=my{0kiNU{|hG\\dRlkhkN_2k] ~/3EDV#B\nL]L +m9!\VMqsov σ]vZHvg͛нC;K2|G{jKUc^3+;֞=mLf9X*Z+_4G#ΰM?GDiHm>kCjd8&d;d 0Ƣ<|oP0 DmW:}zr@G)C'nJt~tT8(]=#d7Wgf;M6!X4y6!dɿ7M+u5xRT %,/NVzրeZ0n,ɫ\"2X bR:0/(,;złS5e&(ݮYPy+y O& gs It!S%W?p'5qɘ=GKʶ{^ꪼ$QmFΓ_B[UF ,:|bq,c~J.WۙWv4 nt/~kvRup@Ki0uiivy})Aڈg T)H.ΏN9ʱ5Iblh-R羲qՂ_jWZˍ-  )ɒ(zG怘%?EMׄIkF_>j_E4|=y0 NDC8ū>KY$_)Pe. %^ԩHSPۅ{{a\[{ə/1 JmdmnT裷Ǻyڡr%-RNh JdZ-`#Eb^[J=3kܳ{<,ҳuF+it|<:TGhjX%pglRw;sze)B`T.| DΎ >GBm ;1;Jfe,`Ѧ~Yj"ݽ̜i}k~y,@{\ʼ>4vy8XūoO㘧ͩ 暰Euڂη:<[=`jiQ VCiϊ,[Udo߃iU,J^JQz/7COk_%XZ7{wH6]OqIDjߏ=N=ERgtt5k. wJou-㐙>5Ʉ xʅ2,rT;-1ePQS~? ژ~, /JX|}P(Ġf~&g=P~6<Ҷ\GO55֪2Kh4ǣᡬa&?I</+c%cOwQљ|-(8O9\lG$q:Xod ULJ*p.YFpCe! PDx s0wpQ @;a$܊bFCeg?’%yqNj[mB61^V*TfS?"VX]933rnDصԔV-=&(wP37-0|[ͲuydbO< -gRhbMT!KWy 20\7[`}ev긳w)wsmX#I/Z_ZilO%T@M e+x 8(F&i@"!%ɫVb/$z</R10@vx!Q4;iޥ_{n_&sZ}ylQ$bRκ}JJeTLF,\ B ;\=U+Ō }a,K])EATE+[8ZKM  mYU^)ĭT>ΎXD&~&},"p ҽ0,+(Pl?q f,3y?OeHx=\!i٧g<]vFơTxޝT 툷Dz 6%KAUt/~e,= {Fr 6*oD&čJm^ldg-0xz{_.psd2.%fQ>[{[7= 10Īfu8fyu¸nY@NkkgU04?l/5gz67Ajs VN3g~PrwR:J; w&:&o 2ZJ H$} >*:#mNB֊R*X.efGF!2nFBpkXpٿ~򩔱pOexcӶ {4 <ú㨳; v݌`"J+^XU'rZ9"?2/.-*6ewt`lm%5)5ڲ~!T0s!lZR .-;NV RE*#hJJW޺N4BS^izW~~>+W]@X~LjMk k1V$LByB'ccl 9}Q"W/%'$hw4CyTևmCWtvjwFp{ _H r4(f9S]"w{yK uO8X?˛Eo?f]z)_ |NםaCk#=h+ak]G WaKI_ Ka45̭Mֹkׯ;VmRHΗXäҔOkv(즺Y4w,d 'nNy;~u%oo^Q){Q+,y,S8|;0'Z,[ -gϏ-˹sTRo4[ ӏd"R,VEm[Ws݇p=k"k р?gi"A7,;|p~'U|-?mcfeGR:Nq91)v)* f۷^yhe t&}QL_T٣ȭMePb)۟bŌl_ͽ*\oK&Oi#Ce74-UnnvY%\uH̒< koJۼr+gQ$הN}xK:g'3zMqSqm 3M5]3Xz=gE^ 3G&x94ع)iV(Wk|0/T(f/]HbS ϩJ.npyBрm⠳G)C!S~MGawA횡Df܊RvOrRK59Vh_ϚFe$?kոaf5֚/&Oc7?)>S7~P޶8:[;G(Ϻ=ͯ+.z8?WMx2M'nzkg+_l%+tz T2k'iNz}VX^S^Ii_`tK8W 6 ^DK镒6mW/^d +p=<0^R"KEs(sMμkvj }B3{T޸ne$ 6>o bz7&~a[O'&\/ܼ}8 bU˳k, ]<)v(88ZZ/ђ,$-ŜQ=.m%P2HnpE[t+ AܤtM<j gPͯng_0k0Omtv_1}_ IK*`FST>ſAbpx{:e]a :B(R+t7sۮ3!YZ]9+ct,.d3ZJ ps L]tt(Rρ(U(GyD;ߤu-5ߊ1a8pF}0 fkЪox:^?8AIQQv p}85{Cĭ YߋuhGĔm N.xc晄 /6T,T \ ~~LC ވLVq{UʌN<&F\%VWwnˬ#C5֊2&!dKYˏS?iZLjL 2H Cdz#>&\K&&&Ktcxabc+cg[xT}i 37>iusg _AG=v>$;rQOe Tc+P򾷎b04BiT%hR8V\,MVYCKC0..|'-:Ģnh 7}w/YǼnlө6l#i-V8C-s6MUƦ9n9.!$[G5٦uz%yd$8T4Dl酲.F2Si[&&CkUݱ2Ť\j~BLM H [ gbL/'$ ĵw5lY~X2[q1B[[cdWW"]zah5j[_hpcCu1Y:΋ %TWnj ov9A9\*ݻ(;$AS jR12A~m/q2M Bwn0$a$E.rz`G:"p<{.s}>n I `q־3U`Ԗ{hnl^,$i ^p[˥"C)ET/JQa.N̜Vjw1ޯcK1TTfr7!H/.}]Ҽ_-T"nmsPNjo1_Վ XqC i)Ս \?!9F۝ q[n/]Aê N׏8( d5KZJ Wsh{|ZOǍ4eڀr$}0 VZ,Y$v[[^]T|PzeZID\`8 K> vwoSU6Dξ{1҆BOAz*#ĥso*dKW??=ZQ+ $.utLk"T& A sg tbBe~(&/VOv,}*p \LoTCRzcy΢{%+X#V/D]]_jwbvz n~4`e*ozO+8U(HRypnS%積m@͉Lp] QkW4ou~}m JtuCM@ƒ$Xq˵ŀ)BF`uj\GQ_I\cNדw¬0gYr+v-}\h3~HۨT =2GS81%9Z؃cfբկ9/FcR^S>\[3Psԕ6R:rXD&X6F)ռ;U2uݕx;~2_]O60g@,QBE\'1ٹ^$a~>!hɫ71Y&J3%NQ W款(a/j~CF/(g֗E H}# 30z=+ wk_9N.l=Fipb]Rf97M-m͚{09Q#.䆤Nl ӕj$`*Q 2h&&~?|EPvHiCp0T? 8 87EIw,OHr,>Oh ? ZF.UIܕ/ܦ$ ԢgF;KʠB@u @ɓ"X2hE@^Q]>ES䱆/}_''AQ)VqX[ÚENgy3aEF[|m\7y* ln] |FMK[9nH}ڮ*GS<4?Xk`x5{`\̏.Cf.D eĘG5:pQ^:ޝ%{oC}k7ϔ7=-( *[?哙{ ' =I{an]R?R$ñ}_G% ̒]z4E\ oeG>2ǔIZIqVK㠫[y,gb'mNMWM@-{cY}Q\iٺO^џUt;D,Y6<9, +*'ѐ|ֹ?b5UÛ'!W To} ˊK>ii>SǏcN}+o$%~CHL0&ۏ5I(F`o*ӏlc`_ Ut}0>hJ̴%cIQȰƤ@pܠLUbMT)1" KQ|ܘD0!PB^ ڣtq#CdU\^eާAx{\c H}N4Ed<0X(ltUW0L{wvd@5rzZH ^qUO\}m"i;Ah;Qː+f: D :08'h{6ajݗca:(#-O/H$45bg-˔q D^W@v^"co b!!=Sְ:Rf|рLZ1bRU<R_PM<|ɤON+ re!xz2@C~sɡ<;ykbF-d.9ֺ;fRyBjBbn5mEnw%Miiɺ†JSTpћiz%fAn@bB4hvε܊}(pjjU"."V F9g:N lr?8(2φ8-LoC1N~Gn^ěb(0˄IaXV~# 8.^U ]sYVDh:h2]Rѷ$2w@4׹^u.qRF{t"{cn}CeE, cK9fF[}y>bTB3.$i G3Jml䭌mlv y%x_2Dϛ_ʎk {;Ub hvB?lŅ>|#'qS@pj/B+Tc+G%EnIŗ.hK&5.(2RH̉l{+g&jL.7J?j D ?[{ndsO}x-.(}9;h@s6Sk5w-e^=LMr۔Y`b{< )3ζ-w{Tx_Ż{p@N\hAӳpվY?r;c޶Yt yi G2RPoFQ@҆wj1o ܧTG"TVï O-j1r/"ńwym NzPO: $a=YX=IqZq}Ys8qQri,IQA{ FΓ܎:i)LCׂL59t*EǨ6^Jgp݁P0}lu .iw}= u~!VQG'Tg'bӡ}_RYqE|BwMip3S9!_NTZDy[lI?< %1Ss cm2!,$yWHw3^ۥ0CRRaCa]z^}Bc${4' *c4 >DPC3O?4oP{C._O@YQ(``$U洏Jͫt>d'T 6tn啕i(cԇ1ӿ[`Œ([ q}sZSZh?0ceCX\dD$ONn8,tЀL` n+ f4ܠO&u0vtʠ5'Aしdg$li˂؋hk eZ9;)q4g[YrNl[T?nIE|nO(C^|z]w8ݢcNɍ7 e,#rXY[Vm ޚhoGnR.1rŰ?X]@,O ׵m1LV/ ˴y0(GwKS+A;1kUTANIsWCK bS{04(fRZє?Hɗa/f ԃ?ffjbZNV2eDe@US̒'a}f XMM|-QJZH] uj+D,bj<%B%~շdPh+iz_3w^u;BU>(tl 2cSJ#jjHr).kd\ DGAٍɺKrW#.WQJFG> cE .l}h<35?O2ۙ)0(S3eUuGʋIyKUV!ިR]uܲŭj}bP\1H9[;a<\VnfIc"4؞БW[6fKRy)%J͎5P鋱ρ 2~ou^稺{f.g!<Nhh[Ë,.S)زee)qRK=O. .)[&/zΰmiRT״J{׮hEd7CJ9ݴ(b7WaZ7 = 0մu&Nt cxnB*w9F8.}Ram9PJKd rⰈ\b#NÛRM͚5ZJ'3NVy׶L7s [F7#zD-0XUM ilMJu~Fכ[k]w"^ 9}z*Hn,RM 0!([ب)mH kycHfz2Y|^y-iٽi[w$l-YݡO˴y)2_ФmlD/63|w`P!/CzӍhnjUjV*U||&,<#{.:v,]@H0*𴟜][~p6Zu;0kkCt4X*Ku^oMUJo=3vŒ"Z}S4).\I?Ve#[ȱ\)b YBр 6 NrH"Jcbs? )w{#iՠwP'L c59PW!+"Mb&-^}x[&vz`ϰ`)VSrKSLڙ2{%e&I'89HeQv͂*J 9 1wz?F> ظD,Pz輝}pR=w؂^(Ng--]/ jxe3g/]Ncf+D:r~oGA-bQl0z^C[_C:֦ Ua&D,Sj#:XG"{N">(gXt*OJ sqMc]w+`A2:rkMʛNrWܼa[U]BLaj܍QY;|uk"oy7f6<㛫U @EOy&j yv&9&ݫm10z/]U*)4{pO@ "t* X:v#{;fܲ_K)ș ;ٕc[.4Xymz}v5_r];FTo:R u^20`DG40'1ޚdqmw<8:ZLc_(91EN={cN1?A)S:ڏ<͹hU x/{HATV9*K")-)׈qOL%8r݋ԆTZMwTͪe,}o_~6h}2ջ=krǾs(X@M'q?yb_+|u_mN_S{g=gw':SMt< (MBkH7|CWXCcEDI>\(4H-'[4.Fv?gM.o32T%c }U8 Lŷ>. >*hDD,]%Bd֊&5Oko/[#$5veB|2yE 0kG&op|ZUģ,aAi ߏ*>B154u]a53"(yk(}DqF~ Ucn Ia>a b4g,Ti6%WF ZW7#?\Kݤ:gzKkq.Puv\#3[)1l;byo5IΈb@ l;Ys<1jIJG4mZz4ih$N{y}xJ5 j́?^[_,.u3Lʾg+_9$^o@aJ&#.xe>rkNݮ;J{'aM3`b'ЦBwݻZ]ݙw..-w1%WP|dzChh0FwwFv0R{.̔AS7k:qpQ8T){@'3[4. >fTn[篴ֵ3y$HT]{4GZ@5=-)dČzypq)]dM6qpS; ^l^zCg"yԓp{(?m_Z ޣ 4CKUBPeD3H7[Q.㱱^NKբ(7[=z2 r7pԖР<`#a󸢀"LZRWR!?P5vDt -x5rFP*l9ѽ9(]U:P9m-V%1Xmi| $w_g͌ рJhSw.gC\:.U ^}1sḾDj1PWMoRjVj'Go&wQn FRh8Ϻ-[oH{ԕm񨐸EƴڝXWQIuQ] [$1֙ : '.sC5/WZFab"a(ޑsPplbqAI>]'Tb{]K'tE/ycsKd J܂7ۨr2w y#8p[+˖o5ճs὚ n}{>0H?բ2^?HK36#{̂feom|%ƭ؝*H+ u%`9ꎨ|m 喭קAK*tWYo&4FK} du75i_nrSy5/"b)EL c/NECbojP[M&<54髱 ĊENI{gEB^a-&=o *!CNdivW$IAWWԵk40Y`wRs]lIs]_Umļ+*~$AhV2P_1Xgvo}+ lqo,BZ՗˭F攉C#A6:;* 8Juz%%[^w; 2ӱ˜ CofBa#)׹7}.|#$FN~/ķ\)Dqeg/;~b5^zTvy,# %Yty)y97*~}[ `RkQPՅ;HҎ罼#cr؜"cMg~_aYԞxxZB92 EV+!̍" Ѡl_lo[3^X,aM/vـՐPvbx Oc8>n(wYSf=ygݣF‚q&pW56(Fd0-AS[;'Q:4E9ݐyH^%0S,h0RRzL@/ Acbq0Ja7Z"y,fe= q?~9+""B22=w!_H+glrkz4=BimRD]* udሖO4maޅd⢬@w)hmQuK*ӊ.qh<͈rv3adcZg3(mB Yd+'u'w1:G;.=hcOT8Tҿ%d,\֩Ai:toB+8iͅHL$8gmv-us=aPHr4 wLnZ)[i/k6S_^&{HC.ERan 8Lx}x e&V~fŠ}&4>HKHv_Uأ!ɉ] r<}CW9'|gFnNݝ'׮>Fk}E&K,a|ε409WO}A<{ս$s*9[Z~(j)+pv,vTf-Q|ps ΀ɽ#|+v%^S33Uo/RӌaSI\ N~lvDZJO~JYDLAp;d,φx۔D9ȽٍRaqD? b&fiֶ[Z_@.&j}N`IQ\QZ1Xch@NyZ)pwNhYiZVTN[Q`ea r\t]{^|F{ % hy }dQ{ FMSbNtLNe9С9Ҭ,ɏ_Q!3>;xi^/q>V*펃l$wsaǞֱՈAuoLw?GtoFN`ED$Q#c=wgMOY=nT&kIӏjq.~zwx crR/]-dT*@ J7ks\; 94M2K#D٨)WH$r?ھ 0msTg=sj%*x^ [/$"?yەV|o:Ĩmzll;20ةO"MFA9>+zF$0Bq]3H x]V{wedyyH>+J]/<:ိAv/n뗒H ެ*`?^49R!+sET;e)®E~=ْm뭜#*e_ ;}C3˶`bqs.fEayY LJZ|ď կÅ+XV.5/P0L< DPADLYޑr>t=x; os|u8(`xKHUq./zNZC`@zd]LZ9ѷo,LL NGk 0}}wFo|)r%x,n>3N/u)ǻhbi)Izs泐Y=IωdK7[zI1F:_ĜI=V3)\Ӽqr (c3j슣5끙~V2No1p񝌁:ܐτiO_4mS:-CsO&OTY͓wN[xsMuVg9Huzj%Yg==q ĝoa$=[ = ibl[+lbRv\0]յKl0J'rYnxV6n޳KSFw:ܼ7ʟ}MY\4%Aq*lc b#6擲gvK3S!`V-ͧ2Li/@wz0ϕʃWM̭꼄]s; CpRxm!s~_G#-+ZWsϰX:Iwp"֩qQXʐIy='C30^0tRu/9469<#p[]첦:05%0x5p6{ .7ZpvZyoVd*Z19vh ӊpWe=(Ge3gjħeFf^.S^Ř솁dk vQҩ+y2lEșC],]~uϹs-4~UE+,)ЄD*{ &';4ĎC3mR|2fɣʐoKޔ:;7J:dgb5{V!X E$8i~gC+Nh$%m"= 3bWqC% Wgn)-94~.gNof5CX0K}S9QvvͶ]^lYzTtr;NtT<#2 l.,ȴ q;jRuzk7)#FƘi,XhDȰT"3N@3XZ#5cW6 Xֽ_3LZAmeŽvcmfK<6~ΕzjlNvi3o#7_Wȫn$^a=9 zr"䠊pf+o[b6Z:4 )@oJzY-,L/aUԦ|"ӸpS4$Խ_PQ`Wj?J>d0D9["m{.Ũ01)QX`[ip0w$;BlWgt]4ɶz ,"kK<0W# "J֯~G1A}DyĢb̠)C:0Ě@#.@]QU~3.ah.Jqw{W>͋!H i!ި[ιt5nts\QPI[ epirJ}ށ錅HPUܧ;5#wo%'dp9yo\sA%(Q.fS;Ά G#áaÆïRT+nnי](2AU9Ӄ<r7~!%zH1~`))'?#ه*U)(ԋ oɨe5C-~o 0x}g12sUn UzFq4o_VyS@rE\'a7b`g%H1v,, }Љ/W7$;D#лPi`ǫqY\{ U1 5 TckU;TS6q/7 g4C%V f椟_wҟId dm~l7-sgm\4U:4agڷ([&M`b.Ռx;p9i} ;aa؈,>;3ѿTʨRZZ!^ܾbg?uOYө=WR0y  `Tpe] I Ng' X[yiJrSZ&sBZ/N#2MJU֬7 Z {l3x'+;"((RQni:46 BwP 6]t OJȟ񪍫m!4['sws8D4꼋)% $6DbĖfz̼{P|-v}C@gx u1rAQJݷWUZiI8ˌÊdL6zÖ5t+߭M"-QPJ'W&i,ҵD-y{Y͘w 2%ږ=3(Xjq D./]|#oZQb&XoֳZm|W*!$6f2.wݸFjNJIs'j:Ŭ )QiO~boRO4^5AHV|N3f`uB<|Q@L̛}k`Xz~I9sn*&/ьS;HdO\P\@D?|yVi <yJy'q@hs{"?[taQ.2il_O(豨2zꍲ-[ pab ; &4lc(fj)q')z⌻J#23cP\WZGc;} vM#{?mDyyD^jWRrR95Iڡrl&]iQMnep V7?3oa-kZyTVPfkj >hp\"\Y,ə{bٛ_dޭɎBjLI/ Yj|O>>ޗW{S&^6t1\F#`cEv1Wo NmkʴwiZq^)kfW︳qtt:_ ﴤZ3 q>4+%yƞ&bo dapӂ~g|d HuM20jb|D&C6\٠o +h i EM U*l!g&<*ɯl.œTʉ(mm `0*ʱݫ(,rb>ŝߖ~rXぢf2$|&ƔP(w2Oيv)9rp?ק'XWFo2O* [͐gVdd`|Z=c~?.I]s2u"3Iaό J%hbb#töб~* yYxh7D?4 ;yh &0+3j)bH_D|8a| |ҫS8"m>Ż|\l^?Ů=o=q ״yjp.inZcNOyVb? "`z|o`frV}JTHf[@[QSqմ#H*Bc*T'1:̠%h@P]{MၷS9*m&\<hϹ?߂tqxsh ϫq~ǯv){RB,EX6l)JqN^ٽ޵k'٤2Vu~/(nv|}dUO@mof{oTb-ÙV.*I.Y #Yv- OsLMyr)x(e,{ ;4+HWekve '(x˝at6}@0:2!r-6a"m51Uqf[1 R<ܡ{JN {B4UsO?DhUc§6[9h-pgw#hsTnxٿ1Qf6PvyPYxZ5oU۪( < *< p/($Vl^tD^h_/vhνk4{,mS(B y`yetW9̎FUFj*GV5 x}oj.̰0p97p`7疢m$vJ oi/Qh N=99VZ;L,p9ሩ8ѽ_UAi@8GPkbTH VUes8,6F1&нJ_ՙչ:}0o+>+bL/G!hQGܓqu4y:Tw30 P3Yd#`6t9+5{"MTm*sIțRXje'3@ËZ9^95ѳyJdxm$~ҸVz4r&zHiepOiͿNF7IԢש~_*!>z~)V&'Hi2jTiAZ`i.鐎P.fhPbahn8uuΏkfg=Ͼ})P{΋dcWzQ8P .A>(=.RM@/o]SoE]Pԅz[t '\䃅,cMI!qix*)KG`?.76-ַeSg3FJJje奙hr;.VHe$^ [ڷz* _TئiŖתNwPWH CBl:V v,!z9#yV#"'+AZO6J~` /( ~Vav|,)/*~m#ƑvB 7'~Q˺X%V#ee։ +wC!>ّ_zOޱ ڽwȈw׎n>ǣ9%[WfJʿGR)qd,$|w$n$># EEZT22Geƌӗ}&qk7W](7T&c/ûϥ򎶐MG7LϼҔ?8ڧNw"3;M_ !K8Hcqy8+l8 ,øӟvXH5 ״/4#:j||e-hv#g_R3i\m5`sR6jVa׍),C#Ϻ44&?{lDUWf,]}m~¼+N|/_ FWc##wEE0#m"-#lr;OW 䨆b{tY;RR°eFSw ?y ӔԞWntnPsiC\ Mj=*+rRyT.#P <=ވ1 (i38pzXaV DW@I35a $Ix1 xTskё<c zSBd᫣^ *qؚѰ`q*=1J+[U("mkPV\rl%ERb)pC~oAJϓ?xx=p]B}wW5/ ~=bř% y٥'ϥ8jf w21<1wj.yGA{,ax72#[vl2ݿ;+uGE8-ͷw@]sfִOZn";t.VN> =ky-pԲ1UoO[IhG Ua;_.zտ^ף %Jܤj/g_4roFY٦y(>.ѧmsQ<$- K!ȟc]"Wby+]l8rMob}m} ]B);uڛ ڤP*}sƥׯ\׋|H<тQh~@0%S/A6އ4N9]ۋ:4F=w/b}5|`ΎcI9tm_RFT#y^3IrVPy{u=ht3-\ܓVxeVWyjhtߦ\8'IONM&@aH+2qIe Ȥe(TY˧lJOI71I v{[% 5LL@[cЗ#$u'P*%pt&dP1]~r f[rfUɛ^XܽEoPΒu)?0*sfN+}R@CFub$>f >LBj}R]tz@rϡWRo&0n9VB'0spO硩a Am\;E7jrN7P B݊x/ƷG>=}W6O"n[4{k]';-Q O:2<OcP`lpU{:5O\j"E<ĜIEE>FtkD2.+6W!=\Pd#%1{aroI½OH_= vdbey=@IӓErR` NɥxoǗI '* TBeK'OB*6y%|TQҖ%^ɡL0]\NVU 7{ 5HaSrP0-JNS8mBnM->J3,9U|y` pý,y&wQDAwyTъOEqQ_ZAySHI&Tu -&TNH.Iؑ/?@$ĥ !lt,jm^܉RfNwi =g+GHӞN Ι_?6)(+G"xf~²H"n\or>]4i\/YD30A{mi \+H}a a0ڄE] ; E,3Ԣ+sM-ȌaTВ9I 0> yX:dp-1"<i[*3Lj@v*#ɗe+X+mĬG`qr|`)2,dt~qVJx¢rr|7Đx#4ݚ]BL 5@y $e:Aܢ@CiFZmiDfqiJW@J 9NY]J7g3B QH-(IosA^V 1F5xdDb?&ߤ (UR1Cl"A)Srbd>x_ =lX}fDʼnS|rwy%3&{2鋊 q@[g\"5":$J'~n& `$uyLfU)ayJw Eo}i:.'MgϑjGYq&)7uԈpC5pThXsV5{':jr|9˃}ɶKn8ӊs% ϖdw7\`[D"W%<xc(zH9(L7UBUO{սwP:tIyCv'>3U0B~!uȧaNFY=\V>,XiNkk uq`Awa9H2z1aNph^WΡYf 1T2X>22:*v }<]1/OֳT "swAl[`\popcR4D\ycn(i sL'lAfS/B[? 0J7X@j$'BÎRAyҷe?؊A>v?qg k3ISiل\eԵ~?s/Qz&lsnNistbda-`g!d@mځ' tP-.t%W7BFetZjq 1 kv6֡ ǮH396n+S5WBkָ+m5A&بz*O5Vq8^/, =3b|ǣGΤON,ֽ9&6~;%*&UZd\^y:+WZ@+R41_I Wj&v)oe=2 [@~^* EJX5PRz!n3Iug܇hWr`snc%!;5˙W݀ 2LݛB6XP&(s@p^dDLz7t` iwDR{6),wtpH,-$Ѻu?ioUSz"%rGtu!z>oӢJZp艁(`n ⯯$IgTa&}iYvfi nURׂ,Pi )E8нw hOs XF rUӐIS*^YȰZ 3σA%Pƫ]yU%ccyXUWw 8 /\@grg$$vvd`/v>]ϡbԅxX ao.-D%oSت :?$;H ^YĻ,u~ ʺWxQVk[!5q`yYښLRh}}s b !KXR ]BTA\ktTf q:䓮/%o?f)3C# 7Z$Y|EſJº^׶b7朶 ͙d٬koeP9A~crCC.|cAhri;3.TڨoTl+!nh8Nɼ(wUy#+n? CGڱn_2}5Llk{l"Tum' 8 RTx8nHtHAmAϞ60yn!S Il`]WiqFڡ E.S?Ȗ"t(P&+ngy:ǂjf\tǚNկqŸ?EτV]]8?>MV+gz{><{ 9ǣdR"ܸ9+ :ܸrS%hLЯT|wq,[m8/.fťܷ'G!FfNj6D}~tOOG>,| nmKz25S2Z?3ܽxwVd[=Nm &Z`v dC[=3!%)Ț'1/a8 MEk"p]U*t5g^f˷ם3Q؜wn6d n%O5Q-N=?I(|:Cϭ}]H\%Dz5)>L <1'U V*–ҷnF IaambaW&G&V"8R `ԃcb5oj#=6Hv~ o-_l܈}rQ SY5r'z :9vJeTֿe#]PH\ t}FjŐvN S?+`t'%W0ڨ85'-^\&WaI?.4'@XVᘻ7eD>DSo-I\LrãeN;]wl@#P6(4tGi=7эZL^RA9UԭT5>UV*+gqx(9um'qE]nO{ Mj6YǚGȉ AC#I>V/{\a+禉1{t(8/}Օ&> HPb0Op$Ͷxg%,˺[I_6I*o7 [ qLڼ|iP 2+IuNRUzgIot78qtA:}$T(U{R B,vT{P0fېN3`v˔ [`au%8GO׸SQ[ֺqÊ%k xi6LdSd!KBu!M$l^P;y&N&i 4];&>5IUh7pݶ8ad]$|-@3h xX> "7^gGu[anC{G'xcL?AFn(T|=VƁNN (Fy;!Xpc?Oa@)r{+^c:ܞ];97?S:kUPƘ3S`IRs]jOKW>Xx&%փ䔁"PARm X `K@R~60~8PõwfƜ׋"CJSN2ASA%%=-MA2%"t̾ ԑS*Ht}m4g0sdD"[c.6]h FEvRT\\nwB-Rf<)em +Zlk)pmaKҽB>(Ӡe,lG}ۃ\! &]*pE ' E-SX^0hUk+_h&yp[iM5L/"P -S0{%HhIT Mv0XM4kKu2LBu 6~Kz{w \j9YJII3yXru%G V߫I5O!Q%9T˺uJ`\n%ٹ}o.S@/ܳShU2*(Vν`SeE I iviB!5keraH׌ڟDu 4\4WkBޮ#2Gb7)"и_ C Ȑc"=nZC3P F.^:&->G iR qAOü me ψ/S>J*3fD,b4wf(@W!Z]2]/{j'&p0/M썊&^P69u!` ɪk0yK*&k[1Suy^rߴR*Rr6*qϿo{XSjr sR7g *?{t8=o |; ̌ryK:+ZH$&$kl8B8xl7`@*iV0tlW%"r%I+ܷ$S Z5嶭Yp-hJ[Tqz(ƿWTºSstٔ$Lҟ| [<:wO5y> 8D+ grݥv*-ܹCTx}Aں ]즑dp k;9 9p*Wd_Z6~$U^Ȗik=[L%;@fb0tJ2 YVf@B:Vzgaח!Ms-༬3aZ_MO( =M5ڛSOBH'XJtCkxߞIm&Vn]\4Q3RDO.Zj9G`pRu/H:M(1xgɸ1Xi`t6&̹֏ʾU7Mȴ'K"ME]P zAKWH);8-x[: xpdY=jTX00`2_\ MG0#yķXfd<+՞(ՎNIAX8:*9W\ů['Vc2b[{`ä>Y%J{ 1xwӪ|X/9xfCU*geI6@"(JG_[4ݗ q%聸* u%=EBcTzE2+zM=eqA◾TBg{Xc_:܍1D B[ ~+;Vvv1Mq&1pv#(ST|u;p0wz|pkiyq ]FG#U]\}}cJ{6` VYgvKQe0BH`W9%qR/54lטPg9;lBE_{I$]\slN%|4 dX+lԊH'jQX0!޳T=3wCAFl[d&TM}\4XK(*>3;]ɯ>u:Mg۲=-CEKP3El_ WONm6}|Wb% >K)<,H*|g Q۠í?ۦ JFeNU,%J-ɒ|tC} .G5#W#h_և]+Q:6i3z.Pㇾ!/[>RsR5%}6̶:.z5A0Ysh&|xЪ-^UDy[9r].~/DqM]x5W+~.Ek^_~DS̟%:k-*ک  6ƽY֕Qcq;m2w}cr r"P +qR|3sHnY\պ(hR t3>m_v$^șvٯpF(roɨmyH0aߟAΙKјyz>25 ]$eiƟ{jfiQ{̱2.[b l\I/uVz.վ^ZfZ9whJZu~)hҺܨVd*F -? }4'Ņ XrYxϴ pW݆]yyp zv|V]1_#^B J mfu QiF SPquڞĩ"ckP67CkNGnO[hr<?܈@/H=EW4Ra? `aKkp35RJm*ST&w-n5k;ۚ'VI$K}4j(, +˺\6oVe"d54~e#k܎ >/Grei4qWӐ@V:k|Zm8ap쮤"SjU*^KXu@C/K)[0:h[D1.y~A\ 6ϔ;Ȅ\УGKň W/^l:<fym&׉/>̈́n3 F{TR.v3Y5+r%F(*p_&F2$G}i'kEourҋ}>}&b*eez_P'pNm#pg/: E|޸3rzһ Z QBIzoK̛@D^)I@/(#7Vf/0f8ȪԭZ9l2H 0w^ηrcK\o{U*"Ew/[0"Ulԉ&ӥ-7 •p_!QO%Tp%X7`Vt|v؞gii <( RK.T *lT{Baۜ %ZwL_l'PKm[$Gn`mCaLh|YUOYƂs] N eq?HƟ..ZyA&w$:yCXǁֳj-a5)z/odNĜ:@5hX-m>\("_Z]4`6%4Cj`%0=f}ʺ'2iÒշ~ӐU[{,6*t׫%}@} Ӣ^@\?O1lBLvd',JZ",+1^O:ۖ_%kFH+X ,V~Q@ mzTj(2+B&)b"'z7ikĵ!):Z«3W6/c)Cete8`uraƆo<߻XQя}p'gLk|Ys<*%be&yW?`&=?:F-WLL{ԺQ[^f;)e 5jїmF7hvسD9w e's;lZZ$0b$1*SFho h'D&2dIºKʳPh'Mք&9 |rT[Axp7;˦c~Qևw- îoi2lfG [}ǐCۼ1m!oZy6t4tp~5ª"wV<k͂^I NP8KĚNjx:[.E|EW\QymN) mY<-"Bw>lRY.+'MI&}WWL>[k2Gs(h"25Uě/ 6*\/ DسdʯrVh%yV?YvMArQ8LD4p2.R{Ξ@{ߏx.%¡s]Dz*J=SAJsσg7M˦(8{XPY>1(W_Yl|lO~h6'$+IJޭꩲݭhRp| zGOQ< Px("2:I9'p\ێ|kGgfp@Y61xgaDs}wJȦCH6OI7[^pG5}пēfGQovfq gǽE0}gsb%& R%,+`/.Z$> iϠ=ҘA@Dz Nǭ]-exoЖ*w@RGFU qɐISBP52v,~7f\Iu* #1Z̠;dUZW)=Oюc;?FԊnzDn sE? Ѡ<$) 6n>kMJRN^a$o < Aȿ{mо)Ѷ>Xla8X(rYk >[P^~>?hMZCP{O"(ΫuF <iT0db!KA֋3??@,܅T؟z  Te2j"P˷)UhlMVեG|Jy&s[42 &Po,EcB@'Aݸ*Kd2"ydVk֤{xkvF U]䤏wYi,/ɣP TEO&wI5y'TB9tQx&@m`fwZz7KΚX]T5#$ݞFd;|檁)vj1QatuR1e/O?HP d|eO16Is)/7V՝&c\SLkY^ Ls`/.MKS/2@ v9 R[st4J[n0M1pi}m? WPRIO8W, 8' w}YsE`/lz$`W| ÆPZ $}ľ)hDfBQ8\GStD0@V`^@H/ ɽNX3T7WOpg>a6،mpdT(N “no(4;{G n׊uSO(VlՋ-rhI;,l/Es<=\\*[n[G@P :8d;[i;}t$,ڕwblK xj<^Cv~W9Wk'ur]l 8.ĺK:ծxiKI&m:Lo)_}r=Rv6Kzu^#2ԒCfg0g XV؂O6?oyH"%S2!=i}Fчb&ۻ}J/>|9(:^ 4eٝ־7hkwYT^4蓲E[{ٍUgCI'`H;wiiO:ΐXs3/~frMչj$@,{7?LB10qfjy.V42Q{jmTLPWˢu rXF@M(Jg8I͖@5hl7sh@I2IӝѧP5W*n:Ur w?K=Eu6u\Tҕ_GټWmY!#51Q61)q.欰M,O1}mgDNɁglΑXeRJ #iLQ^xŕPJ!!o3DPt{i-TL%O|첳+jGuxz`l}#JăwBK$w}xxO\A'>׏$Ry䋋UTGJ KA|X*Lݫ`[(0ۅO4/ǭ`SfWgǒ,!<_P(5nhѲ U $bc[P9!J6?8ӟH@~\E=BbxqKobW.'0"j|$QpoĀ2|Ggߌߑ1R]Ϲڻr5!ܕJ ͫv:~ L-sVn|̹Ss1kyLGlOs<*~fR8,de=W3܌\aF7b {eeφ[tus=eMCuzWvWQtDCkGGKXE*Aɝ0 >lZhn&JF1*~O/ϧ҉©9j6!m~{ znoWDGҹЊIx WNd3y}gA_"[gՁD߼zRKaGvH}ޥV йţYфۖ/&et&I:wߩdu fI-яxu3# 3n* ޑ~]ζ QߧE2ju}w@^~)I_o]i i|;<b2 M{&i_fM,D]6Ơ=ዯcZІOK$1pzCCH"ccB 3zk^bo鼤{\{tGrzLҠj*tl=[g{PtW%%6g]ojzyc> [=e}ry [w OF0hN1q1I{K- .Am~eƥ'-vÒ8Fy䌕+큂pvQ3K)T<Z d&ꩌӥ9_H|ohLvYDb';4;>x`/k:yiˌ tCV]/`M΀l[Tr:ZZ:^.F?̜SۭeEۄW^R,⊴ZTuM~HZؒ6qtjw Jz0G.)ɶf,/ۡI v$9^csZU$-\R=ƒrEąڼ.ژw72>SYT.eN)TTwΥsb@:.c^$oZ֯IQ, GV/U?B#.47Aȵ(/t߶rY/|>![ 6k&>ץ/#ԣ(GqھsSGw_qL}aYV7'Xi4\TQm@.%;̙(,.m{j_~*Y՛j }jn]y-G< A=iRᴖpz|`/5rr L' 6{@Qc˲$l|ߞ(]DHfY`p1<6 oRn~Dp̛>WcW 4f{xqߍZ]09Sh~4[EnsҷY?swv}BaS/ {PKe5 HzAF߫WJ966ds!r0<#d=ۑ9K~ďշdcjȥ sY"&+? 웑^\Gk'2(%V:{;!Hb!λ[dF_tT=d@q"ROEϴ$IkQ -ml 8][qvC[k=xǡ(.x#Z]`I}ω܄ɈOR~,Z)GC{dS 6or';t7%؅rGmDM+BGD<:Jջ~ki]Mc`49|aڜibAp+zP{"S-JYe4}s.!&$!w7ߊA| /EiFՙ* OְkiGl߲chݝDԮGNAuT1'ǭ:/;r5JnOM"6հ)}v꽂Tz6=yu)9pILsQmn Jo s {Z95%؜^2R@=G@AVwzRs+_ L*"|5-uk@"R g^^RnQ@ ߼6o{UW\=xCU vT~K`kxPpMjF8,Pƚr~ibH_/e]~hX**YD9{mW!L~)mbu2ƏiZpP&^l-6/UoL<6aq餥_tQI|o=}(SAP p@!_l@0n|҉dN,>4*'O9=1 *d>H0JcwM4zW,!-!| }E˖;߹*lTw_%=IN}\\3\|x~\f/([0rDW{Iޮ;Tfll4.V8g<# F|kFb { ^8M\QgVv>nNŐc,,LY5w~d[28Kln2茋#ejJV32>]*γ%3Qa vFW*HjL϶\J~B4ml$O" ;+S-dAz4! 5AGAۼK=(ªA ވ`f?MK$|۽6&\vv*o$_)ȹZv;niB/ 3n(:)_p-J1 /Wm$#)|:%IrOs >Y= . 9&k;1<+[nFCO!]=έ[!Otcz-ԪжЦ2mۂŰq&~Vix JԌCj)[&$55MiQYMt S>5^V68U>*E1fy؜%ifŶ> A,}H;XsvH;`42 U'!Eöf_pNN.ViBmtVo+#\Ɩmƛ'q1 20*=|o 6(,}{>b$?,ӞOa#+im!A wg`1T64W]Jg_*h`۪'?zzzdLƼ2{ɴYZ!»}!`+J§m.I-rƕ`+%\,;P$޳yewՃ )A9a#˦k\6V_F фjR~ !}_l0lU/qb⌤\PO}l*C:6;obqDxwSR-3SR }j2J.iWaȘ@ݹh+1Ox{xY셮6E4ZGzG=ESO()O U ihTiWȇwgg7zA]ۢOT ό9A|iUWQwR|YK&G)pj%pqDCٗS{JrMuG܏;-iص3#[%8Oxΐ䧲go7/66SCӐt.l#y%?}CTTw01.I#?i "5MLsý5czw ^C MB)B_4֚oʉ_mf|3>w2Jr8l~Wy6.@JR6iF@"jw\=++,l\\ LˊB'g^`aT3RCJ$z&_hnԀ1T>%sPWEPGϭҞIꓑK 6dF/ j Zvlh幘߻/=#A [ i{&{O%OKY> s%Cf(,[qGNuX4hjkۏQԼs}Y(<ʅ;ق[ܟDdT2vd[Uݭ|I:=}ydX_t W>5I{k~uéܒLa_ & V.[ki";[js: IUEiۚ?k"4wE[cx11=):nߩ5LDOJz +Cj{Ԛ-]Aܲ9}3J7r㺲2$J]u7#V][{POuMEoRĨ(:~5nvEQPRe}ݛ LrZ`20jx>r>,*}У7;x8U&,?ؐ L%@j T|*tq=jBЮ5{`#׏v7r4.N4:8p9 KףDe kBϖ#J9V;¯oe ܧ֐.h%Ŕ\d t@bA7) }4j/ʴr۳DQAA>'|tgAusΫ^T#Cs3$ns殍s!FcñP7˾KB15f[ Ȅ:+L ]J wײwc{ $7^"gR_,7HV8ұ^f\?̍a5Aj6?6I-ߘP&\5*ۺq~ J[>ހ*RKKw?Ԗ6NX$kH Mo&sbnH0({Med+2>z:.0"*/b*ѱLpܙ rV&yNw-4 5`aya05@;:f1$*<4s/Qӣ5R}t.89>rsͅH`!+Jݸfi"˻n8ç {s{v\zu%LMi|')L!і/*-O>9 ?zi^4R}=Ss]Xm9|6:)s݌jZR>GR]{oVw@L F{%uךӎCYZWcZ9F6;%"_|)L}SAEvM$%_nq/y+("R&O\v)l͐*ql&{pNc]n0I-8Lj5 <P]P*{QPEy6IU(70s"-1+h/R;e//-9uwTWîNhݦ:9.d9 d]/{86FwU}%OD\,}HE:oIj۵Fc%9Kڶ"b [;V 晭XCJ 74ӹ?ۋ&whʇdIEbluҽ՜fH\#mM93v1a^Z!qJG'?I5/.–H=?tدϚ:{FJ.OVR}0wnYRnsw^U%ջr ,e9,1ORr^pQMҚ{/2} #Ѭ vu{8;ܗJjq#N{P6^1&>En27uƥ9_7g_5幅˩𤮻^ZP%K7:ڛk)ʿ:;$Q,4?}NohjeHk5@0e3&5CEPPDzIc$?oaeMԦQ߫gLnZni?g4$CO|* L?e(?0U2q[)`Ŭh%y#82fcaJ:Bޛ.~„a ^UAg3f 1yOt!/N"gۅ$:k}]L۟ӫm2_t}+RT[t;WH:Ӭ7O~iWҠ{jKǼy?t+䥠] ˇ![%&?\%U( Kf&J $>O1f >jYQeS3y-͈ęjObx 1e٥=͜'y:MUqvwmrzԜƾg|0 ~~ Nw^ze&3?lWڴN$yುUje{{ =dc(4>ZHڛ?=d֚ 7\yhޞ[`P {1=Boܑ72^uBҦ|YN 'ՌK/bb4> r} }P'|~2{0"FwUy1"ݿQWYЅrY.8VfHb\oQCY$ɯIܳTskU<.8z锫%/{#tf\nͭ>ˑiXcu{dP5zT{I q >Hdxf U e^5œ3dxhY08{nMuw {RsF%WR& &QmԧόUL)m,:{VlLp\rT<ؾĝV0?Elc7%,CHu9 ʲ{ܛ%.᳥&rqIT/I, J8J*{V+ȺIG){'$G"[%d9eD{4-"u˗ +$פϮ.1Sx "˷}sB^ց_=a ?"zqY7_%*m.SD?`7 jmr1(#t¦.6^&{7kgZcO$ 8EHdg ℻DE1cml,P zhcdzi95쨂":KW#Rp:4rn`uVB# 6z(:e۾BjOc֐m3:ûώ'ogN&ՈT,|UCݫi3jTF yjө ZZ-ȓziFGx6 "ej/_[??5du,ʏhõjd+-}g(beyq=O!Ҫ}H%go=N-]"6,඙Ԧ8!hsGt3lF/]XR鐉S}gyZN5KDxa'_øՁaQ>Çk|jEM_;]vvܚ%t#17"/xI$ϩva ;}{ΥZϖ.<%]Ο8]'K˱5%=ru~H' Z9(0˗X-wqjOLoxyj,Xwqe`}C$ {cZjAmmit\b^A/jcDd|d\Žv ɩj3z :)## wj`(:wI|{X*фk UGW /iq@br~ePDj(ߚaˊh1kֶ'l'D7Ν5uϊB,lƹvC{[ig!t Τ릕[ahTsSI{7is9j R񯔚SsQ\ .'wi%7z*,x|}k)_7&"v퉄 eطh?J#<1% js!a#FO6azĨʩz꧕,Mocu'u^W`T5_mkWPMWǃ4/)rԩJGj(Dԭ/FNzA'R)>h/%螰z ^߽brҦ*qLnTũn!U+T)h{r.ܵj d(k#5|-qnʢi_ݦc,|g pKWf5xmspv1(nip犋iԌcDb7|>RU7b*vh]kh G$": xyJ#|ojr)FVRn7IZnk֩2Mm.JC7]7O{GQ{rq"sba:Np6iquu¤(pk̰yrSJ,\jŷ"ćqqi/6Y`tB(깳5w.jEr%TS 7 ?bu`"M'V$`,getO:@WTD?Cv&sAx2|eaҋA!77loy'Fȓg?vvB[(eJmG#8c,:3fѭ5Yo7-{SJ*;uqbq*@ ;*;ZlD+FZ0ZVP}O  $W$wOMo`Fr"HH4/AX\Zˋ ^XTn:A WxʍzMB21 1o_m7r%jN Gw/.l,#; EfeCܢO(0LM 40R3rv˅?QMV/ma/pED[e\:9{gw}&;1˻#L 6gY9=_9Yg#L&1|i+/x0C9E26kZ;t_xQ彶z {xzm}!v~tlEG|wo`Fӿz'6m.D7'`T^@( z=;;ݿU V*B0$O+O 87B={d\a6T0l,gFvڋX;5Y;4*);O@j^[#6GqZe&Id1qOu)w9ͷ<X^2'$< v]C_yt5]wI[PC~VscaO`7]3nKV[3\r`Tب ]q$w/!g gŘ̏o)XO#T /LcY^>%S7J)dRz(ZمqK>GPK8Yh.M]"fRaOT]~*r9:x_-ؗP͵HPP ) 5[3b*(~muVj} DQ2w~wzjc6ڲ9[VzKBIH^\ON˭ 'W.b~n$3}Rp3M'PE+.+%צ Rm )73$.¿~4aYzwƒ\- V7R11Ňh+b^DliiG%M 4Ph/3 % 8''M%]<a쩈Juԍg! uHpg%P,A!C@S0z 9iOM۽5 4yb1먧v;ox(ĥ 1e U[_n여3mFFTLp5inV6:LM\Ŗ#6O"\%J L#!~zP Ԇ" ࢻ\sKK` BGa*Jk-bZUh ^aXh MJ,rqbK_Hz@9w4O,L~fݏЁs{H L Vh "04ExoR>S$+f ̰Eд6S"$)lB\ˠ;MR\J4]Y_jhKr`L}@SKI#(r(E^DA @(IL6@{WwQQPQ7TQ=' rw{Gٙٙ9KS܇\.zwM\^pk!/,2:o|.wYdy᝼CnO޸Nd[JċM4`c\9%+}%f~~S$nXX+7p/@OL64:Ym#3CHz_{]m;qC=ᙾ:nϡ_9m w]suո--b~cZwt&i{4}>a !y+/l˸{g7gvWOmCQ~v(\äjMnt=n15y+_wgK7LcZqؼA~]_Ogz#/y3WN{ӓY2>i9a׹7Y4\}JSKSQeW{_`w76vZ8 ?zٲ;Z/9<4nMM/ ek/t6X:4 GD+*aң7qמ߾侧Kt_y[nY:d7+=/z% - i'nPsqo\z.מ=PQ`ꩇUG o{hk͝c˩M4Q{߼,y{wڋ#4^Zlϙ~(y1V*t1q+}}ķԍz&@s{{-zt\WP}f]} rW%Ds?1+ 8Y#3cʗs$QO=~cj;]#_<|ɐ s0$ʊaoD5/#:KZ+`҄/ 2r:H}wҝ Z,W޽h2w#bfS\oޏֆ4_\{ jھI3/U|7Ha}\<'GM9pXBy ok=+b97i*?y&q{TRg_v:3'PI5h۽e/_dAx;z"?#&]YGD v!mۯ\ipc)]̎.dnꔰ9d۵ձ뵯kFCe_|Bo/ޕuv!Ú}ud|~)/`'AMׅs&y41ЅÁ5%N ގ4(,q+>s2I6.ë ᧿L,d:r/]\|}q5篭lk{*[DV~&)Q} Ӗ7goϏBɥ\ckvo^k<4{!OvLp9zoާ̧twwmÉp&hݓLO$Ϻ̺Orz9*L[Qmvu?0rRzQre殣|_yٙ2;E/u3:=09VM_̛ߛY߬·_vacgϹ*b>C&ێRLM 8vTu^?uS6o[s~9mra@m㘲\sEEW v2mƣ[޿}wfLNS47}ㅶjz]9ƔMm <-6;y);ot7j/w~X1v R혙RI}}6KIkyh:I|mz1MU҃q8A񌙤my$Y3.>P[0]s#|x+؝O:}x[7MD9u.ܵ;ÅôT$,՝|*!Pɇ8y/c=3|yo>]>=[gŒ7+Zgnה6գc$6ʸɰCE֬78kҕ:;VF6sO^0}9Y_8r3{Pϳw ۱'NKǨ~J;q\Vm .nd;uc;^n0.skSAyC<3f6tMժ\+zwgouƅE Nuyw{|ᶍe̊ )ւȻo9?Yɿ0uIeEW ͑N_K<랶9qݏ|({m/ KWԘ`~΍m R!8x;klDeڔs3*d,G GqF|ۄGFܳ>2[uhts<17/}W(AP|g;NI\sq*>}7Ƭy0׏1F v ';NZ:|D—i[9-KF,|~0̶m`P~Z P/|0,ƮO:uleݭoQ/z_yp:Y&s> <Uva&Aj3eSߧ2lޛ^Q}B)C-o;sBj9ņ KM&pCXA:gP)Kk8daQ mns1ܙhb:6z.P/ZP^^!}BTN(rOr{;:6='[mE&Mw3?,#)擩е32wrk^_=[Oo?99zdd{Ҟ@KN|kvۭBVf7}E{_dW +?.QڷuRMnh|zlDv7j̎ν./yc27ջW_lfT(mZ㶡:Bd6ozvz~m OZ ߅l]!VVxcǟg/~M.d񎐅wg9|PGy}r4o8fz&s CM~+Cuv{qБi67~'[ެ}҅|SI{o݋g_Nw=%*uM'zn.1%ٻϝw?KlCM]ȘëxeԾ{zᓭvﲺ-a{ ֌+|w@\[5_$;)rcڗ10%Y=C)SY{wh~'X?9/SR1nS>U^2G.7FU.ӿoT٥Y{GRG'i|oz⷇WǯRo'Q=/]o2۲ւ}&3qL\\U2sו*@Lάk$tԜe' ߦIBΧƣ]1Q]Ȫ.׺UE/ۏ7qm5OXe|/nr->Ty!w[jO(VpyZF~vzj ],@C{,5s]qW'7w3?avcǖ'PQh[ф^ МuϮo_6$sq2kR;"6Ў=S5,RZ3ZB̻4s *vaPrl݇++ګ. ?qߺG礯1ٷLx|LȈs] >-޺>n||nM 3NpeS0PRśduKۦFnmJ[6 89:wǚj"^^y!"kc 6j'|E7M/#<>nmhKi_:$t0wnw!'w!֑=M{җKʵn|:cg:u-AS>WǁJ`%ғos;kdJMio`uc 7ȾkNo}ҹ;nU`\gs꯬Z8z'4pqƧ[5Į9q=oKAvOlRP|j˺16fyWݴUmEC+,c܆.F(ִ?"wֿwdvio>v[ U~|sCWP봡3/ɯn_--S#?2F:mxѧ<S[QRچ !|Aާ 2{?:tΐ:uä>_ANuz?iwd۾c.Tqwt#g&.6'G?WWk9Pv4fU.D>HJ_,z.M)L~F)SZ:xčWl?۵ZkMj+* L6Pox]7n#53oyדމӧ}O?ߵ? R~O/1Į;)LcG$r&L)')֔ȋ1b91GL3& a2f6Vfenfim"Lk |fYX (hϮa2K?ܟ=_z cE#H[֧Ou|7:_yɫWo>;Z/*ٷ3kDX^;W 2dao65n^}cUlc83u.O]2{ކYK6-ܰu}Plތ%EJdU?9kM޼5^5wMn=v[s}ki O_viΖgd<}::a?mE]?w-[;}~Ik g`{}O_?Fw-[b淯OܮqScշ/>(k{_Kw[{yΏ^PhOv, iQ~`U5㯞/E#Nlĺ^Vcׯ4W:ᇗY6zC/_wnoN%eZRɑ'w/ho+Dk7P]}c3O,wdA# FYnȱ%fr8bO':q7)y1{|4)qc>:w%!'c ؼz^77o;yvo"=;^2nitSi}|떇y ny)Mh}Lg2A:c(P&\eorZ>ŕ9kJKNFi|0O#+&;OJg΢[sXM3>>iOG:8S rd1;0 y7&>;WžYf6Xcz*n"c_}c#t)-_.A k+EO@X8%H)yɵS ;SM^6*L9iV 8hְtrMUR՝/Ӆi/S-)SZl,9rpyɣe(sU-QfC\+]\P:uxPт#KY' mYD=akN3˵P3W5Y}u5&暟CSŔOr%9ɻ3}n~I.F\T^d8b9}[+u='FGfWwW^Z\ATq"]T:22WGW+g:)x1۞zّXkQ|+Im!,ً"ERi8֐Mqh^:kNeupƣ95^~us\UOΨ33R/b9C~uWu99f}.*-2vX>F4L6E#u!w_deAUFr@~3T3_=2f~B} rP6Ѭì6^+]՗4ߕ{Vw˩~8%W' ըP|~@AtͿkO BתAE9'GhWrU"M%%IZwq^H>&wuL 9Ãwc~qdc>QsHKRz"OkdR5gǶCSwntlx!a9R97 vkq}: 9jEg+Fe i}r>?ߦ#~Y\y4kpQ/{coTb4GRghE.l;R}Muh mug+/pe!Y Rgj A+D!NNlr|$ɾԜ"OclڈSK+mչQÙCz)v;G94{,/C7*m]]1{InJqje;dR&n%-U%29I1f˥Riq3{jD+gύܼpš[:r~c|F^|#+$aL0ZJ1iʃ<'\KwHIF"ܕP# e iEr710ޞ5TVYaj#-µ=JS숁sh_/P"sZ lʯymYMבn݆ZAs]3(q(c2;Dj2e4m^*31?JK1yK/Fۄ-ϟrYA )咷}D4L[YM% (gGQpdƱi5^RmaNmrTv,粍rgɵTvpN/&jld|9D ^8IA\CMT2'|}UqUeù[ֿLWh{qzHP{KZmm +yڨ 6/uƭR ˜lP{˧7*%o:}03fjzz!մʹ5'zy,A݌.eG46Q}T!C/.;~.Đ &:_>k!7ė-M'(%G4g(k^wӫy?m!^\L6#K&++v\MsxqZc{EC?d}Eaܘ]ѽ.%z+NsDfh޸-p,Q%72\,$e?^A"jjTT(VSO1f7\5: 1uQMHz ksrr*%Hf+;?"*E>ޕ$Rc+[E:PyJNم]r} jzPx2"5 +H瓜]F*pqb{\ -ѤѲ[  ]]P#!_IτnVWS/Q}2IZLrZ*dC'PO!#d׸\DGј$MlBJm$SDpQebJur;"+/}[p7/mPjrU0Q+RU,)XnY9W׮4Rzͧ-Rjjɝ\+Xp)cv<_6un"+D陫VD뚊B_oMr7]N>N*U|⪰'KUSūϔ^xvz&MTZl]-jkLŴ+/Zf)]0V\t|r5'*>veM+Tx(@ʡ*xDQ;( 4d T~U'7\eKbSWR~ǮJf Mv0*"rh"ZL(R~W~UZ I,ۮOj}QUU\Өam%EĪ%t*,HݾȬdmmɸd{6XL`:Bk6=dB/&lք5/uau\!5_|Z30K&zTX ݕ_ZnItoN̩FA5FUf]B,*J;]_W[kbH:LRRqyeͯ;V s:Nhq_ Ixp-s71(FPrN[ucQ {* ګʮEUvRd8GTBLy4#H&7BaaBu1Ri2_~]T+5"+YhBJ7tiu^n62セ`Ȧc&kPj0B0lP.喩.BK۪!;ҪiU-JUL܃ FY(5.ޡڵ6ܻP=$P&f7VTTlWAU! w:bbuUvvRAϜ5<-St]EBˬmk|Vn;FCo @ja ugM|+Bij[ _&ɅqWu>vxG!a$үU95L#?_kV(Brd)dtWR5޹ܛ$S _WjҫʕOȾlX cyߚ^.]ujSJtRRG+ƐZ^"MJLd:-$RJNd!TeDK()LqL]L*u o?!)~ {NJNd*Zztm-OuN*!yPlf)oP4 iӿjvFWuEؚrKf AeL;L&4 Jo8R# 4KZxU{a~A/wrfQ:u0tʳ|@~zR۸}W/<|@6}㼣S"^pfwqKKU xM%r=rՔ/h3e["|VVKIUpJr|kx}rSYGTN[X*,]hϻs|G$ԢFE9vrw#FdVo篰Ph` c95Yaav,nX;󱙅*9 vSK(1n5 v dԹh4?zRii/Ny>ߥKFj(T?Uvj ߨ@rDRr˛`EE3,5̠~A>nmٽy4{Y./L3smPiu{4Zdu= x@,4^ؠdy-4@Պs}OԚPWd1뉜JgT5?l%_yܗ(nysN7yvm|ڛD¬Cjdr.!rԂ\/5Ȫl;IyQ#WK'ߎ>QIsb1=ѼDw2g*FzUȠgQ,YNOQvRtBf?W*A>\ \͔?2 iZN(27O0Y"wQar)>E7X1.TbސJʻ|J$攒?/=n65ۥA%ճZ+f)iܚkʜis*ho/ɳrlR0aKc }kHULdi,R *dKsחˏE)zwz #fh67)-uh\}QKK\g[Ͱwڬn~r5)$[\M|q^^3[rӅK˟ *.7WIʾwj-λ>9AMgnuJ}cCV+(v~:R4 rwQ <]\{Kn$0:E}yBZv^'Zi*:Y*zR7Vb>²B_Bnw6Ggm>$͢bAfU]^|^+3Džh/Iop5z݌#"NyVxfD˦1SWL'l?W }~)Qm_`e'ydҬ!{נr綼l/qYܐhяpvwFrzֆj%},~sl}Ĉ,ZnBʦAF*Oz_bݦBoP?m2?2cvȆ[7hE<=媷^7WM^Gx{{#&y.0g6VsE5usMgץ Kmݴ M&2]s_e{NK!*ddhA4Q-[=v㕹>$չ_ V*qBr47po:\2J-z~frHmVSYזV<TS)9ϪʙS Ʀs ״s>$\@TGY^^4,ڹ?+$IJJn攐緞ǢhOrf7ZM6N:ۨRٰٻdV icl|rKsZi# [Ǫ!ʭm"7CyfyAWiAVZ*ٚ_ Z۔aŹl[ʘ4`c8pk_97&8_a@iUmiZ.խ3} ٺlm#l|'q-9a*FZs]yB\ϭ|sW^gJalI:;4?V&Qa>gYyi2i"26iL.~qAjNNey%^ ͷ=Y1ja;s7r!فY_S{{E5WW=r 3{M{L+ kuo}\9|Ϗ{m &nw5 *~޾&C:4G[H@=6 9<.j0cP4jۙY#|VrTj07Dё),Ojce'xqn,ΤuC<Y EJ(*+Sg@kiz }ne`ch4ַs5Z!)+h(*jhWWK!|{H]gm@ $"Id UV& PAH&Q(d2x: JVZE Y6zulgu.@"#B\Lum&eL"z+e/ѭt#>.՗/4N;~NȘ0pI{X~<\„i} t]w\S~5Ϩ::>屃 Y|5օw<ܐ#g?|kijɤ9'i\}Kq3},}x9i:37u:3_۾ )xq8k ֫қv!^XraxYrǧ>+L5#ߋsl20%P9%n ߼'?ot~ q]fBrM|wY`ֻ.NK9$\+*bўV3Ͻlws%;G١@uEg˖҆X1[i2y_We :?yu'm>_L7zKc!Ju vl6fCfV;r5oX=ed;Wޜ'3SW2\7H I~>eSCǒ~]ȧ.d=ӗYSwOg莛I]L%P}ʓ~!;wGN>+hL2f#[?FVyֻb+/(>hf>ڤq3Fy+}rN_>}ij[x>Q×ӗ j?x<*ێ 9f@lw"ݞUL0fMYƋޅsn]& BFuJa޲:)79w!NpUQc[="ݣGM?MGZ2hOI]8lvIEMRw`hc{w k" nm}|iȶw*nP,r3'[0ڏZמy.'2m`P'5m߆=0ʶ:8H^ayacMZV1o;.ܾ=ls7Lszuz~!h*KժcN\ Kp*x%8kMaêU=vӸn쓯v5؍Nӗ7źmj_1b?\>`u{SA~9}8ղKV~nZݾ֣56Tۢ(dZFgQºN!y)֪`r_:>|ܝYy}}:m"jVӋ8yo4IۆwgvӮBrݹ`F}د P~fU2hEx1E~NMiSnEy-MG;C'p0Yd9<4b’A/WTcj1`g78/T{+clt5|Ly{Gף}\ vefKmˎ;x.[x/;n)6# apMvۓUuzK+~x~𗻷/ٙq2RM'ضMw|qc骃kSoO5,2!YsGi\+}<;Ыa5㷏&TR+33u#4w\a3G ҧ:ĺZ`qıo ˾msP2J}7?@],wԹݴz%f >۝ *Q=K"{ytWI%sXo>ts54.BܷʼqǦOii>${nowمլo .yOk ޠԶ.uGg;Gvr젰^.NrڸhL#xĕi}>2ӷUe^=@ݘ-q,)_Y<~(Eɵ Qrz%&}Ԙ'> U-JDkgԋ&(0M~+KVDĹG>{1RAHɷ_gOI3f5a2/!:&Q r./9UzȫkfyP4=rޢ~Nk*:_geg 3˶99Zʝ Xb}_p]}yټ+vq7tiF 7 d ~ya_s T)ӜvXhy斍+cM3:`úUlrsñ}w,r}yč{w]0q.ӊ":iOvA#T? 8wYDz=Gm5_qa Bv0cwOp|ƈzl~wO_6-aPs';" {Z9gk(-r#LU[GGǬW/:֚8\G;O}V|ێG=7]a`|5ѽ?'OnnA' ^g[JBtb{7|}1:)a-éi؆凓m==jYAq$ ǯjaTj{,qfke'}$]}to4Q ۳R/&W37Mƽqg}5Z1zר[_ Q ;˟Yur&=C37cWqpXrZfXOиd1!)A>}Ze^CWTs'\㮸c\%6\ _O@rEvf֜/b4wh%--?Qӯi]泵d/ Ugj.2(AX|咮2`mP"sg,e.O_zpdme)l-ʸ{tٵW6{ά*{vy>#XjSq>ws8Ã8EQZ ;a{6dEC-dn )j:@fۛ]^,ayʉNOE]i{ᷜ5V=)ݫZ6u#}]pIy-io<{ȺwW7TvqW*WS_?SX?͘66߯YX _FZGe9Moov%î'=ڛqGV?lvۛ[0:}] ۟35,noyno['&-J7m^/?ӣڛ﫪>YM\mfbǗfC|qmźOlo|fMC@umh~W??WS>z.摔/?9UAoo?-oyi؈+/hzO+?46>ͭ2߼{^e[AO?4,uC8&3.Z-鑹3EA,]w+uŦV}Gk`KCK/ƹʯilʕh]*gFV޴INX{8b%}$ϗs-;m#" Jv^D6rvCNL6l@|>Q9n}?RAo6Y;kާJۮ~ZݰźU͋nN*iuv¨h-*0<Qخz6(fE[ZJN&UoQt[~!Hvc[\$^mr>߯,%D)TfZ|YgzUEd a 0Q)L KZ9w MaB<Ͼ |v40t=a x̻*׸z%erTUNE/qK*gk]StQFYFy=C1}0̖b/6<cIU5I{]`ݤӪCvZ'l12_ILE~AqYhu۔ʳꈄph 9^42*7hɁk41G2}SBs9AT^ot]Kcj;ه4J+i*{OʞR$>,1f΅ukC yO> .R@TaWV ܟ8CTFQ{RxOاZylss4t*а4]gdTn M4;K]ٗӨYyT5Xdzq. QQ>~Sꊨgү:|٣gT5\y~i|5Z:$YYd~EONzd¬mPʛ~{fE/\QXx&yw}Ζk-3~Z>no(\.%udF2f(IuCjSvrBYL㩨"ڰs|UE^UD%_Hؠ2͖)snGԽ9Xm!~3y}˨*#}P5rOmMm0,G >xv*EfBh11ŲU&H,}YWk9d<3"4^C͹w 6WYfJ:s2X1x#eEzc>-$z(0eLYQ2=JmL.:QєIDߗGԊZ1o_#\+qj;0ua5u5Go:7ں)KT֩Ex_reJ,$|^ĻoH3mrWs4 PF Z =he]7g O[HH,;vi2n!;, cVօ ff_5|ao7+k /;#DA2d >s9zKz7=ɤoHꟳ Q\7N>ΛP,.oyfn~޽ s/7r7 Rm+lQ4F)#:Һ-ORɍʚRaz蔙"E[T#7G !hk*-',J6s}˫wn9sugÊ ``-ݿI} ʋG_@مXQ2uVWmp?gh%5GfQPDv>T}jIlyVߞ7,?I}iѫ mHBԠ:J 4q2^w޳eMcݪ99QWRaC_;6*H#"yhN#G4^gvfq̶#]A[c/^=I5":PV͹4%:Nx!:4[mjͱy_+W2 W3F[J+/,#F|n7dZog7.Vi 6z$ȕV~5` 3[O6.ٟq2A%|mgzBke·VPHԮ϶ -93An _GjNIoPGR`:fò+6Y*L0JD]Aьaag K j:yl6}i"2;Pl}NKC3>! :#"#LNT5nOa"/T hKj@0 Daa(ð!/,=/ P6`t:iGHĬ<,j/f#)}rSa}tRX "S>9tl/S1n f%)m5K~ !DZzTHk{4Rg(La)Q&Ѫk+zh—{{ʬCe֪yhXANJSKN~-|J"[ڸ슨CLZṋEb+ (ͭMA("fEe{l5>0Lʌ*]IaP fB/")d-oA+ҿtņ*"W^ų) qd Ć%:Ĥ 1 Ii!gQuxWB UOD #dPKN24YZUL-&7H[ɶe_(6$ p[|d2VG(5HE#VM۶lf y9buDCCuUE [uSՌU.w0R--IE:>SZR7 %Qɬ\2mQh ;`k5,P/JڧʭکR ^%%#gڿx:- 7̑[,cOSfFLѹ*ţ#6 eh -A^˗ʬ\9A&hk"#=.lB2+9QV-"jnTyzZEDUwޫ܊e~Y8r3; fTݶQ@2dNr?C !0wd+)-*d]#e"g eGIe-r\ xk׮RH{VQ?{r?r .%CEGs/B ,"ݧQ^vU^ ͆5C*3#+AQVz?0"g5I jB9F|}|ѰJ5G9ǍjQ{ WṢG_O-):y5Ϩ?]W;{7dTuOO ;(Eɖ~?~"OY[\xu|T 3-- X5AVXt"H׊£G^-UӃ:~_i oZ_t6XlbO~g5kB.*/8ވ !Hc\* SA$å1j"’&/[HoME>aɞmE.,[h=]Lbwt1nAGiR@_ ~L>g,ͺ[M+߹!:CJ Rqʒ R7^~!̆ǶY$[|qJ/Qn+=htQ4ib ]zH4H7уɘ<`ɻQo__A;oeegnmimʹ--̭~ t ?&4/-$#DTc 9ID6 y(%dGn2[ÊbO(D&bJ# &"U Q! )|*U8g $qD>F u84Sq.L4.H&$PPqS7TN,`5/1 FKH!a~x@%6 t0hGKt6FPJKp0s SEpa1@!d옔 S ͍6l(C g֯0 ;P6D= 1hHV Fa F 4+u /?޼RX|j!&h FC`XP| p("q 1H%JGC)\.lXCHTW)uA=ܓ1(l@Y\PT d09p~-JqA7X,N" *.ADE f>2ڀ ;f=)pRJQC R67]ZȦ@Рx6M(ɉD&@/-49O6 L|8pZ%R@SJƆ W4Q24D롨-Mp`4 `e(h/>*1ŵ"ܻˀtLB8)`kH0AdR ̐&7 2N(N(4B"+ v#Nmc>4ct 3cd*űМ1F=SX ڌKM^?Y l8mY{/ȥKEC6s()|@ui4]]lG󢀁ԆK5W$cXO쭉gXK#*<\30b#C=}P'4%o XCFbbN OHH`h *Ncx)O 2h{bv<-+X1ɘIĦ$6*64|1 0GM4(A?FGEv7& È85቟ݥi""٣ĠP!:Q~\EQz<2b2>@po$9(t* Aߕ{$ʘHTLY֐ ϋ@)C?yHv6מ&'HBMbPcFҡ M,"ƩMfv( H*/^? /7^km}~K:!#܆{I K=`1 lQ5 ֐Da$!⫚]+%@-Z VƧgѨgXC=FTPpG8-K+Fa-Dp9*ERS2rᤲqpD ']q!_L<1K 5#v>4vp`%w" 27Ƭ4ɚ*4)#eOփ)IwZ2vnq^hJj(*TLh! ;a SND;%3F간 z#q`㫗|t `_"`=xxgF#i, rL7𺟊*x$`!>!)/IdI<"%kd4CF3}H J'P*a;r, Qx#xi?\x&|hLgHaYRtPn 0Kl ɡ^8((@;I# lHŃ%ZŇ_EwDEh.Vn"8,8LEpQ(#YJ<ߝz^Q /T*EWhh0K;:M1uҺQL-T-#U*O`iQ(WBn~>X66)U0g7XE"0hMc 70;?x$(M,)JE0H04" 3(Av[IOӅ!n)tC_XPqt9 p`8}-hs4cly|X b1 qt_L?jW[h±k"S['[Cb5aypߥꦛ\@b@(ѣu1(1je1ĢL&hp na4FyB,}-L,6hhGMi.4\fjzW%P+Y]@ASy(-XЁFPaz/Jb.huJFI_a Q=q}C ݑfi``:_H4!:sc!u}I BŒJ ٰ.h>pBbpUE3ƀWb`DZD>IH^T^ob0[߀w@놋V8\(W&'a wx@1K,zx$ =BgtS:-՘(f ܔb+lt-@5X:I᭺mQs3{]tx8-Ϯ(ڳ%D2`Kf<8xx B}Br@&-1" [Շ9WX3~%j :&&(I`~ş: h~Lq6_?6Ɵ6߽menf'ot ۛģK#{+Ŏm DAE+pi~$hChv @x>MdxzyQQ0U@#D:!`$O<.6*+"ZAxDxQ'g2~j@WNt(WI D+.1% }0 P 5EE["l"/ xp%bLW7?/ ( iI@$|ӏ dŊYbO̻#+bMM{];m 7wB@+0%{s=hfK(?2+Iԕ\PL[{&HSE)ItQ3럕z i[ee )zxTv8`d'B=oKt hh'?/Rkn!= @sp2=dC?{ɯKXi|$&3xbwMD޶Tq8۱a] hkot\'1,X!؋0cS"˿b'g=;":)+9 ?.ZA3mqtoeCςIA]q۠ 07Q}xZHRu0*[FTiGEdI0b)Q^n^AC'ݍQ$*j"`?wG&"!ֿ>v1Yp_ l!0I;ކ~8-@m4qDŶ9.ȸfD[tV'`1(4fy8|4)|i7]r 耤H1Vo] 3%TzCVY<ܞXœH?qN~9EiRNm%';YX37|k`4KD[9My&l䉉B$WO=T6]\Н)Nc@w\!VN|d?߯ۘ>~~~~S?뙸_H)ɚCB'S99RPQ)6x;SNB|yOzS\VSEaZh=-KN_t˥pfg:KnRܚ V<¨c}H*Zsjcn0<ѣǾ; Ǒ(co En>h Èw-[:@n7qzNҢw8Nz!fY,_Npnx2ph%: A#qPn#!Pq9TEmfljd%ͿOq `r+_SS<cFS06r;h˩]X#܊Z"CYhR÷EJYiB"B1' %팢4w˼_ؖð3 ,Fc4 \h':4hFNKYG%@(v*$DƉޭ~lQCIꞪ e(;7qY8'|B0+a(Uc){g0CD䑐]$MgDH9vô2'qfX/qngd*LNhq_K8@tA}GOn8{NG'k;*LNpN.( N,b/~&!KtHHCR)W苟3fbp9B1Q@w×__#REm~'Xgx?Kwww? MҺ 7X=Ϋ' g %;&Kb0rY]~_XAEzDQ'ۤHR@K߸4':;} ]TT0n@Qx<.T(P.@0Kc']tZwL5?y@})CrviET/0e&QYQLqWvPQNt. 8PMbQ!^#BC''QmoP$]qQ0,k7ZJM'-a/ǂPu5]:>a= _Y;}puLcq<^%>-J0-h&%n'QHt 8`:?)<\R~AGmDqe N qC3-n<76Qv2 [K ŒD *v_Þ.؍wP["A  HN|WM{Ti`f:h!<ԇIf`QxO~̽>gjwIќTqcbc&A+1QĬ"y.|.ճ~r':: ;6/4#'En0b;o&w)jOkKsmo _dWI%1J\X(?*e!]s~ O:Gꯡ#KG,)BT?du}I螯Kޗ, ?K2q&_w_r,\F DD绳"D3=[4́XΥ;Z .ua/Q]zEBe'@_'68?'ȷ*1ɖ8pbDMD{-M"l.*1 =S+8V,E0GtH' ]OSh-)4t-nB:0ŗѢλ+G.#>r&`O37Cb4"8_]Ó'^"A=|쿐@ΊJ֠%E[hrɉXz[Mt/fJ3l1-fs_*Yoh-\o?rf>p`/7DZjc nk 3A[0 \d`8ãRnD+{ Aa6I%NqYp@h d֯SōV6(B8T~v24Nka_B]uX2A񭾝hQQͿ@h6O7z9V'\1’?;IjY?/Ui? q׳ Kz耍N$O|3$$X2ؤݵ'Kx J}g\(NR}^,:ȂISADoq0˂J1b'C<-pCBɨhPHQ`Ftɿxޓ1vJZ0X[0-,lAyK+ȅ!Y^#$05"ث8QbKQ3;;30]tl팱Gtp#Z6im5 -k7q1 ;49<?P6  cǰ`(rB[rMBQ6#b̈́!ElV|c ,8b"nbgea΍1LXGk4/ ;5+<IN{ƿp|hbo ;xS),ٸGMg41&&خ lL!XE# A݊iTOQX* gF ,蒙?N-ʉVP^$HF$1 .oFa&Z^4N綋& #'cÌ1F$V4~Y!\"%6T4Κ"P˃ېr,0cm0>8!5!L((KGΠ)\OCn#<λpS<&8wPc78$=o@ J"vĈ z1i pl)֜眾@`.Ư{IΩ|2w{:̡[.+`ӷv˪FLTewebMrٌ24Z1G$#C(#6b*H>RQٵ̥L'V>2ʵ{wl )A$k)m+6 } B(pEjԾHMId<CaI,qeAЖZר!l;Ѱe頷v`kmGa׮XzCvMꤐLF*hd#{9y\u~eG$nc[13VI\e&ƻF`ռ4| .\#htv+4&M?haށ-Mn8q# RNӄ$/T`P|[1@;jbOfSBf"{M2ù,CLd"Z@t+Ĥ)-wJ,*| ګu^f ލϰG$%YI0G;jg#BlPbHb;W,e<M"iB(bD&xo P/Ɇyo|e! c Y25`a =eLwX8ƆQXYA<.Uq\A0Zh:6s 3}%,c|2$PڠzvmROz D-J`29}eͺ냾xE|%p-͐t@fL-XK&dP"G5&sI$1똢R  mec`zprӦHQ4}"WxAwZFMYGG>k z)W(MC0X-fsz*Wr+lFyN!b_/ ' 3C#f%=\88AkE("1;pgA,^`${W9ڢc:gG>m A"}gFp`*894PHzHdâI'{aN9 -J-M4XCXc&@3 C|ppi#F3C:-X/HiE0JiVBŊuM@S})p#KGjךyiA ֡XpXNt`난KꂬֈXZkNN,qMKfO}NB=hșϽ;;wcre Z@ cL8VEyou(gIydԇ>8gV \wf,_¿G#o}Vl%7{<?v[pxye@nYdXdE0@G πXĊ V׀GJtc_K8>*rI^sULT0+!皸pd{GJtWd\ p!Sr>F:m:+fBshNܿi˅ Joh2xXA0ؽU^:-&drPG-ؚ#SL(w(6}+*= #A8{7(zZ**x^|8\BOx(K`d/r/kO5&7ԨqfF; fD1uX= be?aۨ!QDֻQ4G_$˗0J6qZh]q&Z4le6 0`R}AaSk]qUN @M\dʕEiqU`'u lQs3H[c&ŒNNO_jzר6w-jخC?.W &8" 'ţ"/8˺R9~M.2{m@'kuB쟰j+lS/ΐK+6F5'UM""sޓkeWXϐ66* o@LY$ks[|!MXsj{UlO*yR/iMIsvH7F+ Ѻ/7$hl'%2 Y# ={p]KӒ<`҆(Q}sKFTVh"R2R 2tfz| 1A2('!0 4kl4%8(}2p! pO+>UA</ײzXf(V[x}CI0ht`MreLv$gKTD85@kXH}cݠhwqb3 fztՔ;sztAp@0ҁ#ǗSMOW+5D瀕Z(׏VXNJ0#MR"t{KFk?Q^  EglmDL8$0DdL1n\8B;t!6x68.%_s" $1U7aHuް{G}I&i=S6'H0 ux|J"ёm4幥@M3HLAHuU@)@ܓ M2d7Ɔ%|pO.-U5mPABlVߥvpfL;>#HSGdnHEx@&:16⦁]Ggo%cAhl!BD @Oo[ mZ@`1U.tnWC,5vNECxRh]P΋,wv[h#k5?NqrZ{JmAjWf;SƁs99 {ӽA4=ũzq8&kN9rEāq}vM =xFnE5?'0{ #nǽ]2~-`f0C.[@h9q?mZBtի3<5`XP x9JB7'g/S:hx_/{;qGcliJ >ֺ̧;ABůP,+@Crfa4VR$عa ƳG @pv_n88 k1&`*~>U҈چĩ!ʒD\;8}ge);'l鶢ÿXqsv [ K` lZKyxW'zv1@MHvR Y=ڵ Xg (Rǁp'09DG `3mFYzJ?|9b`9[pv> %vXayId؜?,ډč"*H'}"3=lNgP0pga'r5Z}=Jv0)a1Y !Q(85ՅɾܱPx6,(l3 {FyMKɄ6PBxxװ.F $)aÉ!-3S 7T_[ XXf o = |8TYs|{&Z"lA-LX;f O2at'V(,jepXEmH,2X2FS"#>=L֟*kj~ADR6"Fc LfܲjQ؃ ? 0 #3e2OhJMXMOw!4Мՠ0Kxq 9I0k]gGyLEp7Pލ-QY#w(wxӌ^tf.q7~m~1k3u(GL);[ oM[ċ% P`#A؍1JT &.!Ѩ^d;,9*jX(P`YCuāv0HԺ#QȵQ@חTk";&EF!^P#FChprDG=H0L,R(őƵµ5iƀ3.PyfL?awǤ+k1ڣǏW0/>tƁ X1~s~(ҡzgAxgAx 9BU @92 u7e w!%H&Ffm֝9c ( *By8"g;ixs `6=`:gvYwgByUQk?gny-ρB(6l}Ug͸:V m1H 颵jsHP0!%O 3GK'hP^xA*`}l+]Eȧ*O!ҟGwpY' *:KFGޥ7T\njcCTʪ cG߰e]s™Lfhhs٫n" g?i/~lϒ44fi *<$)Ir˄bX*ߓdޓhRR5i !mpB9ˑo8`ʤ{d-_E/Hak0^Bzo^~DPΞc]w`vuezFXmWL %zbMc$YnNb Km؈jD^Á[베xsNr|LR>% kB#JNNeJVJ(UKd)ᅓL'{|rEhwy8A{{Lg&俙w_g63O@:!Yc=y?xk+Yefw?όA36k'@p no=89<^uQΰQG"ʓc s 禤- QmTXDށ~ۻ<܇N(5]uB RkeƬ8/Ď-RƊ{\|.mzp88mV@R `T|+}eѩҙn2#cju /:x7k$-Uv0kc%"KC%6NL&31oO-H﨏 㵜wό3nkKbrm?Z|ʿ&2ז+$YEy>W`e0~UVU-[m՚fE-,VH>D?J̎L{ к?0w)TfM~ M2&CtB!@?%:$%d<їfl9Py9SK0"VBin.VD>) ksna1h3iPbhaXMy *l: b@bO9Y]AE6& 3ON||dJ4n,[qIcƍGHFB{P>;>ˢ(]PnN&)xJd:48~ӬZU]Ӊ1~[\"ߙ #y$-s{^}ȖɪmeJF9?13s֖^?gtn:I-?lQPf@ y#|]|OO:0h] ^) eWޖg>>USyɍd8LQښkv>rV]}uu*`.f!aNp&.ϝb8mw_kˏ?OjJnUk'yևN3I&-DSjɵ5;TDQh~s?֊K$)XbŦi|j3V6}wAL}OR|wleRU^2s)P]=jtͮNgҩfje~`]O4-}[]~LwJn Aܻo.FRVKE@YTVZdpΜvEuX3j3pN4.N\ w }es@_qfA WwncH*Ub#^sdK$19O;i>֝(Ln3{3/ۏElETq &zaŋ)%3Jy;0ist&+"D{L0gŭo$U gjQ3@[.$b;v'X^-Qg0ʼ'ZZZX-31{;3bL|dGoU?SA"qԼ*&z9?<{ǯok^!wff ^ڻUoLz "_(*3+[ހόx3F5A\УIL3sN\Ev\) NXLUZJ$pŨ-IGQϪ|$nHd ) 8*X$&k3 )LdzKЃ9*s =B(~N9%S<&G屲ߪhȈ(b6JHJP;w9Fշ'pY+XÁʏŦTR)GOoKک/'.$zj.d-O+'7hpL-k8~_ Xr~aNS˼^~k󞸇{:ztHr@EItssTm#?m#G6> 7~UIq@VVh]{?KRn} >;Cܺ_r^~)na3h甍\7bA_h43P4Rf#oHf]bEU-oi>\,(5 v_0t"Fds) d°U\lo)ZQ 9eW^nKת GFjz+b08u}tq;B7XWa%WIL\G:?myTHTe%wRE";@5:7*ʻks`;d1"S9tz`*, rW}$Q=طq'W mwai1K Nx < -AKjB Y0Z`vi hFBZ$2j} j>A: ʷϷYC9~-sRuS|oSڵG/9 hxj3Ԁ*Ԙ:р]KLy'ӟ샌^>-/x&ύ۟/`6s.nGqߧɌHg0!L<+Vr36_^Q ұVsv*}^;c?L$gx^7fߟ$~(;|io'پ8jk\/wY=}\^䥙^{طu 0b糽_Цf5{>ˮ窝Ã]/= 3a˭!Y*@V"V+[I]\*5,AZnXLx/8&h\8\@[:C8ڼ2*셊E6W[/a]0V&{撷O%9Zb):ٿmluĔHe%a1"[ %6FPI\ x%++Ny]l\>UkFtxH"`pQ"nɼ}s%.!Mh&5v"i1FZH ] ZJ?Z|6mLOؽ3Ȍٟ9-(a%NHB@m;AIo `Y |RH@LX^ ϳ@UʘW/ 4@ nR쭰](߰L{EpsZ&i<<6^p }OA\-lzbSHrYcc">pa$NGuo>V0y<4sG b|Ϭݳ!3!>*Ϟ/)<\Z=fo1IҟlɼpU $t"D9S ~AYV=fDؼ\FfІU ff,dbGTN4>O۞ӗs>EOp SöYOZA砉FhOWH9֌GIR4Q<yl ,؟5q Z#MU9q(wZF >/3.`T4洗;R̿- M%V%]ӑэt٬;B=~dG"(b3됸iMa;ɘ$ZЁ+EԊZը֧DMC-͡^Gwm6^nZ6'8ڃuOә( ůgMF~GM^5k ER{n7X/?0 :$_{nEk_3礧{S%JRyelY2!\ӆ#2-"OTt ?ݲSo6I7 RұqTu9Hԇ/ ;(_D5xUhVjgD@]"TV[|a{tNmZk2u:ML)Z{&%..a@eH!.f}ԉ\eRt A*M Jo߼㻧u,h \1+@oܤ 8 0)P7.t jAAahd!sΎ;-|tzbJa:`rE[4مz .d95VE9Cȑw TL_n{ W0`7{+x0 %`ю?@bV7EqŊU}.q2EE≹fbo\{i{ g0h5K姖xoƚ_0Ol_1Ե<΋ 7d' R`9^Oؐަqs1F )!I@4qEML$@EA v гpʛ5(NڊSJ!sl&.g#z9NuUp}p/Rˤ +_"l|cHe3#(BE%QޝJcV28$?w6c:mRq`1y ,"CFmoclԢ) +]1 /w&GQbqٙT)JMZn6kjvKL5:xNYŋ/ONwW9GaDgF6N$$*gAgAk +OD(i[)O WCU1R闂s"= {7%w%bU64սEt1եo%YUyؙ8"K((nS85Ezϥwiz&.3wʃ/v S<ƨnq/Lv<&u+K'4imc.nJ,r 16tBTcbA}؝Bij˜횘þafϔ4ң,<3oKG_&YWIJrx+4pO$Da~6.?ԁ57s.KӦ繯K&kIDDIDIv8'_ .X˔F^SN~lbyF`=MSm׹Hsq+ Oڕre䞼uڼ>&.=OKk+=Z{Lf}R; `{4߀pspH7SrT}״((o!͎Spؠ*uduulE׀1kF7p:AVY׿Ůzj*ՆqT (Wݰ(x;WիNp}!*hb̻ q5^^;?MrdR1LW8F=_q>+0p^!+> PK yu.JRE-YZ |ybžF|=0Dnà ^6+<&.7,wxk d|J=o:mN5 Xޠ[m;s^E[^y+2p䣹RqY6ɡJYug>KaM\}ekzV5ڿo B;&DzǛTA&Y 2pHy#c_輏]n;7 Ȥ@ cK6],Q(7J$xЄ6|^{3 mEk~iyUےU` oX FrV?.'iX(ؠ*K|P6K:M6El2[h-#ѣ= X!:z;= cg4;a{M)i JNdZMtl8ONV-,gf5-udNv]+/>r}w8hnĠ7D_ӿpAӑ66?H NLުг|ϭǞO]c3b SwP`wցZ|Iq'.)Ғf٫12ȃ6an -B}A$+\"7@;P] ,q|~xR5v8e$98-^6@ws:&8=Υl Ti>@(ǯ^]W%b;LVnuI|FLTɡ_nxiՕG+O,-vuT]́ne j{ǃx~ O_l4.-@W䜧7Nw9/:Z:)[4#PuNY\'%mIi~*M^vfbxbd$)%fԿud:)2v 1i8婖u)%&RL%W>λn$ݭ.R'Nnb[Lh#A;KӨZOjW\Q[[e\HCˀ B/ L;&I_n_r Bt{G璏 xJCD2lC`[XgYN^$]ĩ F礬-)48@M}hhf}0UT$Hˬr?J6nS{Mf]P ,.ٱWC=3$]IqjUJ\Zn oO7 t_36LVޖCeGf;WPA[IyJ/$jX+jwJ6kei:o/ng^OWڮ]0?^]=Rw77).x>+d ˾ T뿖Д>oKNxoozF'" T n}w؁f^^tX7~t @%=oZ?OygC51L0 EB} M;LZ[{[&j󨬬aa嬨5evNd_y(:Yvb0D3@-#Tš=\P$@w} M)-r%,%:h՗?w1gtY4ꔇqp;i/V)U4v8%sߚ o0]ҰmswN]7<ʩa+ohN =uQ/^Ԅnn\  ^tIE+s ]8xic%Px5^P,N4Yu`K"׼Z5wf43} 0/=Zyg>?.)dٰ2I84!&d8#kg̞3{f=g̞3{f=g̞3{f=}?{torque-2.4.16/contrib/README.pbs_weblite0000664000113300011330000000427111272401247014656 00000000000000# README.pbs_weblite # contributed by Yuan-Chung Cheng # updated Mar 19, 2004 pbs_weblite version 0.95 Summary: PBSWeb-Lite is a simple web-based interface to PBS/Torque. Supported systems: PBSWeb-Lite should work on all systems. Overview: PBSWeb-Lite is a simple web-based interface to PBS/Torque. This PHP program is based on Paul Lu's PBSWeb code, with substantial re-writing. Since most of the PHP files have been re-written by me, I think it is inappropriate to keep calling it "PBSWeb". However, I really don't know how to call it. So I'll call this modified version of PBSWeb as "PBSWeb-Lite", at this moment. Actually I would welcome any suggestion for a new name for this set of PHP scripts (TorqueWeb? :). PBSWeb-Lite 0.95 is available here: http://seventeen.mit.edu/blog/platin/pbsweb/pbsweb-lite-0.95.tar.gz I have put together a website for this package: http://seventeen.mit.edu/blog/platin/pbsweb/ Thanks for works done by Paul Lu et al. Without PBSWeb, there will be no PBSWeb-Lite. This is the first release of PBSWeb-Lite. PBSWeb-Lite is a substantial re-writing of Paul Lu's PBSWeb codes. Here is a list of differences between PBSWeb and PBSWeb-Lite 0.9 (BUTF Release): * All PostgreSQL related codes in PBSWeb were removed. PBSWeb-Lite does not depend on a SQL server, and all required parameters are stored in a config file (config.php). * Accounts for PBSWeb-Lite are now directly integrated with the Un*x system accounts. PBSWeb-Lite use a simple C program (spasswd.c) to validate username and password (assume shadow password!). * PBSWeb-Lite support templates for generating PBS scripts. Also, now it is possible to create a new job based on a previously saved jobscript. * PBSWeb-Lite has a simple web-based file manager that can help user to view/download/delete PBS input and output files. * * And many other minor changes that I have forgotten. Read the README file in the package for the instruction for the installation of PBSWeb-Lite. torque-2.4.16/contrib/qpeek0000775000113300011330000000714211470340444012534 00000000000000#!/usr/bin/perl # qpeek: Peek into a job's output spool files # Copyright 2001, Ohio Supercomputer Center # # Usage: qpeek [options] JOBID # # Options: # -c Show all of the output file ("cat", default) # -h Show only the beginning of the output file ("head") # -t Show only the end of the output file ("tail") # -f Show only the end of the file and keep listening ("tail -f") # -e Show the stderr file of the job # -o Show the stdout file of the job # # -ssh Use the ssh command to remote access the mother superior node # -rsh Use the rsh command to remote access the mother superior node # -spool= Specifiy the location of the spool directory, defaults to /var/spool/torque/spool # -host= The name of the host to use in the filename for the jobs stdout or stderr # # -help|? Display help message use strict; use warnings; use Getopt::Long qw(:config bundling); MAIN: { # Options Variables my $tool = "cat"; my $spool = "/opt/torque/spool"; my $host = "set_the_host"; my $rsh_cmd = "rsh"; my $help = 0; my $o = 0; my $e = 0; GetOptions( 'c' => sub { $tool = "cat" }, 'f' => sub { $tool = "tail -f" }, 'h' => sub { $tool = "head" }, 't' => sub { $tool = "tail" }, 'e' => \$e, 'o' => \$o, 'ssh' => sub { $rsh_cmd = "ssh" }, 'rsh' => sub { $rsh_cmd = "rsh" }, 'spooldir|spool=s' => \$spool, 'host=s' => \$host, 'help|?' => \$help, ); # Set OU as the default spool suffix $o = 1 unless ($o or $e); # Print help printHelp() if $help; # Get the job id my $jobid = shift(@ARGV) || die "No job id given!"; $jobid =~ s/\.[A-z0-9.]+$//; die "No jobid given!\n" if ($jobid eq ""); # Get the mother superior node my $node = &motherSuperior($jobid); die "Job $jobid is not running!\n" if ($node eq ""); # Format and run the command my $cmd = "$rsh_cmd $node $tool"; $cmd .= " $spool/$jobid.$host.OU" if $o; $cmd .= " $spool/$jobid.$host.ER" if $e; $cmd .= "\n"; exec $cmd; exit 0; } # END MAIN #------------------------------------------------------------------------------ # printHelp #------------------------------------------------------------------------------ sub printHelp #() { print STDERR < Specifiy the location of the spool directory, defaults to /var/spool/torque/spool -host= The name of the host to use in the filename for the jobs stdout or stderr -help|? Display help message EOF exit 0; } # END sub printHelp #() #------------------------------------------------------------------------------ # motherSuperior #------------------------------------------------------------------------------ sub motherSuperior #($) { my $jobid; my $node; my $keyword; $jobid = $_[0]; $node = ""; open(QSTAT, "qstat -f $jobid |"); while () { chop; if ($_ =~ /exec_host/) { ($keyword, $node) = split(/=/); $node =~ s:/[0-9]+[A-z0-9/+]*::; } } return $node; } # END sub motherSuperior #($) torque-2.4.16/contrib/init.d/0000777000113300011330000000000011614035164012744 500000000000000torque-2.4.16/contrib/init.d/suse.pbs_sched0000775000113300011330000000277111272401247015526 00000000000000#!/bin/sh # # pbs_sched This script will start and stop the PBS Scheduler # ### BEGIN INIT INFO # Provides: pbs_sched # Required-Start: $syslog $remote_fs # Should-Start: pbs_server # Required-Stop: $syslog $remote_fs # Should-Stop: $null # Default-Start: 2 3 5 # Default-Stop: # Short-Description: Torque scheduler # Description: Torque is a versatile batch system for SMPs and clusters. # Starts the PBS scheduler, which runs in conjunction with the PBS server. # it queries the server about the state of PBS and communicates with # pbs_mon to get information about the status of running jobs, memory # available etc. It then makes decisions as to which jobs to run. ### END INIT INFO PBS_DAEMON=/usr/sbin/pbs_sched PBS_HOME=/var/spool/torque export PBS_DAEMON # Source the library functions . /etc/rc.status [ -f /etc/sysconfig/pbs_sched ] && . /etc/sysconfig/pbs_sched [ -x $PBS_DAEMON ] || exit # let see how we were called case "$1" in start) echo -n "Starting TORQUE Scheduler: " startproc $PBS_DAEMON rc_status -v ;; stop) echo -n "Shutting down TORQUE Scheduler: " killproc pbs_sched rc_status -v ;; status) checkproc pbs_sched rc_status -v ;; restart) $0 stop $0 start rc_status ;; try-restart) $0 status >/dev/null && $0 restart rc_status ;; reload|force-reload) echo -n "Reloading TORQUE Scheduler: " killproc pbs_sched -HUP rc_status -v ;; *) echo "Usage: pbs_sched {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 rc_exit esac torque-2.4.16/contrib/init.d/pbs_mom0000775000113300011330000000344611406742456014263 00000000000000#!/bin/sh # # pbs_mom This script will start and stop the PBS Mom # # chkconfig: 345 95 5 # description: TORQUE/PBS is a versatile batch system for SMPs and clusters # ulimit -n 32768 # Source the library functions . /etc/rc.d/init.d/functions PBS_DAEMON=/usr/local/sbin/pbs_mom PBS_HOME=/var/spool/torque export PBS_DAEMON PBS_HOME if [ -f /etc/sysconfig/pbs_mom ];then . /etc/sysconfig/pbs_mom fi if [ -z "$previous" ];then # being run manually, don't disturb jobs args="$args -p" else args="$args -q" fi pidof_pbs_mom() { pid="-1" if [ -f $PBS_HOME/mom_priv/mom.lock ];then pid=`cat $PBS_HOME/mom_priv/mom.lock` fi echo $pid } kill_pbs_mom() { pid=`pidof_pbs_mom` if [ $pid -le 1 ];then return -1; fi retval=1 while kill -0 $pid 2>/dev/null;do kill -TERM $pid retval=$? sleep 1 done return $retval } # how were we called case "$1" in start) echo -n "Starting TORQUE Mom: " # ulimit -c unlimited # Uncomment this to preserve core files daemon $PBS_DAEMON $args RET=$? touch /var/lock/subsys/pbs_mom echo ;; purge) [ -f /var/lock/subsys/pbs_mom ] && $0 stop echo -n "Starting TORQUE Mom with purge: " daemon $PBS_DAEMON -r RET=$? touch /var/lock/subsys/pbs_mom echo ;; stop) echo -n "Shutting down TORQUE Mom: " kill_pbs_mom RET=$? [ $RET -eq 0 ] && success "shutdown" || failure "shutdown" echo rm -f /var/lock/subsys/pbs_mom ;; status) status pbs_mom RET=$? ;; restart) $0 stop sleep 1 $0 start ;; reload) echo -n "Re-reading TORQUE Mom config file: " kill -HUP `pidof_pbs_mom` RET=$? [ $RET -eq 0 ] && success "HUP" || failure "HUP" echo ;; *) echo "Usage: pbs_mom {start|stop|restart|reload|status|purge}" exit 1 esac exit $RET torque-2.4.16/contrib/init.d/debian.pbs_sched0000775000113300011330000000566611272401247015777 00000000000000#! /bin/sh ### BEGIN INIT INFO # Provides: pbs_sched # Required-Start: $local_fs # Should-Start: pbs_server # Required-Stop: # Should-Stop: # Default-Start: 2 3 5 # Default-Stop: S 0 1 6 # Description: Torque is a versatile batch system for SMPs and clusters ### END INIT INFO # TO INSTALL DO (as root): # cp debian.pbs_sched /etc/init.d/pbs_sched && update-rc.d pbs_sched defaults DESC="TORQUE scheduler" NAME=pbs_sched DAEMON=/usr/local/sbin/$NAME PBS_DAEMON=$DAEMON PBS_HOME=/var/spool/torque PIDFILE=$PBS_HOME/sched_priv/sched.lock SCRIPTNAME=/etc/init.d/$NAME export PBS_DAEMON PIDFILE # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables [ -f /etc/default/rcS ] && . /etc/default/rcS # Define LSB log_* functions. . /lib/lsb/init-functions do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 } do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 rm -f $PIDFILE return "$RETVAL" } do_reload() { start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; reload|force-reload) log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? ;; restart) log_daemon_msg "Restarting $DESC" "$NAME" do_stop sleep 1 case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 exit 3 ;; esac : torque-2.4.16/contrib/init.d/pbs_server0000775000113300011330000000236311361400725014764 00000000000000#!/bin/sh # # pbs_server This script will start and stop the PBS Server # # chkconfig: 345 95 5 # description: PBS is a versatile batch system for SMPs and clusters # # Source the library functions . /etc/rc.d/init.d/functions PBS_DAEMON=/usr/local/sbin/pbs_server PBS_HOME=/var/spool/torque export PBS_DAEMON PBS_HOME if [ -f /etc/sysconfig/pbs_server ];then . /etc/sysconfig/pbs_server fi # let see how we were called case "$1" in start) echo -n "Starting TORQUE Server: " # ulimit -c unlimited # Uncomment this to preserve core files # if [ -r $PBS_HOME/server_priv/serverdb ] # then # Commented out by dbeer. This if check (and -t create possibility) will blow # away the serverdb file if $TORQUE_HOME isn't the default daemon $PBS_DAEMON # else # daemon $PBS_DAEMON -t create # fi RET=$? touch /var/lock/subsys/pbs_server echo ;; stop) echo -n "Shutting down TORQUE Server: " killproc pbs_server RET=$? rm -f /var/lock/subsys/pbs_server echo ;; status) status pbs_server RET=$? ;; restart) $0 stop $0 start ;; reload) echo -n "Reloading pbs_server: " killproc pbs_server -HUP RET=$? echo ;; *) echo "Usage: pbs_server {start|stop|restart|status|reload}" exit 1 esac exit $RET torque-2.4.16/contrib/init.d/debian.pbs_server0000775000113300011330000000566211272401247016213 00000000000000#!/bin/sh ### BEGIN INIT INFO # Provides: pbs_server # Required-Start: $local_fs # Should-Start: # Required-Stop: # Should-Stop: # Default-Start: 2 3 5 # Default-Stop: S 0 1 6 # Description: Torque is a versatile batch system for SMPs and clusters ### END INIT INFO # TO INSTALL DO (as root): # cp debian.pbs_server /etc/init.d/pbs_server && update-rc.d pbs_server defaults DESC="TORQUE server" NAME=pbs_server DAEMON=/usr/local/sbin/$NAME PBS_DAEMON=$DAEMON PBS_HOME=/var/spool/torque PIDFILE=$PBS_HOME/server_priv/server.lock SCRIPTNAME=/etc/init.d/$NAME export PBS_DAEMON PBS_HOME PIDFILE # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables [ -f /etc/default/rcS ] && . /etc/default/rcS # Define LSB log_* functions. . /lib/lsb/init-functions do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 } do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 rm -f $PIDFILE return "$RETVAL" } do_reload() { start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; reload|force-reload) log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? ;; restart) log_daemon_msg "Restarting $DESC" "$NAME" do_stop sleep 1 case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 exit 3 ;; esac : torque-2.4.16/contrib/init.d/pbs_sched0000775000113300011330000000162211272401247014542 00000000000000#!/bin/sh # # pbs_sched This script will start and stop the PBS Scheduler # # chkconfig: 345 95 5 # description: PBS is a batch versatile batch system for SMPs and clusters # # Source the library functions . /etc/rc.d/init.d/functions PBS_DAEMON=/usr/local/sbin/pbs_sched export PBS_DAEMON if [ -f /etc/sysconfig/pbs_sched ];then . /etc/sysconfig/pbs_sched fi # let see how we were called case "$1" in start) echo -n "Starting TORQUE Scheduler: " daemon $PBS_DAEMON RET=$? touch /var/lock/subsys/pbs_sched echo ;; stop) echo -n "Shutting down TORQUE Scheduler: " killproc pbs_sched RET=$? rm -f /var/lock/subsys/pbs_sched echo ;; status) status pbs_sched RET=$? ;; restart) $0 stop $0 start ;; reload) echo -n "Reloading pbs_sched: " killproc pbs_sched -HUP RET=$? echo ;; *) echo "Usage: pbs_sched {start|stop|restart|status}" exit 1 esac exit $RET torque-2.4.16/contrib/init.d/suse.pbs_server0000775000113300011330000000327211527304735015752 00000000000000#!/bin/sh # # pbs_server This script will start and stop the PBS Server # ### BEGIN INIT INFO # Provides: pbs_server # Required-Start: $syslog $remote_fs # Should-Start: # Required-Stop: $syslog $remote_fs # Should-Stop: $null # Default-Start: 2 3 5 # Default-Stop: # Short-Description: Torque server # Description: Torque is a versatile batch system for SMPs and clusters. # Starts the PBS batch server, which operates as batch server # on the local host. ### END INIT INFO PBS_DAEMON=/usr/sbin/pbs_server PBS_HOME=/var/spool/torque PIDFILE=$PBS_HOME/server_priv/server.lock export PBS_DAEMON PBS_HOME PIDFILE # Source the library functions . /etc/rc.status rc_reset [ -f /etc/sysconfig/pbs_server ] && . /etc/sysconfig/pbs_server [ -x $PBS_DAEMON ] || exit # let see how we were called case "$1" in start) echo -n "Starting TORQUE Server: " # if [ -r $PBS_HOME/server_priv/serverdb ] # then # Commented out by dbeer. This if check (and -t create possibility) will blow # away the serverdb file if $TORQUE_HOME isn't the default startproc $PBS_DAEMON $SERVER_ARGS # else # startproc $PBS_DAEMON -t create $DAEMON_ARGS # fi rc_status -v ;; stop) echo -n "Shutting down TORQUE Server: " killproc -p $PIDFILE $PBS_DAEMON rc_status -v ;; status) echo -n "Checking TORQUE Server: " checkproc -p $PIDFILE pbs_server rc_status -v ;; restart) $0 stop $0 start rc_status ;; try-restart) $0 status >/dev/null && $0 restart rc_status ;; reload|force-reload) echo -n "Reloading TORQUE Server: " killproc -p $PIDFILE pbs_server -HUP rc_status -v ;; *) echo "Usage: pbs_server {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 esac rc_exit torque-2.4.16/contrib/init.d/suse.pbs_mom0000775000113300011330000000341411301310217015210 00000000000000#!/bin/sh # # pbs_mom This script will start and stop the PBS Mom # ### BEGIN INIT INFO # Provides: pbs_mom # Required-Start: $syslog $remote_fs # Should-Start: pbs_server pbs_sched # Required-Stop: $syslog $remote_fs # Should-Stop: $null # Default-Start: 2 3 5 # Default-Stop: # Short-Description: Torque Node Manager Daemon # Description: Torque is a versatile batch system for SMPs and clusters. # This starts the operation of a batch Machine Oriented Mini-server, # MOM, on the local host. ### END INIT INFO PBS_DAEMON=/usr/sbin/pbs_mom PBS_HOME=/var/spool/torque PIDFILE=$PBS_HOME/mom_priv/mom.lock export PBS_DAEMON PBS_HOME PIDFILE ulimit -n 32768 # Source the library functions . /etc/rc.status rc_reset [ -f /etc/sysconfig/pbs_mom ] && . /etc/sysconfig/pbs_mom [ -x $PBS_DAEMON ] || exit args="" if [ -z "$PREVLEVEL" ];then # being run manually, don't disturb jobs args="-p" else args="-q" fi # how were we called case "$1" in start) echo -n "Starting TORQUE Mom: " startproc $PBS_DAEMON $args $DAEMON_ARGS rc_status -v ;; purge) [ -f /var/lock/subsys/pbs_mom ] && $0 stop echo -n "Starting TORQUE Mom with purge: " startproc $PBS_DAEMON -r $DAEMON_ARGS rc_status -v ;; stop) echo -n "Shutting down TORQUE Mom: " killproc -p $PIDFILE $PBS_DAEMON rc_status -v ;; status) echo -n "Checking TORQUE Mom: " checkproc -p $PIDFILE $PBS_DAEMON rc_status -v ;; restart) $0 stop sleep 1 $0 start rc_status ;; try-restart) $0 status >/dev/null && $0 restart rc_status ;; reload|force-reload) echo -n "Re-reading TORQUE Mom config file: " killproc -p $PIDFILE -HUP pbs_mom rc_status -v ;; *) echo "Usage: pbs_mom {start|stop|status|try-restart|restart|force-reload|reload|purge}" exit 1 esac rc_exit torque-2.4.16/contrib/init.d/debian.pbs_mom0000775000113300011330000000570511272401247015473 00000000000000#!/bin/sh ### BEGIN INIT INFO # Provides: pbs_mom # Required-Start: $local_fs # Should-Start: pbs_server pbs_sched # Required-Stop: # Should-Stop: # Default-Start: 2 3 5 # Default-Stop: S 0 1 6 # Description: Torque is a versatile batch system for SMPs and clusters ### END INIT INFO # To install do (as root): # cp debian.pbs_mom /etc/init.d/pbs_mom && update-rc.d pbs_mom defaults DESC="TORQUE mom" NAME=pbs_mom DAEMON=/usr/local/sbin/$NAME PBS_DAEMON=$DAEMON PBS_HOME=/var/spool/torque PIDFILE=$PBS_HOME/mom_priv/mom.lock SCRIPTNAME=/etc/init.d/$NAME export PBS_DAEMON PBS_HOME PIDFILE ulimit -n 32768 # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables [ -f /etc/default/rcS ] && . /etc/default/rcS # Define LSB log_* functions. . /lib/lsb/init-functions do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 } do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 sleep 1 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 rm -f $PIDFILE return "$RETVAL" } do_reload() { start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; reload|force-reload) log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? ;; restart) log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 exit 3 ;; esac : torque-2.4.16/configure.ac0000664000113300011330000014241611611642005012326 00000000000000dnl dnl This is an autoconf script. dnl To rebuild the `configure' script from this, use the bootstrap dnl script in the directory containing this script. dnl You must have autoconf version 2.53 or later. dnl dnl dnl Configuration and build system for PBS written dnl by Lonhyn T. Jasinskyj (lonhyn@nas.nasa.gov) dnl dnl (credit for the inspiration for some of this is due to the work of dnl Martin Buchholz who autoconf'ed XEmacs) dnl dnl Partly rewritten and ported to Autoconf-2.53 and Automake dnl by Karsten Petersen (kapet@hrz.tu-chemnitz.de) dnl dnl Expanded to support 'make distcheck', shared libs, dnl bi-arches, pbs-config script, and updated to TORQUE 2.x dnl by Garrick Staples (garrick@usc.edu) dnl dnl Expanded to allow --enable-high-availability in order to have improved dnl high availability features dnl by David Beer (dbeer@adaptivecomputing.com) dnl AC_PREREQ(2.53) AC_INIT([torque], [2.4.16], [torqueusers@supercluster.org]) AC_REVISION($Revision: 4868 $) AC_CONFIG_SRCDIR([src/cmds/qrun.c]) AC_CONFIG_AUX_DIR([buildutils]) AC_CANONICAL_HOST AC_CHECK_PROGS(MAKE,$MAKE make gmake,error) if test "x$MAKE" = "xerror" ;then AC_MSG_ERROR([cannot find a make command]) fi AM_INIT_AUTOMAKE AM_MAINTAINER_MODE if test "$program_prefix" = "NONE";then program_prefix="" fi if test "$program_suffix" = "NONE";then program_suffix="" fi AC_SUBST(program_prefix) AC_SUBST(program_suffix) RPM_AC_OPTS="" dnl Instead of putting a long list of defines on the command line dnl for each compile, use a file called "pbs_config.h" that will dnl be created in the include directory. AM_CONFIG_HEADER([src/include/pbs_config.h]) dnl dnl ###################################################################### dnl figure out what PBS "machine type" we are on dnl AC_CACHE_CHECK([PBS machine type], pbs_cv_type_mach, [pbs_cv_type_mach=`$ac_aux_dir/pbs_mach_type`]) PBS_MACH=$pbs_cv_type_mach if test "x$PBS_MACH" = "xunknown"; then AC_MSG_WARN([MOM Machine type "$host_os" is not supported.]) AC_DEFINE(UNSUPPORTED_MACH,1,[Define if building on unsupported OS]) fi AC_SUBST(PBS_MACH) AC_DEFINE_UNQUOTED(PBS_MACH, "${PBS_MACH}", [the PBS style machine type name]) # this defines the name of a .c file which is then included in # another resc_def_all.c AC_DEFINE_UNQUOTED(MACH_RESC_DEFS, "resc_def_${PBS_MACH}.c", [the machine specific resc_def_* file name]) dnl dnl ###################################################################### dnl Autorun mode? dnl AC_MSG_CHECKING([whether to turn on the AUTORUN_JOBS flag]) AC_ARG_ENABLE(autorun, [ --enable-autorun turn on the AUTORUN_JOBS flag], enable_autorun=$enableval, enable_autorun=no) AC_MSG_RESULT($enable_autorun) if test "x$enable_autorun" = "xyes" ; then AC_DEFINE(AUTORUN_JOBS, 1, [turns on the compilation of AUTORUN_JOBS code]) fi dnl dnl ###################################################################### dnl Resource max not default mode? dnl dnl NOTE: due to confusion we are changing MAX to not be default by default dnl AC_MSG_CHECKING([whether to turn on the RESOURCEMAXDEFAULT flag]) AC_ARG_ENABLE(maxdefault, [ --enable-maxdefault turn on the RESOURCEMAXDEFAULT flag], enable_maxdefault=$enableval, enable_maxdefault=no) AC_MSG_RESULT($enable_maxdefault) if test "x$enable_maxdefault" = "xyes" ; then AC_DEFINE(RESOURCEMAXDEFAULT, 1, [turns on the compilation of RESOURCEMAXDEFAULT code]) fi dnl dnl ###################################################################### dnl Quick commit mode? dnl AC_MSG_CHECKING([whether to turn on the QUICKCOMMIT flag]) AC_ARG_ENABLE(quickcommit, [ --enable-quickcommit turn on the QUICKCOMMIT flag], enable_quickcommit=$enableval, enable_quickcommit=no) AC_MSG_RESULT($enable_quickcommit) if test "x$enable_quickcommit" = "xyes" ; then AC_DEFINE(QUICKCOMMIT, 1, [turns on the compilation of QUICKCOMMIT code]) fi dnl dnl ###################################################################### dnl Disable qsub keep(-k) override? dnl AC_ARG_ENABLE(qsub-keep-override, [ --disable-qsub-keep-override do not allow the qsub -k flag to override -o -e.], [case "${enableval}" in yes) ;; no) QSUB_KEEP_NO_OVERRIDE=1; AC_DEFINE(QSUB_KEEP_NO_OVERRIDE, 1, [turns on the QSUB_KEEP_NO_OVERRIDE flag]) ;; *) AC_MSG_ERROR(--enable-qsub-keep-override cannot take a value) ;; esac])dnl dnl dnl ###################################################################### dnl No SIG_CHLD mode? dnl AC_MSG_CHECKING([whether to turn on the NO_SIGCHLD flag]) AC_ARG_ENABLE(nochildsignal, [ --enable-nochildsignal turn on the NO_SIGCHLD flag], enable_nochildsignal=$enableval, enable_nochildsignal=no) AC_MSG_RESULT($enable_nochildsignal) if test "x$enable_nochildsignal" = "xyes" ; then AC_DEFINE(NO_SIGCHLD, 1, [turns on the compilation of NO_SIGCHLD code]) fi dnl dnl ###################################################################### dnl Let the user choose, what parts of PBS he wants to compile and install dnl partdefault=yes if test "x$PBS_MACH" = "xunknown"; then partdefault=no fi AC_MSG_CHECKING([whether to include server and scheduler]) AC_ARG_ENABLE(server, [ --disable-server do not include server and scheduler], build_server=$enableval, build_server=$partdefault) AC_MSG_RESULT($build_server) AM_CONDITIONAL(INCLUDE_SERVER, [test "x$build_server" = "xyes"]) AC_SUBST(build_server) AC_MSG_CHECKING([whether to include the mom daemon]) AC_ARG_ENABLE(mom, [ --disable-mom do not include the mom daemon], build_mom=$enableval, build_mom=$partdefault) AC_MSG_RESULT($build_mom) AM_CONDITIONAL(INCLUDE_MOM, [test "x$build_mom" = "xyes"]) AC_SUBST(build_mom) AC_MSG_CHECKING([whether to include the clients]) AC_ARG_ENABLE(clients, [ --disable-clients do not include the clients], build_clients=$enableval, build_clients=yes) AC_MSG_RESULT($build_clients) AM_CONDITIONAL(INCLUDE_CLIENTS, [test "x$build_clients" = "xyes"]) AC_SUBST(build_clients) AC_MSG_CHECKING([whether to build DRMAA lib]) AC_ARG_ENABLE(drmaa, [ --enable-drmaa build the DRMAA 1.0 library (default is off)], build_drmaa=$enableval, build_drmaa=no) AC_MSG_RESULT($build_drmaa) AM_CONDITIONAL(INCLUDE_DRMAA, [test "x$build_drmaa" = "xyes"]) AC_SUBST(build_drmaa) dnl dnl ###################################################################### dnl Check for the C compiler (some tests rely on it) dnl this needs to be before AC_ARG_ENABLE(debug) dnl dnl did the user provide CC and CFLAGS variables? store for later dnl user_choosed_cc_set=${CC+set} dnl user_choosed_cflags_set=${CFLAGS+set} dnl SPECIFIED_CFLAGS=$CFLAGS dnl look for the C-Compiler AC_PROG_CC AC_PROG_GCC_TRADITIONAL dnl dnl ###################################################################### dnl Check for programs dnl AC_CHECK_PROGS(AR,ar,exit) dnl wrapped libtool macro to remove annoying warning message AC_PROG_LIBTOOL TAC_PROG_LIBTOOL_PATCH AC_PROG_LN_S dnl needed for scheduler.basl AM_PROG_LEX AC_PROG_YACC dnl Check for troff and its family. Prefer groff because we know dnl its fonts whereas various troffs name their fonts differently. dnl (e.g. CO vs C) AC_CHECK_PROGS(TBL, gtbl tbl, exit) AC_CHECK_PROGS(PIC, gpic pic, exit) AC_CHECK_PROGS(ROFF, groff troff, exit) dnl dnl ###################################################################### dnl Check how to compile dnl dnl dnl ###################################################################### dnl compile in debug code? dnl AC_MSG_CHECKING([whether to turn on the compilation of DEBUG code]) AC_ARG_ENABLE(debug, [ --enable-debug turn on the compilation of DEBUG code], enable_debug=$enableval, enable_debug=no) AC_MSG_RESULT($enable_debug) if test "x$enable_debug" = "xyes" ; then AC_DEFINE(DEBUG, 1, [turns on the compilation of DEBUG code]) fi dnl dnl ###################################################################### dnl compile with debugging symbols dnl this needs to be after AC_PROG_CC and before AX_CFLAGS_GCC_OPTION dnl and TAC_SYS_LARGEFILE dnl AC_MSG_CHECKING([whether to compile with debugging symbols]) AC_ARG_WITH([debug], AC_HELP_STRING([--with-debug], [compile with debugging symbols]), DEBUG_SYMBOLS=$withval, DEBUG_SYMBOLS="no") AC_MSG_RESULT([DEBUG_SYMBOLS=$DEBUG_SYMBOLS]) dnl remove -O* and add -g if test "$DEBUG_SYMBOLS" = 'yes'; then AC_MSG_RESULT([before tweak CFLAGS=$CFLAGS]) CFLAGS=`echo $CFLAGS | sed 's/ \?-O[[^ ]]*//g'` AC_MSG_RESULT([mid tweak CFLAGS=$CFLAGS]) case $CFLAGS in *-g*) ;; *) if test "$CFLAGS" = ''; then CFLAGS="-g" else CFLAGS="-g $CFLAGS" fi ;; esac AC_MSG_RESULT([after tweak CFLAGS=$CFLAGS]) fi dnl Torque's own largefile support TAC_SYS_LARGEFILE dnl if using gcc, we can be very strict AC_ARG_ENABLE(gcc_warnings, [ --disable-gcc-warnings Disable gcc strictness and warnings. If using gcc, default is to error on any warning]) if test "x$GCC" = "xyes" ;then AC_MSG_CHECKING([whether to use strict gcc warnings]) if test "${enable_gcc_warnings}" == "yes" ; then if test "x$build_drmaa" = "xyes" ;then AC_MSG_RESULT([no... because DRMAA is being built]) else AC_MSG_RESULT([yes]) AX_CFLAGS_GCC_OPTION([-W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror]) gccwarnings=yes fi else AC_MSG_RESULT([no]) fi fi dnl check if we should use high availability mode AC_ARG_ENABLE(high_availability, [ --enable-high-availability Enables advanced high availability mode (multi-threaded)]) if test "x$GCC" = "xyes" ;then AC_MSG_CHECKING([whether to use threaded high availability]) if test "${enable_high_availability}" == "yes" ; then AC_MSG_RESULT([yes]) PTHREAD_LIBS=-lpthread LIBS="$LIBS $PTHREAD_LIBS" CFLAGS="$CFLAGS -DUSE_HA_THREADS" else AC_MSG_RESULT([no]) high_availability=yes fi fi dnl dnl If hpux and gcc, force the XOPEN interface. AC_MSG_CHECKING([whether to force XOPEN networking stack]) AC_ARG_ENABLE(xopen_networking, [ --disable-xopen-networking With HPUX and GCC, don't force usage of XOPEN and libxnet]) if test "${enable_xopen_networking}" != "no" ; then case $GCC,$PBS_MACH in yes,hpux*) AC_MSG_RESULT([yes]) AC_MSG_WARN([On HPUX and gcc, forcing XOPEN network stack.]) AC_MSG_WARN([Use --disable-xopen-networking to prevent it]) AC_CHECK_LIB([xnet], [getpeername], [LIBS="-lxnet $LIBS" CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"], [AC_MSG_WARN([This build will likely fail in mysterious ways at run-time]) sleep 10]) ;; *) AC_MSG_RESULT([no... phew!]) esac else AC_MSG_RESULT([disabled]) fi dnl dnl ###################################################################### dnl Check for headers dnl AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h limits.h malloc.h netdb.h \ netinet/in.h stddef.h sys/file.h sys/param.h sys/tty.h \ sys/socket.h sys/time.h sys/ioctl.h sys/mount.h \ sys/vfs.h sys/statfs.h sys/statvfs.h sys/ucred.h sys/un.h sys/uio.h \ syslog.h readline/readline.h \ termios.h err.h sys/poll.h pam/pam_modules.h security/pam_appl.h]) # On Solaris, pam_modules.h requires pam_appl.h AC_CHECK_HEADERS([security/pam_modules.h], [], [], [#if HAVE_SECURITY_PAM_APPL_H # include # endif ]) dnl dnl ###################################################################### dnl System specific settings dnl AC_ARG_ENABLE(nodemask, [ --enable-nodemask enable nodemask-based scheduling on the Origin 2000]) if test "${enable_nodemask}" = "yes" ; then case "${PBS_MACH}" in irix6*) AC_DEFINE(NODEMASK, 1, [use nodemask-based scheduling on O2k]) ;; *) AC_MSG_ERROR([Cannot --enable-nodemask on a machine not running IRIX6]);; esac fi AC_ARG_ENABLE(pemask, [ --enable-pemask enable pemask-based scheduling on the Cray T3e]) if test "${enable_pemask}" = "yes" ; then case "${PBS_MACH}" in unicosmk*) AC_DEFINE(PE_MASK, 1, [use pemask-based scheduling on Cray T3e]) ;; *) AC_MSG_ERROR([Cannot --enable-pemask on a machine not running UNICOS/mk]);; esac fi SRFS=0 AC_ARG_ENABLE(srfs, [ --enable-srfs enable support for SRFS on Cray]) if test "${enable_srfs}" = "yes" ; then case "${PBS_MACH}" in unicos*) SRFS=1 ;; *) AC_MSG_ERROR([Cannot --enable-srfs on a machine not running UNICOS]);; esac fi AC_DEFINE_UNQUOTED(SRFS, ${SRFS}, [include support for SRFS on Cray]) MOMLIBS="" PBSPOE="" PBSPOEO="" AC_ARG_ENABLE(sp2, [ --enable-sp2 build PBS for an IBM SP2]) IBM_SP2=0 if test "x$enable_sp2" = "xyes" ; then MOMLIBS="-ljm_client -lSDR" case "$PBS_MACH" in aix*) AC_CHECK_LIB(switchtbl, swtbl_load_table, [ IBM_SP2=2 LIBS="-lswitchtbl $LIBS" PBSPOE="pbspd pbspoe" PBSPOEO="pbspoe.o pbspd.o" ], [ IBM_SP2=1 ]) ;; *) AC_MSG_ERROR([Cannot --enable-sp2 on a machine not running AIX]) ;; esac fi AC_DEFINE_UNQUOTED(IBM_SP2, ${IBM_SP2}, [defined if this is an SP2]) AC_SUBST(PBSPOE) AC_SUBST(PBSPOEO) AC_ARG_ENABLE(cpuset,[ --enable-cpuset enable Linux 2.6 kernel cpusets (in development)]) build_l26_cpuset=no if test "x$enable_cpuset" = "xyes" ;then build_l26_cpuset=yes AC_DEFINE(PENABLE_LINUX26_CPUSETS, 1, [Define to enable Linux 2.6 cpusets]) cpuset=1 dnl define geometry requests to allow these to be requested here dnl CFLAGS="$CFLAGS -DGEOMETRY_REQUESTS" else cpuset=0 fi AM_CONDITIONAL([BUILD_L26_CPUSETS], test "$build_l26_cpuset" = yes) dnl turn on the new feature to request a specific geometry for a process dnl this uses cpusets to bind the job to that geometry dnl --enable-geometry-requests AC_ARG_ENABLE(geometry_requests, [ --enable-geometry-requests Enables the user to request a specific geometry using a cpuset implementation]) if test "x$GCC" = "xyes" ;then AC_MSG_CHECKING([whether to allow geometry requests]) if test "${enable_geometry_requests}" = "yes" ; then AC_MSG_RESULT([yes]) build_l26_cpuset=yes AC_DEFINE(PENABLE_LINUX26_CPUSETS, 1, [Define to enable Linux 2.6 cpusets]) dnl AC_DEFINE(GEOMETRY_REQUESTS, 1, [Define to allow job specific geometry requests]) if test "${cpuset}" = "1" ; then CFLAGS="$CFLAGS -DGEOMETRY_REQUESTS -DALWAYS_USE_CPUSETS" else CFLAGS="$CFLAGS -DGEOMETRY_REQUESTS" fi else AC_MSG_RESULT([no]) fi fi AM_CONDITIONAL([BUILD_L26_CPUSETS], test "$build_l26_cpuset" = yes) dnl irix6 can be changed to irix6array explicitly with an dnl --enable-array and irix6array can be made into irix6 with a dnl --disable-array. AC_ARG_ENABLE(array, [ --enable-array setting this under IRIX enables the SGI Origin 2000 parallel support. Normally autodetected from the /etc/config/array file.], [ if test "$PBS_MACH" = irix6; then if test "$enableval" = yes; then AC_MSG_WARN([No array daemon detected but enable-array overrides.]) PBS_MACH=irix6array fi elif test "$PBS_MACH" = irix6array; then if test "$enableval" = no; then AC_MSG_WARN([Array daemon detected but disable-array overrides.]) PBS_MACH=irix6 fi else AC_MSG_ERROR([Cannot use --en/disable-array unless configuring for IRIX 6.x or above]) fi ]) dnl dnl enable BLCR support dnl AC_MSG_CHECKING([whether to build BLCR support]) AC_ARG_ENABLE(blcr, [ --enable-blcr enable BLCR support], BLCR=$enableval,BLCR=no) AC_MSG_RESULT($BLCR) case "$BLCR" in yes) AC_DEFINE([ENABLE_BLCR], 1, [Define to enable BLCR support]) ;; no) : ;; *) AC_MSG_ERROR([--enable-blcr should be yes or no]) ;; esac dnl dnl enable logging of x attributes for accounting dnl AC_MSG_CHECKING([whether to add x attributes to accounting]) AC_ARG_ENABLE(acct-x, [ --enable-acct-x enable adding x attributes to accounting log], ACCTX=$enableval,ACCTX=no) AC_MSG_RESULT($ACCTX) case "$ACCTX" in yes) AC_DEFINE([ATTR_X_ACCT], 1, [Define to add x attributes to accounting log]) ;; no) : ;; *) AC_MSG_ERROR([--enable-acct-x should be yes or no]) ;; esac dnl dnl enable Cray's CPA support dnl AC_MSG_CHECKING([whether to build Cray's CPA support]) AC_ARG_ENABLE(cpa, [ --enable-cpa enable Cray's CPA support], CPA=$enableval,CPA=no) AC_MSG_RESULT($CPA) AC_ARG_WITH(cpa_include, [ --with-cpa-include=DIR include path for cpalib.h], cpainclude=$withval,cpainclude=none) AC_ARG_WITH(cpa_lib, [ --with-cpa-lib=DIR lib path for libcpalib], cpalib=$withval,cpalib=none) if test "x$cpainclude" != "xnone" ;then CPPFLAGS="$CPPFLAGS -I$cpainclude" fi LDFLAGS_cpasave="$LDFLAGS" if test "x$cpalib" != "xnone" ;then LDFLAGS="$LDFLAGS -L$cpalib" fi buildcpa="no" case "$CPA" in yes) AC_DEFINE([ENABLE_CPA], 1, [Define to enable Cray's CPA support]) AC_CHECK_HEADERS([cpalib.h], [ :], AC_MSG_ERROR([pass the path to cpalib.h to --with-cpa-include])) AC_CHECK_LIB(cpalib, cpa_new_node_req, [ :], AC_MSG_ERROR([pass the path to libcpalib to --with-cpa-lib])) if test "x$cpalib" != "xnone" ;then MOMLIBS="$MOMLIBS -L$cpalib -lcpalib" else MOMLIBS="$MOMLIBS -lcpalib" fi buildcpa="yes" ;; no) : ;; *) AC_MSG_ERROR([--enable-cpa should be yes or no]) ;; esac AM_CONDITIONAL([BUILDCPA], test "$buildcpa" = yes) LDFLAGS="$LDFLAGS_cpasave" dnl dnl enable Cray's CSA support dnl AC_MSG_CHECKING([whether to build Cray's CSA support]) AC_ARG_ENABLE(csa, [ --enable-csa enable Cray's CSA support], CSA=$enableval,CSA=no) AC_MSG_RESULT($CSA) case "$CSA" in yes) AC_DEFINE([ENABLE_CSA], 1, [Define to enable Cray's CSA support]) MOMLIBS="$MOMLIBS -L/opt/cray/job/default/lib64 -lcsa" AC_CHECK_LIB([job], [job_create], , [AC_MSG_ERROR([--enable-csa requires job library support])]) ;; no) : ;; *) AC_MSG_ERROR([--enable-csa should be yes or no]) ;; esac dnl We need pthreads by default in the MOM AC_CHECK_LIB(pthread, pthread_create, MOMLIBS="$MOMLIBS -lpthread") dnl dnl arch-specific libs dnl case $PBS_MACH in aix4|aix5) MOMLIBS="$MOMLIBS -lodm -lcfg" ;; irix6array) MOMLIBS="$MOMLIBS -larray" ;; linux) AC_CHECK_FUNC(openpty, , AC_CHECK_LIB(util, openpty, MOMLIBS="$MOMLIBS -lutil"), AC_MSG_WARN([This is an ancient distro... will open ptys directly]) AC_DEFINE([USEOLDTTY], 1, [Define on ancient linux distros])) dnl dnl Check for job_create function on Cray dnl AC_CHECK_LIB([job], [job_create], [MOMLIBS="-L/opt/cray/job/default/lib64 -ljob $MOMLIBS" CFLAGS="$CFLAGS -DUSEJOBCREATE -I/opt/cray/job/default/include"]) ;; darwin*) AC_DEFINE(SETCONTROLLINGTTY, 1, [Define to set the controlling tty]) ;; digitalunix*) AC_DEFINE(SETCONTROLLINGTTY, 1, [Define to set the controlling tty]) ;; unicosmk*) AC_DEFINE(SETCONTROLLINGTTY, 1, [Define to set the controlling tty]) ;; esac case $PBS_MACH in aix4|aix5|sunos4|solaris5|freebsd|freebsd5|darwin|fujitsu) AC_CHECK_FUNC(nlist, , AC_CHECK_LIB(elf, nlist)) ;; esac case $PBS_MACH in sunos4|solaris5|netbsd|freebsd|freebsd5) AC_CHECK_LIB(kvm, kvm_open) ;; esac case $PBS_MACH in sunos4|solaris5|netbsd|freebsd|freebsd5) AC_CHECK_LIB(resolv, htons) ;; esac dnl Support for checkpointing, note that under IRIX at this time dnl it seems that you must be compiling with the -64 flag to dnl get the cpr libraries on O2000s MOM_CHECKPOINT=0 case "$PBS_MACH" in unicos*) MOM_CHECKPOINT=1 ;; irix6*) AC_CHECK_LIB(cpr, atcheckpoint, [MOM_CHECKPOINT=1]) if test "$MOM_CHECKPOINT" = 1 ; then MOMLIBS="$MOMLIBS -lcpr" # # if we are using plain cc then under irix6array # make it cc -64 unless the user has explicitly asked for cc # if test "$CC" = cc -a "x$user_choosed_cc_set" != xset ; then AC_MSG_WARN([Automatically setting CC='cc -64' under irix6.]) CC='cc -64' fi fi ;; linux) if test "$BLCR" = "yes" ;then MOM_CHECKPOINT=1;fi ;; esac AC_DEFINE_UNQUOTED(MOM_CHECKPOINT, ${MOM_CHECKPOINT}, [whether checkpointing is supported]) AC_SUBST(MOMLIBS) dnl Streams on Solaris case "$build" in *-*-solaris*) AC_DEFINE(PUSH_STREAM, 1, [Define if you are on a solaris box]) ;; *) ;; esac dnl dnl ###################################################################### dnl Scheduler settings dnl AC_ARG_WITH(sched, [ --with-sched=TYPE sets the scheduler type. If TYPE is "c" the scheduler will be written in C "tcl" the server will use a Tcl based scheduler "basl" will use the rule based scheduler "no" then their will be no scheduling done (the "c" scheduler is the default)], [case "${withval}" in c*|C*) SCHD_TYPE=cc ;; tcl|Tcl) SCHD_TYPE=tcl ;; basl|BASL) SCHD_TYPE=basl ;; *) SCHD_TYPE=none ;; esac],[SCHD_TYPE=cc]) if test "x$build_server" != "xyes" ;then SCHD_TYPE=none fi AC_DEFINE_UNQUOTED(SCHD_TYPE, "${SCHD_TYPE}", [set the type of scheduler to use]) SCHD_TYPE_SUBDIR="" if test "$SCHD_TYPE" != none; then SCHD_TYPE_SUBDIR=scheduler.$SCHD_TYPE fi AC_SUBST(SCHD_TYPE_SUBDIR) AC_SUBST(SCHD_TYPE) AM_CONDITIONAL(SCHD_BASL, test "x$SCHD_TYPE" = "xbasl") if test "$SCHD_TYPE" = basl ;then AC_CHECK_FUNC(sqrt, , AC_CHECK_LIB(m, sqrt, SCHD_LIBS="$SCHD_LIBS -lm")) fi AC_SUBST(SCHD_LIBS) AC_ARG_WITH(sched_code, [ --with-sched-code=PATH sets the name of the scheduler to use. This only applies to BASL schedulers and those written in the C language. For C schedulers this should be a directory name and for BASL schedulers a filename ending in ".basl". It will be interpreted relative to srctree/src/schedulers.SCHD_TYPE/samples. As an example, an appropriate BASL scheduler realtive path would be "nas.basl". The default scheduler code for "C" schedulers is "fifo".], [if test "${SCHD_TYPE}" = "cc" -o "${SCHD_TYPE}" = "basl"; then SCHD_CODE="${withval}" else AC_MSG_ERROR([--with-sched-code was used but sched-type was not "c" or "basl".]) fi],[SCHD_CODE=none]) dnl if the scheduler is the C scheduler then the default code is samples/fifo if test "$SCHD_CODE" = none -a "$SCHD_TYPE" = cc; then SCHD_CODE=fifo fi if test "$SCHD_TYPE" = cc -o "$SCHD_TYPE" = basl; then if test "$SCHD_CODE" = none; then AC_MSG_ERROR([Must specify --with-sched-code for C and BASL schedulers.]) fi fi AC_SUBST(SCHD_CODE) dnl dnl ###################################################################### dnl Global settings dnl AC_MSG_NOTICE([Checking global settings...]) AC_ARG_ENABLE(rpp, [ --disable-rpp use RPP/UDP for resource queries from PBS server to mom. This is enabled by default. If disabled, TCP is used. This does not effect general node/job status messages, job launch/exit messages, inter-mom messages, etc.], [case "${enableval}" in yes) RPP=1 ;; no) RPP=0 ;; *) AC_MSG_ERROR(--enable-rpp cannot take a value) ;; esac],[RPP=1])dnl AC_DEFINE_UNQUOTED(RPP, ${RPP}, [Define to enable RPP resource queries]) AM_CONDITIONAL(USING_RPP, [test "$RPP" = "1"]) AC_ARG_ENABLE(filesync, [ --enable-filesync open files with sync on each write operation. Don't bother enabling this, all it does is slow down TORQUE. This is disabled by default.], [case "${enableval}" in yes) TDISABLEFILESYNC=0; AC_MSG_WARN([--enable-filesync does not actually make for safer writes.]) ;; no) TDISABLEFILESYNC=1 ;; *) AC_MSG_ERROR(--enable-filesync cannot take a value) ;; esac],[TDISABLEFILESYNC=1])dnl AC_DEFINE_UNQUOTED(TDISABLEFILESYNC, ${TDISABLEFILESYNC}, [Define to prevent sync writes]) AC_ARG_ENABLE(plock_daemons, [ --enable-plock-daemons[[=ARG]] enable daemons to lock themselves into memory: logical-or of 1 for pbs_server, 2 for pbs_scheduler, 4 for pbs_mom (no argument means 7 for all three)], [case "${enableval}" in yes) PLOCK_DAEMONS=7 ;; no) PLOCK_DAEMONS=0 ;; *) PLOCK_DAEMONS="${enableval}" ;; esac],[PLOCK_DAEMONS=0]) AC_DEFINE_UNQUOTED(PLOCK_DAEMONS, ${PLOCK_DAEMONS}, [Select which daemons plock themselves, a bit pattern]) AC_ARG_ENABLE(syslog, [ --enable-syslog enable (default) the use of syslog for error reporting], [case "${enableval}" in yes) SYSLOG=1 ; RPM_AC_OPTS="$RPM_AC_OPTS --with syslog" ;; no) SYSLOG=0 ; RPM_AC_OPTS="$RPM_AC_OPTS --without syslog" ;; *) AC_MSG_ERROR(--enable-syslog cannot take a value.) ;; esac],[SYSLOG=1 ; RPM_AC_OPTS="$RPM_AC_OPTS --with syslog"])dnl AC_DEFINE_UNQUOTED(SYSLOG, ${SYSLOG}, [Define to enable syslog]) AM_CONDITIONAL(USING_SYSLOG, [test "$SYSLOG" = "1"]) AC_ARG_ENABLE(shell_pipe, [ --disable-shell-pipe give the job script file as standard input to the shell instead of passing its name via a pipe], [case "${enableval}" in yes) SHELL_INVOKE=1 ;; no) SHELL_INVOKE=0 ;; *) SHELL_INVOKE=0 ;; esac],[SHELL_INVOKE=1]) AC_DEFINE_UNQUOTED(SHELL_INVOKE, ${SHELL_INVOKE}, [set whether job scripts use a pipe]) AC_ARG_WITH(maildomain, [ --with-maildomain=MAILDOMAIN override the default domain for outgoing mail messages, i.e. "user@maildomain". The default maildomain is the hostname where the job was submitted from.], [MAILDOMAIN="${withval}" AC_MSG_WARN([--with-maildomain is depricated. Set mail_domain in qmgr.]) AC_DEFINE_UNQUOTED(TMAILDOMAIN, "${MAILDOMAIN}", [override the default domain for outgoing mail messages])]) AC_ARG_ENABLE(spool, [ --disable-spool if disabled, TORQUE will create output and error files directly in $HOME/.pbs_spool if it exists or in $HOME otherwise. By default, TORQUE will spool files in $TORQUEHOME/spool and copy them to the users home directory when the job completes.], [case "${enableval}" in yes) NO_SPOOL_OUTPUT=0 ;; no) NO_SPOOL_OUTPUT=1 ;; *) AC_MSG_ERROR(--enable-spool cannot take a value) ;; esac],[NO_SPOOL_OUTPUT=0])dnl AC_DEFINE_UNQUOTED(NO_SPOOL_OUTPUT, ${NO_SPOOL_OUTPUT}, [directly use homedirs instead of $TORQUEHOME/spool]) AC_ARG_ENABLE(shell-use-argv, [ --enable-shell-use-argv enable this to put the job script name on the command line that invokes the shell. Not on by default. Ignores --enable-shell-pipe setting.], [case "${enableval}" in yes) SHELL_USE_ARGV=1 ;; no) SHELL_USE_ARGV=0 ;; *) AC_MSG_ERROR(--enable-shell-use-argv cannot take a value) ;; esac],[SHELL_USE_ARGV=0])dnl AC_DEFINE_UNQUOTED(SHELL_USE_ARGV, ${SHELL_USE_ARGV}, [job script name passed as the shell's arg]) AC_ARG_ENABLE(posixmemlock, [ --disable-posixmemlock disable the moms use of mlockall. Some versions of OSs seem to have buggy POSIX MEMLOCK.], [case "${enableval}" in yes) ;; no) NOPOSIXMEMLOCK=1; AC_DEFINE(NOPOSIXMEMLOCK, 1, [Define to disable mlockall]) ;; *) AC_MSG_ERROR(--enable-posixmemlock cannot take a value) ;; esac])dnl AC_ARG_ENABLE(privports, [ --disable-privports disable the use of privileged ports for authentication. Some versions of OSX have a buggy bind() and cannot bind to privileged ports.], [case "${enableval}" in yes) ;; no) NOPRIVPORTS=1; AC_DEFINE(NOPRIVPORTS, 1, [Define to disable privileged ports]) ;; *) AC_MSG_ERROR(--enable-privports cannot take a value) ;; esac])dnl AC_ARG_ENABLE(mom-checkspool, [ --disable-mom-checkspool Don't check free space on spool directory and set an error], [case "${enableval}" in yes) MOMCHECKLOCALSPOOL=1 ;; no) MOMCHECKLOCALSPOOL=0;; *) AC_MSG_ERROR(--enable-mom-checkspool cannot take a value) ;; esac],[MOMCHECKLOCALSPOOL=1])dnl AC_DEFINE_UNQUOTED(MOMCHECKLOCALSPOOL, ${MOMCHECKLOCALSPOOL}, [Define to error if spool is full on MOM]) AC_ARG_WITH(tmpdir, [ --with-tmpdir=DIR set the tmp directory that pbs_mom will use defaults to "/tmp". This is a Cray-specific feature.], [TMP_DIR="${withval}"], [TMP_DIR="/tmp"]) test "$TMP_DIR" = yes && TMP_DIR="/tmp" AC_DEFINE_UNQUOTED(TMP_DIR, "${TMP_DIR}", [The pathname of the Cray temporary directory for mom]) AC_ARG_ENABLE(force-nodefile, [ --enable-force-nodefile forces creation of nodefile regardless of job submission parameters. Not on by default.], [case "${enableval}" in yes) MOM_FORCENODEFILE=1 ;; no) MOM_FORCENODEFILE=0 ;; *) AC_MSG_ERROR(--enable-force-nodefile cannot take a value) ;; esac],[MOM_FORCENODEFILE=0])dnl AC_DEFINE_UNQUOTED(MOM_FORCENODEFILE, ${MOM_FORCENODEFILE}, [force creation of nodefile]) AC_MSG_CHECKING([for CMSG_SPACE]) torque_cv_have_cmsg="no" AC_TRY_COMPILE([ #ifdef HAVE_SYS_UCRED_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UN_H #include #endif #include ],[exit(CMSG_SPACE(sizeof(struct ucred)));], [torque_cv_have_cmsg="yes"]) AC_MSG_RESULT([$torque_cv_have_cmsg]) AC_MSG_CHECKING([if enabling Unix Domain socket supprt]) ENABLE_UNIX_SOCKETS=$torque_cv_have_cmsg AC_ARG_ENABLE(unixsockets, [ --enable-unixsockets enable the use of Unix Domain sockets for authentication.], [case "${enableval}" in yes) ENABLE_UNIX_SOCKETS=yes ;; no) ENABLE_UNIX_SOCKETS=no;; *) AC_MSG_ERROR(--enable-unixsockets cannot take a value) ;; esac])dnl if test "x$ENABLE_UNIX_SOCKETS" = "xyes" ;then AC_DEFINE(ENABLE_UNIX_SOCKETS, 1, [Define to enable unix domain sockets]) fi AC_MSG_RESULT([$ENABLE_UNIX_SOCKETS]) AC_ARG_WITH(server_home, [ --with-server-home=DIR set the server home/spool directory for PBS use defaults to /var/spool/torque], [PBS_SERVER_HOME="${withval}" ; RPM_AC_OPTS="$RPM_AC_OPTS --define \"torque_home ${withval}\"" ], [PBS_SERVER_HOME="/var/spool/torque"]) AC_SUBST(PBS_SERVER_HOME) dnl [PBS_SERVER_HOME="${withval}"], [PBS_SERVER_HOME="$localstatedir/spool/torque"]) AC_ARG_WITH(server_name_file, [ --with-server-name-file=FILE set the file that will contain the name of the default server for clients to use. If this is not an absolute pathname, it will be evaluated relative to the server home directory that either defaults to /usr/spool/torque or is set using the --with-server-home option to configure. If this option is not specified, the default name for this file will be set to "server_name".], [pbs_default_file="${withval}"], [pbs_default_file="server_name"]) case "${pbs_default_file}" in /*) PBS_DEFAULT_FILE="${pbs_default_file}" ;; *) PBS_DEFAULT_FILE="\${PBS_SERVER_HOME}/${pbs_default_file}" ;; esac AC_SUBST(PBS_DEFAULT_FILE) AC_ARG_WITH(default_server, [ --with-default-server=HOSTNAME set the name of the computer that clients will access when no machine name is specified as part of the queue name. It defaults to the hostname of the machine on which PBS is being compiled.], [PBS_DEFAULT_SERVER="${withval}" ; RPM_AC_OPTS="$RPM_AC_OPTS --define \"torque_server ${withval}\"" ], [PBS_DEFAULT_SERVER="`uname -n`"]) AC_DEFINE_UNQUOTED(PBS_DEFAULT_SERVER, "${PBS_DEFAULT_SERVER}", [Define to the name of the default PBS server]) AC_SUBST(PBS_DEFAULT_SERVER) AC_ARG_WITH(environ, [ --with-environ=PATH set the path containing the environment variables for the daemons. For SP2 and AIX systems, suggested setting is to /etc/environment. Defaults to the file "pbs_environment" in the server-home. Relative paths are interpreted within the context of the server-home.], [pbs_environ="${withval}"], [pbs_environ="no"]) case "${pbs_environ}" in yes) AC_MSG_ERROR([--with-environ must be given a path]) ;; no) PBS_ENVIRON="\${PBS_SERVER_HOME}/pbs_environment" ;; /*) PBS_ENVIRON="${pbs_environ}" ;; *) PBS_ENVIRON="\${PBS_SERVER_HOME}/${pbs_environ}" ;; esac AC_SUBST(PBS_ENVIRON) AC_ARG_WITH(qstatrc-file, [ --with-qstatrc-file=FILE set the name of the file that qstat will use if there is no ".qstatrc" file in the directory where it is being invoked. Relative path names will be evaluated relative to the server home directory (see above). If this option is not specified, the default name for this file will be set to "qstatrc" (no dot) in the server home directory.], [case "${withval}" in /*) QSTATRC_PATH="${withval}" ;; *) QSTATRC_PATH="${PBS_SERVER_HOME}/${withval}" ;; esac],[QSTATRC_PATH="${PBS_SERVER_HOME}/qstatrc"]) AC_DEFINE_UNQUOTED(QSTATRC_PATH, "${QSTATRC_PATH}", [Define to the path of the qstat init file]) dnl Possibly define default MOM logdir and file suffix AC_ARG_WITH(momlogdir, [ --with-momlogdir use this directory for MOM logs.], AC_DEFINE_UNQUOTED(DEFAULT_MOMLOGDIR,"$with_momlogdir",[Alternate directory for MOM logs]) ) AC_ARG_WITH(momlogsuffix, [ --with-momlogsuffix use this suffix for MOM logs.], AC_DEFINE_UNQUOTED(DEFAULT_MOMLOGSUFFIX,"$with_momlogsuffix",[Alternate suffix for MOM logs]) ) dnl Declare which of scp, rcp, or mom_rcp is to be used for file delivery dnl As of TORQUE 2.1.0, default to scp if found, otherwise use the internal mom_rcp AC_ARG_WITH(scp, [ --with-scp use scp instead of mom_rcp (deprecated, use --with-rcp=scp).], [ AC_MSG_WARN([--with-scp is deprecated, use --with-rcp=scp]) AC_PATH_PROG(RCP_PATH, "scp", "error") case "${RCP_PATH}" in error) AC_MSG_ERROR([--with-scp scp not found in path]) ;; *) RCP_PATH="${RCP_PATH}" ;; esac]) AC_ARG_WITH(rcp, [ --with-rcp one of "scp", "rcp", "mom_rcp", or the fullpath of a remote file copy program. scp is the default if found, otherwise mom_rcp is used. Some rcp programs don't always exit with valid error codes in case of failure. mom_rcp is a copy of BSD rcp included with this source that has correct error codes, but it is also old, unmaintained, and doesn't have largefile support. ], [case "$with_rcp" in yes|no) AC_MSG_ERROR([--with-rcp takes an argument]) ;; *) RCP_PATH="$with_rcp" ;; esac]) # if noone requested an rcp prog, use scp if found, or use mom_rcp if test "x$RCP_PATH" = "x" ;then AC_PATH_PROG(RCP_PATH, scp, error) if test "x$RCP_PATH" = "xerror" ;then RCP_PATH=mom_rcp RPM_AC_OPTS="$RPM_AC_OPTS --without scp" else RPM_AC_OPTS="$RPM_AC_OPTS --with scp" fi fi # figure out what was requested and turn that into a full path if necessary build_pbs_rcp=no case "$RCP_PATH" in mom_rcp|pbs_rcp) RCP_PATH="${sbindir}/pbs_rcp"; build_pbs_rcp=yes ;; /*) ;; *) AC_PATH_PROG(RCP_PATH, "$RCP_PATH", error) if test "x$RCP_PATH" = "xerror" ;then AC_MSG_ERROR([requested copy program not found in path]) fi ;; esac # figure out the required args if test "x$RCP_ARGS" = "x" ;then case "$RCP_PATH" in *rcp) RCP_ARGS="-rp"; RSH_PATH=rsh ;; *scp) RCP_ARGS="-rpB"; RSH_PATH=ssh ;; *) RCP_ARGS="-rp"; RSH_PATH=rsh; AC_MSG_WARN([not using rcp or scp, assuming -r]) ;; esac fi AC_MSG_NOTICE([remote file copy program... $RCP_PATH $RCP_ARGS]) AC_SUBST(RCP_PATH) AC_SUBST(RCP_ARGS) AC_SUBST(RSH_PATH) AC_SUBST(build_pbs_rcp) AM_CONDITIONAL(INCLUDE_MOM_RCP, [test "x$build_pbs_rcp" = "xyes"]) dnl find sendmail and add it to defs AC_ARG_WITH(sendmail, [ --with-sendmail[[=FILE]] sendmail executable to use], [SENDMAIL_CMD=$withval], [sendmail_maybe_in="/usr/lib:/usr/sbin:/usr/bin:/etc:/usr/etc:$PATH" AC_PATH_PROGS(SENDMAIL_CMD, sendmail, sendmail, ${sendmail_maybe_in}) ]) case "${SENDMAIL_CMD}" in /*) ;; *) AC_MSG_WARN([emails might not be sent unless ${SENDMAIL_CMD} is found at run-time]) ;; esac AC_DEFINE_UNQUOTED(SENDMAIL_CMD, "${SENDMAIL_CMD}", [full pathname of sendmail]) dnl attempt to find a location to install PAM modules AC_MSG_CHECKING([for PAM install directory]) pammoddir=disabled AC_ARG_WITH(pam, [ --with-pam=DIR Directory that holds the system PAM modules. Defaults to /lib(64)/security on Linux.], [pammoddir=$withval]) case "$pammoddir" in disabled) ;; no) pammoddir=disabled ;; yes) case "${PBS_MACH}" in linux) pammoddir=/lib$libsuff/security;; *) AC_MSG_ERROR([--with-pam takes a full path to a directory]);; esac ;; /*) ;; *) AC_MSG_ERROR([--with-pam takes a full path to a directory $pammoddir]);; esac if test "x$pammoddir" = "xdisabled" ; then RPM_AC_OPTS="$RPM_AC_OPTS --without pam" else RPM_AC_OPTS="$RPM_AC_OPTS --with pam" fi AC_MSG_RESULT([$pammoddir]) AC_SUBST(pammoddir) AM_CONDITIONAL(INCLUDE_PAM, [test "x$pammoddir" != "xdisabled"]) dnl find default xauth run-time path AC_ARG_WITH(xauth, [ --with-xauth=PATH Specify path to xauth program ], [ if test "x$withval" != "xno" ; then xauth_path=$withval fi ], [ TestPath="$PATH" TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" AC_PATH_PROG(xauth_path, xauth, , $TestPath) if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then xauth_path="/usr/openwin/bin/xauth" fi ] ) if test -z "$xauth_path" ; then xauth_path="/usr/X11R6/bin/xauth" fi AC_DEFINE_UNQUOTED(XAUTH_PATH, "${xauth_path}", [Define to the path of xauth]) dnl Readline AC_ARG_WITH(readline, [ --without-readline do not include readline support (default: included if found)], [HAVE_READLINE="${withval}"], [HAVE_READLINE="default"]) case "$HAVE_READLINE" in yes|no) ;; default) case $PBS_MACH in aix5|darwin) HAVE_READLINE="no";; *) HAVE_READLINE="yes";; esac ;; *) AC_MSG_ERROR([--with-readline only takes "yes" or "no" as arguments]) ;; esac dnl modulefiles AC_MSG_CHECKING([whether to install modulefiles]) AC_ARG_WITH(modulefiles, AC_HELP_STRING([--with-modulefiles@<:@=DIR@:>@], [use modulefiles in specified directory [[/etc/modulefiles]]]), [], [with_modulefiles="no"]) if test "$with_modulefiles" != 'no'; then if test "$with_modulefiles" = 'yes'; then MODULEFILES_DIR="/etc/modulefiles" else MODULEFILES_DIR="$with_modulefiles" fi else MODULEFILES_DIR=no fi AM_CONDITIONAL(INSTALL_MODULEFILES, [test "x$MODULEFILES_DIR" != "xno"]) AC_SUBST(MODULEFILES_DIR) AC_MSG_RESULT($MODULEFILES_DIR) dnl dnl ###################################################################### dnl Check for libraries dnl dnl nsl is needed on some systems but duplicates libc.a on others (O2000s) AC_CHECK_FUNC(xdr_int, , AC_CHECK_LIB(nsl, xdr_int)) AC_CHECK_FUNC(ruserok, , AC_CHECK_LIB(socket, ruserok)) AC_CHECK_FUNC(hstrerror, , AC_CHECK_LIB(resolv, hstrerror)) dnl Readline if test "$HAVE_READLINE" = "yes" ; then AC_CHECK_LIB(ncurses, initscr, READLINE_LIBS="-lncurses") AC_CHECK_LIB(readline, rl_callback_handler_install, [READLINE_LIBS="$READLINE_LIBS -lreadline"], [HAVE_READLINE="no"], [$READLINE_LIBS]) fi AC_SUBST(READLINE_LIBS) if test "$ac_cv_header_readline_readline_h" = "no" ; then HAVE_READLINE="no" fi if test "$HAVE_READLINE" = "yes" ; then AC_DEFINE(HAVE_READLINE, 1, [include readline support]) else AC_MSG_WARN([readline support is disabled]) fi dnl dnl ###################################################################### dnl Check for typedefs, structures and such dnl dnl under some OSs h_errno is not visible AC_DECL_H_ERRNO dnl see if we need to include sys/select.h to get FD_SET and friends AC_DECL_FD_SET_SYS_SELECT_H dnl Check the sizes of various types for DIS dnl The cross-compiling sizes are there to shut autoconf up dnl and are chosen to all be different so that dis.h uses dnl specific routines for each type instead of substituting in the dnl unlikely (and unsupported) event of cross-compilation. AC_CHECK_SIZEOF(int, 20) AC_CHECK_SIZEOF(long, 21) AC_CHECK_SIZEOF(float, 22) AC_CHECK_SIZEOF(double, 23) AC_CHECK_SIZEOF(long double, 24) AC_CHECK_SIZEOF(short, 25) AC_CHECK_SIZEOF(unsigned, 26) AC_CHECK_SIZEOF(unsigned int, 27) AC_CHECK_SIZEOF(unsigned short, 28) AC_CHECK_SIZEOF(unsigned char, 29) AC_CHECK_SIZEOF(unsigned long, 30) AC_CHECK_SIZEOF(signed char, 31) AC_C_CHAR_UNSIGNED AC_CHECK_TYPE([socklen_t], [AC_DEFINE_UNQUOTED([torque_socklen_t],[socklen_t],[type to use in place of socklen_t])], [TAC_SOCKLEN_EQUIV([torque_socklen_t])]) TAC_PAM_GET_USER_2ND_ARG if test "$tac_pam_get_user_2nd_arg" = "none" && test "$pammoddir" != "disabled" ;then AC_MSG_ERROR([Unable to compile PAM bits, missing pam-devel?]) fi dnl dnl ###################################################################### dnl Check for functions dnl dnl under HP-UX seteuid does not exist, look for setresuid instead AC_CHECK_FUNCS(seteuid setresuid,break) AC_CHECK_FUNCS(setegid setresgid,break) AC_CHECK_FUNCS([gettimeofday wordexp poll getaddrinfo]) AC_CHECK_FUNC([bindresvport]) AC_FUNC_GETGROUPS dnl see if atexit() exists, if not check for on_exit(), if that fails, panic AC_CHECK_FUNCS(atexit on_exit, [ { found_an_exit=yes; break; } ]) if test "$found_an_exit" != yes; then AC_MSG_ERROR([Must have atexit() or on_exit()]) fi AC_CHECK_FUNC(ntohl, [ :], AC_MSG_CHECKING([for ntohl in arpa/inet.h]) torque_cv_ntohl_needs_arpa_inet_h="no" AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif ],[exit(ntohl(0));], [torque_cv_ntohl_needs_arpa_inet_h="yes" AC_DEFINE_UNQUOTED([NTOHL_NEEDS_ARPA_INET_H],1,[Define if ntohl() is declared in arpa/inet.h])]) AC_MSG_RESULT($torque_cv_ntohl_needs_arpa_inet_h) ) TAC_TCLTK dnl dnl ###################################################################### dnl Checks needed to build DRMAA dnl if test "$build_drmaa" = "yes" ;then AC_MSG_NOTICE([Configuring DRMAA ...]) AC_PATH_PROG(GPERF, "gperf") AX_PROG_DOT AC_PATH_PROG(DOXYGEN, "doxygen", "none") AC_C_BIGENDIAN_CROSS ACX_PTHREAD(,[AC_MSG_ERROR([POSIX threads library is required by DRMAA.])]) AC_CHECK_HEADERS([stddef.h limits.h stdint.h inttypes.h]) AC_HEADER_STDBOOL #AC_FUNC_MALLOC #AC_FUNC_REALLOC AC_FUNC_STRERROR_R AC_FUNC_STRFTIME AC_CHECK_FUNCS([getcwd strchr strdup strerror mkstemp fstat strlcpy asprintf vasprintf]) AH_TEMPLATE([HAVE_VA_COPY], [Define to 1 if you have the va_copy function.]) AC_MSG_CHECKING([for va_copy]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[va_list a, b; va_copy(a, b);]])],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_VA_COPY]) ],[ AC_MSG_RESULT([no]) ],[ AC_MSG_RESULT([no]) ]) AH_TEMPLATE([HAVE___VA_COPY], [Define to 1 if you have the __va_copy function.]) AC_MSG_CHECKING([for __va_copy]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[va_list a, b; __va_copy(a, b);]])],[ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE___VA_COPY]) AH_BOTTOM([ #ifndef HAVE_VA_COPY # define va_copy(a,b) __va_copy(a,b) #endif ]) ],[ AC_MSG_RESULT([no]) ], [ AC_MSG_RESULT([no]) ]) build_drmaa_docs=yes RPM_AC_OPTS="$RPM_AC_OPTS --with drmaa" else DOXYGEN=none build_drmaa_docs=no RPM_AC_OPTS="$RPM_AC_OPTS --without drmaa" fi AM_CONDITIONAL(DRMAA_DOCS, [test "$DOXYGEN" != "none"]) AC_SUBST(build_drmaa_docs) drmaadocdir=$datadir/doc/$PACKAGE-drmaa AC_SUBST(drmaadocdir) dnl dnl ###################################################################### dnl Output dnl AC_CREATE_GENERIC_CONFIG([pbs],[-ltorque]) dnl these are quoted, and this removes them SPEC_NAME=$PACKAGE_TARNAME SPEC_VERSION=$PACKAGE_VERSION AC_SUBST(SPEC_NAME) AC_SUBST(SPEC_VERSION) AC_SUBST(RPM_AC_OPTS) dnl Head and bottom for the config-file AH_TOP([#ifndef _PBS_CONFIG_H_ #define _PBS_CONFIG_H_]) AH_BOTTOM([ #ifndef __GNUC__ # define __attribute__ /* nothing */ #endif #endif /* _PBS_CONFIG_H_ */ ]) dnl Include the Cplant Fault Recovery Patch jugglery AH_VERBATIM([NEED_BLOCKING_CONNECTIONS], [#ifndef NEED_BLOCKING_CONNECTIONS #define write(a,b,c) write_nonblocking_socket(a,b,c) #define read(a,b,c) read_nonblocking_socket(a,b,c) #endif]) pbs_build_host=`uname -n` pbs_build_date=`date` pbs_build_dir=`pwd` pbs_source_dir=`cd $srcdir && pwd` pbs_config_args=$@ AC_DEFINE_UNQUOTED([PBS_BUILD_HOST],"${pbs_build_host}",[Define to the build hostname]) AC_DEFINE_UNQUOTED([PBS_BUILD_DATE],"${pbs_build_date}",[Define to the build date]) AC_DEFINE_UNQUOTED([PBS_BUILD_DIR],"${pbs_build_dir}",[Define to the build directory]) AC_DEFINE_UNQUOTED([PBS_SOURCE_DIR],"${pbs_source_dir}",[Define to the source directory]) AC_DEFINE_UNQUOTED([PBS_BUILD_USER],"${USER}",[Define to the building username]) AC_DEFINE_UNQUOTED([PBS_INSTALL_DIR],"${prefix}",[Define to the install directory]) AC_DEFINE_UNQUOTED([PBS_CONFIG_ARGS],"${ac_configure_args}",[Define to the install directory]) AC_DEFINE_UNQUOTED([PBS_CFLAGS],"${CFLAGS}",[Define to the install directory]) AC_CONFIG_FILES([torque.spec:buildutils/torque.spec.in]) AC_OUTPUT(buildutils/pbs_mkdirs buildutils/self-extract-head-sh buildutils/modulefiles buildutils/modulefiles.vers Makefile doc/Makefile doc/man1/Makefile doc/man3/Makefile doc/man7/Makefile doc/man8/Makefile src/Makefile src/cmds/Makefile src/iff/Makefile src/gui/Makefile src/gui/Ccode/Makefile src/include/Makefile src/lib/Makefile src/lib/Libattr/Makefile src/lib/Libcmds/Makefile src/lib/Libcsv/Makefile src/lib/Libdis/Makefile src/lib/Libifl/Makefile src/lib/Liblog/Makefile src/lib/Libnet/Makefile src/lib/Libpbs/Makefile src/lib/Libsite/Makefile src/lib/Libutils/Makefile src/mom_rcp/Makefile src/momctl/Makefile src/resmom/Makefile src/resmom/aix4/Makefile src/resmom/aix5/Makefile src/resmom/darwin/Makefile src/resmom/digitalunix/Makefile src/resmom/freebsd/Makefile src/resmom/freebsd5/Makefile src/resmom/fujitsu/Makefile src/resmom/hpux10/Makefile src/resmom/hpux11/Makefile src/resmom/irix5/Makefile src/resmom/irix6/Makefile src/resmom/irix6array/Makefile src/resmom/linux/Makefile src/resmom/netbsd/Makefile src/resmom/solaris5/Makefile src/resmom/solaris7/Makefile src/resmom/sunos4/Makefile src/resmom/unicos8/Makefile src/resmom/unicosmk2/Makefile src/scheduler.basl/Makefile src/scheduler.cc/Makefile src/scheduler.cc/samples/Makefile src/scheduler.cc/samples/cray_t3e/Makefile src/scheduler.cc/samples/dec_cluster/Makefile src/scheduler.cc/samples/fifo/Makefile src/scheduler.cc/samples/msic_cluster/Makefile src/scheduler.cc/samples/sgi_origin/Makefile src/scheduler.cc/samples/umn_cluster/Makefile src/scheduler.tcl/Makefile src/server/Makefile src/tools/Makefile src/tools/xpbsmon/Makefile src/drmaa/Makefile src/drmaa/src/Makefile src/drmaa/test/Makefile src/drmaa/Doxyfile src/pam/Makefile) echo echo "Building components: server=$build_server mom=$build_mom clients=$build_clients gui=$build_gui drmaa=$build_drmaa pam=`test "x$pammoddir" = "xdisabled" && echo no || echo yes`" echo "PBS Machine type: $PBS_MACH" echo "Remote copy: $RCP_PATH $RCP_ARGS" echo "PBS home: $PBS_SERVER_HOME" echo "Default server: $PBS_DEFAULT_SERVER" echo "Unix Domain sockets: $ENABLE_UNIX_SOCKETS" echo "Tcl: `test "$TCL" = "1" && echo $MY_TCL_INCS $MY_TCL_LIBS || echo disabled`" echo "Tk: `test "$TK" = "1" && echo $MY_TCLTK_INCS $MY_TCLTK_LIBS || echo disabled`" echo if test "x$gccwarnings" = "xyes" ;then AC_MSG_WARN([This compilation has strict compiler options enabled that cause the build to fail if any compiler warnings are emitted. If this build fails because of a harmless warning, please report the problem to $PACKAGE_BUGREPORT and run configure again with --disable-gcc-warnings.]) echo fi echo "Ready for '${MAKE-make}'." torque-2.4.16/doc/0000777000113300011330000000000011614035206010661 500000000000000torque-2.4.16/doc/doc_fonts0000664000113300011330000001125611272401252012503 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .\" This file contines the troff commands to set the fonts. .\" .\" Different implementations of troff have different fonts available. .\" .\" For groff we map (NR, NI, NB, CR, HR) to fp 1, 2, 3, 5, 6 (note, no 4) .\" For other troffs (R, I, B, C, H) work well mapped to the same font .\" positions. .\" .\" This will autodetect groff and set the fonts accordingly. .\" .if \n(.g=1 \{ .fp 1 NR .fp 2 NI .fp 3 NB .fp 5 CR .fp 6 HR \} .if !\n(.g=1 \{ .fp 1 R .fp 2 I .fp 3 B .fp 5 C .fp 6 H \} .\" End of font setup torque-2.4.16/doc/soelim.c0000664000113300011330000001512111272401252012231 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * soelim - eliminate .so lines from troff documents * * This simple utility is provided to eliminate the .so lines * from troff documents by merging in the text from the referenced * source file. Some systems already come with soelim, others do not. * * Usage: soelim [-d include [-d include]...] inputfile * The named input file is opened processed. Any .so line in the * input is replace by the lines from the file. * * Output is written to standard out */ #include #include #include #include #include char *sodir[] = { 0, 0, 0, 0, 0 }; int main(int argc, char *argv[]) { int dofile(FILE *); int dirct = 0; FILE *filein; int i; extern int optind; extern char *optarg; while ((i = getopt(argc, argv, "d:")) != -1) switch (i) { case(int)'d': sodir[dirct++] = optarg; break; default: fprintf(stderr, "Usage: %s [-d include_dir] [filename ...]\n", argv[0]); return 1; } if (optind < argc) { for (i = optind; i < argc; ++i) { filein = fopen(argv[i], "r"); if (filein == NULL) { fprintf(stderr, "soelim: unable to open %s\n", argv[i]); return (1); } if (dofile(filein) != 0) return (1); } } else { return (dofile(stdin)); } return (0); } int dofile(filein) FILE *filein; { char buf[256]; int dirindex; int found; char newfile[1024]; FILE *newin; char *pc; char *pdir; char *pso; while (fgets(buf, 255, filein) != NULL) { if (strncmp(buf, ".so ", 4) == 0) { dirindex = 0; found = 0; pso = buf + 4; while (*pso == ' ') pso++; pc = pso; while (isspace((int)*pc) == 0) pc++; *pc = '\0'; while ((pdir = sodir[dirindex]) != NULL) { (void)strcpy(newfile, pdir); (void)strcat(newfile, "/"); (void)strcat(newfile, pso); if ((newin = fopen(newfile, "r")) != NULL) { found = 1; dofile(newin); break; } dirindex++; } if (found == 0) { /* try local directory */ (void)strcpy(newfile, pso); if ((newin = fopen(newfile, "r")) != NULL) { dofile(newin); } else { fprintf(stderr, "Unable to find include file %s\n", pso); exit(1); } } } else { fputs(buf, stdout); } } fclose(filein); return (0); } torque-2.4.16/doc/READ_ME0000664000113300011330000000077011272401252011620 00000000000000The various troff files in the directories below here reference the file ./ers.macros Before they can be processed by troff or (the man pages) can be installed in a man directory, this file must be merged into the source. This is be done by the makefile that processes the document. Because the program "soelim" is not always available and because it needs to know in which directory to look for the so-ed file, a source version is included in the doc directory. DIAGTODO: write pbs_statdiag manpage torque-2.4.16/doc/Makefile.in0000664000113300011330000010472611605403717012664 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(soelim_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(dist_man3_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/buildutils/config.mk noinst_PROGRAMS = soelim$(EXEEXT) subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am_soelim_OBJECTS = soelim.$(OBJEXT) soelim_OBJECTS = $(am_soelim_OBJECTS) soelim_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(soelim_SOURCES) DIST_SOURCES = $(soelim_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" man3dir = $(mandir)/man3 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man3_MANS) $(nodist_man1_MANS) $(nodist_man3_MANS) $(nodist_man7_MANS) $(nodist_man8_MANS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter soelim_SOURCES = soelim.c # ensures soelim is built early so that parallel makes work BUILT_SOURCES = soelim SUBDIRS = man1 man3 man7 man8 EXTRA_DIST = man1/qalter.1.in man1/qdel.1.in man1/qhold.1.in man1/qmove.1.in \ man1/qmsg.1.in man1/qorder.1.in man1/qrerun.1.in man1/qrls.1.in \ man1/qselect.1.in man1/qsig.1.in man1/qstat.1.in man1/qsub.1.in \ man1/pbs.1.in man1/pbsdsh.1.in man1/nqs2pbs.1.in man1/basl2c.1.in \ man1/xpbs.1.in man1/xpbsmon.1.in man1/qmgr.1.in man1/qchkpt.1.in \ \ man3/pbs_alterjob.3.in man3/pbs_checkpointjob.3.in \ man3/pbs_connect.3.in \ man3/pbs_default.3.in man3/pbs_deljob.3.in man3/pbs_disconnect.3.in \ man3/pbs_fbserver.3.in man3/pbs_geterrmsg.3.in \ man3/pbs_get_server_list.3.in man3/pbs_holdjob.3.in \ man3/pbs_locate.3.in man3/pbs_manager.3.in \ man3/pbs_movejob.3.in man3/pbs_msgjob.3.in man3/pbs_orderjob.3.in \ man3/pbs_rerunjob.3.in man3/pbs_rescquery.3.in \ man3/pbs_rescreserve.3.in man3/pbs_rlsjob.3.in man3/pbs_runjob.3.in \ man3/pbs_selectjob.3.in man3/pbs_selstat.3.in man3/pbs_sigjob.3.in \ man3/pbs_stagein.3.in man3/pbs_statjob.3.in man3/pbs_statnode.3.in \ man3/pbs_statque.3.in man3/pbs_statserver.3.in man3/pbs_submit.3.in \ man3/pbs_terminate.3.in \ \ man7/pbs_job_attributes.7.in man7/pbs_queue_attributes.7.in \ man7/pbs_server_attributes.7.in \ man7/pbs_resources_aix4.7.in man7/pbs_resources_digitalunix.7.in \ man7/pbs_resources_aix5.7.in man7/pbs_resources_darwin.7.in \ man7/pbs_resources_freebsd.7.in man7/pbs_resources_freebsd5.7.in \ man7/pbs_resources_fujitsu.7.in \ man7/pbs_resources_hpux10.7.in man7/pbs_resources_irix5.7.in \ man7/pbs_resources_hpux11.7.in \ man7/pbs_resources_irix6.7.in man7/pbs_resources_irix6array.7.in \ man7/pbs_resources_linux.7.in man7/pbs_resources_netbsd.7.in \ man7/pbs_resources_solaris5.7.in man7/pbs_resources_solaris7.7.in \ man7/pbs_resources_sp2.7.in man7/pbs_resources_sunos4.7.in \ man7/pbs_resources_unicos8.7.in man7/pbs_resources_unicosmk2.7.in \ \ man8/pbs_mom.8.in man8/pbsnodes.8.in \ man8/pbs_sched_basl.8.in man8/pbs_sched_cc.8.in \ man8/pbs_sched_tcl.8.in man8/pbs_server.8.in \ man8/qdisable.8.in man8/qenable.8.in \ man8/qrun.8.in man8/qstart.8.in man8/qstop.8.in \ man8/qterm.8.in \ \ READ_ME admin_guide.ps v2_2_ers.pdf v2_2_ids.pdf doc_fonts \ ers/ers.macros ers/ers_setup.ms ers/pbs_resources_all.so \ man1/Makefile.am man1/Makefile.in \ man3/Makefile.am man3/Makefile.in \ man8/Makefile.am man8/Makefile.in nodist_man1_MANS = man1/qalter.1 man1/qdel.1 man1/qhold.1 man1/qmove.1 \ man1/qmsg.1 man1/qorder.1 man1/qrerun.1 man1/qrls.1 \ man1/qselect.1 man1/qsig.1 man1/qstat.1 man1/qsub.1 \ man1/pbs.1 man1/pbsdsh.1 man1/nqs2pbs.1 man1/basl2c.1 \ man1/xpbs.1 man1/xpbsmon.1 man1/qmgr.1 man1/qchkpt.1 nodist_man3_MANS = man3/pbs_alterjob.3 man3/pbs_checkpointjob.3 \ man3/pbs_connect.3 \ man3/pbs_default.3 man3/pbs_deljob.3 man3/pbs_disconnect.3 \ man3/pbs_fbserver.3 man3/pbs_geterrmsg.3 man3/pbs_get_server_list.3 \ man3/pbs_holdjob.3 man3/pbs_locate.3 \ man3/pbs_manager.3 man3/pbs_movejob.3 man3/pbs_msgjob.3 \ man3/pbs_orderjob.3 man3/pbs_rerunjob.3 \ man3/pbs_rescquery.3 man3/pbs_rescreserve.3 \ man3/pbs_rlsjob.3 man3/pbs_runjob.3 man3/pbs_selectjob.3 \ man3/pbs_selstat.3 man3/pbs_sigjob.3 man3/pbs_stagein.3 \ man3/pbs_statjob.3 man3/pbs_statnode.3 man3/pbs_statque.3 \ man3/pbs_statserver.3 man3/pbs_submit.3 man3/pbs_terminate.3 dist_man3_MANS = man3/rpp.3 man3/tm.3 nodist_man7_MANS = man7/pbs_job_attributes.7 man7/pbs_queue_attributes.7 \ man7/pbs_server_attributes.7 \ man7/pbs_resources_aix4.7 man7/pbs_resources_digitalunix.7 \ man7/pbs_resources_aix5.7 man7/pbs_resources_darwin.7 \ man7/pbs_resources_freebsd.7 man7/pbs_resources_fujitsu.7 \ man7/pbs_resources_hpux10.7 man7/pbs_resources_irix5.7 \ man7/pbs_resources_hpux11.7 \ man7/pbs_resources_irix6.7 man7/pbs_resources_irix6array.7 \ man7/pbs_resources_linux.7 man7/pbs_resources_netbsd.7 \ man7/pbs_resources_solaris5.7 man7/pbs_resources_solaris7.7 \ man7/pbs_resources_sp2.7 man7/pbs_resources_sunos4.7 \ man7/pbs_resources_unicos8.7 man7/pbs_resources_unicosmk2.7 nodist_man8_MANS = man8/pbs_mom.8 man8/pbsnodes.8 \ man8/pbs_sched_basl.8 man8/pbs_sched_cc.8 \ man8/pbs_sched_tcl.8 man8/pbs_server.8 \ man8/qdisable.8 man8/qenable.8 \ man8/qrun.8 man8/qstart.8 man8/qstop.8 \ man8/qterm.8 CLEANFILES = $(nodist_man1_MANS) $(nodist_man3_MANS) $(nodist_man7_MANS) \ $(nodist_man8_MANS) MOSTLYCLEANFILES = SUFFIXES = .1.in .3.in .7.in .8.in .1 .3 .7 .8 .so all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .1.in .3.in .7.in .8.in .1 .3 .7 .8 .so .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done soelim$(EXEEXT): $(soelim_OBJECTS) $(soelim_DEPENDENCIES) @rm -f soelim$(EXEEXT) $(LINK) $(soelim_LDFLAGS) $(soelim_OBJECTS) $(soelim_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/soelim.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-man3: $(man3_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man3dir)" || $(mkdir_p) "$(DESTDIR)$(man3dir)" @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ done uninstall-man3: @$(NORMAL_UNINSTALL) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ done install-man7: $(man7_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man7dir)" || $(mkdir_p) "$(DESTDIR)$(man7dir)" @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.7*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 7*) ;; \ *) ext='7' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst"; \ done uninstall-man7: @$(NORMAL_UNINSTALL) @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.7*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 7*) ;; \ *) ext='7' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man7dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man7dir)/$$inst"; \ done install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../buildutils $(distdir)/ers $(distdir)/man1 $(distdir)/man3 $(distdir)/man7 $(distdir)/man8 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-info: install-info-recursive install-man: install-man1 install-man3 install-man7 install-man8 installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 uninstall-man3 uninstall-man7 \ uninstall-man8 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-noinstPROGRAMS \ clean-recursive ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-exec install-exec-am \ install-info install-info-am install-man install-man1 \ install-man3 install-man7 install-man8 install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-hook uninstall-info-am uninstall-man uninstall-man1 \ uninstall-man3 uninstall-man7 uninstall-man8 .1.in.1: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ .3.in.3: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ .7.in.7: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ .8.in.8: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ install_doc: install install-data-hook: rm -f $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 \ $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 @case $(PBS_MACH) in \ unknown) : ;; \ *) echo $(LN_S) $(program_prefix)pbs_resources_$(PBS_MACH)$(program_suffix).7 $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 ; \ $(LN_S) $(program_prefix)pbs_resources_$(PBS_MACH)$(program_suffix).7 $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 ;; \ esac @case $(SCHD_TYPE) in \ cc|tcl|basl) echo $(LN_S) $(program_prefix)pbs_sched_$(SCHD_TYPE)$(program_suffix).8 $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 ; \ $(LN_S) $(program_prefix)pbs_sched_$(SCHD_TYPE)$(program_suffix).8 $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 ;; \ none) : ;; \ *) echo "Unknown scheduler type"; exit 1 ;; \ esac uninstall-hook: rm -f $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/doc/man8/0000777000113300011330000000000011614035206011524 500000000000000torque-2.4.16/doc/man8/pbs_sched_cc.8.in0000664000113300011330000002252311272401251014540 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH pbs_sched 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbs_sched_cc \- pbs C scheduler .SH SYNOPSIS pbs_sched [\^\-a\ alarm\^] [\^\-d\ home\^] [\^\-L\ logfile\^] [\^\-p\ file\^] [\^\-S\ port\^] [\^\-R\ port\^] [\^\-c\ file\^] .SH DESCRIPTION The .B pbs_sched program runs in conjunction with the PBS server. It queries the server about the state of PBS and communicates with .B pbs_resmon to get information about the status of running jobs, memory available etc. It then makes decisions as to what jobs to run. .LP pbs_sched must be executed with root permission. .SH OPTIONS .IP "\-a alarm" 15 This specifies the time in seconds to wait for a schedule run to finish. If a script takes too long to finish, an alarm signal is sent, and the scheduler is restarted. If a core file does not exist in the current directory, .B abort() is called and a core file is generated. The default for .I alarm is 180 seconds. .IP "\-d home" 15 This specifies the PBS home directory, PBS_HOME. The current working directory of the scheduler is PBS_HOME/sched_priv. If this option is not given, PBS_HOME defaults to $PBS_SERVER_HOME as defined during the PBS build procedure. .IP "\-L logfile" 15 Specifies an absolute path name of the file to use as the log file. If not specified, the scheduler will open a file named for the current date in the PBS_HOME/sched_logs directory (see the \-d option). .IP "\-p file" 15 This specifies the "print" file. Any output from the C code which is written to standard out or standard error will be written to this file. If this option is not given, the file used will be .I PBS_HOME/sched_priv/sched_out . See the .At \-d option. .IP "\-S port" 15 This specifies the port to use. If this option is not given, the default port for the PBS scheduler is used. .IP "\-R port" 15 This specifies the resource monitor port to use. If this option is not given, the default port for the PBS mom is used. NOTE: this option only makes the mom port available to the scheduler writer. It doesn't force them to use it. .IP "\-c file" 15 Specify a configuration file, see description below. If this is a relative file name it will be relative to PBS_HOME/sched_priv, see the \-d option. If the \-c option is not supplied, pbs_sched will not attempt to open a configuration file. .LP The options that specify file names may be absolute or relative. If they are relative, their root directory will be PBS_HOME/sched_priv. .LP .SH USAGE This version of the scheduler requires knowledge of the C language and the PBS API. Source code is provided for a main program for the scheduler. The site must supply the heart of the program. When invoked, the main program performs general initialization and housekeeping chores. Then a locally supplied function, .I schedinit() is called to perform site specific initialization. .LP In the main loop, a locally supplied function, .I schedule() is called to make the scheduling decisions and perform any required actions. Information about jobs and queues is obtained from the Server through the standard PBS API as found in libifl.a. Information about the execution host(s) is obtained from the Resource Monitor. Routines to communicate with the Resource Monitor are found in libnet.a. .LP If the processing takes more than the allotted time, the scheduler will restart itself. The default amount of time is three minutes. This can be changed with the \-a option. .LP On receipt of a SIGHUP signal, the scheduler will close and reopen its log file and reread its configuration file (if any). .SH CONFIGURATION FILE A configuration file may be specified with the \-c option. This file may be used to specify the hosts (servers) which are allowed to connect to pbs_sched. The hosts are specified in the configuration file in a manor identical to that used in pbs_mom. .IP clienthost One or more servers, one per line, may be specified: .IP .Ty "$clienthost hostname" +.IP restricted Allows connections from non-priviledged ports on the named hosts. Typically only used with Mac OSX: .IP .Ty "$restricted hostname" .IP Two host names are always allowed to connection to pbs_sched, "localhost" and the name returned to pbs_sched by the system call gethostname(). These names need not be specified in the configuration file. .LP The configuration file must be "secure". It must be owned by a user id and group id less than 10 and not be world writable. .LP .SH FILES .IP $PBS_SERVER_HOME/sched_priv 10 the default directory for configuration files, typically (/usr/spool/pbs)/sched_priv. .LP .SH Signal Handling A C based scheduler will handle the following signals: .IP SIGHUP The server will close and reopen its log file and reread the config file if one exists. .IP SIGALRM If the site supplied scheduling module exceeds the time limit, the Alarm will cause the scheduler to attempt to core dump and restart itself. .IP "SIGINT and SIGTERM" Will result in an orderly shutdown of the scheduler. .LP All other signals have the default action installed. .SH "EXIT STATUS" Upon normal termination, an exit status of zero is returned. .SH "SEE ALSO" pbs_sched_tcl(8B), pbs_server(8B), and pbs_mom(8B). .br PBS Internal Design Specification .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/pbsnodes.8.in0000664000113300011330000001550611413217001013754 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH pbsnodes 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbsnodes \- pbs node manipulation .SH SYNOPSIS pbsnodes [\^\-{a|x}\^] [\-q] [\-s server] [node|:property] .br pbsnodes \-l [\-q] [\-s server] [state] [nodename|:property ...] .br pbsnodes [\^\-{c|d|o|r}\^] [\-q] [\-s server] [\-n] [\-N "note"] [node|:property] .SH DESCRIPTION The .B pbsnodes command is used to mark nodes down, free or offline. It can also be used to list nodes and their state. Node information is obtained by sending a request to the PBS job server. Sets of nodes can be operated on at once by specifying a node property prefixed by a colon. .br Nodes do not exist in a single state, but actually have a set of states. For example, a node can be simultaneously "busy" and "offline". The "free" state is the absence of all other states and so is never combined with other states. .LP In order to execute pbsnodes with other than the .B \-a or .B \-l options, the user must have PBS Manager or Operator privilege. .SH OPTIONS .IP "\-a" 15 All attributes of a node or all nodes are listed. This is the default if no flag is given. .IP "\-x" 15 Same as \-a, but the output has an XML-like format. .IP "\-c" 15 Clear OFFLINE from listed nodes. .IP "\-d" 15 Print MOM diagnosis on the listed nodes. Not yet implemented. Use momctl instead. .IP "\-o" 15 Add the OFFLINE state. This is different from being marked DOWN. OFFLINE prevents new jobs from running on the specified nodes. This gives the administrator a tool to hold a node out of service without changing anything else. The OFFLINE state will never be set or cleared automatically by pbs_server; it is purely for the manager or operator. .IP "\-p" 15 Purge the node record from pbs_server. Not yet implemented. .IP "\-r" 15 Reset the listed nodes by clearing OFFLINE and adding DOWN state. pbs_server will ping the node and, if they communicate correctly, free the node. .IP "\-l" 15 List node names and their state. If no state is specified, only nodes in the DOWN, OFFLINE, or UNKNOWN states are listed. Specifying a state string acts as an output filter. Valid state strings are "free", "offline", "down", "reserve", "job-exclusive", "job-sharing", "busy", "time-shared", or "state-unknown". .IP "\-N" 15 Specify a "note" attribute. This allows an administrator to add an arbitrary annotation to the listed nodes. To clear a note, use \-N "" or \-N n. .IP "\-n" 15 Show the "note" attribute for nodes that are DOWN, OFFLINE, or UNKNOWN. This option requires \-l. .IP "\-q" 15 Supress all error messages. .IP "\-s" 15 Specify the PBS server's hostname or IP address. .SH SEE ALSO pbs_server(8B) and the PBS External Reference Specification torque-2.4.16/doc/man8/qrun.8.in0000664000113300011330000001325611272401251013131 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qrun 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qrun \- run a pbs batch job .SH SYNOPSIS qrun [\^\-a] [\^\-H\ host\^] job_identifier ... .SH DESCRIPTION The .B qrun command is used to force a batch server to initiate the execution of a batch job. The job is run regardless of scheduling position, resource requirements, or state. .LP In order to execute qrun, the user must have PBS Operation or Manager privilege. .SH OPTIONS .IP "\-a" 15 Specifies the job(s) is to be run asynchronously. .IP "\-H host" 15 Specifies the host within the cluster on which the job(s) are to be run. The .Ar host argument is the name of a host that is a member of the cluster of hosts managed by the server. If the option is not specified, the server will select the "worst possible" host on which to execute the job. .LP .SH OPERANDS The qrun command accepts one or more .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in the ERS. .Ig .SH STANDARD ERROR The qrun command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qrun command, the exit status will be a value of zero. .LP If the qrun command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), pbs_sched(8B), qmgr(1B) .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/pbs_sched_basl.8.in0000664000113300011330000004674211272401251015105 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .de BP .ie '\\n(.z'' .bp \\$1 .el \!.BP \\$1 .. .if \n(Pb .ig Iq .TH pbs_scheduler_basl 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbs_sched_basl \- pbs BASL scheduler .SH SYNOPSIS pbs_sched\ [\^\-d home\^] [\^\-L logfile\^] [\^\-p print_file\^] [\^\-a alarm\^] [\^\-S port\^] [\^\-c configfile\^] .SH DESCRIPTION The .B pbs_sched command starts the operation of a batch scheduler on the local host. It runs in conjunction with the PBS server. It queries the server about the state of PBS and communicates with .B pbs_mom to get information about the status of running jobs, memory available etc. It then makes decisions as to what jobs to run. .LP Typically, this command will be in a local boot file such as .I /etc/rc.local . .LP pbs_sched must be executed with root permission. .SH OPTIONS .IP "\-d home" Specifies the name of the PBS home directory, PBS_HOME. If not specified, the value of $PBS_SERVER_HOME as defined at compile time is used. Also see the \-L option. .IP "\-L logfile" 5 Specifies an absolute path name of the file to use as the log file. If not specified, the scheduler will open a file named for the current date in the PBS_HOME/sched_logs directory. See the \-d option. .IP "\-p print_file" 5 This specifies the "print" file. Any output from the scheduler code which is written to standard out or standard error will be written to this file. If this option is not given, the file used will be $PBS_HOME/sched_priv/sched_out. See the \-d option. .IP "\-a alarm" 5 This specifies the time in seconds to wait for a schedule run to finish. If a scheduling iteration takes too long to finish, an alarm signal is sent, and the scheduler is restarted. If a core file does not exist in the current directory, abort() is called and a core file is generated. The default for alarm is 180 seconds. .IP "\-S port" 5 Specifies a port on which to talk to the server. This option is not required. It merely overides the default PBS scheduler port. .IP "\-c configfile" 5 Specify a configuration file, see description below. If this is a relative file name it will be relative to PBS_HOME/sched_priv, see the \-d option. If the \-c option is not supplied, pbs_sched will not attempt to open a configuration file. In BASL, this config file is almost always needed because it is where the list of servers, nodes, and host resource queries are specified by the administrator. .LP .SH USAGE This version of the scheduler requires knowledge of the BASL language. The site must first write a function called .I sched_main() (and all functions supporting it) using BASL constructs, and then translate the functions into C using the BASL compiler .I "basl2c", which would also attach a main program to the resulting code. This main program performs general initialization and housekeeping chores such as setting up local socket to communicate with the server running on the same machine, cd-ing to the priv directory, opening log files, opening configuration file (if any), setting up locks, forking the child to become a daemon, initializing a scheduling cycle (i.e. get node attributes that are static in nature), setting up the signal handlers, executing global initialization assignment statements specified by the scheduler writer, and finally sitting on a loop waiting for a scheduling command from the server. When the server sends the scheduler an appropriate scheduling command .Sc "SCH_SCHEDULE_NEW, SCH_SCHEDULE_TERM, SCH_SCHEDULE_TIME, SCH_SCHEDULE_RECYC, SCH_SCHEDULE_CMD, SCH_SCHEDULE_FIRST", information about server(s), jobs, queues, and execution host(s) are obtained, and then .I sched_main() is called. .SH SCHEDULING LANGUAGE The BAtch Scheduling Language (BASL) is a C-like procedural language. It provides a number of constructs and predefined functions that facilitate dealing with scheduling issues. Information about a PBS server, the queues that it owns, jobs residing on each queue, and the computational nodes where jobs can be run, are accessed via the BASL data types Server, Que, Job, CNode, Set Server, Set Que, Set Job, and Set CNode. .LP The following simple sched_main() will cause the server to run all queued jobs on the local server: .IP .Ty .nf sched_main() { Server s; Que q; Job j; Set Que queues; Set Job jobs; s = AllServersLocalHostGet(); // get local server queues = ServerQueuesGet(s); foreach( q in queues ) { jobs = QueJobsGet(q); foreach( j in jobs ) { JobAction(j, SYNCRUN, NULLSTR); } } } .fi .LP For a more complete discussion of the Batch Scheduler Language, see .B "basl2c(1B)". .SH CONFIGURATION FILE A configuration file may be specified with the \-c option. This file is used to specify the (1) hosts which are allowed to connect to pbs_sched, (2) the list of server hosts for which the scheduler writer wishes the system to periodically check for status, queues, and jobs info, (3) list of execution hosts for which the scheduler writer wants the system to periodically check for information like state, property, and so on, and (4) various queries to send to each execution host. .IP "(1) specifying client hosts:" 6 The hosts allowed to connect to pbs_sched are specified in the configuration file in a manner identical to that used in pbs_mom. There is one line per host using the syntax: .sp .Ty "$clienthost hostname" .sp where .Ty clienthost and .Ty hostname are separated by white space. Two host names are always allowed to connection to pbs_sched: "localhost" and the name returned to pbs_sched by the system call gethostname(). These names need not be specified in the configuration file. .IP "(2) specifying list of servers:" 6 The list of servers is specified in a one host per line manner, using the syntax: .sp .Ty "$serverhost hostname port_number" .br or where .Ty $server_host, .Ty hostname, and .Ty port_number are separated by white space. .sp If .Ty port_number is 0, then the default PBS server port will be used. .sp Regardless of what has been specified in the file, the list of servers will always include the local server \- one running on the same host where the scheduler is running. .sp Within the BASL code, access to data of the list of servers is done by calling .I AllServersGet(), or .I AllServersLocalHostGet() which returns the local server on the list. .IP "(3) specifying the list of execution hosts:" 6 The list of execution hosts (nodes), whose MOMs are to be queried from the scheduler, is specified in a one host per line manner, using the syntax: .sp .Ty "$momhost hostname port_number" .sp where .Ty $momhost, .Ty hostname, and .Ty port_number are separated by white space. .sp If .Ty port_number is 0, then the default PBS MOM port will be used. .sp The BASL function .I AllNodesGet() , or .I ServerNodesGet(AllServersLocalHostGet()) is available for getting the list of nodes known to the local system. .IP "(4) specifying the list of host resources:" For specifying the list of host resource queries to send to each execution host's MOM, the following syntax is used: .sp .Ty "$node node_name CNode..Get host_resource .sp .Ty node_name should be the same hostname string that was specified in a .Ty $momhost line. A .Ty node_name value of "*" (wildcard) means to match any node. .sp Please consult section 9 of the PBS ERS (Resource Monitor/Resources) for a list of possible values to .Ty host_resource parameter. .sp .Ty CNode..Get refers to the actual function name that is called from the scheduler code to obtain the return values to host resource queries. The list of .Ty CNode..Get function names that can appear in the configuration file are: .BP .ft 3 .nf STATIC: ================================ CNodePropertiesGet CNodeVendorGet CNodeNumCpusGet CNodeOsGet CNodeMemTotalGet[type] CNodeNetworkBwGet[type] CNodeSwapSpaceTotalGet[name] CNodeDiskSpaceTotalGet[name] CNodeDiskInBwGet[name] CNodeDiskOutBwGet[name] CNodeTapeSpaceTotalGet[name] CNodeTapeInBwGet[name] CNodeTapeOutBwGet[name] CNodeSrfsSpaceTotalGet[name] CNodeSrfsInBwGet[name] CNodeSrfsOutBwGet[name] DYNAMIC: ================================ CNodeIdletimeGet CNodeLoadAveGet CNodeMemAvailGet[type] CNodeSwapSpaceAvailGet[name] CNodeSwapInBwGet[name] CNodeSwapOutBwGet[name] CNodeDiskSpaceReservedGet[name] CNodeDiskSpaceAvailGet[name] CNodeTapeSpaceAvailGet[name] CNodeSrfsSpaceReservedGet[name] CNodeSrfsSpaceAvailGet[name] CNodeCpuPercentIdleGet CNodeCpuPercentSysGet CNodeCpuPercentUserGet CNodeCpuPercentGuestGet .fi .ft 1 .sp STATIC function names return values that are obtained only during the first scheduling cycle, or when the scheduler is instructed to reconfig; whereas, DYNAMIC function names return attribute values that are taken at every subsequent scheduling cycle. .sp .B name and .B type are arbitrarily defined. For example, you can choose to have .B name defined as "$FASTDIR" for the CNodeSrfs* calls, and a sample configuration file entry would look like: .sp .nf $node unicos8 CNodeSrfsSpaceAvailGet[$FASTDIR] quota[type=ares_avail,dir=$FASTDIR] .fi .sp So in a BASL code, if you call CNodeSrfsSpaceAvailGet(node, "$FASTDIR"), then it will return the value to the query "quota[type=ares_avail,dir=$FASTDIR]" (3rd parameter) as sent to the node's MOM. .sp By default, the scheduler has already internally defined the following mappings, which can be overriden in the configuration file: .sp .Ty .nf keyword node_name CNode..Get host_resource ======= ========= ================ ============= $node * CNodeOsGet arch $node * CNodeLoadAveGet loadave $node * CNodeIdletimeGet idletime .fi .ft 1 .sp The above means that for all declared nodes (via $momhost), the host queries .Ty arch, .Ty loadave, and .Ty idletime will be sent to each node's MOM. The value to .Ty arch is obtained internally by the system during the first scheduling cycle because it falls under STATIC category, while values to .Ty loadave and .Ty idletime are taken at every scheduling iteration because they fall under the DYNAMIC category. Access to the return values is done by calling .Ar "CNodeOsGet(node)", .Ar "CNodeLoadAveGet(node)", and .Ar "CNodeIdletimeGet(node)", respectively. The following are some sample $node arguments that you may put in the configuration file. .BP .Ty .nf node_name CNode..Get host res ================== ========================= ========== CNodeIdletimeGet idletime CNodeLoadAveGet loadave CNodeMemTotalGet[real] physmem CNodeMemTotalGet[virtual] totmem CNodeMemAvailGet[virtual] availmem CNodeNumCpusGet ncpus CNodeMemTotalGet[real] physmem CNodeMemTotalGet[virtual] totmem CNodeIdletimeGet idletime CNodeLoadAveGet loadave CNodeMemAvailGet[virtual] availmem CNodeNumCpusGet ncpus CNodeMemTotalGet[real] physmem CNodeMemTotalGet[virtual] totmem CNodeIdletimeGet idletime CNodeLoadAveGet loadave CNodeMemAvailGet[virtual] availmem CNodeIdletimeGet idletime CNodeLoadAveGet loadave CNodeNumCpusGet ncpus CNodeMemTotalGet[real] physmem CNodeIdletimeGet idletime CNodeLoadAveGet loadave CNodeMemTotalGet[virtual] totmem CNodeMemAvailGet[virtual] availmem CNodeIdletimeGet idletime CNodeLoadAveGet loadave CNodeNumCpusGet ncpus CNodeMemTotalGet[real] physme CNodeMemAvailGet[virtual] availmem CNodeSwapSpaceTotalGet[primary] swaptotal CNodeSwapSpaceAvailGet[primary] swapavail CNodeSwapInBwGet[primary] swapinrate CNodeSwapOutBwGet[primary] swapoutrate CNodePercentIdleGet cpuidle CNodePercentSysGet cpuunix CNodePercentGuestGet cpuguest CNodePercentUsrGet cpuuser CNodeSrfsSpaceAvailGet[$FASTDIR] quota[type =ares_avail, dir=$FASTDIR] CNodeSrfsSpaceAvailGet[$BIGDIR] quota[type =ares_avail, dir=$BIGDIR] CNodeSrfsSpaceAvailGet[$WRKDIR] quota[type =ares_avail, dir=$WRKDIR] CNodeLoadAveGet loadave .fi .ft 1 .sp Suppose you have an execution host that is of irix5 os type, then the entries will be consulted by the scheduler. The initial scheduling cycle would involve sending the STATIC queries .Ty "ncpus", .Ty "physmem", .Ty "totmem" to the execution host's MOM, and access to return values of the queries is done via .Ty "CNodeNumCpusGet(node)", .Ty "CNodeMemTotalGet(node, ""real"")", .Ty "CNodeMemTotalGet(node, ""virtual"")" respectively, where node is the CNode representation of the execution host. The subsequent scheduling cycles will only send DYNAMIC queries .Ty "idletime", .Ty "loadave", and .Ty "availmem", and access to the return values of the queries is done via .Ty "CNodeIdleTimeGet(node)", .Ty "CNodeLoadAveGet(node)", .Ty "CNodeMemAvailGet(node, ""virtual"")". respectively. .RE .LP "Later" entries in the config file take precedence. .LP The configuration file must be "secure". It must be owned by a user id and group id less than 10 and not be world writable. .sp On receipt of a SIGHUP signal, the scheduler will close and reopen its log file and reread its configuration file (if any). .LP .SH FILES .IP $PBS_SERVER_HOME/sched_priv 10 the default directory for configuration files, typically (/usr/spool/pbs)/sched_priv. .LP .SH Signal Handling A C based scheduler will handle the following signals: .IP SIGHUP The server will close and reopen its log file and reread the config file if one exists. .IP SIGALRM If the site supplied scheduling module exceeds the time limit, the Alarm will cause the scheduler to attempt to core dump and restart itself. .IP "SIGINT and SIGTERM" Will result in an orderly shutdown of the scheduler. .LP All other signals have the default action installed. .SH "EXIT STATUS" Upon normal termination, an exit status of zero is returned. .SH "SEE ALSO" basl2c(1B), pbs_sched_tcl(8B), pbs_server(8B), and pbs_mom(8B). .br PBS Internal Design Specification .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/pbs_server.8.in0000664000113300011330000002626411571527053014334 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH pbs_server 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbs_server \- start a pbs batch server .SH SYNOPSIS pbs_server\ [\-a active] [\-d\ config_path\^]\ [\-p\ port\^] [\^\-A\ acctfile\^] [\^\-L\ logfile\^] [\-M\ mom_port\^] [\-R\ momRPP_port] [\-S\ scheduler_port\^] [\-H\ hostname\^] [\-t\ type\^] .SH DESCRIPTION The .B pbs_server command starts the operation of a batch server on the local host. Typically, this command will be in a local boot file such as .I /etc/rc.local . If the batch server is already in execution, .B pbs_server will exit with an error. To insure that the .B pbs_server command is not runnable by the general user community, the server will only execute if its real and effective uid is zero. .LP The server will record a diagnostic message in a log file for any error occurrence. The log files are maintained in the server_logs directory below the home directory of the server. If the log file cannot be opened, the diagnostic message is written to the system console. .SH OPTIONS .IP "\-a active" 15 Specifies if scheduling is active or not. This sets the server attribute .At scheduling . If the option argument is "true" ("True", "t", "T", or "1"), the server is \fBactive\fP and the PBS job scheduler will be called. If the argument is "false" ("False", "f", "F", or "0), the server is \fBidle\fP, and the scheduler will not be called and no jobs will be run. If this option is not specified, the server will retain the prior value of the .At scheduling attribute. .IP "\-d config_path" 15 Specifies the path of the directory which is home to the servers configuration files, PBS_HOME. A host may have multiple servers. Each server must have a different configuration directory. The default configuration directory is given by the symbol $PBS_SERVER_HOME which is typically .Ty /usr/spool/PBS . .IP "\-p port" 15 Specifies the port number on which the server will listen for batch requests. If multiple servers are running on a single host, each must have its own unique port number. This option is for use in testing with multiple batch systems on a single host. .IP "\-A acctfile" Specifies an absolute path name of the file to use as the accounting file. If not specified, the file is named for the current date in the PBS_HOME/server_priv/accounting directory. .IP "\-l scheduler_port" Specifies the host name and port number of listening schedulers. By default pbs_server communicates to the scheduler on the loop back address at port 15004. If the scheduler and pbs_server are not on the same host the -l option tells pbs_server where to find the scheduler. When using TORQUE in high availability mode the -l option should be used to let TORQUE know where all potential schedulers are located. If pbs_server and the scheduler are not on the same node the -l option or the -S option must be used in order for TORQUE to communicate with the scheduler. .IP "\-L logfile" Specifies an absolute path name of the file to use as the log file. If not specified, the file is one named for the current date in the PBS_HOME/server_logs directory, see the .At \-d option. .IP "\-M mom_port" Specifies the host name and/or port number on which the server should connect the job executor, MOM. The option argument, .Ar mom_conn , is one of the forms: host_name, [:]port_number, or host_name:port_number. If host_name not specified, the local host is assumed. If port_number is not specified, the default port is assumed. See the \-M option for pbs_mom(8). .IP "\-R mom_RPPport" Specifies the port number on which the the server should query the up/down status of Mom. See the \-R option for pbs_mom(8). .IP "\-S scheduler_port" 15 Specifies the port number to which the server should connect when contacting the Scheduler. By default pbs_server looks for the scheduler on the loopback address at port 15004. The -S option changes the default to the value given in the option argument. The option argument, .Ar scheduler_conn , is of the same syntax as under the \-M option. .IP "\-H hostname" Causes the server to start under a different hostname as obtained from gethostname(2). Useful for servers with multiple network interfaces to support connections from clients over an interface that has a hostname assigned that differs from the one that is returned by gethostname(2). .IP "\-t type" Specifies the impact on jobs which were in execution, running, when the server shut down. If the running job is not rerunnable or restartable from a checkpoint image, the job is aborted. If the job is rerunnable or restartable, then the actions described below are taken. When the .Ar type argument is: .RS .IP hot 8 All jobs are requeued except non-rerunnable jobs that were executing. Any rerunnable job which was executing when the server went down will be run immediately. This returns the server to the same state as when it went down. After those jobs are restarted, then normal scheduling takes place for all remaining queued jobs. .IP If a job cannot be restarted immediately because of a missing resource, such as a node being down, the server will attempt to restart it periodically for upto 5 minutes. After that period, the server will revert to a normal state, as if warm started, and will no longer attempt to restart any remaining jobs which were running prior to the shutdown. .IP warm 8 All rerunnable jobs which were running when the server went down are requeued. All other jobs are maintained. New selections are made for which jobs are placed into execution. Warm is the default if \-t is not specified. .IP cold 8 All jobs are deleted. Positive confirmation is required before this direction is accepted. .IP create 8 The server will discard any existing configuration files, queues and jobs, and initialize configuration files to the default values. The server is idled. .RE .LP .SH FILES .IP $PBS_SERVER_HOME/server_priv 15 default directory for configuration files, typically /usr/spool/pbs/server_priv .IP $PBS_SERVER_HOME/server_logs 15 directory for log files recorded by the server. .SH Signal Handling On receipt of the following signals, the server performs the defined action: .IP SIGHUP The current server log and accounting log are closed and reopened. This allows for the prior log to be renamed and a new log started from the time of the signal. .IP SIGINT Causes an orderly shutdown of pbs_server. .IP "SIGUSR1, SIGUSR2" Causes server to increase and decrease logging levels, respectively. .IP SIGTERM Causes an orderly shutdown of pbs_server. .IP SIGSHUTDN On systems (Unicos) where SIGSHUTDN is defined, it also causes an orderly shutdown of the server. .IP "SIGPIPE" This signal is ignored. .LP All other signals have their default behavior installed. .SH EXIT STATUS If the server command fails to begin batch operation, the server exits with a value greater than zero. .SH SEE ALSO qsub (1B), pbs_connect(3B), pbs_mom(8B), pbs_sched_basl(8B), pbs_sched_tcl(8B), pbsnodes(8B), qdisable(8B), qenable(8B), qmgr(1B), qrun(8B), qstart(8B), qstop(8B), qterm(8B), and the PBS External Reference Specification. .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/qstop.8.in0000664000113300011330000001346011272401251013307 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qstop 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qstop \- stop pbs batch job processing at a destination .SH SYNOPSIS qstop destination ... .SH DESCRIPTION The .B qstop command directs that a destination should stop processing batch jobs. If the destination is a execution queue, the server will cease scheduling jobs that reside in the queue for execution. If the destination is a routing queue, the server will cease routing jobs from that queue. .LP .if !\n(Pb .ig Ig The qstop command sends a .I "Manage" request to the batch server specified by .Ar destination . The .At started queue attribute is set to FALSE. .Ig .LP In order to execute qstop, the user must have PBS Operation or Manager privilege. .SH OPERANDS The qstop command accepts one or more .Ar destination operands. The operands are one of three forms: .RS 5 .Ty queue .br .Ty @server .br .Ty queue@server .RE If .Ty queue is specified, the request is to stop that queue at the default server. If the .Ty @server form is given, the request is to stop all the queues at that server. If a full destination identifier, .Ty queue@server , is given, the request is to stop the named queue at the named server. .SH STANDARD ERROR The qstop command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qstop command, the exit status will be a value of zero. .LP If the qstop command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), qstart(8B), and qmgr(1B) .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/pbs_sched_tcl.8.in0000664000113300011330000005034011272401251014733 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH pbs_sched 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbs_sched_tcl \- pbs Tcl scheduler .SH SYNOPSIS pbs_sched [\^\-a\ alarm\^] [\^\-b\ file\^] [\^\-d\ home\^] [\^\-i\ file\^] [\^\-L\ logfile\^] [\^\-p\ file\^] [\^\-S\ port\^] [\^\-t\ file\^] [\^\-v\^] [\^\-c\ file\^] .SH DESCRIPTION The .B pbs_sched program runs in conjunction with the PBS server. It queries the server about the state of PBS and communicates with .B pbs_mom to get information about the status of running jobs, memory available etc. It then makes decisions as to what jobs to run. .LP pbs_sched must be executed with root permission. .SH OPTIONS .IP "\-a alarm" 15 This specifies the time in seconds to wait for a schedule run to finish. If a script takes too long to finish, an alarm signal is sent, and the scheduler is restarted. If a core file does not exist in the current directory, .B abort() is called and a core file is generated. The default for .I alarm is 180 seconds. .IP "\-b file" 15 This specifies the "body" file. The file given is read into memory once at program start or after the program receives a SIGHUP and executed each time the scheduler is awakened by the server. If this option is not given, the file "sched_tcl" in the directory PBS_HOME/sched_priv is read for the body code. .IP "\-d home" 15 This specifies the PBS home directory, PBS_HOME. The current working directory of the scheduler is PBS_HOME/sched_priv. If this option is not given, PBS_HOME defaults to $PBS_SERVER_HOME as defined during the PBS build procedure. .IP "\-i file" 15 This specifies the "initialize" file. The file given is executed once before the main processing loop is entered. If this option is not given, no initialization code is executed. .IP "\-L logfile" 15 Specifies an absolute path name of the file to use as the log file. If not specified, the scheduler will open a file named for the current date in the PBS_HOME/sched_logs directory (see the \-d option). .IP "\-p file" 15 This specifies the "print" file. Any output from the Tcl code which is written to standard out or standard error will be written to this file. If this option is not given, the file used will be .I PBS_HOME/sched_priv/sched_out. See the .At \-d option. .IP "\-S port" 15 This specifies the port to use. If this option is not given, the default port for the PBS scheduler is used. .IP "\-t file" 15 This specifies the "terminator" file. If a QUIT command is sent from the server, this code is executed before the scheduler exits. If this option is not given, no special termination handling is done. .IP "\-v" 15 This puts the scheduler into "verbose" mode. Any errors will be shown no matter what this may be set to, but some "uninteresting" events may be logged by using this flag. An example is a message each time the server contacts the scheduler. .IP "\-c file" 15 Specify a configuration file, see description below. If this is a relative file name it will be relative to PBS_HOME/sched_priv, see the \-d option. If the \-c option is not supplied, pbs_sched will not attempt to open a configuration file. .LP The options that specify file names may be absolute or relative. If they are relative, their root directory will be PBS_HOME/sched_priv. .LP .SH USAGE This version of the scheduler requires knowledge of the Tcl language. A set of functions to communicate with the PBS server and resource monitor have been added to those normally available with Tcl. All these calls will set the Tcl variable "pbs_errno" to a value to indicate if an error occured. In all cases, the value "0" means no error. If a call to a Resource Monitor function is made, any error value will come from the system supplied .B errno variable. If the function call communicates with the PBS Server, any error value will come from the error number returned by the server. .IP "openrm host ?port?" 6 Creates a connection to the PBS Resource Monitor on .I host using .I port as the port number or the standard port for the resource monitor if it is not given. A connection handle is returned. If the open is successful, this will be a non-negative integer. If not, an error occurred. .IP "closerm connection" 6 The parameter .I connection is a handle to a resource monitor which was previously returned from .B openrm. This connection is closed. Nothing is returned. .LP .IP "downrm connection" 6 Sends a command to the connected resource monitor to shutdown. Nothing is returned. .LP .IP "configrm connection filename" 6 Sends a command to the connected resource monitor to read the configuration file given by .I filename. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "addreq connection request" 6 A resource request is sent to the connected resource monitor. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "getreq connection" 6 One resource request response from the connected resource monitor is returned. If an error occurred or there are no more responses, an empty string is returned. .LP .IP "allreq request" 6 A resource request is sent to all connected resource monitors. The number of streams acted upon is returned. .LP .IP "flushreq" 6 All resource requests previously sent to all connected resource monitors are flushed out to the network. Nothing is returned. .LP .IP "activereq" 6 The connection number of the next stream with something to read is returned. If there is nothing to read from any of the connections, a negative number is returned. .LP .IP "fullresp flag" 6 Evaluates .I flag as a boolean value and sets the response mode used by .B getreq to .B full if .I flag evaluates to "true". The full return from a resource monitor includes the original request followed by an equal sign followed by the response. The default situation is only to return the response following the equal sign. If a script needs to "see" the entire line, this function may be used. .LP .IP "pbsstatserv" 6 The server is sent a status request for information about the server itself. If the request succeeds, a list with three elements is returned, otherwise an empty string is returned. The first element is the server's name. The second is a list of attributes. The third is the "text" associated with the server (usually blank). .LP .IP "pbsstatjob" 6 The server is sent a status request for information about the all jobs resident within the server. If the request succeeds, a list is returned, otherwise an empty string is returned. The list contains an entry for each job. Each element is a list with three elements. The first is the job's jobid. The second is a list of attributes. The attribute names which specify resources will have a name of the form "Resource_List:name" where "name" is the resource name. The third is the "text" associated with the job (usually blank). .LP .IP "pbsstatque" 6 The server is sent a status request for information about all queues resident within the server. If the request succeeds, a list is returned, otherwise an empty string is returned. The list contains an entry for each queue. Each element is a list with three elements. This first is the queue's name. The second is a list of attributes similar to .B pbsstatjob. The third is the "text" associated with the queue (usually blank). .LP .IP "pbsstatnode" 6 The server is sent a status request for information about all nodes defined within the server. If the request succeeds, a list is returned, otherwise an empty string is returned. The list contains an entry for each node. Each element is a list with three elements. This first is the nodes's name. The second is a list of attributes similar to .B pbsstatjob. The third is the "text" associated with the node (usually blank). .LP .IP "pbsselstat" 6 The server is sent a status request for information about the all runnable jobs resident within the server. If the request succeeds, a list similar to .B pbsstatjob is returned, otherwise an empty string is returned. .LP .IP "pbsrunjob jobid ?location?" 6 Run the job given by .I jobid at the location given by .I location. If .I location is not given, the default location is used. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsasyrunjob jobid ?location?" 6 Run the job given by .I jobid at the location given by .I location without waiting for a positive response that the job has actually started. If .I location is not given, the default location is used. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsrerunjob jobid" 6 Re-runs the job given by .I jobid. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsdeljob jobid" 6 Delete the job given by .I jobid. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsholdjob jobid" 6 Place a hold on the job given by .I jobid. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsmovejob jobid ?location?" 6 Move the job given by .I jobid to the location given by .I location. If .I location is not given, the default location is used. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsqenable queue" 6 Set the "enabled" attribute for the queue given by .I queue to true. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsqdisable queue" 6 Set the "enabled" attribute for the queue given by .I queue to false. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsqstart queue" 6 Set the "started" attribute for the queue given by .I queue to true. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsqstop queue" 6 Set the "started" attribute for the queue given by .I queue to false. If this is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsalterjob jobid attribute_list" 6 Alter the attributes for a job specified by .I jobid. The parameter .I attribute_list is the list of attributes to be altered. There can be more than one. Each attribute consists of a list of three elements. The first is the name, the second the resource and the third is the new value. If the alter is successful, a "0" is returned, otherwise, "\-1" is returned. .LP .IP "pbsrescquery resource_list" 6 Obtain information about the resources specified by .I resource_list. This will be a list of strings. If the request succeeds, a list with the same number of elements as .I resource_list is returned. Each element in this list will be a list with four numbers. The numbers specify .I available, .I allocated, .I reserved, and .I down in that order. .LP .IP "pbsrescreserve resource_id resource_list" 6 Make (or extend) a reservation for the resources specified by .I resource_list which will be given as a list of strings. The parameter .I resource_id is a number which provides a unique identifier for a reservation being tracked by the server. If .I resource_id is given as "0", a new reservation is created. In this case, a new identifier is generated and returned by the function. If an old identifier is used, that same number will be returned. The Tcl variable "pbs_errno" will be set to indicate the success or failure of the reservation. .LP .IP "pbsrescrelease resource_id" 6 The reservation specified by .I resource_id is released. .LP The two following commands are not normally used by the scheduler. They are included here because there could be a need for a scheduler to contact a server other than the one which it normally communicates with. Also, these commands are used by the Tcl tools. .LP .IP "pbsconnect ?server?" 6 Make a connection to the named server or the default server if a parameter is not given. Only one connection to a server is allowed at any one time. .LP .IP pbsdisconnect 6 Disconnect from the currently connected server. .LP The above Tcl functions use PBS interface library calls for communication with the server and the PBS resource monitor library to communicate with pbs_mom. .LP .IP "datetime ?day? ?time?" 6 The number of arguments used determine the type of date to be calculated. With no arguments, the current POSIX date is returned. This is an integer in seconds. .sp With one argument there are two possible formats. The first is a 12 (or more) character string specifying a complete date in the following format: .Cs YYMMDDhhmmss .Ce All characters must be digits. The year (YY) is given by the first two (or more) characters and is the number of years since 1900. The month (MM) is the number of the month [01-12]. The day (DD) is the day of the month [01-32]. The hour (hh) is the hour of the day [00-23]. The minute (mm) is minutes after the hour [00-59]. The second (ss) is seconds after the minute [00-59]. The POSIX date for the given date/time is returned. .sp The second option with one argument is a relative time. The format for this is .Cs HH:MM:SS .Ce With hours (HH), minutes (MM) and seconds (SS) being separated by colons ":". The number returned in this case will be the number of seconds in the interval specified, not an absolute POSIX date. .sp With two arguments a relative date is calculated. The first argument specifies a day of the week and must be one of the following strings: "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", or "Sat". The second argument is a relative time as given above. The POSIX date calculated will be the day of the week given which follows the current day, and the time given in the second argument. For example, if the current day was Monday, and the two arguments were "Fri" and "04:30:00", the date calculated would be the POSIX date for the Friday following the current Monday, at four-thirty in the morning. If the day specified and the current day are the same, the current day is used, not the day one week later. .LP .IP "strftime format time" This function calls the POSIX function .I strftime(). It requires two arguments. The first is a format string. The format conventions are the same as those for the POSIX function strftime(). The second argument is POSIX calendar time in second as returned by .I datetime. It returns a string based on the format given. This gives the ability to extract information about a time, or format it for printing. .LP The Tcl interpreter is started at program initialization and after a reset (the receipt of a SIGHUP signal). It is not deleted between scheduling runs so variables which are set in one can be accessed later. .LP The "initialize" and "terminator" files are run with no supplied connection to the server. This means that none of the above functions which talk to the server will work unless .B pbsconnect is called first. The "body" file is run with a connection to the server already established. .SH CONFIGURATION FILE A configuration file may be specified with the \-c option. This file may be used to specify the hosts (servers) which are allowed to connect to pbs_sched. The hosts are specified in the configuration file in a manor identical to that used in pbs_mom. There is one line per host with the syntax: .br .Ty "$clienthost hostname" .br where clienthost and hostname are separated by white space. .LP Two host names are always allowed to connection to pbs_sched, "localhost" and the name returned to pbs_sched by the system call gethostname(). These names need not be specified in the configuration file. .LP The configuration file must be "secure". It must be owned by a user id and group id less than 10 and not be world writable. .LP .SH FILES .IP $PBS_SERVER_HOME/sched_priv 10 the default directory for configuration files, typically (/usr/spool/pbs)/sched_priv. .LP .SH Signal Handling A C based scheduler will handle the following signals: .IP SIGHUP The server will close and reopen its log file and reread the config file if one exists. .IP SIGALRM If the site supplied scheduling module exceeds the time limit, the Alarm will cause the scheduler to attempt to core dump and restart itself. .IP "SIGINT and SIGTERM" Will result in an orderly shutdown of the scheduler. .LP All other signals have the default action installed. .SH "EXIT STATUS" Upon normal termination, an exit status of zero is returned. .SH "SEE ALSO" pbs_scheduler_cc(8B), pbs_scheduler_rule(8B), pbs_server(8B), and pbs_mom(8B). .br PBS Internal Design Specification .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/Makefile.in0000664000113300011330000003265111605403721013517 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = doc/man8 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man8/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man8/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all work is done in doc/ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/doc/man8/pbs_mom.8.in0000664000113300011330000006670011413217001013575 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH pbs_mom 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbs_mom \- start a pbs batch execution mini-server .SH SYNOPSIS pbs_mom [\^\-a\ alarm\^] [\^\-C\ chkdirectory\^] [\^\-c\ config\^] [\^\-d\ directory] [\^\-H\ hostname] [\^\-L\ logfile] [\^\-M\ MOMport\^] [\^\-R\ RPPport\^] [\^\-p\^|\^\-q\^|\^\-r] [\^\-x] .SH DESCRIPTION The .B pbs_mom command starts the operation of a batch \fBM\fPachine \fBO\fPriented \fBM\fPini\-server, MOM, on the local host. Typically, this command will be in a local boot file such as .I /etc/rc.local . To insure that the pbs_mom command is not runnable by the general user community, the server will only execute if its real and effective uid is zero. .LP One function of pbs_mom is to place jobs into execution as directed by the server, establish resource usage limits, monitor the job's usage, and notify the server when the job completes. If they exist, pbs_mom will execute a prologue script before executing a job and an epilogue script after executing the job. The next function of pbs_mom is to respond to resource monitor requests. This was done by a separate process in previous versions of PBS but has now been combined into one process. The resource monitor function is provided mainly for the PBS scheduler. It provides information about the status of running jobs, memory available etc. The next function of pbs_mom is to respond to task manager requests. This involves communicating with running tasks over a tcp socket as well as communicating with other MOMs within a job (aka a "sisterhood"). .LP Pbs_mom will record a diagnostic message in a log file for any error occurrence. The log files are maintained in the .I mom_logs directory below the home directory of the server. If the log file cannot be opened, the diagnostic message is written to the system console. .SH OPTIONS .IP "\-a alarm" 16 Used to specify the alarm timeout in seconds for computing a resource. Every time a resource request is processed, an alarm is set for the given amount of time. If the request has not completed before the given time, an alarm signal is generated. The default is 5 seconds. .IP "\-C chkdirectory" 16 Specifieds the path of the directory used to hold checkpoint files. [Currently this is only valid on Cray systems.] The default directory is PBS_HOME/spool/checkpoint, see the \-d option. The directory specified with the \-C option must be owned by root and accessible (rwx) only by root to protect the security of the checkpoint files. .IP "\-c config" 16 Specify a alternative configuration file, see description below. If this is a relative file name it will be relative to PBS_HOME/mom_priv, see the \-d option. If the specified file cannot be opened, pbs_mom will abort. If the \-c option is not supplied, pbs_mom will attempt to open the default configuration file "config" in PBS_HOME/mom_priv. If this file is not present, pbs_mom will log the fact and continue. .IP "\-H hostname" 16 Set MOM's hostname. This can be useful on multi-homed networks. .IP "\-d directory" 16 Specifies the path of the directory which is the home of the servers working files, PBS_HOME. This option is typically used along with \-M when debugging MOM. The default directory is given by $PBS_SERVER_HOME which is typically .Ty /usr/spool/PBS . .IP "\-L logfile" 16 Specify an absolute path name for use as the log file. If not specified, MOM will open a file named for the current date in the PBS_HOME/mom_logs directory, see the .At \-d option. .IP "\-M port" 16 Specifies the port number on which the mini-server (MOM) will listen for batch requests. .IP "\-R port" 16 Specifies the port number on which the mini-server (MOM) will listen for resource monitor requests, task manager requests and inter-MOM messages. Both a UDP and a TCP port of this number will be used. .IP "\-p" 16 (Default after version 2.4.0) (Preserve running jobs) -- Specifies the impact on jobs which were in execution when the mini-server shut-down. The \-p option tries to preserve any running jobs when the MOM restarts. The new mini-server will not be the parent of any running jobs, MOM has lost control of her offspring (not a new situation for a mother). The MOM will allow the jobs to continue to run and monitor them indirectly via polling. All recovered jobs will report an exit code of 0 when they are complete. The \-p option is mutually exclusive with the \-r, \-P and \-q options. .IP "\-P" 16 (Terminate all jobs and remove them from the queue) -- Specifies the impact on jobs which were in execution when the mini-server shut-down. With the \-P option, it is assumed that either the entire system has been restarted or the MOM has been down so long that it can no longer guarantee that the pid of any running process is the same as the recorded job process pid of a recovering job. Unlike the \-p option no attempt is made to try and preserve or recover running jobs. All jobs are terminated and removed from the queue. The \-q option is mutually exclusive with the \-p, \-q and \-r options. .IP "\-q" 16 (Requeue all jobs - This is the default behavior in versions prior to 2.4.0) -- Specifies the impact on jobs which were in execution when the mini-servershut-down. Do not terminate running processes. With the \-q option, it is assumed that either the entire system has been restarted or the MOM has been down so long that it can no longer guarantee that the pid of any running process is the same as the recorded job process pid of a recovering job. No attempt is made to kill job processes. The MOM will mark the jobs as terminated and notify the batch server which owns the job. Re-runnable jobs will be requeued. The \-q option is mutually exclusive with the \-p, \-P and \-r options. .IP "\-r" 16 (Terminate running processes and requeue all jobs) -- Specifies the impact on jobs which were in execution when the mini-server shut-down. With the \-r option, MOM will kill any processes belonging to running jobs, mark the jobs as terminated and notify the batch server that owns the job. Re-runnable jobs are reset to a queued state so they can be run again. The \-r option is mutually exclusive with the \-p, \-P and \-q options. .IP If the \-r option is used following a reboot, process IDs (pids) may be reused and MOM may kill a process that is not a batch session. .IP "\-S port" 16 Specifies the port number on which the pbs_server is listening for requests. If pbs_server is started with a \-p option, pbs_mom will need to use the \-S option and match the port value which was used to start pbs_server. .IP "\-x" 16 Disables the check for privileged port resource monitor connections. This is used mainly for testing since the privileged port is the only mechanism used to prevent any ordinary user from connecting. .LP .SH CONFIGURATION FILE The configuration file may be specified on the command line at program start with the \-c flag. The use of this file is to provide several types of run time information to pbs_mom: static resource names and values, external resources provided by a program to be run on request via a shell escape, and values to pass to internal set up functions at initialization (and re-initialization). .LP Each item type is on a single line with the component parts separated by white space. If the line starts with a hash mark (pound sign, #), the line is considered to be a comment and is skipped. .IP "Static Resources" For static resource names and values, the configuration file contains a list of resource names/values pairs, one pair per line and separated by white space. An Example of static resource names and values could be the number of tape drives of different types and could be specified by .IP .Ty "tape3480 4" .br .Ty "tape3420 2" .br .Ty "tapedat 1" .br .Ty "tape8mm 1" .IP "Shell Commands" If the first character of the value is an exclamation mark (!), the entire rest of the line is saved to be executed through the services of the \fBsystem\fP(3) standard library routine. .IP The shell escape provides a means for the resource monitor to yield arbitrary information to the scheduler. Parameter substitution is done such that the value of any qualifier sent with the query, as explained below, replaces a token with a percent sign (%) followed by the name of the qualifier. For example, here is a configuration file line which gives a resource name of "escape": .IP .Ty "escape !echo %xxx %yyy" .IP If a query for "escape" is sent with no qualifiers, the command executed would be "echo %xxx %yyy". If one qualifier is sent, "escape[xxx=hi there]", the command executed would be "echo hi there %yyy". If two qualifiers are sent, "escape[xxx=hi][yyy=there]", the command executed would be "echo hi there". If a qualifier is sent with no matching token in the command line, "escape[zzz=snafu]", an error is reported. .IP size[fs=] Specifies that the available and configured disk space in the filesystem is to be reported to the pbs_server and scheduler. NOTE: To request disk space on a per job basis, specify the file resource as in 'qsub \-l nodes=1,file=1000kb' For example, the available and configured disk space in the /localscratch filesystem will be reported: .IP .Ty "size[fs=/localscratch]" .br .IP "Initialization Value" An initialization value directive has a name which starts with a dollar sign ($) and must be known to MOM via an internal table. The entries in this table now are: .RS .IP pbsserver which defines hostnames running pbs_server that will be allowed to submit jobs, issue Resource Monitor (RM) requests, and get status updates. MOM will continually attempt to contact all server hosts for node status and state updates. Like $PBS_SERVER_HOME/server_name, the hostname may be followed by a colon and a port number. This parameter replaces the oft-confused $clienthost parameter from TORQUE 2.0.0p0 and earlier. Note that the hostname in $PBS_SERVER_HOME/server_name is used if no $pbsserver parameters are found .IP pbsclient which causes a host name to be added to the list of hosts which will be allowed to connect to MOM as long as they are using a privilaged port for the purposes of resource monitor requests. For example, here are two configuration file lines which will allow the hosts "fred" and "wilma" to connect: .IP .Ty "$pbsclient fred" .br .Ty "$pbsclient wilma" .IP Two host name are always allowed to connection to pbs_mom, "localhost" and the name returned to pbs_mom by the system call gethostname(). These names need not be specified in the configuration file. The hosts listed as "clients" can issue Resource Monitor (RM) requests. Other MOM nodes and servers do not need to be listed as clients. .IP restricted which causes a host name to be added to the list of hosts which will be allowed to connect to MOM without needing to use a privilaged port. These names allow for wildcard matching. For example, here is a configuration file line which will allow queries from any host from the domain "ibm.com". .IP .Ty "$restricted *.ibm.com" .IP The restriction which applies to these connections is that only internal queries may be made. No resources from a config file will be found. This is to prevent any shell commands from being run by a non-root process. .br This parameter is generally not required except for some versions of OSX. .IP logevent which sets the mask that determines which event types are logged by pbs_mom. For example: .IP .Ty "$logevent 0x1fff" .br .Ty "$logevent 255" .IP The first example would set the log event mask to 0x1ff (511) which enables logging of all events including debug events. The second example would set the mask to 0x0ff (255) which enables all events except debug events. .IP cputmult which sets a factor used to adjust cpu time used by a job. This is provided to allow adjustment of time charged and limits enforced where the job might run on systems with different cpu performance. If Mom's system is faster than the reference system, set cputmult to a decimal value greater than 1.0. If Mom's system is slower, set cputmult to a value between 1.0 and 0.0. For example: .IP .Ty "$cputmult 1.5 .br .Ty "$cputmult 0.75 .IP usecp specifies which directories should be staged with cp instead of rcp/scp. If a shared filesystem is available on all hosts in a cluster, this directive is used to make these filesystems known to MOM. For example, if /home is NFS mounted on all nodes in a cluster: .IP .Ty "$usecp *:/home /home" .br .IP wallmult which sets a factor used to adjust wall time usage by to job to a common reference system. The factor is used for walltime calculations and limits the same as cputmult is used for cpu time. .IP configversion specifies the version of the config file data, a string. .IP check_poll_time specifies the MOM interval in seconds. MOM checks each job for updated resource usages, exited processes, over-limit conditions, etc. once per interval. This value should be equal or lower to pbs_server's job_stat_rate. High values result in stale information reported to pbs_server. Low values result in increased system usage by MOM. Default is 45 seconds. .IP down_on_error causes MOM to report itself as state "down" to pbs_server in the event of a failed health check. This feature is EXPERIMENTAL and likely to be removed in the future. See HEALTH CHECK below. .IP ideal_load ideal processor load. Represents a low water mark for the load average. Nodes that are currently busy will consider itself free after falling below ideal_load. .IP auto_ideal_load if jobs are running, sets idea_load based on a simple expression. The expressions start with the variable 't' (total assigned CPUs) or 'c' (existing CPUs), an operator (+ \- / *), and followed by a float constant. .IP .Ty "$auto_ideal_load t-0.2" .br .IP loglevel specifies the verbosity of logging with higher numbers specifying more verbose logging. Values may range between 0 and 7. .IP log_file_max_size If this is set to a value > 0 then pbs_mom will roll the current log file to log-file-name.1 when its size is greater than or equal to the value of log_file_max_size. This value is interpreted as kilobytes. . .IP log_file_roll_depth If this is set to a value >=1 and log_file_max_size is set then pbs_mom will continue rolling the log files to log-file-name.log_file_roll_depth. . .IP max_load maximum processor load. Nodes over this load average are considered busy (see ideal_load above). .IP auto_max_load if jobs are running, sets max_load based on a simple expression. The expressions start with the variable 't' (total assigned CPUs) or 'c' (existing CPUs), an operator (+ \- / *), and followed by a float constant. .IP enablemomrestart enable automatic restarts of MOM. If enabled, MOM will check if its binary has been updated and restart itself at a safe point when no jobs are running; thus making upgrades easier. The check is made by comparing the mtime of the pbs_mom executable. Command-line args, the process name, and the PATH env variable are preserved across restarts. It is recommended that this not be enabled in the config file, but enabled when desired with momctl (see RESOURCES for more information.) .IP node_check_script specifies the fully qualified pathname of the health check script to run (see HEALTH CHECK for more information). .IP node_check_interval specifies when to run the MOM health check. The check can be either periodic, event-driver, or both. The value starts with an integer specifying the number of MOM intervals between subsequent executions of the specified health check. After the integer is an optional comma-separated list of event names. Currently supported are "jobstart" and "jobend". This value defaults to 1 with no events indicating the check is run every MOM interval. (see HEALTH CHECK for more information) .IP .Ty "$node_check_interval 0" Disabled. .br .Ty "$node_check_interval 0,jobstart" Only runs at job starts .br .Ty "$node_check_interval 10,jobstart,jobend" .IP .IP prologalarm Specifies maximum duration (in seconds) which the MOM will wait for the job prolog or job job epilog to complete. This parameter default to 300 seconds (5 minutes) .IP rcpcmd Specify the the full path and argument to be used for remote file copies. This overrides the compile-time default found in configure. This must contain 2 words: the full path to the command and the switches. The copy command must be able to recursively copy files to the remote host and accept arguments of the form "user@host:files" For example: .IP .Ty "$rcpcmd /usr/bin/rcp \-rp .br .Ty "$rcpcmd /usr/bin/scp \-rpB .IP remote_checkpoint_dirs Specifies what server checkpoint directories are remotely mounted. This directive is used to tell the MOM which directories are shared with the server. Using remote checkpoint directories eliminates the need to copy the checkpoint files back and forth between the MOM and the server. This parameter is available in 2.4.1 and later. .IP .Ty "$remote_checkpoint_dirs /var/spool/torque/checkpoint" .IP remote_reconfig Enables the ability to remotely reconfigure pbs_mom with a new config file. Default is disabled. This parameter accepts various forms of true, yes, and 1. .IP timeout Specifies the number of seconds before TCP messages will time out. TCP messages include job obituaries, and TM requests if RPP is disabled. Default is 60 seconds. .IP tmpdir Sets the directory basename for a per-job temporary directory. Before job launch, MOM will append the jobid to the tmpdir basename and create the directory. After the job exit, MOM will recursively delete it. The env variable TMPDIR will be set for all pro/epilog scripts, the job script, and TM tasks. .br Directory creation and removal is done as the job owner and group, so the owner must have write permission to create the directory. If the directory already exists and is owned by the job owner, it will not be deleted after the job. If the directory already exists and is NOT owned by the job owner, the job start will be rejected. .IP status_update_time Specifies (in seconds) how often MOM updates its status information to pbs_server. This value should correlate with the server's scheduling interval. High values increase the load of pbs_server and the network. Low values cause pbs_server to report stale information. Default is 45 seconds. .IP varattr This is similar to a shell escape above, but includes a TTL. The command will only be run every TTL seconds. A TTL of \-1 will cause the command to be executed only once. A TTL of 0 will cause the command to be run everytime varattr is requested. This parameter may be used multiple times, but all output will be grouped into a single "varattr" attribute in the request and status output. The command should output data in the form of .Ty varattrname=va1ue1[+value2]... .IP .Ty "$varattr 3600 /path/to/script []..." .IP .RE .LP The configuration file must be executable and "secure". It must be owned by a user id and group id less than 10 and not be world writable. Output from this file must be in the format $VAR=$VAL, i.e., .IP .Ty dataset13=20070104 .br .Ty dataset22=20070202 .br .Ty viraltest=abdd3 .LP .IP xauthpath Specifies the path to the xauth binary to enable X11 fowarding. .IP ignvmem If set to true, then pbs_mom will ignore vmem/pvmem limit enforcement. .IP ignwalltime If set to true, then pbs_mom will ignore walltime limit enforcement. .IP mom_host Sets the local hostname as used by pbs_mom. .SH RESOURCES Resource Monitor queries can be made with momctl's \-q option to retrieve and set pbs_mom options. Any configured static resource may be retrieved with a request of the same name. These are resource requests not otherwise documented in the PBS ERS. .IP cycle forces an immediate MOM cycle .IP status_update_time retrieve or set the $status_update_time parameter .IP check_poll_time retrieve or set the $check_poll_time parameter .IP configversion retrieve the config version .IP jobstartblocktime retrieve or set the $jobstartblocktime parameter .IP enablemomrestart retrieve or set the $enablemomrestart parameter .IP loglevel retrieve or set the $loglevel parameter .IP down_on_error retrieve or set the EXPERIMENTAL $down_on_error parameter .IP "diag0 \- diag4" retrieves various diagnostic information .IP rcpcmd retrieve or set the $rcpcmd parameter .IP version retrieves the pbs_mom version .SH HEALTH CHECK The health check script is executed directly by the pbs_mom daemon under the root user id. It must be accessible from the compute node and may be a script or compiled executable program. It may make any needed system calls and execute any combination of system utilities but should not execute resource manager client commands. Also, as of TORQUE 1.0.1, the pbs_mom daemon blocks until the health check is completed and does not possess a built-in timeout. Consequently, it is advisable to keep the launch script execution time short and verify that the script will not block even under failure conditions. .LP If the script detects a failure, it should return the keyword 'ERROR' to stdout followed by an error message. The message (up to 256 characters) immediately following the ERROR string will be assigned to the node attribute 'message' of the associated node. .LP If the script detects a failure when run from "jobstart", then the job will be rejected. This should probably only be used with advanced schedulers like Moab so that the job can be routed to another node. .LP TORQUE currently ignores ERROR messages by default, but advanced schedulers like moab can be configured to react appropriately. .LP If the experimental $down_on_error MOM setting is enabled, MOM will set itself to state down and report to pbs_server; and pbs_server will report the node as "down". Additionally, the experimental "down_on_error" server attribute can be enabled which has the same effect but moves the decision to pbs_server. It is redundant to have MOM's $down_on_error and pbs_server's down_on_error features enabled. See "down_on_error" in pbs_server_attributes(7B). .LP .SH FILES .IP $PBS_SERVER_HOME/server_name contains the hostname running pbs_server. .IP $PBS_SERVER_HOME/mom_priv 10 the default directory for configuration files, typically (/usr/spool/pbs)/mom_priv. .IP $PBS_SERVER_HOME/mom_logs 10 directory for log files recorded by the server. .IP $PBS_SERVER_HOME/mom_priv/prologue 10 the administrative script to be run before job execution. .IP $PBS_SERVER_HOME/mom_priv/epilogue 10 the administrative script to be run after job execution. .SH SIGNAL HANDLING pbs_mom handles the following signals: .IP SIGHUP causes pbs_mom to re-read its configuration file, close and reopen the log file, and reinitialize resource structures. .IP SIGALRM results in a log file entry. The signal is used to limit the time taken by certain children processes, such as the prologue and epilogue. .IP "SIGINT and SIGTERM" results in pbs_mom exiting without terminating any running jobs. This is the action for the following signals as well: SIGXCPU, SIGXFSZ, SIGCPULIM, and SIGSHUTDN. .IP "SIGUSR1, SIGUSR2" causes MOM to increase and decrease logging levels, respectively. .IP "SIGPIPE, SIGINFO" are ignored. .IP "SIGBUS, SIGFPE, SIGILL, SIGTRAP, and SIGSYS" cause a core dump if the PBSCOREDUMP environmental variable is defined. .LP All other signals have their default behavior installed. .SH EXIT STATUS If the mini-server command fails to begin operation, the server exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), pbs_scheduler_basl(8B), pbs_scheduler_tcl(8B), the PBS External Reference Specification, and the PBS Administrator's Guide. .\" turn off any extra indent left by the Sh macro torque-2.4.16/doc/man8/qterm.8.in0000664000113300011330000001671711413217001013274 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qterm 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qterm \- terminate processing by a PBS batch server .SH SYNOPSIS qterm [\^\-t\ type\^] [server...] .SH DESCRIPTION The .B qterm command terminates a PBS batch server. .if !\n(Pb .ig Ig The command sends a .I "Server Shutdown" batch request to the server. .Ig When a server receives a .if \n(Pb .ig Ig terminate command, .Ig .if !\n(Pb .ig Ig Shutdown request, .Ig the server will go into a .I terminating state. While in this state, the server will not allow new jobs to be started or enqueued. By default, qterm will request a "quick" shutdown of the PBS server. Other ways of shutting down the server (specified with the \-t argument), and their impact on running jobs, are described below. The qterm command will not exit until the server has completed its shutdown procedure. .LP In order to execute qterm, the user must have PBS Operation or Manager privilege. .SH OPTIONS .IP "\-t type" 10 Specifies the type of shut down. The types are: .RS .IP immediate All running jobs are to immediately stop execution. .if !\n(Pb .ig Ig The value passed in the .I Shutdown request is .Sc SHUT_IMMEDIATE . .Ig .IP If checkpoint is supported, running jobs that were submitted with "\-c shutdown" are checkpointed, terminated, and requeued. If checkpoint is not supported or the job cannot be checkpointed, running jobs are requeued if the .At rerunable attribute is true. Otherwise, jobs are killed. .IP Normally the server will not shutdown until there are no jobs in the running state. If the server is unable to contact the MOM of running job, the job is still listed as running. The server may be forced down by a second \*Qqterm \-t immediate\*U command. .IP delay\ If checkpoint is supported, running jobs that were submitted with "\-c shutdown" are checkpointed, terminated, and requeued. If a job cannot be checkpointed, but can be rerun, the job is terminated and requeued. Otherwise, running jobs are allowed to continue to run. Note, the operator or administrator may use the qrerun and qdel commands to remove running jobs. .if !\n(Pb .ig Ig The value passed in the .I Shutdown request is .Sc SHUT_DELAY . .Ig .IP quick\ This option is used when you wish that running jobs be left running when the server shuts down. The server will cleanly shutdown and can be restarted when desired. Upon restart of the server, jobs that continue to run are shown as running; jobs that terminated during the server's absence will be placed into the exiting state. .if !\n(Pb .ig Ig The value passed in the .I Shutdown request is .SC SHUT_NOW . .Ig .RE .LP .SH OPERANDS The .Ar server operand specifies which servers are to shutdown. If no servers are given, then the default server will be terminated. .SH STANDARD ERROR The qterm command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qterm command, the exit status will be a value of zero. .LP If the qterm command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), qmgr(1B), pbs_resources_aix4(7B), pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), and pbs_resources_unicos8(7B) .\" turn off any extra indent left by the Sh macrO .RE torque-2.4.16/doc/man8/qstart.8.in0000664000113300011330000001346311272401251013462 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qstart 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qstart \- start pbs batch job processing at a destination .SH SYNOPSIS qstart destination ... .SH DESCRIPTION The .B qstart command directs that a destination should process batch jobs. If the destination is an execution queue, the server will begin to schedule jobs that reside in the queue for execution. If the destination is a routing queue, the server will begin to route jobs from that queue. .LP .if !\n(Pb .ig Ig The qstart command sends a .I "Manage" request to the batch server specified by .Ar destination . The .At started queue attribute is set to TRUE. .Ig .LP In order to execute qstart, the user must have PBS Operation or Manager privilege. .SH OPERANDS The qstart command accepts one or more .Ar destination operands. The operands are one of three forms: .RS 5 .Ty queue .br .Ty @server .br .Ty queue@server .RE If .Ty queue is specified, the request is to start that queue at the default server. If the .Ty @server form is given, the request is to start all queues at that server. If a full destination identifier, .Ty queue@server , is given, the request is to start the named queue at the named server. .SH STANDARD ERROR The qstart command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qstart command, the exit status will be a value of zero. .LP If the qstart command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), qstop(8B), and qmgr(1B) .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/qenable.8.in0000664000113300011330000001342611272401251013552 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qenable 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qenable \- enable input to a pbs destination .SH SYNOPSIS qenable destination ... .SH DESCRIPTION The .B qenable command directs that a destination should accept batch jobs. .LP The qenable command sends a .I "Manage" request to the batch server specified by .Ar destination . .if !\n(Pb .ig Ig The .At enabled queue attribute is set to TRUE. If the request is accepted, that server will accept .Ig .if \n(Pb .ig Ig If the command is accepted, the destination will accept .Ig .I "Queue Job" requests which specified the queue. .LP In order to execute qenable, the user must have PBS Operation or Manager privilege. .SH OPERANDS The qenable command accepts one or more .Ar destination operands. The operands are one of three forms: .RS 5 .Ty queue .br .Ty @server .br .Ty queue@server .RE If .Ty queue is specified, the request is to enable that queue at the default server. If the .Ty @server form is given, the request is to enable all the queues at that server. If a full destination identifier, .Ty queue@server , is given, the request is to enable the named queue at the named server. .SH STANDARD ERROR The qenable command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qenable command, the exit status will be a value of zero. .LP If the qenable command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), qdisable(8B), and qmgr(1B) .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man8/Makefile.am0000664000113300011330000000010711272401251013471 00000000000000include $(top_srcdir)/buildutils/config.mk # all work is done in doc/ torque-2.4.16/doc/man8/qdisable.8.in0000664000113300011330000001367511272401251013735 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qdisable 8B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qdisable \- disable input to a pbs destination .SH SYNOPSIS qdisable destination ... .SH DESCRIPTION The .B qdisable command directs that a destination should no longer accept batch jobs. .if !\n(Pb .ig Ig .LP The qdisable command sends a .I "Manage" request to the batch server specified by .Ar destination . The .At enabled queue attribute is set to FALSE. If the batch request is accepted, the server will no longer accept .Ig .if \n(Pb .ig Ig If the command is accepted, the destination will no longer accept .Ig .I "Queue Job" requests which specified the disabled queue. Jobs which already reside in the queue will continue to be processed. This allows a queue to be "drained." .LP In order to execute qdisable, the user must have PBS Operation or Manager privilege. .SH OPERANDS The qdisable command accepts one or more .Ar destination operands. The operands are one of three forms: .RS 5 .Ty queue .br .Ty @server .br .Ty queue@server .RE If .Ty queue is specified, the request is to disable that queue at the default server. If the .Ty @server form is given, the request is to disable all the queues at that server. If a full destination identifier, .Ty queue@server , is given, the request is to disable the named queue at the named server. .SH STANDARD ERROR The qdisable command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qdisable command, the exit status will be a value of zero. .LP If the qdisable command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), qmgr(1B), and qenable(8B) .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man7/0000777000113300011330000000000011614035207011524 500000000000000torque-2.4.16/doc/man7/pbs_resources_irix6.7.in0000664000113300011330000001621711272401250016140 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_irix 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_irix \- pbs resources on SGI Irix .SH DESCRIPTION This page summarizes the resources supported by PBS for SGI workstations running IRIX 6. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 SGI Irix 6 Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP ncpus The number of processors requested. Units: unitary. .IP cpupercent The maximum percentage of a cpu which the job used. A value of 100 means 1 cpu. This cannot be set, it is only reported. Units: percent. .IP nice The nice value under which the job is to be run. Units: unitary. .IP nodemask A bit mask specifying the nodes (a pair of processors) to be associated with this job. This resource is intended for use by PBS to optimize processor allocation and direct use of this field by the job owner is discouraged. Units: bit mask. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,vmem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_unicos8.7.in0000664000113300011330000002032111272401250016456 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_unicos 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_unicos \- pbs resources under Unicos .SH DESCRIPTION This page summarizes the resources and special features supported by PBS for Cray Research computers running Unicos versions 8 and 9. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 CRI Computers running Unicos version 8, 9, or 10 .Ig .LP .IP ncpus 10 Maximum number of multitask processes in the job. If this is set the environment variable NCPUS will be set to the given value. Units: unitary. .IP cput Maximum amount of CPU time used by all processes in the job. Root processes are not limited, see limit(2). Units: time. .IP mem Maximum amount of physical memory used by all concurrent processes in the job. Units: size. .IP mppe The number of processing elements used by a single process in the job. Units: unitary. .IP mppt Maximum amount of wall clock time used on the MPP in the job. Units: time. .IP "mta, mtb, mtc, ..., mth Maximum number of magnetic tape drives required in the corresponding device class of a, b, c, ..., h. Units: unitary. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pncpus Maximum number of processors used by any single process in the job. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pf Maximum number of file system blocks that can be used by all process in the job. Units: size. .IP pmem Maximum amount of physical memory used by any single process in the job. Units: size. .IP pmppt Maximum amount of wall clock time used on the MPP by a single process in the job. Units: time. .IP ppf Maximum number of file system blocks that can be used by a single process in the job. Units: size. .IP procs Maximum number of processes in the job. Units: unitary. .IP psds Maximum number of data blocks on the SDS (secondary data storage) for any process in the job. .IP sds Maximum number of data blocks on the SDS (secondary data storage) for the job. .IP srfs_tmp Session Reservable File System (SRFS) space in TMPDIR. Note, SRFS is not supported by Cray. Units: size. .IP srfs_wrk SRFS space in WRKDIR. Units: size. .IP srfs_big SRFS space in BIGDIR. Units: size. .IP srfs_fast SRFS space in FASTDIR. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,pcput=20:00,file=50gb,mem=15mb,mta=2 script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .br qsub \-lsrfs_tmp=50mb,srfs_big=2gw script .LP or in a qsub script as directives: .LP #PBS \-l cput=1:00:00,pcput=20:00,file=50gb,mem=15mb,mta=2 .br #PBS \-lsrfs_tmp=50mb,srfs_big=2gw .LP .if !\n(Pb .ig Ig .\" for ers only .RE .Ig .SH "SPECIAL FEATURES" Cray Unicos supports checkpoint and restart. Any description of checkpoint features in PBS are applicable to Unicos. .RE .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_irix5(7B) pbs_resources_sp2(7B), pbs_resources_sunos4(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_darwin.7.in0000664000113300011330000001526511272401250016365 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_darwin 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_darwin \- pbs resources on Darwin .SH DESCRIPTION This page summarizes the resources supported by PBS for PC workstations running Darwin. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 Darwin Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_sunos4.7.in0000664000113300011330000001527711272401250016337 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_Resources_sunos4 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_sunos4 \- pbs resources on SunOS 4 .SH DESCRIPTION This page summarizes the resources supported by PBS for Sun workstations running SunOS 4.x. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 Sun SunOS Version 4 Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15 .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_irix5(7B) pbs_resources_sp2(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_freebsd.7.in0000664000113300011330000001530111272401250016502 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_Resources_freebsd 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_freebsd \- pbs resources on FreeBSD .SH DESCRIPTION This page summarizes the resources supported by PBS for AMD/Intel/Cyrix workstations running FreeBSD. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 FreeBSD Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15 .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_irix5(7B) pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_queue_attributes.7.in0000664000113300011330000003656511272401250016407 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_queue_attributes 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_queue_attributes \- pbs queue attributes .SH DESCRIPTION .Iq .if !\n(Pb .ig Ig .\" for ers .NH 3 .Tc Queue Public Attributes .Ig .LP Queue public attributes are alterable on request by a client. The client must be acting for a user with administrator (manager) or operator privilege. Certain attributes require the user to have full administrator privilege before they can be modified. The following attributes apply to both queue types: .RS .25i .Al acl_group_enable Attribute which when true directs the server to use the queue group access control list .I acl_groups . Format: boolean, "TRUE", "True", "true", "Y", "y", "1", "FALSE", "False", "false", "N", "n", "0"; default value: false = disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_group_sloppy Search a job user's secondary groups if the effective group doesn't match the group acl. Warning, this can be very slow and expensive. Format: boolean, "TRUE", "True", "true", "Y", "y", "1", "FALSE", "False", "false", "N", "n", "0"; default value: false = disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_groups List which allows or denies enqueuing of jobs owned by members of the listed groups. The groups in the list are groups on the server host, not submitting hosts. If acl_group_enable is set to true, only groups listed in the acl_groups attribute will be allowed access to the queue. See section 10.1, Authorization, in the PBS External Reference Specification. Format: "[+|-]group_name[,...]"; default value: all groups allowed. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al acl_host_enable Attribute which when true directs the server to use the .I acl_hosts access list. Format: boolean (see acl_group_enable); default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_hosts List of hosts which may enqueue jobs in the queue. See section 10.1, Authorization, in the PBS External Reference Specification. Format: "[+|-]hostname[...]"; default value: all hosts allowed. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al acl_logic_or Modifies the way acls are applied if both .I acl_user_enable and .I acl_group_enable are set to true. If .I acl_logic_or is true, then user and group acls are logically OR'ed together (a job can pass either the user or group acl lists to be allowed access to the queue). If I acl_logic_or is false, then user and group acls are logically AND'ed together (a job would have to pass both user and group acl lists). Format: boolean (see acl_group_enable and acl_user_enable); default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_user_enable Attribute which when true directs the server to use the the .I acl_users access list for this queue. Format: boolean (see acl_group_enable); default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_users List of users allowed or denied the ability to enqueue jobs in this queue. See section 10.1, Authorization, in the PBS External Reference Specification. If acl_user_enable is set to true, only users listed in the acl_groups attribute will be allowed access to the queue. Format: "[+|-]user[@host][,...]"; default value: all users allowed. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al disallowed_types List of job "types" (interactive,batch,rerunable,nonrerunable,fault_tolerant,fault_intolerant) that are not allowed in this queue. default value: all types allowed. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al enabled Queue will or will not accept new jobs. When false the queue is \*Qdisabled\*U and will not accept jobs. Format: boolean (see acl_group_enable); default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al from_route_only When true, this queue will not accept jobs except when being routed by the server from a local routing queue. This is used to force user to submit jobs into a routing queue used to distribute jobs to other queues based on job resource limits. Format: boolean; default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al is_transit When true, jobs will be allowed into this queue that do not fit server resource limitations. This is to allow the jobs to be routed to a server that does have the appropriate resources. Any queue limits are checked. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al max_queuable The maximum number of jobs allowed to reside in the queue at any given time. Format: integer; default value: infinite. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al max_user_queuable The maximum number of jobs owned by a single user that are allowed to reside in the queue at any given time. Format: integer; default value: infinite. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al max_running The maximum number of jobs allowed to be selected from this queue for routing or execution at any given time. For a routing queue, this is enforced, if set, by the server. For an execution queue, this attribute is advisory to the Scheduler, it is not enforced by the server. Format: integer. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al Priority The priority of this queue against other queues of the same type on this server. May affect job selection for execution/routing. Advisory to the Scheduler, not used by the server. Format: integer. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al queue_type The type of the queue: execution or route. Format: "execution", "e", "route", "r". This attribute must be explicitly set. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al resources_max The maximum amount of each resource which can be requested by a single job in this queue. The queue value supersedes any server wide maximum limit. Format: "resources_max.resource_name=value", see qmgr(1B); default value: infinite usage. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al resources_min The minimum amount of each resource which can be requested by a single job in this queue. Format: see resources_max, default value: zero usage. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al resources_default The list of default resource values which are set as limits for a job residing in this queue and for which the job did not specify a limit. Format: "resources_default.resource_name=value", see qmgr(1B); default value: none; if not set, the default limit for a job is determined by the first of the following attributes which is set: server's resources_default, queue's resources_max, server's resources_max. If none of these are set, the job will unlimited resource usage. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al started\ Jobs may be scheduled for execution from this queue. When false, the queue is considered \*Qstopped.\*U Advisory to the Scheduler, not enforced by the server. [default value: false, but depends on scheduler interpretation] Format: boolean (see acl_group_enable). .if !\n(Pb .ig Ig [internal type: boolean] .Ig .RE .LP The following attributes apply only to execution queues: .RS .25i .Al "checkpoint_min \(sc" Specifies the minimum interval of cpu time, in minutes, which is allowed between checkpoints of a job. If a user specifies a time less than this value, this value is used instead. Format: integer; default value: no minimum. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al resources_available The list of resource and amounts available to jobs running in this queue. The sum of the resource of each type used by all jobs running from this queue cannot exceed the total amount listed here. Advisory to the Scheduler, not enforced by the server. Format: "resources_available.resource_name=value", see qmgr(1B). .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al keep_completed Number of seconds to retain completed jobs in the C state. This overrides the server attribute of the same name. EXPERIMENTAL Format: integer; default value: 0. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al kill_delay The amount of the time delay between the sending of SIGTERM and SIGKILL when a qdel command is issued against a running job. This overrides the server attribute of the same name. Format: integer seconds; default value: 2 seconds. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al max_user_run The maximum number of jobs owned by a single user that are allowed to be running from this queue at one time. This attribute is advisory to the Scheduler, it is not enforced by the server. Format: integer; default value: none. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al max_group_run The maximum number of jobs owned by any users in a single group that are allowed to be running from this queue at one time. This attribute is advisory to the Scheduler, it is not enforced by the server. Format: integer; default value: none. .if !\n(Pb .ig Ig [internal type: integer] .Ig .RE .LP The following attributes apply only to routing queues: .RS .25i .Al route_destinations The list of destinations to which jobs may be routed. [default value: none, should be set to at least one valid destination] .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .Al alt_router If true, an site supplied, alternative job router function is used to determine the destination for routing jobs from this queue. Otherwise, the default, round-robin router is used. Format: boolean (see acl_group_enable); default value: false. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al route_held_jobs If true, jobs with a hold type set may be routed from this queue. If false, held jobs are not to be routed. Format: boolean (see acl_group_enable); default value: false. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al route_waiting_jobs If true, jobs with a future .At execution_time attribute may be routed from this queue. If false, they are not to be routed. Format: boolean (see acl_group_enable); default value: false. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al route_retry_time Time delay between route retries. Typically used when the network between servers is down. Format: integer seconds; default value: .Sc PBS_NET_RETRY_TIME (30 seconds). .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al route_lifetime The maximum time a job is allowed to exist in a routing queue. If the job cannot be routed in this amount of time, the job is aborted. If unset or set to a value of zero (0), the lifetime is infinite. Format: integer seconds; default infinite. .if !\n(Pb .ig Ig [internal type: integer] .Ig .RE .if !\n(Pb .ig Ig .\" ers only .NH 3 .Tc Queue Read-Only Attributes .Ig .LP The following data items are read-only attributes of the queue. They are visible to but cannot be changed by clients. .LP Items which apply to all types of queues are: .RS .25i .Al total_jobs The number of jobs currently residing in the queue. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al state_count The total number of jobs currently residing in the queue in each state. .if !\n(Pb .ig Ig [internal type: special, array of integers] .Ig .RE .LP These read-only attributes only apply to execution queues: .RS .25i .Al resources_assigned The total amount of certain types of resources allocated to jobs running from this queue. .if !\n(Pb .ig Ig [internal type: resource] .Ig .RE .if \n(Pb .ig Ig .\" man page only .SH SEE ALSO the PBS ERS, qmgr(1B), pbs_resources(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_aix4.7.in0000664000113300011330000001543411272401250015744 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_aix4 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_aix4 \- pbs Resources on IBM AIX 4 .SH DESCRIPTION This page summarizes the resources supported by PBS for IBM systems running AIX version 4. These resources are specified for jobs by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 IBM AIX Version 4 Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP mem Maximum amount of physical memory (workingset) used by the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_netbsd.7.in0000664000113300011330000001531611272401250016355 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_Resources_netbsd 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_netbsd \- pbs resources on NetBSD .SH DESCRIPTION This page summarizes the resources supported by PBS for workstations running NetBSD on various hardware architectures. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 NetBSD Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15 .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_irix5(7B) pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_freebsd5.7.in0000664000113300011330000001530711272401250016575 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_Resources_freebsd5 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_freebsd5 \- pbs resources on FreeBSD 5.x .SH DESCRIPTION This page summarizes the resources supported by PBS for AMD/Intel/Cyrix workstations running FreeBSD. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 FreeBSD Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15 .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_irix5(7B) pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/Makefile.in0000664000113300011330000003265111605403720013515 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = doc/man7 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man7/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man7/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all work is done in doc/ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/doc/man7/pbs_resources_unicosmk2.7.in0000664000113300011330000002007111272401250017002 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_unicosmk2 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_unicosmk2 \- pbs resources under Unicos MK2 .SH DESCRIPTION This page summarizes the resources and special features supported by PBS for Cray Research computers running Unicos MK version 2. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 CRI Computers running Unicos MK version 2. .Ig .LP .IP cput Maximum amount of CPU time used by all processes in the job. Root processes are not limited, see limit(2). Units: time. .IP mem Maximum amount of physical memory used by all concurrent processes in the job. Units: size. .IP mppe The number of processing elements used by a single process in the job. Units: unitary. .IP mppt Maximum amount of wall clock time used on the MPP in the job. Units: time. .IP "mta, mtb, mtc, ..., mth Maximum number of magnetic tape drives required in the corresponding device class of a, b, c, ..., h. Units: unitary. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pncpus Maximum number of processors used by any single process in the job. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pf Maximum number of file system blocks that can be used by all process in the job. Units: size. .IP pmem Maximum amount of physical memory used by any single process in the job. Units: size. .IP pmppt Maximum amount of wall clock time used on the MPP by a single process in the job. Units: time. .IP ppf Maximum number of file system blocks that can be used by a single process in the job. Units: size. .IP procs Maximum number of processes in the job. Units: unitary. .IP psds Maximum number of data blocks on the SDS (secondary data storage) for any process in the job. .IP sds Maximum number of data blocks on the SDS (secondary data storage) for the job. .IP srfs_tmp Session Reservable File System (SRFS) space in TMPDIR. Note, SRFS is not supported by Cray. Units: size. .IP srfs_wrk SRFS space in WRKDIR. Units: size. .IP srfs_big SRFS space in BIGDIR. Units: size. .IP srfs_fast SRFS space in FASTDIR. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,pcput=20:00,file=50gb,mem=15mb,mta=2 script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .br qsub \-lsrfs_tmp=50mb,srfs_big=2gw script .LP or in a qsub script as directives: .LP #PBS \-l cput=1:00:00,pcput=20:00,file=50gb,mem=15mb,mta=2 .br #PBS \-lsrfs_tmp=50mb,srfs_big=2gw .LP .if !\n(Pb .ig Ig .\" for ers only .RE .Ig .SH "SPECIAL FEATURES" Cray Unicos MK supports checkpoint and restart. Any description of checkpoint features in PBS are applicable to Unicos MK. .RE .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_irix5(7B) pbs_resources_sp2(7B), pbs_resources_sunos4(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_irix6array.7.in0000664000113300011330000001621611272401250017176 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_irix 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_irix \- pbs resources on SGI Irix .SH DESCRIPTION This page summarizes the resources supported by PBS for SGI workstations running IRIX 6. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 SGI Irix 6 Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP ncpus The number of processors requested. Units: unitary. .IP cpupercent The maximum percentage of a cpu which the job used. A value of 100 means 1 cpu. This cannot be set, it is only reported. Units: percent. .IP nice The nice value under which the job is to be run. Units: unitary. .IP nodemask A bit mask specifying the nodes (a pair of processors) to be associated with this job. This resource is intended for use by PBS to optimize processor allocation and direct use of this field by the job owner is discouraged. Units: bit mask. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_solaris7.7.in0000664000113300011330000001527011272401250016640 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_solaris 7B "" Local PBS .so ers.macros .SH NAME pbs_resources_solaris \- pbs resources on SUN Solaris .SH DESCRIPTION This page summarizes the resources supported by PBS for Sun workstations running Solaris 2.x. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 Sun Solaris Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,vmem=15mb script .br qalter \-lcput=30:00 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,vmem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_aix5.7.in0000664000113300011330000001543411272401250015745 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_aix5 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_aix5 \- pbs Resources on IBM AIX 5 .SH DESCRIPTION This page summarizes the resources supported by PBS for IBM systems running AIX version 5. These resources are specified for jobs by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 IBM AIX Version 5 Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP mem Maximum amount of physical memory (workingset) used by the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_sp2.7.in0000664000113300011330000001372211272401250015601 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_sp2 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_sp2 \- pbs resources on IBM SP-2 .SH DESCRIPTION This page summarizes the resources supported by PBS for the IBM SP-2. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 IBM SP-2 Resources .Ig .LP .IP nice The nice value under which the job is to be run. Units: unitary. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .\" .IP size 8 .\" specifies the maximum amount in terms of bytes or words. It is expressed .\" in the form .\" .Ty integer[suffix] .\" The suffix is a multiplier defined in the following table, .\" 'b' means bytes (the default) and 'w' means words. .\" The size of a word is the word size on the execution host. .\" .RS .\" .IP "\ b\ or\ \ w" 12 .\" bytes or words. .\" .IP "kb\ or\ kw" .\" Kilo (1024) bytes or words. .\" .IP "mb\ or\ mw" 12 .\" Mega (1,048,576) bytes or words. .\" .IP "gb\ or\ gw" 12 .\" Giga (1,073,741,824) bytes or words. .\" .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_irix5(7B) pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_irix5.7.in0000664000113300011330000001526711272401250016143 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_irix 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_irix \- pbs resources on SGI Irix .SH DESCRIPTION This page summarizes the resources supported by PBS for SGI workstations running IRIX 5. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 SGI Irix 5 Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_digitalunix.7.in0000664000113300011330000001513611272401250017417 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_digitalunix 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_digitalunix \- pbs resources on DEC Unix .SH DESCRIPTION This page summarizes the resources supported by PBS for DEC systems running Digital Unix 5. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 Digital Unix Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_hpux11.7.in0000664000113300011330000001511211272401250016216 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_hpux11 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_hpux11 \- pbs resources on HP UX .SH DESCRIPTION This page summarizes the resources supported by PBS for systems running HP UX version 11.x. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 HP UX Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_hpux10.7.in0000664000113300011330000001511211272401250016215 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_hpux10 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_hpux10 \- pbs resources on HP UX .SH DESCRIPTION This page summarizes the resources supported by PBS for systems running HP UX version 10.x. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 HP UX Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_job_attributes.7.in0000664000113300011330000004406311272401250016025 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_job_attributes 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_job_attributes \- pbs job attributes .SH DESCRIPTION .Iq .if !\n(Pb .ig Ig .\" for ers .NH 3 .Tc Public Job Attributes .Ig .LP A batch job has the following public attributes shown in the following list. The attributes marked with the section symbol \(sc are required by POSIX 1003.2d: If an attribute is unset, the indicated default value is assumed. .Al "Account_Name \(sc" Used for accounting on some hosts. .if !\n(Pb .ig Ig .\" ers only A server may not use the string, but allowances for it must be made. .Ig Format: string; default value: none, not used. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "Checkpoint \(sc" If supported by the server implementation and the host operating system, the checkpoint attribute determines when checkpointing will be performed by PBS on behalf of the job. The legal values for checkpoint are described under the .B qalter and .B qsub commands. Format: the strings "n", "s", "c", "c=mmmm"; default value: "u", which is unspecified. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al depend The type of inter-job dependencies specified by the job owner. Format: "type:jobid[,jobid...]"; default value: no dependencies. .if !\n(Pb .ig Ig [internal type: special, dependency] .Ig .Al "Error_Path \(sc" The final path name for the file containing the job's standard error stream. See the .B qsub and .B qalter command description for more detail. Format: "[hostname:]pathname"; default value: (job_name).e(job_number). .if !\n(Pb .ig Ig [internal type: list] .Ig .Al "Execution_Time \(sc" The time after which the job may execute. The time is maintained in seconds since Epoch. If this time has not yet been reached, the job will not be scheduled for execution and the job is said to be in .B wait state. Format: "[[CCwYY]MMDDhhmm[.ss]"; default value: time 0, no delay. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al "group_list \(sc" A list of .Ty group_names@hosts which determines the group under which the job is run on a given host. [internal type: array of strings] When a job is to be placed into execution, the server will select a group name according to the following ordered set of rules: .RS .IP 1. 3 Select the group name from the list for which the associated host name matches the name of the execution host. .IP 2. 3 Select the group name which has no associated host name, the \*Qwild card name.\*U .IP 3. 3 Use the login group for the user name under which the job will be run. .RE .IP Format: "group_name[@host][,group_name[@host]...]". .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .Al "Hold_Types \(sc" The set of holds currently applied to the job. If the set is not null, the job will not be scheduled for execution and is said to be in the .B hold state. Note, the .B hold state takes precedence over the .B wait state. Format: string made up of the letters 'u', 's', 'o'; default value: no hold. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "Job_Name \(sc" The name assigned to the job by the .B qsub or .B qalter command. Format: string up to 15 characters, first character must be alphabetic; default value: the base name of the job script or STDIN. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "Join_Path \(sc" If the .At Join_Paths attribute is .Sc TRUE , then the job's standard error stream will be merged, inter-mixed, with the job's standard output stream and placed in the file determined by the .At Output_Path attribute. The .At Error_Path attribute is maintained, but ignored. Format: boolean, values accepted are "True", "TRUE", "true", "Y", "y", "1", "False", "FALSE", "false", "N", "n", "0"; default value: false. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "Keep_Files \(sc" If .At Keep_Files contains the values "o" .if !\n(Pb .ig Ig .Sc KEEP_OUTPUT .Ig and/or "e" .if !\n(Pb .ig Ig .Sc KEEP_ERROR .Ig the corresponding streams of the batch job will be retained on the execution host upon job termination. .At Keep_Files overrides the .At Output_Path and .At Error_Path attributes. Format: "o", "e", "oe" or "eo"; default value: no keep, return files to submission host. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "Mail_Points \(sc" Identifies at which state changes the server will send mail about the job. Format: string made up of the letters 'a' for abort, 'b' for beginning, and 'e' for ending; default value: 'a', send on job abort. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "Mail_Users \(sc" The set of users to whom mail may be sent when the job makes certain state changes. Format: "user@host[,user@host]"; default value: job owner only. .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .Al "Output_Path \(sc" The final path name for the file containing the job's standard output stream. See the .B qsub and .B qalter command description for more detail. Format: see error_path, default value: (job_name).o(job_number). .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "Priority \(sc" The job scheduling priority assigned by the user. Format: "[+|-]nnnnn"; default value: undefined. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al "Rerunable \(sc" The rerunable flag given by the user. Format: "y" or "n", see Join_Path; default value: y, job is rerunable. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al "Resource_List \(sc" The list of resources required by the job. The resource list is a set of .Ty name=value strings. The meaning of .Ty name and .Ty value is server dependent. The value also establishes the limit of usage of that resource. If not set, the value for a resource may be determined by a queue or server default established by the administrator. Default value: no usage or no limit depending on specific resource. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al "Shell_Path_List \(sc" A set of absolute paths of the program to process the job's script file. The list is in the format: "path[@host][,path[@host]...]". If this is null, then the user's login shell on the host of execution will be used. Default value: null, login shell. .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .Al stagein The list of files to be staged in prior to job execution. Format: local_path@remote_host:remote_path .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .Al stageout The list of files to be staged out after job execution. Format: local_path@remote_host:remote_path .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .Al "User_List \(sc" The list of .Ty user@hosts which determines the user name under which the job is run on a given host. [internal type: array of strings] When a job is to be placed into execution, the server will select a user name from the list according to the following ordered set of rules: .RS .IP 1. 3 Select the user name from the list for which the associated host name matches the name of the execution host. .IP 2. 3 Select the user name which has no associated host name, the \*Qwild card name.\*U .IP 3. 3 Use the .At Job_Owner as the user name. .RE .IP Default value: job owner name. .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .Al "Variable_List \(sc" This is the list of environment variables passed with the .I "Queue Job" batch request. Format: "name=value[,name=value...]". .if !\n(Pb .ig Ig [internal type: array of strings] .Ig .if !\n(Pb .ig Ig .NH 3 .Tc Privileged Job Attributes .Ig .LP The following attributes require system, manager, or operator privilege to set. They are visible to clients depending on privilege as noted. .Al comment An attribute for displaying comments about the job from the system. Visible to any client. Format: any string; default value: none. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al sched_hint This attribute is present when the job is a member of a synchronous dependency set. It is set when the hold is released on the job. The value is .Sc SYNC_SCHED_HINT_FIRST (1) when the first job of the set is released for scheduling. This is a hint that may be used by the scheduler to decrease the priority of the job. This keeps a user from attempting to \*Qgame\*U the scheduler. The attribute is set to .Sc SYNC_SCHED_HINT_OTHER (2) for all other jobs in the set as they become schedulable. This should be taken as a hint by the scheduler to increase their priority to insure they will run at the same time as the earlier scheduled jobs in the set. [This attribute is viewable only by the batch administrator.] [type: integer] .if !\n(Pb .ig Ig .NH 3 .Tc Read-Only Job Attributes .Ig .LP The following attributes are read-only, they are established by the server and are visible to the client but cannot be set by a client. Certain ones are only visible to privileged clients (those run by the batch administrator). .Al alt_id For a few systems, such as Irix 6.x running Array Services, the session id is insufficient to track which processes belong to the job. Where a different identifier is required, it is recorded in this attribute. If set, it will also be recorded in the end-of-job accounting record. .IP For Irix 6.x running Array Services, the alt_id attribute is set to the Array Session Handle (ASH) assigned to the job. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al ctime\ The time that the job was created. .if !\n(Pb .ig Ig [internal type: integer, (seconds since epoch)] .Ig .Al etime The time that the job became eligible to run, i.e. in a queued state while residing in an execution queue. .if !\n(Pb .ig Ig [internal type: integer, (seconds since epoch)] .Ig .Al exec_host If the job is running, this is set to the name of the host on which the job is executing. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al exit_status The exit status of the job. This is only set on receipt of a job obituary notice from MOM, and probably only useful if the "keep_completed" server attribute is set. Note that negative values are generated internally by PBS to indicate system errors and are listed as the JOB_EXEC_* defines in pbs_job.h. Positive values are returned from the user script and cannot be interpreted by PBS. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al egroup If the job is queued in an execution queue, this attribute is set to the group name under which the job is to be run. [This attribute is available only to the batch administrator.] .if !\n(Pb .ig Ig [internal type: string] .Ig .Al euser If the job is queued in an execution queue, this attribute is set to the user name under which the job is to be run. [This attribute is available only to the batch administrator.] .if !\n(Pb .ig Ig [internal type: string] .Ig .Al hashname The name used as a basename for various files, such as the job file, script file, and the standard output and error of the job. [This attribute is available only to the batch administrator.] .if !\n(Pb .ig Ig [type: string] .Ig .Al "interactive" True if the job is an interactive PBS job. Format: boolean, see Join_Paths; default value: false. .if !\n(Pb .ig Ig [internal type: long] Internally, the value is the port number obtained by qsub when the job was submitted. .Ig .Al "Job_Owner \(sc" The login name on the submitting host of the user who submitted the batch job. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al "job_state The state of the job. .RS .IP E for exiting, the job has completed execution, with or without errors, and the batch system is doing post-execution clean-up. .IP H for Held, one or more holds have been applied to the job. .IP Q for Queued, the job resides in a execution or routing queue pending execution or routing. It is not in .B held or .B waiting state. .IP R for Running, the job resides in a execution queue and has been placed into execution. .IP S for Suspend (Job running on Unicos only), the job was executing and has been suspended. The job retains its assigned resources but does not use cpu cycle or walltime. .IP T for Transiting, the job is in process of being routed or moved to a new destination. .IP W for Waiting, the job is not held but the .At Execution_Time attribute contains a time which has not yet been reached. .RE .if !\n(Pb .ig Ig [internal type: character] .Ig .Al mtime\ The time that the job was last modified, changed state, or changed locations. .if !\n(Pb .ig Ig Internally, maintained as number of seconds since epoch. [internal type: integer] .Ig .Al qtime\ The time that the job entered the current queue. .if !\n(Pb .ig Ig Internally, maintained as number of seconds since epoch. [internal type: integer] .Ig .Al queue\ The name of the queue in which the job currently resides. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al queue_rank An ordered, non-sequential number indicating the job's position with in the queue. This is provided as an aid to the scheduler. [This attribute is available to the batch manager only.] .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al queue_type An identification of the the type of queue in which the job is currently residing. This is provided as an aid to the scheduler. [This attribute is available to the batch manager only.] Format: The letter \*QE\*U or the letter \*Qr\*U. .if !\n(Pb .ig Ig [internal type: character] .Ig .Al "resources_used \(sc" The amount of resources used by the job. This is provided as part of job status information if the job is running. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al server\ The name of the server which is currently managing the job. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al session_id If the job is running, this is set to the session id of the first executing task. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al "substate" A numerical indicator of the substate of the job. The substate is used by the PBS job server internally. The attribute is visible to privileged clients, such as the scheduler. Format: integer. .if !\n(Pb .ig Ig [internal type: long integer] .br The values are defined in the header file pbs_job.h. See the ERS section on file staging for why it is available to the scheduler. .Ig .if \n(Pb .ig Ig .\" man page only .SH SEE ALSO PBS ERS, qsub(1B), qalter(1B), pbs_resources(7B) .Ig torque-2.4.16/doc/man7/Makefile.am0000664000113300011330000000010711272401250013467 00000000000000include $(top_srcdir)/buildutils/config.mk # all work is done in doc/ torque-2.4.16/doc/man7/pbs_server_attributes.7.in0000664000113300011330000005773111413217001016563 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_server_attributes 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_server_attributes \- pbs server attributes .SH DESCRIPTION .Iq .if !\n(Pb .ig Ig .\" for ers .NH 3 .Tc Server Public Attributes .Ig .LP Server attributes can be read by any client; privilege is not required. Most server attributes are alterable by a privileged client, run by a user with administrator or operator privilege. Certain attributes require the user to have full administrator privilege. The following is a list of the server attributes. .RS .25i .Al acl_group_sloppy This is a default value for the queue attribute of the same name. Format: boolean, "TRUE", "True", "true", "Y", "y", "1", "FALSE", "False", "false", "N", "n", "0"; default value: false = disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_host_enable Attribute which when true directs the server to use the .I acl_hosts access control lists. Requires full manager privilege to set or alter. Format: boolean, "TRUE", "True", "true", "Y", "y", "1", "FALSE", "False", "false", "N", "n", "0"; default value: false = disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_hosts List of hosts which may request services from this server. This list contains the network name of the hosts. Local requests, i.e. from the server's host itself, are aways accepted even if the host is not included in the list. See section 10.1, Authorization, in the PBS External Reference Specification. Requires full manager privilege to set or alter. Format: "[+|-]hostname.domain[,...]"; default value: all hosts. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al acl_logic_or This is a default value for the queue attribute of the same name. Format: boolean, "TRUE", "True", "true", "Y", "y", "1", "FALSE", "False", "false", "N", "n", "0"; default value: false = disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_user_enable Attribute which when true directs the server to use the server level .I acl_users access list. Requires full manager privilege to set or alter. Format: boolean (see acl_group_enable); default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al acl_users List of users allowed or denied the ability to make any requests of this server. See section 10.1, Authorization, in the PBS External Reference Specification. If acl_user_enable is set to true, only users listed in acl_users may submit to or execute jobs in the queue. Requires full manager privilege to set or alter. Format: "[+|-]user[@host][,...]"; default value: all users allowed. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al acl_roots List of super users who may submit to and execute jobs at this server. If the job execution id would be zero (0), then the job owner, root@host, must be listed in this access control list or the job is rejected. Format: "[+|-]user[@host][,...]"; default value: no root jobs allowed. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al allow_node_submit Allow job submissions from compute nodes regardless of ruserok(). Requires full manager privilege to set or alter. Format: boolean; default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al auto_node_np Automatically configure a node's np value based on the ncpus value from the status update. Requires full manager privilege to set or alter. Format: boolean; default value: disabled. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al comment A text string which may be set by the scheduler or other privileged client to provide information to the batch system users. Format: any string; default value: none. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al default_node A node specification to use if there is no other supplied specification. This attribute is only used by servers where a .I nodes file exist in the server_priv directory providing a list of nodes to the server. If the nodes file does not exist, this attribute is not set by default and is ignored if set. The default value allows for jobs to share a single node. Format: a node specification string; default value: 1#shared. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al default_queue The queue which is the target queue when a request does not specify a queue name. Format: a queue name; default value: none, must be set to an existing queue. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al down_on_error Set a node's state to "down" if MOM reports a message beginning with the string "ERROR". This might interfere with moab's node error handling. See the HEALTH CHECK section in pbs_mom(8B). This is an EXPERIMENTAL feature and may be removed in the future. Format: boolean; default value: false. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al extra_resc Add additional string-type job resources. They have no effect within TORQUE and are only advisible to the scheduler. They can not be used for resources_default/min/max. Format: list; default value: none. .if !\n(Pb .ig Ig [internal type: list] .Ig .Al job_nanny Enables the "job deletion nanny" feature. All job cancels will create a repeating task that will resend KILL signals if the initial job cancel failed. Further job cancels will be rejected with the message "job cancel in progress." This is useful for temporary failures with a job's execution node during a job delete request. It is possible that the job nanny might interfere with job restarts, migrations, and checkpointing. Format: boolean; default value: false. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al job_start_timeout Specifies the pbs_server to pbs_mom TCP socket timeout in seconds that is used when the pbs_server sends a job start to the pbs_mom. It is useful when the mom has extra overhead involved in starting jobs. If not specified then the tcp_timeout value is used. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al job_stat_rate Moderates how often job stat requests will be issued from pbs_server to the MOM daemons. If poll_jobs is unset or false, then all jobs that haven't been updated in job_stat_rate seconds will trigger a stat request. If poll_jobs is true, then all jobs will be updated every job_stat_rate. (see poll_jobs) On active clusters, 60 or 120 might be reasonable. Default value: 45 seconds (PBS_RESTAT_JOB in server_limits.h) Minimum value: 4 seconds (PBS_JOBSTAT_MIN in server_limits.h) .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al keep_completed Number of seconds to retain completed jobs in the C state. This is overridden by the execution queue attribute of the same name. Format: integer; default value: 0. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al kill_delay The amount of the time delay between the sending of SIGTERM and SIGKILL when a qdel command is issued against a running job. This is overridden by the execution queue attribute of the same name. Format: integer seconds; default value: 2 seconds. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al log_events A bit string which specifies the type of events which are logged, see the section on Event Logging in chapter 3 of the ERS. Format: integer; default value: 511, all events. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al log_file_max_size If this is set to a value > 0 then pbs_server will roll the current log file to logfile.1 when its size is greater than or equal to the value of log_file_max_size. This value is interpreted as kilobytes. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al log_file_roll_depth If this is set to a value >=1 and log_file_max_size is set then pbs_server will continue rolling the log files to logfile.log_file_roll_depth. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al log_level Controls the verbosity of server logs. This value ranges from 0 to 7 with 7 representing maximum verbosity. Format: integer; default value: 0, minimum verbosity. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al mail_body_fmt Override the default format for the body of outgoing mail messages. A number of printf-like format specifiers and escape sequences can be used: .TP \en new line .TP \et horizontal tab .TP \e\e backslash .TP \e' single quote .TP \e" double quote .TP %d details concerning the message .TP %h PBS host name .TP %i PBS job identifier .TP %j PBS job name .TP %m long reason for message .TP %r short reason for message .TP %% a single % .PP Format: a printf-like format string; Default value: "PBS Job Id: %i\enJob Name: %j\enExec host: %h\en%m\en%d\en". .if !\n(Pb .ig Ig [internal type: string] .Ig .Al mail_domain Override the default domain for outgoing mail messages. If set, emails will be addressed to "euser@mail_domain". If unset, the job's Job_Owner attribute will be used. Format: a domain name; Default value: none. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al mail_subject_fmt Override the default format for the subject of outgoing mail messages. A number of printf-like format specifiers and escape sequences can be used: .TP \en new line .TP \et horizontal tab .TP \e\e backslash .TP \e' single quote .TP \e" double quote .TP %d details concerning the message .TP %h PBS host name .TP %i PBS job identifier .TP %j PBS job name .TP %m long reason for message .TP %r short reason for message .TP %% a single % .PP Format: a printf-like format string; Default value: "PBS JOB %i". .if !\n(Pb .ig Ig [internal type: string] .Ig .Al mail_uid The uid from which server generated mail is sent to users. Format: integer uid; default value: 0 for root. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al managers List of users granted batch administrator privileges. Format: .Ty "user@host.sub.domain[,user@host.sub.domain...]" . The host, sub-domain, or domain name may be \*Qwild carded\*U by the use of an \*Q*\*U character, see the description of user access control lists in chapter 10.1.1 of the ERS. Requires full manager privilege to set or alter. Default value: root on the local host. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al max_running The maximum number of jobs allowed to be selected for execution at any given time. Advisory to the Scheduler, not enforced by the server. Format: integer. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al max_user_run The maximum number of jobs owned by a single user that are allowed to be running from this queue at one time. This attribute is advisory to the Scheduler, it is not enforced by the server. Format: integer; default value: none. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al max_group_run The maximum number of jobs owned by any users in a single group that are allowed to be running from this queue at one time. This attribute is advisory to the Scheduler, it is not enforced by the server. Format: integer; default value: none. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al mom_job_sync Enables the "job sync on MOM" feature. When MOMs send a status update, and it includes a list of jobs, server will issue job deletes for any jobs that don't actually exist. Format: boolean; default value: true. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al next_job_number This hidden attribute is used to allow a manager to set the value of the next job ID via qmgr. This attribute should rarely be modified. Some sites may find it useful if they need to recreate their pbs_server database (perhaps due to a format change between major TORQUE versions) and they keep a database of job information indexed by the job ID. The manager should be careful to avoid setting the value to something that would allow the next job number to conflict with a job already queued, however Torque will handle this in a sane manner: the job submission will be rejected and the next job number will be incremented. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al net_counter Lists the 3 numbers representing the number of connections in the last 5 seconds, 30 seconds, and 60 seconds. This is a read-only attribute. Format: string; default value: none. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al node_check_rate In OpenPBS, this was the rate at which pbs_server would poll each node. In TORQUE, nodes periodically send updates without solicitation from pbs_server; this attribute is now used as the maximum number of seconds allowed without an update before pbs_server will consider the node down. Format: integer; default value: 150 .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al node_pack Controls how multiple processor nodes are allocated to jobs. If this attribute is set to true, jobs will be assigned to the multiple processor nodes with the fewest free processors. This packs jobs into the fewest possible nodes leaving multiple processor nodes free for jobs which need many processors on a node. If set to false, jobs will be scattered across nodes reducing conflicts over memory between jobs. If unset, the jobs are packed on nodes in the order that the nodes are declared to the server (in the nodes file). Default value: unset \- assigned to nodes as nodes in order that were declared. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al operators List of users granted batch operator privileges. Format of the list is identical with .At managers above. Requires full manager privilege to set or alter. Default value: root on the local host. .if !\n(Pb .ig Ig [internal type: access control list] .Ig .Al poll_jobs Controls how pbs_server will send job status requests to MOMs. When unset or false, statjob requests from clients (ie: qstat(1B) or the scheduler) may trigger job status requests to MOMs and and must wait until the MOMs have replied; this is suitable for small to medium sized clusters. When set to true, pbs_server will send periodic job status requests; this is suitable for busy clusters with lots of jobs, lots of clients, qstat(1B) is too slow, or your scheduler times out. (see job_stat_rate) Default value: TRUE .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al query_other_jobs The setting of this attribute controls if general users, other than the job owner, are allowed to query the status of or select the job. Format: boolean (see acl_host_enable); Requires full manager privilege to set or alter. default value: false \- users may not query or select jobs owned by other users. .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al "resources_available" The list of resource and amounts available to jobs run by this server. The sum of the resource of each type used by all jobs running by this server cannot exceed the total amount listed here. Advisory to the Scheduler, not enforced by the server. Format: "resources_available.resource_name=value[,...]". .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al resources_cost The cost factors of various types of resources. These values are used in determining the order of releasing members of synchronous job sets, see the section on \*QSynchronize Job Starts.\*U For the most part, these value are purely arbitrary and have meaning only in the relative values between systems. The \*Qcost\*U of the resources requested by a job is the sum of the products of the various .I resources_cost s and the amount of each resource requested by the job. It is not necessary to assign a cost for each possible resource, only those which the site wishes to be considered in synchronous job scheduling. Format: "resources_cost.resource_name=value[,...]"; default value: none, cost of resource is not computed. .if !\n(Pb .ig Ig [internal type: list] .Ig .Al resources_default The list of default resource values that are set as limits for a job executing on this server when the job does not specify a limit, and there is no queue default. Format: "resources_default.resource_name=value[,...]"; default value: no limit. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al resources_max The maximum amount of each resource which can be requested by a single job executing on this server if there is not a resources_max valued defined for the queue in which the job resides. Format: "resources_max.resource_name=value[,...]"; default value: infinite usage. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al sched_version A string specifying the scheduler version. Schedulers should check this string when starting and not become active if the wrong string is found. This is ignored by pbs_server. .if !\n(Pb .ig Ig [internal type: string] .Ig .Al scheduler_iteration The time, in seconds, between iterations of attempts by the batch server to schedule jobs. On each iteration, the server examines the available resources and runnable jobs to see if a job can be initiated. This examination also occurs whenever a running batch job terminates or a new job is placed in the queued state in an execution queue. Format: integer seconds; default value: 10 minutes, set by .Sc PBS_SCHEDULE_CYCLE in server_limits.h. .if !\n(Pb .ig Ig [internal type: integer, displays as name defined below] .Ig .Al scheduling Controls if the server will request job scheduling by the PBS job scheduler. If true, the scheduler will be called as required; if false, the scheduler will not be called and no job will be placed into execution unless the server is directed to do so by an operator or administrator. Setting or resetting this attribute to true results in an immediate call to the scheduler. For more information, see the section .B "Scheduler \- Server Interaction" in the PBS Administrator Guide. Format: boolean (see acl_host_enable); default value: value of \-a option when server is invoked, if \-a is not specified, the value is recovered from the prior server run. If it has never been set, the value is "false". .if !\n(Pb .ig Ig [internal type: boolean] .Ig .Al server_name The name of the server which is the same as the host name. If the hostname resolves to an external IP address, then set this to a name that resolves to the internal IP. .if !\n(Pb .ig Ig If the server is listening to a non-standard port, the port number is appended, with a colon, to the host name. For example: .Ty host.domain:9999 . [internal type: string] .Ig .Al submit_hosts A list of hostnames allowed to submit jobs to this batch server regardless of ruserok(). .if !\n(Pb .ig Ig [internal type: list] .Ig .Al system_cost An arbitrary value factored into the resource cost of any job managed by this server for the purpose of selecting which member of synchronous set is released first, see resources_cost and section 3.2.2, \*QSynchronize Job Starts.\*U [default value: none, cost of resource is not computed] .if !\n(Pb .ig Ig [internal type: list] .Ig .Al tcp_timeout Specifies the pbs_server to pbs_mom TCP socket timeout in seconds. Format: integer; default value: 6. .if !\n(Pb .ig Ig [internal type: integer] .Ig .RE .LP .if !\n(Pb .ig Ig .\" ers only .NH 3 .Tc Read Only Server Attributes .Ig .LP The following attributes are read-only, they are maintained by the server and cannot be changed by a client. .RS .25i .Al resources_assigned The total amount of certain types of resources allocated to running jobs. .if !\n(Pb .ig Ig [internal type: resource] .Ig .Al server_state The current state of the server: .RS .IP Active The server is running and will invoke the job scheduler as required to schedule jobs for execution. .IP Idle The server is running but will not invoke the job scheduler. .IP Scheduling The server is running and there is an outstanding request to the job scheduler. .IP Terminating The server is terminating. No additional jobs will be scheduled. .IP "Terminating, Delayed" The server is terminating in delayed mode. The server will not run any new jobs and will shutdown when the last currently executing job completes. .RE .IP .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al state_count The total number of jobs managed by the server currently in each state. .if !\n(Pb .ig Ig [internal type: special, array of integers] .Ig .Al total_jobs The total number of jobs currently managed by the server. .if !\n(Pb .ig Ig [internal type: integer] .Ig .Al PBS_version The release version number of the server. .if !\n(Pb .ig Ig [internal type: string] .Ig .RE .if \n(Pb .ig Ig .\" man page only .SH SEE ALSO the PBS ERS, qmgr(1B), pbs_resources(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_linux.7.in0000664000113300011330000001526011272401250016233 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_linux 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_linux \- pbs resources on Linux .SH DESCRIPTION This page summarizes the resources supported by PBS for PC workstations running Linux. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 Linux Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_solaris5.7.in0000664000113300011330000001527711272401250016645 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_solaris 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_solaris \- pbs resources on SUN Solaris .SH DESCRIPTION This page summarizes the resources supported by PBS for Sun workstations running Solaris 2.x. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 Sun Solaris Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pmem Maximum amount of physical memory (workingset) used by any single process of the job. Units: size. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,vmem=15mb script .br qalter \-lcput=30:00 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,vmem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/man7/pbs_resources_fujitsu.7.in0000664000113300011330000001513111272401250016562 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .\" for man page .TH pbs_resources_fujitsu 7B "" Local PBS .so ../ers/ers.macros .SH NAME pbs_resources_fujitsu \- pbs resources on Fujitsu UXP/V .SH DESCRIPTION This page summarizes the resources supported by PBS for Fujitsu computers running UXP/V. These resources are specified by including them in the .I \-l option argument on the qsub or qalter command or in the PBS job script. .LP .SH RESOURCES .Iq .if !\n(Pb .ig Ig .\" for ers only .NH 4 Fujitsu UXP/V Resources .Ig .LP .IP cput 10 Maximum amount of CPU time used by all processes in the job. Units: time. .IP file The largest size of any single file that may be created by the job. Units: size. .IP nice The nice value under which the job is to be run. Units: unitary. .IP pcput Maximum amount of CPU time used by any single process in the job. Units: time. .IP pvmem Maximum amount of virtual memory used by any single process in the job. Units: size. .IP vmem Maximum amount of virtual memory used by all concurrent processes in the job. Units: size. .IP walltime Maximum amount of real time during which the job can be in the running state. Units: time. .so pbs_resources_all.so .LP qsub \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb script .br qalter \-lcput=30:00,pmem=8mb 123.jobid .LP or in a qsub script as a directive: .LP #PBS \-l cput=1:00:00,walltime=2:00:00,file=50gb,mem=15mb .LP .if !\n(Pb .ig Ig .\" for ers only .RE .LP .Ig .if \n(Pb .ig Ig .\" man page only .SH RESOURCE UNITS The resource values take the following units: .IP time 8 specifies a maximum time period the resource can be used. Time is expressed in seconds as an integer, or in the form: .br .Ty [[hours:]minutes:]seconds[.milliseconds] .IP size 8 specifies the maximum amount in terms of bytes or words. It is expressed in the form .Ty integer[suffix] The suffix is a multiplier defined in the following table, 'b' means bytes (the default) and 'w' means words. The size of a word is the word size on the execution host. .RS .IP "\ b\ or\ \ w" 12 bytes or words. .IP "kb\ or\ kw" Kilo (1024) bytes or words. .IP "mb\ or\ mw" 12 Mega (1,048,576) bytes or words. .IP "gb\ or\ gw" 12 Giga (1,073,741,824) bytes or words. .RE .IP unitary The maximum amount of a resource which is expressed as a simple integer. .SH SEE ALSO the PBS ERS, qsub(1B), qalter(1B), pbs_submit(3B), pbs_alterjob(3B), pbs_statjob(3b) pbs_resources_aix4(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B) .Ig torque-2.4.16/doc/ers/0000777000113300011330000000000011614035206011452 500000000000000torque-2.4.16/doc/ers/ers_setup.ms0000664000113300011330000001244611272401251013746 00000000000000.\" .\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .\" The following macros changes are to allow "man" pages .\" to be included in this document formatted with -ms .\" .\" The TH macro, used for headers on a man page, must be ignored (skipped .\" over) when process the pages with -ms. .\" The Sh is defined on each included "man" page to approximate .\" what is output with the -man macro .SH as opposed to the -ms macro .\" The setting of the register Pb to 1 triggers the -ms form of the Sh .\" macro used in the man pages included in the ERS. Otherwise, the Sh .\" macro invokes the -man macro .SH. .\" .nr Pb 1 \" turn on -ms version of macros for "man" pages. .\" .de IR .I \\$1 \\$2 \\$3 \\$4 .. .de BR .B \\$1 \\$2 \\$3 \\$4 .. .\" include special ERS style macro definitions .so ../ers/ers.macros .\" following macro cuts the date provided by RCS so only yy/mm/dd shows .de Cd \&\\$2 .. .de Rv .ds rV Revision: \\$2 .. .\" macro to use in generating TOC section, parameter is printed and output .\" if number register I = 2, output in XA format for PS PE macros .de Tc \&\\$1 \\$2 \\$3 \\$4 \\$5 .if \\nI=2 \{\ . tm .XA \\n(H1-\\n(PN . tm \\*(SN \\$1 \\$2 \\$3 \\$4 \\$5 .\} .. torque-2.4.16/doc/ers/pbs_resources_all.so0000664000113300011330000001574011272401251015445 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .IP arch Specifies the administrator defined system architecture requried. This defaults to whatever the PBS_MACH string is set to in "local.mk". Units: string. .IP host Name of host on which job should be run. This resource is provided for use by the site's scheduling policy. The allowable values and effect on job placement is site dependent. Units: string. .IP nodes Number and/or type of nodes to be reserved for exclusive use by the job. The value is one or more .I node_specs joined with the '+' character, "node_spec[+node_spec...]. Each node_spec is an .I number of nodes required of the type declared in the node_spec and a .I name or one or more .I properity or properities desired for the nodes. The number, the name, and each properity in the node_spec are separated by a colon ':'. If no number is specified, one (1) is assumed. Units: string. .IP The name of a node is its hostname. The properities of nodes are: .RS .IP . 2 ppn=# specifying the number of processors per node requested. Defaults to 1. .IP . 2 arbitrary string assigned by the system administrator, please check with your administrator as to the node names and properities available to you. .RE .IP Examples: .RS .IP . 2 To ask for 12 nodes of any type: \-l\ nodes=12 .IP . 2 To ask for 2 "server" nodes and 14 other nodes (a total of 16): \-l\ nodes=2:server+14 .br The above consist of two node_specs "2:server" and "14". .IP . 2 To ask for (a) 1 node that is a "server" and has a "hippi" interface, (b) 10 nodes that are not servers, and (c) 3 nodes that have a large amount of memory an have hippi: .br \-l\ nodes=server:hippi+10:noserver+3:bigmem:hippi .IP . 2 To ask for three nodes by name: .br \-l\ nodes=b2005+b1803+b1813 .IP . 2 To ask for 2 processors on each of four nodes: .br \-l\ nodes=4:ppn=2 .IP . 2 To ask for 4 processors on one node: .br \-l\ nodes=1:ppn=4 .IP . 2 To ask for 2 processors on each of two blue nodes and three processors on one red node: .br \-l\ nodes=2:blue:ppn=2+red:ppn=3 .RE .IP host Allows a user to specify the desired execution location. This resource is provided for use by the site's scheduling policy. The allowable values and effect on job placement is site dependent. Units: string. .IP other Allows a user to specify site specific information. This resource is provided for use by the site's scheduling policy. The allowable values and effect on job placement is site dependent. Units: string. .IP software Allows a user to specify software required by the job. This is useful if certain software packages are only available on certain systems in the site. This resource is provided for use by the site's scheduling policy. The allowable values and effect on job placement is site dependent. Units: string. .LP .Sh EXAMPLES qsub \-l nodes=15,walltime=2:00:00 script .LP or in a qsub script as a directive: .LP #PBS \-l nodes=15,walltime=2:00:00 torque-2.4.16/doc/ers/ers.macros0000664000113300011330000001366311272401251013375 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .\" The following macros defination, Sh and Sx, are used to allow .\" PBS man pages to be formatted with either -man macros or .\" be included in the PBS ERS which is formatted with -ms. .\" .\" The presence of the register Pb defined as non zero will trigger .\" the use of the Sx alternate form. Otherwise the standard -man .\" SH is used. .\" .de Sh .ie \n(Pb .Sx \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 .el .SH \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 .. .\" .de Sx .RE .sp .B \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 .br .RS .R .. .\" .\" end of special PBS man/ERS macros .\" -- .\" The following macros are style for object names and values. .de Ar \" command/function arguments and operands (italic) .ft 2 .if \\n(.$>0 \&\\$1\f1\\$2 .. .de Av \" data item values (Helv) .if \n(Pb .ft 6 .if !\n(Pb .ft 3 .ps -1 .if \\n(.$>0 \&\\$1\s+1\f1\\$2 .. .de At \" attribute and data item names (Helv Bold) .if \n(Pb .ft 6 .if !\n(Pb .ft 2 .ps -1 .if \\n(.$>0 \&\\$1\s+1\f1\\$2 .. .de Ty \" Type-ins and examples (typewritter) .if \n(Pb .ft 5 .if !\n(Pb .ft 3 .if \\n(.$>0 \&\\$1\f1\\$2 .. .de Er \" Error values ( [Helv] ) .if \n(Pb .ft 6 .if !\n(Pb .ft 3 \&\s-1[\^\\$1\^]\s+1\f1\\$2 .. .de Sc \" Symbolic constants ( {Helv} ) .if \n(Pb .ft 6 .if !\n(Pb .ft 3 \&\s-1{\^\\$1\^}\s+1\f1\\$2 .. .de Al \" Attribute list item, like .IP but set font and size .if !\n(Pb .ig Ig .ft 6 .IP "\&\s-1\\$1\s+1\f1" .Ig .if \n(Pb .ig Ig .ft 2 .IP "\&\\$1\s+1\f1" .Ig .. .\" the following pair of macros are used to bracket sections of code .de Cs .ft 5 .nf .. .de Ce .sp .fi .ft 1 .. .if !\n(Pb .ig Ig .\" define sting Ji as section heading for Job Ids .ds Ji 2.7.6 .\" define sting Di as section heading for Destination Ids .ds Di 2.7.3 .\" define sting Si as section heading for Default Server .ds Si 2.7.4 .Ig .\" End of macros torque-2.4.16/doc/man3/0000777000113300011330000000000011614035206011517 500000000000000torque-2.4.16/doc/man3/pbs_selectjob.3.in0000664000113300011330000002505511272401252014751 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_selectjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_selectjob \- select pbs batch jobs .SH SYNOPSIS #include .br #include .sp .ft 3 .nf char **pbs_selectjob(\^int\ connect, struct\ attropl\ *attrib, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to select jobs which meet certain criteria. \fBpbs_selectjob\fP() returns a array of job identifiers which met the criteria. .LP Initially all batch jobs are selected for which the user is authorized to query status. This set may be reduced or filtered by specifying certain attributes of the jobs. .LP A .I "Select Jobs" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The argument, .Ar attrib , is a pointer to an .I attropl structure which is defined in pbs_ifl.h as: .sp .Ty .nf struct attropl { struct attropl *next; char *name; char *resource; char *value; enum batch_op op; }; .fi .sp .ft 1 The .Ar attrib .ft 1 list is terminated by the first entry where .Ty next is a null pointer. .LP The .Ty name member points to a string which is the name of the attribute. Not all of the job attributes may be used as a selection criteria. The .Ty resource member points to a string which is the name of a resource. This member is only used when .Ty name is set to ATTR_l. Otherwise, resource should be a pointer to a null string. The .Ty value member points to a string which is the value of the attribute or resource. The attribute names are defined in pbs_ifl.h: .br .RS .IP #define\ ATTR_a\ "Execution_Time" Select based upon the job's execution time. .IP #define\ ATTR_A\ "Account_Name" Select (E) based upon the account string. .IP #define\ ATTR_c\ "Checkpoint" Select based upon the checkpoint interval. .IP #define\ ATTR_e\ "Error_Path" Select (E) based upon the name of the standard error file. .IP #define\ ATTR_g\ "Group_List" Select (E) based upon the list of group names under which the job may execute. .IP #define\ ATTR_h\ "Hold_Types" Select (E) based upon the hold types. .IP #define\ ATTR_j\ "Join_Paths" Select (E) based upon the value of the join list. .IP #define\ ATTR_k\ "Keep_Files" Select (E) based upon the value of the keep files list. .IP #define\ ATTR_l\ "Resource_List" Select based upon the value of the resource named in .Ty resource . .IP #define\ ATTR_m\ "Mail_Points" Select (E) based upon the setting of the mail points attribute. .IP #define\ ATTR_M\ "Mail_Users" Select (E) based upon the list of user names to which mail will be sent. .IP #define\ ATTR_N\ "Job_Name" Select (E) based upon the job name. .IP #define\ ATTR_o\ "Output_Path" Select (E) based upon the name of the standard output file. .IP #define\ ATTR_p\ "Rriority" Select based upon the priority of the job. .IP #define\ ATTR_q\ "destination" Select based upon the specified destination. Jobs selected are restricted to those residing in the named queue. If destination is the null string, the default queue at the server is assumed. .IP #define\ ATTR_r\ "Rerunable" Select (E) based upon the rerunable flag. .IP #define\ ATTR_session\ "session_id" Select based upon the session id assigned to running jobs. .IP #define\ ATTR_S\ "Shell_Path_List" Select (E) based upon the execution shell list. .IP #define\ ATTR_u\ "User_List" Select (E) based upon the owner of the jobs. .IP #define\ ATTR_v\ "Variable_List" Select (E) based upon the list of environment variables. .IP #define\ ATTR_ctime\ "ctime" Select based upon the creation time of the job. .IP #define\ ATTR_depend\ "depend" Select based upon the list of job dependencies. .IP #define\ ATTR_mtime\ "mtime" Select based upon the last modification time of the job. .IP #define\ ATTR_qtime\ "qtime" Select based upon the time of the job was placed into the current queue. .IP #define\ ATTR_qtype\ "queue_type" Select (E) base on the type of queue in which the job resides. .IP #define\ ATTR_stagein\ "stagein" Select based upon the list of files to be staged-in. .IP #define\ ATTR_stageout\ "stageout" Select based upon the list of files to be staged-out. .IP #define\ ATTR_state\ "job_state" Select based upon the state of the jobs. State is not a job attribute, but is included here to allow selection. .RE .LP The .Ty op member defines the operator in the logical expression: .br .Ty \ \ \ \ value\ operator\ current_value .br The logical expression must evaluate as true for the job to be selected. The permissible values of .Ty op are defined in pbs_ifl.h as: .Ty "enum batch_op { ..., EQ, NE, GE, GT, LE, LT, ... };" . The attributes marked with (E) in the description above may only be selected with the equal, EQ, or not equal, NE, operators. .if !\n(Pb .ig Ig .LP The full range of batch_op values is .Ty "{ SET, UNSET, INCR, DECR, EQ, NE, GE, GT, LE, LT }." Only the relational operators are allowed in a select call, and others will be rejected by the server. .Ig .LP If .Ar attrib itself is a null pointer, then no selection is done on the basis of attributes. .LP The return value is a pointer to a null terminated array of character pointers. Each character pointer in the array points to a character string which is a .IR job_identifier in the form: .Ty sequence_number.server@server .LP The array is allocated by pbs_selectjob via \fBmalloc\fP(). When the array is no longer needed, the user is responsible for freeing it by a call to \fBfree\fP(). .if !\n(Pb .ig Ig The space for the array and the job identifier strings is malloc-ed by \fBpbs_selectjob\fP() as one allocation. The array of pointers starts at the address returned by malloc(), so free() will work. .Ig .LP The parameter, .Ar extend , is reserved for implementation defined extensions. TORQUE 2.0.0p1 added the #define'd constant string EXECQUEONLY to only retrieve jobs in execution queues. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qselect(1B), pbs_alterjob(3B), and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by pbs_selectjob() function has been completed successfully by a batch server, the routine will return a pointer to the array of job identifiers. If no jobs met the criteria, the first pointer in the array will be the null pointer. .LP If an error occurred, a null pointer is returned and the error is available in the global integer pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_default.3.in0000664000113300011330000001200311272401252014410 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_default 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_default \- return the pbs default server name .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_default() .ft 1 .fi .SH DESCRIPTION A character string is returned containing the name of the default PBS server. The default server is defined .if !\n(Pb .ig Ig in section \*(Si. .Ig .if \n(Pb .ig Ig by (a) the setting of the environment variable .B PBS_DEFAULT which contains a destination, or (b) the destination in the batch administrator established file .Av {PBS_DIR}/default_destn . .Ig .SH SEE ALSO qsub(1B), pbs_connect(3B), pbs_disconnect(3B), and the PBS External Reference Specification .SH DIAGNOSTICS If the default server cannot be determined, a NULL value is returned. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/rpp.30000664000113300011330000002423411272401252012325 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .\" @(#)string.3 1.32 90/02/03 TMP; .TH RPP 3 "28 February 1996" .SH NAME rpp_open, rpp_bind, rpp_poll, rpp_io, rpp_read, rpp_write, rpp_close, rpp_getaddr, rpp_flush, rpp_terminate, rpp_shutdown, rpp_rcommit, rpp_wcommit, rpp_eom, rpp_getc, rpp_putc \- reliable packet protocol .SH SYNOPSIS .nf .B #include #include #include .ft .fi .LP .nf .B int rpp_open(addr) struct sockadd_in \(**addr; .ft .fi .LP .nf .B int rpp_bind(port) int port; .ft .fi .LP .nf .B int rpp_poll() .ft .fi .LP .nf .B int rpp_io() .ft .fi .LP .nf .B int rpp_read(stream, buf, len) u_int stream; char \(**buf; int len; .ft .fi .LP .nf .B int rpp_write(stream, buf, len) u_int stream; char \(**buf; int len; .ft .fi .LP .nf .B int rpp_close(stream) u_int stream; .ft .fi .LP .nf .B struct sockadd_in \(**rpp_getaddr(stream) u_int stream; .ft .fi .LP .nf .B int rpp_flush(stream) u_int stream; .ft .fi .LP .nf .B int rpp_terminate() .ft .fi .LP .nf .B int rpp_shutdown() .ft .fi .LP .nf .B int rpp_rcommit(stream, flag) u_int stream; int flag; .ft .fi .LP .nf .B int rpp_wcommit(stream, flag) u_int stream; int flag; .ft .fi .LP .nf .B int rpp_eom(stream) u_int stream; .ft .fi .LP .nf .B int rpp_getc(stream) u_int stream; .ft .fi .LP .nf .B int rpp_putc(stream, c) u_int stream; int c; .ft .fi .SH DESCRIPTION .LP These functions provide reliable, flow-controlled, two-way transmission of data. Each data path will be called a "stream" in this document. The advantage of RPP over TCP is that many streams can be multiplexed over one socket. This allows simultaneous connections over many streams without regard to the system imposed file descriptor limit. .LP Data is sent and received in "messages". A message may be of any length and is either received completely or not at all. Long messages will cause the library to use large amounts of memory in the heap by calling .BR malloc (3V). .LP .B rpp_open(\|) initializes a new stream connection to .IR addr and returns the stream identifier. This is an integer with a value greater than or equal to zero. A negative number indicates an error. In this case, errno will be set. .LP .B rpp_bind(\|) is an initialization call which is used to bind the UDP socket used by RPP to a particular .IR port . The file descriptor of the UDP socket used by the library is returned. .LP .B rpp_poll(\|) returns the stream identifier of a stream with data to read. If no stream is ready to read, a \-2 is returned. A \-1 is returned if an error occurs. .LP .B rpp_io(\|) processes any packets which are waiting to be sent or resceived over the UDP socket. This routine should be called if a section of code could be executing for more than a few (~10) seconds without calling any other rpp function. A \-1 is returned if an error occurs, 0 otherwise. .LP .B rpp_read(\!) transfers up to .IR len characters of a message from .IR stream into .IR buf . If all of a message has been read, the return value will be less than .IR len . The return value could be zero if all of a message had previously been read. A \-1 is returned on error. A \-2 is returned if the peer has closed its connection. If .B rpp_poll(\!) is used to determine the stream is ready for reading, the call to .IR rpp_read(\!) will return immediately. Otherwise, the call will block waiting for a message to arrive. .LP .B rpp_write(\|) adds information to the current message on a .IR stream . The data in .IR buf numbering .IR len characters is transfered to the stream. The number of characters added to the stream are returned or a \-1 on error. In this case, errno will be set. A \-2 is returned if the peer has closed its connection. .LP .B rpp_close(\!) disconnects the .IR stream from its peer and frees all resources associated with the stream. The return value is \-1 on error and 0 otherwise. .B rpp_getaddr(\!) returns the address which a .IR stream is connected to. If the stream is not open, a .SM NULL pointer is returned. .LP .B rpp_flush(\!) marks the end of a message and commits all the data which has been written to the specified .IR stream . A zero is returned if the message has been successfully committed. A \-1 is returned on error. .LP .B rpp_terminate(\!) is used to free all memory associated with all streams and close the UDP socket. This is done without attempting to send any final messages that may be waiting. If a process is using .B rpp and calls .B fork() , the child .B must call rpp_terminate() so it will not cause a conflict with the parent's communication. .LP .B rpp_shutdown(\!) is used to free all memory associated with all streams and close the UDP socket. An attepmt is made to send all outstanding messages before returning. .LP .B rpp_rcommit(\!) is used to "commit" or "de-commit" the information read from a message. As calls are made to .IR rpp_read(\!) , the number of characters transfered out of the message are counted. If .IR rpp_rcommit(\!) is called with .IR flag being non-zero (TRUE), the current position in the message is marked as the commit point. If .IR rpp_rcommit(\!) is called with .IR flag being zero (FALSE), a subsequent call to .IR rpp_read(\!) will return characters from the message following the last commit point. If an entire message has been read, .IR rpp_read(\!) will continue to return zero as the number of bytes transfered until .IR rpp_eom(\!) is called to commit the complete message. .LP .B rpp_wcommit(\!) is used to "commit" or "de-commit" the information written to a stream. As calls are made to .IR rpp_write(\!) , the number of characters transfered into the message are counted. If .IR rpp_wcommit(\!) is called with .IR flag being non-zero (TRUE), the current position in the message is marked as the commit point. If .IR rpp_wcommit(\!) is called with .IR flag being zero (FALSE), a subsequent call to .IR rpp_write(\!) will transfer characters into the stream following the last commit point. A call to .IR rpp_flush(\!) does an automatic write commit to the current position. .LP .B rpp_eom(\!) is called to terminate processing of the current message. .SH SEE ALSO .BR tcp (4P), .BR udp (4P) torque-2.4.16/doc/man3/pbs_checkpointjob.3.in0000664000113300011330000001306211435257364015632 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_checkpointjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_checkpointjob \- checkpoint a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 int pbs_checkpointjob(\^int\ connect, char\ *job_id, char\ *extend) .ft 1 .SH DESCRIPTION Issue a batch request to checkpoint a batch job. .LP For .I pbs_checkpointjob() a "Checkpoint Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). The server will reply when the job has completed the checkpoint operation. Checkpointing is only allowed for jobs that are marked as checkpointable. .LP These requests requires that the issuing user have operator or administrator privilege. .LP The argument, .Ar job_id , identifies which job is to be checkpointed, it is specified in the form: .Ty "sequence_number.server" .LP The argument, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by these functions. .Ig .SH "SEE ALSO" pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by the \fBpbs_checkpointjob\fP() functions has been completed successfully by a batch server, the routines will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_holdjob.3.in0000664000113300011330000001353311272401252014416 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_holdjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_holdjob \- place a hold on a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_holdjob(\^int\ connect, char\ *job_id, char\ *hold_type, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to place a hold upon a job. .LP A .I "Hold Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The argument, .Ar job_id , identifies which job is to be held, it is specified in the form: .Ty "sequence_number.server" .LP The parameter, .Ar hold_type , contains the type of hold to be applied. The possible values are defined in pbs_ifl.h as: .RS .IP #define\ USER_HOLD\ "u" .br Available to the owner of the job, the batch operator, and the batch administrator. .IP #define\ OTHER_HOLD\ "o" .br Available to the batch operator and the batch administrator. .IP #define\ SYSTEM_HOLD\ "s" .br Available only to the batch administrator. .RE .LP If .Ar hold_type is either a null pointer or points to a null string, USER_HOLD will be applied. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qhold(1B), pbs_connect(3B), pbs_alterjob(3B), and pbs_rlsjob(3B) .SH DIAGNOSTICS When the batch request generated by .B pbs_holdjob () function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_fbserver.3.in0000664000113300011330000001157311435257364014633 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_fbserver 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_fbserver \- get the pbs fall-back server name .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_fbserver() .ft 1 .fi .SH DESCRIPTION A character string is returned containing the name of the fall-back PBS server. The fall-back server is the second server listed when configured to run in high-availability mode. .Ig .SH SEE ALSO qsub(1B), pbs_connect(3B), pbs_default(3B), pbs_fbserver(3B), pbs_disconnect(3B), and the PBS External Reference Specification .SH DIAGNOSTICS If the fall-back server cannot be determined, a NULL value is returned. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_msgjob.3.in0000664000113300011330000001337511272401252014262 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_msgjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_msgjob \- record a message for a running pbs batch job .SH SYNOPSIS #include .br #include .sp .nf .ft 3 int pbs_msgjob(\^int\ connect, char\ *job_id, int\ file, char\ *message, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to write a message in an output file of a batch job. .LP A .I "Message Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The argument, .Ar job_id , identifies the job to which the message is to be sent; it is specified in the form: .Ty "sequence_number.server" .LP The parameter, .Ar file , indicates the file or files to which the message string is to be written. The following values are defined in pbs_ifl.h: .RS .IP #define\ MSG_ERR\ 2 directs the message to the standard error stream of the job. .IP #define\ MSG_OUT\ 1 directs the message to the standard output stream of the job. .RE .LP The parameter, .Ar message , is the message string to be written. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qmsg(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_msgjob\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_sigjob.3.in0000664000113300011330000001363311435257364014271 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_sigjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_sigjob \- send a signal to a pbs batch job .SH SYNOPSIS #include .br #include .sp .nf .ft 3 int pbs_sigjob(\^int\ connect, char\ *job_id, char\ *signal, char\ *extend\^) .sp int pbs_sigjobasync(\^int\ connect, char\ *job_id, char\ *signal, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to send a signal to a batch job. .LP A .I "Signal Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). If the batch job is in the .B running state, the batch server will send the job the signal number corresponding to the signal named in .Ar signal . When the asynchronous \fBpbs_sigjobasync\fP() call is used, the server will reply before passing the signal request to the pbs_mom. .LP The argument, .Ar job_id , identifies which job is to be signaled, it is specified in the form: .Ty "sequence_number.server" .LP If the name of the signal is not a recognized signal name on the execution host, no signal is sent and an error is returned. If the job is not in the .B running state, no signal is sent and an error is returned. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qsig(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by the \fBpbs_sigjob\fP() or \fBpbs_sigjobasync\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_disconnect.3.in0000664000113300011330000001153611272401252015127 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_disconnect 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_disconnect \- disconnect from a pbs batch server .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_disconnect(int connect) .ft 1 .fi .SH DESCRIPTION The virtual stream connection specified by .Ar connect , which was established with a server by a call to \fBpbs_connect\fP(), is closed. .SH SEE ALSO pbs_connect(3B) .SH DIAGNOSTICS When the connection to batch server has been successfully closed, the routine will return zero. Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_statnode.3.in0000664000113300011330000001602311272401252014613 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_statnode 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_statnode \- obtain status of pbs nodes .SH SYNOPSIS #include .br #include .sp .ft 3 struct batch_status *pbs_statnode(\^int\ connect, char\ *id, struct\ attrl\ *attrib, char\ *extend) .sp void pbs_statfree(\^struct batch_status *psj\^) .ft 1 .SH DESCRIPTION Issue a batch request to obtain the status of a PBS node or nodes. .LP A .I "Status Node" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The .Ar id is the name of a node or the null string. If .Ar id specifies a node name, the status of that node will be returned. If the .Ar id is a null string (or null pointer), the status of all nodes at the server will be returned. .LP In TORQUE 2.1.0, if the .Ar id starts with a ":" and followed by a node property, all nodes with that property are returned; creating a "node group" functionality. The string ":ALL" is specially handled and is the same as passing a null string. .LP The parameter, .Ar attrib , is a pointer to an .I attrl structure which is defined in pbs_ifl.h as: .sp .Ty .nf struct attrl { struct attrl *next; char *name; char *resource; char *value; }; .fi .sp .ft 1 The .Ar attrib .ft 1 list is terminated by the first entry where .Ty next is a null pointer. If .Ar attrib is given, then only the attributes in the list are returned by the server. Otherwise, all the attributes of a node are returned. When an .Ar attrib list is specified, the .Ty name member is a pointer to a attribute name. The supported attribute names relating to nodes are "state", "properties", "np", "ntype", "jobs", "status", and "note". The .Ty resource member is not used and must be a pointer to a null string. The .Ty value member should aways be a pointer to a null string. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .LP The return value is a pointer to a list of .I batch_status structures, which is defined in pbs_ifl.h as: .sp .Ty .nf struct batch_status { struct batch_status *next; char *name; struct attrl *attribs; char *text; } .fi .ft 1 .LP It is up the user to free the structure when no longer needed, by calling \fBpbs_statfree\fP(). .LP .SH "SEE ALSO" qstat(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_statnode\fP() function has been completed successfully by a batch server, the routine will return a pointer to the batch_status structure. Otherwise, a null pointer is returned and the error code is set in the global integer pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/tm.30000664000113300011330000003346411272401252012151 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .\" @(#)string.3 1.0 97/05/21 TMP; .TH TM 3 "21 May 1997" .SH NAME tm_init, tm_nodeinfo, tm_poll, tm_notify, tm_spawn, tm_kill, tm_obit, tm_taskinfo, tm_atnode, tm_rescinfo, tm_publish, tm_subscribe, tm_finalize \- task management API .SH SYNOPSIS .nf .B #include .ft .fi .LP .nf .B int tm_init(info, roots) .in 6 void \(**info; struct tm_roots \(**roots; .in .ft .fi .LP .nf .B int tm_nodeinfo(list, nnodes) .in 6 tm_node_id ***list; int \(**nnodes; .in .ft .fi .LP .nf .B int tm_poll(poll_event, result_event, wait, tm_errno) .in 6 tm_event_t poll_event; tm_event_t \(**result_event; int wait; int \(**tm_errno; .in .ft .fi .LP .nf .B int tm_notify(tm_signal) .in 6 int tm_signal; .in .ft .fi .LP .nf .B int tm_spawn(argc, argv, envp, where, tid, event) .in 6 int argc; char \(**\(**argv; char \(**\(**envp; tm_node_id where; tm_task_id \(**tid; tm_event_t \(**event; .in .ft .fi .LP .nf .B int tm_kill(tid, sig, event) .in 6 tm_task_id tid; int sig; tm_event_t \**event; .in .ft .fi .LP .nf .B int tm_obit(tid, obitval, event) .in 6 tm_task_id tid; int \(**obitval; tm_event_t \**event; .in .ft .fi .LP .nf .B int tm_taskinfo(node, tid_list, list_size, ntasks, event) .in 6 tm_node_id node; tm_task_id \(**tid_list; int list_size; int \(**ntasks; tm_event_t \**event; .in .ft .fi .LP .nf .B int tm_atnode(tid, node) .in 6 tm_task_id tid; tm_node_id \(**node; .in .ft .fi .LP .nf .B int tm_rescinfo(node, resource, len, event) .in 6 tm_node_id node; char \(**resource; int len; tm_event_t \**event; .in .ft .fi .LP .nf .B int tm_publish(name, info, len, event) .in 6 char \(**name; void \(**info; int len; tm_event_t \**event; .in .ft .fi .LP .nf .B int tm_subscribe(tid, name, info, len, info_len, event) .in 6 tm_task_id tid; char \(**name; void \(**info; int len; int \(**info_len; tm_event_t \**event; .in .ft .fi .LP .nf .B int tm_finalize() .ft .fi .SH DESCRIPTION .LP These functions provide a partial implementation of the task management interface part of the PSCHED API. In PBS, MOM provides the task manager functions. This library opens a tcp socket to the MOM running on the local host and sends and receives messages. .LP The PSCHED Task Management API description used to create this library was commited to paper on Novermber 15, 1996 and was given the version number 0.1. Changes may have taken place since that time which are not reflected in this library. .LP The API description uses several data types that it purposefully does not define. This was done so an implementaion would not be confined in the way it was written. For this specific work, the definitions follow: .sp .Ty .nf typedef int tm_node_id; /* job-relative node id */ #define TM_ERROR_NODE ((tm_node_id)-1) typedef int tm_event_t; /* event handle, > 0 for real events */ #define TM_NULL_EVENT ((tm_event_t)0) #define TM_ERROR_EVENT ((tm_event_t)-1) typedef unsigned long tm_task_id; #define TM_NULL_TASK (tm_task_id)0 .fi .LP There are a number of error values defined as well: .Ty .na TM_SUCCESS, TM_ESYSTEM, TM_ENOEVENT, TM_ENOTCONNECTED, TM_EUNKNOWNCMD, TM_ENOTIMPLEMENTED, TM_EBADENVIRONMENT, TM_ENOTFOUND. .ad .LP .B tm_init(\|) initializes the library by opening a socket to the MOM on the local host and sending a TM_INIT message, then waiting for the reply. The .IR info paramenter has no use and is included to conform with the PSCHED document. The .IR roots pointer will contain valid data after the function returns and has the following structure: .sp .Ty .nf struct tm_roots { tm_task_id tm_me; tm_task_id tm_parent; int tm_nnodes; int tm_ntasks; int tm_taskpoolid; tm_task_id *tm_tasklist; }; .fi .sp .IP tm_me 20 The task id of this calling task. .IP tm_parent 20 The task id of the task which spawned this task or TM_NULL_TASK if the calling task is the initial task started by PBS. .IP tm_nnodes 20 The number of nodes allocated to the job. .IP tm_ntasks 20 This will always be 0 for PBS. .IP tm_taskpoolid 20 PBS does not support task pools so this will always be \-1. .IP tm_tasklist 20 This will be NULL for PBS. .LP The .IR tm_ntasks , .IR tm_taskpoolid and .IR tm_tasklist fields are not filled with data specified by the PSCHED document. PBS does not support task pools and, at this time, does not return information about current running tasks from .B tm_init. There is a separate call to get information for current running tasks called .B tm_taskinfo which is described below. The return value from .B tm_init be TM_SUCCESS if the library initialization was successful, or an error return otherwise. .LP .B tm_nodeinfo(\|) places a pointer to a malloc'ed array of tm_node_id's in the pointer pointed at by .IR list . The order of the tm_node_id's in .IR list is the same as that specified to MOM in the "exec_host" attribute. The int pointed to by .IR nnodes contains the number of nodes allocated to the job. This is information that is returned during initialization and does not require communication with MOM. If .B tm_init has not been called, TM_ESYSTEM is returned, otherwise TM_SUCCESS is returned. .LP .B tm_poll(\|) is the function which will retrieve information about the task management system to locations specified when other routines request an action take place. The bookkeeping for this is done by generating an .IR event for each action. When the task manager (MOM) sends a message that an action is complete, the event is reported by .B tm_poll and information is placed where the caller requested it. The argument .IR poll_event is meant to be used to request a specific event. This implementation does not use it and it must be set to TM_NULL_EVENT or an error is returned. Upon return, the argument .IR result_event will contain a valid event number or TM_ERROR_EVENT on error. If .IR wait is zero and there are no events to report, .IR result_event is set to TM_NULL_EVENT. If .IR wait is non-zero an there are no events to report, the function will block waiting for an event. If no local error takes place, TM_SUCCESS is returned. If an error is reported by MOM for an event, then the argument .IR tm_errno will be set to an error code. .LP .B tm_notify(\|) is described in the PSCHED documentation, but is not implemented for PBS yet. It will return TM_ENOTIMPLEMENTED. .LP .B tm_spawn(\|) sends a message to MOM to start a new task. The node id of the host to run the task is given by .IR where . The parameters .IR argc , .IR argv and .IR envp specify the program to run and its arguments and environment very much like .B exec(\|). The full path of the program executable must be given by .IR argv[0] and the number of elements in the argv array is given by .IR argc . The array .IR envp is NULL terminated. The argument .IR event points to a tm_event_t variable which is filled in with an event number. When this event is returned by .B tm_poll , the tm_task_id pointed to by .IR tid will contain the task id of the newly created task. In addition, the tid is available to the process in the .B PBS_TASKNUM environment variable. Similarly, the node number is in the .B PBS_NODENUM variable and the cpu number is in the .B PBS_VNODENUM variable. .LP .B tm_kill(\|) sends a signal specified by .IR sig to the task .IR tid and puts an event number in the tm_event_t pointed to by .IR event . .LP .B tm_obit(\|) creates an event which will be reported when the task .IR tid exits. The int pointed to by .IR obitval will contain the exit value of the task when the event is reported. .LP .B tm_taskinfo(\|) returns the list of tasks running on the node specified by .IR node . The PSCHED documentation mentions a special ability to retrieve all tasks running in the job. This is not supported by PBS. The argument .IR tid_list points to an array of tm_task_id's which contains .IR list_size elements. Upon return, .IR event will contain an event number. When this event is polled, the int pointed to by .IR ntasks will contain the number of tasks running on the node and the array will be filled in with tm_task_id's. If .IR ntasks is greater than .IR list_size , only .IR list_size tasks will be returned. .LP .B tm_atnode(\|) will place the node id where the task .IR tid exists in the tm_node_id pointed to by .IR node . .LP .B tm_rescinfo(\|) makes a request for a string specifying the resources available on a node given by the argument .IR node . The string is returned in the buffer pointed to by .IR resource and is terminated by a NUL character unless the number of characters of information is greater than specified by .IR len . The resource string PBS returns is formated as follows: .sp A space separated set of strings from the .B uname system call followed by a colon (:). The order of the strings is .B sysname, .B nodename, .B release, .B version, .B machine. .sp A comma spearated set of strings giving the components of the "Resource_List" attribute of the job. Each component has the resource name, an equal sign, and the limit value. .sp For example, a return for a task running on an SGI workstation might look like: .sp IRIX golum 6.2 03131015 IP22:cput=20:00,mem=400kb .LP .B tm_publish(\|) causes .IR len bytes of information pointed at by .IR info to be sent to the local MOM to be saved under the name given by .IR name . .LP .B tm_subscribe(\|) returns a copy of the information named by .IR name for the task given by .IR tid . The argument .IR info points to a buffer of size .IR len where the information will be returned. The argument .IR info_len will be set with the size of the published data. If this is larger than the supplied buffer, the data will have been truncated. .LP .B tm_finalize(\|) may be called to free any memory in use by the library and close the connection to MOM. .SH SEE ALSO .BR pbs_mom, .BR "PSCHED: An API for Parallel Job/Resource Managment," .BR http://parallel.nas.nasa.gov/Psched/psched-api-report.ps torque-2.4.16/doc/man3/pbs_statque.3.in0000664000113300011330000001550411272401252014463 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_statque 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_statque \- obtain status of pbs batch queues .SH SYNOPSIS #include .br #include .sp .ft 3 .nf struct batch_status *pbs_statque(\^int\ connect, char\ *id, struct\ attrl\ *attrib, char\ *extend) .sp void pbs_statfree(\^struct batch_status *psj\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to obtain the status of a batch queue. .LP A .I "Status Queue" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The .Ar id is the name of a queue, in the form: .RS 5 .Ty queue_name .RE or the null string. If .Ty queue_name is specified, the status of the queue named .Ty queue_name at the server will be returned. If the .Ar id is a null string or null pointer, the status of all queues at the server will be returned. .LP The parameter, .Ar attrib , is a pointer to an .I attrl structure which is defined in pbs_ifl.h as: .sp .Ty .nf struct attrl { struct attrl *next; char *name; char *resource; char *value; }; .fi .sp .ft 1 The .Ar attrib .ft 1 list is terminated by the first entry where .Ty next is a null pointer. If .Ar attrib is given, then only the attributes in the list are returned by the server. Otherwise, all the attributes of a job are returned. When an .Ar attrib list is specified, the .Ty name member is a pointer to a attribute name as listed in pbs_alter(3) and pbs_submit(3). The .Ty resource member is only used if the name member is ATTR_l, otherwise it should be a pointer to a null string. The .Ty value member should aways be a pointer to a null string. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .LP The return value is a pointer to a list of .I batch_status structures, which is defined in pbs_ifl.h as: .sp .Ty .nf struct batch_status { struct batch_status *next; char *name; struct attrl *attribs; char *text; } .fi .ft 1 .LP It is up the user to free the structure when no longer needed, by calling \fBpbs_statfree\fP(). .LP .SH "SEE ALSO" qstat(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_statque\fP() function has been completed successfully by a batch server, the routine will return a pointer to the batch_status structure. Otherwise, a null pointer is returned and the error code is set in the global integer pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_deljob.3.in0000664000113300011330000001364711272401252014242 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_deljob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_deljob \- delete a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_deljob\^(\^int\ connect, char\ *job_id, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to delete a batch job. If the batch job is running, the execution server will send the .B SIGTERM signal followed by .B SIGKILL . .LP A .I "Delete Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The argument, .Ar job_id , identifies which job is to be deleted, it is specified in the form: .Ty "sequence_number.server" .LP The argument, .Ar extend , is overloaded to serve two purposes. If the pointer .Ar extend points to a string of the form: .br \fBdeldelay=nnnn\fP, .ft 1 .br it is used to provide control over the delay between sending .B SIGTERM and .B SIGKILL signals to a running job. The characters \fBnnnn\fP specify a unsigned decimal integer time delay in seconds. If .Ar extend is the null pointer or points to a null string, the administrator established default time delay is used. .LP If .Ar extend points to a string other than the above, it is taken as text to be appended to the message mailed to to the job owner. This mailing occurs if the job is deleted by a user other than the job owner. .SH "SEE ALSO" qdel(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by the \fBpbs_deljob\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/Makefile.in0000664000113300011330000003265111605403720013511 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = doc/man3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man3/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man3/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all work is done in doc/ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/doc/man3/pbs_rescreserve.3.in0000664000113300011330000001567411272401252015335 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_rescreserve 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_rescreserve, pbs_rescrelease \- reserve/free batch resources .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_rescreserve\^(\^int\ connect, char\ **resourcelist, int arraysize, resource_t *resource_id\^) .sp int pbs_rescrelease\^(\^int connect, resource_t resource_id\^) .fi .ft 1 .SH DESCRIPTION .if \n(Pb .ig Ig .HP 2 .Ig .if !\n(Pb .ig Ig .sp .Ig .B pbs_rescreserver .br Issue a request to the batch server to reserve specified resources. .Ar connect is the connection returned by \fBpbs_connect\fP(). .Ar resourcelist is an array of one or more strings specifying the resources to be queried. .Ar arraysize is the is the number of strings in resourcelist. .Ar resource_id is a pointer to a resource handle. The pointer cannot be null. If the present value of the resource handle is .B RESOURCE_T_NULL , this request is for a new reservation and if successful, a resource handle will be returned in resource_id. .IP If the value of resource_id as supplied by the caller is not .B RESOURCE_T_NULL , this is a existing (partial) reservation. Resources currently reserved for this handle will be released and the full reservation will be attempted again. If the caller wishes to release the resources allocated to a partial reservation, the caller should pass the resource handle to \fBpbs_rescrelease\fP(). .IP At the present time the only resources which may be specified are "nodes". It should be specified as .Ty nodes=specification where specification is what a user specifies in the \-l option arguement list for nodes, see .I qsub (1B). .if \n(Pb .ig Ig .HP 2 .Ig .if !\n(Pb .ig Ig .sp .Ig .B pbs_rescrelease .br The \fBpbs_rescrelease\fP() call releases or frees resources reserved with the resource handle of .Ar resource_id returned from a prior \fBpbs_rescreserve\fP() call. .Ar connect is the connection returned by \fBpbs_connect\fP(). .LP Both functions require that the issuing user have operator or administrator privilege. .SH "SEE ALSO" qsub(1B), pbs_connect(3B), pbs_disconnect(3B), pbs_rescquery(3B) and pbs_resources(7B) .SH DIAGNOSTICS pbs_rescreserve() and pbs_rescrelease() return zero on success. Otherwise, a non zero error is returned. The error number is also set in pbs_errno. .IP PBSE_RMPART is a special case indicating that some but not all of the requested resources could be reserved; a partial reservation was made. The reservation request should either be rerequested with the returned handle or the partial resources released. .IP PBSE_RMBADPARAM a parameter is incorrect, such as a null for the pointer to the resource_id. .IP PBSE_RMNOPARAM a parameter is missing, such as a null resoruce list. .LP \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_stagein.3.in0000664000113300011330000001403711272401252014427 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_stagein 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_stagein \- request that files for a pbs batch job be staged in. .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_stagein(\^int\ connect, char\ *job_id, char\ *location, char\ *extend) .fi .ft 1 .SH DESCRIPTION Issue a batch request to start the stage in of files specified in the stagein attribute of a batch job. .LP A .I "stage in" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP This request directs the server to begin the stage in of files specified in the job's stage in attribute. This request requires that the issuing user have operator or administrator privilege. .LP The argument, .Ar job_id , identifies which job for which file staging is to begin. It is specified in the form: .Ty "sequence_number.server" .LP The argument, .Ar location , if not the null pointer or null string, specifies the location where the job will be run and hence to where the files will be staged. The location is the name of a host in the the cluster managed by the server. .if !\n(Pb .ig Ig If the server does not understand the location, it will reject the request and return an error. .Ig If the job is then directed to run at different location, the run request will be rejected. .LP The argument, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qrun(8B), qsub(1B), and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_stagein\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_rlsjob.3.in0000664000113300011330000001360111272401252014264 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_rlsjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_rlsjob \- release a hold on a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_rlsjob(\^int\ connect, char\ *job_id, char\ *hold_type, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to release a hold from a job. .LP A .I "Release Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The argument, .Ar job_id , identifies the job from which the hold is to be released, it is specified in the form: .Ty "sequence_number.server" .LP The parameter, .Ar hold_type , contains the type of hold to be released. The possible values are defined in pbs_ifl.h as: .RS .IP #define\ USER_HOLD\ "u" Available to the owner of the job, the batch operator, and the batch administrator. .IP #define\ OTHER_HOLD\ "o" Available to the batch operator and the batch administrator. .IP #define\ SYSTEM_HOLD\ "s" Available only to the batch administrator. .RE .LP If .Ar hold_type is either a null pointer or points to a null string, USER_HOLD will be released. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qrls(1B), qhold(1B), qalter(1B), pbs_alterjob(3B), pbs_connect(3B), and pbs_holdjob(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_rlsjob\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_geterrmsg.3.in0000664000113300011330000001250711272401252014774 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_geterrmsg 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_geterrmsg \- get error message for last pbs batch operation .SH SYNOPSIS #include .br #include .sp .ft 3 .nf char *pbs_geterrmsg(int connect) .ft 1 .fi .SH DESCRIPTION Return the error message text associated with a batch server request. .LP .if !\n(Pb .ig Ig Because different server implementations may have different error conditions, the batch request \- reply protocol allows for the server to include the text of an error message in the reply to a batch request. .LP .Ig If the preceding batch interface library call over the connection specified by .Ar connect resulted in an error return from the server, there may be an associated text message. If it exists, this function will return a pointer to the null terminated text string. .SH SEE ALSO pbs_connect(3B) .SH DIAGNOSTICS If an error text message was returned by a server in reply to the previous call to a batch interface library function, \fBpbs_geterrmsg\fP() will return a pointer to it. Otherwise, pbs_geterrmsg() returns the null pointer. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_statjob.3.in0000664000113300011330000001672111272401252014445 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_statjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_statjob \- obtain status of pbs batch jobs .SH SYNOPSIS #include .br #include .sp .ft 3 .nf struct batch_status *pbs_statjob(\^int\ connect, char\ *id, struct\ attrl\ *attrib, char *extend) .sp void pbs_statfree(\^struct batch_status *psj\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to obtain the status of a specified batch job or a set of jobs at a destination. .LP A .I "Status Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The parameter, .Ar id , may be either a job identifier or a destination identifier. .if !\n(Pb .ig Ig If the string starts with a number, it is a job identifier. If it starts with a alphabetic character, it is a destination identifier. .Ig .LP If .Ar id is a job identifier, it is the identifier of the job for which status is requested. It is specified in the form: .Ty "sequence_number.server" .LP If .Ar id is a destination identifier, it specifies that status of all jobs at the destination (queue) which the user is authorized to see be returned. If .Ar id is the null pointer or a null string, the status of each job at the server which the user is authorized to see is returned. .LP The parameter, .Ar attrib , is a pointer to an .I attrl structure which is defined in pbs_ifl.h as: .sp .Ty .nf struct attrl { struct attrl *next; char *name; char *resource; char *value; }; .fi .sp .ft 1 The .Ar attrib .ft 1 list is terminated by the first entry where .Ty next is a null pointer. If .Ar attrib is given, then only the attributes in the list are returned by the server. Otherwise, all the attributes of a job are returned. When an .Ar attrib list is specified, the .Ty name member is a pointer to a attribute name as listed in pbs_alter(3) and pbs_submit(3). The .Ty resource member is only used if the name member is ATTR_l, otherwise it should be a pointer to a null string. The .Ty value member should aways be a pointer to a null string. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. TORQUE 2.0.0p1 added the #define'd constant string EXECQUEONLY to only retrieve jobs in execution queues. .LP The return value is a pointer to a list of .I batch_status structures or the null pointer if no jobs can be queried for status. The batch_status structure is defined in pbs_ifl.h as .sp .Ty .nf struct batch_status { struct batch_status *next; char *name; struct attrl *attribs; char *text; } .fi .ft 1 .LP It is up the user to free the structure when no longer needed, by calling \fBpbs_statfree\fP(). .LP .SH "SEE ALSO" qstat(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_statjob\fP() function has been completed successfully and the status of each job has been returned by the batch server, the routine will return a pointer to the list of batch_status structures. If no jobs were available to query or an error occurred, a null pointer is returned. The global integer pbs_errno should be examined to determine the cause. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_get_server_list.3.in0000664000113300011330000001131211435257364016204 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_get_server_list 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_get_server_list \- get a list of pbs server names .SH SYNOPSIS #include .br #include .sp .ft 3 .nf char pbs_get_server_list() .ft 1 .fi .SH DESCRIPTION A character string is returned containing the names of the PBS servers. .SH SEE ALSO pbs_connect(3B), pbs_default(3B), pbs_fbserver(3B) .SH DIAGNOSTICS If the servers cannot be determined, a NULL value is returned. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_alterjob.3.in0000664000113300011330000002122611435257364014613 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_alterjob 3B " " Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_alterjob \- alter pbs batch job .SH SYNOPSIS #include .br #include .sp .nf .ft 3 int pbs_alterjob(\^int connect, char\ *job_id, struct\ attrl\ *attrib, char\ *extend\^) .sp int pbs_alterjob_async(\^int connect, char\ *job_id, struct\ attrl\ *attrib, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to alter a batch job. .LP A .I "Modify Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). When the asynchronous \fBpbs_alterjob_async\fP() call is used, the server will validate the request and reply before modifying the job. This version of the call can be used to reduce latency in scheduling, especially when the scheduler must modify a large number of jobs. .LP The argument, .Ar job_id , identifies which job is to be altered, it is specified in the form: .br .Ty \ \ \ \ sequence_number.server .ft 1 .LP The parameter, .Ar attrib , is a pointer to an .I attrl structure which is defined in pbs_ifl.h as: .sp .Ty .nf struct attrl { char *name; char *resource; char *value struct attrl *next; }; .fi .sp .ft 1 The .Ar attrib list is terminated by the first entry where .Ty next is a null pointer. .LP The .Ty name member points to a string which is the name of the attribute. The .Ty value member points to a string which is the value of the attribute. The attribute names are defined in pbs_ifl.h: .br .RS .IP #define\ ATTR_a\ "Execution_Time" Alter the job's execution time. .IP #define\ ATTR_A\ "Account_Name" Alter the account string. .IP #define\ ATTR_c\ "Checkpoint" Alter the checkpoint interval. .IP #define\ ATTR_e\ "Error_Path" Alter the path name for the standard error of the job. .IP #define\ ATTR_g\ "Group_List" Alter the list of group names under which the job may execute. .IP #define\ ATTR_h\ "Hold_Types" Alter the hold types. .IP #define\ ATTR_j\ "Join_Path" Alter if standard error and standard output are joined (merged). .IP #define\ ATTR_k\ "Keep_Files" Alter which output of the job is kept on the execution host. .IP #define\ ATTR_l\ "Resource_List" Alter the value of a named resource. .IP #define\ ATTR_m\ "Mail_Points" Alter the points at which the server will send mail about the job. .IP #define\ ATTR_M\ "Mail_Users" Alter the list of users who would receive mail about the job. .IP #define\ ATTR_N\ "Job_Name" Alter the job name. .IP #define\ ATTR_o\ "Output_Path" Alter the path name for the standard output of the job. .IP #define\ ATTR_p\ "Priority" Alter the priority of the job. .IP #define\ ATTR_r\ "Rerunable" Alter the rerunable flag. .IP #define\ ATTR_S\ "Shell_Path_List" Alter the path to the shell which will interprets the job script. .IP #define\ ATTR_u\ "User_List" Alter the list of user names under which the job may execute. .IP #define\ ATTR_v\ "Variable_List" Alter the list of environmental variables which are to be exported to the job. .IP #define\ ATTR_depend\ "depend" Alter the inter-job dependencies. .IP #define\ ATTR_stagein\ "stagein" Alter the list of files to be staged-in before job execution. .IP #define\ ATTR_stageout\ "stageout" Alter the list of files to be staged-out after job execution. .RE .LP If .Ar attrib itself is a null pointer, then no attributes are altered. .LP Associated with an attribute of type ATTR_l (the letter ell) is a resource name indicated by .Ty resource in the .I attrl structure. All other attribute types should have a pointer to a null string ("") for .Ty resource . .LP If the resource of the specified resource name is already present in the job's .At Resource_List attribute, it will be altered to the specified value. If the resource is not present in the attribute, it is added. .LP Certain attributes of a job may or may not be alterable depending on the state of the job; see \fBqalter\fP(1B). .sp .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qalter(1B), qhold(1B), qrls(1B), qsub(1B), pbs_connect(3B), pbs_holdjob(3B), and pbs_rlsjob(3B) .SH DIAGNOSTICS When the batch request generated by the \fBpbs_alterjob\fP() or \fBpbs_alterjob_async\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_submit.3.in0000664000113300011330000002227511272401252014303 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_submit 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_submit \- submit a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 .nf char *pbs_submit(\^int\ connect, struct\ attropl\ *attrib, char\ *script, char\ *destination, char\ *extend) .fi .ft 1 .SH DESCRIPTION Issue a batch request to submit a new batch job. .LP A .I "Queue Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). The job will be submitted to the queue specified by .Ar destination . .LP The parameter, .Ar attrib , is a list of .I attropl structures which is defined in pbs_ifl.h as: .sp .Ty .nf struct attrl { char *name; char *resource; char *value; struct attrl *next; enum batch_op op; }; .fi .sp .ft 1 The .Ar attrib list is terminated by the first entry where .Ty next is a null pointer. .LP The .Ty name member points to a string which is the name of the attribute. The .Ty value member points to a string which is the value of the attribute. The attribute names are defined in pbs_ifl.h: .br .RS .IP #define\ ATTR_a\ "Execution_Time" Defines the job's execution time. .IP #define\ ATTR_A\ "Account_Name" Defines the account string. .IP #define\ ATTR_c\ "Checkpoint" Defines the checkpoint interval. .IP #define\ ATTR_e\ "Error_Path" Defines the path name for the standard error of the job. .IP #define\ ATTR_g\ "Group_List" Defines the list of group names under which the job may execute. .IP #define\ ATTR_h\ "Hold_Types" Defines the hold types, the only allowable value string is .Ty \&"u" . .IP #define\ ATTR_j\ "Join_Paths" Defines whether standard error and standard output are joined (merged). .IP #define\ ATTR_k\ "Keep_Files" Defines which output of the job is kept on the execution host. .IP #define\ ATTR_l\ "Resource_List" Defines a resource required by the job. .IP #define\ ATTR_m\ "Mail_Points" Defines the points at which the server will send mail about the job. .IP #define\ ATTR_M\ "Mail_Users" Defines the list of users who would receive mail about the job. .IP #define\ ATTR_N\ "Job_Name" Defines the job name. .IP #define\ ATTR_o\ "Output_Path" Defines the path name for the standard output of the job. .IP #define\ ATTR_p\ "Priority" Defines the priority of the job. .IP #define\ ATTR_r\ "Rerunable" Defines the rerunable flag. .IP #define\ ATTR_S\ "Shell_Path_List" Defines the path to the shell which will interpret the job script. .IP #define\ ATTR_t\ "job_array_request" Requests specific array IDs. Makes this submission a job array submit. .IP #define\ ATTR_u\ "User_List" Defines the list of user names under which the job may execute. .IP #define\ ATTR_v\ "Variable_List" Defines the list of additional environment variables which are exported to the job. .IP #define\ ATTR_depend\ "depend" Defines the inter\-job dependencies. .IP #define\ ATTR_stagein\ "stagein" Defines the list of files to be staged in prior to job execution. .IP #define\ ATTR_stageout\ "stageout" Defines the list of files to be staged out after job execution. .RE .LP If an attribute is not named in the .Ar attrib array, the default action will be taken. It will either be assigned the default value or will not be passed with the job. The action depends on the attribute. If .Ar attrib itself is a null pointer, then the default action will be taken for each attribute. .LP Associated with an attribute of type ATTR_l (the letter ell) is a resource name indicated by .Ty resource in the .I attrl structure. All other attribute types should have a pointer to a null string for .Ty resource . .LP The .Ty op member is forced to a value of .Ty SET by pbs_submit(). .LP The parameter, .Ar script , is the path name to the job script. If the path name is relative, it will be expanded to the processes current working directory. If .Ar script is a null pointer or the path name pointed to is specified as the null string, no script is passed with the job. .LP The .Ar destination parameter specifies the destination for the job. It is specified as: .Ty [queue] If .Ar destination is the null string or the queue is not specified, the destination will be the default queue at the connected server. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .LP The return value is a character string which is the .Ar job_identifier assigned to the job by the server. The space for the .Ar job_identifier string is allocated by \fBpbs_submit\fP() and should be released via a call to \fBfree\fP() by the user when no longer needed. .SH "SEE ALSO" qsub(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by pbs_submit() function has been completed successfully by a batch server, the routine will return a pointer to a character string which is the job identifier of the submitted batch job. Otherwise, a null pointer is returned and the error code is set in pbs_error. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_manager.3.in0000664000113300011330000001621611272401252014410 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_manager 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_manager \- administrator a pbs batch object .SH SYNOPSIS #include .br #include .sp .nf .ft 3 int pbs_manager(\^int\ connect, int\ command, int\ obj_type, char\ *obj_name, struct\ attropl\ *attrib, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to perform administration functions at a server. With this request server objects such as queues can be created and deleted, and have their attributes set and unset. .LP A .I "Manage" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). This request requires full batch administrator privilege. .LP The parameter, .Ar command , specifies the operation to be performed, see pbs_ifl.h: .br .Ty .nf #define MGR_CMD_CREATE 0 #define MGR_CMD_DELETE 1 #define MGR_CMD_SET 2 #define MGR_CMD_UNSET 3 .fi .ft 1 .LP The parameter, .Ar obj_type , declares the type of object upon which the command operates, see pbs_ifl.h: .br .Ty .nf #define MGR_OBJ_SERVER 0 #define MGR_OBJ_QUEUE 1 .fi .ft 1 .LP The parameter, .Ar obj_name , is the name of the specific object. .LP The parameter, .Ar attrib , is a pointer to an .I attropl structure which are defined in pbs_ifl.h as: .sp .Ty .nf struct attropl { char *name; char *resource; char *value; enum batch_op op; struct attropl *next; }; .fi .sp .ft 1 The .Ar attrib list is terminated by the first entry where .Ty next is a null pointer. .LP The .Ty name member points to a string which is the name of the attribute. .LP If the attribute is one which contains a set of resources, the specific resource is specified in the structure member .Ty resource . Otherwise, the member resource is pointer to a null string. .LP The .Ty value member points to a string which is the new value of the attribute. .LP The .Ty op member defines the manner in which the new value is assigned to the attribute. The operators are: .Ty "enum batch_op { ..., SET, UNSET, INCR, DECR };" .br .if !\n(Pb .ig Ig .LP The full range of batch_op values is .Ty "{ SET, UNSET, INCR, DECR, EQ, NE, GE, GT, LE, LT } Only the SET, UNSET, INCR, and DECR are allowed in a manager call, others will be rejected by the server. .Ig .LP The parameter .Ar extend is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .LP Functions MGR_CMD_CREATE and MGR_CMD_DELETE require PBS Manager privilege. Functions MGR_CMD_SET and MGR_CMD_UNSET require PBS Manager or Operator privilege. .SH "SEE ALSO" qmgr(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_manager\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_statserver.3.in0000664000113300011330000001476711272401252015211 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_statserver 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_statserver \- obtain status of a pbs batch server .SH SYNOPSIS #include .br #include .sp .nf .ft 3 struct batch_status *pbs_statserver(\^int/ connect, struct/ attrl/ *attrib, char/ *extend) .sp void pbs_statfree(\^struct batch_status *psj\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to obtain the status of a batch server. .LP A .I "Status Server" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The parameter, .Ar attrib , is a pointer to an .I attrl structure which is defined in pbs_ifl.h as: .sp .Ty .nf struct attrl { struct attrl *next; char *name; char *resource; char *value; }; .fi .sp .ft 1 The .Ar attrib .ft 1 list is terminated by the first entry where .Ty next is a null pointer. If .Ar attrib is given, then only the attributes in the list are returned by the server. Otherwise, all the attributes of the server are returned. When an .Ar attrib list is specified, the .Ty name member is a pointer to a attribute name as listed in pbs_alter(3) and pbs_submit(3). The .Ty resource member is only used if the name member is ATTR_l, otherwise it should be a pointer to a null string. The .Ty value member should aways be a pointer to a null string. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .LP The return value is a pointer to a list of batch_status structures, which is defined in pbs_ifl.h as: .sp .Ty .nf struct batch_status { struct batch_status *next; char *name; struct attrl *attribs; char *text; } .fi .ft 1 .LP It is up the user to free the space when no longer needed, by calling \fBpbs_statfree\fP(). .LP .SH "SEE ALSO" qstat(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_statserver\fP() function has been completed successfully by a batch server, the routine will return a pointer to a batch_status structure. Otherwise, a null pointer is returned and the error code is set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_terminate.3.in0000664000113300011330000001375511272401252014773 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_terminate 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_terminate \- terminate a pbs batch server .SH SYNOPSIS #include .br #include .sp .nf .ft 3 int pbs_terminate(\^int\ connect, int\ manner, char\ *extend\^) .ft 1 .fi .SH DESCRIPTION Issue a batch request to shut down a batch server. This request requires the privilege level usually reserved for batch operators and administrators. .LP A .I "Server Shutdown" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The parameter, .Ar manner , specifies the manner in which the server is shut down. The available manners are defined in pbs_ifl.h as: .RS .25i .IP #define\ SHUT_IMMEDIATE\ 0 Shutdown is to be immediate, runnings jobs are checkpointed, requeued, or deleted as required. .IP #define\ SHUT_DELAY\ 1 Jobs which can be checkpointed are checkpointed, terminated, and requeued. Jobs which cannot be checkpointed but are rerunnable are terminated and requeued. Shutdown is delayed until the remaining running jobs complete. No new jobs will be started by the server. .RE .LP The server will not respond to the batch request until the server has completed its termination procedure. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .LP This call requires PBS Operator or Manager privilege. .SH "SEE ALSO" qterm(8B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_terminate\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_runjob.3.in0000664000113300011330000001447111272401252014276 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_runjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_runjob \- run a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 int pbs_runjob(\^int\ connect, char\ *job_id, char\ *location, char\ *extend) .sp int pbs_asyrunjob(\^int\ connect, char\ *job_id, char\ *location, char\ *extend) .ft 1 .SH DESCRIPTION Issue a batch request to run a batch job. .LP For .I pbs_runjob() a "Run Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). The server will reply when the job has started execution unless file in-staging is required. In that case, the server will reply when the staging operations are started. .LP For .I pbs_asyrunjob() an "Asynchronous Run Job" request is generated and set to the server over the connection. The server will validate the request and reply before initiating the execution of the job. This version of the call can be used to reduce latency in scheduling, especially when the scheduler must start a large number of jobs. .LP These requests requires that the issuing user have operator or administrator privilege. .LP The argument, .Ar job_id , identifies which job is to be run it is specified in the form: .Ty "sequence_number.server" .LP The argument, .Ar location , if not the null pointer or null string, specifies the location where the job should be run. The location is the name of a host in the the cluster managed by the server. .if !\n(Pb .ig Ig If the server does not understand the location, it will reject the request and return an error. .Ig .LP The argument, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by these functions. .Ig .SH "SEE ALSO" qrun(8B), qsub(1B), and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by the \fBpbs_runjob\fP() or \fBpbs_asyrunjob\fP() functions has been completed successfully by a batch server, the routines will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_movejob.3.in0000664000113300011330000001406111272401252014433 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_movejob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_movejob \- move a pbs batch job to a new destination .SH SYNOPSIS #include .br #include .sp .nf .ft 3 int pbs_movejob(\^int\ connect, char\ *job_id, char\ *destination, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to move a job to a new destination. The job is removed from the present queue and instantiated in a new queue. .LP A .I "Move Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The .Ar job_id parameter identifies which job is to be moved; it is specified in the form: .Ty "sequence_number.server" .LP The .Ar destination parameter specifies the new destination for the job. It is specified as: .Ty [queue][@server] . If .Ar destination is a null pointer or a null string, the destination will be the default queue at the current server. If .Ar destination specifies a queue but not a server, the destination will be the named queue at the current server. If .Ar destination specifies a server but not a queue, the destination will be the default queue at the named server. If .Ar destination specifies both a queue and a server, the destination is that queue at that server. .LP A job in the .B Running , .B Transiting , or .B Exiting state cannot be moved. .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qmove(1B), qsub(1B), and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_movejob\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_locate.3.in0000664000113300011330000001325611272401252014246 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_locjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_locjob \- locate current location of a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 .nf char *pbs_locjob\^(\^int connect, char\ *job_id, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to locate a batch job. If the server currently manages the batch job, or knows which server does currently manage the job, it will reply with the location of the job. .LP A .I "Locate Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The argument, .Ar job_id , identifies which job is to be located, it is specified in the form: .Ty "sequence_number.server" .LP The argument, .Ar extend , is reserved for implementation defined extensions. It is not currently used by this function. .LP The return value is a pointer to a character sting which contains the current location if known. The syntax of the location string is: .Ty "queue@server_name" . If the location of the job is not known, the return value is the NULL pointer. .SH "SEE ALSO" qsub(1B) and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by the \fBpbs_locjob\fP() function has been completed successfully by a batch server, the routine will return a non null pointer to the destination. Otherwise, a null pointer is returned. The error number is set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_connect.3.in0000664000113300011330000001450211272401252014423 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_connect 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_connect \- connect to a pbs batch server .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_connect(\^char *server\^) .sp extern char *pbs_server; .ft 1 .fi .SH DESCRIPTION A virtual stream (TCP/IP) connection is established with the server specified by .Ar server . .LP This function must be called before any of the other .B pbs_ functions. They will transmit their batch requests over the connection established by this function. Multiple requests may be issued over the connection before it is closed. .LP The connection should be closed by a call to \fBpbs_disconnect\fP() when all requests have been sent to the server. .LP The parameter, .Ar server , is of the form .Ty host_name[:port] , see section 2.7.9. If .Ty port is not specified, the standard PBS port number will be used. .LP If the parameter, .Ar server , is either the null string or a null pointer, a connection will be opened to the default server. The default server is defined .if !\n(Pb .ig Ig in section \*(Si. .Ig .if \n(Pb .ig Ig by (a) the setting of the environment variable .B PBS_DEFAULT which contains a destination, or (b) the destination in the batch administrator established file .Av {PBS_DIR}/default_destn . .Ig .LP The variable .Ar pbs_server , declared in pbs_ifl.h, is set on return to point to the server name to which pbs_connect() connected or attempted to connect. .SH SEE ALSO qsub(1B), pbs_alterjob(3B), pbs_deljob(3B), pbs_disconnect(3B), pbs_geterrmsg(3B), pbs_holdjob(3B), pbs_locate(3B), pbs_manager(3B), pbs_movejob(3B), pbs_msgjob(3B), pbs_rerunjob(3B), pbs_rlsjob(3B), pbs_runjob(3B), pbs_selectjob(3B), pbs_selstat(3B), pbs_sigjob(3B), pbs_statjob(3B), pbs_statque(3B), pbs_statserver(3B), pbs_submit(3B), pbs_terminate(3B), pbs_server(8B), and the PBS External Reference Specification .SH DIAGNOSTICS When the connection to batch server has been successfully created, the routine will return a connection identifier which is positive. Otherwise, a negative value is returned. The error number is set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_selstat.3.in0000664000113300011330000002572211272401252014457 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_selstat 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_selstat \- obtain status of selected pbs batch jobs .SH SYNOPSIS #include .br #include .sp .ft 3 .nf struct batch_status *pbs_selstat(\^int\ connect, struct\ attropl\ *sel_list, char\ *extend\^) .sp void pbs_statfree(\^struct batch_status *psj\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to examine the status of jobs which meet certain criteria. \fBpbs_selstat\fP() returns a list of batch_status structures for those jobs which met the selection criteria. .LP This function is a combination of \fBpbs_selectjobs\fP() and \fBpbs_statjob\fP(). It is an extension to the POSIX Batch standard. .LP Initially all batch jobs are selected for which the user is authorized to query status. This set may be reduced or filtered by specifying certain attributes of the jobs. .LP A .I "Select Status" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The parameter, .Ar sel_list , is a pointer to an .I attropl structure which is defined in pbs_ifl.h as: .sp .Ty .nf struct attropl { struct attropl *next; char *name; char *resource; char *value; enum batch_op op; }; .fi .sp .ft 1 The .Ar sel_list .ft 1 list is terminated by the first entry where .Ty next is a null pointer. .LP The .Ty name member points to a string which is the name of the attribute. Not all of the job attributes may be used as a selection criteria. The .Ty resource member points to a string which is the name of a resource. This member is only used when .Ty name is set to ATTR_l, otherwise it should be a pointer to a null string. The .Ty value member points to a string which is the value of the attribute or resource. The attribute names are defined in pbs_ifl.h: .br .RS .IP #define\ ATTR_a\ "Execution_Time" Select based upon the job's execution time. .IP #define\ ATTR_A\ "Account_Name" Select (E) based upon the account string. .IP #define\ ATTR_c\ "Checkpoint" Select based upon the checkpoint interval. .IP #define\ ATTR_e\ "Error_Path" Select (E) based upon the name of the standard error file. .IP #define\ ATTR_g\ "Group_List" Select (E) based upon the list of group names under which the job may execute. .IP #define\ ATTR_h\ "Hold_Types" Select (E) based upon the hold types. .IP #define\ ATTR_j\ "Join_Paths" Select (E) based upon the value of the join list. .IP #define\ ATTR_k\ "Keep_Files" Select (E) based upon the value of the keep files list. .IP #define\ ATTR_l\ "Resource_List" Select based upon the value of the resource named in .Ty resource . .IP #define\ ATTR_m\ "Mail_Points" Select (E) based upon the setting of the mail points attribute. .IP #define\ ATTR_M\ "Mail_Users" Select (E) based upon the list of user names to which mail will be sent. .IP #define\ ATTR_N\ "Job_Name" Select (E) based upon the job name. .IP #define\ ATTR_o\ "Output_Path" Select (E) based upon the name of the standard output file. .IP #define\ ATTR_p\ "Priority" Select based upon the priority of the job. .IP #define\ ATTR_q\ "destination" Select based upon the specified destination. Jobs selected are restricted to those residing in the named queue. If destination is the null string, the default queue at the server is assumed. .IP #define\ ATTR_r\ "Rerunable" Select (E) based upon the rerunable flag. .IP #define\ ATTR_session\ "session_id" Select based upon the session id assigned to running jobs. .IP #define\ ATTR_S\ "Shell_Path_List" Select (E) based upon the execution shell list. .IP #define\ ATTR_u\ "User_List" Select (E) based upon the owner of the jobs. .IP #define\ ATTR_v\ "Variable_List" Select (E) based upon the list of environment variables. .IP #define\ ATTR_ctime\ "ctime" Select based upon the creation time of the job. .IP #define\ ATTR_depend\ "depend" Select based upon the list of job dependencies. .IP #define\ ATTR_mtime\ "mtime" Select based upon the last modification time of the job. .IP #define\ ATTR_qtime\ "qtime" Select based upon the time of the job was placed into the current queue. .IP #define\ ATTR_qtype\ "queue_type" Select (E) base on the type of queue in which the job resides. .IP #define\ ATTR_stagein\ "stagein" Select based upon the list of files to be staged-in. .IP #define\ ATTR_stageout\ "stageout" Select based upon the list of files to be staged-out. .IP #define\ ATTR_state\ "job_state" Select based upon the state of the jobs. State is not a job attribute, but is included here to allow selection. .RE .LP The .Ty op member defines the operator in the logical expression: .br .Ty \ \ \ \ value\ operator\ current_value .br The logical expression must evaluate as true for the job to be selected. The permissible values of .Ty op are defined in pbs_ifl.h as: .Ty "enum batch_op { ..., EQ, NE, GE, GT, LE, LT, ... };" . The attributes marked with (E) in the description above may only be selected with the equal, EQ, or not equal, NE, operators. .if !\n(Pb .ig Ig The full range of batch_op values is SET, UNSET, INCR, DECR, EQ, NE, GE, GT, LE, and LT, Only the relational operators are allowed in a selstat call, and others will be rejected by the server. .Ig .LP If .Ar sel_list itself is a null pointer, then no selection is done on the basis of attributes. .LP The return value is a pointer to a list of .I batch_status structures or the null pointer if no jobs can be queried for status. The batch_status structure is defined in pbs_ifl.h as .sp .Ty .nf struct batch_status { struct batch_status *next; char *name; struct attrl *attribs; char *text; } .fi .ft 1 .LP The entry, .Ty attribs , is a pointer to a list of attrl structures defined in pbs_ifl.h as: .sp .Ty .nf struct attrl { struct attrl *next; char *name; char *resource; char *value; }; .fi .ft 1 .LP It is up the user to free the list of batch_status structures when no longer needed, by calling \fBpbs_statfree\fP(). .LP The parameter, .Ar extend , is reserved for implementation defined extensions. TORQUE 2.0.0p1 added the #define'd constant string EXECQUEONLY to only retrieve jobs in execution queues. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qselect(1B), pbs_alterjob(3B), pbs_connect(3B), pbs_statjob(3B), and pbs_selectjob(3B). .SH DIAGNOSTICS When the batch request generated by pbs_selstat() function has been completed successfully by a batch server, the routine will return a pointer to the list of batch_status structures. If no jobs met the criteria or an error occurred, the return will be the null pointer. If an error occurred, the global integer pbs_errno will be set to a non-zero value. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/Makefile.am0000664000113300011330000000010711272401252013465 00000000000000include $(top_srcdir)/buildutils/config.mk # all work is done in doc/ torque-2.4.16/doc/man3/pbs_orderjob.3.in0000664000113300011330000001257311272401252014606 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_orderjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_orderjob \- reorder pbs batch jobs in a queue .SH SYNOPSIS #include .br #include .sp .nf .ft 3 int pbs_orderjob(\^int\ connect, char\ *job_id1, char\ *job_id2, char\ *extend\^) .fi .ft 1 .SH DESCRIPTION Issue a batch request to swap the order of two jobs with a single queue. .LP An .I "Order Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP The parameters .Ar job_id1 and .Ar job_id2 identify which jobs are to be swapped. They are specified in the form: .Ty "sequence_number.server" . .LP The parameter, .Ar extend , is reserved for implementation defined extensions. .if !\n(Pb .ig Ig It is not currently used by this function. .Ig .SH "SEE ALSO" qorder(1B), qmove(1B), qsub(1M), and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_orderjob\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_rescquery.3.in0000664000113300011330000002111311272401252015010 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_rescquery 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_rescquery, avail, totpool, usepool \- query resource availability .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_rescquery\^(\^int\ connect, char\ **resourcelist, int arraysize, int *available, int *allocated, int *reserved, int *down \^) .sp char *avail\^(\^int connect, char *resc\^) .sp int totpool\^(\^int connect, int update\^) .sp int usepool\^(\^int connect, int update\^) .fi .ft 1 .SH DESCRIPTION .if \n(Pb .ig Ig .HP 2 .Ig .if !\n(Pb .ig Ig .sp .Ig .B pbs_rescquery .br Issue a request to the batch server to query the availability of resources. .Ar connect is the connection returned by \fBpbs_connect\fP(). .Ar resourcelist is an array of one or more strings specifying the resources to be queried. .Ar arraysize is the is the number of strings in resourcelist. .Ar available , .Ar allocated , .Ar reserved , and .Ar down are integer arrays of size arraysize. The amount of resource specified in the corresponding resourcelist string which is available, already allocated, reserved, and down/off-line is returned in the integer arrays. .IP At the present time the only resources which may be specified is "nodes". It may be specified as .br .Ty \ \ \ \ nodes .br .Ty \ \ \ \ nodes= .br .Ty \ \ \ \ nodes=\fBspecification\fP .br where specification is what a user specifies in the \-l option arguement list for nodes, see qsub(1B) and the various pbs_resource_* man pages. .IP Where the node resourcelist is a simple type, such as "nodes", "nodes=", or "nodes=\fBtype\fP", the numbers returned reflect the actual number of nodes (of the specified type) which are \fBavailable\fP, \fBallocated\fP, \fBreserved\fP, or \fBdown\fP. .IP For a more complex node resourcelist, such as "nodes=2" or "nodes=type1:type2", only the value returned in .I available has meaning. If the number in .I available is positive, it is the number of nodes requried to satisified the specification and that some set of nodes are available which will satisify it, see .I avail (). If the number in .I available is zero, some number of nodes requried to satisified the specification are currently unavailable, the request might be satisifed at a later time. If the number in .I available is negative, no combination of known nodes can satisified the specification. .if \n(Pb .ig Ig .HP 2 .Ig .if !\n(Pb .ig Ig .sp .Ig .B avail .br The .I avail () call is provided as conversion aid for scheduler written for early versions of PBS. The avail() routine uses pbs_rescquery() and returns a character string answer. .Ar connect is the connection returned by \fBpbs_connect\fP(). .Ar resc is a single .I node=specification specification as discussed above. If the nodes to satisify the specification are currently available, the return value is the character string .B yes . If the nodes are currently unavailable, the return is the character string .B no . If the specification could never be satified, the return is the string .B never . An error in the specification returns the character string .B ? . .if \n(Pb .ig Ig .HP 2 .Ig .if !\n(Pb .ig Ig .sp .Ig .B totpool .br The .I totpool () function returns the total number of nodes know to the PBS server. This is the sum of the number of nodes available, allocated, reserved, and down. The parameter .Ar connection is the connection returned by pbs_connect(). The parameter .Ar update if non-zero, causes totpool() to issue a pbs_rescquery() call to obtain fresh information. If zero, numbers from the prior pbs_rescquery() are used. .if \n(Pb .ig Ig .HP 2 .Ig .if !\n(Pb .ig Ig .sp .Ig .B usepool .br .I usepool () returns the number of nodes currently in use, the sum of allocated, reserved, and down. The parameter .Ar connection is the connection returned by pbs_connect(). The parameter .Ar update if non-zero, causes totpool() to issue a pbs_rescquery() call to obtain fresh information. If zero, numbers from the prior pbs_rescquery() are used. .SH "SEE ALSO" qsub(1B), pbs_connect(3B), pbs_disconnect(3B), pbs_rescreserve(3B) and pbs_resources(7B) .SH DIAGNOSTICS When the batch request generated by the \fBpbs_rescquery\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. .LP The functions usepool() and totpool() return \-1 on error. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man3/pbs_rerunjob.3.in0000664000113300011330000001272111272401252014621 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Ig .TH pbs_rerunjob 3B "" Local PBS .so ../ers/ers.macros .Ig .SH NAME pbs_rerunjob \- rerun a pbs batch job .SH SYNOPSIS #include .br #include .sp .ft 3 .nf int pbs_rerunjob(\^int\ connect, char\ *job_id,\ char\ *extend) .fi .ft 1 .SH DESCRIPTION Issue a batch request to rerun a batch job. .LP A .I "Rerun Job" batch request is generated and sent to the server over the connection specified by .Ar connect which is the return value of \fBpbs_connect\fP(). .LP If the job is marked as being not rerunable, the request will fail and an error will be returned. .LP The argument, .Ar job_id , identifies which job is to be rerun it is specified in the form: .Ty "sequence_number.server" .LP The parameter, .Ar extend , is reserved for implementation defined extensions. As if TORQUE 2.2, the string define .I RERUNFORCE may be used to force a rerun if the mini-server fails. This is dangerous. Do not used it. .Ig .SH "SEE ALSO" qrerun(1B), qsub(1B), and pbs_connect(3B) .SH DIAGNOSTICS When the batch request generated by \fBpbs_rerunjob\fP() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/Makefile.am0000664000113300011330000001436411446202523012644 00000000000000include $(top_srcdir)/buildutils/config.mk noinst_PROGRAMS = soelim soelim_SOURCES = soelim.c # ensures soelim is built early so that parallel makes work BUILT_SOURCES = soelim SUBDIRS = man1 man3 man7 man8 EXTRA_DIST = man1/qalter.1.in man1/qdel.1.in man1/qhold.1.in man1/qmove.1.in \ man1/qmsg.1.in man1/qorder.1.in man1/qrerun.1.in man1/qrls.1.in \ man1/qselect.1.in man1/qsig.1.in man1/qstat.1.in man1/qsub.1.in \ man1/pbs.1.in man1/pbsdsh.1.in man1/nqs2pbs.1.in man1/basl2c.1.in \ man1/xpbs.1.in man1/xpbsmon.1.in man1/qmgr.1.in man1/qchkpt.1.in \ \ man3/pbs_alterjob.3.in man3/pbs_checkpointjob.3.in \ man3/pbs_connect.3.in \ man3/pbs_default.3.in man3/pbs_deljob.3.in man3/pbs_disconnect.3.in \ man3/pbs_fbserver.3.in man3/pbs_geterrmsg.3.in \ man3/pbs_get_server_list.3.in man3/pbs_holdjob.3.in \ man3/pbs_locate.3.in man3/pbs_manager.3.in \ man3/pbs_movejob.3.in man3/pbs_msgjob.3.in man3/pbs_orderjob.3.in \ man3/pbs_rerunjob.3.in man3/pbs_rescquery.3.in \ man3/pbs_rescreserve.3.in man3/pbs_rlsjob.3.in man3/pbs_runjob.3.in \ man3/pbs_selectjob.3.in man3/pbs_selstat.3.in man3/pbs_sigjob.3.in \ man3/pbs_stagein.3.in man3/pbs_statjob.3.in man3/pbs_statnode.3.in \ man3/pbs_statque.3.in man3/pbs_statserver.3.in man3/pbs_submit.3.in \ man3/pbs_terminate.3.in \ \ man7/pbs_job_attributes.7.in man7/pbs_queue_attributes.7.in \ man7/pbs_server_attributes.7.in \ man7/pbs_resources_aix4.7.in man7/pbs_resources_digitalunix.7.in \ man7/pbs_resources_aix5.7.in man7/pbs_resources_darwin.7.in \ man7/pbs_resources_freebsd.7.in man7/pbs_resources_freebsd5.7.in \ man7/pbs_resources_fujitsu.7.in \ man7/pbs_resources_hpux10.7.in man7/pbs_resources_irix5.7.in \ man7/pbs_resources_hpux11.7.in \ man7/pbs_resources_irix6.7.in man7/pbs_resources_irix6array.7.in \ man7/pbs_resources_linux.7.in man7/pbs_resources_netbsd.7.in \ man7/pbs_resources_solaris5.7.in man7/pbs_resources_solaris7.7.in \ man7/pbs_resources_sp2.7.in man7/pbs_resources_sunos4.7.in \ man7/pbs_resources_unicos8.7.in man7/pbs_resources_unicosmk2.7.in \ \ man8/pbs_mom.8.in man8/pbsnodes.8.in \ man8/pbs_sched_basl.8.in man8/pbs_sched_cc.8.in \ man8/pbs_sched_tcl.8.in man8/pbs_server.8.in \ man8/qdisable.8.in man8/qenable.8.in \ man8/qrun.8.in man8/qstart.8.in man8/qstop.8.in \ man8/qterm.8.in \ \ READ_ME admin_guide.ps v2_2_ers.pdf v2_2_ids.pdf doc_fonts \ ers/ers.macros ers/ers_setup.ms ers/pbs_resources_all.so \ man1/Makefile.am man1/Makefile.in \ man3/Makefile.am man3/Makefile.in \ man8/Makefile.am man8/Makefile.in nodist_man1_MANS = man1/qalter.1 man1/qdel.1 man1/qhold.1 man1/qmove.1 \ man1/qmsg.1 man1/qorder.1 man1/qrerun.1 man1/qrls.1 \ man1/qselect.1 man1/qsig.1 man1/qstat.1 man1/qsub.1 \ man1/pbs.1 man1/pbsdsh.1 man1/nqs2pbs.1 man1/basl2c.1 \ man1/xpbs.1 man1/xpbsmon.1 man1/qmgr.1 man1/qchkpt.1 nodist_man3_MANS = man3/pbs_alterjob.3 man3/pbs_checkpointjob.3 \ man3/pbs_connect.3 \ man3/pbs_default.3 man3/pbs_deljob.3 man3/pbs_disconnect.3 \ man3/pbs_fbserver.3 man3/pbs_geterrmsg.3 man3/pbs_get_server_list.3 \ man3/pbs_holdjob.3 man3/pbs_locate.3 \ man3/pbs_manager.3 man3/pbs_movejob.3 man3/pbs_msgjob.3 \ man3/pbs_orderjob.3 man3/pbs_rerunjob.3 \ man3/pbs_rescquery.3 man3/pbs_rescreserve.3 \ man3/pbs_rlsjob.3 man3/pbs_runjob.3 man3/pbs_selectjob.3 \ man3/pbs_selstat.3 man3/pbs_sigjob.3 man3/pbs_stagein.3 \ man3/pbs_statjob.3 man3/pbs_statnode.3 man3/pbs_statque.3 \ man3/pbs_statserver.3 man3/pbs_submit.3 man3/pbs_terminate.3 dist_man3_MANS = man3/rpp.3 man3/tm.3 nodist_man7_MANS = man7/pbs_job_attributes.7 man7/pbs_queue_attributes.7 \ man7/pbs_server_attributes.7 \ man7/pbs_resources_aix4.7 man7/pbs_resources_digitalunix.7 \ man7/pbs_resources_aix5.7 man7/pbs_resources_darwin.7 \ man7/pbs_resources_freebsd.7 man7/pbs_resources_fujitsu.7 \ man7/pbs_resources_hpux10.7 man7/pbs_resources_irix5.7 \ man7/pbs_resources_hpux11.7 \ man7/pbs_resources_irix6.7 man7/pbs_resources_irix6array.7 \ man7/pbs_resources_linux.7 man7/pbs_resources_netbsd.7 \ man7/pbs_resources_solaris5.7 man7/pbs_resources_solaris7.7 \ man7/pbs_resources_sp2.7 man7/pbs_resources_sunos4.7 \ man7/pbs_resources_unicos8.7 man7/pbs_resources_unicosmk2.7 nodist_man8_MANS = man8/pbs_mom.8 man8/pbsnodes.8 \ man8/pbs_sched_basl.8 man8/pbs_sched_cc.8 \ man8/pbs_sched_tcl.8 man8/pbs_server.8 \ man8/qdisable.8 man8/qenable.8 \ man8/qrun.8 man8/qstart.8 man8/qstop.8 \ man8/qterm.8 CLEANFILES = $(nodist_man1_MANS) $(nodist_man3_MANS) $(nodist_man7_MANS) \ $(nodist_man8_MANS) MOSTLYCLEANFILES = SUFFIXES = .1.in .3.in .7.in .8.in .1 .3 .7 .8 .so .1.in.1: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ .3.in.3: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ .7.in.7: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ .8.in.8: soelim @echo "Creating $@" @./soelim -d $(srcdir)/ers $< > $@ install_doc: install install-data-hook: rm -f $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 \ $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 @case $(PBS_MACH) in \ unknown) : ;; \ *) echo $(LN_S) $(program_prefix)pbs_resources_$(PBS_MACH)$(program_suffix).7 $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 ; \ $(LN_S) $(program_prefix)pbs_resources_$(PBS_MACH)$(program_suffix).7 $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 ;; \ esac @case $(SCHD_TYPE) in \ cc|tcl|basl) echo $(LN_S) $(program_prefix)pbs_sched_$(SCHD_TYPE)$(program_suffix).8 $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 ; \ $(LN_S) $(program_prefix)pbs_sched_$(SCHD_TYPE)$(program_suffix).8 $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 ;; \ none) : ;; \ *) echo "Unknown scheduler type"; exit 1 ;; \ esac uninstall-hook: rm -f $(DESTDIR)$(man7dir)/$(program_prefix)pbs_resources$(program_suffix).7 $(DESTDIR)$(man8dir)/$(program_prefix)pbs_sched$(program_suffix).8 torque-2.4.16/doc/man1/0000777000113300011330000000000011614035206011515 500000000000000torque-2.4.16/doc/man1/qdel.1.in0000664000113300011330000001564011272401251013052 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qdel 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qdel \- delete pbs batch job .SH SYNOPSIS qdel [\-c] [\-m message] [\-p] [\-W delay] job_identifier ... .SH DESCRIPTION The .B qdel command deletes jobs in the order in which their job identifiers are presented to the command. A job is deleted by sending a .I "Delete Job" batch request to the batch server that owns the job. A job that has been deleted is no longer subject to management by batch services. .LP A batch job may be deleted by its owner, the batch operator, or the batch administrator. .LP A batch job being deleted by a server will be sent a .B SIGTERM signal following by a .B SIGKILL signal. The time delay between the two signals is an attribute of the execution queue from which the job was run (settable by the administrator). This delay may be overridden by the .Ar \-W option. .LP See the PBS ERS section 3.1.3.3, "Delete Job Request", for more information. .SH OPTIONS .IP "\-W delay" 15 Specify the delay between the sending of the SIGTERM and SIGKILL signals. The argument .Ar delay specifies a unsigned integer number of seconds. .if !\n(Pb .ig Ig .SM This option is an extension to POSIX 1003.2d. .NL .Ig .IP "\-c" 15 Clean up unreported jobs from the server. This should only be used if the scheduler is unable to purge unreported jobs. This option is only available to a batch operator or the batch administrator. .NL .IP "\-p" 15 Forcibly purge the job from the server. This should only be used if a running job will not exit because its allocated nodes are unreachable. The admin should make every attempt at resolving the problem on the nodes. If a job's mother superior recovers after purging the job, any epilogue scripts may still run. This option is only available to a batch operator or the batch administrator. .NL .IP "\-m message" 15 Specify a comment to be included in the email. The argument .Ar message specifies the comment to send. This option is only available to a batch operator or the batch administrator. .LP .SH OPERANDS The qdel command accepts one or more .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br \ \ \ \ \ \ or .br .Ty "\ \ \ \ 'all'" .br .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR The qdel command will write a diagnostic messages to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qdel command, the exit status will be a value of zero. .LP If the qdel command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), qsig(1B), and pbs_deljob(3B) \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/qmove.1.in0000664000113300011330000001420511272401251013250 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qmove 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qmove \- move pbs batch job .SH SYNOPSIS qmove destination job_identifier ... .SH DESCRIPTION To move a job is to remove the job from the queue in which it resides and instantiate the job in another queue. The .B qmove command issues a .I "Move Job" batch request to the batch server that currently owns each job specified by .Ar job_identifier . .LP A job in the .B Running , .B Transiting , or .B Exiting state cannot be moved. .SH OPERANDS The first operand is the new .Ar destination for the jobs. It will be accepted in the syntax: .br .Ty "\ \ \ \ queue" .br .Ty "\ \ \ \ @server" .br .Ty "\ \ \ \ queue@server" .br See the PBS ERS section \*(Di, "Destination Identifiers". .LP If the .Ar destination operand describes only a queue, then qmove will move jobs into the queue of the specified name at the job's current server. .LP If the .Ar destination operand describes only a batch server, then qmove will move jobs into the default queue at that batch server. .LP If the .Ar destination operand describes both a queue and a batch server, then qmove will move the jobs into the specified queue at the specified server. .LP All following operands are .Ar job_identifiers which specify the jobs to be moved to the new .Ar destination . The qmove command accepts one or more .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR The qmove command will write a diagnostic messages to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qmove command, the exit status will be a value of zero. .LP If the qmove command fails to process any operand, the command exits with a value greater than zero. \" turn off any extra indent left by the Sh macro .SH SEE ALSO qsub(1B), pbs_movejob(3B) .RE torque-2.4.16/doc/man1/qrerun.1.in0000664000113300011330000001375611272401251013447 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qrerun 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qrerun \- rerun a pbs batch job .SH SYNOPSIS qrerun [\-f] job_identifier ... .SH DESCRIPTION The .B qrerun command directs that the specified jobs are to be rerun if possible. .LP To rerun a job is to terminate the session leader of the job and return the job to the queued state in the execution queue in which the job currently resides. .LP .if !\n(Pb .ig Ig The qrerun command sends a .I "Rerun Job" batch request to the server which owns the job. .Ig .LP If a job is marked as not rerunable then the rerun request will fail for that job. If the mini-server running the job is down, or the rejects the request, the .I "Rerun Job" batch request will return a failure unless \-f is used. .LP Using \-f violates IEEE Batch Processing Services Std and should be handled with great care. It should only be used under exceptional circumstances. Best practice is to fix the problem mini-server host and letting qrerun run normally. The previous nodes may need manual cleaning. See the .if !\n(Pb .ig Ig .At Rerunable attribute and the .Ig .Ar \-r option on the .B qsub and .B qalter commands. .SH OPERANDS The qrerun command accepts one or more .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR The qrerun command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qrerun command, the exit status will be a value of zero. .LP If the qrerun command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), qalter(1B), pbs_alterjob(3B), pbs_rerunjob(3B) .RE torque-2.4.16/doc/man1/qchkpt.1.in0000664000113300011330000000245511272401251013417 00000000000000.\" Copyright (c) 2008 Cluster Resources .\" All rights reserved. .if \n(Pb .ig Iq .TH qchkpt 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qchkpt - checkpoint pbs batch jobs .SH SYNOPSIS qchkpt job_identifier ... .SH DESCRIPTION The .B qchkpt command requests that the PBS Mom generate a checkpoint file for a running job. .LP .SM This is an extension to POSIX.2d. .NL .Ig .LP The qchkpt command sends a .I "Chkpt Job" batch request to the server as described in the general section. .SH OPTIONS None .LP .SH OPERANDS The qchkpt command accepts one or more .Ar job_identifier operands of the form: .DS .Ty sequence_number[.server_name][@server] .DE .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .LP .SH STANDARD ERROR The qchkpt command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qchkpt command, the exit status will be a value of zero. .LP If the qchkpt command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qhold(1B), qrls(1B), qalter(1B), qsub(1B), pbs_alterjob(3B), pbs_holdjob(3B), pbs_rlsjob(3B), pbs_job_attributes(7B), pbs_resources_unicos8(7B) \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/pbs.1.in0000664000113300011330000002015111272401251012702 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH pbs 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbs \- general information on pbs .SH DESCRIPTION PBS stands for .I "Portable Batch System." It is a networked subsystem for submitting, monitoring, and controlling a work load of batch jobs on one or more systems. More information about PBS is available in the PBS Users Guide. .LP .I Batch means that the job will be scheduled for execution at a time chosen by the subsystem according to a defined policy and the availability of resources. For a normal batch job, the standard output and standard error of the job will be returned to files available to the user when the job is complete. This differs from an interactive session where commands are executed when entered via the terminal and output is returned directly to the terminal. PBS also supports an .I "interactive batch" mode where the input and output is connected to the user's terminal, but the scheduling of the job is still under control of the batch system. .LP A .I job is typically a shell script and a set of attributes which provide resource and control information about the job. A job does not have to be submitted on the system where it will run, tt can be submitted on any system with the PBS commands and access to the execution system, see .I qsub(1B). Output will be returned to the system from which the job was submitted unless directed otherwise. .LP Attributes offer control over when a job is eligible to be run, what happens to the output when it is completed and how the user is notified when it completes. The attributes of the job may be specified on the command line or in the job script when the job is submitted. For information about job attributes, see qsub(1B) and .I pbs_job_attributes(7B). .LP One important attribute is the .I "resource list." The list specifies the amount and type of resources needed by the job in order to execute. The list also implies a hard upper limit on usage of those resources. When the limit is reached, the job is terminated. The types of resources available to a job vary with the system architecture. For a list of resources supported on the default system, see .I pbs_resources(7B). There are man pages for other systems types as well, see .I pbs_resources_aix4(7B), .I pbs_resources_fujitsu(7B), .I pbs_resources_irix5(7B), .I pbs_resources_solaris5(7B), .I pbs_resources_sp2(7B), .I pbs_resources_sunos4(7B), or .I pbs_resources_unicos8(7B). .LP Once a job has been submitted, it may be monitored by use of the .I qstat(1B) command. Two forms of output are available with the qstat command. The default form is the short display. Information about a job is limited to a single line. Complete information about the job or jobs is available through qstat with the \-f option. Information will be given about all jobs in the system, all jobs in specified queues, or only specified jobs. .LP When displaying status of jobs, you will see in which queue the job resides. In PBS a queue is just a collection point for jobs, it does not imply any execution ordering. That ordering is determined by a scheduling policy implemented by the system administration. .LP Other commands of interest which have man pages of their own are: .IP qalter 8 Alter a job's attributes. .IP qdel Delete a job. .IP qhold Place a hold on a job to keep it from being scheduled for running. .IP qmove Move a job to a different queue or server. .IP qmsg Append a message to the output of an executing job. .IP qrerun Terminate an executing job and return it to a queue. .IP qrls Remove a hold from a job. .IP qselect Obtain a list of jobs that met certain criteria. .IP qsig Send a signal to an executing job. .LP .SH SEE ALSO qalter(1B), qdel(1B), qhold(1B), qmove(1B), qmsg(1B), qrerun(1B), qrls(1B), qselect(1B), qsig(1B), qsub(1B) and the PBS User Guide. Starting with qsub(1B), you can find all other available PBS man pages by following references in the "See Also" section. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/qhold.1.in0000664000113300011330000001612611272401251013234 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qhold 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qhold \- hold pbs batch jobs .SH SYNOPSIS qhold [\-h hold_list] job_identifier ... .SH DESCRIPTION The .B qhold command requests that a server place one or more holds on a job. A job that has a hold is not eligible for execution. There are three supported holds: .Av USER , .Av OTHER (also known as operator), and .Av SYSTEM . .LP A user may place a .Av USER hold upon any job the user owns. An "operator", who is a user with "operator privilege," may place ether an .Av USER or an .Av OTHER hold on any job. The batch administrator may place any hold on any job. .LP If no .Ar "\-h" option is given, the USER hold will be applied to the jobs described by the .Ar job_identifier operand list. .LP If the job identified by .Ar job_identifier is in the .BR queued , .BR held , or .B waiting states, then all that occurs is that the hold type is added to the job. The job is then placed into .B held state if it resides in an execution queue. .LP If the job is in .B running state, then the following additional action is taken to interrupt the execution of the job. .if !\n(Pb .ig Ig .SM This is an extension to POSIX.2d. .NL .Ig If checkpoint / restart is supported by the host system, requesting a hold on a running job will (1) cause the job to be checkpointed, (2) the resources assigned to the job will be released, and (3) the job is placed in the .B held state in the execution queue. .LP If checkpoint / restart is not supported, qhold will only set the the requested hold attribute. This will have no effect unless the job is rerun with the .B qrerun command. .LP The qhold command sends a .I "Hold Job" batch request to the server as described in the general section. .SH OPTIONS .IP "\-h hold_list" 15 Defines the types of holds to be placed on the job. .IP The .Ar hold_list argument is a string consisting of one or more of the letters "\fBu\fP", "\fBo\fP", or "\fBs\fP" in any combination. The hold type associated with each letter is: .RS .IP "u \- " 4 .Av USER .IP "o \- " 4 .Av OTHER .IP "s \- " 4 .Av SYSTEM .RE .if !\n(Pb .ig Ig .IP Repetition of characters is permitted. .Ig .LP .SH OPERANDS The qhold command accepts one or more .Ar job_identifier operands of the form: .DS .Ty sequence_number[.server_name][@server] .DE .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .LP .SH STANDARD ERROR The qhold command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qhold command, the exit status will be a value of zero. .LP If the qhold command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qrls(1B), qalter(1B), qsub(1B), pbs_alterjob(3B), pbs_holdjob(3B), pbs_rlsjob(3B), pbs_job_attributes(7B), pbs_resources_unicos8(7B) \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/xpbs.1.in0000664000113300011330000007177211272401251013111 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH xpbs 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME xpbs \- GUI front end to PBS commands .SH SYNOPSIS xpbs [\-admin] .SH DESCRIPTION The \fBxpbs\fP command provides a user-friendly point-and-click interface to PBS commands. Please see the sections below for a tour and tutorials. Also, within every dialog box, a \fBHelp\fP button can be found for assistance. .SH OPTIONS .IP "\-admin" 8 A mode where additional buttons are made available for terminating PBS servers, starting/stopping/disabling/enabling queues, and running/rerunning jobs. .in 0 .LP .SH GETTING STARTED Running \fBxpbs\fP will initialize the X resource database from various sources in the following order: .IP "1." The \fBRESOURCE_MANAGER\fP property on the root window (updated via xrdb) with settings usually defined in the .Xdefaults file .IP "2." Preference settings defined by the system administrator in the global xpbsrc file .IP "3." User's ~/.xpbsrc file \- this file defines various X resources like fonts, colors, list of PBS hosts to query, criteria for listing queues and jobs, and various view states. See PREFERENCES section below for a list of resources that can be set. .SH RUNNING XPBS .LP To run \fBxpbs\fP as a regular, non-privileged user, type: .RS .sp .Ty "\ \ \ setenv DISPLAY :0" .br .Ty "\ \ \ xpbs" .sp .RE To run \fBxpbs\fP with the additional purpose of terminating PBS servers, stopping and starting queues, or running/rerunning jobs, then run: .RS .sp .Ty "\ \ \ xpbs \-admin" .sp .RE NOTE: Be sure to appropriately set ~/.rhosts file if you're planning to submit jobs to some remote server, and expecting output files to be returned to the local host (where xpbs was run). Usually, adding the PBS hostname running the server to your .rhosts file locally, and adding the name of the local machine to the .rhosts file at remote host, should be sufficient. .sp Also, be sure that the PBS client commands are in the default PATH because \fBxpbs\fP will call these commands. .SH THE XPBS DISPLAY This section describes the main parts of the \fBxpbs\fP display. The main window is composed of 5 distinct areas (subwindows) arranged vertically (one on top of another) in the following order: .RS \ \ \ 1) Menu .br \ \ \ 2) Hosts .br \ \ \ 3) Queues .br \ \ \ 4) Jobs .br \ \ \ 5) Info .br .RE .LP \fBMenu\fP. The Menu area is composed of a row of command buttons that signal some action with a click of the left mouse button. The buttons are: .RS .IP "Manual Update" 23 to update the information on hosts, queues, and jobs. .IP "Auto Update" 23 same as .Ar "Manual Update" except updating is done automatically every number of minutes. .IP "Track Job" 23 for periodically checking for returned output files of jobs. .IP "Preferences" 23 for setting certain parameters such as the list of server host(s) to query. .IP "Help" 23 contains some help information. .IP "About" 23 tells of the author and who to send comments, bugs, suggestions to. .IP "Close" 23 for exiting \fBxpbs\fP plus saving the current setup information (if anything had changed) in the user's $HOME/.xpbsrc file. Information saved include the selected host(s), queue(s), job(s), the different jobs listing criteria, the view states (i.e. minimized/maximized) of the Hosts, Queues, Jobs, and INFO regions, and anything in the Preferences section. .RE .LP \fBHosts\fP. The Hosts area is composed of a leading horizontal HOSTS bar, a listbox, and a set of command buttons. The HOSTS bar contains a minimize/maximize button, identified by a dot or a rectangular image, for displaying or iconizing the Hosts region. The listbox displays information about favorite server host(s), and each entry is meant to be selected via a single left mouse button click, shift key + mouse button 1 click for contiguous selection, or cntrl key + mouse button 1 click for non-contiguous selection. The command buttons represent actions on selected host(s), and commonly found buttons are: .RS .IP detail 11 for obtaining detailed information about selected server host(s). This functionality can also be achieved by double clicking on an entry in the Hosts listbox. .IP "Submit" 11 for submitting a job to any of the queues managed by the selected host(s). .IP terminate 11 for terminating PBS servers on selected host(s). (\-admin only) .RE .LP The server hosts can be chosen by specifying in the ~/.xpbsrc file (or .Xdefaults) the resource: .RS .sp *serverHosts: hostname1 hostname2 ... .sp .RE Another way of specifying the host is to click on the Preferences button in the Menu region, and manipulate the server Hosts entry widget from the preferences dialog box. .sp .LP \fBQueues\fP. The Queues area is composed of a leading horizontal QUEUES bar, a listbox, and a set of command buttons. The QUEUES bar lists the hosts that are consulted when listing queues; the bar also contains a minimize/maximize button for displaying or iconizing the Queues region. The listbox displays information about queues managed by the server host(s) selected from the Hosts listbox; each listbox entry is meant to be selected (highlighted) via a single left mouse button click, shift key + mouse button 1 click for contiguous selection, or cntrl key + mouse button 1 click for non-contiguous selection. The command buttons represent actions for operating on selected queue(s), and commonly found buttons are: .RS .IP detail 9 for obtaining detailed information about selected queue(s). This functionality can also be achieved by double clicking on a Queues listbox entry. .IP stop 9 for stopping the selected queue(s). (\-admin only) .IP start 9 for starting the selected queue(s). (\-admin only) .IP disable 9 for disabling the selected queue(s). (\-admin only) .IP enable 9 for enabling the selected queue(s). (\-admin only) .RE .sp .LP \fBJobs\fP. The Jobs area is composed of a leading horizontal JOBS bar, a listbox, and a set of command buttons. The JOBS bar lists the queues that are consulted when listing jobs; the bar also contains a minimize/maximize button for displaying or iconizing the Jobs region. The listbox displays information about jobs that are found in the queue(s) selected from the Queues listbox; each listbox entry is meant to be selected (highlighted) via a single left mouse button click, shift key + mouse button 1 click for contiguous selection, or cntrl key + mouse button 1 click for non-contiguous selection. The region just above the Jobs listbox shows a collection of command buttons whose labels describe criteria used for filtering the Jobs listbox contents. The list of jobs can be selected according to the owner of jobs (Owners), job state (Job_States), name of the job (Job_Name), type of hold placed on the job (Hold_Types), the account name associated with the job (Account_Name), checkpoint attribute (Checkpoint), time the job is eligible for queueing/execution (Queue_Time), resources requested by the job (Resources), priority attached to the job (Priority), and whether or not the job is rerunnable (Rerunnable). The selection criteria can be modified by clicking on any of the appropriate command buttons to bring up a selection box. The criteria command buttons are accompanied by a .Ar "Select Jobs" button, which when clicked, will update the contents of the Jobs listbox based on the new selection criteria. Please see \fBqselect(1B)\fP for more details on how the jobs are filtered. .sp Finally, to the right of the listbox, the Jobs region is accompanied by the following command buttons, for operating on selected job(s): .RS .IP detail 9 for obtaining detailed information about selected job(s). This functionality can also be achieved by double clicking on a Jobs listbox entry. .IP modify 9 for modifying attributes of the selected job(s). .IP delete 9 for deleting the selected job(s). .IP hold 9 for placing some type of hold on selected job(s). .IP release 9 for releasing held job(s). .IP signal 9 for sending signals to selected job(s) that are running. .IP msg 9 for writing a message string into the output streams of the selected job(s). .IP move 9 for moving selected job(s) into some specified destination queue. .IP order 9 for exchanging order of two selected jobs in a queue. .IP run 9 for running selected job(s). (\-admin only) .IP rerun 9 for requeueing selected job(s) that are running. (\-admin only) .RE .sp .LP \fBInfo\fP. The Info Area shows the progress of the commands' executed by \fBxpbs\fP. Look into this box for errors. The INFO bar also contains a minimize/maximize button for displaying or iconizing the Info region. .RE .SH WIDGETS USED IN XPBS Some of the widgets used in \fBxpbs\fP and how they are manipulated are described in the following: .sp .IP "1." 3 \fBlistbox\fP \- can be multi-selectable (a number of entries can be selected/highlighted using a mouse click) or single-selectable (one entry can be highlighted at a time). For a multi-selectable listbox, the following operations are allowed: .RS .IP "a." 3 single click with mouse button 1 to select/highlight an entry. .IP "b." 3 shift key + mouse button 1 to contiguously select more than one entry. .IP "c." 3 cntrl key + mouse button 1 to non-contiguously select more than one entry. NOTE: For systems running Tk < 4.0, the newly selected item is reshuffled to appear next to already selected items. .IP "d." 3 click the .Ar "Select All/Deselect All" button to select all entries or deselect all entries at once. .IP "e." 3 double clicking an entry usually activates some action that uses the selected entry as a parameter. .sp .RE .IP "2." 3 \fBscrollbar\fP \- usually appears either vertically or horizontally and contains 5 distinct areas that are mouse clicked to achieve different effects: .RS .IP "top arrow" 14 Causes the view in the associated widget to shift up by one unit (i.e. the object appears to move down one unit in its window). If the button is held down the action will auto-repeat. .IP "top gap" 14 Causes the view in the associated window to shift up by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very top of the window will now appear at the very bottom). If the button is held down the action will auto-repeat. .IP "slider" 14 Pressing button 1 in this area has no immediate effect except to cause the slider to appear sunken rather than raised. However, if the mouse is moved with the button down then the slider will be dragged, adjusting the view as the mouse is moved. .IP "bottom gap" 14 Causes the view in the associated window to shift down by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very bottom of the window will now appear at the very top). If the button is held down the action will auto-repeat. .IP "bottom arrow" 14 Causes the view in the associated window to shift down by one unit (i.e. the object appears to move up one unit in its window). If the button is held down the action will auto-repeat. .RE .sp .IP "3." 3 \fBentry\fP \- brought into focus with a click of the left mouse button. To manipulate this widget, simply type in the text value. Use of arrow keys, mouse selection of text for deletion or overwrite, copying and pasting with sole use of mouse buttons are permitted. This widget is usually accompanied by a scrollbar for horizontally scanning a long text entry string. .sp .IP "4." 3 \fBmatrix of entry boxes\fP \- usually shown as several rows of entry widgets where a number of entries (called fields) can be found per row. The matrix is accompanied by up/down arrow buttons for paging through the rows of data, and each group of fields gets one scrollbar for horizontally scanning long entry strings. Moving from field to field can be done using the , , or (move backwards) keys. .sp .IP "5." 3 \fBspinbox\fP \- a combination of an entry widget and a horizontal scrollbar. The entry widget will only accept values that fall within a defined list of valid values, and incrementing through the valid values is done by clicking on the up/down arrows. .IP "6." 3 \fBbutton\fP \- a rectangular region appearing either raised or pressed that invokes an action when clicked with the left mouse button. When the button appears pressed, then hitting the key will automatically select the button. .IP "7." 3 \fBtext\fP \- an editor like widget. This widget is brought into focus with a click of the left mouse button. To manipulate this widget, simply type in the text. Use of arrow keys, backspace/delete key, mouse selection of text for deletion or overwrite, copying and pasting with sole use of mouse buttons are permitted. This widget is usually accompanied by a scrollbar for vertically scanning a long entry. .SH SUBMITTING JOBS Submitting a PBS job requires only to manipulate the widgets found in the Submit window. The submit dialog box is composed of 4 distinct regions: .sp \ \ \ 1) Job Script .br \ \ \ 2) OPTIONS .br \ \ \ 3) OTHER OPTIONS .br \ \ \ 4) Command Buttons .sp The Job Script file region is at the upper left, the OPTIONS region containing various widgets for setting job attributes is scattered all over the dialog box, the OTHER OPTIONS is located just below the Job Script file region, and Command Buttons region is at the bottom. .sp The job script region is composed of a header box, the text box, FILE entry box, and a couple of buttons labeled .Ar load and .Ar save. If you have a script file containing PBS options and executable lines, then type the name of the file on the FILE entry box, and then click on the .Ar load button. The various widgets in the Submit window will get loaded with values found in the script file. The script file text box will only be loaded with executable lines (non-PBS) found in the script. The job script header box has a .Ar Prefix entry box that can be modified to specify the PBS directive to look for when parsing a script file for PBS options. If you don't have a script file, you can start typing the executable lines of the job in the file text box. .sp To submit a job, perform the following steps: .RS .IP "1." 3 Select a host from the HOSTS listbox in the main \fBxpbs\fP display. .IP "2." 3 Click on the .Ar Submit button located in the Menu bar. .IP "3." 3 Specify the script file containing the job execution lines and job property values, or simply type in the execution lines in the FILE textbox. .IP "4." 3 Start manipulating the various widgets in the Submit window. Particularly, pay close attention to the Destination listbox. This box lists all the queues found in the host that you selected. A special entry called .Ty """@host""" refers to the default queue at host. Select appropriately the destination queue of the job. More options can be found by clicking the OTHER OPTIONS buttons. .IP "5." 3 At the bottom of the Submit window, click .Ar "confirm submit". You can also click on .Ar "interactive" to run the job interactively. Running a job interactively will open an xterm window to your display host containing the session. .sp NOTE: The script FILE entry box is accompanied by a .Ar save button that you click to save the current widget values to the specified file in a form that can later be read by \fBxpbs\fP or by the \fBqsub\fP command. .RE .SH MODIFYING ATTRIBUTES OF JOBS Modifying a PBS job requires only to manipulate the widgets found in the Modify window. To modify a job or jobs, do the following steps: .RS .IP "1." 3 Select one or more jobs from the JOBS listbox in the main \fBxpbs\fP display. .IP "2." 3 Click on the .Ar modify button located to the right of the listbox. .IP "3." 3 The Modify window is structured similarly to the Submit window. Simply manipulate the widgets to specify replacement or additional values of job attributes. .IP "4." 3 Click on the .Ar "confirm modify" button located at the bottom of the dialog box. .RE .SH DELETING JOBS Deleting a PBS job requires only to manipulate the widgets found in the Delete window. To delete a job or jobs, do the following steps: .RS .IP "1." 3 Select one or more jobs from the JOBS listbox in the main \fBxpbs\fP display. .IP "2." 3 Click on the .Ar delete button located to the right of the listbox. .IP "3." 3 Manipulate the spinbox widget to set the kill delay signal interval. .IP "4." 3 Click on the .Ar delete button located at the bottom of the dialog box. .RE .SH TRACKING RETURNED OUTPUT FILES If you want to be informed of returned output files of current jobs, and be able to quickly see the contents of those files, then enable the .Ty """track job""" feature as follows: .RS .IP "1." Submit all the jobs that you want monitored. .IP "2." Click on the .Ar "Track Job" button located in the Menu bar to bring up the Track Job dialog box. .IP "3." Specify the list of user names, whose jobs are to be monitored for returned output files, in the matrix located at the upper left of the dialog box. .IP "4." Manipulate the minutes spinbox, located just below the user names matrix, to specify the interval value when output files will be periodically checked. .IP "5." Specify the location of job output files (whether locally or remotely) by clicking on one of the radio buttons located at the upper right of the dialog box. Returned locally means the output files will be returned back to the host where \fBxpbs\fP was run. If the output files are returned to some remote host, then \fBxpbs\fP will execute an .br .Ty "\ \ \ RSH test \-f " .br to test the existence of the files. RSH is whatever you set the remote shell command to in the corresponding entry box. .sp NOTE: Be sure the files are accessible from the host where \fBxpbs\fP was run (i.e. .rhosts appropriately set). .IP "6." Click .Ar "start/reset tracking" button located at the bottom of the dialog box to: .RS .IP \- 2 cancel any previous tracking .IP \- 2 build a new list of jobs to be monitored for returned output files based on currently queued jobs. .IP \- 2 start periodic tracking. .RE .IP "7." Click on .Ar "close window" button. .RE .sp When an output file for a job being monitored is found, then the .Ar "Track Job" button (the one that originally invoked the Track Job dialog box) will turn into a different color, and the .Ar "Jobs Found Completed" listbox, located in the Track Job dialog box, is then loaded with the corresponding job id(s). Then double click on a job id to see the contents of the output file and the error file. Click .Ar "stop tracking" if you want to cancel tracking. .SH LEAVING XPBS Click on the Close button located in the Menu bar to leave \fBxpbs\fP. If anything had changed, it will bring up a dialog box asking for a confirmation in regards to saving state information like the view states (minimize/maximize) of the HOSTS, QUEUES, JOBS, and INFO subwindows, and various criteria for listing queues and jobs. The information is saved in ~/.xpbsrc file. .SH PREFERENCES The resources that can be set in the X resources file, ~/.xpbsrc, are: .IP *serverHosts list of server hosts (space separated) to query by \fBxpbs\fP. .IP *timeoutSecs specify the number of seconds before timing out waiting for a connection to a PBS host. .IP *xtermCmd the xterm command to run driving an interactive PBS session. .IP *labelFont font applied to text appearing in labels. .IP *fixlabelFont font applied to text that label fixed-width widgets such as listbox labels. This must be a fixed-width font. .IP *textFont font applied to a text widget. Keep this as fixed-width font. .IP *backgroundColor the color applied to background of frames, buttons, entries, scrollbar handles. .IP *foregroundColor the color applied to text in any context (under selection, insertion, etc...). .IP *activeColor the color applied to the background of a selection, a selected command button, or a selected scroll bar handle. .IP *disabledColor color applied to a disabled widget. .IP *signalColor color applied to buttons that signal something to the user about a change of state. For example, the color of the .Ar "Track Job" button when returned output files are detected. .IP *shadingColor a color shading applied to some of the frames to emphasize focus as well as decoration. .IP *selectorColor the color applied to the selector box of a radiobutton or checkbutton. .IP *selectHosts list of hosts (space separated) to automatically select/highlight in the HOSTS listbox. .IP *selectQueues list of queues (space separated) to automatically select/highlight in the QUEUES listbox. .IP *selectJobs list of jobs (space separated) to automatically select/highlight in the JOBS listbox. .IP *selectOwners list of owners checked when limiting the jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Owners: ". See \-u option in \fBqselect(1B)\fP for format of . .IP *selectStates list of job states to look for (do not space separate) when limiting the jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Job_States: ". See \-s option in \fBqselect(1B)\fP for format of . .IP *selectRes list of resource amounts (space separated) to consult when limiting the jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Resources: ". See \-l option in \fBqselect(1B)\fP for format of . .IP *selectExecTime the Execution Time attribute to consult when limiting the list of jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Queue_Time: ". See \-a option in \fBqselect(1B)\fP for format of . .IP *selectAcctName the name of the account that will be checked when limiting the jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Account_Name: ". See \-A option in \fBqselect(1B)\fP for format of . .IP *selectCheckpoint the checkpoint attribute relationship (including the logical operator) to consult when limiting the list of jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Checkpoint: ". See \-c option in \fBqselect(1B)\fP for format of . .IP *selectHold the hold types string to look for in a job when limiting the jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Hold_Types: ". See \-h option in \fBqselect(1B)\fP for format of . .IP *selectPriority the priority relationship (including the logical operator) to consult when limiting the list of jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Priority: ". See \-p option in \fBqselect(1B)\fP for format of . .IP *selectRerun the rerunnable attribute to consult when limiting the list of jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Rerunnable: ". See \-r option in \fBqselect(1B)\fP for format of . .IP *selectJobName name of the job that will be checked when limiting the jobs appearing on the Jobs listbox in the main \fBxpbs\fP window. Specify value as "Job_Name: ". See \-N option in \fBqselect(1B)\fP for format of . .IP *iconizeHostsView a boolean value (true or false) indicating whether or not to iconize the HOSTS region. .IP *iconizeQueuesView a boolean value (true or false) indicating whether or not to iconize the QUEUES region. .IP *iconizeJobsView a boolean value (true or false) indicating whether or not to iconize the JOBS region. .IP *iconizeInfoView a boolean value (true or false) indicating whether or not to iconize the INFO region. .IP *jobResourceList a curly-braced list of resource names as according to architecture known to xpbs. The format is as follows: .br { resname1 resname2 ... resnameN } .br { resname1 resname2 ... resnameN } .br . . . .br { resname1 resname2 ... resnameN } .LP .SH XPBS AND PBS COMMANDS \fBxpbs\fP calls PBS commands as follows: .IP "\fBCommand Button\fP" 22 \fBPBS Command\fP .IP "detail (Hosts)" 22 qstat \-B \-f .IP "terminate" 22 qterm .IP "detail (Queues)" 22 qstat \-Q \-f .IP "stop" 22 qstop .IP "start" 22 qstart .IP "enable" 22 qenable .IP "disable" 22 qdisable .IP "detail (Jobs)" 22 qstat \-f .IP "modify" 22 qalter .IP "delete" 22 qdel .IP "hold" 22 qhold .IP "release" 22 qrls .IP "run" 22 qrun .IP "rerun" 22 qrerun .IP "signal" 22 qsig .IP "msg" 22 qmsg .IP "move" 22 qmove .IP "order" 22 qorder .LP .SH EXIT STATUS Upon successful processing, the \fBxpbs\fP exit status will be a value of zero. .LP If the xpbs command fails, the command exits with a value greater than zero. .SH SEE ALSO qalter(1B), qdel(1B), qhold(1B), qmove(1B), qmsg(1B), qrerun(1B), qrls(1B), qselect(1B), qsig(1B), qstat(1B), qorder(1B), qsub(1B), qdisable(8B), qenable(8B), qrun(8B), qstart(8B), qstop(8B), qterm(8B). \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/Makefile.in0000664000113300011330000003265111605403717013515 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = doc/man1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man1/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man1/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all work is done in doc/ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/doc/man1/nqs2pbs.1.in0000664000113300011330000001407011272401251013511 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH nqs2pbs 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME nqs2pbs \- convert NQS job scripts to PBS .SH SYNOPSIS nqs2pbs nqs_script [\^pbs_script\^] .SH DESCRIPTION This utility converts a existing NQS job script to work with PBS and NQS. The existing script is copied and PBS directives, .I #PBS , are inserted prior to each NQS directive .I #QSUB or .I #@$ , in the original script. .LP Certain NQS date specification and options are not supported by PBS. A warning message will be displayed indicating the problem and the line of the script on which it occurred. .LP If any unrecognizable NQS directives are encountered, an error message is displayed. The new PBS script will be deleted if any errors occur. .SH OPERANDS .IP nqs_script Specifies the file name of the NQS script to convert. This file is not changed. .IP pbs_script If specified, it is the name of the new PBS script. If not specified, the new file name is .I nqs_script.new . .LP .SH NOTES Converting NQS date specifications to the PBS form may result in a warning message and an incompleted converted date. PBS does not support date specifications of "today", "tomorrow", or the name of the days of the week such as "Monday". If any of these are encountered in a script, the PBS specification will contain only the time portion of the NQS specification, i.e. #PBS \-a hhmm[.ss]. It is suggested that you specify the execution time on the qsub command line rather than in the script. .LP Note that PBS will interpret a time specification without a date in the following way: .IP \- 3 If the time specified has not yet been reached, the job will become eligible to run at that time today. .IP \- If the specified time has already passed when the job is submitted, the job will become eligible to run at that time tomorrow. .LP PBS does not support time zone identifiers. All times are taken as local time. .SH SEE ALSO qsub(1B) .RE torque-2.4.16/doc/man1/qrls.1.in0000664000113300011330000001507711272401251013112 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qrls 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qrls \- release hold on pbs batch jobs .SH SYNOPSIS qrls [\-h\ hold_list] job_identifier ... .SH DESCRIPTION The .B qrls command removes or releases holds which exist on batch jobs. .LP A job may have one or more types of holds which make the job ineligible for execution. The types of holds are .Av USER , .Av OTHER , and .Av SYSTEM . The different types of holds may require that the user issuing the qrls command have special privilege. Typically, the owner of the job will be able to remove a .Av USER hold, but not an .Av OTHER or .Av SYSTEM hold. An Attempt to release a hold for which the user does not have the correct privilege is an error and no holds will be released for that job. .LP If no .Ar \-h option is specified, the .Av USER hold will be released. .LP If the job has no .At execution_time pending, the job will change to the .B queued state. If an .At execution_time is still pending, the job will change to the .B waiting state. .if !\n(Pb .ig Ig .LP If the .At sched_hint attribute is set, when the job is returned to .B queued state, it may be given preference in selection for execution depending on site policy. .LP The qrls command sends a .I "Release Job" batch request to the server which owns the job. .Ig .SH OPTIONS .IP "\-h hold_list" 15 Defines the types of hold to be released from the jobs. The .Ar hold_list option argument is a string consisting of one or more of the letters "\fBu\fP", "\fBo\fP", an "\fBs\fP" in any combination. The hold type associated with each letter is: .RS .IP "u \- " 4 .Av USER .IP "o \- " 4 .Av OTHER .IP "s \- " 4 .Av SYSTEM .RE .if !\n(Pb .ig Ig .IP Repetition of characters is permitted. .Ig .LP .SH OPERANDS The qrls command accepts one or more .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR The qrls command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qrls command, the exit status will be a value of zero. .LP If the qrls command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), qalter(1B), qhold(1B), pbs_alterjob(3B), pbs_holdjob(3B), and pbs_rlsjob(3B). .RE torque-2.4.16/doc/man1/qselect.1.in0000664000113300011330000003716011272401251013566 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qselect 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qselect \- select pbs batch jobs .SH SYNOPSIS qselect [\-a [op]date_time] [\-A account_string] [\-e] [\-c [op]interval] [\-h hold_list] [\-l resource_list] [\-N name] [\-p [op]priority] [\-q destination] [\-r rerun] [\-s states] [\-u user_list] .SH DESCRIPTION The .B qselect command provides a method to list the job identifier of those jobs which meet a list of selection criteria. .if !\n(Pb .ig Ig The selection is accomplished by sending a .I "Select Jobs" batch request to the default server or the server specified by the .Ar \-q option. .Ig Jobs are selected from those owned by a single server. .LP When qselect successfully completes, it will have written to standard output a list of zero or more jobs which meet the criteria specified by the options. Each option acts as a filter restricting the number of jobs which might be listed. With no options, the qselect command will list all jobs at the server which the user is authorized to list (query status of). The \-u option may be used to limit the selection to jobs owned by this user or other specified users. .if !\n(Pb .ig Ig Operators and system administrators have the privilege to select all jobs. Other uses access depends on the setting of the server attribute .At query_other_jobs . .Ig .SH OPTIONS When an option is specified with a optional .Ar op component to the option argument, then .Ar op specifies a relation between the value of a certain job attribute and the value component of the option argument. If an .Ar op is allowable on an option, then the description of the option letter will indicate the .Ar op is allowable. The only acceptable strings for the .Ar op component, and the relation the string indicates, are shown in the following list: .RS 5 .IP .eq. 6 the value represented by the attribute of the job is equal to the value represented by the option argument. .IP .ne. 6 the value represented by the attribute of the job is not equal to the value represented by the option argument. .IP .ge. 6 the value represented by the attribute of the job is greater than or equal to the value represented by the option argument. .IP .gt. 6 the value represented by the attribute of the job is greater than the value represented by the option argument. .IP .le. 6 the value represented by the attribute of the job is less than or equal to the value represented by the option argument. .IP .lt. 6 the value represented by the attribute of the job is less than the value represented by the option argument. .RE .IP "\-a [op]\^date_time " 10 Restricts selection to a specific time, or a range of times. .IP The qselect command selects only jobs for which the value of the .At Execution_Time attribute is related to the .Ar date_time argument by the optional .Ar op operator. The .Ar date_time argument is in the form of the date_time operand of the \fBtouch\fP(1) command: .Ty "[[CC]YY]MMDDhhmm[.SS]" .br where the MM is the two digits for the month, DD is the day of the month, hh is the hour, mm is the minute, and the optional SS is the seconds. CC is the century and YY the year. .IP If .Ar op is not specified, jobs will be selected for which the .At Execution_Time and .Ar date_time values are equal. If .Ar op is specified, jobs will be selected according to the following definitions: .RS .IP .eq. .At Execution_Time attribute is equal to the .Ar date_time argument. .IP .ne. .At Execution_Time attribute is not equal to the .Ar date_time argument. .IP .ge. .At execution_Time attribute is greater than (after) or equal to the .Ar date_time argument. .IP .gt. .At Execution_Time attribute is greater than (after) the .Ar date_time argument. .IP .le. .At Execution_Time attribute is less than (before) or equal to the .Ar date_time argument. .IP .lt. .At Execution_Time attribute is less than (before) the .Ar date_time argument. .RE .IP "\-e" 10 Restricts selection to jobs in execution queues. .IP "\-A account_string" 10 Restricts selection to jobs whose .At Account_Name attribute matches the specified .Ar account_string . .IP "\-c [\^op\^]\^interval" 10 Restricts selection to jobs whose .At Checkpoint interval attribute matches the specified relationship. .IP The values of the .At Checkpoint attribute are defined to have the following ordered relationship: .br \ \ \ \ n\ >\ s\ >\ c=minutes\ >\ c\ >\ u .br If the optional .Ar op is not specified, jobs will be selected whose .At Checkpoint attribute is equal to the .Ar interval argument. If .Ar op is specified, jobs will be selected according to: .RS .IP .eq. .At Checkpoint attribute of the job is equal to the .Ar interval argument. .IP .ne. .At Checkpoint attribute of the job is not equal to the .Ar interval argument. .IP .ge. .At Checkpoint attribute of the job is greater than or equal to the .Ar interval argument. .IP .gt. .At Checkpoint attribute of the job is greater than the .Ar interval argument. .IP .le. .At Checkpoint attribute of the job is less than or equal to the .Ar interval argument. .IP .lt. .At Checkpoint attribute of the job is less than the .Ar interval argument. .RE .IP For an interval value of "u", only ".eq." and ".ne." are valid. .IP "\-h hold_list" 10 Restricts the selection of jobs to those with a specific set of hold types. Only those jobs will be selected whose .At Hold_Types attribute exactly match the value of the .Ar hold_list argument. .RS .LP The .Ar hold_list argument is a string consisting of one or more occurrences the single letter .Ty n , or one or more of the letters .Ty u , .Ty o , or .Ty s in any combination. If letters are duplicated, they are treated as if they occurred once. The letters represent the hold types: .nf \fBn\fP \- none \fBu\fP \- user \fBo\fP \- other \fBs\fP \- system .fi .RE .IP "\-l resource_list" 10 Restricts selection of jobs to those with specified resource amounts. .RS .LP Only those jobs will be selected whose .At Resource_List attribute matches the specified relation with each resource and value listed in the .Ar resource_list argument. The .Ar resource_list is in the following format: .br resource_name\fBop\fPvalue[,resource_name\fBop\fPval,...] .br The relation operator .Ar op must be present. .LP When comparing the values of resources, the following definitions for the operator apply: .IP .eq. the resource value in the .At Resource_List attribute of the job equals the value specified in .Ar resource_list . .IP .ne. the resource value in the .At Resource_List attribute of the job is not equal to the value specified in .Ar resource_list . .IP .ge. the resource value in the .At Resource_List attribute of the job is greater than or equal to the value specified in .Ar resource_list . .IP .gt. the resource value in the .At Resource_List attribute of the job is greater than the value specified in .Ar resource_list . .IP .le. the resource value in the .At Resource_List attribute of the job is less than or equal to the value specified in .Ar resource_list . .IP .lt. the resource value in the .At Resource_List attribute of the job is less than the value specified in .Ar resource_list . .RE .IP "\-N name" 10 Restricts selection of jobs to those with a specific name. .IP "\-p [op]priority" 10 Restricts selection of jobs to those with a priority that matches the specified relationship. If .Ar op is not specified, jobs are selected for which the job .At Priority attribute is equal to the .Ar priority .RS .LP If the .Ar op is specified, the relationship is defined as: .IP .eq. .At Priority attribute is equal to the value of the .Ar priority argument. .IP .ne. .At Priority attribute is not equal to the value of the .Ar priority argument. .IP .ge. .At Priority attribute is greater than or equal to the value of the .Ar priority argument. .IP .gt. .At Priority attribute is greater than the value of the .Ar priority argument. .IP .le. .At Priority attribute is less than or equal to the value of the .Ar priority argument. .IP .lt. .At Priority attribute is less than the value of the .Ar priority argument. .RE .IP "\-q destination" 10 Restricts selection to those jobs residing at the specified destination. .RS .LP The .Ar destination may be of one of the following three forms: .br .Ty "\ \ \ \ queue" .br .Ty "\ \ \ \ @server" .br .Ty "\ \ \ \ queue@server" .LP If the .Ar \-q option is not specified, jobs will be selected from the default server. .if !\n(Pb .ig Ig See the ERS section \*(Si for a definition of the default server. .Ig .LP If the .Ar destination describes only a queue, only jobs in that queue on the default batch server will be selected. .LP If the .Ar destination describes only a server, then jobs in all queues on that server will be selected. .LP If the .Ar destination describes both a queue and a server, then only jobs in the named queue on the named server will be selected. .RE .IP \-r\ rerun Restricts selection of jobs to those with the specified .At Rerunable attribute. The option argument must be a single character. The following two characters are supported by PBS: .Ty y and .Ty n . .IP "\-s states" 10 Restricts job selection to those in the specified states. .RS .LP The .Ar states argument is a character string which consists of any combination of the characters: .Ty E , .Ty H , .Ty Q , .Ty R , .Ty T , and .Ty W . .if !\n(Pb .ig Ig .SM This set of state letters does not conform to the POSIX 1003.2d standard. It requires the sames letters, but in lower case. .NL A repeated character will be accepted, but no additional meaning is assigned to it. .Ig .LP The characters in the .Ar states argument have the following interpretation: .IP \fBE\fP 5 the Exiting state. .IP \fBH\fP 5 the Held state. .IP \fBQ\fP 5 the Queued state. .IP \fBR\fP 5 the Running state. .IP \fBT\fP 5 the Transiting state. .IP \fBW\fP 5 the Waiting state. .LP Jobs will be selected which are in any of the specified states. .RE .IP "\-u user_list" 10 Restricts selection to jobs owned by the specified user names. .RS .LP This provides a means of limiting the selection to jobs owned by one or more users. .if !\n(Pb .ig Ig The ability to select jobs owned by others is controllable by the server attribute .At query_other_jobs . Mapping between user names on different hosts and validation of privilege to access the specified user name is discussed under the server. This option may also be used by batch operators and batch administrators to select jobs belonging to other users. .Ig .LP The syntax of the .Ar user_list is: .br .Ty "\ \ \ \ user_name[@host][,user_name[@host],...]" .br Host names may be wild carded on the left end, e.g. "*.nasa.gov". User_name without a "@host" is equivalent to "user_name@*", that is at any host. Jobs will be selected which are owned by the listed users at the corresponding hosts. .RE .SH STANDARD OUTPUT The list of job identifiers of selected jobs is written to standard output. Each job identifier is separated by white space. Each job identifier is of the form: .br .Ty "\ \ \ \ sequence_number.server_name@server" .br Where .Ty "sequence_number.server" is the identifier assigned at submission time, see .BR qsub . .Ty @server identifies the server which currently owns the job. .SH STANDARD ERROR The qselect command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all options presented to the qselect command, the exit status will be a value of zero. .LP If the qselect command fails to process any option, the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), qstat(1B), pbs_selectjob(3B), pbs_selstat(3B), pbs_statjob(3B) \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/qsig.1.in0000664000113300011330000001627011272401251013070 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qsig 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qsig \- signal pbs batch job .SH SYNOPSIS qsig [\-s\ signal] job_identifier ... .SH DESCRIPTION The .B qsig command requests that a signal be sent to executing batch jobs. The signal is sent to the session leader of the job. .LP If the .Ar \-s option is not specified, .B `SIGTERM' is sent. The request to signal a batch job will be rejected if: .IP \- The user is not authorized to signal the job. .IP \- The job is not in the .B running state. .IP \- The requested signal is not supported by the system upon which the job is executing. .LP The qsig command sends a .I "Signal Job" batch request to the server which owns the job. .SH OPTIONS .IP "\-s signal" 15 Declares which signal is sent to the job. .RS .LP The .Ar signal argument is either a signal name, e.g. \fBSIGKILL\fP, the signal name without the \fBSIG\fP prefix, e.g. \fBKILL\fP, or a unsigned signal number, e.g. \fB9\fP. The signal name .B SIGNULL is allowed; the server will send the signal 0 to the job which will have no effect on the job, but will cause an obituary to be sent if the job is no longer executing. Not all signal names will be recognized by qsig. If it doesn't recognize the signal name, try issuing the signal number instead. .LP Two special signal names, "suspend" and "resume", are used to suspend and resume jobs. Cray systems use the Cray-specific suspend()/resume() calls. .LP On non-Cray system, suspend causes a SIGTSTP to be sent to all processes in job's top task, wait 5 seconds, and then send a SIGSTOP to all processes in all tasks on all nodes in the job. This differs from TORQUE 2.0.0 which did not have the ability to propogate signals to sister nodes. Resume sends a SIGCONT to all processes in all tasks on all nodes. .LP When suspended, a job continues to occupy system resources but is not executing and is not charged for walltime. The job will be listed in the "S" state. Manager or operator privilege is required to suspend or resume a job. .LP Note that interactive jobs may not resume properly because the top-level shell will background the suspended child process. .if !\n(Pb .ig Ig .LP If the server receives a .I "Signal Job" batch request with a signal that is unsupported on the server host, the server will reject the request. .Ig .RE .SH OPERANDS The qsig command accepts one or more .Ar job_identifier operands of the form: .DS .Ty sequence_number[.server_name][@server] .DE .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR The qsig command will write a diagnostic messages to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qsig command, the exit status will be a value of zero. .LP If the qsig command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), pbs_sigjob(3B), pbs_resources_*(7B) where * is system type, and the PBS ERS. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/qsub.1.in0000664000113300011330000013011411413217002013065 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qsub 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qsub \- submit pbs job .SH SYNOPSIS qsub [\-a date_time] [\-A account_string] [\-b secs] [\-c checkpoint_options] [\-C directive_prefix] [\-d path] [\-D path] [\-e path] [\-f] [\-h] [\-I] [\-j join] [\-k keep] [\-l resource_list] [\-m mail_options] [\-M user_list] [\-N name] [\-o path] [\-p priority] [\-P proxy_username[:group]] [\-q destination] [\-r c] [\-S path_list] [\-t num_jobs] [\-T prologue/epilogue script_name] [\-u user_list] [\-v variable_list] [\-V] [\-w] path [\-W additional_attributes] [\-x] [\-X] [\-z] [script] .SH DESCRIPTION To create a job is to submit an executable script to a batch server. The batch server will be the default server unless the .Ar \-q option is specified. See discussion of PBS_DEFAULT under Environment Variables below. Typically, the script is a shell script which will be executed by a command shell such as sh or csh. .LP Options on the .B qsub command allow the specification of attributes which affect the behavior of the job. .if !\n(Pb .ig Ig The job is created by sending a .I "Queue Job" batch request to the batch server. .Ig .LP The qsub command will pass certain environment variables in the .At Variable_List attribute of the job. These variables will be available to the job. The value for the following variables will be taken from the environment of the qsub command: \fBHOME\fP, \fBLANG\fP, \fBLOGNAME\fP, \fBPATH\fP, \fBMAIL\fP, \fBSHELL\fP, and \fBTZ\fP. These values will be assigned to a new name which is the current name prefixed with the string "PBS_O_". For example, the job will have access to an environment variable named .B PBS_O_HOME which have the value of the variable .B HOME in the qsub command environment. .LP In addition to the above, the following environment variables will be available to the batch job. .if !\n(Pb .ig Ig (The values of the following environment variables are established by qsub.) .Ig .IP \fBPBS_O_HOST\fP the name of the host upon which the qsub command is running. .IP \fBPBS_SERVER\fP the hostname of the pbs_server which qsub submits the job to. .IP \fBPBS_O_QUEUE\fP the name of the original queue to which the job was submitted. .if !\n(Pb .ig Ig (It is established by the server which creates the job, not qsub.) .Ig .IP \fBPBS_O_WORKDIR\fP the absolute path of the current working directory of the qsub command. .if !\n(Pb .ig Ig .LP The following are established by the server executing the job, not the qsub command. .Ig .IP \fBPBS_ARRAYID\fP each member of a job array is assigned a unique identifier (see \-t) .IP \fBPBS_ENVIRONMENT\fP set to .Ty PBS_BATCH to indicate the job is a batch job, or to .Ty PBS_INTERACTIVE to indicate the job is a PBS interactive job, see \-I option. .IP \fBPBS_JOBID\fP the job identifier assigned to the job by the batch system. .IP \fBPBS_JOBNAME\fP the job name supplied by the user. .IP \fBPBS_NODEFILE\fP the name of the file contain the list of nodes assigned to the job (for parallel and cluster systems). .IP \fBPBS_QUEUE\fP the name of the queue from which the job is executed. .SH OPTIONS .IP "\-a date_time" 8 Declares the time after which the job is eligible for execution. .RS .LP The .Ar date_time argument is in the form: .Ty "[[[[CC]YY]MM]DD]hhmm[.SS]" .LP Where CC is the first two digits of the year (the century), YY is the second two digits of the year, MM is the two digits for the month, DD is the day of the month, hh is the hour, mm is the minute, and the optional SS is the seconds. .LP If the month, .Ty MM , is not specified, it will default to the current month if the specified day .Ty DD , is in the future. Otherwise, the month will be set to next month. Likewise, if the day, .Ty DD , is not specified, it will default to today if the time .Ty hhmm is in the future. Otherwise, the day will be set to tomorrow. For example, if you submit a job at 11:15am with a time of .Ty "\-a 1110" , the job will be eligible to run at 11:10am tomorrow. .if !\n(Pb .ig Ig See the date_time operand for the touch(1) command defined by POSIX.2. .LP The .At Execution_Time job attribute will be set to the number of seconds since Epoch which is equivalent to the Universal time expressed by the local time in the .Ar date_time argument. If the .Ar \-a option is not specified, the .At Execution_Time attribute is unset which represents a time zero or no delay. .Ig .RE .IP "\-A account_string" 8 Defines the account string associated with the job. The .Ar account_string is an undefined string of characters and is interpreted by the server which executes the job. See section 2.7.1 of the PBS ERS. .if !\n(Pb .ig Ig The .At Account_Name attribute is set to the account string. If account_string is unset, it is not passed with the job to the job executor. .Ig .IP "\-b seconds" Defines the maximum number of seconds qsub will block attempting to contact pbs_server. If pbs_server is down, or for a variety of communication failures, qsub will continually retry connecting to pbs_server for job submission. This value overrides the .B CLIENTRETRY parameter in .B torque.cfg. This is a non-portable TORQUE extension. Portability-minded users can use the .B PBS_CLIENTRETRY environmental variable. A negative value is interpreted as infinity. The default is 0. .IP "\-c checkpoint_options" Defines the options that will apply to the job. If the job executes upon a host which does not support checkpoint, these options will be ignored. .IP Valid checkpoint options are: .RS .IP none 3 No checkpointing is to be performed. .if !\n(Pb .ig Ig The job's .At Checkpoint attribute is set to the string .Ty """none""" . .Ig .IP enabled 3 Specify that checkpointing is allowed but must be explicitly invoked by either the .B qhold or .B qchkpt commands. .if !\n(Pb .ig Ig The job's .At Checkpoint attribute is set to the string .Ty """enabled""" . .Ig .IP shutdown 3 Specify that checkpointing is to be done on a job at pbs_mom shutdown. .if !\n(Pb .ig Ig The job's .At Checkpoint attribute is set to the string .Ty """shutdown""" . .Ig .IP periodic 3 Specify that periodic checkpointing is enabled. The default interval is 10 minutes and can be changed by the $checkpoint_interval option in the mom config file or by specifying an interval when the job is submitted .if !\n(Pb .ig Ig The job's .At Checkpoint attribute is set to the string .Ty """periodic""" . .Ig .IP interval=minutes 3 Checkpointing is to be performed at an interval of .Ar minutes , which is the integer number of minutes of wall time used by the job. This value must be greater than zero. .if !\n(Pb .ig Ig The .At Checkpoint attribute is set to the string specified by .Ar """interval=minutes""" . .Ig .IP depth=number 3 Specify a number (depth) of checkpoint images to be kept in the checkpoint directory. .if !\n(Pb .ig Ig The .At Checkpoint attribute is set to the string specified by .Ar """depth=number""" . .Ig .IP dir=path 3 Specify a checkpoint directory (default is /var/spool/torque/checkpoint). .if !\n(Pb .ig Ig The .At Checkpoint attribute is set to the string specified by .Ar """dir=path""" . .Ig .RE .IP "\-C directive_prefix" 8 Defines the prefix that declares a directive to the qsub command within the script file. See the paragraph on script directives in the Extended Description section. .IP If the .Ar \-C option is presented with a .Ar directive_prefix argument that is the null string, qsub will not scan the script file for directives. .if !\n(Pb .ig Ig The directive prefix is not a job attribute. It is used solely within the qsub command. .Ig .IP "\-d path" 8 Defines the working directory path to be used for the job. If the .Ar \-d option is not specified, the default working directory is the home directory. This option sets the environment variable PBS_O_INITDIR. .Ig .IP "\-D path" 8 Defines the root directory to be used for the job. This option sets the environment variable PBS_O_ROOTDIR. .Ig .IP "\-e path" 8 Defines the path to be used for the standard error stream of the batch job. The .Ar path argument is of the form: .br .Ty "\ \ \ \ [hostname:][path_name]" .br where .Ty hostname is the name of a host to which the file will be returned and .Ty path_name is the path name on that host in the syntax recognized by POSIX. The argument will be interpreted as follows: .RS .IP \fBpath_name\fP Where path_name is not an absolute path name, then the qsub command will expand the path name relative to the current working directory of the command. The command will supply the name of the host upon which it is executing for the .Ar hostname component. .IP \fBhostname:path_name\fP Where path_name is not an absolute path name, then the qsub command will not expand the path name relative to the current working directory of the command. On delivery of the standard error, the path name will be expanded relative to the user's home directory on the \fBhostname\fP system. .IP \fBpath_name\fP Where path_name specifies an absolute path name, then the qsub will supply the name of the host on which it is executing for the .Ar hostname .IP \fBhostname:path_name\fP Where path_name specifies an absolute path name, the path will be used as specified. .Ar hostname . .IP \fBhostname:\fP Where hostname specifies the name of the host that the file should be returned to. The path will be the default file name. .RE .IP If the .Ar \-e option is not specified or the \fBpath_name\fP is not specified or is specified and is a directory, the default file name for the standard error stream will be used. The default name has the following form: .br \ \ \ \ \fBjob_name.esequence_number\fP .br where \fBjob_name\fP is the name of the job, see .Ar \-N option, and \fBsequence_number\fP is the job number assigned when the job is submitted. .if !\n(Pb .ig Ig This option sets the job attribute .At Error_Path . .Ig .IP "\-f" 8 Specifies that the job is fault tolerant. The .At fault_tolerant attribute will be set to true, which indicates that the job can survive the loss of a mom other than the "mother superior" mom (the first node in the exec hosts ) .Ig .IP "\-h" 8 Specifies that a user hold be applied to the job at submission time. .if !\n(Pb .ig Ig The .At Hold_Types attribute will be set to USER, "u". If \-h is not specified, then .At Hold_Types is set to NONE, "n". .Ig .IP "\-I" 8 Declares that the job is to be run "interactively". The job will be queued and scheduled as any PBS batch job, but when executed, the standard input, output, and error streams of the job are connected through qsub to the terminal session in which qsub is running. Interactive jobs are forced to not rerunable. See the "Extended Description" paragraph for addition information of interactive jobs. .if !\n(Pb .ig Ig .SM The \-I option is a violation of the POSIX 1003.2d standard. Option key letters not defined by the standard, such as I, are reserved for future revisions of the standard. PBS can be built with the symbol PBS_NO_POSIX_VIOLATION defined, in which case the \-I option is removed. The interactive attribute may still be specified via the \-W option. .NL .Ig .IP "\-j join" 8 Declares if the standard error stream of the job will be merged with the standard output stream of the job. .IP An option argument value of .Ty oe directs that the two streams will be merged, intermixed, as standard output. .if !\n(Pb .ig Ig The .At Join_Path job attribute is set to "oe". .Ig An option argument value of .Ty eo directs that the two streams will be merged, intermixed, as standard error. .if !\n(Pb .ig Ig The .At Join_Path job attribute is set to "eo". .Ig .IP If the .Ar join argument is .Ty n or the option is not specified, the two streams will be two separate files. .if !\n(Pb .ig Ig The .At Join_Path job attribute is set to "n". .Ig .IP "\-k keep" 8 Defines which (if either) of standard output or standard error will be retained on the execution host. If set for a stream, this option overrides the path name for that stream. If not set, neither stream is retained on the execution host. .IP The argument is either the single letter "e" or "o", or the letters "e" and "o" combined in either order. Or the argument is the letter "n". .if !\n(Pb .ig Ig Repetition of characters is permitted, but "n" may not appear in the same option argument with the other two characters. The attribute .At Keep_Files is set to the argument. .Ig .RS .IP e 3 The standard error stream is to retained on the execution host. The stream will be placed in the home directory of the user under whose user id the job executed. The file name will be the default file name given by: \fBjob_name.esequence\fP where \fBjob_name\fP is the name specified for the job, and \fBsequence\fP is the sequence number component of the job identifier. .if !\n(Pb .ig Ig The attribute is set to KEEP_ERROR. .Ig .IP o 3 The standard output stream is to retained on the execution host. The stream will be placed in the home directory of the user under whose user id the job executed. The file name will be the default file name given by: \fBjob_name.osequence\fP where \fBjob_name\fP is the name specified for the job, and \fBsequence\fP is the sequence number component of the job identifier. .if !\n(Pb .ig Ig The attribute is set to KEEP_OUTPUT. .Ig .IP eo 3 Both the standard output and standard error streams will be retained. .if !\n(Pb .ig Ig The attribute is set to "KEEP_OUTPUT\ |\ KEEP_ERROR". .Ig .IP oe 3 Both the standard output and standard error streams will be retained. .if !\n(Pb .ig Ig The attribute is set to "KEEP_OUTPUT\ |\ KEEP_ERROR". .Ig .IP n 3 Neither stream is retained. .RE .IP "\-l resource_list" 8 Defines the resources that are required by the job and establishes a limit to the amount of resource that can be consumed. If not set for a generally available resource, such as CPU time, the limit is infinite. The .Ar resource_list argument is of the form: .br .Ty "\ \ \ \ resource_name[=[value]][,resource_name[=[value]],...] .if !\n(Pb .ig Ig .IP For each resource listed in the .Ar resource_list , one entry will be added to the .At Resource_List attribute of the job. The entry contains the resource name and its requested value. No white space is allowed in the value. Other than syntax, qsub performs no resource or value checking. The checking is performed by the execution server. .Ig .IP "\-m mail_options " 8 Defines the set of conditions under which the execution server will send a mail message about the job. The .Ar mail_options argument is a string which consists of either the single character "\fBn\fP", or one or more of the characters "\fBa\fP", "\fBb\fP", and "\fBe\fP". .if !\n(Pb .ig Ig Repeated letters are accepted, but \fBn\fP cannot be mixed with the other characters. .Ig .IP If the character "\fBn\fP" is specified, no mail will be sent. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to NONE, "n". .Ig .IP For the letters "\fBa\fP", "\fBb\fP", and "\fBe\fP": .RS .IP a 3 mail is sent when the job is aborted by the batch system. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to ABORT, "a". .Ig .IP b 3 mail is sent when the job begins execution. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to BEGINNING, "b". .Ig .IP e 3 mail is sent when the job terminates. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to EXIT, "e". .Ig .RE .IP If the .Ar \-m option is not specified, mail will be sent if the job is aborted. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to ABORT, "a". .Ig .IP "\-M user_list" 8 Declares the list of users to whom mail is sent by the execution server when it sends mail about the job. .IP The .Ar user_list argument is of the form: .br .Ty "\ \ \ \ user[@host][,user[@host],...]" .br If unset, the list defaults to the submitting user at the qsub host, i.e. the job owner. .if !\n(Pb .ig Ig .IP The .At Mail_Users attribute is set to the argument. .Ig .IP "\-N name " 8 Declares a name for the job. The name specified may be up to and including 15 characters in length. It must consist of printable, non white space characters with the first character alphabetic. .if !\n(Pb .ig Ig [The POSIX 1003.2d Standard calls for only alphanumeric characters, but then calls for the use of the script file base name as the job name if a name is not specified. The file name may contain other than alphanumeric characters. Therefore I \*Qinterpret\*U the standard as allowing printable characters.] Names taken from the script name may have a non-alphabetic character first. If the script basename is greater than 15 characters, it will be truncated to 15. .Ig .IP If the .Ar \-N option is not specified, the job name will be the base name of the job script file specified on the command line. If no script file name was specified and the script was read from the standard input, then the job name will be set to .Ty STDIN . .if !\n(Pb .ig Ig .IP The .At Job_Name attribute is set to the name. .Ig .IP "\-o path" 8 Defines the path to be used for the standard output stream of the batch job. The .Ar path argument is of the form: .br .Ty "\ \ \ \ [hostname:][path_name]" .br where .Ty hostname is the name of a host to which the file will be returned and .Ty path_name is the path name on that host in the syntax recognized by POSIX. The argument will be interpreted as follows: .RS .IP \fBpath_name\fP Where path_name is not an absolute path name, then the qsub command will expand the path name relative to the current working directory of the command. The command will supply the name of the host upon which it is executing for the .Ar hostname component. .IP \fBhostname:path_name\fP Where path_name is not an absolute path name, then the qsub command will not expand the path name relative to the current working directory of the command. On delivery of the standard output, the path name will be expanded relative to the user's home directory on the \fBhostname\fP system. .IP \fBpath_name\fP Where path_name specifies an absolute path name, then the qsub will supply the name of the host on which it is executing for the .Ar hostname .IP \fBhostname:path_name\fP Where path_name specifies an absolute path name, the path will be used as specified. .Ar hostname . .IP \fBhostname:\fP Where hostname specifies the name of the host that the file should be returned to. The path will be the default file name. .RE .IP If the .Ar \-o option is not specified or the \fBpath_name\fP is not specified or is specified and is a directory, the default file name for the standard output stream will be used. The default name has the following form: .br \ \ \ \ \fBjob_name.osequence_number\fP .br where \fBjob_name\fP is the name of the job, see .Ar \-N option, and \fBsequence_number\fP is the job number assigned when the job is submitted. .if !\n(Pb .ig Ig This option sets the job attribute .At Output_Path . .Ig .IP "\-p priority" 8 Defines the priority of the job. The .Ar priority argument must be a integer between \-1024 and +1023 inclusive. The default is no priority which is equivalent to a priority of zero. .if !\n(Pb .ig Ig The .At Priority job attribute is set to this signed integer value. .Ig .IP "\-P proxy_user[:group]" 8 Proxy user for whom the job should be submitted. This option is only available for the super user. .Ig .IP "\-q destination" 8 Defines the destination of the job. The .Ar destination names a queue, a server, or a queue at a server. .IP The qsub command will submit the script to the server defined by the .Ar destination argument. .if !\n(Pb .ig Ig The server named by the destination is the one to which qsub sends the .I "Queue Job" batch request. .Ig If the destination is a .I "routing queue," the job may be routed by the server to a new destination. .IP If the .Ar \-q option is not specified, the qsub command will submit the script to the default server. See PBS_DEFAULT under the Environment Variables section on this man page and the PBS ERS section 2.7.4, "Default Server". .IP If the .Ar \-q option is specified, it is in one of the following three forms: .br .Ty "\ \ \ \ queue" .br .Ty "\ \ \ \ @server" .br .Ty "\ \ \ \ queue@server" .IP If the .Ar destination argument names a queue and does not name a server, the job will be submitted to the named queue at the default server. .IP If the .Ar destination argument names a server and does not name a queue, the job will be submitted to the default queue at the named server. .IP If the .Ar destination argument names both a queue and a server, the job will be submitted to the named queue at the named server. .IP "\-r y|n" 8 Declares whether the job is rerunable. See the .B qrerun command. The option argument is a single character, either .Ty y or .Ty n . .if !\n(Pb .ig Ig Also see .I rerunable in the glossary. Interactive jobs are forced to not rerunable. .Ig .IP If the argument is "\fBy\fP", the job is rerunable. .if !\n(Pb .ig Ig The .At Rerunable attribute is set to the character 'y'. .Ig If the argument is "\fBn\fP", the job is not rerunable. The default value is 'y', rerunable. .IP "\-S path_list" 8 Declares the shell that interprets the job script. .IP The option argument .Ar path_list is in the form: .br .Ty "\ \ \ \ path[@host][,path[@host],...]" .br Only one path may be specified for any host named. Only one path may be specified without the corresponding host name. The path selected will be the one with the host name that matched the name of the execution host. If no matching host is found, then the path specified without a host will be selected, if present. .IP If the .Ar \-S option is not specified, the option argument is the null string, or no entry from the .Ar path_list is selected, the execution will use the user's login shell on the execution host. .if !\n(Pb .ig Ig The .At Shell_Path_List attribute is set to the .Ar path_list argument if present, otherwise it is set to the null string. .Ig .IP "\-t array_request" 8 Specifies the task ids of a job array. Single task arrays are allowed. .IP The .Ar array_request argument is an integer id or a range of integers. Multiple ids or id ranges can be combined in a comma delimted list. Examples : \-t 1-100 or \-t 1,10,50-100 .IP "\-T script_name" 8 Allows for per job prologue and epilogue scripts. The full script name will be prologue.[name] or epilogue.[name]. For the job submission, only request the name of the prologue or epilogue script. .IP Example: .Ty "qsub -T prescript" .br Specifies to use the script prologue.prescript .IP "\-u user_list" 8 Defines the user name under which the job is to run on the execution system. .IP The .Ar user_list argument is of the form: .br .Ty "\ \ \ \ user[@host][,user[@host],...]" .br Only one user name may be given per specified host. Only one of the .Ty user specifications may be supplied without the corresponding .Ty host specification. That user name will used for execution on any host not named in the argument list. .if !\n(Pb .ig Ig The .At User_List attribute is set to the value of .Ar user_list . .Ig If unset, the user list defaults to the user who is running qsub. .IP "\-v variable_list" Expands the list of environment variables that are exported to the job. .IP In addition to the variables described in the "Description" section above, .Ar variable_list names environment variables from the qsub command environment which are made available to the job when it executes. The .Ar variable_list is a comma separated list of strings of the form .Ty variable or .Ty variable=value . These variables and their values are passed to the job. .if !\n(Pb .ig Ig The .At Variable_List attribute is appended with the variables in .Ar user_list and their values. .Ig .IP "\-V" 8 Declares that all environment variables in the qsub command's environment are to be exported to the batch job. .if !\n(Pb .ig Ig The .At Variable_List attribute is appended with the variables in the qsub command's environment and their values. .Ig .IP "\-w path" 8 Defines the working directory path to be used for the job. If the .Ar \-w option is not specified, the default working directory is the current directory. This option sets the environment variable PBS_O_WORKDIR. .Ig .IP "\-W additional_attributes" 8 The \-W option allows for the specification of additional job attributes. .if !\n(Pb .ig Ig .SM POSIX.2 reserves all undefined option letters for future versions of the standard. The single letter 'W' is allowed for extensions. PBS makes use of the \-W to specify attributes which are extensions to POSIX 1003.2d. .NL .Ig The general syntax of the \-W is in the form: .br .Ty "\ \ \ \ \-W attr_name=attr_value[,attr_name=attr_value...]" .br Note if white space occurs anywhere within the option argument string or the equal sign, "=", occurs within an .Ar attribute_value string, then the string must be enclosed with either single or double quote marks. .IP PBS currently supports the following attributes within the \-W option. .IP .Ty "depend=dependency_list" .br Defines the dependency between this and other jobs. The .Ar dependency_list is in the form: .br .Ty "type[:argument[:argument...][,type:argument...]" . .br The .I argument is either a numeric count or a PBS job id according to .I type . If argument is a count, it must be greater than 0. If it is a job id and not fully specified in the form .Ty seq_number.server.name , it will be expanded according to the default server rules which apply to job IDs on most commands. If .I argument is null (the preceding colon need not be specified), the dependency of the corresponding type is cleared (unset). .RS 12 .IP "\fBsynccount:count\fP" 4 This job is the first in a set of jobs to be executed at the same time. .I Count is the number of additional jobs in the set. .IP "\fBsyncwith:jobid\fP" 4 This job is an additional member of a set of jobs to be executed at the same time. In the above and following dependency types, .I jobid is the job identifier of the first job in the set. .IP "\fBafter:jobid[:jobid...]\fP" 4 This job may be scheduled for execution at any point after jobs .I jobid have started execution. .IP "\fBafterok:jobid[:jobid...]\fP" 4 This job may be scheduled for execution only after jobs .I jobid have terminated with no errors. See the csh warning under "Extended Description". .IP "\fBafternotok:jobid[:jobid...]\fP" 4 This job may be scheduled for execution only after jobs .I jobid have terminated with errors. See the csh warning under "Extended Description". .IP "\fBafterany:jobid[:jobid...]\fP" 4 This job may be scheduled for execution after jobs .I jobid have terminated, with or without errors. .IP "\fBon:count\fP" 4 This job may be scheduled for execution after \fBcount\fP dependencies on other jobs have been satisfied. This form is used in conjunction with one of the \fBbefore\fP forms, see below. .IP \fBbefore:jobid[:jobid...]\fP 4 When this job has begun execution, then jobs \fBjobid...\fP may begin. .IP \fBbeforeok:jobid[:jobid...]\fP 4 If this job terminates execution without errors, then jobs \fBjobid...\fP may begin. See the csh warning under "Extended Description". .IP \fBbeforenotok:jobid[:jobid...]\fP 4 If this job terminates execution with errors, then jobs \fBjobid...\fP may begin. See the csh warning under "Extended Description". .IP \fBbeforeany:jobid[:jobid...]\fP 4 When this job terminates execution, jobs \fBjobid...\fP may begin. .IP If any of the \fBbefore\fP forms are used, the jobs referenced by \fBjobid\fP must have been submitted with a dependency type of \fBon\fP. .if !\n(Pb .ig Ig .IP The .At depend attribute is set to the value of the .Ar dependency option argument. .Ig .IP If any of the \fBbefore\fP forms are used, the jobs referenced by \fBjobid\fP must have the same owner as the job being submitted. Otherwise, the dependency is ignored. .LP Error processing of the existence, state, or condition of the job on which the newly submitted job is a deferred service, i.e. the check is performed after the job is queued. If an error is detected, the new job will be deleted by the server. Mail will be sent to the job submitter stating the error. .LP Dependency examples: .br .Ty "qsub \-W depend=afterok:123.big.iron.com /tmp/script" .br .Ty "qsub \-W depend=before:234.hunk1.com:235.hunk1.com /tmp/script" .RE .IP .Ty group_list=g_list .br Defines the group name under which the job is to run on the execution system. The .Ar g_list argument is of the form: .br .Ty "group[@host][,group[@host],...]" .br Only one group name may be given per specified host. Only one of the .Ty group specifications may be supplied without the corresponding .Ty host specification. That group name will used for execution on any host not named in the argument list. .if !\n(Pb .ig Ig The .At group_list attribute is set to the value of .Ar g_list . .Ig If not set, the .At group_list defaults to the primary group of the user under which the job will be run. .IP .Ty "interactive=true" .br If the interactive attribute is specified, the job is an interactive job. The \-I option is a alternative method of specifying this attribute. .IP .Ty "stagein=file_list" .br .Ty "stageout=file_list" .br Specifies .if !\n(Pb .ig Ig the .At stagein or .At stageout attribute, listing .Ig which files are staged (copied) in before job start or staged out after the job completes execution. On completion of the job, all staged-in and staged-out files are removed from the execution system. The .Ar file_list is in the form .br .Ty "local_file@hostname:remote_file[,...]" .br regardless of the direction of the copy. The name .Ty local_file is the name of the file on the system where the job executed. It may be an absolute path or relative to the home directory of the user. The name .Ty remote_file is the destination name on the host specified by .Ty hostname . The name may be absolute or relative to the user's home directory on the destination host. The use of wildcards in the file name is not recommended. .if !\n(Pb .ig Ig Since rcp (or scp) is run via rsh, it will pick up matching names from the remote system. However, pbs_mom will does not expand the wildcards and will fail to delete the staged files on job termination. .Ig The file names map to a remote copy program (rcp) call on the execution system in the follow manner: .br For stagein: rcp hostname:remote_file local_file .br For stageout: rcp local_file hostname:remote_file .br Data staging examples: .br .Ty "\-W stagein=/tmp/input.txt@headnode:/home/user/input.txt" .br .Ty "\-W stageout=/tmp/output.txt@headnode:/home/user/output.txt" .br If TORQUE has been compiled with wordexp support, then variables can be used in the specified paths. Currently only $PBS_JOBID, $HOME, and $TMPDIR are supported for stagein. .RE .IP .Ty umask=XXX .br Sets umask used to create stdout and stderr spool files in pbs_mom spool directory. Values starting with 0 are treated as octal values, otherwise the value is treated as a decimal umask value. .br .IP "\-x" When running an interactive job, the \-x flag makes it so that the script won't be parsed for PBS directives, but instead will be a command that is launched once the interactive job has started. The job will terminate at the completion of this command. .IP "\-X" 8 Enables X11 forwarding. The DISPLAY environment variable must be set. .IP "\-z" 8 Directs that the qsub command is not to write the job identifier assigned to the job to the command's standard output. .in 0 .LP .SH OPERANDS The qsub command accepts a .Ar script operand that is the path to the script of the job. If the path is relative, it will be expanded relative to the working directory of the qsub command. .LP If the .Ar script operand is not provided or the operand is the single character "\-", the qsub command reads the script from standard input. .if \n(Pb .ig Ig When the script is being read from Standard Input, qsub will copy the file to a temporary file. This temporary file is passed to the library interface routine pbs_submit. The temporary file is removed by qsub after pbs_submit returns or upon the receipt of a signal which would cause qsub to terminate. .Ig .SH STANDARD INPUT The qsub command reads the script for the job from standard input if the .Ar script operand is missing or is the single character "\-". .SH INPUT FILES The .Ar script file is read by the qsub command. Qsub acts upon any directives found in the script. .LP When the job is created, a copy of the script file is made and that copy cannot be modified. .SH STANDARD OUTPUT Unless the .Ar \-z option is set, the job identifier assigned to the job will be written to standard output if the job is successfully created. .SH STANDARD ERROR The qsub command will write a diagnostic message to standard error for each error occurrence. .SH ENVIRONMENT VARIABLES The values of some or all of the variables in the qsub command's environment are exported with the job, see the \-v and \-V options. .LP The environment variable .B PBS_DEFAULT defines the name of the default server. Typically, it corresponds to the system name of the host on which the server is running. If PBS_DEFAULT is not set, the default is defined by an administrator established file. .LP The environment variable .B PBS_DPREFIX determines the prefix string which identifies directives in the script. .LP The environment variable .B PBS_CLIENTRETRY defines the maximum number of seconds qsub will block. See the \-b option above. Despite the name, currently qsub is the only client that supports this option. .SH TORQUE.CFG The torque.cfg file, located in PBS_SERVER_HOME (/var/spool/torque by default) controls the behavior of the qsub command. This file contains a list of parameters and values separated by whitespace .LP .B QSUBSLEEP takes an integer operand which specifies time to sleep when running qsub command. Used to prevent users from overwhelming the scheduler. .LP .B SUBMITFILTER specifies the path to the submit filter used to pre-process job submission. The default path is $(libexecdir)/qsub_filter, which falls back to /usr/local/sbin/torque_submitfilter for backwards compatibility. This torque.cfg parameter overrides this default. .LP .B SERVERHOST specifies the value for the PBS_SERVER environment variable .LP .B QSUBHOST specifies the hostname for the jobs QSUB_O_HOST variable .LP .B QSUBSENDUID specifies a uid to use for the jobs PBS_O_UID variable .LP .B XAUTHPATH specifies the path to xauth .LP .B CLIENTRETRY specifies the integer seconds between retry attempts to communicate with pbs_server .LP .B VALIDATEGROUP set this parameter to force qsub to verify the submitter's group id .LP .B DEFAULTCKPT specifies the default value for the jobs checkpoint attribute. The user overrides this with the \-c qsub option. .LP .B VALIDATEPATH set this parameter to force qsub to validate local existence of a "\-d" working directory .LP .B RERUNNABLEBYDEFAULT this parameter specifies if a job is rerunnable by default. The default is true, setting this to false causes the rerunnable attribute value to be false unless the users specifies otherwise with the \-r option .LP .B FAULT_TOLERANT_BY_DEFAULT this parameter specifies if a job is fault tolerant by default. The default value for the fault_tolerant job attribute is false, setting this parameter to true causes the default value of the attribute to be true. The user can specify their preference with the \-f qsub option. .LP For example: .RS .Cs .Ty "QSUBSLEEP 2" .Ty "RERUNNABLEBYDEFAULT false" .Ce .RE .LP .SH EXTENDED DESCRIPTION .LP Script Processing: .LP A job script may consist of PBS directives, comments and executable statements. A PBS directive provides a way of specifying job attributes in addition to the command line options. For example: .RS .Cs .Ty ":" .Ty "#PBS \-N Job_name" .Ty "#PBS \-l walltime=10:30,mem=320kb" .Ty "#PBS \-m be" .Ty "#" .Ty "step1 arg1 arg2" .Ty "step2 arg3 arg4" .Ce .RE .LP The qsub command scans the lines of the script file for directives. An initial line in the script that begins with the characters "#!" or the character ":" will be ignored and scanning will start with the next line. Scanning will continue until the first executable line, that is a line that is not blank, not a directive line, nor a line whose first non white space character is "#". If directives occur on subsequent lines, they will be ignored. .LP A line in the script file will be processed as a directive to qsub if and only if the string of characters starting with the first non white space character on the line and of the same length as the directive prefix matches the directive prefix. .LP The remainder of the directive line consists of the options to qsub in the same syntax as they appear on the command line. The option character is to be preceded with the "\-" character. .LP If an option is present in both a directive and on the command line, that option and its argument, if any, will be ignored in the directive. The command line takes precedence. .LP If an option is present in a directive and not on the command line, that option and its argument, if any, will be processed as if it had occurred on the command line. .LP The directive prefix string will be determined in order of preference from: .RS 4 .sp The value of the .Ar \-C option argument if the option is specified on the command line. .sp The value of the environment variable .B PBS_DPREFIX if it is defined. .sp The four character string .Ty #PBS . .sp .RE If the .Ar \-C option is found in a directive in the script file, it will be ignored. .LP User Authorization: .LP When the user submits a job from a system other than the one on which the PBS Server is running, the name under which the job is to be executed is selected according to the rules listed under the \-u option. The user submitting the job must be authorized to run the job under the execution user name. This authorization is provided if .RS .IP (1) 5 The host on which qsub is run is trusted by the execution host (see /etc/hosts.equiv), .IP (2) The execution user has an .rhosts file naming the submitting user on the submitting host. .RE .LP C-Shell .logout File: .LP The following warning applies for users of the c-shell, csh. If the job is executed under the csh and a .I .logout file exists in the home directory in which the job executes, the exit status of the job is that of the .logout script, not the job script. This may impact any inter-job dependencies. To preserve the job exit status, either remove the .logout file or place the following line as the first line in the .logout file .br .Ty "\ \ \ set EXITVAL = $status" .br and the following line as the last executable line in .logout .br .Ty "\ \ \ exit $EXITVAL" .LP Interactive Jobs: .LP If the .Ar \-I option is specified on the command line or in a script directive, or if the "interactive" job attribute declared true via the \-W option, .Ty "\-W interactive=true" , either on the command line or in a script directive, the job is an interactive job. The script will be processed for directives, but will not be included with the job. When the job begins execution, all input to the job is from the terminal session in which qsub is running. .LP When an interactive job is submitted, the qsub command will not terminate when the job is submitted. Qsub will remain running until the job terminates, is aborted, or the user interrupts qsub with an SIGINT (the control-C key). If qsub is interrupted prior to job start, it will query if the user wishes to exit. If the user response "yes", qsub exits and the job is aborted. .LP Once the interactive job has started execution, input to and output from the job pass through qsub. Keyboard generated interrupts are passed to the job. Lines entered that begin with the tilde ('~') character and contain special sequences are escaped by qsub. The recognized escape sequences are: .RS .IP "~." Qsub terminates execution. The batch job is also terminated. .IP "~susp" Suspend the qsub program if running under the C shell. "susp" is the suspend character, usually CNTL-Z. .IP "~asusp" Suspend the input half of qsub (terminal to job), but allow output to continue to be displayed. Only works under the C shell. "asusp" is the auxiliary suspend character, usually CNTL-Y. .RE .LP .SH EXIT STATUS Upon successful processing, the qsub exit status will be a value of zero. .LP If the qsub command fails, the command exits with a value greater than zero. .SH SEE ALSO qalter(1B), qdel(1B), qhold(1B), qmove(1B), qmsg(1B), qrerun(1B), qrls(1B), qselect(1B), qsig(1B), qstat(1B), pbs_connect(3B), pbs_job_attributes(7B), pbs_queue_attributes(7B), pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), and pbs_server(8B) \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/basl2c.1.in0000664000113300011330000023676711272401251013312 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .de BP .ie '\\n(.z'' .bp \\$1 .el \!.BP \\$1 .. .if \n(Pb .ig Iq .TH basl2c 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME basl2c \- converts a BASL (BAtch Scheduling Language) code into a C scheduler code. .SH SYNOPSIS basl2c [\^\-d\^] [\^\-l lexerDebugFile\^] [\^\-p parserDebugFile\^] [\^\-y symtabDebugFile\^] [\^\-s semanticDebugFile\^] [\^\-g codegenDebugFile\^] [\^\-c cFile\^] baslFile .SH DESCRIPTION .B basl2c is the BASL to C compiler that produces an intermediate code that can be fed into a regular C compiler, and linked with the PBS libraries to produce the scheduler executable. Basl2c takes as input a .Ar "baslFile", which is a program written in the BAtch Scheduling Language, containing the main scheduling code. Basl2c then converts the BASL constructs in the file into C statements, and it also attaches additional code to produce the PBS scheduler source code. By default, the resulting C code is written into the file .Ar "pbs_sched.c". .sp The full pathname to the resulting C file is what needs to be specified in the .B SCHD_CODE variable in local.mk before compiling the BASL scheduler to produce the .Ar "pbs_sched" executable. .SH OPTIONS .IP "\-d" 5 Prints additional debugging messages to the lexer (see \-l option), parser (see \-p option), symbol table (see \-y option), semantic analyzer (see \-s option), and code generator (see \-g option). .IP "\-l lexerDebugFile" 5 .Ar lexerDebugFile is the name of a file to write into the debugging messages generated while scanning for tokens. .IP "\-p parserDebugFile" 5 .Ar parserDebugFile is the name of a file to write into the debugging messages generated while putting together tokens in a usable way. .IP "\-y symtabDebugFile" 5 .Ar symtabDebugFile is the name of a file to write into the debugging messages related to the symbol table. .IP "\-s semanticDebugFile" 5 .Ar semanticDebugFile is the name of a file to write into the debugging messages generated while checking to make sure variables and operators are used in a consistent way. .IP "\-g codegenDebugFile" 5 .Ar codegenDebugFile is the name of a file to write into the debugging messages generated while converting BASL statements to C statements. .IP "\-c cFile" 5 .Ar cFile is the name of a file where the generated C code is written into. .SH MAIN STRUCTURE The basic structure of a scheduler code written in BASL is as follows: .BP .ft 3 .nf zero or more FUNCTIONS definitions zero or more global VARIABLE DECLARATIONS zero or more assignment statements (to initialize global variables) sched_main() { one or more VARIABLE DECLARATIONS zero or more STATEMENTS } .fi .sp .LP For example, .Ty .nf % cat sched.basl Int sum(Int a, Int b) { Int s; s = a + b; return(s); } Int glob; sched_main() { Int c; a = 3; b = 4; c = sum(a, b); print(c); glob = 5; print(glob); } .fi .LP .Ty sched_main() is the function that gets called at every scheduling iteration. .SH FUNCTIONS To define a function that can be called in subsequent functions, the syntax is: .sp .ft 3 .nf ReturnType function-name ( DATATYPE1 IDENTIFIER1, DATATYPE2 IDENTIFIER2, ... ) { one or more VARIABLE DECLARATIONS zero or more STATEMENTS } .fi .sp .ft 1 For example, .Ty .nf Void printStuff(Dayofweek dow, DateTime t, String str, Size sz, CNode cn) { print(dow); print(t); print(str); print(sz); print(cn); } .fi .sp .ft 1 Valid function .B ReturnType are: Void, Int, Float, Dayofweek, DateTime, String, Size, Server, Que, Job, CNode, Set Server, Set Que, Set Job, Set CNode. .sp Valid data types ( .B "DATATYPE1, DATATYPE2, ..." ) for the parameter identifiers are: Int, Float, Dayofweek, DateTime, String, Size, Server, Que, Job, CNode, Set Server, Set Que, Set Job, Set CNode, Range Int, Range Float, Range Dayofweek, Range DateTime, Range Size, Fun Int, Fun Float, Fun Void, Fun Dayofweek, Fun DateTime, Fun String, Fun Size, Fun Server, Fun Que, Fun Job, Fun CNode, Fun Set Server, Fun Set Que, Fun Set Job, Fun Set CNode. These data types will be discussed in the next topic. .sp Functions are invoked by their name and their arguments as in: .sp .Ty .nf printStuff( MON, (5|1|1997@14:32:00), "sched begins", 30gb, node ); .fi .sp .ft 1 .Ar basl2c will actually add a "basl_" prefix to the function name given by the scheduler writer to minimize chance of name collision, which can result when the resulting C code is linked with the PBS, BASL libraries. For example, if you look at the generated C code for .Ar "printStuff", you would see, .sp .nf basl_printStuff( MON, (5|1|1997@14:32:00), "sched begins", 30gb, node ); .fi .sp As in C, all function calls must have been previously defined. The BASL compiler will check to make sure that arguments in the function call match up exactly (in terms of types) with the parameters in the function definition. .sp Two kinds of functions exist in BASL: user-defined functions and predefined functions. User-defined functions are those that the scheduler writer provided a definition for, while predefined functions are those that can immediately be called without a need for defining it. For a list of predefined functions, see section on .B "PREDEFINED FUNCTIONS" . .SH VARIABLE DECLARATIONS Like in C, all variables in a BASL code must be explicitly declared before use. Those variables declared outside of any function are referred to as global variables, while variables that are declared within a function body are called local variables. Global variables are usable anywhere within the BASL code, while local variables are readable only within the function from which they were declared. .sp The syntax of a variable declaration is: .sp .B .nf DATATYPE IDENTIFIER ; .fi .sp .ft 1 where .B DATATYPE can be: Int, Float, Dayofweek, DateTime, String, Size, Server, Que, Job, CNode, Set Server, Set Que, Set Job, Set CNode, Range Int, Range Float, Range Dayofweek, Range DateTime, Range Size. .sp .SH "DATA TYPE" .IP \fBVoid\fP 8 used for functions that don't return a value. .IP \fBInt\fP 8 signed, whole numbers given in base 10. .br .RS .IP "Sample constants:" 5, +1, \-3, SUCCESS (=1), FAIL (=0), TRUE (=1), FALSE (=0) .RE .IP \fBFloat\fP 8 real numbers which are represented as doubles in the translated C code. .br Sample constants: 4.3, +1.2, \-2.6 .IP \fBDayofweek\fP 8 constant values: SUN, MON, TUE, WED, THU, FRI, SAT, internally represented as integer valued constants with SUN=0, MON=1, and so on. .IP \fBDateTime\fP 8 specify in one of 3 formats: .sp .RS .IP [1] (m|d|y) where 1 <= m <= 12, 1 <= d <= 31, 0 <= y, ex. (4|4|1997); .IP [2] (hh:mm:ss) where 0 <= hh <= 23, 0 <= mm <= 59, 0 <= ss <= 61, ex. (12:01:00); .IP [3] (m|d|y@hh:mm:ss), ex. (4|4|1997@12:01:00) .br During dates/times comparison, "now" time is substituted if the time portion is not given (format [1]); the "now" date is substituted if the date portion is not given (format [2]). Also, the full year portion must be given (i.e. 1997 instead of 97) in dates to avoid ambiguity. .RE .IP \fBString\fP 8 A string is enclosed in quotes (") and it can contain anything except another quote, a newline, and left and right parentheses. .br Sample constants: "a sample string", NULLSTR .IP \fBSize\fP 8 format: where suffix is a multiplier of the form: : .sp .Ty .nf multiplier unit (bytes or words) =================== ===================== k,m,g,t,p,K,M,G,T,P b,B,w,W .fi .ft 1 .sp where k=K=1024, m=M=1,048,576, g=G=1,073,741,824, t=T=1,099,511,627,776, p=P=1,125,899,906,842,624, b=B=1, and word size w=W is locally defined (i.e. 4 bytes in a 32-bit machine). .sp When operating on 2 size operands that are of different suffixes, the suffix of the "lower" of the two will be the resultant suffix. For example, .nf 10mb + 10gb = 10250mb .fi .br Sample constants: \-1b, 2w, 1kb, 2mw, +3gb, 4tw, 6Pb .IP "\fBRange Int\fP" 8 .RS .IP "format: (low Int value, high Int value)" 8 where low Int value <= high Int value. Sample constant: (1,3) .RE .br .IP "\fBRange Float\fP" 8 .RS .IP "format: (low Float value, high Float value)" 8 where low value <= high value. Sample constant: (2.3, 4.6) .RE .br .IP "\fBRange Dayofweek\fP" 8 .RS .IP "format: (earlier day, later day)" 8 where earlier day <= later day. Sample constant: (WED, FRI) .RE .br .IP "\fBRange DateTime\fP" 8 .RS .IP "format: (earlier date/time, later date/time)" 8 where earlier date/time <= later date/time. .br NOTE: if range contains only time portions, and earlier time "appears" to be > later time as in "((18:0:0), (6:0:0))", then during date/time comparisons, the "later" time will be adjusted by one day so that it will look like: "( (@18:0:0), (@6:0:0) )" .RE .br .RS .IP "Sample constants:" ((4|4|1997), (4|10|1997)), ((12:01:00), (12:30:00)), ((4|4|1997@12:01:00), (4|10|1997@12:30:00)) .RE .IP "\fBRange Size\fP" 8 .RS .IP "format: (low size, high size)" 8 where low size <= high size. Sample constants: (23gb, 50gb) .RE .br .IP \fBServer\fP 8 Maps directly to the PBS server object. A .B Server manages one or more .B Que objects. .br Sample constant: NOSERVER .IP \fBCNode\fP 8 for computational node consisting of a single OS image, a shared memory, and a set of cpus. CNode runs 1 PBS MOM. .br Sample constant: NOCNODE .IP \fBQue\fP 8 Maps directly to the PBS queue object. A .B Que object spools one or more .B Job objects. .br Sample constant: NOQUE .IP \fBJob\fP 8 Maps directly to the PBS job object. A .B Job object carries some attributes and resource requirements. .br Sample constant: NOJOB .IP "\fBSet Server\fP" 8 list of Server objects. .br Sample constant: EMPTYSETSERVER .IP "\fBSet CNode\fP" 8 list of CNode objects. .br Sample constant: EMPTYSETCNODE .IP "\fBSet Que\fP" 8 list of Que objects. .br Sample constant: EMPTYSETQUE .IP "\fBSet Job\fP" 8 list of Job objects. .br Sample constant: EMPTYSETJOB .sp .SH "BASL-DEFINED CONSTANTS" These are constants that cannot be used for naming an identifier (see next topic). These are always in uppercase. .sp .Ty .nf DATA TYPE BASL-DEFINED CONSTANT =================== ============================================= Dayofweek SUN, MON, TUE, WED, THU, FRI, SAT Int SUCCESS, FAIL, FALSE, TRUE, SYNCRUN, ASYNCRUN, DELETE, RERUN, HOLD, RELEASE, SIGNAL, MODIFYATTR, MODIFYRES, SERVER_ACTIVE, SERVER_IDLE, SERVER_SCHED, SERVER_TERM, SERVER_TERMDELAY, QTYPE_E, QTYPE_R, SCHED_DISABLED, SCHED_ENABLED, TRANSIT, QUEUED, HELD, WAITING, RUNNING, EXITING, CNODE_OFFLINE, CNODE_DOWN, CNODE_FREE, CNODE_RESERVE, CNODE_INUSE_EXCLUSIVE, CNODE_INUSE_SHARED, CNODE_TIMESHARED, CNODE_CLUSTER, CNODE_UNKNOWN, OP_EQ, OP_NEQ, OP_LE, OP_LT, OP_GE, OP_GT, OP_MAX, OP_MIN, ASC, DESC Server NOSERVER Set Server EMPTYSETSERVER CNode NOCNODE Set CNode EMPTYSETCNODE Que NOQUE Set Que EMPTYSETQUE Job NOJOB Set Job EMPTYSETJOB String NULLSTR .fi .ft 1 .sp .SH IDENTIFIER Identifiers (used for variable names and function names) are in alphanumeric format, with the special underscore (_) character allowed. Currently, BASL can only handle identifiers with length of up to 80 chars. Also, you cannot use the BASL-defined constant names for naming an identifier. .SH STATEMENTS In BASL(2), you can have a single statement terminated by a semi-colon, or a group of statements (called compound statement or block) delimited by '{' and '}'. The different kinds of statements that can appear in a BASL code are: .RS .IP "1. expression statement" Expression statements are anything of the form: .sp .ft 3 .nf expr ; .fi .sp .ft 1 where .B expr can be: .RS .IP a) Arithmetic expressions .sp .ft 3 .nf lexpr + rexpr (add) lexpr \- rexpr (subtract) lexpr * rexpr (multiply) lexpr / rexpr (divide) lexpr % rexpr (modulus or remainder) .fi .sp .ft 1 NOTE: Adding, subtracting, multiplying, dividing, and remaindering will only be allowed for proper types and if the left and right expressions are of consistent types. The table below illustrates what types are consistent among the various operators: .sp For +: .sp .Ty .nf lexpr rexpr ============ ============ Int or Float Int or Float Size Size String String .fi .ft 1 .sp For \-, *, /: .sp .Ty .nf lexpr rexpr ============ ============ Int or Float Int or Float Size Size .fi .ft 1 .sp For %: .sp .Ty .nf lexpr rexpr ============ ============ Int or Float Int or Float .fi .ft 1 .sp Here are some sample arithmetic expressions statements: .Ty .nf Int i1; Int i2; Float f1; Float f2; Size sz1; Size sz2; String str1; String str2; i1 + i2; f1 \- i2; sz1 * sz2 * 2b; sz1 / 1024b; str1 = "basl"; str2 = " cool"; // the following is a string concatenation // operation resulting in the string: // "basl cool" str1 + str2; i1 % 10; .fi .IP b) Unary expressions .sp .ft 3 .nf +expr // positive \- multiplies by 1 an // expression that is // of Int, Float, or // Size type \-expr // negative \- multiplies by \-1 an // expression that is // of Int, Float, or // Size type !expr // not \- converts a non-zero expr // value into 0, and a // zero expr value into 1 // where expr type must be // of type Int or Float .fi .sp .ft 1 Some sample unary expressions: .Ty .nf Int i; +3; \-(i + 4); !i; .fi .IP c) Logical expressions .sp .ft 3 .nf lexpr EQ rexpr lexpr NEQ rexpr lexpr LT rexpr lexpr LE rexpr lexpr GT rexpr lexpr GE rexpr lexpr AND rexpr lexpr OR rexpr .fi .sp .ft 1 .B lexpr and .B rexpr must have types that are mutually consistent as shown in the following table: .sp .Ty .nf lterminal-expr rterminal-expr ============== ============== Int or Float Int or Float Dayofweek Dayofweek DateTime DateTime String String Size Size Server Server Que Que Job Job CNode CNode Set Server Set Server Set Que Set Que Set Job Set Job Set CNode Set CNode .fi .ft 1 .sp For .B AND, .B OR operators, the .B lexpr, .B rexpr consistent types are Int or Float. .sp Some sample logical expressions: .Ty .nf i1 EQ i2; i1 NEQ f2; dow1 LE dow2; d1 LT d2; str1 GT str2; sz1 GE sz2; .fi .IP d) Post-operator expressions .br These are expressions that are merely shortcut to assignment statements. .sp .ft 3 .nf IDENTIFIER++; // identifier=identifier+1 IDENTIFIER\-\-; // identifier=identifier-1 .fi .sp .ft 1 .B IDENTIFIER must be of Int or Float type. .sp Example: .Ty .nf Int i; Float f; i++; f\-\-; .fi .IP e) Function call .sp .ft 3 .nf function-name ( arg1 ,arg2 ... , argN ) .fi .sp .ft 1 where .B "arg1, ..., argN" can be any constant or variable. You can't have another function call as an argument. .br Example: .Ty .nf Void pr(Int a) { print(a); } pr(5); .fi .sp .ft 1 There are certain predefined functions that a scheduler writer can automatically call in his/her BASL code without a need to define it. These functions are referred to as assist functions (or helper functions) and they are discussed under .B "PREDEFINED FUNCTIONS" topic. .IP f) Constants .br Some valid constant expressions are given in the following: .nf 5; +1.2; SUN; MON; TUE; WED; THU; FRI; SAT; (4|4|1997); (12:01:00); (4|4|1997@12:01:00); "wonderful"; \-1b; SYNCRUN; ASYNCRUN; DELETE; RERUN; HOLD; RELEASE; SIGNAL; MODIFYATTR; MODIFYRES; (1, 3); (2.3, 4.6); (WED, FRI); ((4|4|1997), (4|10|1997)); ((12:01:00), (12:30:00)); ((4|4|1997@12:01:00), (4|10|1997@12:30:00)); (23gb, 50gb); NOSERVER; NOCNODE; NOQUE; NOJOB; EMPTYSETSERVER; EMPTYSETCNODE; EMPTYSETQUE; EMPTYSETJOB; NULLSTR; SUCCESS; FAIL; SERVER_ACTIVE; SERVER_IDLE; SERVER_SCHED; SERVER_TERM; SERVER_TERMDELAY; QTYPE_E; QTYPE_R; SCHED_DISABLED; SCHED_ENABLED; FALSE; TRUE; TRANSIT; QUEUED; HELD; WAITING; RUNNING; EXITING; CNODE_OFFLINE; CNODE_DOWN; CNODE_FREE; CNODE_RESERVE; CNODE_INUSE_EXCLUSIVE; CNODE_INUSE_SHARED; CNODE_TIMESHARED; CNODE_CLUSTER; CNODE_UNKNOWN; OP_EQ; OP_NEQ; OP_LE; OP_LT; OP_GE; OP_GT; OP_MAX; OP_MIN; .fi .IP g) Identifier .sp Example: .nf Int i; i; .fi .RE .IP "2. Assignment statement" .sp .B .nf IDENTIFIER = expr ; .fi .sp .ft 1 .B IDENTIFIER and .B expr must have types that are mutually consistent as illustrated in the following table: .sp .Ty .nf identifier expr =============== =============== Int Int, Float Float Int, Float Dayofweek Dayofweek DateTime DateTime String String Size Size Que Que Job Job CNode CNode Server Server Dayofweek Dayofweek DateTime DateTime Set Server Set Server Set Que Set Que Set Job Set Job Set CNode Set CNode Range Int Range Int Range Float Range Float Range Dayofweek Range Dayofweek Range DateTime Range DateTime Range Size Range Size .fi .IP "3. if...else statement" The format of an if statement is similar to that in C with the delimiting "{" and "}" always present: .sp .ft 3 .nf if( expr ) { zero or more (true) STATEMENTS } if( expr ) { zero or more (true) STATEMENTS } else { zero or more (false) STATEMENTS } .fi .sp .ft 1 The .B expr 's type must be either Int or Float, and after evaluation if its value is non-zero, then the true statements are executed. On the second form, if the .B expr evaluates to zero, then the false statements are executed. .sp Some sample .B if statements are given below: .sp .Ty .nf if (2 * x ) { y = y + 3; print(y); } if (2 * x ) { y = y + 3; } else { if( 3 * x ) { y = 4; } else { y = 5; } } .fi .IP "4. for loop statement" The format of a for statement is as follows: .sp .ft 3 .nf for( start; test; action ) { zero or more STATEMENTS } .fi .sp .ft 1 Just like in C, .B for first executes .B "start", then evaluates the .B test condition to see if it returns a non-zero value. If it does, the .B for statements are executed. After the .B for statements are executed, then .B action is evaluated, and then it checks the .B test condition again in the same manner as before. .B start and .B action can be a simple assignment expression or a post-operator expression. .B test is a logical/relational expression. Some sample for statements are given in the following: .sp .Ty .nf for (i = 0; i LT 3 ; i = i + 1) { print(i); } for (i = 0; i LT 2 * x; i++) { if (x GT 3) { y = 99; } else { x = 73; } } .fi .IP "5. foreach loop statement" This statement is primarily used for successively retrieving each element of a Set data type: Set Server, Set CNode, Set Job, Set Que. The syntax is: .sp .ft 3 .nf foreach ( IDENTIFIER1 in IDENTIFIER2 ) { zero or more STATEMENTS } .fi .sp .ft 1 where the following pairing of types for the identifiers are allowed: .sp .Ty .nf IDENTIFIER1 IDENTIFIER2 =========== =========== Server Set Server Que Set Que Job Set Job CNode Set CNode .fi .ft 1 .sp Example: .Ty .nf Server s; Que q; Job j; CNode c; Set Server ss; Set Que sq; Set Job sj; Set CNode sc; foreach(s in ss){ print(s); } foreach(q in sq){ print(q); } foreach(j in sj){ print(j); } foreach(c in sc){ print(c); } .fi .IP "6. while loop statement" The syntax of a while loop is: .sp .ft 3 .nf while ( expr ) { zero or more STATEMENTS } .fi .sp .ft 1 where .B expr must be of Int or Float type. If .B expr is non-zero, then the zero or more .Ty STATEMENTS are executed and .B expr is re-evaluated. .sp Example: .Ty .nf Int i; i = 3; while(i) { if( i EQ 0 ) { print("break on i = 1"); break; } i\-\-; } .fi .IP "7. switch statement" The switch statement is a mult-way decision that tests whether an identifier's value matches one of a number of values, and branches to a group of statements accordingly. .br The syntax for a switch statement is: .sp .ft 3 .nf switch( IDENTIFIER ) { case constant-expr : { zero or more STATEMENTS } case constant-expr : { zero or more STATEMENTS } ... case in constant-rangeOrSet-expr : { zero or more STATEMENTS } case in IDENTIFIER-rangeOrSettype : { zero or more STATEMENTS } default : { zero or more STATEMENTS } } .fi .sp .ft 1 where .B constant-expr is an .B expr of type Int, Float, Dayofweek, DateTime, Size, String, Server, Que, Job, or CNode. .B constant-rangeOrSet-expr and .B IDENTIFIER-rangeOrSettype can be of type Set Server, Set CNode, Set Que, Set Job, Range Int, Range Float, Range Dayofweek, Range DateTime, or Range Size. .sp .B IDENTIFIER cannot be of type Void. .B "IDENTIFIER"'s type must be consistent with .B "constant-expr"'s, .B "constant-rangeOrSet-expr"'s, and .B "IDENTIFIER-rangeOrSettype"'s type as illustrated in the following table: .BP .Ty .nf IDENTIFIER constant-range-expr, IDENTIFIER-rangetype =========== ========================================= Server Set Server Que Set Que Job Set Job CNode Set CNode Int Range Int Float Range Float Dayofweek Range Dayofweek DateTime Range DateTime Size Range Size .fi .ft 1 .sp If a case expression matches the .B "IDENTIFIER"'s value, then the corresponding block of statements are executed. Unlike in C, execution does NOT fall through to the next case statement. The reason for this is that .Ar basl2c will translate this .B switch statement into if-elseif-else construct. The case labeled default is executed if none of the other cases are satisfied. The .B default is optional; if it isn't there, and if none of the cases match, no action takes place. .sp Example: .Ty .nf Dayofweek dow; switch(dow) { case MON: { print("case MON"); } case TUE: { print("case TUE"); } case WED: { print("case WED"); } case THU: { print("case THU"); } case FRI: { print("case FRI"); } case SAT: { print("case SAT"); } case SUN: { print("case SUN"); } default: { print("case defaulted"); } } Int a; Range Int ri; ri = (10, 12); switch(a) { case in (1,5): { print("case 1,5"); } case in (6,9): { print("case 6,9"); } case in ri: { print("case ri"); } } .fi .IP "8. print statement" Print statement is capable of printing to stdout the value of any .B identifier or .B constant of type Int, Float, Dayofweek, DateTime, String, Size, Que, Job, CNode, Server, Range Int, Range Float, Range Dayofweek, Range DateTime, Range Size. .br The syntax is as follows: .sp .ft 3 .br .nf print ( IDENTIFIER ); print ( constant ); .fi .sp .ft 1 Example: .Ty .nf DateTime dt; CNode cn; dt = (4|4|1997@12:13:36); cn = AllNodesLocalHostGet(); print(dt); print(cn); .fi .sp .ft 1 For Set types, use .B foreach to go through each element and print as in: .sp .Ty .nf Server s; Set Server ss; ss = AllServersGet(); foreach(s in ss) { print(s); } .fi .sp .ft 1 .IP "9. continue statement" .sp .B .nf continue ; .fi .sp .ft 1 The .B continue statement must have been invoked within a .B for, .B foreach, and .B while loop. It causes the next iteration of the enclosing loop to begin. .IP "10. break statement" .sp .B .nf break ; .fi .sp .ft 1 The .B break statement must have been invoked within a .B for, .B foreach, and .B while loop. It provides an early exit from the enclosing loop. .IP "11. return statement" .sp .ft 3 .nf return(IDENTIFIER) ; return(constant) ; return() ; .fi .sp .ft 1 The return statement provides the value (if any) to be returned by a function. The type returned by .B IDENTIFIER and .B constant must match the calling function's return type. .B constant types allowed are anything except Set and Range types. The last format, .B "return()" is usually called within a function that doesn't return any value ( like .B sched_main() ). .IP "12. exit statement" .sp .B .nf exit(constant); .fi .sp .ft 1 where .B constant is of type Int. Calling this will terminate the scheduler. .IP "13. Comment statement" These are statements prefixed by "//" and they are ignored by the BASL compiler. .sp .Ty .nf // this line is ignored Int i; // string following the slashes is ignored .fi .sp .ft 1 .RE .SH OPERATOR PRECEDENCE AND ASSOCIATIVITY The following table shows the various operator precedence levels and associativity defined in the BASL language. The operators are listed in the order of decreasing precedence. The higher the precedence of an operator, the earlier it gets executed. The order in which the operators on the same level are executed depends on the associativity: left means the operators are seen from left to right, while right means they are seen from right to left. .sp .Ty .nf Operator Associativity ======================================= ============= ! ++ \-\- + (unary plus) \- (unary minus) right * / % left + \- left LT LE GT GE left EQ NEQ left AND left OR left = right .fi .ft 1 .SH PREDEFINED FUNCTIONS In BASL(2), a .B Server data type maps directly to a batch server object. Similarly, .B CNode is to mom/resmom, .B Job is to batch job, and .B Que is to batch queue. However, not all attributes to the PBS objects can be accessed from BASL. Only a subset of attributes, those that seemed to make sense in the context of a scheduler, are made available, and values to these attributes can be accessed by calling the following predefined functions, known also as assist/helper functions. .RS .IP "(1) Server-related functions" .RS .IP "\fBSet Server AllServersGet(void)\fP" Returns the list of servers specified in the configuration file for which the scheduler writer wants the system to periodically check for status, queues and jobs info. See .B pbs__sched__basl(8B) for a discussion on the format of the configuration file. .br CAUTION: This function must be called from inside .B sched_main() so that at every scheduling iteration, the most up to date .B "Set Server" structure is returned. .IP "\fBServer AllServersLocalHostGet(void)\fP" 3 Returns the Server object that represents the local host. unset value: NOSERVER. This is a simple function to call for non-cluster environments where only one server host exists. .br CAUTION: This function must be called from inside .B sched_main() (or from within function called by sched_main) so that at every scheduling iteration, the most up to date .B "Server" structure is returned. .IP "\fBString ServerInetAddrGet(Server s)\fP" Returns name for Server s. unset value: NULLSTR .IP "\fBString ServerDefQueGet(Server s)\fP" Returns the default_queue attribute of Server s. unset value: NULLSTR .IP "\fBInt ServerStateGet(Server s)\fP" Returns server_state attribute of Server s. .br .RS .IP "Return value:" SERVER_ACTIVE, SERVER_IDLE, SERVER_SCHED, SERVER_TERM, SERVER_TERMDELAY, \-1 (unset value) .RE .IP "\fBInt ServerMaxRunJobsGet(Server s)\fP" Returns max_running attribute of Server s. unset value: 0 .IP "\fBInt ServerMaxRunJobsPerUserGet(Server s)\fP" Returns max_user_run attribute of Server s. unset value: 0 .IP "\fBInt ServerMaxRunJobsPerGroupGet(Server s)\fP" Returns max_group_run attribute of Server s. unset value: 0 .IP "\fBSet Que ServerQueuesGet(Server s)\fP" Returns list of queues managed by Server s. .IP "\fBSet Job ServerJobsGet(Server s)\fP" Returns list of jobs managed by Server s. For obtaining a subset of this list, see \fBQueJobsGet()\fP. .IP "\fBInt ServerIntResAvailGet(Server s, String name)\fP" Returns the value to resource specified in .B name that is available to jobs run by this server (Server .At resources_available.name attribute). Call this function for resources with values that are of Int type. Sample resource names are: cput, pcput, walltime, mppt, pmppt, nice, procs, mppe, ncpus, pncpus, nodect, srfs_assist, mta,..., mth. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Int cpuAvail; // return the # of cpus currently available in // the server cpuAvail = ServerIntResAvailGet(server, "ncpus"); .fi .IP "\fBSize ServerSizeResAvailGet(Server s, String name)\fP" Returns the value to resource specified in .B name that is available to jobs run by this server (Server .At resources_available.name attribute). Call this function for resources with values that are of Size type. Sample resource names are: file, mem, pmem, workingset, pf, ppf, srfs_tmp, srfs_wrk, srfs_big, srfs_fast, sds, psds. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Size memAvail; // return the amount of available memory in // the server memAvail = ServerSizeResAvailGet(server, "mem"); .fi .IP "\fBString ServerStringResAvailGet(Server s, String name)\fP" Returns the value to resource specified in .B name that is available to jobs run by this server (Server .At resources_available.name attribute). Call this function for resources with values that are of String type. Sample resource names are: nodes, arch, neednodes. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf String type; // return the architecture (or os type) of // the server type = ServerStringResAvailGet(server, "arch"); .fi .IP "\fBInt ServerIntResAssignGet(Server s, String name)\fP" Returns the value to resource specified in .B name that is allocated to running jobs (Server .At resources_assigned.name attribute). Call this function for resources with values that are of Int type. Sample resource names are: cput, pcput, walltime, mppt, pmppt, nice, procs, mppe, ncpus, pncpus, nodect, srfs_assist, mta,..., mth. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Int cpuAssn; // return the # of cpus currently assigned in // the server cpuAssn = ServerIntResAssignGet(server, "ncpus"); .fi .IP "\fBSize ServerSizeResAssignGet(Server s, String name)\fP" Returns the value to resource specified in .B name that is allocated to running jobs (Server .At resources_assigned.name attribute). Call this function for resources with values that are of Size type. Sample resource names are: file, mem, pmem, workingset, pf, ppf, srfs_tmp, srfs_wrk, srfs_big, srfs_fast, sds, psds. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Size sdsAssn; // return the amount of sds space currently assigned // in the server sdsAssn = ServerSizeResAssignGet(server, "sds"); .fi .IP "\fBString ServerStringResAssignGet(Server s, String name)\fP" Returns the value to resource specified in .B name that is allocated to running jobs (Server .At resources_assigned.name attribute). Call this function for resources with values that are of String type. Sample resource names are: nodes, arch, neednodes. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .IP "\fBSet CNode ServerNodesGet(Server s)\fP" Returns the set of nodes managed by server s. unset value: EMPTYSETCNODE. .br NOTE: You can usually call the following functions for the nodes returned by this call: CNodeStateGet(), CNodePropertiesGet(), and CNodeTypeGet(). .IP "\fBInt ServerNodesQuery(Server s, String spec)\fP" Issues a request to the specified server to query the availability of resources specified in .B spec. At the present time, the only resource specification allowed is one that involves "nodes" and it can be of the format "nodes", "nodes=", or "nodes=". The query results can be accessed by calling the following functions: ServerNodesNumAvailGet(), ServerNodesNumAllocGet(), ServerNodesNumRsvdGet(), ServerNodesNumDownGet(). .br NOTE: This is a wrapper to the pbs_rescquery(3B) server function. .br .RS .IP "Return value:" SUCCESS, FAIL .RE .IP "\fBInt ServerNodesNumAvailGet(Server s)\fP" Returns the number of nodes available for those managed by the specified server, or as reflected by the most recent query specified by ServerNodesQuery(). If the return value is zero, then this means that some number of nodes currently needed to satisfy the specification of ServerNodesQuery() are currently unavailable. The request maybe satisfied at some later time. If the result is negative, no combination of known nodes can satisfy the specification. .IP "\fBInt ServerNodesNumAllocGet(Server s)\fP" Returns the number of nodes allocated for those managed by the specified server, or as reflected by the most recent query specified by ServerNodesQuery(). .IP "\fBInt ServerNodesNumRsvdGet(Server s)\fP" Returns the number of nodes reserved for those managed by the specified server, or as reflected by the most recent query specified by ServerNodesQuery(). .IP "\fBInt ServerNodesNumDownGet(Server s)\fP" Returns the number of nodes down for those managed by the specified server, or as reflected by the most recent query specified by ServerNodesQuery(). .IP "\fBInt ServerNodesReserve(Server s,String spec,Int resId)\fP" Issues a request to the specified server to reserve the resources specified in .B spec. A value of 0 for .B resId means that this is for doing a new reservation. Otherwise, the number will represent an existing (partial) reservation. Resources currently reserved for this .B resId will be released and the full reservation will be attempted again. At the present time the only resources which may be specified are "nodes". It should be specified as .B nodes=specification where specification is what a user specifies in the \-l option argument list for nodes, see qsub (1B). .br NOTE: This is a wrapper to the pbs_rescreserve(3B) server function. .br .RS .IP "Return value:" a reference number to a successful or partially-successful reservation, or FAIL .RE .IP "\fBInt ServerNodesRelease(Server s, Int resId)\fP" This releases or frees resources reserved with the reference number specified in .B resId. .br NOTE: This is a wrapper to the pbs_rescrelease(3B) server function. .br .RS .IP "Return value:" SUCCESS, or FAIL .RE .RE .IP "(2) Que-related functions:" .RS .IP "\fBString QueNameGet( Que que )\fP" Returns name of Que que. unset value: NULLSTR .IP "\fBInt QueTypeGet( Que que )\fP" Returns queue_type attribute of Que que. .br Return value: QTYPE_E (Execution), QTYPE_R (Routing), \-1 (unset value) .IP "\fBInt QueNumJobsGet( Que que )\fP" Returns number of jobs residing in Que que. unset value: 0 .IP "\fBInt QueMaxRunJobsGet( Que que )\fP" Returns max_running attribute of Que que. unset value: 0 .IP "\fBInt QueMaxRunJobsPerUserGet( Que que )\fP" Returns max_user_run attribute of Que que. unset value: 0 .IP "\fBInt QueMaxRunJobsPerGroupGet( Que que )\fP" Returns max_group_run attribute of Que que. unset value: 0 .IP "\fBInt QuePriorityGet( Que que )\fP" Returns Priority attribute of Que que. unset value: 0 .IP "\fBInt QueStateGet( Que que )\fP" Returns started attribute of Que que \- the job execution selection state of the que: SCHED_DISABLED, SCHED_ENABLED. unset value: SCHED_DISABLED .IP "\fBSet Job QueJobsGet( Que que )\fP" Returns the list of jobs currently residing in que. .IP "\fBInt QueIntResAvailGet(Que q, String name)\fP" Returns the value to resource specified in .B name that is available to jobs running from this q (Que .At resources_available.name attribute). Call this function for resources with values that are of Int type. Sample resource names are: cput, pcput, walltime, mppt, pmppt, nice, procs, mppe, ncpus, pncpus, nodect, srfs_assist, mta,..., mth. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .IP "\fBSize QueSizeResAvailGet(Que q, String name)\fP" Returns the value to resource specified in .B name that is available to jobs running from this q (Que .At resources_available.name attribute). Call this function for resources with values that are of Size type. Sample resource names are: file, mem, pmem, workingset, pf, ppf, srfs_tmp, srfs_wrk, srfs_big, srfs_fast, sds, psds. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .IP "\fBString QueStringResAvailGet(Que q, String name)\fP" Returns the value to resource specified in .B name that is available to jobs running from this q (Que .At resources_available.name attribute). Call this function for resources with values that are of String type. Sample resource names are: nodes, arch, neednodes. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .IP "\fBInt QueIntResAssignGet(Que q, String name)\fP" Returns the value to resource specified in .B name that is allocated to jobs running from this queue (Que .At resources_assigned.name attribute). Call this function for resources with values that are of Int type. Sample resource names are: cput, pcput, walltime, mppt, pmppt, nice, procs, mppe, ncpus, pncpus, nodect, srfs_assist, mta,..., mth. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .IP "\fBSize QueSizeResAssignGet(Que q, String name)\fP" Returns the value to resource specified in .B name that is allocated to jobs running from this q (Que .At resources_assigned.name attribute). Call this function for resources with values that are of Size type. Sample resource names are: file, mem, pmem, workingset, pf, ppf, srfs_tmp, srfs_wrk, srfs_big, srfs_fast, sds, psds. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .IP "\fBString QueStringResAssignGet(Que q, String name)\fP" Returns the value to resource specified in .B name that is allocated to jobs running from this q (Que .At resources_assigned.name attribute). Call this function for resources with values that are of String type. Sample resource names are: nodes, arch, neednodes. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .RE .IP "(3) Job-related functions" .RS .IP "\fBString JobIdGet( Job job )\fP" Returns job identifier of Job job. unset value: NULLSTR .IP "\fBString JobNameGet( Job job )\fP" Returns Job_Name attribute of Job job. unset value: NULLSTR .IP "\fBString JobOwnerNameGet( Job job )\fP" Returns Job_Owner attribute of Job job. unset value: NULLSTR .IP "\fBString JobEffectiveUserNameGet( Job job)\fP" Returns euser attribute of Job job. .IP "\fBString JobEffectiveGroupNameGet(Job job)\fP" Returns egroup attribute of Job job. unset value: NULLSTR .IP "\fBInt JobStateGet ( Job job )\fP" Returns job_state attribute of Job job. .br .RS .IP "Return value:" TRANSIT, QUEUED, HELD, WAITING, RUNNING, EXITING, \-1 (unset value) .RE .IP "\fBInt JobPriorityGet( Job job )\fP" Returns Priority attribute of Job job. unset value: 0 .IP "\fBInt JobRerunFlagGet( Job job )\fP" Returns Rerunable attribute of Job job. .br Return value: FALSE, TRUE, \-1 (unset value) .IP "\fBInt JobInteractiveFlagGet( Job job )\fP" Returns interactive attribute of Job job. .br Return value: FALSE, TRUE. unset value: FALSE .IP "\fBDateTime JobDateTimeCreatedGet(Job job)\fP" Returns the ctime attribute of Job job. unset value: (0|0|0@-1:-1:-1) .IP "\fBString JobEmailAddrGet( Job job )\fP" Returns the Mail_Users attribute of Job job. unset value: NULLSTR .IP "\fBString JobStageinFilesGet( Job job )\fP" Returns the stagein attribute of Job job. unset value: NULLSTR .IP "\fBString JobStageoutFilesGet( Job job )\fP" Returns stageout attribute of Job job. unset value: NULLSTR .IP "\fBInt JobIntResReqGet(Job job, String name)\fP" Returns the value to resource specified in .B name as required by the job (Job .At Resource_List.name attribute). Call this function for resources with values that are of Int type. Sample resource names are: cput, pcput, walltime, mppt, pmppt, nice, procs, mppe, ncpus, pncpus, nodect, srfs_assist, mta,..., mth. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Int cputReq; // returns the cput requirement of the job cputReq = JobIntResReqGet(job, "cput"); .fi .IP "\fBSize JobSizeResReqGet(Job job, String name)\fP" Returns the value to resource specified in .B name as required by the job (Job .At Resource_List.name attribute). Call this function for resources with values that are of Size type. Sample resource names are: file, mem, pmem, workingset, pf, ppf, srfs_tmp, srfs_wrk, srfs_big, srfs_fast, sds, psds. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Size memReq; // returns the memory requirement of the job memReq = JobSizeResReqGet(job, "mem"); .fi .IP "\fBString JobStringResReqGet(Job job, String name)\fP" Returns the value to resource specified in .B name as required by the job (Job .At Resource_List.name attribute). Call this function for resources with values that are of String type. Sample resource names are: nodes, arch, neednodes. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf String nodes; // returns the nodes requirement property of // the job nodes = JobStringResReqGet(job, "nodes"); .fi .IP "\fBInt JobIntResUseGet(Job job, String name)\fP" Returns the value to resource specified in .B name used by the job (Job .At resources_used.name attribute). Call this function for resources with values that are of Int type. Sample resource names are: cput, pcput, walltime, mppt, pmppt, nice, procs, mppe, ncpus, pncpus, nodect, srfs_assist, mta,..., mth. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Int walltUse; // returns the amount of walltime used by // the job walltUse = JobIntResUseGet(job, "walltime"); .fi .IP "\fBSize JobSizeResUseGet(Job job, String name)\fP" Returns the value to resource specified in .B name used by the job (Job .At resources_used.name attribute). Call this function for resources with values that are of Size type. Sample resource names are: file, mem, pmem, workingset, pf, ppf, srfs_tmp, srfs_wrk, srfs_big, srfs_fast, sds, psds. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .sp Example: .Ty .nf Size srfsUse; // returns the amount of srfs_fast used by // the job srfsUse = JobSizeResUseGet(job, "srfs_fast"); .fi .IP "\fBString JobStringResUseGet(Job job, String name)\fP" Returns the value to resource specified in .B name used by the job (Job .At resources_used.name attribute). Call this function for resources with values that are of String type. Sample resource names are: nodes, arch, neednodes. For a description of these resource names, see pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .RE .IP "(4) CNode-related functions" .RS .IP "\fBSet CNode AllNodesGet(void)\fP" Returns list of nodes that are managed by the server running on the local host. This could also include those nodes that were specified in the scheduler configuration file for which the scheduler writer wants the system to periodically check for information like state, property, and so on. See .B pbs_sched_basl(8B) for a discussion of configuration file format. .br CAUTION: This function must be called from inside .B sched_main() so that at every scheduling iteration, the most up to date .B "Set CNode" structure is returned. Do not call this from an assignment statement intended to initialize a global variable, as the statement will only be called once. .IP "\fBCNode AllNodesLocalHostGet(void)\fP" Returns the CNode object that represents the local host. This is a simple function to call for non-clustered systems where only 1 CNode exists. unset value: NOCNODE .br CAUTION: This function must be called from inside .B sched_main() (or from within functions called by sched_main) so that at every scheduling iteration, the most up to date .B "CNode" structure is returned. Do not call this from an assignment statement intended to initialize a global variable, as the statement will only be called once. .IP "\fBString CNodeNameGet(CNode node)\fP" Returns the unique (official) name of the node (i.e. ResMom hostname in a 1 mom/node model). This returns the same string that was specified in the configuration file. unset value: NULLSTR .IP "\fBString CNodeOsGet(CNode node)\fP" Returns the os architecture of the node (i.e. "irix5", "sp2"). unset value: NULLSTR .IP "\fBInt CNodeStateGet( CNode node )\fP" Returns the node's state. .br .RS .IP "Return value:" CNODE_OFFLINE, CNODE_DOWN, CNODE_FREE, CNODE_RESERVE, CNODE_INUSE_EXCLUSIVE, CNODE_INUSE_SHARED, CNODE_UNKNOWN .RE .IP "\fBInt CNodeTypeGet( CNode node )\fP" Returns the node's type. .br .RS .IP "Return value:" CNODE_TIMESHARED, CNODE_CLUSTER, CNODE_UNKNOWN .RE .IP "\fBString CNodePropertiesGet(CNode node)\fP" Returns the comma-separated list of other names the node is known by ( properties, other network name). For example, "babbage.OpenPBS.org" maybe the node name, but it could also be known via "babbage1, babbage2". unset value: NULLSTR .IP "\fBString CNodeVendorGet(CNode node)\fP" Returns the name of the vendor for the hardware of the machine (i.e. "sgi", "ibm"). unset value: NULLSTR .IP "\fBInt CNodeNumCpusGet(CNode node)\fP" Returns the number of processors attached to the node. unset value: \-1 .IP "\fBSize CNodeMemTotalGet( CNode node, String type )\fP" Returns total memory of .B type for the node. .B type is an arbitrary string that the scheduler writer defines in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf // get total physical memory CNodeMemTotalGet(node, "real") // get total virtual memory CNodeMemTotalGet(node, "virtual") .fi .IP "\fBSize CNodeMemAvailGet( CNode node, String type )\fP" Returns available memory of .B type for the node. .B type is an arbitrary string that the scheduler writer defines in the scheduler configuration file. unset value: \-1b .br So sample calls will be: .Ty .nf // get available physical memory CNodeMemAvailGet(node, "real") // get available virtual memory CNodeMemAvailGet(node, "virtual") .fi .IP "\fBInt CNodeIdletimeGet( CNode node )\fP" Returns number of seconds in which no keystroke or mouse movement has taken place on any terminal connected to the node. unset value: \-1 .IP "\fBFloat CNodeLoadAveGet( CNode node )\fP" Returns node's load average for all cpus. unset value: \-1.0 .IP "\fBInt CNodeCpuPercentIdleGet( CNode node )\fP" Returns the percent of idle time that all the processors of the node have experienced. .IP "\fBInt CNodeCpuPercentSysGet( CNode node )\fP" Returns the percent of time that all the processors of the node have spent running kernel code. .IP "\fBInt CNodeCpuPercentUserGet( CNode node )\fP" Returns the percent of time that all the processors of the node have spent running user code. .IP "\fBInt CNodeCpuPercentGuestGet( CNode node )\fP" Returns the percent of time that all the processors of the node have spent running a guest operating system. .IP "\fBInt CNodeNetworkBwGet( CNode node, String type )\fP" Returns the bandwidth of the node's network of .B type in bytes/second. .B type is defined by the scheduler writer in the scheduler configuration file. unset value: \-1 .br Some sample calls are: .Ty .nf CNodeNetworkBwGet( node, "hippi" ); CNodeNetworkBwGet( node, "fddi" ); .fi .IP "\fBSize CNodeDiskSpaceTotalGet(CNode node, String name)\fP" Returns the node's total space on disk identified by .B name where .B name is the device name arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeDiskSpaceTotalGet( node, "/scratch2" ); .fi .IP "\fBSize CNodeDiskSpaceAvailGet(CNode node, String name)\fP" Returns the node's available space on disk identified by .B name where .B name is arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeDiskSpaceAvailGet( node, "/scratch1" ); .fi .IP "\fBSize CNodeDiskSpaceReservedGet(CNode node, String name)\fP" Returns the node's reserved space on disk (user quota?) identified by .B name where .B name is arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeDiskSpaceReservedGet( node, "/scratch1" ); .fi .IP "\fBInt CNodeDiskInBwGet( CNode node, String name )\fP" Returns the write bandwidth (bytes/sec) of the node's disk identified by .B "name". unset value: \-1 .br Example: .Ty .nf CNodeDiskInBwGet( node, "/fast" ); .fi .IP "\fBInt CNodeDiskOutBwGet( CNode node, String name )\fP" Returns read bandwidth (bytes/sec) of the node's disk identified by .B "name". unset value: \-1 .br Example: .Ty .nf CNodeDiskOutBwGet( node, "/big" ); .fi .IP "\fBSize CNodeSwapSpaceTotalGet( CNode node, String name )\fP" Returns the node's total space on swap identified by .B name where .B name is arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeSwapSpaceTotalGet( node, "primary" ); .fi .IP "\fBSize CNodeSwapSpaceAvailGet( CNode node, String name )\fP" Returns node's available space on swap identified by .B name where .B name is the device name arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeSwapSpaceAvailGet( node, "secondary" ); .fi .IP "\fBInt CNodeSwapInBwGet( CNode node, String name )\fP" Returns swapin rate of the node's swap device identified by .B name. .br Example: .Ty .nf CNodeSwapInBwGet(node, "secondary"); .fi .IP "\fBInt CNodeSwapOutBwGet( CNode node, String name )\fP" Returns the swapout rate of the node's swap device identified by .B name. unset value: \-1 .br Example: .Ty .nf CNodeSwapOutBwGet(node, "primary"); .fi .IP "\fBSize CNodeTapeSpaceTotalGet( CNode node, String name )\fP" Returns the node's total space on tape identified by .B name where .B name is arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeTapeSpaceTotalGet(node, "4mm"); .fi .IP "\fBSize CNodeTapeSpaceAvailGet( CNode node, String name )\fP" Returns the node's available space on tape identified by .B name where .B name is arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .nf CNodeTapeSpaceAvailGet(node, "8mm"); .fi .IP "\fBInt CNodeTapeInBwGet( CNode node, String name )\fP" Returns the write bandwidth (bytes/sec) of the node's tape identified by .B "name". unset value: \-1 .br Example: .Ty .nf CNodeTapeInBwGet( node, "4mm" ); .fi .IP "\fBInt CNodeTapeOutBwGet( CNode node, String name )\fP" Returns the read bandwidth (bytes/sec) of the node's tape identified by .B "name". unset value: \-1 .br Example: .Ty .nf CNodeTapeOutBwGet( node, "8mm" ); .fi .IP "\fBSize CNodeSrfsSpaceTotalGet( CNode node, String name )\fP" Returns the node's total space on srfs device identified by .B name where .B name is arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeSrfsSpaceTotalGet(node, "/fast"); .fi .IP "\fBSize CNodeSrfsSpaceAvailGet( CNode node, String name )\fP" Returns the node's available space on srfs device identified by .B name where .B name is arbitrarily defined by the scheduler writer in some configuration file. unset value: \-1b .br Example: .Ty .nf CNodeSrfsSpaceAvailGet( node, "/big" ); .fi .IP "\fBSize CNodeSrfsSpaceReservedGet(CNode node, String name)\fP" Returns the node's total amount of reserved space on srfs device identified by .B name where .B name is arbitrarily defined by the scheduler writer in the scheduler configuration file. unset value: \-1b .br Example: .Ty .nf CNodeSrfsSpaceReservedGet( node, "/fast" ); .fi .IP "\fBInt CNodeSrfsInBwGet( CNode node, String name )\fP" Returns the write bandwidth (bytes/sec) of the node's srfs device identified by .B "name". unset value: \-1 .br Example: .nf CNodeSrfsInBwGet( node, "/fast" ); .fi .IP "\fBInt CNodeSrfsOutBwGet( CNode node, String name )\fP" Returns the read bandwidth (bytes/sec) of the node's srfs device identified by .B "name". unset value: \-1 .br Example: .nf CNodeSrfsOutBwGet( node, "/big" ); .fi .RE .IP "(5) Miscellaneous Functions" .RS .IP "\fBDateTime datetimeGet()\fP" gets the current date/time. .IP "\fBInt datetimeToSecs(DateTime dt)\fP" returns the # of seconds since epoch (beginning of UNIX time \- 00:00:00, January 1, 1970) for the given date/time .B dt. .IP "\fBInt JobAction( Job job, Int action, String param )\fP" Performs .B action on .B job with a .B param specified depending on the action. .B action can be: SYNCRUN, ASYNCRUN, DELETE, RERUN, HOLD, RELEASE, SIGNAL, MODIFYATTR, MODIFYRES where: .br .Ty .nf Action Description =============== ========================== SYNCRUN runs the job synchronously, meaning the call to JobAction() will only return when the job has started running or when an error has been encountered. Param value: name of host(s) to run job under. ASYNCRUN runs the job asynchronously, meaning the call to JobAction() will return immediately as soon as the run request is validated by the PBS server, and not necessarily when the job has started execution. Param value: name of host(s) to run job under. DELETE deletes the job. Param value: "deldelay=<# of secs>" \- delay # of seconds between the sending of SIGTERM and SIGKILL to the job before getting deleted. RERUN reruns the running job, which involves terminating the session leader of the job and returning the job to the queued state. HOLD places one or more holds on the job. Param value: "u", "o", "s", "uo", "os", "uos" \- type of holds to place on job: u(ser), o(ther), s(ystem). RELEASE removes or releases holds placed on jobs. Param value: "u", "o", "s", "uo", "os", "uos" \- type of holds to remove from job: u(ser), o(ther), s(ystem). SIGNAL sends a signal to the executing job. Param value: "HUP", "SIGHUP",... MODIFYATTR modifies the specified attribute of the job to the given value, when the attrib_name is != "Resource_List" or "resources_used". Param value: "attrib_name=value" MODIFYRES modifies the job's Resource_List attribute given the res_name and the res_value: Resource_List.res_name= res_value Param value: "res_name=res_val" .fi .br .B param value depends on the action. Specify NULLSTR if no value for this parameter is desired. .br Return value: SUCCESS or FAIL. .br NOTE: Any unrecognized .B action is ignored. .br Example: .Ty .nf // run Job j synchronously JobAction(j, SYNCRUN, NULLSTR); // run Job j asynchronously on host "db" JobAction(j, ASYNCRUN, "db"); // delete Job j JobAction(j, DELETE, NULLSTR); // delete Job j with a delay of 5 secs // between the sending of SIGTERM and // SIGKILL JobAction(j, DELETE, "deldelay=5"); // rerun Job j JobAction(j, RERUN, NULLSTR); // place a u(ser) hold on Job j JobAction(j, HOLD, "u"); // place an o(ther) hold on Job j JobAction(j, HOLD, "o"); // place a s(ystem) hold on Job j JobAction(j, HOLD, "s"); // place a default hold (u) on Job j JobAction(j, HOLD, NULLSTR); // release u(ser) hold from Job j JobAction(j, RELEASE, "u"); // release o(ther) hold from Job j JobAction(j, RELEASE, "o"); // release s(ystem) hold from Job j JobAction(j, RELEASE, "s"); // release default hold (u) from Job j JobAction(j, RELEASE, NULLSTR); // send SIGHUP signal to Job j JobAction(j, SIGNAL, "SIGHUP"); // update the comment attribute of Job // j to "a message". // The param format is: attribute_name=new_value // Consult PBS documentation for a list of job // attribute names that can be specified. JobAction(j, MODIFYATTR, "comment=a message"); // update the Resource_List.cput attribute of Job // j to 3600 seconds. // The param format is: resource_name=new_value // See pbs_resources* man page for a list of // resource_names that can be specified. JobAction(j, MODIFYRES, "cput=3600"); .fi .IP "\fBQueJobFind(Que que,Fun Int func,Int cpr,Int value);\fP" .IP "\fBQueJobFind(Que que,Fun String func,Int cpr,String value);\fP" .IP "\fBQueJobFind(Que que,Fun DateTime func,Int cpr,DateTime value);\fP" .IP "\fBQueJobFind(Que que,Fun Size func,Int cpr,Size value);\fP" .sp where .B cpr is one of: OP_EQ, OP_NEQ, OP_LE, OP_LT, OP_GE, OP_GT. .B func is a function whose ONLY argument is of Job type. .B Job is the return type. .sp Description: Applies .B func to every job in .B que , and return the first job that satisfies the logical comparison: .B "func(job) cpr value" .sp Example: .sp .Ty .nf Size JobVirtualMemAvailGet(Job job) { Size sz; sz = JobSizeResReqGet(job, "mem"); return(sz); } Int JobWallTimeReqGet(Job job) { Int wallt; wallt = JobIntResReqGet(job, "walltime"); return(wallt); } Int JobCpuTimeUsedGet(Job job) { Int cput; cput = JobIntResUseGet(job, "cput"); return(cput); } Que findQueByName(Set Que queues, String qname) { Que q; foreach(q in queues) { if( QueNameGet(q) EQ qname ) { return(q); } } return(NOQUE); } sched_main() { Server s; Que que; Set Que sq; // get local server s = AllServersLocalHostGet(); // get the queues of the Server s sq = ServerQueuesGet(s); // get the queue named "fast" from the // local server que = findQueByName( sq, "fast" ); // Find the 1st job whose walltime requirement // is == 300s: QueJobFind(que, JobWallTimeReqGet, OP_EQ, 300); // Find the 1st job whose email address to // notify about job activity != "bayucan": QueJobFind(que, JobEmailAddrGet, OP_NEQ, "bayucan"); // Find the 1st job that was created after // or on 3/3/1997: QueJobFind(que, JobDateTimeCreatedGet, OP_GE, (3|3|1997)); // Find the 1st job that was created after // 3:3:44: QueJobFind(que, JobDateTimeCreatedGet, OP_GT, (3:3:44)); // Find the 1st job that was created after // 3:3:44 on 3/3/1997: QueJobFind(que, JobDateTimeCreatedGet, OP_GT, (3|3|1997@3:3:44)); // Find the 1st job whose cpu time used < 1600s: QueJobFind(que, JobCpuTimeUsedGet, OP_LT, 1600); // Find the 1st job whose virtual memory // requirement <= 300mb: QueJobFind(que, JobVirtualMemAvailGet, OP_LE, 300mb); } .fi .IP "\fBJob QueJobFind( Que que, Fun Int func, Int cpr)\fP" .IP "\fBJob QueJobFind( Que que, Fun String func, Int cpr)\fP" .IP "\fBJob QueJobFind( Que que, Fun DateTime func, Int cpr)\fP" .IP "\fBJob QueJobFind( Que que, Fun Size func, Int cpr)\fP" .sp where .B cpr can be one of the following: OP_MAX, OP_MIN, .B func is a function whose only argument is of Job type. .sp Description: Returns the Job with the max or min value found for .B func(job) as it is applied to every job in .B "que". .sp Example: .Ty .nf Int JobCpuTimeReqGet(Job job) { Int cput; cput = JobIntResReqGet(job, "cput"); return(cput); } sched_main() { Que que; Job job; // Find the Job with the highest cpu time // requirement: job = QueJobFind(que, JobCpuTimeReqGet, OP_MAX); // Find the Job with the minimum cpu time // requirement: job = QueJobFind(que, JobCpuTimeReqGet, OP_MIN); } .fi .IP "\fBQue QueFilter(Que que,Fun Int func,Int cpr,Int value)\fP" .IP "\fBQue QueFilter(Que que,Fun String func,Int cpr,String value)\fP" .IP "\fBQue QueFilter(Que que,Fun DateTime func,Int cpr,Date value)\fP" .IP "\fBQue QueFilter(Que que,Fun Size func,Int cpr,Size value)\fP" .sp where .B cpr can be one of the following: OP_EQ, OP_NEQ, OP_LE, OP_LT, OP_GE, OP_GT, .B func is a function whose only argument is of Job type. .sp Description: Applies .B func to every job in .B que , and returns a new que containing all jobs that satisfies the comparison condition: .B "func(job) cpr value" .sp Example: .br .Ty .nf Int JobWallTimeReqGet(Job job) { Int wallt; wallt = JobIntResReqGet(job, "walltime"); return(wallt); } sched_main() { Que que; Que newq; // Returns a new que containing all jobs in "que" // with a walltime requirement == 300s: newq = QueFilter(que, JobWallTimeReqGet, OP_EQ, 300); // Returns a new que containing all jobs in "que" // with an email address != "bayucan": newq = QueFilter(que, JobEmailAddrGet, OP_NEQ, "bayucan"); // Returns a new que containing all jobs in "que" // created after or on 3/3/1997: newq = QueFilter(que, JobDateTimeCreatedGet, OP_GE, (3|3|1997)); // Returns a new que containing all jobs in "que" // created after 3:3:44: newq = QueFilter(que, JobDateTimeCreatedGet, OP_GT, (3:3:44)); // Returns a new que containing all jobs in "que" // created after 3:3:44 on 3/3/1997: newq = QueFilter(que, JobDateTimeCreatedGet, OP_GT, (3|3|1997@3:3:44)); // NOTE: The original "que" is not modified // whatsoever. } .fi .IP "\fBInt Sort(Set Job s, Fun Int key, Int order)\fP" .IP "\fBInt Sort(Set Job s, Fun String key, Int order)\fP" .IP "\fBInt Sort(Set Job s, Fun Float key, Int order)\fP" .IP "\fBInt Sort(Set Job s, Fun DateTime key, Int order)\fP" .IP "\fBInt Sort(Set Job s, Fun Size key, Int order)\fP" .sp where .B s the set of jobs to sort. .B key is the sorting key which is a function whose only argument is of Job type, .B order is the sorting order: ASC, DESC. .sp Description: sorts the elements of .B s , in either ASCending or DESCending order of values that were returned by the .B key function, as applied to every member of the set of jobs. The .B s object is modified with this call. This returns SUCCESS or FAIL depending on outcome of the sort. .sp Examples: .br .Ty .nf Size JobMemReqGet(Job job) { Size mem; mem = JobSizeResReqGet(job, "mem"); return(mem); } sched_main() { Server master; Set Job jobs; Int order; // get local server master = AllServersLocalHostGet(); jobs = ServerJobsGet(master); Sort(jobs, JobPriorityGet, ASC); Sort(jobs, JobIdGet, DESC); order = ASC; Sort(jobs, JobDateTimeCreatedGet, order); order = DESC; Sort(jobs, JobMemReqGet, order); } .fi .IP "\fBInt Sort(Set Que s, Fun Int key, Int order)\fP" .IP "\fBInt Sort(Set Que s, Fun String key, Int order)\fP" .IP "\fBInt Sort(Set Que s, Fun Float key, Int order)\fP" .IP "\fBInt Sort(Set Que s, Fun DateTime key, Int order)\fP" .IP "\fBInt Sort(Set Que s, Fun Size key, Int order)\fP" .sp where .B s the set of queues to sort. .B key is the sorting key which is a function whose only argument is of Que type, .B order is the sorting order: ASC, DESC. .sp Description: sorts the elements of .B s , in either ASCending or DESCending order of values that were returned by the .B key function, as applied to every member of the set of queues. The .B s object is modified with this call. This returns SUCCESS or FAIL depending on outcome of the sort. .sp Examples: .br .Ty .nf Size QueMemAvailGet(Que que) { Size mem; mem = QueSizeResAvailGet(que, "mem"); return(mem); } sched_main() { Server master; Set Que ques; Int order; // get local server master = AllServersLocalHostGet(); ques = ServerQueuesGet(master); Sort(ques, QuePriorityGet, ASC); Sort(ques, QueNameGet, ASC); order = DESC; Sort(ques, QueMemAvailGet, order); } .fi .IP "\fBInt Sort(Set Server s, Fun Int key, Int order)\fP" .IP "\fBInt Sort(Set Server s, Fun String key, Int order)\fP" .IP "\fBInt Sort(Set Server s, Fun Float key, Int order)\fP" .IP "\fBInt Sort(Set Server s, Fun DateTime key, Int order)\fP" .IP "\fBInt Sort(Set Server s, Fun Size key, Int order)\fP" .sp where .B s the set of servers to sort. .B key is the sorting key which is a function whose only argument is of Server type, .B order is the sorting order: ASC, DESC. .sp Description: sorts the elements of .B s , in either ASCending or DESCending order of values that were returned by the .B key function, as applied to every member of the set of servers. The .B s object is modified with this call. This returns SUCCESS or FAIL depending on outcome of the sort. .sp Examples: .br .Ty .nf Size ServerMemAvailGet(Server serv) { Size mem; mem = ServerSizeResAvailGet(serv, "mem"); return(mem); } sched_main() { Set Server sserver; Int order; Int ret; sserver = AllServersGet(); ret = Sort(sserver, ServerMaxRunJobsGet, ASC); Sort(sserver, ServerInetAddrGet, ASC); order = DESC; Sort(sserver, ServerMemAvailGet, order); } .fi .IP "\fBInt Sort(Set CNode s, Fun Int key, Int order)\fP" .IP "\fBInt Sort(Set CNode s, Fun String key, Int order)\fP" .IP "\fBInt Sort(Set CNode s, Fun Float key, Int order)\fP" .IP "\fBInt Sort(Set CNode s, Fun DateTime key, Int order)\fP" .IP "\fBInt Sort(Set CNode s, Fun Size key, Int order)\fP" .sp where .B s the set of nodes to sort. .B key is the sorting key which is a function whose only argument is of CNode type, .B order is the sorting order: ASC, DESC. .sp Description: sorts the elements of .B s , in either ASCending or DESCending order of values that were returned by the .B key function, as applied to every member of the set of nodes. The .B s object is modified with this call. This returns SUCCESS or FAIL depending on outcome of the sort. .sp Examples: .br .Ty .nf Size CNodeMyMemAvailGet(CNode cn) { Size mem; mem = CNodeMemAvailGet(cn, "virtual"); return(mem); } sched_main() { Set CNode scnode; Int order; scnode = AllNodesGet(); Sort(scnode, CNodeIdletimeGet, ASC); Sort(scnode, CNodeNameGet, ASC); order = DESC; Sort(scnode, CNodeMyMemAvailGet, order); } .fi .RE .RE .SH CNode..Get() FUNCTIONS The return values of the CNode..Get() functions discussed in the previous section are obtained by sending resource queries to the CNode's MOM at every scheduling iteration. For example, .Ty CNodeLoadAveGet(node) will return the value obtained from some query (this could be the string "loadave") as sent to the node's MOM. The " \-> CNode..Get()" mappings are established internally, but they can be modified or more mappings can be added via the scheduler configuration file. The config file is discussed in .B pbs_sched_basl(8B). .br Mappings already established are given in the following: .sp For all architectures: .sp .Ty .nf CNode..Get() actual call host resource ======================== ============= CNodeOsGet(node) arch CNodeLoadAveGet(node) loadave CNodeIdletimeGet(node) idletime .fi .ft 1 .sp .SH SEE ALSO pbs_sched_basl(8B) pbs_job_attributes(7B), pbs_queue_attributes(7B), pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), and pbs_server(8B), pbs_resources_irix6(7B), pbs_resources_linux(7B). .RE torque-2.4.16/doc/man1/qmgr.1.in0000664000113300011330000002407011272401251013070 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qmgr 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qmgr \- pbs batch system manager .SH SYNOPSIS qmgr [\^\-a\^] [\^\-c\ command\^] [\^\-e\^] [\^\-n\^] [\^\-z\^] [\^server...] .SH DESCRIPTION The .B qmgr command provides an administrator interface to the batch system. .LP The command reads directives from standard input. The syntax of each directive is checked and the appropriate request is sent to the batch server or servers. .LP The list or print subcommands of qmgr can be executed by general users. Creating or deleting a queue requries PBS Manager privilege. Setting or unsetting server or queue attributes requires PBS Operator or Manager privilege. .SH OPTIONS .IP "\-a" 12 Abort .B qmgr on any syntax errors or any requests rejected by a server. .IP "\-c command" Execute a single .Ar command and exit .B qmgr . .IP "\-e" Echo all commands to standard output. .IP "\-n" No commands are executed, syntax checking only is performed. .IP "\-z" No errors are written to standard error. .LP .SH OPERANDS The .Ar server operands identify the name of the batch server to which the administrator requests are sent. Each .Ar server conforms to the following syntax: .br .Ty \ \ \ \ host_name[:port] .br where .Ty host_name is the network name of the host on which the server is running and .Ty port is the port number to which to connect. If .Ty port is not specified, the default port number is used. .LP If .Ar server is not specified, the administrator requests are sent to the local server. .SH STANDARD INPUT The .B qmgr command reads standard input for directives until end of file is reached, or the .I exit or .I quit directive is read. .SH STANDARD OUTPUT If Standard Output is connected to a terminal, a command prompt will be written to standard output when qmgr is ready to read a directive. .LP If the .Ar \-e option is specified, .B qmgr will echo the directives read from standard input to standard output. .SH STANDARD ERROR If the .Ar \-z option is not specified, the qmgr command will write a diagnostic message to standard error for each error occurrence. .SH EXTENDED DESCRIPTION If .B qmgr is invoked without the .Ar \-c option and standard output is connected to a terminal, qmgr will write a prompt to standard output and read a directive from standard input. .LP Commands can be abbreviated to their minimum unambiguous form. A command is terminated by a new line character or a semicolon, ";", character. Multiple commands may be entered on a single line. A command may extend across lines by escaping the new line character with a back-slash "\\". .LP Comments begin with the # character and continue to end of the line. Comments and blank lines are ignored by qmgr. .SH DIRECTIVE SYNTAX A qmgr directive is one of the following forms: .sp .Ty "command\ server\ [names]\ [attr\ OP\ value[,attr\ OP\ value,...]]" .br .Ty "command\ queue\ [names]\ [attr\ OP\ value[,attr\ OP\ value,...]]" .br .Ty "command\ node\ [names]\ [attr\ OP\ value[,attr\ OP\ value,...]]" .sp Where, .IP command 10 is the command to perform on a object. Commands are: .RS .IP active 10 sets the active objects. If the active objects are specified, and the name is not given in a qmgr cmd the active object names will be used. .IP create 10 is to create a new object, applies to queues and nodes. .IP delete 10 is to destroy an existing object, applies to queues and nodes. .IP set 10 is to define or alter attribute values of the object. .IP unset 10 is to clear the value of attributes of the object. Note, this form does not accept an OP and value, only the attribute name. .IP list 10 is to list the current attributes and associated values of the object. .IP print 10 is to print all the queue and server attributes in a format that will be usable as input to the qmgr command. .RE .IP names is a list of one or more names of specific objects The name list is in the form: .br .Ty "\ \ [name][@server][,queue_name[@server]...]" .br with no intervening white space. The name of an object is declared when the object is first created. If the name is @server, then all the objects of specified type at the server will be effected. .IP attr specifies the name of an attribute of the object which is to be set or modified. .if !\n(Pb .ig Ig The attributes of objects are described in section 2 of the ERS. .Ig If the attribute is one which consist of a set of resources, then the attribute is specified in the form: .br \ \ \fBattribute_name.resource_name\fP .br .IP OP operation to be performed with the attribute and its value: .RS .IP = set the value of the attribute. If the attribute has a existing value, the current value is replaced with the new value. .IP += increase the current value of the attribute by the amount in the new value. .IP \-= decrease the current value of the attribute by the amount in the new value. .RE .IP value the value to assign to an attribute. If the value includes white space, commas or other special characters, such as the # character, the value string must be inclosed in quote marks ("). .LP The following are examples of qmgr directives: .sp .ft 5 .nf .Ty "create queue fast priority=10,queue_type=e,enabled = true,max_running=0" .Ty "set queue fast max_running +=2" .Ty "create queue little" .Ty "set queue little resources_max.mem=8mw,resources_max.cput=10" .Ty "unset queue fast max_running" .Ty "set node state = down,offline" .Ty "active server s1,s2,s3" .Ty "list queue @server1" .Ty "set queue max_running = 10 - uses active queues" .fi .ft 1 .LP .SH EXIT STATUS Upon successful processing of all the operands presented to the qmgr command, the exit status will be a value of zero. .LP If the qmgr command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO pbs_server(8B), pbs_queue_attributes(7B), pbs_server_attributes(7B), qstart(8B), qstop(8B), qenable(8B), qdisable(8), pbs_resources(7B) and the PBS External Reference Specification .\" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/pbsdsh.1.in0000664000113300011330000001465111272401251013411 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH pbsdsh 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME pbsdsh \- distribute task to nodes under pbs .SH SYNOPSIS pbsdsh [\-c copies] [\-o] [\-s] [\-u] [\-v] program [args] .br pbsdsh [\-n node] [\-o] [\-s] [\-u] [\-v] program [args] .br pbsdsh [\-h nodename] [\-o] [\-v] program [args] .SH DESCRIPTION Executes (spawns) a normal Unix program on one or more nodes under control of the Portable Batch System, PBS. Pbsdsh uses the Task Manager API, see tm_spawn(3), to distribute the program on the allocated nodes. .LP When run without the \-c or the \-n option, pbsdsh will spawn the program on all nodes allocated to the PBS job. The spawns take place concurrently \- all execute at (about) the same time. .LP Users will find the .B PBS_TASKNUM , .B PBS_NODENUM , and the .B PBS_VNODENUM environmental variables useful. They contain the TM task id, the node identifier, and the cpu (virtual node) identifier. .SH OPTIONS .IP "\-c copies" The program is spawned on the first .Ar Copies nodes allocated. This option is mutual exclusive with \-n. .IP "\-n node" The program is spawned on one node which is the .Ar node \-th node allocted. This option is mutual exclusive with \-c. .IP "\-h hostname" The program is spawned on the node specified. .IP \-o Capture stdout of the spawned program. Normally stdout goes to the job's output. .IP \-s If this option is given, the program is run in turn on each node, one after the other. .IP \-u The program is run once on each node (unique). This ignores the number of allocated processers on a given node. .IP \-v Verbose output about error conditions and task exit status is produced. .SH OPERANDS The first operand, .Ar program , is the program to execute. .LP Additional operands, .Ar args , are passed as arguments to the program. .SH STANDARD ERROR The pbsdsh command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the command, the exit status will be a value of zero. .LP If the pbsdsh command fails to process any operand, or fails to contact the MOM daemon on the localhost the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), tm_spawn(3B) \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/doc/man1/xpbsmon.1.in0000664000113300011330000007112711272401251013615 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH xpbsmon 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME xpbsmon \- GUI for displaying, monitoring the nodes/execution hosts under PBS .SH SYNOPSIS xpbsmon .SH DESCRIPTION The \fBxpbsmon\fP command provides a way to graphically display the various nodes that run jobs. A node or execution host can be running a \fBpbs_mom\fP daemon, or not running the daemon. For the latter case, it could just be a nodename that appears in a nodes file that is managed by a main \fBpbs_server \fP running on another host. This utility also provides the ability to monitor values of certain system resources by posting queries to the \fBpbs_mom\fP of a node. With this utility, you can see what job is running on what node, who owns the job, how many nodes assigned to a job, status of each node (color-coded and the colors are user-modifiable), how many nodes are available, free, down, reserved, offline, of unknown status, in use running multiple jobs or executing only 1 job. Please see the sections below for a tour and tutorials of xpbsmon. Also, within every dialog box, a \fBHelp\fP button can be found for assistance. .SH GETTING STARTED Running xpbsmon will initialize the X resource database from various sources in the following order: .IP "1." The \fBRESOURCE_MANAGER\fP property on the root window (updated via xrdb) with settings usually defined in the .Xdefaults file .IP "2." Preference settings defined by the system administrator in the global xpbsmonrc file .IP "3." User's ~/.xpbsmonrc file \- this file defines various X resources like fonts, colors, list of colors to use to represent the various status of the nodes, list of PBS sites to query, list of server hosts on each site, list of nodes/execution hosts on each server host, list of system resource queries to send to the nodes' pbs_mom, and various view states. See PREFERENCES section below for a list of resources that can be set. .SH RUNNING XPBSMON .LP \fBxpbsmon\fP can be run either as a regular user or superuser. If you run it with less privilege, you may not be able to see all the information for a node. If it is executed as a regular user, you should still be able to see what jobs are running on what nodes, possibly state and properties as these information are obtained by xpbsmon talking directly to the specified server. If you want other system resource values, it may require special privilege since xpbsmon will have to talk directly to the pbs_mom of a node. In addition, the host where xpbsmon was running must also have been given explicit access permission by the mom (unless the GUI is running on the same host where mom is running). This is done done by updating the $clienthost and/or the $restricted parameter on the mom's configuration file. To run \fBxpbsmon\fP, type: .RS .sp .Ty "\ \ \ setenv DISPLAY :0" .br .Ty "\ \ \ xpbsmon" .sp .RE If you are running the GUI and only interested in jobs data, then be sure to set all the nodes' type to NOMOM in the \fBPref\fP dialog box. .SH THE XPBSMON DISPLAY This section describes the main parts of the \fBxpbsmon\fP display. The main window is composed of 3 distinct areas (subwindows) arranged vertically (one on top of another) in the following order: .RS \ \ \ 1) Menu .br \ \ \ 2) Site Information .br \ \ \ 3) Info .br .RE .LP \fBMenu\fP. The Menu area is composed of a row of command buttons that signal some action with a click of the left mouse button. The buttons are: .RS .IP "Site.." 15 displays a popup menu containing the list of PBS sites that have been added using the Sites Preferences window. Simply drag your mouse and release to the site name whose servers/nodes information you would like to see. .IP "Pref.." 15 brings up various dialog boxes for specifying the list of sites, servers on each site, nodes that are known to a server, and the system resource queries to be sent to a node's pbs_mom daemon. .IP "Auto Update.." 15 brings up another window for specifying whether or not to do auto updates of nodes information, and also for specifying the interval number of minutes between updates. .IP "Help" 15 contains some help information. .IP "About" 15 tells who the author is and who to send comments, bugs, suggestions to. .IP "Close" 15 for exiting \fBxpbsmon\fP plus saving the current setup information (if anything had changed) in the user's $HOME/.xpbsmonrc file. Information saved include the the specified list of sites, servers on each site, nodes known to each server, and system resource queries to send to node's pbs_mom. .IP "Minimize Button" 15 shows the iconized view of Site Information where nodes are represented as tiny boxes, where each box is colored according to status. In order to get more information about a node, you need to double click on the colored box. .IP "Maximize button" 15 shows the full view of Site Information where nodes are represented in bigger boxes, still colored depending on the status, and some information on it is displayed. .RE .LP \fBSite Information\fP. Only one site at a time can be displayed. This area (shown as one huge box referred to as the site box) can be further sub-divided into 3 areas: the site name label at the top, server boxes in the middle, and the color status bar at the bottom. The site name label shows the name of the site as specified in the \fBPref..\fP window. At the middle of the site box shows a row of big boxes housing smaller boxes. .sp The big box is an abstraction of a server host (called a server box), showing its server display label at the top of the box, a grid of smaller boxes representing the nodes that the server knows about (where jobs are run), and summary status for the nodes under the server. Status information will show counters for the number of nodes used, available, reserved, offline, or of unknown status and even # of cpus assigned. For a cleaner display, some counters with a value of zero are not displayed. The server boxes are placed in a grid, with a new row being started when either *siteBoxMaxNumServerBoxesPerRow or *siteBoxMaxWidth limit has been reached. .sp The smaller boxes represent the nodes/execution hosts where jobs are run (referred to as node boxes). Each node box shows the name at the top, and a sub-box (a smaller square) that is is colored according to the status of the node that it represents, and if the view type is FULL, it will will display some node information according to the system resource queries specified on the \fBPref..\fP window. Clicking on the sub-box will show a much bigger box (called the MIRROR view) with bigger fonts containing nodes information. Another view is called ICON and this shows a tiny box with a colored area. The node boxes are arranged in a grid, where a new row is created if either the *serverBoxMaxNumNodeBoxesPerRow or *serverBoxMaxWidth limit has been reached. ICON view of the node boxes will be constrained by the *nodeBoxIconMaxHeight and *nodeBoxIconMaxWidth pixel values; FULL view of the node boxes will be bounded by *nodeBoxFullMaxWidth and *nodeBoxFullMaxHeight; the mirror view of the node boxes has its size be *nodeBoxMirrorMaxWidth, and *nodeBoxMirrorMaxHeight. .sp Horizontal and vertical scrollbars for the site box, server box, and node box will be displayed as needed. .sp Finally, the color bar information shows a color chart displaying what the various colors mean in terms of node status. The color-to-status mapping can be modified by setting the X resources: *nodeColorNOINFO, *nodeColorFREE, *nodeColorINUSEshared, *nodeColorINUSEexclusive, *nodeColorDOWN, *nodeColorRSVD, *nodeColorOFFL. .sp .LP \fBInfo\fP. The Info Area shows the progress of some of the background actions performed by \fBxpbsmon\fP. Look into this box for errors. .SH WIDGETS USED IN XPBSMON Some of the widgets used in \fBxpbsmon\fP and how they are manipulated are described in the following: .sp .IP "1." 3 \fBlistbox\fP \- the ones found in this GUI are only single-selectable (one entry can be highlighted/selected at a time via a mouse click). .IP "2." 3 \fBscrollbar\fP \- usually appears either vertically or horizontally and contains 5 distinct areas that are mouse clicked to achieve different effects: .RS .IP "top arrow" 14 Causes the view in the associated widget to shift up by one unit (i.e. the object appears to move down one unit in its window). If the button is held down the action will auto-repeat. .IP "top gap" 14 Causes the view in the associated window to shift up by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very top of the window will now appear at the very bottom). If the button is held down the action will auto-repeat. .IP "slider" 14 Pressing button 1 in this area has no immediate effect except to cause the slider to appear sunken rather than raised. However, if the mouse is moved with the button down then the slider will be dragged, adjusting the view as the mouse is moved. .IP "bottom gap" 14 Causes the view in the associated window to shift down by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very bottom of the window will now appear at the very top). If the button is held down the action will auto-repeat. .IP "bottom arrow" 14 Causes the view in the associated window to shift down by one unit (i.e. the object appears to move up one unit in its window). If the button is held down the action will auto-repeat. .RE .sp .IP "3." 3 \fBentry\fP \- brought into focus with a click of the left mouse button. To manipulate this widget, simply type in the text value. Use of arrow keys, mouse selection of text for deletion or overwrite, copying and pasting with sole use of mouse buttons are permitted. This widget is usually accompanied by a scrollbar for horizontally scanning a long text entry string. .sp .IP "4." 3 \fBbox\fP \- made up of 1 or more listboxes displayed adjacent to each other giving the effect of a "matrix". Each row from the listboxes makes up an element of the box. In order to add items to the box, you need to manipulate the accompanying entry widgets, one for each listbox, and then clicking the \fBadd\fP button. Removing items from the box is done by selecting an element, and then clicking \fBdelete\fP. .sp .IP "5." 3 \fBspinbox\fP \- a combination of an entry widget and a horizontal scrollbar. The entry widget will only accept values that fall within a defined list of valid values, and incrementing through the valid values is done by clicking on the up/down arrows. .IP "6." 3 \fBbutton\fP \- a rectangular region appearing either raised or pressed that invokes an action when clicked with the left mouse button. When the button appears pressed, then hitting the key will automatically select the button. .SH UPDATING PREFERENCES .IP "CASE 1: Time Sharing" .sp Suppose you have a time-sharing environment where the front-end is called bower and you have 4 nodes: bower1, bower2, bower3, bower4. bower is the host that runs the server; jobs are submitted to host bower where it enqueues it for future execution. Also, a pbs_mom daemon is running on each of the execution hosts. If the server bower also maintains a nodes list containing information like state, properties for the 4 nodes, then this will also be reported. Then to setup \fBxpbsmon\fP, do the following: .sp .RS .IP 1. Click the \fBPref..\fP button on the Menu section. .IP 2. On the Sites Preference dialog, enter any arbitrary site name, for example "Local". Then click the \fBadd\fP button. .IP 3. On the Server_Host entry box, enter "bower", and on the DisplayLabel entry box, put an arbitrary label (as it would appear on the header of the server box) like "Bower", and then click \fBadd\fP. .IP 4. Click the \fBnodes..\fP button that is accompanying the Servers box. This would bring up the Server Preference dialog. .IP 5. Now add the entries "bower1", "bower2", "bower3", "bower4" specifying type MOM for each on the Nodes box. .IP 6. If you need to monitor certain system resource parameters for each of the nodes, you need to specify query expressions containing resource queries to be sent to the individual PBS moms. For example, if you want to obtain memory usage, then select a node from the Nodes list, click on the \fBquery..\fP button that accompanies the Nodes list, and this would bring up the Query Table dialog. Specify the following input: .sp .RS Query_Expr: (availmem/totmem) * 100 .br Display_Info: Memory Usage: .br Display_Type: SCALE .RE .IP .sp The above says to display the result of the "Query_Expr" in a scale widget calibrated over 100. The queries "availmem" and "totmem" will be sent to the PBS mom, and the expression is evaluated upon receiving all results from the mom. If you want to display the result of another query, say "loadave", directly, then specify the following: .sp .RS Query_Expr: loadave .br Display_Info: Load Average: .br Display_Type: TEXT .RE .IP .sp NOTE: For a list of queries that can be sent to a pbs_mom, please click on the \fBHelp\fP button on the Query table window. .RE .IP "CASE 2: Jobs Exclusive Environment" Supposing you have a "space non-sharing" environment where the server maintains a list of nodes that it runs jobs on exclusively (one job at a time outstanding per node). Let's call this server b1. Simply update Preferences information as follows: .RS .IP 1. Click the \fBPref..\fP button on the Menu section. .IP 2. On the Sites Preference dialog, enter a site name, for example "B System". Then click the \fBadd\fP button. .IP 3. On the Server_Host entry box, enter "b1", DisplayLabel entry box type "B1" (or whatever label that you would like to appear on the header of the server box), and then click \fBadd\fP. .sp .RE .IP "CASE 3: Hybrid Time Sharing/Space Sharing Environment" A cluster of heterogeneous machines, time-sharing or jobs exclusive, could easily be represented in \fBxpbsmon\fP by combining steps in CASE 1 and CASE 2. .SH LEAVING XPBSMON Click on the \fBClose\fP button located in the Menu bar to leave \fBxpbsmon\fP. If anything had changed, it will bring up a dialog box asking for a confirmation in regards to saving preferences information about list of sites, their view types, list of servers on each site, the list of nodes known to each server, and the list of queries to be sent to the pbs_mom of each node. The information is saved in ~/.xpbsmonrc file. .SH PREFERENCES The resources that can be set in the X resources file, ~/.xpbsmonrc, are described in the following: .sp \fBNode Box Properties\fP .sp Resource names beginning with "*small" or "*node" apply to the properties of the node boxes. A node box is made of an outer frame where the node label sits on top, the canvas (smaller box) is on the middle, and possibly some horizontal/ vertical scrollbars. .sp .IP nodeColorNOINFO color of node box when information for the node it represents could not be obtained. .IP *nodeColorFREE color of canvas when node it represents is up. .IP *nodeColorINUSEshared color when node it represents has more than 1 job running on it, or when node has been marked by the server that manages it as "job-sharing". .IP *nodeColorINUSEexclusive list of colors to assign to a node box when host it represents is running only 1 job, or when node has been marked by the server that manages it as "time-sharing". xpbsmon will use this list to assign 1 distinct color per job unless all the colors have been exhausted, in which case, colors will start getting assigned more than once in a round-robin fashion. .IP *nodeColorDOWN color when node it represents is down. .IP *nodeColorRSVD color when node it represents is reserved. .IP *nodeColorOFFL color when node it represents is offline. .IP *smallForeground applies to the color of text inside the canvas. .IP *smallBackground applies to the color of the frame. .IP *smallBorderWidth distance (in pixels) from other node boxes. .IP *smallRelief how node box will visually appear (style). .IP *smallScrollBorderWidth significant only in FULL mode, this is the distance of the horizontal/vertical scrollbars from the canvas and lower edge of the frame. .IP *smallScrollBackground background color of the scrollbars .IP *smallScrollRelief how scrollbars would visually appear (style). .IP *smallCanvasBackground color of the canvas (later overridden depending on status of the node it represents) .IP *smallCanvasBorderWidth distance of the canvas from the frame and possibly the scrollbars. .IP *smallCanvasRelief how the canvas is visually represented (style). .IP *smallLabelBorderWidth the distance of the node label from the canvas and the topmost edge of the frame. .IP *smallLabelBackground the background of the area of the node label that is not filled. .IP *smallLabelRelief how the label would appear visually (style). .IP *smallLabelForeground the color of node label text. .IP *smallLabelFont the font to use for the node label text. .IP *smallLabelFontWidth font width (in pixels) of *smallLabelFont .IP *smallLabelFontHeight font height (in pixels) of *smallLabelFont .IP *smallTextFont font to use for the text that appear inside a canvas. .IP *smallTextFontWidth font width (in pixels) of *smallTextFont. .IP *smallTextFontHeight font height (in pixels) of *smallTextFont. .IP *nodeColorTrough color of trough part (the /100 portion) of a canvas scale item. .IP *nodeColorSlider color of slider part (value portion) of a canvas scale item. .IP *nodeColorExtendedTrough color of extended trough (over 100 portion when value exceeds max) of a canvas scale item. .IP *nodeScaleFactor tells how much bigger you want the scale item on the canvas to appear. (1 means to keep size as is) .IP *nodeBoxFullMaxWidth .IP *nodeBoxFullMaxHeight maximum width and height (in pixels) of a node box in FULL mode. .IP *nodeBoxIconMaxWidth .IP *nodeBoxIconMaxHeight maximum width and height (in pixels) of a node box in ICON mode. .IP *nodeBoxMirrorMaxWidth .IP *nodeBoxMirrorMaxHeight maximum width and height (in pixels) of a node box displayed on a separate window (after it has been clicked with the mouse to obtain a bigger view) .IP *nodeBoxMirrorScaleFactor tells how much bigger you want the scale item on the canvas to appear while the node box is displayed on a separate window (1 means to keep size as is) .LP \fBServer Box Properties\fP .sp Resource names beginning with "*medium" apply to the properties of the server boxes. A server box is made of an outer frame where the server display label sits on top, a canvas filled with node boxes is on the middle, possibly some horizontal/vertical scrollbars, and a status label at the bottom. .IP *mediumLabelForeground color of text applied to the server display label and status label. .IP *mediumLabelBackground background color of the unfilled portions of the server display label and status label. .IP *mediumLabelBorderWidth distance of the server display label and status label from other parts of the server box. .IP *mediumLabelRelief how the server display label and status label appear visually (style). .IP *mediumLabelFont" font used for the text of the server display label and status label. .IP *mediumLabelFontWidth font width (in pixels) of *mediumLabelFont. .IP *mediumLabelFontHeight font height (in pixels) of *mediumLabelFont. .IP *mediumCanvasBorderWidth the distance of the server box's canvas from the label widgets. .IP *mediumCanvasBackground the background color of the canvas. .IP *mediumCanvasRelief how the canvas appear visually (style). .IP *mediumScrollBorderWidth distance of the scrollbars from the other parts of the server box. .IP *mediumScrollBackground the background color of the scrollbars .IP *mediumScrollRelief how the scrollbars appear visually. .IP *mediumBackground the color of the server box frame. .IP *mediumBorderWidth the distance of the server box from other boxes. .IP *mediumRelief how the server box appears visually (style). .IP *serverBoxMaxWidth .IP *serverBoxMaxHeight maximum width and height (in pixels) of a server box. .IP *serverBoxMaxNumNodeBoxesPerRow maximum # of node boxes to appear in a row within a canvas. .LP \fBMiscellaneous Properties\fP .sp Resource names beginning with "*big" apply to the properties of a site box, as well as to widgets found outside of the server box and node box. This includes the dialog boxes that appear when the menu buttons of the main window are manipulated. The site box is the one that appears on the main region of xpbsmon. .IP *bigBackground background color of the outer layer of the main window. .IP *bigForeground color applied to regular text that appear outside of the node box and server box. .IP *bigBorderWidth distance of the site box from the menu area and the color information area. .IP *bigRelief how the site box is visually represented (style) .IP *bigActiveColor the color applied to the background of a selection, a selected command button, or a selected scroll bar handle. .IP *bigShadingColor a color shading applied to some of the frames to emphasize focus as well as decoration. .IP *bigSelectorColor the color applied to the selector box of a radiobutton or checkbutton. .IP *bigDisabledColor color applied to a disabled widget. .IP *bigLabelBackground color applied to the unfilled portions of label widgets. .IP *bigLabelBorderWidth distance from other widgets of a label widget. .IP *bigLabelRelief how label widgets appear visually (style) .IP *bigLabelFont font to use for labels. .IP *bigLabelFontWidth font width (in pixels) of *bigLabelFont. .IP *bigLabelFontHeight font height (in pixels) of *bigLabelFont. .IP *bigLabelForeground color applied to text that function as labels. .IP *bigCanvasBackground the color of the main region. .IP *bigCanvasRelief how the main region looks like visually (style) .IP *bigCanvasBorderWidth: distance of the main region from the menu and info regions. .IP *bigScrollBorderWidth if the main region has a scrollbar, this is its distance from other widgets appearing on the the region. .IP *bigScrollBackground background color of the scrollbar appearing outside a server box and node box. .IP *bigScrollRelief how the scrollbar that appears outside a server box and node box looks like visually (style) .IP *bigTextFontWidth the font width (in pixels) of *bigTextFont .IP *bigTextFontHeight the font height (in pixels) of *bigTextFont .IP *siteBoxMaxWidth maximum width (in pixels) of the site box. .IP *siteBoxMaxHeight maximum height (in pixels) of the site box. .IP *siteBoxMaxNumServerBoxesPerRow maximum number of server boxes to appear in a row inside the site box. .IP *autoUpdate if set to true, then information about nodes is periodically gathered. .IP *autoUpdateMins the # of minutes between polling for data regarding nodes when *autoUpdate is set. .IP *siteInView the name of the site that should be in view .IP *rcSiteInfoDelimeterChar the separator character for each input within a curly-bracketed line of input of *siteInfo. .IP *sitesInfo {} .br . . . .br {} .sp information about a site where can be either {FULL,ICON}, can be {MOM, NOMOM}, and has the format: .sp { {} {expr-label} } .sp where could be {TEXT, SCALE}. It's probably better to use the \fBPref\fP dialog boxes in order to specify a value for this. .sp Example: .sp *rcSiteInfoDelimeterChar ; .br *sitesInfo: {Mars;ICON;newton;Newton;newton3;NOMOM;} {Langley;FULL;db;DB;db.OpenPBS.org;MOM;{{ ( availmem / totmem ) * 100} {Memory Usage:} SCALE} {{ ( loadave / ncpus ) * 100} {Cpu Usage:} SCALE} {ncpus {Number of Cpus:} TEXT} {physmem {Physical Memory:} TEXT} {idletime {Idle Time (s):} TEXT} {loadave {Load Avg:} TEXT}} {Mars;ICON;newton;Newton;newton4;NOMOM;} {Mars;ICON;newton;Newton;newton1;NOMOM;} {Mars;ICON;newton;Newton;newton2;NOMOM;} {Mars;ICON;b0101;DB;aspasia.OpenPBS.org;MOM;{{ ( availmem / totmem ) * 100} {Memory Usage:} SCALE} {{ ( loadave / ncpus ) * 100} {Cpu Usage:} SCALE} {ncpus {Number of Cpus:} TEXT} {physmem {Physical Memory:} TEXT} {idletime {Idle Time (s):} TEXT} {loadave {Load Avg:} TEXT}} {Mars;ICON;newton;Newton;newton7;NOMOM;} .SH EXIT STATUS Upon successful processing, the \fBxpbsmon\fP exit status will be a value of zero. .LP If the xpbsmon command fails, the command exits with a value greater than zero. .LP If xpbsmon is querying a host running a server with an incompatible version, you may see the following messages: .RS .sp Internal error: pbsstatnode: End of File (15031) .sp .RE The above message can be safely ignored. .SH SEE ALSO pbs_sched_tcl(8B) and pbs_mom(8B). \" turn off any extra indent left by the Sh macro torque-2.4.16/doc/man1/qorder.1.in0000664000113300011330000001350211272401251013414 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qorder 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qorder \- exchange order of two pbs batch jobs in a queue. .SH SYNOPSIS qorder job_identifier job_identifier .SH DESCRIPTION To order two jobs is to exchange the jobs positions in the queue or queues in which the jobs resides. The two jobs must be located at the same server. .if !\n(Pb .ig Ig The .B qorder command issues an .I "Order Jobs" batch request to the batch server that currently owns the two jobs specified by the two .Ar job_identifier operands. .Ig No attribute of the job, such as priority is changed. The impact of interchanging the order with the queue(s) is dependent on local job scheduled policy, contact your systems administrator. .LP A job in the .B running state cannot be reordered. .SH OPERANDS Both operands are .Ar job_identifiers which specify the jobs to be exchanged. The qorder command accepts two .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br The server specification for the two jobs must agree as to the current location of the two job IDs. .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR The qorder command will write diagnostic messages to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qorder command, the exit status will be a value of zero. .LP If the qorder command fails to process any operand, the command exits with a value greater than zero. \" turn off any extra indent left by the Sh macro .SH SEE ALSO qsub(1B), qmove(1B), pbs_orderjob(3B), pbs_movejob(3B) .RE torque-2.4.16/doc/man1/qmsg.1.in0000664000113300011330000001404211272401251013067 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qmsg 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qmsg \- send message to pbs batch jobs .SH SYNOPSIS qmsg [\-E] [\-O] message_string job_identifier ... .SH DESCRIPTION To send a message to a job is to write a message string into one or more output files of the job. Typically this is done to leave an informative message in the output of the job. .LP The .B qmsg command writes messages into the files of jobs by sending a .I "Message Job" batch request to the batch server that owns the job. The qmsg command does not directly write the message into the files of the job. .SH OPTIONS .IP "\-E" 15 Specifies that the message is written to the standard error of each job. .IP "\-O" 15 Specifies that the message is written to the standard output of each job. .LP If neither the .Ar \-E nor the .Ar \-O option is specified, the message will be written to the standard error of the job. .SH OPERANDS The first operand, .Ar message_string , is the message to be written. If the string contains blanks, the string must be quoted. If the final character of the string is not a newline, a newline character will be added when written to the job's file. .LP All following operands are .Ar job_identifiers which specify the jobs to receive the message string. The qmsg command accepts one or more .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR The qmsg command will write a diagnostic message to standard error for each error occurrence. .SH EXIT STATUS Upon successful processing of all the operands presented to the qmsg command, the exit status will be a value of zero. .LP If the qmsg command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), pbs_msgjob(3B) .RE torque-2.4.16/doc/man1/qalter.1.in0000664000113300011330000006044211272401251013415 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qalter 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qalter \- alter pbs batch job .SH SYNOPSIS qalter [\-a date_time] [\-A account_string] [\-c interval] [\-e path] [\-h hold_list] [\-j join] [\-k keep] [\-l resource_list] [\-m mail_options] [\-M user_list] [\-N name] [\-o path] [\-p priority] [\-r c] [\-S path] [\-u user_list] [\-W additional_attributes] job_identifier... .SH DESCRIPTION The .B qalter command modifies the attributes of the job or jobs specified by .Ar "job_identifier" on the command line. Only those attributes listed as options on the command will be modified. If any of the specified attributes cannot be modified for a job for any reason, none of that job's attributes will be modified. .LP The qalter command accomplishes the modifications by sending a .I "Modify Job" batch request to the batch server which owns each job. .SH OPTIONS .IP "\-a date_time" 8 Replaces the .if !\n(Pb .ig Ig attribute .At Execution_Time .Ig time at which the job becomes eligible for execution. The .Ar date_time argument syntax is: .Ty "[[[[CC]YY]MM]DD]hhmm[.SS]" . .IP If the month, .Ty MM , is not specified, it will default to the current month if the specified day .Ty DD , is in the future. Otherwise, the month will be set to next month. Likewise, if the day, .Ty DD , is not specified, it will default to today if the time .Ty hhmm is in the future. Otherwise, the day will be set to tomorrow. .if !\n(Pb .ig Ig This .Ar date_time will be converted to the integer number of seconds since Epoch that is equivalent to the local time on the system where the command is being executed. .Ig .IP This attribute can be altered once the job has begun execution, but it will not take affect until the job is rerun. .IP "\-A account_string " 8 Replaces the .if !\n(Pb .ig Ig the .At Account_Name attribute, .Ig the account string associated with the job. .if !\n(Pb .ig Ig The syntax of the .Ar account_string is defined in section 2.7.1. It is interpreted by the server which executes the job. .Ig .IP This attribute cannot be altered once the job has begun execution. .IP "\-c interval" 8 Replaces the .if !\n(Pb .ig Ig .At Checkpoint attribute, .Ig the interval at which the job will be checkpointed. If the job executes upon a host which does not support checkpoint, this option will be ignored. .IP The .Ar interval argument is specified as: .RS .IP n 4 No checkpointing is to be performed. .if !\n(Pb .ig Ig The job's .At Checkpoint attribute is set to the string .Ty """n""" . .Ig .IP s 4 Checkpointing is to be performed only when the server executing the job is shutdown. .if !\n(Pb .ig Ig The job's .At Checkpoint attribute is set to the string .Ty """s""" . .Ig .IP c 4 Checkpointing is to be performed at the default minimum cpu time for the queue from which the job is executing. .if !\n(Pb .ig Ig The job's .At Checkpoint attribute is set to the string .Ty """c""" . .Ig .IP c=minutes 3 Checkpointing is to be performed at an interval of .Ar minutes , which is the integer number of minutes of CPU time used by the job. This value must be greater than zero. If the number is less than the default checkpoint time, the default time will be used. .if !\n(Pb .ig Ig The .At Checkpoint attributes is set to the string specified by .Ar """c=minutes""" . .Ig .RE .IP This attribute can be altered once the job has begun execution, but the new value does not take affect until the job is rerun. .IP "\-e path" 8 Replaces the .if !\n(Pb .ig Ig .At Error_Path attribute, .Ig the path to be used for the standard error stream of the batch job. The .Ar path argument is of the form: .br .Ty "\ \ \ \ [hostname:]path_name" .br where .Ty hostname is the name of a host to which the file will be returned and .Ty path_name is the path name on that host in the syntax recognized by POSIX 1003.1. The argument will be interpreted as follows: .RS .IP \fBpath_name\fP Where path_name is not an absolute path name, then the qalter command will expand the path name relative to the current working directory of the command. The command will supply the name of the host upon which it is executing for the .Ar hostname component. .IP \fBhostname:path_name\fP Where path_name is not an absolute path name, then the qalter command will not expand the path name. The execution server will expand it relative to the home directory of the user on the system specified by hostname. .IP \fBpath_name\fP Where path_name specifies an absolute path name, then qalter will supply the name of the host on which it is executing for the .Ar hostname . .IP \fBhostname:path_name\fP Where path_name specifies an absolute path name, the path will be used as specified. .RE .IP This attribute can be altered once the job has begun execution, but it will not take affect until the job is rerun. .IP "\-h hold_list" 8 Updates the .if !\n(Pb .ig Ig .At Hold_Types attribute, .Ig the types of holds on the job. The .Ar hold_list argument is a string of one or more of the following characters: .RS .IP u 5 Add the USER type hold. .IP s 5 Add the SYSTEM type hold if the user has the appropriate level of privilege. [Typically reserved to the batch administrator.] .IP o 5 Add the OTHER (or OPERATOR ) type hold if the user has the appropriate level of privilege. [Typically reserved to the batch administrator and batch operator.] .IP n 5 Set to none; that is clear the hold types which could be applied with the users level of privilege. .RE .IP Repetition of characters is permitted, but "n" may not appear in the same option argument with the other three characters. This attribute can be altered once the job has begun execution, but the hold will not take affect until the job is rerun. .IP "\-j join" 8 Declares which standard streams of the job will be merged together. The .Ar join argument value may be the characters "oe" and "eo", or the single character "n". .IP A argument value of .Ty oe directs that the standard output and standard error streams of the job will be merged, intermixed, and returned as the standard output. A argument value of .Ty eo directs that the standard output and standard error streams of the job will be merged, intermixed, and returned as the standard error. .if !\n(Pb .ig Ig The .At Join_Path job attribute is set to the value. .Ig .IP A value of .Ty n directs that the two streams will be two separate files. .if !\n(Pb .ig Ig The .At Join_Path attribute is set to "n". .Ig This attribute can be altered once the job has begun execution, but it will not take affect until the job is rerun. .IP "\-k keep" 8 Defines which if either of standard output or standard error of the job will be retained on the execution host. If set for a stream, this option overrides the path name for that stream. .IP The argument is either the single letter "\fBe\fP", "\fBo\fP", or "\fBn\fP", or one or more of the letters "\fBe\fP" and "\fBo\fP" combined in either order. .RS .IP n 5 No streams are to be retained. .if !\n(Pb .ig Ig The .At Keep_Files attribute is set to KEEP_NONE, "n". .Ig .IP e 5 The standard error stream is to retained on the execution host. The stream will be placed in the home directory of the user under whose user id the job executed. The file name will be the default file name given by: job_name.\fBe\fPsequence where \fBjob_name\fP is the name specified for the job, and \fBsequence\fP is the sequence number component of the job identifier. .if !\n(Pb .ig Ig The attribute is set to include KEEP_ERROR, "e". .Ig .IP o 5 The standard output stream is to be retained on the execution host. The stream will be placed in the home directory of the user under whose user id the job executed. The file name will be the default file name given by: job_name.\fBo\fPsequence where \fBjob_name\fP is the name specified for the job, and \fBsequence\fP is the sequence number component of the job identifier. .if !\n(Pb .ig Ig The .At Output_Path attribute is set to include KEEP_OUTPUT, "o". .Ig .IP eo 5 Both the standard output and standard error streams will be retained. .if !\n(Pb .ig Ig The attribute is set to KEEP_OUTPUT\ |\ KEEP_ERROR. .Ig .IP oe 5 Both the standard output and standard error streams will be retained. .if !\n(Pb .ig Ig The attribute is set to KEEP_OUTPUT\ |\ KEEP_ERROR. .Ig .RE .IP .if !\n(Pb .ig Ig Repetition of characters is permitted, but "n" may not appear in the same option argument with the other two characters. .Ig This attribute cannot be altered once the job has begun execution. .IP "\-l resource_list " 8 Modifies the .if !\n(Pb .ig Ig .At Resource_List attribute, the .Ig list of resources that are required by the job. The .Ar Resource_List argument is in the following syntax: .br .Ty resource_name[=[value]][,resource_name[=[value]],...] .if !\n(Pb .ig Ig .IP For each resource listed, if a resource with the specified name already exist in the jobs resource attribute, the value for that resource will be updated. If the named resource does not exist in the job resource attribute, the resource name and value will be added. No white space is allowed in the value. .IP Because the list of supported resources vary from host to host, the command will perform no validation of the name or value. .Ig .IP If a requested modification to a resource would exceed the resource limits for jobs in the current queue, the server will reject the request. .IP If the job is running, only certain, resources can be altered. Which resources can be altered in the run state is system dependent. A user may only lower the limit for those resources. .if !\n(Pb .ig Ig A PBS Manager or Operator may increase them. .Ig .IP "\-m mail_options " 8 Replaces the set of conditions under which the execution server will send a mail message about the job. The .Ar mail_options argument is a string which consists of .if !\n(Pb .ig Ig one or more repetitions of .Ig the single character "\fBn\fP", or one or more .if !\n(Pb .ig Ig repetitions .Ig of the characters "\fBa\fP", "\fBb\fP", and "\fBe\fP". .IP If the character "\fBn\fP" is specified, no mail will be sent. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to NONE, "n". .Ig .IP For the letters "\fBa\fP", "\fBb\fP", and "\fBe\fP": .RS .IP a 5 mail is sent when the job is aborted by the batch system. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to ABORT, "a". .Ig .IP b 5 mail is sent when the job begins execution. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to BEGINNING, "b". .Ig .IP e 5 mail is sent when the job terminates. .if !\n(Pb .ig Ig The .At Mail_Points attribute is set to EXIT, "e". .Ig .RE .IP "\-M user_list" 8 Replaces the list of users to whom mail is sent by the execution server when it sends mail about the job. .IP The .Ar user_list argument is of the form: .br .Ty "\ \ \ \ user[@host][,user[@host],...]" .if !\n(Pb .ig Ig .br The .At Mail_Users attribute is set to the argument. .Ig .IP "\-N name" 8 Renames the job. The name specified may be up to and including 15 characters in length. It must consist of printable, non white space characters with the first character alphabetic. .if !\n(Pb .ig Ig [See the discussion of the \-N option under qsub(1).] The .At Job_Name attribute is reset to the name value. .Ig .IP "\-o path" 8 Replaces the path to be used for the standard output stream of the batch job. The .Ar path argument is of the form: .br .Ty "\ \ \ \ [hostname:]path_name" .br where .Ty hostname is the name of a host to which the file will be returned and .Ty path_name is the path name on that host in the syntax recognized by POSIX. The argument will be interpreted as follows: .RS .IP \fBpath_name\fP Where path_name is not an absolute path name, then the qalter command will expand the path name relative to the current working directory of the command. The command will supply the name of the host upon which it is executing for the .Ar hostname component. .IP \fBhostname:path_name\fP Where path_name is not an absolute path name, then the qalter command will not expand the path name. The execution server will expand it relative to the home directory of the user on the system specified by hostname. .IP \fBpath_name\fP Where path_name specifies an absolute path name, then the qalter will supply the name of the host on which it is executing for the .Ar hostname . .IP \fBhostname:path_name\fP Where path_name specifies an absolute path name, the path will be used as specified. .RE .IP This attribute can be altered once the job has begun execution, but it will not take affect until the job is rerun. .IP "\-p priority" 8 Replaces the priority of the job. The .Ar priority argument must be a integer between \-1024 and +1023 inclusive. .if !\n(Pb .ig Ig The .At Priority attribute is set to this signed integer value. .Ig .IP This attribute can be altered once the job has begun execution, but it will not take affect until the job is rerun. .IP "\-r c" 8 Declares whether the job is rerunable. See the .B qrerun command. The option argument .Ar c is a single character. PBS recognizes the following characters: .Ty y and .Ty n . .if !\n(Pb .ig Ig Also see .I rerunability in the glossary. .Ig .IP If the argument is "\fBy\fP", the job is marked rerunable. .if !\n(Pb .ig Ig The .At Rerunable attribute is set to 'y'. .Ig If the argument is "\fBn\fP", the job is marked as not rerunable. .if !\n(Pb .ig Ig The .At Rerunable attribute is set to 'n'. .Ig .IP "\-S path" 8 Declares the shell that interprets the job script. .IP The option argument .Ar path_list is in the form: .br .Ty "\ \ \ \ path[@host][,path[@host],...]" .br Only one path may be specified for any host named. Only one path may be specified without the corresponding host name. The path selected will be the one with the host name that matched the name of the execution host. If no matching host is found, then if present the path specified without a host will be selected. .IP If the .Ar \-S option is not specified, the option argument is the null string, or no entry from the .Ar path_list is selected, the execution will use the login shell of the user on the execution host. .if !\n(Pb .ig Ig The .At Shell_Path_List attribute is set to the .Ar path_list argument if present, otherwise it is set to the null string. .Ig .IP This attribute can be altered once the job has begun execution, but it will not take affect until the job is rerun. .IP "\-u user_list" 8 Replaces the user name under which the job is to run on the execution system. .IP The .Ar user_list argument is of the form: .br .Ty "\ \ \ \ user[@host][,user[@host],...]" .br Only one user name may be given for per specified host. Only one of the .Ty user specifications may be supplied without the corresponding .Ty host specification. That user name will be used for execution on any host not named in the argument list. .if !\n(Pb .ig Ig The .At User_List attribute is set to the value of .Ar User_List . .Ig .IP This attribute cannot be altered once the job has begun execution. .IP "\-W additional_attributes" 8 The \-W option allows for the modification of additional job attributes. The general syntax of the \-W is in the form: .br .ft 5 \ \ \ \ \-W attr_name=value[,attr_name=value...] .ft 1 .br Note if white space occurs anywhere within the option argument string or the equal sign, "=", occurs within an .Ar attribute_value string, then the string must be enclosed with either single or double quote marks. .IP PBS currently supports the following attributes within the \-W option. .IP .Ty "depend=dependency_list" .br Redefines the .if !\n(Pb .ig Ig .At depend attribute listing the .Ig dependencies between this and other jobs. The .Ar dependency_list is in the form: .Ty "type[:argument[:argument...][,type:argument...]" . .br The .I argument is either a numeric count or a PBS job id according to .I type . If argument is a count, it must be greater than 0. If it is a job id and is not fully specified in the form: .Ty "seq_number.server.name" , it will be expanded according to the default server rules. If .I argument is null (the preceding colon need not be specified), the dependency of the corresponding type is cleared (unset). .RS 12 .IP "\fBsynccount:count\fP" 4 This job is the first in a set of jobs to be executed at the same time. .I Count is the number of additional jobs in the set. .IP "\fBsyncwith:jobid\fP" This job is an additional member of a set of jobs to be executed at the same time. .I Jobid is the job identifier of the first job in the set. .IP "\fBafter:jobid[:jobid...]\fP" This job may be scheduled for execution at any point after jobs .I jobid have started execution. .IP "\fBafterok:jobid[:jobid...]\fP" This job may be scheduled for execution only after jobs .I jobid have terminated with no errors. .IP "\fBafternotok:jobid[:jobid...]\fP" This job may be scheduled for execution only after jobs .I jobid have terminated with errors. .IP "\fBafterany:jobid[:jobid...]\fP" This job may be scheduled for execution after jobs .I jobid have terminated, with or without errors. .IP "\fBon:count\fP" This job may be scheduled for execution after \fBcount\fP dependencies on other jobs have been satisfied. This form is used in conjunction with one of the \fBbefore\fP forms, see below. .IP \fBbefore:jobid[:jobid...]\fP When this job has begun execution, then jobs \fBjobid...\fP may begin. .IP \fBbeforeok:jobid[:jobid...]\fP If this job terminates execution without errors, then jobs \fBjobid...\fP may begin. .IP \fBbeforenotok:jobid[:jobid...]\fP If this job terminates execution with errors, then jobs \fBjobid...\fP may begin. .IP \fBbeforeany:jobid[:jobid...]\fP When this job terminates execution, jobs \fBjobid...\fP may begin. .IP If any of the \fBbefore\fP forms are used, the job referenced by \fBjobid\fP must have been submitted with a dependency type of \fBon\fP. .IP The job specified in any of the \fBbefore\fP forms must have the same owner as the job being altered.. Otherwise, the dependency will not take effect. .LP Error processing of the existence, state, or condition of the job on which the newly submitted job is a deferred service, i.e. the check is performed after the job is queued. If an error is detected, the new job will be deleted by the server. Mail will be sent to the job submitter stating the error. .if !\n(Pb .ig Ig .SM These options are extensions to the POSIX 1003.2d standard. .NL .Ig .RE .IP .Ty group_list=g_list .br Alters the .if !\n(Pb .ig Ig .At group_list attribute, which lists the .Ig group name under which the job is to run on the execution system. .IP The .Ar g_list argument is of the form: .Ty "\ \ group[@host][,group[@host],...]" .br Only one group name may be given per specified host. Only one of the .Ty group specifications may be supplied without the corresponding .Ty host specification. That group name will used for execution on any host not named in the argument list. .if !\n(Pb .ig Ig .SM This option is an extension to the POSIX 1003.2d standard. .NL .Ig .IP .Ty "stagein=file_list" .br .Ty "stageout=file_list" .br Alters .if !\n(Pb .ig Ig the .At stageout attribute or the .At stagein attribute, which list .Ig which files are staged (copied) in before job start or staged out after the job completes execution. The .Ar file_list is in the form: .Ty "local_file@hostname:remote_file[,...]" .br The name .Ty local_file is the name on the system where the job executes. It may be an absolute path or a path relative to the home directory of the user. The name .Ty remote_file is the destination name on the host specified by .Ty hostname . The name may be absolute or relative to the user's home directory on the destination host. .if !\n(Pb .ig Ig .SM These options are extensions to the POSIX 1003.2d standard. .NL .Ig .LP .SH OPERANDS The qalter command accepts one or more .Ar job_identifier operands of the form: .br .Ty "\ \ \ \ sequence_number[.server_name][@server]" .br .if !\n(Pb .ig Ig See the description under "Job Identifier" in section \*(Ji in this ERS. .Ig .SH STANDARD ERROR Any error condition, either in processing the options or the operands, or any error received in reply to the batch requests will result in a error message being written to standard error. .SH EXIT STATUS Upon successful processing of all the operands presented to the qalter command, the exit status will be a value of zero. .LP If the qalter command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qsub(1B), qstat(1B), pbs_alterjob(3B), pbs_statjob(3B), pbs_selectjob(3B), pbs_resources_*(7B), where * is system type, and the PBS ERS. .RE torque-2.4.16/doc/man1/Makefile.am0000664000113300011330000000010711272401251013462 00000000000000include $(top_srcdir)/buildutils/config.mk # all work is done in doc/ torque-2.4.16/doc/man1/qstat.1.in0000664000113300011330000004722511413217001013260 00000000000000.\" OpenPBS (Portable Batch System) v2.3 Software License .\" .\" Copyright (c) 1999-2000 Veridian Information Solutions, Inc. .\" All rights reserved. .\" .\" --------------------------------------------------------------------------- .\" For a license to use or redistribute the OpenPBS software under conditions .\" other than those described below, or to purchase support for this software, .\" please contact Veridian Systems, PBS Products Department ("Licensor") at: .\" .\" www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org .\" 877 902-4PBS (US toll-free) .\" --------------------------------------------------------------------------- .\" .\" This license covers use of the OpenPBS v2.3 software (the "Software") at .\" your site or location, and, for certain users, redistribution of the .\" Software to other sites and locations. Use and redistribution of .\" OpenPBS v2.3 in source and binary forms, with or without modification, .\" are permitted provided that all of the following conditions are met. .\" After December 31, 2001, only conditions 3-6 must be met: .\" .\" 1. Commercial and/or non-commercial use of the Software is permitted .\" provided a current software registration is on file at www.OpenPBS.org. .\" If use of this software contributes to a publication, product, or service .\" proper attribution must be given; see www.OpenPBS.org/credit.html .\" .\" 2. Redistribution in any form is only permitted for non-commercial, .\" non-profit purposes. There can be no charge for the Software or any .\" software incorporating the Software. Further, there can be no .\" expectation of revenue generated as a consequence of redistributing .\" the Software. .\" .\" 3. Any Redistribution of source code must retain the above copyright notice .\" and the acknowledgment contained in paragraph 6, this list of conditions .\" and the disclaimer contained in paragraph 7. .\" .\" 4. Any Redistribution in binary form must reproduce the above copyright .\" notice and the acknowledgment contained in paragraph 6, this list of .\" conditions and the disclaimer contained in paragraph 7 in the .\" documentation and/or other materials provided with the distribution. .\" .\" 5. Redistributions in any form must be accompanied by information on how to .\" obtain complete source code for the OpenPBS software and any .\" modifications and/or additions to the OpenPBS software. The source code .\" must either be included in the distribution or be available for no more .\" than the cost of distribution plus a nominal fee, and all modifications .\" and additions to the Software must be freely redistributable by any party .\" (including Licensor) without restriction. .\" .\" 6. All advertising materials mentioning features or use of the Software must .\" display the following acknowledgment: .\" .\" "This product includes software developed by NASA Ames Research Center, .\" Lawrence Livermore National Laboratory, and Veridian Information .\" Solutions, Inc. .\" Visit www.OpenPBS.org for OpenPBS software support, .\" products, and information." .\" .\" 7. DISCLAIMER OF WARRANTY .\" .\" THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT .\" ARE EXPRESSLY DISCLAIMED. .\" .\" IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE .\" U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, .\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" This license will be governed by the laws of the Commonwealth of Virginia, .\" without reference to its choice of law rules. .if \n(Pb .ig Iq .TH qstat 1B "" Local PBS .so ../ers/ers.macros .Iq .SH NAME qstat \- show status of pbs batch jobs .SH SYNOPSIS qstat [\-f [\-1]] [\-l] [\-W site_specific] [\-x] [\^job_identifier... | destination...\^] .sp qstat [\-a|\-i|\-r|\-e] [\-l] [\-n [\-1]] [\-s] [\-G|\-M] [\-R] [\-u user_list] [\^job_identifier... |\ destination...\^] .sp qstat \-Q [\-f [\-1]][\-W site_specific] [\-l] [\^destination...\^] .sp qstat \-q [\-G|\-M] [\-l] [\^destination...\^] .sp qstat \-B [\-f [\-1]][\-W site_specific] [\-l] [\^server_name...\^] .SH DESCRIPTION The .B qstat command is used to request the status of jobs, queues, or a batch server. The requested status is written to standard out. .if !\n(Pb .ig Ig The status is obtained by sending a .I "Job Status" , a .I "Queue Status" , or a .I "Server Status" batch request to the appropriate server. .Ig .LP When requesting job status, synopsis format 1 or 2, .B qstat will output information about each .Ar job_identifier or all jobs at each .Ar destination . .if !\n(Pb .ig Ig .SM The capability to request status of all jobs at a destination is an extension to POSIX 1003.2d. .NL .Ig Jobs for which the user does not have status privilege are not displayed. .LP When requesting queue or server status, synopsis format 3 through 5, qstat will output information about each .Ar destination . .if !\n(Pb .ig Ig The syntax using the [\-a|-i|-r|-e] line or the \-q line are extensions to POSIX. .Ig .SH OPTIONS .IP "\-f" 10 Specifies that a full status display be written to standard out. .IP "\-a" 10 "All" jobs are displayed in the alternative format, see the Standard Output section. If the operand is a destination id, all jobs at that destination are displayed. If the operand is a job id, information about that job is displayed. .IP "\-e" 10 If the operand is a job id or not specified, only jobs in executable queues are displayed. Setting the PBS_QSTAT_EXECONLY environment variable will also enable this option. .IP "\-i" 10 Job status is displayed in the alternative format. For a destination id operand, status for jobs at that destination which are not running are displayed. This includes jobs which are queued, held or waiting. If an operand is a job id, status for that job is displayed regardless of its state. .IP "\-r" 10 If an operand is a job id, status for that job is displayed. For a destination id operand, status for jobs at that destination which are running are displayed, this includes jobs which are suspended. .IP "\-n" 10 In addition to the basic information, nodes allocated to a job are listed. .IP "\-1" 10 In combination with \-n, the \-1 option puts all of the nodes on the same line as the job ID. In combination with \-f, attributes are not folded to fit in a terminal window. This is intended to ease the parsing of the qstat output. .IP "\-s" 10 In addition to the basic information, any comment provided by the batch administrator or scheduler is shown. .IP "\-G" 10 Show size information in giga-bytes. .IP "\-M" 10 Show size information, disk or memory in mega-words. A word is considered to be 8 bytes. .IP "\-R" 10 In addition to other information, disk reservation information is shown. Not applicable to all systems. .IP "\-u" 10 Job status is displayed in the alternative format. If an operand is a job id, status for that job is displayed. For a destination id operand, status for jobs at that destination which are owned by the user(s) listed in .Ar user_list are displayed. The syntax of the .Ar user_list is: .br .Ty "\ \ \ \ user_name[@host][,user_name[@host],...]" .br Host names may be wild carded on the left end, e.g. "*.nasa.gov". User_name without a "@host" is equivalent to "user_name@*", that is at any host. .IP "\-Q" 10 Specifies that the request is for queue status and that the operands are destination identifiers. .IP "\-q" 10 Specifies that the request is for queue status which should be shown in the alternative format. .IP "\-B" 10 Specifies that the request is for batch server status and that the operands are the names of servers. .IP "\-x" 10 Specifies that the output is to be displayed in XML form. This option is only valid with the \-f option or by itself, which will also specify the \-f full status display. .IP "\-l" 10 Specifies that the long name of the job (or the job name appended with the suffix alias) should be displayed. .LP .SH OPERANDS If neither the .Ar \-Q nor the .Ar \-B option is given, the operands on the qstat command must be either job identifiers or destinations identifiers. .LP If the operand is a job identifier, it must be in the following form: .RS 5 .Ty sequence_number[.server_name][@server] .RE where .Ty sequence_number.server_name is the job identifier assigned at submittal time, see .BR qsub . If the .Ty .server_name is omitted, the name of the default server will be used. If .Ty @server is supplied, the request will be for the job identifier currently at that Server. .if !\n(Pb .ig Ig See ERS sections \*(Ji and \*(Di for more details on job identifiers and batch destinations. .Ig .LP If the operand is a destination identifier, it is one of the following three forms: .RS 5 .Ty queue .br .Ty @server .br .Ty queue@server .RE If .Ty queue is specified, the request is for status of all jobs in that queue at the default server. If the .Ty @server form is given, the request is for status of all jobs at that server. If a full destination identifier, .Ty queue@server , is given, the request is for status of all jobs in the named queue at the named server. .LP If the .Ar \-Q option is given, the operands are destination identifiers as specified above. If .Ty queue is specified, the status of that queue at the default server will be given. If .Ty queue@server is specified, the status of the named queue at the named server will be given. If .Ty @server is specified, the status of all queues at the named server will be given. If no destination is specified, the status of all queues at the default server will be given. .LP If the .Ar \-B option is given, the operand is the name of a server. .SH STANDARD OUTPUT Displaying Job Status .LP If job status is being displayed in the default format and the .Ar \-f option is not specified, the following items are displayed on a single line, in the specified order, separated by white space: .RS .IP \- 3 the job identifier assigned by PBS. .IP \- the job name given by the submitter. .IP \- the job owner .IP \- the CPU time used .IP \- the job state: .RS 0.5i C \- Job is completed after having run/ .br E \- Job is exiting after having run. .br H \- Job is held. .br Q \- job is queued, eligible to run or routed. .br R \- job is running. .br T \- job is being moved to new location. .br W \- job is waiting for its execution time .br (\-a option) to be reached. .br S \- (Unicos only) job is suspend. .br .if !\n(Pb .ig Ig .SM This set of state letters does not conform to the POSIX 1003.2d standard. It requires the sames letters, but in lower case. .NL .Ig .RE .IP \- the queue in which the job resides .RE .LP If job status is being displayed and the .Ar \-f option is specified, the output will depend on whether .B qstat was compiled to use a .B Tcl interpreter. See the configuration section for details. If .B Tcl is not being used, full display for each job consists of the header line: .br .Ty "\ \ \ \ Job Id:\ " job identifier .br Followed by one line per job attribute of the form: .br .Ty "\ \ \ \ attribute_name\ =\ value" .if !\n(Pb .ig Ig .LP The attribute name is indented 4 spaces. There is a single space on each side of the equal sign. Long values wrap either at column 78 or following a comma beyond which the next comma separated segment will not fit before column 79. Continuation lines are indented by a tab (8 spaces). There is blank line following the last attribute. .Ig .LP If any of the options \-a, \-i, \-r, \-u, \-n, \-s, \-G or \-M are provided, the alternative display format for jobs is used. The following items are displayed on a single line, in the specified order, separated by white space: .RS .IP \- 3 the job identifier assigned by PBS. .IP \- the job owner. .IP \- The queue in which the job currently resides. .IP \- The job name given by the submitter. .IP \- The session id (if the job is running). .IP \- The number of nodes requested by the job. .IP \- The number of cpus or tasks requested by the job. .IP \- The amount of memory requested by the job. .IP \- Either the cpu time, if specified, or wall time requested by the job, (hh:mm). .IP \- The job's current state. .IP \- The amount of cpu time or wall time used by the job (hh:mm). .RE If the \-R option is provided, the line contains: .RS .IP \- 3 the job identifier assigned by PBS. .IP \- the job owner. .IP \- The queue in which the job currently resides. .IP \- The number of nodes requested by the job. .IP \- The number of cpus or tasks requested by the job. .IP \- The amount of memory requested by the job. .IP \- Either the cpu time or wall time requested by the job. .IP \- The job's current state. .IP \- The amount of cpu time or wall time used by the job. .IP \- The amount of SRFS space requested on the big file system. .IP \- The amount of SRFS space requested on the fast file system. .IP \- The amount of space requested on the parallel I/O file system. .RE The last three fields may not contain useful information at all sites or on all systems. .br Note: Remaining walltime does not account for walltime multiplication factors. .sp 2 Displaying Queue Status .LP If queue status is being displayed and the .Ar \-f option was not specified, the following items are displayed on a single line, in the specified order, separated by white space: .RS 5 .IP \- the queue name .IP \- the maximum number of jobs that may be run in the queue concurrently .IP \- the total number of jobs in the queue .IP \- the enable or disabled status of the queue .IP \- the started or stopped status of the queue .IP \- for each job state, the name of the state and the number of jobs in the queue in that state. .IP \- the type of queue, execution or routing. .RE .LP If queue status is being displayed and the .Ar \-f option is specified, the output will depend on whether .B qstat was compiled to use a .B Tcl interpreter. See the configuration section for details. If .B Tcl is not being used, the full display for each queue consists of the header line: .br .Ty "\ \ \ \ Queue:\ " queue_name .br Followed by one line per queue attribute of the form: .br .Ty "\ \ \ \ attribute_name\ =\ value" .if !\n(Pb .ig Ig .LP The queue attributes are listed in the same format as job attributes. .Ig .LP If the \-q option is specified, queue information is displayed in the alternative format: The following information is displayed on a single line: .RS .IP \- 3 the queue name .IP \- the maximum amount of memory a job in the queue may request .IP \- the maximum amount of cpu time a job in the queue may request .IP \- the maximum amount of wall time a job in the queue may request .IP \- the maximum amount of nodes a job in the queue may request .IP \- the number of jobs in the queue in the running state .IP \- the number of jobs in the queue in the queued state .IP \- the maximum number (limit) of jobs that may be run in the queue concurrently .IP \- the state of the queue given by a pair of letters: .br \- either the letter E if the queue is Enabled or D if Disabled, and .br \- either the letter R if the queue is Running (started) or S if Stopped. .RE .sp 2 Displaying Server Status .LP If batch server status is being displayed and the .Ar \-f option is not specified, the following items are displayed on a single line, in the specified order, separated by white space: .RS 5 .IP \- the server name .IP \- the maximum number of jobs that the server may run concurrently .IP \- the total number of jobs currently managed by the server .IP \- the status of the server .IP \- for each job state, the name of the state and the number of jobs in the server in that state .RE .LP If server status is being displayed and the .Ar \-f option is specified, the output will depend on whether .B qstat was compiled to use a .B Tcl interpreter. See the configuration section for details. If .B Tcl is not being used, the full display for the server consist of the header line: .br .Ty "\ \ \ \ Server:\ " server name .br Followed by one line per server attribute of the form: .br .Ty "\ \ \ \ attribute_name = value" .if !\n(Pb .ig Ig .LP The server attributes are listed in the same format as job attributes. .Ig .LP .SH STANDARD ERROR The qstat command will write a diagnostic message to standard error for each error occurrence. .SH CONFIGURATION If .B qstat is compiled with an option to include a .B Tcl interpreter, using the .Ar \-f flag to get a full display causes a check to be made for a script file to use to output the requested information. The first location checked is $HOME/.qstatrc. If this does not exist, the next location checked is administrator configured. If one of these is found, a .B Tcl interpreter is started and the script file is passed to it along with three global variables. The command line arguments are split into two variable named .B flags and .B operands . The status information is passed in a variable named .B objects . All of these variables are .B Tcl lists. The .B flags list contains the name of the command (usually "qstat") as its first element. Any other elements are command line option flags with any options they use, presented in the order given on the command line. They are broken up individually so that if two flags are given together on the command line, they are separated in the list. For example, if the user typed .LP .Ty "qstat \-QfWbigdisplay" .LP the .B flags list would contain .LP .Ty "qstat \-Q \-f \-W bigdisplay" .LP The .B operands list contains all other command line arguments following the flags. There will always be at least one element in .B operands because if no operands are typed by the user, the default destination or server name is used. The .B objects list contains all the information retrieved from the server(s) so the Tcl interpreter can run once to format the entire output. This list has the same number of elements as the .B operands list. Each element is another list with two elements. The first element is a string giving the type of objects to be found in the second. The string can take the values "server", "queue", "job" or "error". The second element will be a list in which each element is a single batch status object of the type given by the string discussed above. In the case of "error", the list will be empty. Each object is again a list. The first element is the name of the object. The second is a list of attributes. The third element will be the object text. All three of these object elements correspond with fields in the structure .Ty batch_status which is described in detail for each type of object by the man pages for .B pbs_statjob(3), pbs_statque(3), and pbs_statserver(3). Each attribute in the second element list whose elements correspond with the .Ty attrl structure. Each will be a list with two elements. The first will be the attribute name and the second will be the attribute value. .SH EXIT STATUS Upon successful processing of all the operands presented to the qstat command, the exit status will be a value of zero. .LP If the qstat command fails to process any operand, the command exits with a value greater than zero. .SH SEE ALSO qalter(1B), qsub(1B), pbs_alterjob(3B), pbs_statjob(3B), pbs_statque(3B), pbs_statserver(3B), pbs_submit(3B), pbs_job_attributes(7B), pbs_queue_attributes(7B), pbs_server_attributes(7B), pbs_resources_*(7B) where * is system type, and the PBS ERS. \" turn off any extra indent left by the Sh macro .RE torque-2.4.16/README.cygwin0000664000113300011330000000343111272401253012211 00000000000000TORQUE clients can be built and used under Cygwin, but be aware that there is basicly no security. Windows doesn't have a concept of setuid root programs and priviledged ports. This means that any user on cygwin can impersonate any user on your cluster[1]. You have been warned! To install Cygwin, browse to http://www.cygwin.com and click the "Install Cygwin Now" link. Download and run setup.exe to install the base packages. After installation, run setup.exe again, click through the defaults and under the package selection, select the gcc and make packages. Run Cygwin and you should be looking at a terminal window with bash. Download the TORQUE tarball with wget, untar it, and ./configure, make, make install as usual. The configure script will warn that cygwin is an unsupported OS and disable the server[2] and mom components. After the install, put your TORQUE server name in $PBS_SERVER_HOME/server_name. As of July 24, 2006, Cygwin doesn't yet support getaddrinfo() which means that X11 forwarding won't be built. Tcl/Tk components are untested. Interactive jobs are untested. If your server has a host_acl, add the DNS hostname of your Cygwin box to it and you should be able to run qstat and pbsnodes. Now add the hostname to your server's submit_hosts and check your Cygwin username with 'id' in your bash shell. If it matches a username on your cluster, you can now submit jobs! If it doesn't match, edit /etc/passwd to change your uid to the desired username. [1] Someone should write a service to take the place of the setuid root pbs_iff, or wait for the forthcoming kerberos support. [2] The server and scheduler components will successfully build under Cygwin, but these components are disabled by default because actually running them on Cygwin isn't practical. torque-2.4.16/src/0000777000113300011330000000000011614035204010701 500000000000000torque-2.4.16/src/momctl/0000777000113300011330000000000011614035205012175 500000000000000torque-2.4.16/src/momctl/Makefile.in0000664000113300011330000004626611605403742014203 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(momctl_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk sbin_PROGRAMS = momctl$(EXEEXT) subdir = src/momctl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_momctl_OBJECTS = momctl.$(OBJEXT) momctl_OBJECTS = $(am_momctl_OBJECTS) momctl_LDADD = $(LDADD) am__DEPENDENCIES_1 = ../lib/Libpbs/libtorque.la momctl_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(momctl_SOURCES) DIST_SOURCES = $(momctl_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter PBS_LIBS = ../lib/Libpbs/libtorque.la LDADD = $(PBS_LIBS) momctl_SOURCES = momctl.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/momctl/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/momctl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done momctl$(EXEEXT): $(momctl_OBJECTS) $(momctl_DEPENDENCIES) @rm -f momctl$(EXEEXT) $(LINK) $(momctl_LDFLAGS) $(momctl_OBJECTS) $(momctl_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/momctl.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-exec-hook install-info install-info-am \ install-man install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-hook uninstall-info-am \ uninstall-sbinPROGRAMS install-exec-hook: $(PBS_MKDIRS) aux || : $(PBS_MKDIRS) default uninstall-hook: rm -f $(DESTDIR)$(PBS_DEFAULT_FILE) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/momctl/momctl.c0000664000113300011330000003274411307261653013573 00000000000000/* momctl */ /* build w/ cc momctl.c -o momctl -L ../lib/Libnet -L ../lib/Libpbs -lnet -lpbs -I ../include */ #include #include #include #include #include #include extern char *optarg; #include "mcom.h" #include "pbs_error.h" #include "pbs_ifl.h" #include "resmon.h" #include "rm.h" #define MAX_QUERY 128 char *LocalHost = "localhost"; char *DiagPtr = "diag"; char *Query[MAX_QUERY]; int QueryI = 0; char *FPtr = NULL; char *JPtr = NULL; char HostFile[256]; char ConfigBuf[65536]; int MOMPort = 0; /* use default PBS MOM port */ mbool_t IsVerbose = FALSE; enum MOMCmdEnum { momNONE = 0, momClear, momQuery, momReconfig, momShutdown }; enum MOMCmdEnum CmdIndex = momNONE; /* prototypes */ void MCShowUsage(char *); int do_mom(char *, int, int); /* END prototypes */ int main( int ArgC, /* I */ char **ArgV) /* I */ { const char *OptString = "c:Cd:f:h:p:q:r:sv"; char HostList[65536]; char *HPtr; int c; int HostCount; int FailCount; /* initialize */ HostList[0] = '\0'; ConfigBuf[0] = '\0'; if (getuid() != 0) { fprintf(stderr, "ERROR: must be root to run this command\n"); exit(EXIT_FAILURE); } while ((c = getopt(ArgC, ArgV, OptString)) != EOF) { switch (c) { case 'c': /* clear stale job */ JPtr = optarg; CmdIndex = momClear; break; case 'C': /* force cycle */ CmdIndex = momQuery; Query[QueryI] = strdup("cycle"); QueryI++; break; case 'd': /* diagnose */ /* FORMAT: momctl -d */ CmdIndex = momQuery; if ((Query[QueryI] = calloc(strlen(DiagPtr) + 3, sizeof(char))) == NULL) { fprintf(stderr,"ERROR: could not calloc %d bytes!\n", (int)strlen(DiagPtr) + 3); exit(EXIT_FAILURE); } if (optarg == NULL) { strncpy(Query[QueryI],DiagPtr,strlen(DiagPtr)); } else { snprintf(Query[QueryI],strlen(DiagPtr) + 2,"%s%s", DiagPtr, optarg); } QueryI++; break; case 'f': { int rc; FILE *fp; long size; if ((fp = fopen(optarg, "r")) == NULL) { fprintf(stderr, "ERROR: cannot open file '%s', errno: %d (%s)\n", optarg, errno, strerror(errno)); exit(EXIT_FAILURE); } rc = fread(HostList, sizeof(HostList), 1, fp); if ((rc == 0) && (!feof(fp))) { fprintf(stderr, "ERROR: cannot read file '%s', errno: %d (%s)\n", optarg, errno, strerror(errno)); exit(EXIT_FAILURE); } size = ftell(fp); HostList[MIN(size,(long)sizeof(HostList) - 1)] = '\0'; fclose(fp); } /* END BLOCK */ break; case 'h': /* connect to specified host */ strncpy(HostList,optarg,sizeof(HostList)); break; case 'p': /* port */ if (optarg == NULL) MCShowUsage("port not specified"); MOMPort = (int)strtol(optarg, NULL, 10); if (MOMPort == 0) MCShowUsage("invalid port specified"); break; case 'q': /* query resources */ if (optarg == NULL) { MCShowUsage("query not specified"); Query[QueryI] = strdup(DiagPtr); } else { Query[QueryI] = strdup(optarg); } QueryI++; CmdIndex = momQuery; break; case 'r': /* reconfigure */ { CmdIndex = momReconfig; /* NOTE: specify remote file to load -> 'fname' */ /* specify local file to stage -> 'LOCAL:fname' */ if (optarg == NULL) MCShowUsage("file not specified"); if (!strncmp(optarg, "LOCAL:", strlen("LOCAL:"))) { FILE *fp; int size; int rc; char *ptr; char *cptr; strcpy(ConfigBuf, "CONFIG:"); cptr = ConfigBuf + strlen(ConfigBuf); ptr = optarg + strlen("LOCAL:"); if ((fp = fopen(ptr, "r")) == NULL) { fprintf(stderr, "ERROR: cannot open file '%s', errno: %d (%s)\n", optarg, errno, strerror(errno)); exit(EXIT_FAILURE); } rc = fread(cptr, sizeof(ConfigBuf) - strlen(ConfigBuf), 1, fp); if ((rc == 0) && (!feof(fp))) { fprintf(stderr, "ERROR: cannot read file '%s', errno: %d (%s)\n", optarg, errno, strerror(errno)); exit(EXIT_FAILURE); } size = ftell(fp); ConfigBuf[MIN(size + strlen("CONFIG:"),sizeof(ConfigBuf) - 1)] = '\0'; fclose(fp); } else { strncpy(ConfigBuf, optarg, sizeof(ConfigBuf)); } } /* END (case 'r') */ break; case 's': /* shutdown */ CmdIndex = momShutdown; break; case 'v': /* report verbose logging */ IsVerbose = TRUE; break; } /* END switch (c) */ } /* END while (c = getopt()) */ if (CmdIndex == momNONE) { MCShowUsage("no command specified"); } if (HostList[0] == '\0') strcpy(HostList, LocalHost); HPtr = strtok(HostList, ", \t\n"); HostCount = 0; FailCount = 0; /* at this point, all args processing and setup is completed ... * ... now we run through each comma-delimited word in HPtr */ while (HPtr != NULL) { if ((*HPtr == ':') && (*(HPtr + 1) != '\0')) { /* finds nodes with this property */ int con; char *def_server, *pserver, *servername; struct batch_status *bstatus, *pbstat; struct attrl *nodeattrs; def_server = pbs_default(); if ((pserver = strchr(HPtr,'@')) != NULL) { *pserver = '\0'; servername = pserver + 1; } else { servername = def_server; } con = pbs_connect(servername); if (con < 0) { fprintf(stderr,"failed to connect to pbs_server:%s\n", servername); exit(EXIT_FAILURE); } /* get a batch_status entry for each node in ":property" */ bstatus = pbs_statnode(con,HPtr,NULL,NULL); if (bstatus != NULL) { for (pbstat = bstatus;pbstat != NULL;pbstat = pbstat->next) { /* check state first, only do_mom() if not down */ for (nodeattrs = pbstat->attribs;nodeattrs != NULL; nodeattrs = nodeattrs->next) { if (!strcmp(nodeattrs->name, ATTR_NODE_state)) { if (!strstr(nodeattrs->value, ND_down)) { do_mom(pbstat->name, MOMPort, CmdIndex) >= 0 ? HostCount++ : FailCount++; } else { fprintf(stderr,"%12s: skipping down node\n", pbstat->name); } break; } /* END if (attrib name eq state) */ } /* END for (nodeattrs) */ } /* END for (pbstat) */ pbs_statfree(bstatus); } /* END if (bstatus != NULL) */ else { fprintf(stderr,"no nodes found in %s on %s\n", HPtr, servername); } pbs_disconnect(con); if (pserver != NULL) *pserver = '@'; } else { do_mom(HPtr, MOMPort, CmdIndex) >= 0 ? HostCount++ : FailCount++; } /* END if (*HPtr == ':') */ HPtr = strtok(NULL, ", \t\n"); } /* END while (HPtr != NULL) */ if (IsVerbose == TRUE) { fprintf(stdout, "Node Summary: %d Successful %d Failed\n", HostCount, FailCount); } /* SUCCESS */ exit(EXIT_SUCCESS); } /* END main() */ int do_mom( char *HPtr, int MOMPort, int CmdIndex) { int sd; if ((sd = openrm(HPtr, MOMPort)) < 0) { /* FAILURE */ extern char TRMEMsg[]; fprintf(stderr, "cannot connect to MOM on node '%s', errno=%d (%s)\n", HPtr, pbs_errno, strerror(pbs_errno)); if (TRMEMsg[0] != '\0') { fprintf(stderr, " %s\n", TRMEMsg); } return(sd); } if (IsVerbose == TRUE) { fprintf(stderr, "INFO: successfully connected to %s\n", HPtr); } switch (CmdIndex) { case momClear: { char tmpLine[1024]; char *Value; snprintf(tmpLine, 1024, "clearjob=%s", (JPtr != NULL) ? JPtr : "all"); if (addreq(sd, tmpLine) != 0) { /* FAILURE */ fprintf(stderr,"ERROR: cannot request job clear on %s (errno=%d-%s: %d-%s)\n", HPtr, errno, pbs_strerror(errno), pbs_errno, pbs_strerror(pbs_errno)); closerm(sd); return(-1); } if ((Value = (char *)getreq(sd)) == NULL) { /* FAILURE */ fprintf(stderr,"ERROR: job clear failed on %s (errno=%d-%s: %d-%s)\n", HPtr, errno, pbs_strerror(errno), pbs_errno, pbs_strerror(pbs_errno)); closerm(sd); return(-1); } /* job cleared */ fprintf(stdout,"job clear request successful on %s\n", HPtr); } /* END BLOCK (case momClear) */ break; case momShutdown: { int rc; rc = downrm(sd); if (rc != 0) { /* FAILURE */ fprintf(stderr,"ERROR: cannot shutdown mom daemon on %s (errno=%d-%s: %d-%s)\n", HPtr, errno, pbs_strerror(errno), pbs_errno, pbs_strerror(pbs_errno)); closerm(sd); exit(EXIT_FAILURE); } fprintf(stdout, "shutdown request successful on %s\n", HPtr); } /* END BLOCK */ break; case momReconfig: { int rc; rc = configrm(sd, ConfigBuf); if (rc != 0) { /* FAILURE */ fprintf(stderr,"ERROR: cannot reconfigure mom on %s (errno=%d-%s: %d-%s)\n", HPtr, errno, pbs_strerror(errno), pbs_errno, pbs_strerror(pbs_errno)); closerm(sd); return(-1); } fprintf(stdout, "reconfig successful on %s\n", HPtr); } /* END BLOCK (case momReconfig) */ break; case momQuery: default: { char *ptr; int rindex; char *Value; for (rindex = 0;rindex < QueryI;rindex++) { if (addreq(sd, Query[rindex]) != 0) { fprintf(stderr,"ERROR: cannot add query for '%s' on %s (errno=%d-%s: %d-%s)\n", Query[rindex], HPtr, errno, pbs_strerror(errno), pbs_errno, pbs_strerror(pbs_errno)); } } for (rindex = 0;rindex < QueryI;rindex++) { if ((ptr = strchr(Query[rindex],'=')) != NULL) { *ptr = '\0'; } if ((Value = (char *)getreq(sd)) == NULL) { fprintf(stderr, "ERROR: query[%d] '%s' failed on %s (errno=%d-%s: %d-%s)\n", rindex, Query[rindex], HPtr, errno, pbs_strerror(errno), pbs_errno, pbs_strerror(pbs_errno)); } else { if (!strncmp(Query[rindex], "diag", strlen("diag"))) { fprintf(stdout, "%s\n", Value); } else if (!strncmp(Query[rindex], "cycle", strlen("cycle"))) { fprintf(stdout, "mom %s successfully cycled %s\n", HPtr, Value); } else { fprintf(stdout, "%12s: %12s = '%s'\n", HPtr, Query[rindex], Value); } } if (ptr != NULL) { *ptr = '='; } } /* END for (rindex) */ } /* END BLOCK (case momQuery) */ break; } /* END switch(CmdIndex) */ closerm(sd); return(0); } /* END do_mom() */ void MCShowUsage( char *Msg) /* I (optional) */ { if (Msg != NULL) fprintf(stderr, " %s\n", Msg); fprintf(stderr, "USAGE: momctl \n"); fprintf(stderr, " [ -c {JOB|'all'} ] // CLEAR STALE JOB\n"); fprintf(stderr, " [ -C ] // CYCLE\n"); fprintf(stderr, " [ -d DIAGLEVEL ] // DIAGNOSE (0 - 3)\n"); fprintf(stderr, " [ -f HOSTFILE ] // FILE CONTAINING HOSTLIST\n"); fprintf(stderr, " [ -h HOST[,HOST]... ] // HOSTLIST\n"); fprintf(stderr, " [ -p PORT ] // PORT\n"); fprintf(stderr, " [ -q ATTR ] // QUERY ATTRIBUTE\n"); fprintf(stderr, " [ -r FILE ] // RECONFIG\n"); fprintf(stderr, " [ -s ] // SHUTDOWN\n"); fprintf(stderr, "\n"); fprintf(stderr, " Only one of c, C, d, q, r, or s must be specified, but -q may\n"); fprintf(stderr, " be used multiple times. HOST may be a hostname or \":property\".\n"); exit(EXIT_FAILURE); } /* END MCShowUsage() */ /* END momctl.c */ torque-2.4.16/src/momctl/Makefile.am0000664000113300011330000000042311272401236014147 00000000000000include $(top_srcdir)/buildutils/config.mk PBS_LIBS = ../lib/Libpbs/libtorque.la sbin_PROGRAMS = momctl LDADD = $(PBS_LIBS) momctl_SOURCES = momctl.c install-exec-hook: $(PBS_MKDIRS) aux || : $(PBS_MKDIRS) default uninstall-hook: rm -f $(DESTDIR)$(PBS_DEFAULT_FILE) torque-2.4.16/src/resmom/0000777000113300011330000000000011614035173012210 500000000000000torque-2.4.16/src/resmom/mom_comm.c0000664000113300011330000036327411540173260014112 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H) #include #endif #include "libpbs.h" #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "server_limits.h" #include "pbs_job.h" #include "pbs_nodes.h" #include "pbs_error.h" #include "log.h" #include "net_connect.h" #include "rpp.h" #include "dis.h" #include "dis_init.h" #include "mom_func.h" #include "batch_request.h" #include "resmon.h" #include "mcom.h" #include "svrfunc.h" #ifdef PENABLE_LINUX26_CPUSETS #include "pbs_cpuset.h" #endif /* Global Data Items */ extern int exiting_tasks; extern char mom_host[]; extern char *path_jobs; extern char *path_home; extern int pbs_errno; extern unsigned int pbs_mom_port; extern unsigned int pbs_rm_port; extern unsigned int pbs_tm_port; extern tlist_head mom_polljobs; /* must have resource limits polled */ extern tlist_head svr_alljobs; /* all jobs under MOM's control */ extern int termin_child; extern time_t time_now; extern tree *okclients; /* accept connections from */ extern int port_care; extern char *path_prologp; extern char *path_prologuserp; const char *PMOMCommand[] = { "ALL_OKAY", "JOIN_JOB", "KILL_JOB", "SPAWN_TASK", "GET_TASKS", "SIGNAL_TASK", "OBIT_TASK", "POLL_JOB", "GET_INFO", "GET_RESC", "ABORT_JOB", "GET_TID", "ERROR", /* 12+ */ NULL }; char task_fmt[] = "/%010.10ld"; char noglobid[] = "none"; extern int LOGLEVEL; extern long TJobStartBlockTime; /* external functions */ extern void exec_bail(job *, int); extern int TMomFinalizeJob1(job *, pjobexec_t *, int *); extern int TMomFinalizeJob2(pjobexec_t *, int *); extern int TMomFinalizeJob3(pjobexec_t *, int, int, int *); extern int TMOMJobGetStartInfo(job *, pjobexec_t **) ; extern int TMomCheckJobChild(pjobexec_t *, int, int *, int *); extern void job_nodes(job *); extern int tlist(tree *, char *, int); extern void DIS_tcp_funcs(); extern int TTmpDirName(job *, char *); extern int TMakeTmpDir(job *, char *); extern void mom_server_close_stream(int stream); char *cat_dirs(char *root, char *base); char *get_local_script_path(job *pjob, char *base); #ifdef PENABLE_LINUX26_CPUSETS extern int use_cpusets(job *); #endif /* PENABLE_LINUX26_CPUSETS */ /* END external functions */ /* ** Save the critical information associated with a task to disk. */ int task_save( task *ptask) /* I */ { static char id[] = "task_save"; job *pjob = ptask->ti_job; int fds; int i; int TaskID = 0; char namebuf[MAXPATHLEN]; int openflags; strcpy(namebuf, path_jobs); /* job directory path */ strcat(namebuf, pjob->ji_qs.ji_fileprefix); strcat(namebuf, JOB_TASKDIR_SUFFIX); openflags = O_WRONLY | O_CREAT | O_Sync; if (LOGLEVEL >= 6) { sprintf(log_buffer, "saving task in %s", namebuf); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_SERVER, id, log_buffer); } #ifdef HAVE_OPEN64 fds = open64(namebuf, openflags, 0600); #else fds = open(namebuf, openflags, 0600); #endif if (fds < 0) { log_err(errno, id, "error on open"); return(-1); } TaskID = ptask->ti_qs.ti_task; /* adjust task ID if it is adopted... */ if (IS_ADOPTED_TASK(ptask->ti_qs.ti_task)) { TaskID = ptask->ti_qs.ti_task % TM_ADOPTED_TASKID_BASE; } #ifdef HAVE_LSEEK64 if (lseek64(fds, (off_t)(TaskID*sizeof(ptask->ti_qs)), SEEK_SET) < 0) #else if (lseek(fds, (off_t)(TaskID*sizeof(ptask->ti_qs)), SEEK_SET) < 0) #endif { log_err(errno, id, "lseek"); close(fds); return(-1); } /* NOTE: to avoid partial write failures in fs full situations, */ /* attempt write of empty buffer, if success, then write actual task? */ /* (NYI) */ /* just write the "critical" base structure to the file */ while ((i = write( fds, (char *) & ptask->ti_qs, sizeof(ptask->ti_qs))) != sizeof(ptask->ti_qs)) { if ((i < 0) && (errno == EINTR)) { /* retry the write */ #ifdef HAVE_LSEEK64 if (lseek64(fds, (off_t)(TaskID*sizeof(ptask->ti_qs)), SEEK_SET) < 0) #else if (lseek(fds, (off_t)(TaskID*sizeof(ptask->ti_qs)), SEEK_SET) < 0) #endif { log_err(errno, id, "lseek"); close(fds); return(-1); } continue; } log_err(errno, id, "quickwrite"); close(fds); return(-1); } /* END while (i = write()) */ /* SUCCESS */ close(fds); return(0); } /* END task_save() */ /* ** Allocate an event and link it to the given nodeent entry. */ eventent *event_alloc( int command, hnodent *pnode, tm_event_t event, tm_task_id taskid) { static tm_event_t eventnum = TM_NULL_EVENT + 1; eventent *ep; ep = (eventent *)malloc(sizeof(eventent)); assert(ep); ep->ee_command = command; ep->ee_event = (event == TM_NULL_EVENT) ? eventnum++ : event; ep->ee_taskid = taskid; ep->ee_forward.fe_node = TM_ERROR_NODE; ep->ee_forward.fe_event = TM_ERROR_EVENT; ep->ee_forward.fe_taskid = TM_NULL_TASK; ep->ee_argv = NULL; ep->ee_envp = NULL; CLEAR_LINK(ep->ee_next); append_link(&pnode->hn_events, &ep->ee_next, ep); return(ep); } /* END event_alloc() */ /* Forward declaration */ static int adoptSession(pid_t sid, char *id, int command, char *cookie); /* * Create a new task if the current number is less then * the tasks per node limit. */ task *pbs_task_create( job *pjob, tm_task_id taskid) { static char id[] = "pbs_task_create"; task *ptask; attribute *at; resource_def *rd; resource *pres; u_long tasks; /* DJH 27 feb 2002. Check that we aren't about to run into the */ /* task IDs that we use to label adopted tasks. */ if ((taskid == TM_NULL_TASK) && (pjob->ji_taskid >= TM_ADOPTED_TASKID_BASE)) { sprintf(log_buffer, "Ran into reserved task IDs on job %s", pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); return NULL; } for (ptask = (task *)GET_NEXT(pjob->ji_tasks), tasks = 0; ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask), tasks++); at = &pjob->ji_wattr[(int)JOB_ATR_resource]; rd = find_resc_def(svr_resc_def, "taskspn", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); if (pres != NULL) { if (tasks >= (unsigned long)pres->rs_value.at_val.at_long) { return(NULL); } } ptask = (task *)calloc(1, sizeof(task)); assert(ptask); /* initialize task */ ptask->ti_job = pjob; CLEAR_LINK(ptask->ti_jobtask); append_link(&pjob->ji_tasks, &ptask->ti_jobtask, ptask); ptask->ti_fd = -1; ptask->ti_flags = 0; ptask->ti_register = TM_NULL_EVENT; CLEAR_HEAD(ptask->ti_obits); CLEAR_HEAD(ptask->ti_info); memset(ptask->ti_qs.ti_parentjobid, 0, sizeof(ptask->ti_qs.ti_parentjobid)); ptask->ti_qs.ti_parentnode = TM_ERROR_NODE; ptask->ti_qs.ti_parenttask = TM_NULL_TASK; ptask->ti_qs.ti_task = ((taskid == TM_NULL_TASK) ? pjob->ji_taskid++ : taskid); ptask->ti_qs.ti_status = TI_STATE_EMBRYO; ptask->ti_qs.ti_sid = 0; ptask->ti_qs.ti_exitstat = 0; memset(ptask->ti_qs.ti_u.ti_hold, 0, sizeof(ptask->ti_qs.ti_u.ti_hold)); /* SUCCESS */ return(ptask); } /* END pbs_task_create() */ task *task_find( job *pjob, tm_task_id taskid) { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_task == taskid) break; } return(ptask); } task *task_check( job *pjob, tm_task_id taskid) { static char id[] = "task_check"; task *ptask; if (taskid == TM_NULL_TASK) { /* don't bother with the error messages */ return(NULL); } ptask = task_find(pjob, taskid); if (ptask == NULL) { sprintf(log_buffer, "%s requesting task %ld not found", pjob->ji_qs.ji_jobid, (long)taskid); log_err(-1, id, log_buffer); return(NULL); } if (ptask->ti_fd < 0) { sprintf(log_buffer, "cannot tm_reply to task %ld", (long)taskid); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return(NULL); } return(ptask); } /* END task_check() */ /* ** task_recov() ** Recover (read in) the tasks from their save files for a job. ** ** This function is only needed upon MOM start up. */ int task_recov( job *pjob) { static char id[] = "task_recov"; int fds; task *pt; char namebuf[MAXPATHLEN]; struct taskfix task_save; tm_task_id tid; strcpy(namebuf, path_jobs); /* job directory path */ strcat(namebuf, pjob->ji_qs.ji_fileprefix); strcat(namebuf, JOB_TASKDIR_SUFFIX); #ifdef HAVE_OPEN64 fds = open64(namebuf, O_RDONLY, 0); #else fds = open(namebuf, O_RDONLY, 0); #endif if (fds < 0) { log_err(errno, id, "open of task file"); unlink(namebuf); return -1; } /* read in task quick save sub-structure */ while (read(fds, (char *)&task_save, sizeof(task_save)) == sizeof(task_save)) { tid = TM_NULL_TASK; if (IS_ADOPTED_TASK(task_save.ti_task)) { /* * Set the high water mark for adopted task ids. Its * "+1" due to the post-increment when we generate the * task ids. */ pjob->maxAdoptedTaskId = MAX(pjob->maxAdoptedTaskId, (int)(task_save.ti_task + 1)); tid = task_save.ti_task; } if ((pt = pbs_task_create(pjob, tid)) == NULL) { log_err(errno, id, "cannot create task"); close(fds); return -1; } pt->ti_qs = task_save; } /* END while read */ close(fds); return(0); } /* END task_recov() */ /* ** Send a reply message to a user proc over a TCP stream. */ int tm_reply( int stream, int com, tm_event_t event) { int ret; DIS_tcp_funcs(); ret = diswsi(stream, TM_PROTOCOL); if (ret != DIS_SUCCESS) goto done; ret = diswsi(stream, TM_PROTOCOL_VER); if (ret != DIS_SUCCESS) goto done; ret = diswsi(stream, com); if (ret != DIS_SUCCESS) goto done; ret = diswsi(stream, event); if (ret != DIS_SUCCESS) goto done; return(DIS_SUCCESS); done: DBPRT(("tm_reply: send error %s\n", dis_emsg[ret])) return(ret); } /* tm_reply() */ /* ** Start a standard inter-MOM message. */ int im_compose( int stream, char *jobid, char *cookie, int command, tm_event_t event, tm_task_id taskid) { int ret; if (stream < 0) { return(DIS_EOF); } DIS_rpp_reset(); ret = diswsi(stream, IM_PROTOCOL); if (ret != DIS_SUCCESS) goto err; ret = diswsi(stream, IM_PROTOCOL_VER); if (ret != DIS_SUCCESS) goto err; ret = diswst(stream, jobid); if (ret != DIS_SUCCESS) goto err; ret = diswst(stream, cookie); if (ret != DIS_SUCCESS) goto err; ret = diswsi(stream, command); if (ret != DIS_SUCCESS) goto err; ret = diswsi(stream, event); if (ret != DIS_SUCCESS) goto err; ret = diswsi(stream, taskid); if (ret != DIS_SUCCESS) goto err; return(DIS_SUCCESS); err: DBPRT(("im_compose: send error %s\n", dis_emsg[ret])) return(ret); } /* END im_compose() */ /** * Send a message (command = com) to all the other MOMs in the job -> pjob. * * @see scan_for_exiting() - parent - report to sisters upon job completion * @see examine_all_polled_jobs() - parent - poll job status info * @see exec_bail() - parent - abort parallel job * * @see start_exec() - peer - opens connections to sisters at parallel job start * * @return 0 on FAILURE or number of sister mom's successfully contacted on SUCCESS */ int send_sisters( job *pjob, /* I */ int com) /* I (command to send to all sisters) */ { char *id = "send_sisters"; int i, num, ret; eventent *ep; char *cookie; if (LOGLEVEL >= 4) { sprintf(log_buffer, "sending command %s for job %s (%d)", PMOMCommand[com], pjob->ji_qs.ji_jobid, com); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_REQUEST, id, log_buffer); } if (!(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_flags & ATR_VFLAG_SET)) { /* cookie not set - return FAILURE */ return(0); } cookie = pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str; num = 0; if (com == IM_ABORT_JOB) { snprintf(log_buffer, 1024, "sending ABORT to sisters for job %s", pjob->ji_qs.ji_jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_REQUEST, id, log_buffer); } /* walk thru node list, contact each mom */ for (i = 0;i < pjob->ji_numnodes;i++) { hnodent *np = &pjob->ji_hosts[i]; if (np->hn_node == pjob->ji_nodeid) /* this is me */ continue; if (np->hn_sister != SISTER_OKAY) /* sister is gone? */ { snprintf(log_buffer, 1024, "%s: sister #%d (%s) is not ok (%d)", id, i, (np->hn_host != NULL) ? np->hn_host : "NULL", np->hn_sister); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* garrick commented out continue statement below */ /* continue; */ } if (np->hn_stream == -1) { char EMsg[1024]; EMsg[0] = 0; np->hn_stream = rpp_open(np->hn_host, pbs_rm_port, EMsg); if (np->hn_stream == -1) { snprintf(log_buffer, 1024, "%s: cannot open rpp connection to sister #%d (%s) - %s", id, i, (np->hn_host != NULL) ? np->hn_host : "NULL", EMsg); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); if(LOGLEVEL >= 6) { if(EMsg[0] != 0) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, EMsg); } } continue; } } ep = event_alloc(com, np, TM_NULL_EVENT, TM_NULL_TASK); if (ep == NULL) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "cannot alloc event object in send_sisters"); continue; } ret = im_compose( np->hn_stream, pjob->ji_qs.ji_jobid, cookie, com, ep->ee_event, TM_NULL_TASK); if (ret != DIS_SUCCESS) { snprintf(log_buffer, 1024, "%s: cannot compose message to sister #%d (%s) - %d", id, i, (np->hn_host != NULL) ? np->hn_host : "NULL", ret); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); rpp_close(np->hn_stream); np->hn_stream = -1; np->hn_sister = SISTER_EOF; continue; } ret = rpp_flush(np->hn_stream); if (ret == -1) { snprintf(log_buffer, 1024, "%s: cannot flush message to sister #%d (%s)", id, i, (np->hn_host != NULL) ? np->hn_host : "NULL"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); rpp_close(np->hn_stream); np->hn_stream = -1; np->hn_sister = SISTER_EOF; continue; } np->hn_sister = SISTER_OKAY; num++; } /* END for (i) */ return(num); } /* END send_sisters() */ #define SEND_ERR(err) \ if (reply) { \ im_compose(stream,jobid,cookie,IM_ERROR,event,fromtask); \ diswsi(stream,err); \ } /** * Check to see which node a stream is coming from. Return a NULL * if it is not assigned to this job. Return a nodeent pointer if * it is. */ hnodent *find_node( job *pjob, int stream, tm_node_id nodeid) { static char id[] = "find_node"; int i; vnodent *vp; hnodent *hp; struct sockaddr_in *stream_addr; struct sockaddr_in *node_addr; for (vp = pjob->ji_vnods, i = 0;i < pjob->ji_numvnod;vp++, i++) { if (vp->vn_node == nodeid) break; } /* END for (vp) */ if (i == pjob->ji_numvnod) { sprintf(log_buffer, "node %d not found", nodeid); log_err(-1, id, log_buffer); return(NULL); } hp = vp->vn_host; stream_addr = rpp_getaddr(stream); node_addr = rpp_getaddr(hp->hn_stream); if (stream_addr == NULL) { /* caller didn't have a stream */ /* if node is not me and no stream open, open one */ if (pjob->ji_nodeid != hp->hn_node && node_addr == NULL) hp->hn_stream = rpp_open(hp->hn_host, pbs_rm_port, NULL); return(hp); } /* No stream recorded in the node info, save this one. */ if (node_addr == NULL) { hp->hn_stream = stream; return(hp); } /* ** At this point, both the input stream and the recorded ** stream for the node are good. If they are the same ** index, we are done. */ if (hp->hn_stream == stream) { return(hp); } /* ** The node struct has a different stream number saved ** then the one passed in (supposedly from the same node). ** Check to see if stream recorded in the node struct ** and the one passed in have the same IP address. If ** they do (only a possibly different port number), ** we are fine. Otherwise, a mixup has happened. */ /* if (memcmp( &stream_addr->sin_addr, &node_addr->sin_addr, sizeof(node_addr->sin_addr)) != 0) { */ if (stream_addr->sin_addr.s_addr != node_addr->sin_addr.s_addr) { /* FAILURE */ char *addr1; char *addr2; addr1 = strdup(netaddr(stream_addr)); addr2 = strdup(netaddr(node_addr)); sprintf(log_buffer, "stream id %d does not match %d to node %d (stream=%s node=%s)", stream, hp->hn_stream, nodeid, (addr1 != NULL) ? addr1 : "", (addr2 != NULL) ? addr2 : ""); log_err(-1, id, log_buffer); free(addr1); free(addr2); return(NULL); } return(hp); } /* END find_node() */ /** * An error has been encountered starting a job. * * Format a message to all the sisterhood to get rid of their copy * of the job. There should be no processes running at this point. */ void job_start_error( job *pjob, /* I */ int code, /* I */ char *nodename) /* I */ { static char id[] = "job_start_error"; static char abortjobid[64]; static int abortcount = -1; attribute *pattr; char tmpLine[1024]; if (abortcount == -1) { abortjobid[0] = '\0'; } sprintf(log_buffer, "job_start_error from node %s in %s", nodename, id); log_err(code, pjob->ji_qs.ji_jobid, log_buffer); if (!strcmp(abortjobid, pjob->ji_qs.ji_jobid)) { if (abortcount >= 16) { /* abort is not working, do not send sisters again */ sprintf(log_buffer, "abort attempted 16 times in %s. ignoring abort request from node %s", id, nodename); log_err(code, pjob->ji_qs.ji_jobid, log_buffer); exec_bail(pjob, JOB_EXEC_RETRY); return; } abortcount++; } else { strcpy(abortjobid, pjob->ji_qs.ji_jobid); abortcount = 1; } /* annotate job with failed node info */ snprintf(tmpLine, sizeof(tmpLine), "REJHOST=%s", nodename); pattr = &pjob->ji_wattr[(int)JOB_ATR_sched_hint]; job_attr_def[(int)JOB_ATR_sched_hint].at_free(pattr); job_attr_def[(int)JOB_ATR_sched_hint].at_decode( pattr, NULL, NULL, tmpLine); pjob->ji_wattr[(int)JOB_ATR_errpath].at_flags = (ATR_VFLAG_SET | ATR_VFLAG_MODIFY | ATR_VFLAG_SEND); /* NOTE: is there a way to force the updated 'sched_hint' info to pbs_server before the obit to avoid a race condition? */ /* Perhaps, pbs_mom could register job and perform 'exec_bail' after next job status query from pbs_server? */ /* NOTE: exec_bail() will issue 'send_sisters(pjob,IM_ABORT_JOB);' */ exec_bail(pjob, JOB_EXEC_RETRY); return; } /* END job_start_error() */ /* ** Free malloc'ed array (used in SPAWN) */ void arrayfree( char **array) /* I - freed */ { int i; for (i = 0;array[i];i++) free(array[i]); free(array); return; } /** * Deal with events hooked to a node where a stream has gone * south or we are going away. * * @see term_job() - parent - terminate job * @see im_eof() - parent - inter-MOM end of file detected */ void node_bailout( job *pjob, /* I */ hnodent *np) /* I */ { static char id[] = "node_bailout"; task *ptask; eventent *ep; int i; ep = (eventent *)GET_NEXT(np->hn_events); while (ep != NULL) { switch (ep->ee_command) { case IM_JOIN_JOB: /* * I'm MS and a node has failed to respond to the * call. Maybe in the future the user can specify * the job can start with a range of nodes so * one (or more) missing can be tolerated. Not * for now. */ sprintf(log_buffer, "%s join_job failed from node %s %d - recovery attempted)", pjob->ji_qs.ji_jobid, np->hn_host, np->hn_node); log_err(-1, id, log_buffer); DBPRT(("%s: JOIN_JOB %s\n", id, pjob->ji_qs.ji_jobid)) job_start_error(pjob, PBSE_SISCOMM, np->hn_host); break; case IM_ABORT_JOB: case IM_KILL_JOB: /* ** The job is already in the process of being killed ** but somebody has dropped off the face of the ** earth. Just check to see if everybody has ** been heard from in some form or another and ** set JOB_SUBSTATE_EXITING if so. */ sprintf(log_buffer, "%s: received KILL/ABORT request for job %s from node %s", id, pjob->ji_qs.ji_jobid, np->hn_host); log_err(-1, id, log_buffer); for (i = 1;i < pjob->ji_numnodes;i++) { if (pjob->ji_hosts[i].hn_sister == SISTER_OKAY) break; } /* END for (i) */ if (i == pjob->ji_numnodes) { /* all dead */ pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; job_save(pjob, SAVEJOB_QUICK); exiting_tasks = 1; } break; case IM_SPAWN_TASK: case IM_GET_TASKS: case IM_SIGNAL_TASK: case IM_OBIT_TASK: case IM_GET_INFO: case IM_GET_RESC: /* ** A user attempt failed, inform process. */ DBPRT(("%s: REQUEST %d %s\n", id, ep->ee_command, pjob->ji_qs.ji_jobid)) ptask = task_check(pjob, ep->ee_taskid); if (ptask == NULL) break; tm_reply(ptask->ti_fd, TM_ERROR, ep->ee_event); diswsi(ptask->ti_fd, TM_ESYSTEM); DIS_tcp_wflush(ptask->ti_fd); break; case IM_POLL_JOB: /* ** I must be Mother Superior for the job and ** this is an error reply to a poll request. */ #ifdef __TRR /* roadrunner */ sprintf(log_buffer, "%s POLL failed from node %s %d - recovery attempted - job will not be killed)", pjob->ji_qs.ji_jobid, np->hn_host, np->hn_node); log_err(-1, id, log_buffer); #else /* __TRR */ /* we should be more patient - how do we recover this connection? (NYI) */ /* if job attribute fault_tolerant is not set or set to false then kill the job */ if ((pjob->ji_wattr[(int)JOB_ATR_fault_tolerant].at_flags & ATR_VFLAG_SET) && pjob->ji_wattr[(int)JOB_ATR_fault_tolerant].at_val.at_long) { sprintf(log_buffer, "%s POLL failed from node %s %d - job is fault tolerant - job will not be killed)", pjob->ji_qs.ji_jobid, np->hn_host, np->hn_node); } else { sprintf(log_buffer, "%s POLL failed from node %s %d - recovery not attempted - job will be killed)", pjob->ji_qs.ji_jobid, np->hn_host, np->hn_node); pjob->ji_nodekill = np->hn_node; } log_err(-1, id, log_buffer); #endif /* __TRR */ break; case IM_GET_TID: /* ** A request to Mother Superior to get ** a TID has failed. */ DBPRT(("%s: GET_TID %s\n", id, pjob->ji_qs.ji_jobid)) arrayfree(ep->ee_argv); arrayfree(ep->ee_envp); ptask = task_check(pjob, ep->ee_forward.fe_taskid); if (ptask == NULL) break; tm_reply( ptask->ti_fd, TM_ERROR, ep->ee_forward.fe_event); diswsi(ptask->ti_fd, TM_ESYSTEM); DIS_tcp_wflush(ptask->ti_fd); break; default: sprintf(log_buffer, "unknown command %d saved", ep->ee_command); log_err(-1, id, log_buffer); break; } /* END switch (ep->ee_command) */ delete_link(&ep->ee_next); free(ep); ep = (eventent *)GET_NEXT(np->hn_events); } /* END while (ep != NULL) */ return; } /* END node_bailout() */ /** terminate job - terminate all node events of all types contained by nodes in job nodelist */ void term_job( job *pjob) /* I */ { hnodent *np; int num; for (num = 0, np = pjob->ji_hosts;num < pjob->ji_numnodes;num++, np++) { if (np->hn_stream >= 0) { rpp_close(np->hn_stream); np->hn_stream = -1; np->hn_sister = SISTER_EOF; } node_bailout(pjob, np); } /* END for (num) */ return; } /* END term_job() */ /* * Handle a stream that needs to be closed. * May be either from another MOM, or the server. * * @see im_request() - parent * @see do_rpp() - parent */ void im_eof( int stream, /* I */ int ret) /* I */ { static char id[] = "im_eof"; int num = -1; job *pjob = NULL; hnodent *np = NULL; struct sockaddr_in *addr; addr = rpp_getaddr(stream); sprintf(log_buffer, "%s from addr %s", dis_emsg[ret], netaddr(addr)); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); rpp_close(stream); mom_server_close_stream(stream); /* ** Search though all the jobs looking for this stream. ** We want to find if any events are being waited for ** from the "dead" stream and do something with them. */ for (pjob = (job *)GET_NEXT(svr_alljobs); pjob != NULL; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { for (num = 0, np = pjob->ji_hosts;num < pjob->ji_numnodes;num++, np++) { if (np->hn_stream == stream) { np->hn_stream = -1; np->hn_sister = SISTER_EOF; break; } } /* END for (num) */ if (num < pjob->ji_numnodes) /* found it */ break; } /* END for (pjob) */ if (pjob == NULL) { return; } /* matching job located - connection has failed - close all connections to MOM */ node_bailout(pjob, np); /* ** If dead stream is num = 0, I'm a regular node and my connection to ** Mother Superior is gone... kill job. */ if (num == 0) { sprintf(log_buffer, "job %s lost connection to MS on %s", pjob->ji_qs.ji_jobid, np->hn_host); log_err(-1, id, log_buffer); /* don't just give up, maybe mother superior is just being restarted, do not set exiting_tasks -gs */ /* disabled - USC 2/11/2005 */ /* * exiting_tasks = 1; * * pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; */ } return; } /* END im_eof() */ /* * Check to be sure this is a connection from Mother Superior on * a good port. * Check to make sure I am not Mother Superior (talking to myself). * Set the stream in ji_nodes[0] if needed. * Return TRUE on error, FALSE if okay. */ int check_ms( int stream, /* I */ job *pjob) /* I */ { static char id[] = "check_ms"; struct sockaddr_in *addr; hnodent *np; addr = rpp_getaddr(stream); if ((port_care != 0) && (ntohs(addr->sin_port) >= IPPORT_RESERVED)) { sprintf(log_buffer, "non-privileged connection from %s", netaddr(addr)); log_err(-1, id, log_buffer); rpp_close(stream); return(TRUE); } if (pjob == NULL) { return(FALSE); } if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) { log_err(-1, id, "Mother Superior talking to herself"); rpp_eom(stream); return(TRUE); } /* ** This should be mother superior calling. ** We always have a stream open to her at node 0. */ np = &pjob->ji_hosts[0]; /* MS entry */ if (stream != np->hn_stream) { if (np->hn_stream != -1) { sprintf(log_buffer, "MS reset from %d to %d (%s)", np->hn_stream, stream, netaddr(addr)); log_err(-1, id, log_buffer); } np->hn_stream = stream; } return(FALSE); } /* END check_ms() */ u_long resc_used( job *pjob, char *name, u_long(*func) A_((resource *))) { attribute *at; resource_def *rd; resource *pres; u_long val = 0L; at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; if (at == NULL) { return(0); } rd = find_resc_def(svr_resc_def, name, svr_resc_size); if (rd == NULL) return 0; pres = find_resc_entry(at, rd); if (pres == NULL) return 0; val = func(pres); DBPRT(("resc_used: %s %lu\n", name, val)) return(val); } /* ** Find named info for a task. */ infoent * task_findinfo(task *ptask, char *name) { infoent *ip; for (ip = (infoent *)GET_NEXT(ptask->ti_info); ip; ip = (infoent *)GET_NEXT(ip->ie_next)) { if (strcmp(ip->ie_name, name) == 0) break; } return ip; } /* ** Save named info with a task. */ void task_saveinfo( task *ptask, char *name, void *info, size_t len) { infoent *ip; if ((ip = task_findinfo(ptask, name)) == NULL) { /* new name */ ip = (infoent *)malloc(sizeof(infoent)); assert(ip); CLEAR_LINK(ip->ie_next); append_link(&ptask->ti_info, &ip->ie_next, ip); ip->ie_name = name; } else { /* replace name with new info */ free(ip->ie_info); } ip->ie_info = info; ip->ie_len = len; return; } /* END task_saveinfo() */ /* ** Generate a resource string for a job. */ char *resc_string( job *pjob) { attribute *at; attribute_def *ad; svrattrl *pal; tlist_head lhead; int len, used, tot; char *res_str, *ch; char *getuname(); extern int resc_access_perm; char *tmpResStr; ch = getuname(); len = strlen(ch); tot = len * 2; used = 0; res_str = (char *)malloc(tot); if (res_str == NULL) { /* FAILURE - cannot alloc memory */ return(NULL); } strcpy(res_str, ch); used += len; res_str[used++] = ':'; at = &pjob->ji_wattr[(int)JOB_ATR_resource]; if (at->at_type != ATR_TYPE_RESC) { /* SUCCESS */ res_str[used] = '\0'; return(res_str); } ad = &job_attr_def[(int)JOB_ATR_resource]; resc_access_perm = ATR_DFLAG_USRD; CLEAR_HEAD(lhead); ad->at_encode( at, &lhead, ad->at_name, NULL, ATR_ENCODE_CLIENT); attrl_fixlink(&lhead); for (pal = (svrattrl *)GET_NEXT(lhead); pal; pal = (svrattrl *)GET_NEXT(pal->al_link)) { while (used + pal->al_rescln + pal->al_valln > tot) { tot *= 2; tmpResStr = realloc(res_str,tot); if (tmpResStr == NULL) { /* FAILURE - cannot alloc memory */ free(res_str); return(NULL); } res_str = tmpResStr; } strcpy(&res_str[used], pal->al_resc); used += (pal->al_rescln - 1); res_str[used++] = '='; strcpy(&res_str[used], pal->al_value); used += (pal->al_valln - 1); res_str[used++] = ','; } free_attrlist(&lhead); res_str[--used] = '\0'; /* SUCCESS */ return(res_str); } /* END resc_string() */ /** * Input is coming from another MOM over a DIS rpp stream. * Read the stream to get a Inter-MOM request. * * request ( * jobid string * cookie string * command int * event int * task int * ) * * Format the reply and write it back. * * @see im_eof() - child - called if failure occurs */ void im_request( int stream, /* I */ int version) /* I */ { char *id = "im_request"; int command = 0; int event_com = 0, ret; char *jobid = NULL; char *cookie = NULL; char *oreo; char basename[50]; char namebuf[MAXPATHLEN]; job *pjob; task *ptask; hnodent *np; eventent *ep = NULL; infoent *ip; struct sockaddr_in *addr; u_long ipaddr; int i, j, errcode, nodeidx = 0; int reply; int exitval; tm_node_id nodeid; tm_task_id fromtask, event_task = 0, taskid; int nodenum, index; int num; int sig; char **argv = NULL, **envp = NULL, *cp, *globid; char *name; void *info; size_t len; tm_event_t event; fwdevent efwd; tlist_head lhead; svrattrl *psatl; attribute_def *pdef; struct passwd *check_pwd(); extern int resc_access_perm; int start_process A_((task *, char **, char **)); u_long gettime A_((resource *)); u_long getsize A_((resource *)); memset(&efwd, 0, sizeof(efwd)); if (version != IM_PROTOCOL_VER) { sprintf(log_buffer, "protocol version %d unknown", version); log_err(-1, id, log_buffer); rpp_close(stream); return; } /* check that machine is known */ addr = rpp_getaddr(stream); ipaddr = ntohl(addr->sin_addr.s_addr); if (LOGLEVEL >= 3) { sprintf(log_buffer, "connect from %s", netaddr(addr)); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if (tfind(ipaddr, &okclients) == NULL) { char tmpLine[1024]; tmpLine[0] = '\0'; tlist(okclients, tmpLine, 1024); sprintf(log_buffer, "bad connect from %s - unauthorized (okclients: %s)", netaddr(addr), tmpLine); log_err(-1, id, log_buffer); rpp_close(stream); return; } jobid = disrst(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer,"request for failed - %s (jobid)", dis_emsg[ret]); log_err(-1,id,log_buffer); goto err; } cookie = disrst(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer,"request for job %s failed - %s (cookie)", jobid, dis_emsg[ret]); log_err(-1,id,log_buffer); goto err; } command = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer,"request for job %s failed - %s (command)", jobid, dis_emsg[ret]); log_err(-1,id,log_buffer); goto err; } event = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer,"%s request for job %s failed - %s (event)", PMOMCommand[MIN(command,IM_MAX)], jobid, dis_emsg[ret]); log_err(-1,id,log_buffer); goto err; } fromtask = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer,"%s request for job %s failed - %s (fromtask)", PMOMCommand[MIN(command,IM_MAX)], jobid, dis_emsg[ret]); log_err(-1,id,log_buffer); goto err; } if (LOGLEVEL >= 3) { sprintf(log_buffer,"received request '%s' for job %s from %s", PMOMCommand[MIN(command,IM_MAX)], jobid, netaddr(addr)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); DBPRT(("%s\n", log_buffer)); } switch (command) { case IM_JOIN_JOB: /* ** Sender is mother superior sending a job structure to me. ** I am going to become a member of a job. ** ** auxiliary info ( ** localnode id int; ** number of nodes int; ** stdout port int; ** stderr port int; ** nodeid 0 int; ** ... ** nodeid n-1 int; ** jobattrs attrl; ** ) */ reply = 1; if (check_ms(stream, NULL)) goto fini; nodeid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer,"join_job request for job %s failed - %s (nodeid)", jobid, dis_emsg[ret]); log_err(-1, id, log_buffer); goto err; } nodenum = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "join_job request from node %d for job %s failed - %s (nodenum)", nodeid, jobid, dis_emsg[ret]); log_err(-1, id, log_buffer); goto err; } if (LOGLEVEL >= 3) { sprintf(log_buffer, "%s: JOIN_JOB %s node %d", id, jobid, nodeid); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } np = NULL; /* does job already exist? */ pjob = find_job(jobid); if (pjob != NULL) { /* job already exists locally */ if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) { if (LOGLEVEL >= 3) { /* if peer mom times out, MS will send new join request for same job */ sprintf(log_buffer, "WARNING: duplicate JOIN request %s from %s (purging previous pjob)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } job_purge(pjob); } else { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s (job already exists locally)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } /* should local job be purged, ie 'job_purge(pjob);' ? */ SEND_ERR(PBSE_JOBEXIST) goto done; } } /* END if (pjob != NULL) */ if ((pjob = job_alloc()) == NULL) { /* out of memory */ log_err(-1, id, "insufficient memory to create job"); SEND_ERR(PBSE_SYSTEM) goto done; } pjob->ji_stdout = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "%s: join_job request to node %d for job %s failed - %s (stdout)", id, nodeid, jobid, dis_emsg[ret]); log_err(-1, id, log_buffer); goto err; } pjob->ji_stderr = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "%s: join_job request to node %d for job %s failed - %s (stderr)", id, nodeid, jobid, dis_emsg[ret]); log_err(-1, id, log_buffer); goto err; } pjob->ji_numnodes = nodenum; /* XXX */ CLEAR_HEAD(lhead); if (decode_DIS_svrattrl(stream, &lhead) != DIS_SUCCESS) { sprintf(log_buffer, "%s: join_job request to node %d for job %s failed - %s (decode)", id, nodeid, jobid, dis_emsg[ret]); log_err(-1, id, log_buffer); goto err; } /* Get the hashname from the attribute. */ psatl = (svrattrl *)GET_NEXT(lhead); while (psatl) { if (!strcmp(psatl->al_name, ATTR_hashname)) { strcpy(basename, psatl->al_value); break; } psatl = (svrattrl *)GET_NEXT(psatl->al_link); } strcpy(pjob->ji_qs.ji_jobid, jobid); strcpy(pjob->ji_qs.ji_fileprefix, basename); pjob->ji_modified = 1; pjob->ji_nodeid = nodeid; pjob->ji_qs.ji_svrflags = 0; pjob->ji_qs.ji_un_type = JOB_UNION_TYPE_MOM; /* decode attributes from request into job structure */ errcode = 0; resc_access_perm = READ_WRITE; for (psatl = (svrattrl *)GET_NEXT(lhead); psatl; psatl = (svrattrl *)GET_NEXT(psatl->al_link)) { /* identify the attribute by name */ index = find_attr(job_attr_def, psatl->al_name, JOB_ATR_LAST); if (index < 0) { /* didn`t recognize the name */ errcode = PBSE_NOATTR; break; } pdef = &job_attr_def[index]; /* decode attribute */ errcode = pdef->at_decode( &pjob->ji_wattr[index], psatl->al_name, psatl->al_resc, psatl->al_value); if (errcode != 0) break; } /* END for (psatl) */ free_attrlist(&lhead); if (errcode != 0) { if (LOGLEVEL >= 6) { sprintf(log_buffer, "error %d received in joinjob - purging job", errcode); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } job_purge(pjob); SEND_ERR(errcode) goto done; } job_nodes(pjob); /* set remaining job structure elements */ pjob->ji_qs.ji_state = JOB_STATE_TRANSIT; pjob->ji_qs.ji_substate = JOB_SUBSTATE_PRERUN; pjob->ji_qs.ji_stime = time_now; pjob->ji_wattr[(int)JOB_ATR_mtime].at_val.at_long = (long)time_now; pjob->ji_wattr[(int)JOB_ATR_mtime].at_flags |= ATR_VFLAG_SET; /* check_pwd is setting up ji_un as type MOM pjob->ji_qs.ji_un_type = JOB_UNION_TYPE_NEW; pjob->ji_qs.ji_un.ji_newt.ji_fromsock = -1; pjob->ji_qs.ji_un.ji_newt.ji_fromaddr = addr->sin_addr.s_addr; pjob->ji_qs.ji_un.ji_newt.ji_scriptsz = 0; */ if (check_pwd(pjob) == NULL) { /* log_buffer populated in check_pwd() */ LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); job_purge(pjob); SEND_ERR(PBSE_BADUSER) goto done; } /* should we make a tmpdir? */ if (TTmpDirName(pjob, namebuf)) { if (!TMakeTmpDir(pjob, namebuf)) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "cannot create tmp dir"); job_purge(pjob); SEND_ERR(PBSE_BADUSER) goto done; } } #ifdef PENABLE_LINUX26_CPUSETS if (use_cpusets(pjob) == TRUE) { sprintf(log_buffer, "about to create cpuset for job %s.\n", pjob->ji_qs.ji_jobid); log_ext(-1, id, log_buffer, LOG_INFO); if (create_jobset(pjob) == FAILURE) { sprintf(log_buffer, "Could not create cpuset for job %s.\n", pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); } } #endif /* (PENABLE_LINUX26_CPUSETS) */ /* run local prolog */ if ((j = run_pelog( PE_PROLOG, path_prologp, pjob, PE_IO_TYPE_ASIS)) != 0) { DBPRT(("cannot run local prolog '%s': %s (rc: %d)\n", path_prologp, log_buffer, j)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); job_purge(pjob); SEND_ERR(PBSE_SYSTEM) goto done; } /* run user prolog */ if ((j = run_pelog( PE_PROLOGUSER, path_prologuserp, pjob, PE_IO_TYPE_ASIS)) != 0) { DBPRT(("cannot run local user prolog '%s': %s (rc: %d)\n", path_prologuserp, log_buffer, j)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); job_purge(pjob); SEND_ERR(PBSE_SYSTEM) goto done; } #if IBM_SP2==2 /* IBM SP with PSSP 3.1 */ if (load_sp_switch(pjob) != 0) { job_purge(pjob); log_err(-1, id, "cannot load sp switch table"); SEND_ERR(PBSE_SYSTEM) goto done; } #endif /* IBM SP */ job_save(pjob, SAVEJOB_FULL); sprintf(log_buffer, "JOIN JOB as node %d", nodeid); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); /* ** if certain resource limits require that the job usage be ** polled, we link the job to mom_polljobs. ** ** NOTE: we overload the job field ji_jobque for this as it ** is not used otherwise by MOM */ if (mom_do_poll(pjob)) append_link(&mom_polljobs, &pjob->ji_jobque, pjob); append_link(&svr_alljobs, &pjob->ji_alljobs, pjob); ret = im_compose( stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); goto done; /*NOTREACHED*/ break; /* END IM_JOIN_JOB */ case IM_ALL_OKAY: case IM_ERROR: reply = 0; break; default: reply = 1; break; } /* END switch (command) */ np = NULL; /* ** Check if job already exists. */ if ((pjob = find_job(jobid)) == NULL) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s for job '%s' (job does not exist locally)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } SEND_ERR(PBSE_JOBEXIST) goto done; } /* check cookie */ if (!(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_flags & ATR_VFLAG_SET)) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s for job '%s' (job has no cookie)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } SEND_ERR(PBSE_BADSTATE) goto done; } oreo = pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str; if (strcmp(oreo, cookie) != 0) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s for job '%s' (job has corrupt cookie - '%s' != '%s')", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid, oreo, cookie); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } SEND_ERR(PBSE_BADSTATE) goto done; } /* ** This is some processing needed that is common between ** both kinds of reply. */ if (reply == 0) { for (nodeidx = 0;nodeidx < pjob->ji_numnodes;nodeidx++) { np = &pjob->ji_hosts[nodeidx]; if (np->hn_stream == stream) break; } if (nodeidx == pjob->ji_numnodes) { sprintf(log_buffer, "stream %d not found", stream); log_err(-1, id, log_buffer); goto err; } ep = (eventent *)GET_NEXT(np->hn_events); while (ep != NULL) { if ((ep->ee_event == event) && (ep->ee_taskid == fromtask)) break; ep = (eventent *)GET_NEXT(ep->ee_next); } if (ep == NULL) { sprintf(log_buffer, "event %d taskid %ld not found", event, (long)fromtask); log_err(-1, id, log_buffer); goto err; } efwd = ep->ee_forward; event_com = ep->ee_command; event_task = ep->ee_taskid; argv = ep->ee_argv; envp = ep->ee_envp; delete_link(&ep->ee_next); free(ep); } /* END if (reply == 0) */ switch (command) { case IM_KILL_JOB: /* ** Sender is (must be) mom superior commanding me to kill a ** job which I should be a part of. ** Send a signal and set the jobstate to begin the ** kill. We wait for all tasks to exit before sending ** an obit to mother superior. ** ** auxiliary info ( ** none; ** ) */ if (check_ms(stream, pjob)) goto fini; /* ** Send the jobs a signal but we have to wait to ** do a reply to mother superior until the procs ** die and are reaped. */ reply = 0; kill_job(pjob, SIGKILL, id, "kill_job message received"); pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; pjob->ji_obit = event; job_save(pjob, SAVEJOB_QUICK); exiting_tasks = 1; break; case IM_SPAWN_TASK: /* ** Sender is a MOM in a job that wants to start a task. ** I am MOM on the node that is to run the task. ** ** auxiliary info ( ** parent node tm_node_id ** task id tm_task_id ** global id string ** argv 0 string ** ... ** argv n string ** null ** envp 0 string ** ... ** envp m string ** ) */ nodeid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; if ((np = find_node(pjob, stream, nodeid)) == NULL) { SEND_ERR(PBSE_BADHOST) break; } taskid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; globid = disrst(stream, &ret); if (ret != DIS_SUCCESS) goto err; if (LOGLEVEL >= 3) { sprintf(log_buffer, "INFO: received request '%s' from %s for job '%s' (spawning task on node '%d' with taskid=%d, globid='%s'", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid, nodeid, taskid, globid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } if (pjob->ji_globid == NULL) { pjob->ji_globid = globid; } else if (strcmp(pjob->ji_globid, noglobid) == 0) { free(pjob->ji_globid); pjob->ji_globid = globid; } else if (strcmp(pjob->ji_globid, globid) != 0) { DBPRT(("%s: globid job %s received %s\n", id, pjob->ji_globid, globid)) free(globid); } num = 4; argv = (char **)calloc(sizeof(char **), num); assert(argv); for (i = 0;;i++) { if ((cp = disrst(stream, &ret)) == NULL) break; if (ret != DIS_SUCCESS) break; if (*cp == '\0') { free(cp); break; } if (i == num - 1) { char **tmpArgV; num *= 2; tmpArgV = (char **)realloc(argv,num * sizeof(char **)); if (tmpArgV == NULL) goto err; argv = tmpArgV; } argv[i] = cp; } /* END for (i) */ argv[i] = NULL; if (ret != DIS_SUCCESS) { arrayfree(argv); goto err; } num = 8; envp = (char **)calloc(sizeof(char **), num); assert(envp); for (i = 0;;i++) { if ((cp = disrst(stream, &ret)) == NULL) break; if (ret != DIS_SUCCESS) break; if (*cp == '\0') { free(cp); break; } if (i == num - 1) { num *= 2; envp = (char **)realloc(envp, num * sizeof(char **)); assert(envp); } envp[i] = cp; } /* END for (i) */ envp[i] = NULL; if (ret != DIS_EOD) { arrayfree(argv); arrayfree(envp); goto err; } /* ** do the spawn */ ret = DIS_SUCCESS; if ((ptask = pbs_task_create(pjob, taskid)) == NULL) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s for job '%s' (cannot create task)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } SEND_ERR(PBSE_SYSTEM); arrayfree(argv); arrayfree(envp); break; } strcpy(ptask->ti_qs.ti_parentjobid, jobid); ptask->ti_qs.ti_parentnode = nodeid; ptask->ti_qs.ti_parenttask = fromtask; if (LOGLEVEL >= 6) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, "saving task (IM_SPAWN_TASK)"); } if (task_save(ptask) == -1) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s for job '%s' (cannot save task)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid); LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, jobid, log_buffer); } SEND_ERR(PBSE_SYSTEM) arrayfree(argv); arrayfree(envp); break; } if (start_process(ptask, argv, envp) == -1) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s for job '%s' (cannot start task)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } SEND_ERR(TM_ESYSTEM) arrayfree(argv); arrayfree(envp); break; } ret = im_compose( stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); if (ret != DIS_SUCCESS) { /* SUCCESS but cannot reply */ if (LOGLEVEL >= 0) { sprintf(log_buffer, "ALERT: received request '%s' from %s for job '%s' (task successfully started but reply failed)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } arrayfree(argv); arrayfree(envp); break; } /* SUCCESS */ ret = diswsi(stream, ptask->ti_qs.ti_task); arrayfree(argv); arrayfree(envp); break; case IM_GET_TASKS: /* ** Sender is MOM which controls a task that wants to get ** the list of tasks running here. ** ** auxiliary info ( ** sending node tm_node_id; ** ) */ nodeid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: GET_TASKS %s from node %d\n", id, jobid, nodeid)) if ((np = find_node(pjob, stream, nodeid)) == NULL) { SEND_ERR(PBSE_BADHOST) break; } ret = im_compose( stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); if (ret != DIS_SUCCESS) break; for (ptask = (task *)GET_NEXT(pjob->ji_tasks);ptask != NULL;ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { ret = diswsi(stream, ptask->ti_qs.ti_task); if (ret != DIS_SUCCESS) break; } break; case IM_SIGNAL_TASK: /* ** Sender is MOM sending a task and signal to ** deliver. If taskid is 0, signal all tasks. ** ** auxiliary info ( ** sending node tm_node_id; ** taskid tm_task_id; ** signal int; ** ) */ nodeid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; if ((np = find_node(pjob, stream, nodeid)) == NULL) { SEND_ERR(PBSE_BADHOST) break; } taskid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; sig = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; if (taskid == 0) { DBPRT(("%s: SIGNAL_TASK %s from node %d all tasks signal %d\n", id, jobid, nodeid, sig)) for ( ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { kill_task(ptask, sig, 0); } /* if STOPing all tasks, we're obviously suspending the job */ if (sig == SIGSTOP) { pjob->ji_qs.ji_substate = JOB_SUBSTATE_SUSPEND; pjob->ji_qs.ji_svrflags |= JOB_SVFLG_Suspend; } else if (sig == SIGCONT) { pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_Suspend; } } else { DBPRT(("%s: SIGNAL_TASK %s from node %d task %d signal %d\n", id, jobid, nodeid, taskid, sig)) ptask = task_find(pjob, taskid); if (ptask == NULL) { SEND_ERR(PBSE_JOBEXIST) break; } sprintf(log_buffer, "%s: SIGNAL_TASK %s from node %d task %d signal %d", id, jobid, nodeid, taskid, sig); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); kill_task(ptask, sig, 0); } ret = im_compose(stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); break; case IM_OBIT_TASK: /* ** Sender is MOM sending a request to monitor a ** task for exit. ** ** auxiliary info ( ** sending node tm_node_id; ** taskid tm_task_id; ** ) */ nodeid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; if ((np = find_node(pjob, stream, nodeid)) == NULL) { SEND_ERR(PBSE_BADHOST) break; } taskid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; ptask = task_find(pjob, taskid); if (ptask == NULL) { SEND_ERR(PBSE_JOBEXIST) break; } DBPRT(("%s: OBIT_TASK %s from node %d task %d\n", id, jobid, nodeid, taskid)) if (ptask->ti_qs.ti_status >= TI_STATE_EXITED) { ret = im_compose(stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); if (ret != DIS_SUCCESS) break; ret = diswsi(stream, ptask->ti_qs.ti_exitstat); } else { /* save obit request with task */ obitent *op = (obitent *)malloc(sizeof(obitent)); assert(op); CLEAR_LINK(op->oe_next); append_link(&ptask->ti_obits, &op->oe_next, op); op->oe_info.fe_node = nodeid; op->oe_info.fe_event = event; op->oe_info.fe_taskid = fromtask; reply = 0; } break; case IM_GET_INFO: /* ** Sender is MOM sending a task and name to lookup ** for info to report back. ** ** auxiliary info ( ** sending node tm_node_id; ** taskid tm_task_id; ** name string; ** ) */ nodeid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; if ((np = find_node(pjob, stream, nodeid)) == NULL) { SEND_ERR(PBSE_BADHOST) break; } taskid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; ptask = task_find(pjob, taskid); if (ptask == NULL) { SEND_ERR(PBSE_JOBEXIST) break; } name = disrst(stream, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: GET_INFO %s from node %d task %d name %s\n", id, jobid, nodeid, taskid, name)) if ((ip = task_findinfo(ptask, name)) == NULL) { SEND_ERR(PBSE_JOBEXIST) break; } ret = im_compose( stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); if (ret != DIS_SUCCESS) break; ret = diswcs(stream, ip->ie_info, ip->ie_len); break; case IM_GET_RESC: /* ** Sender is MOM requesting resource info to ** report back its client. ** ** auxiliary info ( ** sending node tm_node_id; ** ) */ nodeid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; if ((np = find_node(pjob, stream, nodeid)) == NULL) { SEND_ERR(PBSE_BADHOST) break; } DBPRT(("%s: GET_RESC %s from node %d\n", id, jobid, nodeid)) info = resc_string(pjob); ret = im_compose( stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); if (ret != DIS_SUCCESS) break; ret = diswst(stream, info); free(info); break; case IM_POLL_JOB: /* ** Sender is (must be) mom superior commanding me to send ** information for a job which I should be a part of. ** ** auxiliary info ( ** none; ** ) */ if (check_ms(stream, pjob)) goto fini; DBPRT(("%s: POLL_JOB %s\n", id, jobid)) ret = im_compose( stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); if (ret != DIS_SUCCESS) break; if (pjob->ji_qs.ji_state == JOB_STATE_TRANSIT) { /* first poll, set job to running */ pjob->ji_qs.ji_state = JOB_STATE_RUNNING; pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; job_save(pjob, SAVEJOB_QUICK); } /* Now comes a recomendation for killing the job. */ exitval = (pjob->ji_qs.ji_svrflags & (JOB_SVFLG_OVERLMT1 | JOB_SVFLG_OVERLMT2)) ? 1 : 0; ret = diswsi(stream, exitval); if (ret != DIS_SUCCESS) break; /* get fresh resource usage */ mom_set_use(pjob); /* ** Send the information tallied for the job. */ ret = diswul(stream, resc_used(pjob, "cput", gettime)); if (ret != DIS_SUCCESS) break; ret = diswul(stream, resc_used(pjob, "mem", getsize)); if (ret != DIS_SUCCESS) break; ret = diswul(stream, resc_used(pjob, "vmem", getsize)); break; case IM_ABORT_JOB: /* ** Sender is (must be) mom superior commanding me to ** abort a JOIN_JOB request. ** ** auxiliary info ( ** none; ** ) */ if (check_ms(stream, pjob)) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "ERROR: received request '%s' from %s for job '%s' (requestor is not parent)", PMOMCommand[MIN(command,IM_MAX)], netaddr(addr), jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } goto fini; } if (LOGLEVEL >= 2) { sprintf(log_buffer, "%s: received KILL/ABORT request for job %s from node %s", id, jobid, netaddr(addr)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } reply = 0; job_purge(pjob); break; case IM_GET_TID: /* * I must be mom superior getting a request from a * sub-mom to get a TID. * * auxiliary info ( * none; * ) */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { log_err(-1, id, "got GET_TID and I'm not MS"); goto err; } DBPRT(("%s: GET_TID %s\n", id, jobid)) /* DJH 27 Feb 2002 */ if (IS_ADOPTED_TASK(pjob->ji_taskid)) { log_err(-1, id, "Ran into reserved task ids"); goto err; } ret = im_compose(stream, jobid, cookie, IM_ALL_OKAY, event, fromtask); if (ret != DIS_SUCCESS) break; ret = diswsi(stream, pjob->ji_taskid++); break; case IM_ALL_OKAY: /* this is a REPLY */ /* ** Sender is another MOM telling me that a request has ** completed successfully. */ switch (event_com) { case IM_JOIN_JOB: /* ** Sender is one of the sisterhood saying she ** got the job structure sent and she accepts it. ** I'm mother superior. ** ** auxiliary info ( ** none; ** ) */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { log_err(-1, id, "got JOIN_JOB OKAY and I'm not MS"); goto err; } for (i = 0;i < pjob->ji_numnodes;i++) { np = &pjob->ji_hosts[i]; if ((ep = (eventent *)GET_NEXT(np->hn_events)) != NULL) break; } /* END for (i) */ if (ep == NULL) { pjobexec_t *TJE; int SC; int RC; int Count; /* no events remaining, all moms have reported in, launch job locally */ if (LOGLEVEL >= 2) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "all sisters have reported in, launching job locally"); } TMOMJobGetStartInfo(NULL, &TJE); if (TMomFinalizeJob1(pjob, TJE, &SC) == FAILURE) { /* FAILURE (or at least do not continue) */ if (SC != 0) { memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, SC); } break; } /* TMomFinalizeJob2() blocks until job is fully launched */ if (TMomFinalizeJob2(TJE, &SC) == FAILURE) { if (SC != 0) { memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, SC); } break; } /* block, wait for child to complete indicating success/failure of job launch */ if (TMomCheckJobChild(TJE, TJobStartBlockTime, &Count, &RC) == FAILURE) { if (LOGLEVEL >= 3) { sprintf(log_buffer, "job not ready after %ld second timeout, MOM will check later", TJobStartBlockTime); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } break; } /* NOTE: TMomFinalizeJob3() populates SC */ if (TMomFinalizeJob3(TJE, Count, RC, &SC) == FAILURE) { sprintf(log_buffer, "ALERT: job failed phase 3 start"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, SC); break; } /* SUCCESS: MOM returns */ memset(TJE, 0, sizeof(pjobexec_t)); if (LOGLEVEL >= 3) { sprintf(log_buffer, "job successfully started"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } /* END if (ep == NULL) */ else { if (LOGLEVEL >= 4) { sprintf(log_buffer, "joinjob response received from node %s, (still waiting for %s)", netaddr(addr), np->hn_host); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } break; case IM_KILL_JOB: /* ** Sender is sending a response that a job ** which needs to die has been given the ax. ** I'm mother superior. ** ** auxiliary info ( ** cput ulong; ** mem ulong; ** vmem ulong; ** ) */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { log_err(-1, id, "got KILL_JOB OKAY and I'm not MS"); goto err; } if (LOGLEVEL >= 2) { sprintf(log_buffer, "KILL_JOB acknowledgement received"); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } if (pjob->ji_resources != NULL) { pjob->ji_resources[nodeidx - 1].nr_cput = disrul(stream, &ret); if (ret != DIS_SUCCESS) goto err; pjob->ji_resources[nodeidx - 1].nr_mem = disrul(stream, &ret); if (ret != DIS_SUCCESS) goto err; pjob->ji_resources[nodeidx - 1].nr_vmem = disrul(stream, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: %s FINAL from %d cpu %lu sec mem %lu kb vmem %ld kb\n", id, jobid, nodeidx, pjob->ji_resources[nodeidx - 1].nr_cput, pjob->ji_resources[nodeidx - 1].nr_mem, pjob->ji_resources[nodeidx - 1].nr_vmem)) } /* END if (pjob_ji_resources != NULL) */ /* don't close stream in case other jobs use it */ np->hn_sister = SISTER_KILLDONE; for (i = 1;i < pjob->ji_numnodes;i++) { if (pjob->ji_hosts[i].hn_sister == SISTER_OKAY) break; } if (i == pjob->ji_numnodes) { /* all dead */ DBPRT(("%s: ALL DONE, set EXITING job %s\n", id, jobid)) pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; job_save(pjob, SAVEJOB_QUICK); exiting_tasks = 1; } break; case IM_SPAWN_TASK: /* ** Sender is MOM responding to a "spawn_task" ** request. ** ** auxiliary info ( ** task id tm_task_id; ** ) */ taskid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: SPAWN_TASK %s OKAY task %d\n", id, jobid, taskid)) ptask = task_check(pjob, event_task); if (ptask == NULL) break; tm_reply(ptask->ti_fd, TM_OKAY, event); diswsi(ptask->ti_fd, taskid); DIS_tcp_wflush(ptask->ti_fd); break; case IM_GET_TASKS: /* ** Sender is MOM giving a list of tasks which she ** has started for this job. ** ** auxiliary info ( ** task id tm_task_id; ** ... ** task id tm_task_id; ** ) */ DBPRT(("%s: GET_TASKS %s OKAY\n", id, jobid)) ptask = task_check(pjob, event_task); if (ptask == NULL) break; tm_reply(ptask->ti_fd, TM_OKAY, event); for (;;) { DIS_rpp_reset(); taskid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { if (ret == DIS_EOD) break; goto err; } DIS_tcp_funcs(); diswsi(ptask->ti_fd, taskid); } DIS_tcp_funcs(); diswsi(ptask->ti_fd, TM_NULL_TASK); DIS_tcp_wflush(ptask->ti_fd); break; case IM_SIGNAL_TASK: /* ** Sender is MOM with a good signal to report. ** ** auxiliary info ( ** none; ** ) */ DBPRT(("%s: SIGNAL_TASK %s OKAY %d\n", id, jobid, event_task)) ptask = task_check(pjob, event_task); if (ptask == NULL) break; tm_reply(ptask->ti_fd, TM_OKAY, event); DIS_tcp_wflush(ptask->ti_fd); break; case IM_OBIT_TASK: /* ** Sender is MOM with a death report. ** ** auxiliary info ( ** exit value int; ** ) */ exitval = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: OBIT_TASK %s OKAY %d exit val %d\n", id, jobid, event_task, exitval)) ptask = task_check(pjob, event_task); if (ptask == NULL) break; tm_reply(ptask->ti_fd, TM_OKAY, event); diswsi(ptask->ti_fd, exitval); DIS_tcp_wflush(ptask->ti_fd); break; case IM_GET_INFO: /* ** Sender is MOM with a named info to report. ** ** auxiliary info ( ** info counted string; ** ) */ info = disrcs(stream, &len, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: GET_INFO %s OKAY %d\n", id, jobid, event_task)) ptask = task_check(pjob, event_task); if (ptask == NULL) { free(info); break; } tm_reply(ptask->ti_fd, TM_OKAY, event); diswcs(ptask->ti_fd, info, len); DIS_tcp_wflush(ptask->ti_fd); break; case IM_GET_RESC: /* ** Sender is MOM with a resource info to report. ** ** auxiliary info ( ** info counted string; ** ) */ info = disrst(stream, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: GET_RESC %s OKAY %d\n", id, jobid, event_task)) ptask = task_check(pjob, event_task); if (ptask == NULL) { free(info); break; } tm_reply(ptask->ti_fd, TM_OKAY, event); diswst(ptask->ti_fd, info); DIS_tcp_wflush(ptask->ti_fd); break; case IM_POLL_JOB: /* ** I must be Mother Superior for the job and ** this is a reply with job resources to ** tally up. ** ** auxiliary info ( ** recommendation int; ** cput u_long; ** mem u_long; ** vmem u_long; ** ) */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { log_err(-1, id, "got POLL_JOB and I'm not MS"); goto err; } exitval = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; pjob->ji_resources[nodeidx - 1].nr_cput = disrul(stream, &ret); if (ret != DIS_SUCCESS) goto err; pjob->ji_resources[nodeidx - 1].nr_mem = disrul(stream, &ret); if (ret != DIS_SUCCESS) goto err; pjob->ji_resources[nodeidx - 1].nr_vmem = disrul(stream, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: POLL_JOB %s OKAY kill %d cpu=%lu mem=%lu vmem=%lu\n", id, jobid, exitval, pjob->ji_resources[nodeidx - 1].nr_cput, pjob->ji_resources[nodeidx - 1].nr_mem, pjob->ji_resources[nodeidx - 1].nr_vmem)) if (exitval != 0) { if (LOGLEVEL >= 2) { sprintf(log_buffer, "non-zero exit status reported from node %s, aborting job", np->hn_host); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } pjob->ji_nodekill = np->hn_node; } break; case IM_GET_TID: /* ** Sender must be Mother Superior with a TID. ** I will either do the spawn or forward the SPAWN ** to the final destination. ** ** auxiliary info ( ** task id tm_task_id; ** ) */ if (check_ms(stream, pjob)) goto fini; taskid = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; /* ** Check to see if I need to forward the taskid ** to another MOM. */ if (pjob->ji_nodeid != efwd.fe_node) { np = find_node(pjob, -1, efwd.fe_node); if (np == NULL) goto done; ep = event_alloc( IM_SPAWN_TASK, np, efwd.fe_event, efwd.fe_taskid); ret = im_compose( np->hn_stream, jobid, cookie, IM_SPAWN_TASK, efwd.fe_event, efwd.fe_taskid); if (ret != DIS_SUCCESS) goto done; ret = diswsi(np->hn_stream, pjob->ji_nodeid); if (ret != DIS_SUCCESS) goto done; ret = diswsi(np->hn_stream, taskid); if (ret != DIS_SUCCESS) goto done; ret = diswst(np->hn_stream, pjob->ji_globid); if (ret != DIS_SUCCESS) goto done; for (i = 0;argv[i];i++) { ret = diswst(np->hn_stream, argv[i]); if (ret != DIS_SUCCESS) goto done; } ret = diswst(np->hn_stream, ""); if (ret != DIS_SUCCESS) goto done; for (i = 0;envp[i];i++) { ret = diswst(np->hn_stream, envp[i]); if (ret != DIS_SUCCESS) goto done; } ret = (rpp_flush(np->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; arrayfree(argv); arrayfree(envp); break; } /* END if (pjob->ji_nodeid != efwd.fe_node) */ /* It's me, do the spawn */ ret = 0; if ((ptask = pbs_task_create(pjob, taskid)) != NULL) { strcpy(ptask->ti_qs.ti_parentjobid, jobid); ptask->ti_qs.ti_parentnode = efwd.fe_node; ptask->ti_qs.ti_parenttask = efwd.fe_taskid; if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "saving task (IM_GET_TID)"); } if (task_save(ptask) != -1) ret = start_process(ptask, argv, envp); } arrayfree(argv); arrayfree(envp); taskid = ptask->ti_qs.ti_task; ptask = task_check(pjob, efwd.fe_taskid); if (ptask == NULL) break; tm_reply( ptask->ti_fd, (ret == -1) ? TM_ERROR : TM_OKAY, efwd.fe_event); diswsi( ptask->ti_fd, (int)(ret == -1 ? TM_ESYSTEM : taskid)); DIS_tcp_wflush(ptask->ti_fd); break; default: sprintf(log_buffer, "unknown request type %d saved", event_com); log_err(-1, id, log_buffer); break; } /* END switch (event_com) */ break; case IM_ERROR: /* this is a REPLY */ /* ** Sender is responding to a request with an error code. ** ** auxiliary info ( ** error value int; ** ) */ errcode = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; switch (event_com) { case IM_JOIN_JOB: /* ** A MOM has rejected a request to join a job. ** We need to send a ABORT_JOB to all the sisterhood ** and fail the job start to server. ** I'm mother superior. */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { log_err(-1, id, "JOIN_JOB ERROR and I'm not MS"); goto err; } DBPRT(("%s: JOIN_JOB %s returned ERROR %d\n", id, jobid, errcode)) job_start_error(pjob, errcode, netaddr(addr)); break; case IM_ABORT_JOB: case IM_KILL_JOB: /* ** Job cleanup failed on a sister. ** Wait for everybody to respond then finish. ** I'm mother superior. */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { /* log_err(-1,id,"KILL_JOB %s ERROR and I'm not MS"); */ log_err(-1, id, "KILL_JOB ERROR and I'm not MS"); goto err; } if (LOGLEVEL >= 1) { char tmpLine[1024]; sprintf(tmpLine, "KILL/ABORT request for job %s returned error %d\n", jobid, errcode); log_err(errcode, id, tmpLine); } np->hn_sister = errcode ? errcode : SISTER_KILLDONE; for (i = 1;i < pjob->ji_numnodes;i++) { if (pjob->ji_hosts[i].hn_sister == SISTER_OKAY) break; } if (i == pjob->ji_numnodes) { /* all dead */ pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; job_save(pjob, SAVEJOB_QUICK); exiting_tasks = 1; } break; case IM_SPAWN_TASK: case IM_GET_TASKS: case IM_SIGNAL_TASK: case IM_OBIT_TASK: case IM_GET_INFO: /* A user attempt failed, inform process. */ DBPRT(("%s: REQUEST %d %s returned ERROR %d\n", id, event_com, jobid, errcode)) ptask = task_check(pjob, event_task); if (ptask == NULL) break; tm_reply(ptask->ti_fd, TM_ERROR, event); diswsi(ptask->ti_fd, errcode); DIS_tcp_wflush(ptask->ti_fd); break; case IM_POLL_JOB: /* ** I must be Mother Superior for the job and ** this is an error reply to a poll request. */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { /* log_err(-1,id,"POLL_JOB %s ERROR and I'm not MS"); */ log_err(-1, id, "POLL_JOB ERROR and I'm not MS"); goto err; } DBPRT(("%s: POLL_JOB %s returned ERROR %d\n", id, jobid, errcode)) np->hn_sister = errcode ? errcode : SISTER_BADPOLL; break; case IM_GET_TID: /* ** Sender must be Mother Superior failing to ** send a TID. ** Send a fail to the task which called SPAWN. */ if (check_ms(stream, pjob)) goto fini; DBPRT(("%s: GET_TID %s returned ERROR %d\n", id, jobid, errcode)) arrayfree(argv); arrayfree(envp); ptask = task_check(pjob, efwd.fe_taskid); if (ptask == NULL) break; tm_reply(ptask->ti_fd, TM_ERROR, efwd.fe_event); diswsi(ptask->ti_fd, errcode); DIS_tcp_wflush(ptask->ti_fd); break; default: sprintf(log_buffer, "unknown command %d error", event_com); log_err(-1, id, log_buffer); goto err; /*NOTREACHED*/ break; } /* END switch(event_com) */ break; default: sprintf(log_buffer, "unknown command %d sent", command); log_err(-1, id, log_buffer); goto err; /*NOTREACHED*/ break; } /* END switch (Command) */ done: rpp_eom(stream); if (reply) { /* check if write worked */ if ((ret != DIS_SUCCESS) || (rpp_flush(stream) == -1)) { log_err(errno, id, "rpp_flush"); rpp_close(stream); if ((np != NULL) && (np->hn_stream == stream)) np->hn_stream = -1; } } goto fini; err: /* ** We come here if we got a DIS read error or a protocol ** element is missing. The likely case is the remote ** host has gone down. */ sprintf(log_buffer, "error sending command %d to job %s", command, jobid ? jobid : "unknown"); log_err(-1, id, log_buffer); im_eof(stream, ret); fini: if (jobid != NULL) free(jobid); if (cookie != NULL) free(cookie); return; } /* END im_request() */ void tm_eof( int fd) { job *pjob; task *ptask; char *id = "tm_eof"; /* ** Search though all the jobs looking for this fd. */ for ( pjob = (job *)GET_NEXT(svr_alljobs); pjob != NULL; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { for ( ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_fd == fd) { if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "matching task located, marking interface closed"); } ptask->ti_fd = -1; return; } } } if (LOGLEVEL >= 1) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_SERVER, id, "no matching task found"); } return; } /* END tm_eof() */ /* ** Input is coming from a process running on this host which ** should be part of one of the jobs I am part of. The i/o ** will take place using DIS over a tcp fd. ** ** Read the stream to get a task manager request. Format the reply ** and write it back. ** ** read ( ** jobid string ** cookie string ** command int ** event int ** from taskid int ** ) ** ** ** tm_requests only use tcp. No rpp. */ int tm_request( int fd, int version) { char *id = "tm_request"; int command, reply = 0; int ret = DIS_SUCCESS; char *jobid = NULL; char *cookie = NULL; char *oreo; job *pjob; task *ptask; vnodent *pnode; hnodent *phost; int i, event, numele; size_t len; long ipadd; char **argv, **envp; char *name, *info; eventent *ep; infoent *ip; int signum; int vnodenum; int prev_error = 0; tm_node_id nodeid; tm_task_id taskid = 0, fromtask; attribute *at; extern u_long localaddr; extern struct connection svr_conn[]; int start_process A_((task *ptask, char **argv, char **envp)); if (svr_conn[fd].cn_addr != localaddr) { sprintf(log_buffer, "non-local connect"); goto err; } if (version != TM_PROTOCOL_VER) { sprintf(log_buffer, "bad protocol version %d", version); goto err; } jobid = disrst(fd, &ret); if (ret != DIS_SUCCESS) goto err; cookie = disrst(fd, &ret); if (ret != DIS_SUCCESS) goto err; command = disrsi(fd, &ret); if (ret != DIS_SUCCESS) goto err; event = disrsi(fd, &ret); if (ret != DIS_SUCCESS) goto err; fromtask = disrui(fd, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: job %s cookie %s task %d com %d event %d\n", id, jobid, cookie, fromtask, command, event)) /* * Allow a non-PBS process to be adopted * by PBS for resource accounting and possibly management * purposes. Note that this circumvents much of the protocol, * cookie checks etc. See adoptSession() for more info * DJH 26 Feb 2002. Distinguish between jobid and altid * adoptions - see adoptSession() */ if ((command == TM_ADOPT_ALTID) || (command == TM_ADOPT_JOBID)) { pid_t sid; char *id = NULL; int adoptStatus; reply = TRUE; /* Read the session id and alt/job id from tm_adopt() */ sid = disrsi(fd, &ret); if (ret != DIS_SUCCESS) goto err; id = disrst(fd, &ret); if (ret != DIS_SUCCESS) { if (id) free(id); goto err; } /* Got all the info. Try to adopt the session */ adoptStatus = adoptSession(sid, id, command, cookie); if (id) free(id); /* Let the tm_adopt() call know if it was adopted or not. This is synchronous - doesn't use the event stuff.*/ DIS_tcp_funcs(); /* do I really need this? */ ret = diswsi(fd, adoptStatus); if (ret != DIS_SUCCESS) goto err; goto done; } /* verify the jobid is known and the cookie matches */ if ((pjob = find_job(jobid)) == NULL) { sprintf(log_buffer, "job %s not found", jobid); goto err; } if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) { sprintf(log_buffer, "job %s not running", jobid); goto err; } at = &pjob->ji_wattr[(int)JOB_ATR_Cookie]; if (!(at->at_flags & ATR_VFLAG_SET)) { sprintf(log_buffer, "job %s has no cookie", jobid); goto err; } oreo = at->at_val.at_str; if (strcmp(oreo, cookie) != 0) { sprintf(log_buffer, "job %s cookie %s message %s", jobid, oreo, cookie); goto err; } /* verify this taskid is my baby */ ptask = task_find(pjob, fromtask); if (ptask == NULL) { /* not found */ sprintf(log_buffer, "task %d in job %s not found", fromtask, jobid); log_err(-1, id, log_buffer); ret = tm_reply(fd, TM_ERROR, event); if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, TM_ENOTFOUND); if (ret != DIS_SUCCESS) goto done; prev_error = 1; /* * ANUPBS - DBS 21/10/02 * This line added to avoid segfault. Code path can fall thru * here and deref ptask! Problem uncovered by adopt? Problem * noticed in code with multiple pbs_dsh and prun (adopt) */ goto done; } else if ((ptask->ti_fd != -1) && (ptask->ti_fd != fd)) { /* someone is already connected, create a new task for the new conn */ ptask = pbs_task_create(pjob, TM_NULL_TASK); if (ptask == NULL) goto err; strcpy(ptask->ti_qs.ti_parentjobid, jobid); ptask->ti_qs.ti_parentnode = pjob->ji_nodeid; ptask->ti_qs.ti_parenttask = fromtask; /* the initial connection is "from" task 1, we set this to not confuse the new connection with the old */ fromtask = ptask->ti_qs.ti_task; if (LOGLEVEL >= 6) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "saving task (additional connection)"); } if (task_save(ptask) == -1) goto err; } svr_conn[fd].cn_oncl = tm_eof; ptask->ti_fd = fd; reply = TRUE; /* set no timeout so connection is not closed for being idle */ svr_conn[fd].cn_authen |= PBS_NET_CONN_NOTIMEOUT; switch (command) { case TM_INIT: /* ** A request to initialize. Must be the first ** thing we see from a task to do psched requests. */ DBPRT(("%s: INIT %s\n", id, jobid)) if (prev_error) goto done; ret = tm_reply(fd, TM_OKAY, event); if (ret != DIS_SUCCESS) goto done; vnodenum = pjob->ji_numvnod; ret = diswui(fd, vnodenum); /* num nodes */ if (ret != DIS_SUCCESS) goto done; pnode = pjob->ji_vnods; for (i = 0;i < vnodenum;i++) { ret = diswsi(fd, pnode[i].vn_node); if (ret != DIS_SUCCESS) goto done; } ret = diswst(fd, ptask->ti_qs.ti_parentjobid); /* dad job */ if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, ptask->ti_qs.ti_parentnode); /* dad node */ if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, ptask->ti_qs.ti_parenttask); /* dad task */ if (ret != DIS_SUCCESS) goto done; ptask->ti_flags |= TI_FLAGS_INIT; goto done; /*NOTREACHED*/ break; case TM_POSTINFO: /* ** Post named info for a task. ** ** read ( ** name string; ** info counted string; ** ) */ name = disrst(fd, &ret); if (ret != DIS_SUCCESS) goto err; info = disrcs(fd, &len, &ret); if (ret != DIS_SUCCESS) { free(name); goto err; } DBPRT(("%s: POSTINFO %s task %d sent info %s:%s(%d)\n", id, jobid, fromtask, name, info, (int)len)) if (prev_error) goto done; task_saveinfo(ptask, name, info, len); ret = tm_reply(fd, TM_OKAY, event); goto done; /*NOTREACHED*/ break; case TM_REGISTER: sprintf(log_buffer, "REGISTER - NOT IMPLEMENTED %s", jobid); tm_reply(fd, TM_ERROR, event); diswsi(fd, TM_ENOTIMPLEMENTED); DIS_tcp_wflush(fd); goto err; /*NOTREACHED*/ break; default: /* NO-OP */ break; } /* END switch(command) */ /* ** All requests beside TM_INIT and TM_POSTINFO ** require a node number where the action will take place. ** Read that and check that it is legal. ** ** read ( ** node number int ** ) */ nodeid = disrui(fd, &ret); if (ret != DIS_SUCCESS) goto err; pnode = pjob->ji_vnods; for (i = 0;i < pjob->ji_numvnod;i++, pnode++) { if (pnode->vn_node == nodeid) break; } if (i == pjob->ji_numvnod) { sprintf(log_buffer, "node %d in job %s not found", nodeid, jobid); log_err(-1, id, log_buffer); ret = tm_reply(fd, TM_ERROR, event); if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, TM_ENOTFOUND); if (ret != DIS_SUCCESS) goto done; prev_error = 1; } phost = pnode->vn_host; switch (command) { case TM_TASKS: /* ** A request to read the list of tasks that a ** particular node has charge of. */ DBPRT(("%s: TASKS %s on node %d\n", id, jobid, nodeid)) if (prev_error) goto done; if (pjob->ji_nodeid != nodeid) { /* not me */ ep = event_alloc(IM_GET_TASKS, phost, event, fromtask); if (phost->hn_stream == -1) { phost->hn_stream = rpp_open(phost->hn_host, pbs_rm_port, NULL); } ret = im_compose( phost->hn_stream, jobid, cookie, IM_GET_TASKS, event, fromtask); if (ret != DIS_SUCCESS) goto done; ret = diswui(phost->hn_stream, pjob->ji_nodeid); /* XXX */ if (ret != DIS_SUCCESS) goto done; ret = (rpp_flush(phost->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; if (ret != DIS_SUCCESS) goto done; reply = FALSE; goto done; } /* END if (pjob->ji_nodeid != nodeid) */ ret = tm_reply(fd, TM_OKAY, event); if (ret != DIS_SUCCESS) goto done; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { ret = diswui(fd, ptask->ti_qs.ti_task); if (ret != DIS_SUCCESS) goto done; } ret = diswui(fd, TM_NULL_TASK); break; case TM_SPAWN: /* ** Spawn a task on the requested node. ** ** read ( ** argc int; ** arg 0 string; ** ... ** arg argc-1 string; ** env 0 string; ** ... ** env m string; ** ) */ DBPRT(("%s: SPAWN %s on node %d\n", id, jobid, nodeid)) numele = disrui(fd, &ret); if (ret != DIS_SUCCESS) goto done; argv = (char **)calloc(numele + 1, sizeof(char **)); assert(argv); for (i = 0;i < numele;i++) { argv[i] = disrst(fd, &ret); if (ret != DIS_SUCCESS) { arrayfree(argv); goto done; } } argv[i] = NULL; numele = 4; envp = (char **)calloc(numele, sizeof(char **)); assert(envp); for (i = 0;;i++) { char *env; env = disrst(fd, &ret); if ((ret != DIS_SUCCESS) && (ret != DIS_EOD)) { arrayfree(argv); arrayfree(envp); goto done; } if (env == NULL) break; if (*env == '\0') { free(env); break; } /* ** Need to remember extra slot for NULL ** at the end. Thanks to Pete Wyckoff ** for finding this. */ if (i == numele - 2) { numele *= 2; envp = (char **)realloc(envp, numele * sizeof(char **)); assert(envp); } envp[i] = env; envp[i+1] = NULL; } /* tack on PBS_VNODENUM */ envp[i] = malloc(1024 * sizeof(char)); if (envp[i] == NULL) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "cannot alloc env memory)"); arrayfree(argv); arrayfree(envp); goto done; } sprintf(envp[i], "PBS_VNODENUM=%d", nodeid); i++; envp[i] = NULL; ret = DIS_SUCCESS; if (prev_error) { arrayfree(argv); arrayfree(envp); goto done; } /* ** If I'm Mother Suerior and the spawn happens on ** me, just do it. */ if ((pjob->ji_nodeid == 0) && (pjob->ji_nodeid == nodeid)) { /* XXX */ i = TM_ERROR; ptask = pbs_task_create(pjob, TM_NULL_TASK); if (ptask != NULL) { strcpy(ptask->ti_qs.ti_parentjobid, jobid); ptask->ti_qs.ti_parentnode = pjob->ji_nodeid; ptask->ti_qs.ti_parenttask = fromtask; if (LOGLEVEL >= 6) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "saving task (TM_SPAWN)"); } if (task_save(ptask) != -1) { ret = start_process(ptask, argv, envp); if (ret != -1) i = TM_OKAY; } } arrayfree(argv); arrayfree(envp); ret = tm_reply(fd, i, event); if (ret != DIS_SUCCESS) goto done; ret = diswsi( fd, ((i == TM_ERROR) ? TM_ESYSTEM : ptask->ti_qs.ti_task)); goto done; } /* END if ((pjob->ji_nodeid == 0) && (pjob->ji_nodeid == nodeid)) */ /* ** If I'm a regular mom and the destination is not ** MS, just send a GET_TID to MS. */ else if ((pjob->ji_nodeid != 0) && (nodeid != pjob->ji_vnods[0].vn_node)) { /* XXX */ pnode = &pjob->ji_vnods[0]; phost = pnode->vn_host; ep = event_alloc( IM_GET_TID, pnode->vn_host, TM_NULL_EVENT, TM_NULL_TASK); ep->ee_argv = argv; ep->ee_envp = envp; ep->ee_forward.fe_node = nodeid; ep->ee_forward.fe_event = event; ep->ee_forward.fe_taskid = fromtask; ret = im_compose( phost->hn_stream, jobid, cookie, IM_GET_TID, ep->ee_event, TM_NULL_TASK); if (ret != DIS_SUCCESS) goto done; ret = (rpp_flush(phost->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; if (ret != DIS_SUCCESS) goto done; reply = FALSE; goto done; } /* END else if ((pjob->ji_nodeid != 0) && ...) */ /* ** If I am MS, generate the TID now, otherwise ** we are sending to MS who will do it when she gets ** the SPAWN. */ taskid = (pjob->ji_nodeid == 0) ? pjob->ji_taskid++ : TM_NULL_TASK; ep = event_alloc(IM_SPAWN_TASK, phost, event, fromtask); job_save(pjob, SAVEJOB_FULL); if (phost->hn_stream == -1) { phost->hn_stream = rpp_open(phost->hn_host, pbs_rm_port, NULL); } ret = im_compose( phost->hn_stream, jobid, cookie, IM_SPAWN_TASK, event, fromtask); if (ret != DIS_SUCCESS) goto done; ret = diswui(phost->hn_stream, pjob->ji_nodeid); if (ret != DIS_SUCCESS) goto done; ret = diswui(phost->hn_stream, taskid); if (ret != DIS_SUCCESS) goto done; ret = diswst(phost->hn_stream, pjob->ji_globid); if (ret != DIS_SUCCESS) goto done; for (i = 0;argv[i];i++) { ret = diswst(phost->hn_stream, argv[i]); if (ret != DIS_SUCCESS) goto done; } ret = diswst(phost->hn_stream, ""); if (ret != DIS_SUCCESS) goto done; for (i = 0;envp[i];i++) { ret = diswst(phost->hn_stream, envp[i]); if (ret != DIS_SUCCESS) goto done; } ret = (rpp_flush(phost->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; if (ret != DIS_SUCCESS) goto done; reply = FALSE; arrayfree(argv); arrayfree(envp); break; case TM_SIGNAL: /* ** Send a signal to the specified task. ** ** read ( ** to task int ** signal int ** ) */ taskid = disrui(fd, &ret); if (ret != DIS_SUCCESS) goto err; signum = disrui(fd, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: SIGNAL %s on node %d task %d sig %d\n", id, jobid, nodeid, taskid, signum)) if (prev_error) goto done; if (pjob->ji_nodeid != nodeid) { /* not me XXX */ ep = event_alloc(IM_SIGNAL_TASK, phost, event, fromtask); if (phost->hn_stream == -1) { phost->hn_stream = rpp_open(phost->hn_host, pbs_rm_port, NULL); } ret = im_compose(phost->hn_stream, jobid, cookie, IM_SIGNAL_TASK, event, fromtask); if (ret != DIS_SUCCESS) goto done; ret = diswui(phost->hn_stream, pjob->ji_nodeid); /* XXX */ if (ret != DIS_SUCCESS) goto done; ret = diswsi(phost->hn_stream, taskid); if (ret != DIS_SUCCESS) goto done; ret = diswsi(phost->hn_stream, signum); if (ret != DIS_SUCCESS) goto done; ret = (rpp_flush(phost->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; if (ret != DIS_SUCCESS) goto done; reply = FALSE; goto done; } /* END if (pjob->ji_nodeid != nodeid) */ /* ** Task should be here... look for it. */ if ((ptask = task_find(pjob, taskid)) == NULL) { ret = tm_reply(fd, TM_ERROR, event); if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, TM_ENOTFOUND); break; } if (LOGLEVEL >= 3) { sprintf(log_buffer, "%s: TM_SIGNAL %s from node %d task %d signal %d", id, jobid, nodeid, taskid, signum); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); } kill_task(ptask, signum, 0); ret = tm_reply(fd, TM_OKAY, event); break; case TM_OBIT: /* ** Register an obit request for the specified task. ** ** read ( ** task to watch int ** ) */ taskid = disrui(fd, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: OBIT %s on node %d task %d\n", id, jobid, nodeid, taskid)) if (prev_error) goto done; if (pjob->ji_nodeid != nodeid) { /* not me */ ep = event_alloc(IM_OBIT_TASK, phost, event, fromtask); if (phost->hn_stream == -1) { phost->hn_stream = rpp_open(phost->hn_host, pbs_rm_port, NULL); } ret = im_compose( phost->hn_stream, jobid, cookie, IM_OBIT_TASK, event, fromtask); if (ret != DIS_SUCCESS) goto done; ret = diswui(phost->hn_stream, pjob->ji_nodeid); if (ret != DIS_SUCCESS) goto done; ret = diswsi(phost->hn_stream, taskid); if (ret != DIS_SUCCESS) goto done; ret = (rpp_flush(phost->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; if (ret != DIS_SUCCESS) goto done; reply = FALSE; goto done; } /* ** Task should be here... look for it. */ if ((ptask = task_find(pjob, taskid)) == NULL) { ret = tm_reply(fd, TM_ERROR, event); if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, TM_ENOTFOUND); break; } if (ptask->ti_qs.ti_status >= TI_STATE_EXITED) { ret = tm_reply(fd, TM_OKAY, event); if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, ptask->ti_qs.ti_exitstat); } else { obitent *op = (obitent *)malloc(sizeof(obitent)); assert(op); CLEAR_LINK(op->oe_next); append_link(&ptask->ti_obits, &op->oe_next, op); op->oe_info.fe_node = nodeid; op->oe_info.fe_event = event; op->oe_info.fe_taskid = fromtask; reply = 0; } break; case TM_GETINFO: /* ** Get named info for a specified task. ** ** read ( ** task int ** name string ** ) */ taskid = disrui(fd, &ret); if (ret != DIS_SUCCESS) goto err; name = disrst(fd, &ret); if (ret != DIS_SUCCESS) goto err; DBPRT(("%s: GETINFO %s from node %d task %d name %s\n", id, jobid, nodeid, taskid, name)) if (prev_error) goto done; if (pjob->ji_nodeid != nodeid) { /* not me */ ep = event_alloc( IM_GET_INFO, phost, event, fromtask); if (phost->hn_stream == -1) { phost->hn_stream = rpp_open(phost->hn_host, pbs_rm_port, NULL); } ret = im_compose( phost->hn_stream, jobid, cookie, IM_GET_INFO, event, fromtask); if (ret == DIS_SUCCESS) { ret = diswui(phost->hn_stream, pjob->ji_nodeid); if (ret == DIS_SUCCESS) { ret = diswsi(phost->hn_stream, taskid); if (ret == DIS_SUCCESS) { ret = diswst(phost->hn_stream, name); } } } free(name); if (ret != DIS_SUCCESS) goto done; ret = (rpp_flush(phost->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; if (ret != DIS_SUCCESS) goto done; reply = FALSE; goto done; } /* END if (pjob->ji_nodeid != nodeid) */ /* ** Task should be here... look for it. */ if ((ptask = task_find(pjob, taskid)) != NULL) { if ((ip = task_findinfo(ptask, name)) != NULL) { ret = tm_reply(fd, TM_OKAY, event); if (ret != DIS_SUCCESS) goto done; ret = diswcs(fd, ip->ie_info, ip->ie_len); break; } } ret = tm_reply(fd, TM_ERROR, event); if (ret != DIS_SUCCESS) goto done; ret = diswsi(fd, TM_ENOTFOUND); break; case TM_RESOURCES: /* get resource string for a node */ DBPRT(("%s: RESOURCES %s for node %d task %d\n", id, jobid, nodeid, taskid)) if (prev_error) goto done; if (pjob->ji_nodeid != nodeid) { /* not me XXX */ ep = event_alloc(IM_GET_RESC, phost, event, fromtask); if (phost->hn_stream == -1) { phost->hn_stream = rpp_open(phost->hn_host, pbs_rm_port, NULL); } ret = im_compose( phost->hn_stream, jobid, cookie, IM_GET_RESC, event, fromtask); if (ret != DIS_SUCCESS) goto done; ret = diswui(phost->hn_stream, pjob->ji_nodeid); if (ret != DIS_SUCCESS) goto done; ret = (rpp_flush(phost->hn_stream) == -1) ? DIS_NOCOMMIT : DIS_SUCCESS; if (ret != DIS_SUCCESS) goto done; reply = FALSE; goto done; } /* END if (pjob->ji_nodeid != nodeid) */ info = resc_string(pjob); ret = tm_reply(fd, TM_OKAY, event); if (ret != DIS_SUCCESS) goto done; ret = diswst(fd, info); free(info); break; default: sprintf(log_buffer, "unknown command %d", command); tm_reply(fd, TM_ERROR, event); diswsi(fd, TM_EUNKNOWNCMD); DIS_tcp_wflush(fd); goto err; /*NOTREACHED*/ break; } /* END switch (command) */ done: if (reply) { DBPRT(("%s: REPLY %s\n", id, dis_emsg[ret])) if ((ret != DIS_SUCCESS) || (DIS_tcp_wflush(fd) == -1)) { sprintf(log_buffer, "comm failed %s", dis_emsg[ret]); log_err(errno, id, log_buffer); close_conn(fd); } } free(jobid); free(cookie); return(0); err: if (ret != DIS_SUCCESS) sprintf(log_buffer, "bad header %s", dis_emsg[ret]); log_err(errno, id, log_buffer); ipadd = svr_conn[fd].cn_addr; sprintf(log_buffer, "message refused from port %d addr %ld.%ld.%ld.%ld", svr_conn[fd].cn_port, (ipadd & 0xff000000) >> 24, (ipadd & 0x00ff0000) >> 16, (ipadd & 0x0000ff00) >> 8, (ipadd & 0x000000ff)); close_conn(fd); if (jobid) free(jobid); if (cookie) free(cookie); return(-1); } /* END tm_request() */ /* * adoptSession -- * * Find a job that corresponds to a given alternative task management * id or job id and create a new task in it to monitor the usage of a * given session id. * * Result: * Returns TM_OK if the session id was adopted, and TM_ERROR if * it wasn't. The job identified by jobid or altid (eg rmsResourceId) * gets a new task, and that task has its session id set to monitor * sid. Various special values are set in the task to ensure that * PBS only monitors the new task, and doesn't attempt to control it. * * Side effects: * Saves the new task with task_save(). * Forces a mom_get_sample() * * */ static int adoptSession(pid_t sid, char *id, int command, char *cookie) { job *pjob; task *ptask; /* extern int next_sample_time; */ /* extern time_t time_resc_updated; */ /* Find the job that has this job/alt id */ for (pjob = (job *)GET_NEXT(svr_alljobs); pjob != NULL; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { if (command == TM_ADOPT_JOBID) { if (strcmp(id, pjob->ji_qs.ji_jobid) == 0) break; } else { if (strcmp(id, pjob->ji_altid) == 0) break; } } if (pjob == NULL) { /* Didn't find a job with this resource id. Complain. */ (void)sprintf(log_buffer, "Adoption rejected: no job with id %1.30s", id); log_record(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, "adoptSession()", log_buffer); return TM_ERROR; } /* * Check cookie if we can (why bother!) Should check for * correct cookie first, it might be available! */ if (strcmp(cookie, "ADOPT COOKIE")) { char *oreo; attribute *at = &pjob->ji_wattr[(int)JOB_ATR_Cookie]; if (!(at->at_flags & ATR_VFLAG_SET)) { sprintf(log_buffer, "Adoption rejected: job %s has no cookie", pjob->ji_qs.ji_jobid); DBPRT(("%s\n", log_buffer)); log_record(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return TM_ERROR; } oreo = at->at_val.at_str; if (strcmp(oreo, cookie) != 0) { sprintf(log_buffer, "Adoption rejected: job %s cookie %s message %s", pjob->ji_qs.ji_jobid, oreo, cookie); DBPRT(("%s\n", log_buffer)); log_record(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return TM_ERROR; } } else { /* sprintf(log_buffer, "job %s cookie %s message %s", jobid, oreo, cookie); DBPRT(("%s\n", log_buffer)); log_record(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); */ DBPRT(("Trusting ADOPT cookie for job %s\n", pjob->ji_qs.ji_jobid)); } /* JMB--set task ID in such a way that makes it obvious this is an adopted task */ if (pjob->maxAdoptedTaskId == TM_NULL_TASK) { pjob->maxAdoptedTaskId = TM_ADOPTED_TASKID_BASE; } /* * DJH 27 Feb 2002. * Now create a task to monitor that sid. Use a task id that isn't * going to collide with the ones given to non-adopted tasks. */ ptask = pbs_task_create(pjob, (pjob->ji_taskid - 1) + TM_ADOPTED_TASKID_BASE); pjob->ji_taskid++; /* ti_parenttask not used but avoiding using TM_NULL_TASK as it means 'top level shell' to scan_for_exiting() */ ptask->ti_qs.ti_parenttask = TM_NULL_TASK + 1; ptask->ti_qs.ti_sid = sid; ptask->ti_qs.ti_status = TI_STATE_RUNNING; (void)task_save(ptask); /* Mark the job as running if we need to. This is copied from start_process() */ if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) { pjob->ji_qs.ji_state = JOB_STATE_RUNNING; pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; job_save(pjob, SAVEJOB_QUICK); } if (mom_get_sample() == PBSE_NONE) { /* time_resc_updated = time_now; */ (void)mom_set_use(pjob); } /* next_sample_time = 45; */ (void)sprintf(log_buffer, "Task adopted. id=%1.30s, sid = %d", id, (int)sid); DBPRT(("%s\n", log_buffer)); log_record(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return TM_OKAY; } /* * cat_dirs -- * * Concatenate root and base into a new string and return the result * * Result: * if root is null only the base value is returned. Otherwise a string * with the root followed by base is returned. If memory cannot be * allocated NULL is returned. * * Side effects: * If a non-null value is returned the new string will need * to later be freed * * */ char *cat_dirs(char *root, char *base) { char *pn; int len = 0; if(root) len = strlen(root); len += strlen(base); pn = malloc(len+2); if(!pn) { return(NULL); } if(root) { strcpy(pn, root); strcat(pn, base); } else strcpy(pn, base); return(pn); } /* * get_local_script_path -- * * takes a path given by base and prepends * the PBS_O_WORKDIR if base is a relative path. That is, if * base does not begin with '/'. Otherwise it returns * the value of base. cat_dirs allocates memory for the new * string so this has to be freed. * * If a null string is returned it is because cat_dirs could * not allocate memory */ char *get_local_script_path(job *pjob, char *base) { char *wdir; size_t len; char *pn = NULL; /* see if base is an absolute path*/ if(base[0] != '/') { /* base is not an absolute path. Prepend it with the working directory */ wdir = get_job_envvar(pjob, "PBS_O_WORKDIR"); len = strlen(wdir); if(wdir[len-1] != '/') strcat(wdir, "/"); pn = cat_dirs(wdir, base); } else pn = cat_dirs(NULL, base); /* cat_dirs will allocate memory to hold our string */ return(pn); } /* END mom_comm.c */ torque-2.4.16/src/resmom/digitalunix/0000777000113300011330000000000011614035172014530 500000000000000torque-2.4.16/src/resmom/digitalunix/mom_start.c0000664000113300011330000002552311272401242016621 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * set login name for getlogin() call which is not POSIX. * but is used by mpi on this system. */ if (setlogin(pwdp->pw_name) != NULL) { sprintf(log_buffer, "setlogin() failed for job %s user %s", pjob->ji_qs.ji_jobid, pwdp->pw_name); log_err(errno, "set_shell", log_buffer); } /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/digitalunix/mom_mach.h0000664000113300011330000001241311272401242016373 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: digitalunix */ #ifndef MOM_MACH #define MOM_MACH "digitalunix" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *file, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed job */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/digitalunix/Makefile.in0000664000113300011330000004401111605403746016521 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/digitalunix ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/digitalunix/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/digitalunix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/digitalunix/pe_input.c0000664000113300011330000001063211272401242016432 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For solaris5 - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/digitalunix/mom_mach.c0000664000113300011330000013206611272401242016375 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * The Digital Unix Port was developed and provided by * Dirk Grunwald of the Department of Computer Science at * the University of Colorado at Boulder */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "mom_func.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a Digital Unix machine ** ** Resources known by this code: ** cput cpu time for a pid or job ** mem memory size for a pid or job in KB ** resi resident memory size for a pid or job in KB ** sessions list of sessions in the system ** pids list of pids in a job ** nsessions number of sessions in the system ** nusers number of users in the system ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** cpuclock clock rate of the CPU ** cputype cpu type ** platform platform name (as string) */ #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* MAX */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *cpuspeed A_((struct rm_attribute *attrib)); static char *cputype A_((struct rm_attribute *attrib)); static char *platform A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); char procfs[] = "/proc"; char procfmts[] = "/proc/%s"; char procfmtd[] = "/proc/%05.5d"; DIR *pdir; extern char *ret_string; extern int ret_size; time_t wait_time = 10; int nproc = 0; int max_proc = 0; prstatus_t *proc_status = NULL; prpsinfo_t *proc_info = NULL; static long page_size; #define TBL_INC 20 extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char no_count[] = "count not found"; /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "cpuspeed", {cpuspeed} }, { "cputype", {cputype} }, { "platform", {platform} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } void dep_initialize(void) { char *id = "dep_initialize"; page_size = sysconf(_SC_PAGESIZE); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) closedir(pdir); } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a timestruc_t pointer. Returns unsigned long * time in seconds. */ #define tv(val) (ulong)((val).tv_sec + ((val).tv_nsec + 500000000)/1000000000) static int injob(pjob, sid) job *pjob; pid_t sid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds, * adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; ulong cputime, addtime; int i; int nps = 0; prstatus_t *ps; prpsinfo_t *pi; cputime = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; nps++; if (pi->pr_state == SZOMB) { cputime += tv(pi->pr_time); DBPRT(("%s: ses %d pid %d (zombie) cputime %lu\n", id, pi->pr_sid, pi->pr_pid, cputime)) continue; } ps = &proc_status[i]; addtime = tv(ps->pr_utime) + tv(ps->pr_stime) + tv(ps->pr_cutime) + tv(ps->pr_cstime); cputime += addtime; DBPRT(("%s: ses %d pid %d cputime %lu\n", id, pi->pr_sid, ps->pr_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcput_proc(job *pjob, unsigned long limit) { char *id = "overcput_proc"; ulong memsize; ulong cputime; int i; prstatus_t *ps; memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pr_sid)) continue; cputime = (ulong)(cputfactor * (double)( tv(ps->pr_utime) + tv(ps->pr_stime) + tv(ps->pr_cutime) + tv(ps->pr_cstime))); if (cputime > limit) return (TRUE); } return (FALSE); } /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the session. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; ulong memsize; int i; prpsinfo_t *pi; memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; memsize += pi->pr_size * page_size; } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; ulong resisize; int i; prpsinfo_t *pi; resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; resisize += pi->pr_rssize * page_size; } return (resisize); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (!strcmp(pname, "file")) { /* set */ if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) { return(error(pname, retval)); } if (value > ULONG_MAX) { return(error(pname, PBSE_BADATVAL)); } reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) { return(error(pname, PBSE_SYSTEM)); } } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_VMEM, &reslim) < 0)) return (error("RLIMIT_VMEM", PBSE_SYSTEM)); } } return(PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) proc_status = (prstatus_t *)malloc(sizeof(prstatus_t) * TBL_INC); proc_info = (prpsinfo_t *)malloc(sizeof(prpsinfo_t) * TBL_INC); if (proc_status == NULL || proc_info == NULL) { log_err(errno, id, "malloc"); return (PBSE_SYSTEM); } max_proc = TBL_INC; return (PBSE_NONE); } /* * Declare start of polling loop. */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; int fd; struct dirent *dent; char procname[100]; prstatus_t *ps; prpsinfo_t *pi; DBPRT(("%s: entered\n", id)) rewinddir(pdir); ps = proc_status; pi = proc_info; nproc = 0; for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if (ioctl(fd, PIOCSTATUS, ps) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCSTATUS)", procname); log_err(errno, id, log_buffer); } memset(ps, sizeof(prstatus_t), '\0'); } if (++nproc == max_proc) { void *hold; DBPRT(("%s: alloc more table space %d\n", id, nproc)) max_proc += TBL_INC; hold = realloc((void *)proc_status, max_proc * sizeof(prstatus_t)); assert(hold != NULL); proc_status = (prstatus_t *)hold; hold = realloc((void *)proc_info, max_proc * sizeof(prpsinfo_t)); assert(hold != NULL); proc_info = (prpsinfo_t *)hold; } ps = &proc_status[nproc]; pi = &proc_info[nproc]; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcput_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %lu exceeded limit %lu", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; prpsinfo_t *pi; int i, sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; (void)mom_get_sample(); for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (sesid == pi->pr_sid) { (void)kill(pi->pr_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) if (proc_status) free(proc_status); if (proc_info) free(proc_info); if (pdir) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return a PBS error code. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; char *id = "getprocs"; caddr_t *kernel_proc; int i, len; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } double dsecs(t) timestruc_t *t; { DBPRT(("\tsecs: %lu\tnsecs: %lu\n", t->tv_sec, t->tv_nsec)) return ((double)t->tv_sec + ((double)t->tv_nsec * 1.0e-9)); } static char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; prstatus_t *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pr_sid) continue; found = 1; addtime = dsecs(&ps->pr_utime) + dsecs(&ps->pr_stime) + dsecs(&ps->pr_cutime) + dsecs(&ps->pr_cstime); cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, ps->pr_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; double cputime; int i; prstatus_t *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } cputime = dsecs(&ps->pr_utime) + dsecs(&ps->pr_stime) + dsecs(&ps->pr_cutime) + dsecs(&ps->pr_cstime); sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int memsize; int i; int found = 0; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; memsize += pi->pr_size; DBPRT(("%s: total %ld pid %d %ld\n", id, memsize*page_size, pi->pr_pid, pi->pr_size*page_size)) } if (found) { sprintf(ret_string, "%ldkb", (memsize*page_size) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; prpsinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ldkb", (pi->pr_size*page_size) >> 10); /* in KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int resisize; int i; int found = 0; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; resisize += pi->pr_rssize; } if (found) { /* in KB */ sprintf(ret_string, "%ldkb", (resisize * page_size) >> 10); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; prpsinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ldkb", (pi->pr_rssize * page_size) >> 10); /* KB */ return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; prpsinfo_t *pi; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of job */ for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_uid == 0) continue; if ((jobid = pi->pr_sid) == 0) continue; DBPRT(("%s[%d]: pid %d sid %d\n", id, njids, pi->pr_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i, j; prpsinfo_t *pi; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; num_pids = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; DBPRT(("%s[%d]: pid: %d sid %d\n", id, num_pids, pi->pr_pid, pi->pr_sid)) if (jobid != pi->pr_sid) continue; sprintf(fmt, "%d ", pi->pr_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; prpsinfo_t *pi; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if ((uid = pi->pr_uid) == 0) continue; DBPRT(("%s[%d]: pid %d uid %d\n", id, nuids, pi->pr_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char *ncpus( struct rm_attribute *attrib) { char *id = "ncpus"; unsigned int pmem; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } sprintf(ret_string, "%ld", sysconf(_SC_NPROCESSORS_ONLN)); system_ncpus = sysconf(_SC_NPROCESSORS_ONLN); return(ret_string); } /* END ncpus() */ static char *physmem( struct rm_attribute *attrib) { char *id = "physmem"; static int kbytes = -1; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } /* NOTE: kbytes must be int, not long for Tru64 systems (CRI) */ if (kbytes == -1) { getsysinfo(GSI_PHYSMEM, (caddr_t)&kbytes, sizeof(kbytes), NULL, 0); } sprintf(ret_string, "%lukb", (unsigned long)kbytes); /* KB */ return(ret_string); } /* END physmem() */ static char *totmem( struct rm_attribute *attrib) { /* NOTE: not enabled. simply report configured mem for now */ return physmem(attrib); } /* END totmem() */ static char *availmem( struct rm_attribute *attrib) { /* NOTE: not enabled. simply report configured mem for now */ return physmem(attrib); } /* END availmem() */ char *size_fs( char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statvfs fsbuf; if ((param == NULL) || (param[0] != '/')) { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (statvfs(param, &fsbuf) == -1) { log_err(errno, id, "statvfs"); rm_errno = RM_ERR_BADPARAM; return(NULL); } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bfree) / 1024.0)); return(ret_string); } /* END size_fs() */ static char *size_file( char *param) { char *id = "size_file"; struct stat sbuf; if ((param == NULL) || (param[0] != '/')) { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return(NULL); } sprintf(ret_string, "%lukb", sbuf.st_size >> 10); /* in KB */ return(ret_string); } /* END size_file() */ char *size( struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; static void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev/pts")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { char *name = de->d_name; if (maxtm >= curtm) break; if (*name == '.') continue; sprintf(ttyname, "/dev/pts/%s", name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; int i; int value, job, found = 0; time_t now, start; prpsinfo_t *pi; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (job) { if (value != pi->pr_sid) continue; } else { if ((pid_t)value != pi->pr_pid) continue; } found = 1; start = MIN(start, pi->pr_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; double avg; struct tbl_loadavg info; int ret; ret = table(TBL_LOADAVG, 0L, &info, 1, sizeof(info)); if (ret < 0) { log_err(-1, id, extra_parm); return (rm_errno = RM_ERR_SYSTEM); } if (info.tl_lscale == 0) { avg = info.tl_avenrun.d[0]; } else { avg = (double) info.tl_avenrun.l[0]; avg /= (double) info.tl_lscale; } *rv = (double)avg; return 0; } static char *cpuspeed( struct rm_attribute *attrib) { char *id = "cpuspeed"; double avg; struct tbl_loadavg info; int ret; double scale = -1; int err; double freq; struct rpb rpbbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } err = getsysinfo(GSI_GET_HWRPB, (caddr_t) & rpbbuf, sizeof(rpbbuf)); if (err < 0) { freq = 233; } else { freq = rpbbuf.rpb_counter; } /* * Scale is the 1 over the clock frequency, in Mhz */ scale = ((double) freq / (1000 * 1000)); sprintf(ret_string, "%d", (int) scale); return ret_string; } /* END cpuspeed() */ static char * cputype(struct rm_attribute *attrib) { char *id = "cputype"; double avg; struct tbl_loadavg info; int ret; static long cputype = -1; static char *cputypename; static char errbuf[128]; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (cputype == -1) { int err; double freq; err = getsysinfo(GSI_PROC_TYPE, (caddr_t) & cputype, sizeof(cputype)); if (err < 0) { cputype = -1; sprintf(errbuf, "[errno = %d]", errno); cputypename = errbuf; } else { CPU_TYPE_TO_TEXT(cputype & 0xfffff, cputypename); if (strcmp(cputypename, "") == 0) { sprintf(errbuf, "[error, cputype = %ld]", cputype); } } } return cputypename; } static char * platform(struct rm_attribute *attrib) { char *id = "platform"; int err; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } err = getsysinfo(GSI_PLATFORM_NAME, ret_string, ret_size - 1); if (err < 0) { return "unknown [error]"; } else { return ret_string; } } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/digitalunix/Makefile.am0000664000113300011330000000030611272401242016474 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/hpux10/0000777000113300011330000000000011614035172013334 500000000000000torque-2.4.16/src/resmom/hpux10/mom_start.c0000664000113300011330000002502611272401243015424 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include #include #include #include #include #include #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; ptask->ti_qs.ti_sid = 0; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/hpux10/mom_mach.h0000664000113300011330000001245111272401243015202 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: hpux10 */ #ifndef MOM_MACH #define MOM_MACH "hpux10" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* from mom child process back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *ptask, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/hpux10/Makefile.in0000664000113300011330000004377211605403751015336 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/hpux10 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/hpux10/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/hpux10/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/hpux10/pe_input.c0000664000113300011330000001063011272401243015235 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For hpux10 - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/hpux10/mom_mach.c0000664000113300011330000012630111272401243015175 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a HP-UX 10.x machine ** ** Resources known by this code: ** cput cpu time for a pid or job ** mem memory size for a pid or job in KB ** resi resident memory size for a pid or job in KB ** sessions list of sessions in the system ** pids list of pids in a job ** nsessions number of sessions in the system ** nusers number of users in the system ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** cpuspeed clock rate of the CPU ** cputype cpu type ** platform platform name (as string) ** valid_user is user name valid.. */ static char ident[] = "@(#) hpux10/$RCSfile$ $Revision: 3151 $"; #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* MAX */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *cpuspeed A_((struct rm_attribute *attrib)); static char *cputype A_((struct rm_attribute *attrib)); static char *platform A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *valid_user A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); extern char *ret_string; time_t wait_time = 10; int nproc = 0; int max_proc = 0; struct pst_status *proc_status = NULL; #define TBL_INC 20 extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char no_count[] = "count not found"; static long page_size; /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "cpuspeed", {cpuspeed} }, { "cputype", {cputype} }, { "platform", {platform} }, { "valid_user", {valid_user} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* Don't need any periodic processing. */ } void dep_initialize(void) { page_size = sysconf(_SC_PAGESIZE); } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a long time in seconds. Returns unsigned long * time in seconds. */ #define tv(val) ((unsigned long)((val))) static int injob(pjob, sid) job *pjob; pid_t sid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; unsigned long cputime, addtime; int i; int nps = 0; struct pst_status *ps; cputime = 0.0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; nps++; if (ps->pst_stat == PS_ZOMBIE) { cputime += tv(ps->pst_utime) + tv(ps->pst_stime); DBPRT(("%s: ses %d pid %d (zombie) cputime %d\n", id, ps->pst_sid, ps->pst_pid, cputime)) continue; } addtime = tv(ps->pst_utime) + tv(ps->pst_stime); /* + tv(ps->pr_cutime) + tv(ps->pr_cstime); */ cputime += addtime; DBPRT(("%s: ses %d pid %d cputime %d\n", id, ps->pst_sid, ps->pst_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcput_proc(job *pjob, unsigned long limit) { char *id = "overcput_proc"; unsigned long memsize; unsigned long cputime; int i; struct pst_status *ps; memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; cputime = (unsigned long)(cputfactor * (double)(tv(ps->pst_utime) + tv(ps->pst_stime))); if (cputime > limit) return (TRUE); } return (FALSE); } /* virtual memory size of a process; add up sizes of all regions */ #define VSIZE(p) ((p)->pst_vtsize + (p)->pst_vdsize + (p)->pst_vssize + \ (p)->pst_vshmsize + (p)->pst_vmmsize + (p)->pst_vusize + \ (p)->pst_viosize) /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the session. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; unsigned long memsize; int i; struct pst_status *ps; memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; memsize += VSIZE(ps) * page_size; } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; unsigned long resisize; int i; struct pst_status *ps; resisize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; resisize += ps->pst_rssize * page_size; } return (resisize); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_AS, &reslim) < 0)) return (error("RLIMIT_AS", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * allocate memory for data structure */ int mom_open_poll(void) { return (PBSE_NONE); } /* * Declare start of polling loop. */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; struct pst_dynamic pst_d; DBPRT(("%s: entered\n", id)) if (pstat_getdynamic(&pst_d, sizeof(struct pst_dynamic), 1, 0) != 1) { sprintf(log_buffer, "pstat_getdynamic"); log_err(errno, id, log_buffer); nproc = 0; return (PBSE_SYSTEM); } nproc = pst_d.psd_activeprocs + TBL_INC; if (max_proc < nproc) { max_proc = nproc; proc_status = (struct pst_status *) realloc((void *)proc_status, max_proc * sizeof(struct pst_status)); if (proc_status == 0) { return (PBSE_SYSTEM); } } nproc = pstat_getproc(proc_status, sizeof(struct pst_status), nproc, 0); if (nproc < 0) { sprintf(log_buffer, "pstat_getproc"); log_err(errno, id, log_buffer); memset(proc_status, sizeof(struct pst_status) * max_proc, '\0'); nproc = 0; return (PBSE_SYSTEM); } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcput_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; struct pst_status *ps; int i, sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; (void)mom_get_sample(); for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (sesid == ps->pst_sid) { (void)kill(ps->pst_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. * */ int mom_close_poll(void) { char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) if (proc_status) free(proc_status); return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. Return -1 on error. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; static char id[] = "getprocs"; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pst_sid) continue; found = 1; addtime = ps->pst_utime + ps->pst_stime; /* ps->pr_cutime + ps->pr_cstime; */ cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, ps->pst_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; double cputime; int i; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } cputime = ps->pst_utime + ps->pst_stime; /* ps->pr_cutime + ps->pr_cstime; */ sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int memsize; int i; int found = 0; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pst_sid) continue; found = 1; memsize += VSIZE(ps); DBPRT(("%s: total %d pid %d %d\n", id, memsize*page_size, ps->pst_pid, VSIZE(ps)*page_size)) } if (found) { /* in KB */ sprintf(ret_string, "%ukb", (memsize * page_size) >> 10); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; struct pst_status *ps; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", (VSIZE(ps) * page_size) >> 10); /* KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int resisize; int i; int found = 0; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pst_sid) continue; found = 1; resisize += ps->pst_rssize; } if (found) { sprintf(ret_string, "%ukb", (resisize*page_size) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; struct pst_status *ps; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", (ps->pst_rssize*page_size) >> 10); /* KB */ return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; struct pst_status *ps; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of job */ for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_uid == 0) continue; if ((jobid = ps->pst_sid) == 0) continue; DBPRT(("%s[%d]: pid %d sid %d\n", id, njids, ps->pst_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i, j; struct pst_status *ps; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; num_pids = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; DBPRT(("%s[%d]: pid: %d sid %d\n", id, num_pids, ps->pst_pid, ps->pst_sid)) if (jobid != ps->pst_sid) continue; sprintf(fmt, "%d ", ps->pst_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; struct pst_status *ps; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if ((uid = ps->pst_uid) == 0) continue; DBPRT(("%s[%d]: pid %d uid %d\n", id, nuids, ps->pst_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; struct pst_dynamic pst_d; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (pstat_getdynamic(&pst_d, sizeof(struct pst_dynamic), 1, 0) == -1) { sprintf(log_buffer, "pstat_getdynamic"); log_err(errno, id, log_buffer); } sprintf(ret_string, "%d", (int) pst_d.psd_proc_cnt); system_ncpus = (int) pst_d.psd_proc_cnt; return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; struct pst_static pst_s; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (pstat_getstatic(&pst_s, sizeof(struct pst_static), 1, 0) == -1) { sprintf(log_buffer, "pstat_getstatic"); log_err(errno, id, log_buffer); } /* physical_memory is in pages - convert to KB */ sprintf(ret_string, "%ukb", (unsigned int)(pst_s.physical_memory * pst_s.page_size / 1024)); return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statvfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statvfs(param, &fsbuf) == -1) { log_err(errno, id, "statvfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bfree) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev/pts")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { char *name = de->d_name; if (maxtm >= curtm) break; if (*name == '.') continue; sprintf(ttyname, "/dev/pts/%s", name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; int i; int value, job, found = 0; time_t now, start; struct pst_status *ps; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (job) { if (value != ps->pst_sid) continue; } else { if ((pid_t)value != ps->pst_pid) continue; } found = 1; start = MIN(start, ps->pst_start); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; struct pst_dynamic pst_d; if (pstat_getdynamic(&pst_d, sizeof(struct pst_dynamic), 1, 0) == -1) { sprintf(log_buffer, "pstat_getdynamic"); log_err(errno, id, log_buffer); return (rm_errno = RM_ERR_SYSTEM); } *rv = (double)pst_d.psd_avg_1_min; return 0; } static char * cpuspeed(struct rm_attribute *attrib) { char *id = "cpuspeed"; double scale; double freq; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } /* don't know how to get on hpux - fake it */ freq = 100 * 1000 * 1000; /* * Scale is the 1 over the clock frequency, in Mhz */ scale = ((double) freq / (1000 * 1000)); sprintf(ret_string, "%d", (int) scale); return ret_string; } static char * cputype(struct rm_attribute *attrib) { char *id = "cputype"; static long cputype = -1; static char *cputypename; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (cputype == -1) { cputype = sysconf(_SC_CPU_VERSION); if (cputype < 0) { sprintf(cputypename, "[errno = %d]", errno); } else { switch (cputype) { case CPU_HP_MC68020: cputypename = "Motorola MC68020"; break; case CPU_HP_MC68030: cputypename = "Motorola MC68030"; break; case CPU_HP_MC68040: cputypename = "Motorola MC68040"; break; case CPU_PA_RISC1_0: cputypename = "HP PA-RISC1.0"; break; case CPU_PA_RISC1_1: cputypename = "HP PA-RISC1.1"; break; case CPU_PA_RISC1_2: cputypename = "HP PA-RISC1.2"; break; case CPU_PA_RISC2_0: cputypename = "HP PA-RISC2.0"; break; default: cputypename = "unknown"; } } } return cputypename; } static char * platform(struct rm_attribute *attrib) { char *id = "platform"; struct utsname name; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } uname(&name); sprintf(ret_string, "%s %s %s", name.sysname, name.release, name.machine); return ret_string; } static char * valid_user(struct rm_attribute *attrib) { char *id = "valid_user"; struct passwd *p; if (attrib == NULL || attrib -> a_value == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } p = getpwnam(attrib -> a_value); if (p) { return "yes"; } else { return "no"; } } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/hpux10/Makefile.am0000664000113300011330000000030611272401243015301 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/aix4/0000777000113300011330000000000011614035171013053 500000000000000torque-2.4.16/src/resmom/aix4/mom_start.c0000664000113300011330000004243111272401243015143 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" #include "resmon.h" #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ #include "pbs_nodes.h" #include #endif /* IBM SP2 */ static char ident[] = "@(#) $RCSfile$ $Revision: 3027 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; extern char *path_home; extern void state_to_server A_((int, int)); /* Private variables */ static int job_key; /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { #if IBM_SP2==1 || IBM_SP2==2 /* IBM SP2 with PSSP 2.x or 3.x*/ char buf[256]; int i; sprintf(buf, "%d", pjob->ji_numvnod); bld_env_variables(vtab, "MP_PROCS", buf); for (i = 0; i < vtab->v_used; ++i) { if ((strncmp(vtab->v_envp[i], "PBS_NODEFILE", 12) == 0) && (*(vtab->v_envp[i] + 12) == '=')) { bld_env_variables(vtab, "MP_HOSTFILE", vtab->v_envp[i] + 13); break; } } #endif #if IBM_SP2==2 /* IBM SP2 with PSSP 3.x*/ sprintf(buf, "%d", job_key); bld_env_variables(vtab, "PBS_JOB_KEY", buf); sprintf(buf, "%d", pjob->ji_vnods[0].vn_index); bld_env_variables(vtab, "MP_MPI_NETWORK", buf); #endif /* IBM SP2 */ return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which tasks(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } /* END while (pjob) */ if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* END scan_for_terminated() */ /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ int open_master( char **rtn_name /* RETURN name of slave pts */ ) { int ptc; if ((ptc = open("/dev/ptc", O_RDWR | O_NOCTTY, 0)) < 0) { return (-1); } *rtn_name = ttyname(ptc); /* name of slave side */ return (ptc); } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "MSG", SIGMSG }, { "WINCH", SIGWINCH }, { "PWR", SIGPWR }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "PROF", SIGPROF }, { "DANGER", SIGDANGER }, { "VTALRM", SIGVTALRM }, { "MIGRATE", SIGMIGRATE }, { "PRE", SIGPRE }, { "VIRT", SIGVIRT }, { "ALRM1", SIGALRM1 }, { "WAITING", SIGWAITING }, { "KAP", SIGKAP }, { "GRANT", SIGGRANT }, { "RETRACT", SIGRETRACT }, { "SOUND", SIGSOUND }, { "SAK", SIGSAK }, {(char *)0, -1 } }; #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ /* * The following routines are used to load and unload the routing information * for the IBM high speed switch on the SP. Each node must specify the same * connection information. At the end of the job the information is unloaded. */ static int name_to_sw_num(char *nn) { int i; char *pa; char *pb; extern struct swtbl_num swtbl_num[]; extern int ibm_sp2_num_nodes; for (i = 0; i < ibm_sp2_num_nodes; i++) { pa = nn; pb = swtbl_num[i].sw_name; while (*pa && *pb && (*pa == *pb)) { pa++; pb++; } if (((*pa == '\0') && (*pb == '\0')) || ((*pa == '\0') && (*pb == '.')) || ((*pa == '.') && (*pb == '\0'))) return swtbl_num[i].sw_num; } return -1; } static int build_swtbl_array(job *pjob, struct ST_NODE_INFO **psa) { int i; int j; struct ST_NODE_INFO *swtbl; swtbl = (struct ST_NODE_INFO *)calloc(pjob->ji_numvnod, sizeof(struct ST_NODE_INFO)); if (swtbl == NULL) return PBSE_SYSTEM; for (i = 0; i < pjob->ji_numvnod; i++) { /* pull node name out of vnodent/hnodent struct */ (void)strcpy((swtbl + i)->st_node_name, pjob->ji_vnods[i].vn_host->hn_host); /* now find switch node number that matches name */ if ((j = name_to_sw_num((swtbl + i)->st_node_name)) == -1) { (void)free(swtbl); return PBSE_UNKNODE; } (swtbl + i)->st_virtual_task_id = i; (swtbl + i)->st_switch_node_num = j; (swtbl + i)->st_window_id = pjob->ji_vnods[i].vn_index; } *psa = swtbl; return PBSE_NONE; } /* * load_sp_switch - load the IBM SP switch table with the nodes/window_id * to be used by this job. Also write a file into the "aux" directory * with the array of window_ids in task order. This file is used by * pbspd.c to place the correct window_id into the environment based on * the value of MP_CHILD passed by IBM's poe. */ int load_sp_switch(job *pjob) { int i; int rc = 0; struct ST_NODE_INFO *pswa; static char *id = "load_sp_switch"; char buf[MAXPATHLEN+1]; FILE *fwin; extern int internal_state; sscanf(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str, "%x", &job_key); if (job_key < 0) job_key = -job_key; if ((rc = build_swtbl_array(pjob, &pswa)) != PBSE_NONE) { sprintf(log_buffer, "build swtbl node array failed %d", rc); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); return -1; } rc = swtbl_load_table(ST_VERSION, pjob->ji_qs.ji_un.ji_momt.ji_exuid, getpid(), job_key, mom_host, pjob->ji_numvnod, pjob->ji_qs.ji_jobid, pswa); if (rc != ST_SUCCESS) { sprintf(log_buffer, "swtbl_load_table failed with %d", rc); log_record(PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); internal_state |= INUSE_DOWN; /* FIXME: need to send state to all servers, not just index 0 */ state_to_server(0, 1); /* tell server we are down */ } else { /* success */ (void)sprintf(buf, "%s/aux/%s.SW", path_home, pjob->ji_qs.ji_jobid); if ((fwin = fopen(buf, "w")) == NULL) { sprintf(log_buffer, "cannot open %s", buf); log_err(errno, id, log_buffer); return -1; } (void)fchmod(fileno(fwin), 0644); for (i = 0; i < pjob->ji_numvnod; i++) fprintf(fwin, "%d\n", pjob->ji_vnods[i].vn_index); (void)fclose(fwin); } (void)free(pswa); return rc; } /* * unload_sp_switch - unload the job/node information from the switch * Also remove the aux *.SW file created when the switch is loaded above. */ void unload_sp_switch(job *pjob) { int i; int rc = 0; char buf[MAXPATHLEN+1]; struct vnodent *pvp; extern int internal_state; for (i = 0; i < pjob->ji_numvnod; ++i) { pvp = &pjob->ji_vnods[i]; if (pvp->vn_host->hn_node == pjob->ji_nodeid) { rc = swtbl_unload_table(ST_VERSION, "css0", pjob->ji_qs.ji_un.ji_momt.ji_exuid, pvp->vn_index); DBPRT(("Unloading switch window %d\n", pvp->vn_index)) if (rc != ST_SUCCESS) { sprintf(log_buffer, "error %d unloading switch table window %d for job %s", rc, pvp->vn_index, pjob->ji_qs.ji_jobid); log_err(PBSE_SYSTEM, "unload_sp_switch", log_buffer); if (rc != ST_SWITCH_NOT_LOADED) { rc = swtbl_clean_table(ST_VERSION, "css0", ST_ALWAYS_KILL, pvp->vn_index); } else if (rc != ST_SUCCESS) { sprintf(log_buffer, "error %d cleaning switch table window %d for job %s", rc, pvp->vn_index, pjob->ji_qs.ji_jobid); log_err(PBSE_SYSTEM, "unload_sp_switch", log_buffer); internal_state |= INUSE_DOWN; /* FIXME: need to send state to all servers, not just index 0 */ state_to_server(0, 1); /* tell server we are down */ } } } } (void)sprintf(buf, "%s/aux/%s.SW", path_home, pjob->ji_qs.ji_jobid); (void)unlink(buf); return; } /* * query_adp - query the SP switch adaptor, are we on line */ void query_adp(void) { int rc; enum ST_ADAPTER_STATUS st; extern int internal_state; static char *id = "query_adp"; if ((rc = swtbl_query_adapter(ST_VERSION, "css0", &st)) != ST_SUCCESS) { if ((internal_state & INUSE_DOWN) == 0) { log_record(PBSEVENT_SYSTEM, rc, id, "cannot query adaptor"); internal_state |= INUSE_DOWN | UPDATE_MOM_STATE; } return; } switch (st) { case ADAPTER_READY: if (internal_state & INUSE_DOWN) { internal_state &= ~INUSE_DOWN; /* we are not down */ internal_state |= UPDATE_MOM_STATE; log_record(PBSEVENT_SYSTEM, 0, id, "adaptor up"); } break; case ADAPTER_NOTREADY: if ((internal_state & INUSE_DOWN) == 0) { /* mark that we are down */ internal_state |= INUSE_DOWN | UPDATE_MOM_STATE; log_record(PBSEVENT_SYSTEM, 0, id, "adaptor down"); } break; } } #endif /* IBM SP */ torque-2.4.16/src/resmom/aix4/mom_mach.h0000664000113300011330000001310411272401243014716 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: aix4 */ #ifndef MOM_MACH #define MOM_MACH "aix4" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #if IBM_SP2==2 /* IBM SP with PSSP 3.1 */ int load_sp_switch A_((job *pjob)); /* load SP2 Switch */ void unload_sp_switch A_((job *pjob)); /* unload SP2 Switch */ #define SWNODEBUFSZ 1024 #define MAX_SW_NODES 1024 struct swtbl_num { char *sw_name; int sw_num; }; extern int ibm_sp2_num_nodes; #endif /* IBM SP */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/aix4/Makefile.in0000664000113300011330000004376411605403744015061 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/aix4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/aix4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/aix4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/aix4/pe_input.c0000664000113300011330000001062511272401243014761 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For aix - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/aix4/mom_mach.c0000664000113300011330000016166611272401243014732 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined ( _AIX43 ) #include #include #endif /* AIX43 */ #if IBM_SP2==1 #include #endif #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "resmon.h" #include "../rm_dep.h" #include "mom_mach.h" /* ** System dependent code to gather information for the resource ** monitor for an IBM 590 running AIX4. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** ncpus number of cpus ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** */ #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #if IBM_SP2==1 struct JM_JOB_STATUS *job_tbl = NULL; static int njob = 1; #endif /* IBM_SP2 */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern char *ret_string; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions */ static char *resi A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); /* ** local resource list storage */ struct config dependent_config[] = { { "resi", {resi} }, { "totmem", {totmem} }, { "physmem", {physmem} }, { "availmem", {availmem} }, { "loadave", {loadave} }, { "ncpus", {ncpus} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; struct nlist nl[] = { { "avenrun" } }; #define KSYM_LOAD 0 #define ASIZE 10 time_t wait_time = 10; int kd = -1; int proctot = 0; struct procsinfo *proc_tbl = NULL; char **swap_dev = NULL; int nproc = 0; static int nncpus; static uint realmem; static long page_size; extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char nokernel[] = "kernel not available"; char noproc[] = "process %d does not exist"; #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ struct swtbl_num swtbl_num[MAX_SW_NODES]; int ibm_sp2_num_nodes; static int get_swtbl_num(void) { int i; char buf[SWNODEBUFSZ]; char *lppcmd = "/usr/lpp/ssp/bin/SDRGetObjects Node reliable_hostname switch_node_number"; FILE *pp; char name[SWNODEBUFSZ]; if ((pp = popen(lppcmd, "r")) == 0) return (-1); (void)fgets(buf, SWNODEBUFSZ - 1, pp); /* ignore first line */ for (i = 0; i < MAX_SW_NODES; i++) { if (fgets(buf, SWNODEBUFSZ - 1, pp) == NULL) break; sscanf(buf, "%s %d", name, &swtbl_num[i].sw_num); if (swtbl_num[i].sw_name != NULL) free(swtbl_num[i].sw_name); swtbl_num[i].sw_name = strdup(name); } if (pclose(pp) != 0) { return (-1); } ibm_sp2_num_nodes = i; return(i); } #endif /* IBM SP2 */ /** * NOTE: swap_dev is global */ void dep_initialize(void) { char *id = "dep_initialize"; int i, rc, len; char line[200], *dev; char *swapfil = "/etc/swapspaces"; FILE *fil; #if defined( _AIX43 ) struct CuAt * obj; int qty; #else /* AIX43 */ struct nlist ndata; #endif /* AIX43 */ if (swap_dev == NULL) { if ((swap_dev = (char **)calloc(10,sizeof(char *))) == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,"dep_initialize","calloc failure"); return; } } page_size = sysconf(_SC_PAGESIZE); if ((fil = fopen(swapfil, "r")) == NULL) { log_err(errno, id, swapfil); } else { char **tmpSwapDev; for (i = 0; fgets(line, sizeof(line), fil);) { if (line[0] == '*') continue; len = strlen(line); if (line[len-1] == '\n') line[--len] = '\0'; if ((dev = strstr(line, "/dev/")) == NULL) continue; DBPRT(("%s: swapdev(%d) %s\n", id, i, dev)) tmpSwapDev = (char **)realloc(swap_dev,(i + 2) * sizeof(char *)); if (tmpSwapDev == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,"dep_initialize","realloc failure"); return; } swap_dev = tmpSwapDev; swap_dev[i] = strdup(dev); if (swap_dev[i] == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,"dep_initialize","strdup failure"); return; } i++; } /* END for (i) */ swap_dev[i] = NULL; fclose(fil); } if ((kd = open("/dev/kmem", O_RDONLY)) == -1) { log_err(errno, id, "open"); return; } /* insure /dev/kmem closed on exec */ if ((i = fcntl(kd, F_GETFD)) == -1) { log_err(errno, id, "F_GETFD"); } i |= FD_CLOEXEC; if (fcntl(kd, F_SETFD, i) == -1) { log_err(errno, id, "F_SETFD"); } if ((proc_tbl = malloc(ASIZE * sizeof(struct procsinfo))) == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,"dep_initialize","malloc failure"); return; } proctot = ASIZE; rc = knlist(nl, sizeof(nl) / sizeof(struct nlist), sizeof(struct nlist)); if (rc == -1) { log_err(errno, id, "knlist"); return; } #ifdef DEBUG for (i = 0; i < sizeof(nl) / sizeof(struct nlist); i++) printf("%s: %s @ %x\n", id, nl[i].n_name, nl[i].n_value); #endif #if defined( _AIX43 ) /* The following code works for AIX 4.3 * Supplied by Lloyd Caldwell, U of Utah */ if (odm_initialize() == 0) { obj = getattr("sys0", "realmem", 0, &qty) ; if (obj == NULL) log_err(odmerrno, id, "odm_initialize"); else realmem = atoi(obj->value); /* in KB */ if (odm_terminate()) log_err(odmerrno, id, "odm_terminate for realmem"); } else { log_err(odmerrno, id, "odm_initialize for realmem"); } #else /* ! AIX43 */ /* * This code works for AIX 4.1 and 4.2 * The size of real memory is stored in the 10th location (uint big each) * of undocumented kernel structure "vmker". * * Author: Wendy Lin, PUCC, May 1998 */ ndata.n_name = "vmker"; if ((knlist(&ndata, 1, sizeof(struct nlist)) == -1) || (kvm_read(kd, ndata.n_value + sizeof(uint) * 9, &realmem, sizeof(realmem)) != sizeof(realmem))) { log_err(errno, id, "kvm_read of realmem"); realmem = 0; } else { realmem = realmem * 4; /* now in KB */ } #endif /* AIX43 */ #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ if (get_swtbl_num() < 1) { log_err(PBSE_SYSTEM, id, "Unable to obtain node switch numbers from SDR, exiting"); exit(1); } #endif /* IBM SP2 */ nncpus = sysconf(_SC_NPROCESSORS_ONLN); return; } void dep_cleanup(void) { char *id = "dep_cleanup"; int i; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); close(kd); kd = -1; if (proc_tbl) { free(proc_tbl); proc_tbl = NULL; } if (swap_dev) { for (i = 0; swap_dev[i]; i++) { free(swap_dev[i]); swap_dev[i] = NULL; } } } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { #if IBM_SP2==2 query_adp(); #endif /*IBM_SP2 */ return; } /* * Time decoding macro. Accepts a timeval structure. Returns unsigned long * time in seconds. */ #define tv(val) (ulong)((val).tv_sec) /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For AIX, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } static int injob(pjob, sesid) job *pjob; pid_t sesid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a session id. Returns the sum of all cpu time consumed for all * tasks executed by the job, in seconds, adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_ses"; int i; unsigned long cputime; int nps = 0; cputime = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; nps++; DBPRT(("%s: pid=%d", id, pp->pi_pid)) if (pp->pi_state == SZOMB) { DBPRT((" (zombie)")) cputime += (pp->pi_utime + pp->pi_stime); } else { DBPRT((" (active)")) cputime += tv(pp->pi_ru.ru_utime) + tv(pp->pi_ru.ru_stime) + tv(pp->pi_cru.ru_utime) + tv(pp->pi_cru.ru_stime); } DBPRT((" total=%lu\n", cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Internal session memory usage function. * * Accepts a session ID. Returns the total number of bytes of address * space consumed by all current tasks within the job. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_ses"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; memsize += ctob(pp->pi_size); DBPRT(("%s: pid=%d size=%lu\n", id, pp->pi_pid, memsize)) } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_ses"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; if (pp->pi_state == SZOMB) continue; memsize += (pp->pi_drss == -1) ? 0 : ctob(pp->pi_drss); memsize += (pp->pi_trss == -1) ? 0 : ctob(pp->pi_trss); DBPRT(("%s: pid=%d size=%lu\n", id, pp->pi_pid, memsize)) } return (memsize); } /* * Return TRUE if any process in the job is over limit for memory usage. */ static int overmem_proc(job *pjob, unsigned long limit) { int i; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; if (ctob(pp->pi_size) > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) proc_tbl = malloc(ASIZE * sizeof(struct procsinfo)); proctot = ASIZE; return (PBSE_NONE); } #if IBM_SP2==1 #define JMRETRY 2 /* ** Get job manager info. ** Return the number of jobs or -1 on error; */ int getjobstat(void) { char *id = "getjobstat"; int cnt; int sock; if (job_tbl) jmq_jobs_free(&job_tbl, njob); njob = 0; for (cnt = 0; cnt < JMRETRY; cnt++) { if ((sock = jm_connect_ub(NULL)) >= 0) break; switch (errno) { case EINTR: break; default: log_err(errno, id, "jm_connect_ub failed"); return -1; } } if (cnt == JMRETRY) { log_err(errno, id, "jm_connect_ub retry exhausted"); return -1; } for (cnt = 0; cnt < JMRETRY; cnt++) { DBPRT(("%s: jm socket %d cnt %d\n", id, sock, cnt)) if ((njob = jmq_jobs_status(sock, &job_tbl)) >= 0) break; sprintf(log_buffer, "jmq_jobs_status failed %d", njob); log_err(errno, id, log_buffer); log_buffer[0] = '\0'; } jm_disconnect(sock); /* SDRCloseSession(); */ #ifdef DEBUG { int i, j, k; for (i = 0; i < njob; i++) { struct JM_JOB_STATUS *jp = &job_tbl[i]; printf("-------------------------------\n"); printf("name: %s\n", jp->jm_user_name); printf("desc: %s\n", jp->jm_job_description); printf("%s pid=%d id=%d type=%d ncpus=%d\n", jp->jm_time_allocated, jp->jm_client_pid, jp->jm_job_id, jp->jm_adapter_type, jp->jm_num_nodes); for (j = 0; j < jp->jm_num_nodes; j++) { struct JM_NODE_IN_JOB *np = &jp->jm_node_in_job[j]; printf("\t+++++++++++++++++++\n"); printf("\tnode %s\n", np->jm_node_name); printf("\tusage=(%d/%d) tasks=%d\n\t", np->jm_cpu_usage, np->jm_adapter_usage, np->jm_num_virtual_tasks); for (k = 0; k < np->jm_num_virtual_tasks; k++) { int vid = np->jm_virtual_task_ids[k]; printf("(%d) ", vid); } printf("\n"); } } } #endif /* DEBUG */ return njob; } /* * Internal session number of cpu decoding routine. * * Accepts a job pointer. Returns TRUE if the nodes used * by any session fall outside those allowed. */ static unsigned long nodes_ses( job *pjob) { char *id = "nodes_ses"; int i, j, k; resource *pres; char *nodes; char *badnodes = ""; DBPRT(("%s: entered\n", id)) /* ** The variable "nodes" is the string of plus sign separated ** node names specified by the server. ** We want to check the nodes used by any process in the job ** to these and return TRUE if they are not a subset. */ nodes = pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; /* ** found a process in the job ** loop to see if any JM job shows this ** proc as its client pid */ DBPRT(("%s: pid=%d\n", id, pp->pi_pid)) for (j = 0; j < njob; j++) { struct JM_JOB_STATUS *jp = &job_tbl[j]; int len, hit; char *end; if (jp->jm_client_pid != pp->pi_pid) continue; /* ** the plot thickens ** a JM job has been found to be part of this session ** check to see if the nodes associated with ** the job are shown in "nodes" */ DBPRT(("%s: job pid %d nodes %d\n", id, pp->pi_pid, jp->jm_num_nodes)) hit = 0; for (k = 0; k < jp->jm_num_nodes; k++) { struct JM_NODE_IN_JOB *np = &jp->jm_node_in_job[k]; char *tmpBadNodes; /* ** if we find a match, everything is okay, ** the job is staying within its limits */ if (match(np->jm_node_name, nodes)) continue; /* ** if we get here without a match ** a node being used in the actual job ** was compared to every node this ** job is allowed to use (nodes) ** and it was not in the set */ hit = 1; /* ** see if this node is already listed ** in the "badnodes" list */ if (match(np->jm_node_name, badnodes)) continue; /* ** not in the "badnodes" list so we need ** to add it */ if ((len = strlen(badnodes)) == 0) { badnodes = strdup(np->jm_node_name); continue; } tmpBadNodes = (char *)realloc( badnodes, len + strlen(np->jm_node_name) + 4); if (tmpBadNodes == NULL) { /* FAILURE - cannot alloc memory */ /* report node as 'disallowed' */ return(TRUE); } badnodes = tmpBadNodes; strcat(badnodes,"+"); strcat(badnodes,np->jm_node_name); } /* END for (k) */ if (hit == 0) continue; sprintf(log_buffer, "rouge pid %d using node(s) %s", jp->jm_client_pid, jp->jm_node_in_job[0].jm_node_name); for (k = 1; k < jp->jm_num_nodes; k++) { struct JM_NODE_IN_JOB *np = &jp->jm_node_in_job[k]; int n = strlen(log_buffer); end = &log_buffer[n]; sprintf(end, "+%s", np->jm_node_name); } log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } if (strlen(badnodes)) { sprintf(log_buffer, "node(s) %.450s outside allowed list %.450s", badnodes, nodes); DBPRT(("%s: %s\n", id, log_buffer)) free(badnodes); return(TRUE); } return (FALSE); } /* END nodes_ses() */ #endif /* IBM_SP2 */ /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { char *id = "mom_get_sample"; struct procsinfo *pp; int num, addnum; pid_t pid; DBPRT(("%s: entered\n", id)) addnum = proctot; nproc = 0; pid = 0; pp = proc_tbl; while ((num = getprocs(pp, sizeof(struct procsinfo), NULL, sizeof(struct fdsinfo), &pid, addnum)) > 0) { DBPRT(("%s: loop start: got %d\n", id, num)) nproc += num; if (num < addnum) break; proctot += ASIZE; addnum = ASIZE; proc_tbl = realloc(proc_tbl, proctot * sizeof(struct procsinfo)); pp = &proc_tbl[nproc]; } if (num == -1) { log_err(errno, id, "getprocs"); return PBSE_SYSTEM; } DBPRT(("%s: nproc = %d\n", id, nproc)) #if IBM_SP2==1 if (getjobstat() == -1) return PBSE_SYSTEM; #endif /* IBM_SP2 */ return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); DBPRT(("%s: entered\n", id)) #if IBM_SP2==1 if (nodes_ses(pjob)) return (TRUE); #endif /* IBM_SP2 */ pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return (TRUE); } } else if ((ignwalltime == FALSE) && (strcmp(pname, "walltime") == 0)) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* as KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* as KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a task session. * Call with the job pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { int ct = 0; int i, err; int sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; if ((err = mom_get_sample()) != PBSE_NONE) return 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (sesid != pp->pi_sid) continue; DBPRT(("kill_task: send signal %d to pid %d\n", sig, pp->pi_pid)) (void)kill(pp->pi_pid, sig); ++ct; } return ct; } /* * Clean up everything related to polling. * */ int mom_close_poll(void) { DBPRT(("mom_close_poll entered\n")) if (proc_tbl) { free(proc_tbl); proc_tbl = NULL; } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return a -1 on error or sid. */ long mach_restart(task *ptask, char *file) { return (-1); } int kvm_read(int fd, long addr, char *buf, int size) { int ret; if (lseek(fd, addr, SEEK_SET) != addr) return -1; if ((ret = read(fd, buf, size)) == -1) return -1; return ret; } int getproctab(void) { static uint lastproc = 0; char *id = "getproctab"; if (lastproc == reqnum) /* don't need new proc table */ return nproc; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return(nproc); } double dsecs(struct timeval *val) { return ((double)val->tv_sec + (double)val->tv_usec*1e-6); } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int i, nproc; int found = 0; double cputime, addtime; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; found = 1; DBPRT(("%s: pid=%d", id, pp->pi_pid)) if (pp->pi_state == SZOMB) { DBPRT((" (zombie)")) addtime = dsecs(&pp->pi_utime) + dsecs(&pp->pi_stime); } else { DBPRT((" (active)")) addtime = dsecs(&pp->pi_ru.ru_utime) + dsecs(&pp->pi_ru.ru_stime) + dsecs(&pp->pi_cru.ru_utime) + dsecs(&pp->pi_cru.ru_stime); } cputime += addtime; DBPRT((" %.2f total=%.2f\n", addtime, cputime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_proc"; int i, nproc; int found = 0; double cputime; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pid != pp->pi_pid) continue; DBPRT(("%s: pid=%d", id, pp->pi_pid)) if (pp->pi_state == SZOMB) { DBPRT((" (zombie)")) cputime = dsecs(&pp->pi_utime) + dsecs(&pp->pi_stime); } else { DBPRT((" (active)")) cputime = dsecs(&pp->pi_ru.ru_utime) + dsecs(&pp->pi_ru.ru_stime) + dsecs(&pp->pi_cru.ru_utime) + dsecs(&pp->pi_cru.ru_stime); } DBPRT((" %.2f\n", cputime)) found = 1; break; } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int i, nproc; int memsize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; found = 1; memsize += pp->pi_size; DBPRT(("%s: pid %d memsize %d pi_size %d\n", id, pp->pi_pid, memsize, pp->pi_size)) } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; int i, nproc; int memsize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pid != pp->pi_pid) continue; found = 1; memsize = pp->pi_size; break; } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * ncpus(struct rm_attribute *attrib) { if (attrib) { log_err(-1, "ncpus", extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%d", nncpus); system_ncpus = nncpus; return ret_string; } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int i, nproc; int resisize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; found = 1; if (pp->pi_state == SZOMB) continue; resisize += pp->pi_drss + pp->pi_trss; DBPRT(("%s: pid=%d size=%d\n", id, pp->pi_pid, resisize)) } if (found) { sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; int i, nproc; int resisize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pid != pp->pi_pid) continue; found = 1; if (pp->pi_state == SZOMB) break; resisize = pp->pi_drss + pp->pi_trss; DBPRT(("%s: pid=%d size=%d\n", id, pp->pi_pid, resisize)) break; } if (found) { sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int nproc; int i, j; char *fmt; int njids = 0; pid_t *jids, jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return (NULL); } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return (NULL); } if ((jids = calloc(nproc, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return (NULL); } /* ** Search for session */ for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pp->pi_suid == 0) continue; jobid = pp->pi_sid; if (jobid == 0) continue; DBPRT(("%s: pid %d sid %u\n", id, pp->pi_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ jids[njids++] = jobid; /* so add it to list */ } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", jids[j]); else sprintf(fmt, " %d", jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int nproc; int i; char *fmt; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; checkret(&fmt, 100); sprintf(fmt, " %d", pp->pi_pid); fmt += strlen(fmt); num_pids++; DBPRT(("%s[%d]: pid %d sid %u\n", id, num_pids, pp->pi_pid, pp->pi_sid)) } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int nproc; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if ((uid = pp->pi_suid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, pp->pi_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return (ret_string); } uint swap_free; uint swap_size; int getswap( char *id) { static unsigned int lastai = 0; int i; struct pginfo pginfo; if (lastai == reqnum) /* already have anoninfo */ { return (0); } swap_free = swap_size = 0; for (i = 0; swap_dev[i]; i++) { if (swapqry(swap_dev[i], &pginfo) == -1) { log_err(errno, id, swap_dev[i]); continue; } swap_free += pginfo.free; swap_size += pginfo.size; } lastai = reqnum; return 0; } static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; ulong tmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getswap(id)) return NULL; sprintf(ret_string, "%lukb", (swap_size * page_size) >> 10); /* KB */ return ret_string; } static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getswap(id)) return NULL; sprintf(ret_string, "%lukb", (swap_free * page_size) >> 10); /* KB */ return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bavail) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) { DBPRT(("%s: prev %d curr %d\n", dev, maxtm, sb.st_atime)) maxtm = sb.st_atime; } return; } int interesting(char *name) { static char *list[] = { "kbd", "mouse", "pty", "tty", NULL }; char **el; if (name == NULL || *name == '.') return 0; for (el = list; *el; el++) { if (strncmp(name, *el, strlen(*el)) == 0) return 1; } return 0; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (!interesting(de->d_name)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); if ((maxtm < curtm) && ((dp = opendir("/dev/pts")) != NULL)) { while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (de->d_name[0] == '.') continue; sprintf(ttyname, "/dev/pts/%s", de->d_name); setmax(ttyname); } closedir(dp); } sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; pid_t value; int i, nproc, job, found = 0; time_t now, start; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (job) { if (value != pp->pi_sid) continue; } else { if (value != pp->pi_pid) continue; } found = 1; DBPRT(("%s: pid %d start %d\n", id, pp->pi_pid, pp->pi_start)) start = MIN(start, pp->pi_start); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * physmem(struct rm_attribute *attrib) { if (attrib) { log_err(-1, "physmem", extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%lukb", realmem); return (ret_string); } #define FSCALE (1<<16) int get_la(double *rv) { char *id = "get_la"; long load; if (kd == NULL) { log_err(-1, id, nokernel); return (rm_errno = RM_ERR_SYSTEM); } if (kvm_read(kd, nl[KSYM_LOAD].n_value, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "kvm_read"); return (rm_errno = RM_ERR_SYSTEM); } *rv = (double)load / FSCALE; return 0; } #if IBM_SP2==1 /* * dummy synbol for unknown IBM job manager routine, * wish IBM would give out some information about it... */ void ppslog(void) { } /* ** Check that node_name matches one of the names in node_list ** separated by '+'s. The match is only done up to the first ** '.' character. ** Return 1 for a match and 0 for no match. */ int match(char *node_name, char *node_list) { char *cp, *name; /* ** start a loop through "node_list" ** making one pass only */ name = node_name; cp = node_list; while (*cp) { /* ** step through both name and ** nodes matching each char */ for (; *name; name++, cp++) { if (*name != *cp) break; } /* ** once we are done with the ** test loop above, check ** to see if a match is found ** by having gotten to the ** end of name and the end ** of one node name in "node_list" */ if ((*name == '\0' || *name == '.') && (*cp == '+' || *cp == '\0' || *cp == '.')) return 1; /* ** if we get here, there was no match ** skip the rest of the node name ** (and plus sign) and reset name to ** the one we are looking for */ while (*cp != '+' && *cp != '\0') cp++; if (*cp == '+') cp++; name = node_name; } return 0; } #endif /* IBM_SP2 */ void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/aix4/Makefile.am0000664000113300011330000000030611272401243015021 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/sunos4/0000777000113300011330000000000011614035173013443 500000000000000torque-2.4.16/src/resmom/sunos4/mom_start.c0000664000113300011330000002505211272401243015531 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code does it the hard way, it searches */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "CLD", SIGCLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "POLL", SIGPOLL }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "WINCH", SIGWINCH }, { "LOST", SIGLOST }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; torque-2.4.16/src/resmom/sunos4/mom_mach.h0000664000113300011330000001240111272401243015303 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: sun */ #ifndef MOM_MACH #define MOM_MACH "sunos4" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/sunos4/Makefile.in0000664000113300011330000004377211605403757015452 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/sunos4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/sunos4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/sunos4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/sunos4/pe_input.c0000664000113300011330000001063211272401243015345 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For the Sun - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/sunos4/mom_mach.c0000664000113300011330000014664011272401243015313 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** System dependent code to gather information for a Sun machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information (sizes in KB) */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "pbs_error.h" #include "log.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" static char ident[] = "@(#) sun/$RCSfile$ $Revision: 3151 $"; #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; /* wow, no ncpus - extern long system_ncpus; */ extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions */ static char *resi A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); struct config dependent_config[] = { { "resi", {resi} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { NULL, {nullproc} }, }; struct nlist nl[] = { { "_proc" }, /* 0 */ { "_nproc" }, /* 1 */ { "_anoninfo" }, /* 2 */ { "_physmem" }, /* 3 */ { "_avenrun" }, /* 4 */ { "" } }; #define KSYM_PROC 0 #define KSYM_NPROC 1 #define KSYM_ANON 2 #define KSYM_PHYS 3 #define KSYM_LOAD 4 time_t wait_time = 10; kvm_t *kd = NULL; struct proc *proc_tbl = NULL; pid_t *sess_tbl = NULL; int nproc = 0; extern char *ret_string; extern char extra_parm[]; extern char no_parm[]; char nokernel[] = "kernel not available"; char noproc[] = "process %d does not exist"; void dep_initialize(void) { char *id = "dep_initialize"; if (kd == NULL) { if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "rm")) == NULL) { log_err(errno, id, "kvm_open"); return; } } if (kvm_nlist(kd, nl) == -1) { log_err(errno, id, "kvm_nlist"); return; } return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (kd) kvm_close(kd); kd = NULL; } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } extern time_t time_now; /* * Time decoding macro. Accepts a timeval structure. Returns unsigned long * time in seconds. (tv_usec is in microseconds) */ #define tv(val) ((val).tv_sec + ((unsigned long)(val).tv_usec + 500000)/1000000) /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For SunOS, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* ** Scan a list of tasks and return true if one of them matches ** the process (sid or pid) represented by *psp. */ static int injob(pjob, sesid) job *pjob; pid_t sesid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) return TRUE; } return FALSE; } #define MINPROC 10 #define MAXPROC 10000 /* * Internal session cpu time decoding routine. * * Accepts a session id. Returns the sum of all cpu time consumed for all * tasks executed by the job, in seconds, adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; int i; register struct user *uarea; unsigned long cputime; int nps = 0; cputime = 0; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (!injob(pjob, sess_tbl[i])) continue; nps++; if (pp->p_ru == NULL) { if ((uarea = kvm_getu(kd, pp)) == NULL) continue; else { cputime += tv(uarea->u_ru.ru_utime) + tv(uarea->u_ru.ru_stime) + tv(uarea->u_cru.ru_utime) + tv(uarea->u_cru.ru_stime); } } else { struct rusage ru; if (kvm_read(kd, (unsigned long)pp->p_ru, (char *)&ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); continue; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: ses %d pid %d cputime %d\n", id, sess_tbl[i], pp->p_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Internal session memory usage function. * * Accepts a job ID. Returns the total number of bytes of address * space consumed by all current tasks within the job. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (!injob(pjob, sess_tbl[i])) continue; memsize += ctob(pp->p_tsize + pp->p_dsize + pp->p_ssize); DBPRT(("%s: ses %d pid=%d uid=%d totmem=%lu\n", id, sess_tbl[i], pp->p_pid, pp->p_uid, memsize)) } return (memsize); } /* * Internal session workingset size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (!injob(pjob, sess_tbl[i])) continue; memsize += ctob(pp->p_rssize); DBPRT(("%s: pid=%d ses=%d uid=%d mem=%d totmem=%d\n", id, pp->p_pid, sess_tbl[i], pp->p_uid, pp->p_rssize, memsize)) } return (memsize); } /* * Return TRUE if any task in the job is over limit for memory usage. */ static int overmem_proc(job *pjob, unsigned long limit) { int i; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (!injob(pjob, sess_tbl[i])) continue; if (ctob(pp->p_tsize + pp->p_dsize + pp->p_ssize) > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately (SET_LIMIT_SET). */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) /* cpu time - check */ { if (igncput == FALSE) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ if (set_mode == SET_LIMIT_SET) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); assert(value <= INT_MAX); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) if (kd == NULL) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "mom"); if (kd == NULL) { log_err(errno, id, "kvm_open"); return (PBSE_SYSTEM); } } if (kvm_nlist(kd, nl) == -1) { log_err(errno, id, "kvm_nlist"); return (PBSE_SYSTEM); } return (PBSE_NONE); } /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { char *id = "mom_get_sample"; caddr_t *kernel_proc; int i, len; DBPRT(("%s: entered\n", id)) if (proc_tbl) free(proc_tbl); if (sess_tbl) free(sess_tbl); if (kd == NULL) return (PBSE_INTERNAL); if (nl[KSYM_NPROC].n_type == 0) { log_err(-1, id, "number of process not found"); return (PBSE_SYSTEM); } if (kvm_read(kd, nl[KSYM_NPROC].n_value, (char *)&nproc, sizeof(nproc)) != sizeof(nproc)) { log_err(errno, id, "kvm_read(NPROC)"); return (PBSE_SYSTEM); } if (nproc < MINPROC || nproc > MAXPROC) { sprintf(log_buffer, "strange number of procs (%d)", nproc); log_err(-1, id, log_buffer); return (PBSE_SYSTEM); } if (nl[KSYM_PROC].n_type == 0) { log_err(-1, id, "process table not found"); return (PBSE_SYSTEM); } if (kvm_read(kd, nl[KSYM_PROC].n_value, (char *)&kernel_proc, sizeof(kernel_proc)) != sizeof(kernel_proc)) { log_err(errno, id, "kvm_read(PROC)"); return (PBSE_SYSTEM); } proc_tbl = (struct proc *)calloc(nproc, sizeof(struct proc)); if (proc_tbl == NULL) { sprintf(log_buffer, "can't allocate memory for proc table"); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } len = nproc * sizeof(struct proc); if (kvm_read(kd, (unsigned long)kernel_proc, (char *)proc_tbl, len) != len) { log_err(errno, id, "kvm_read(proc_tbl)"); return (PBSE_SYSTEM); } /* * Read session info for each process. */ sess_tbl = (pid_t *)calloc(nproc, sizeof(pid_t)); if (sess_tbl == NULL) { sprintf(log_buffer, "can't allocate memory for session table"); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } for (i = 0; i < nproc; i++) { struct sess s; struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (pp->p_sessp == NULL) continue; if (kvm_read(kd, (unsigned long)pp->p_sessp, (char *)&s, sizeof(s)) != sizeof(s)) { log_err(errno, id, "kvm_read(session)"); continue; /* session gone? */ } sess_tbl[i] = (pid_t)s.s_sid; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", (float)num, (float)value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a job task. * Call with the job and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int i, err; int sesid; DBPRT(("%s entered\n", id)) sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; if ((err = mom_get_sample()) != PBSE_NONE) return 0; for (i = 0; i < nproc; i++) { struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (sesid != sess_tbl[i]) continue; DBPRT(("%s: send signal %d to pid %d\n", id, sig, pp->p_pid)) (void)kill(pp->p_pid, sig); ++ct; } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { DBPRT(("mom_close_poll entered\n")) if (kd) { if (kvm_close(kd) != 0) { log_err(errno, "mom_close_poll", "kvm_close"); return (PBSE_SYSTEM); } kd = NULL; } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; char *id = "getprocs"; caddr_t *kernel_proc; int i, len; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; double ses_time; int i; register struct user *uarea; unsigned long cputime; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (jobid != sess_tbl[i]) continue; if (pp->p_ru == NULL) { if ((uarea = kvm_getu(kd, pp)) == NULL) continue; else { cputime += tv(uarea->u_ru.ru_utime) + tv(uarea->u_ru.ru_stime) + tv(uarea->u_cru.ru_utime) + tv(uarea->u_cru.ru_stime); } } else { struct rusage ru; if (kvm_read(kd, (unsigned long)pp->p_ru, (char *)&ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); continue; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: ses %d pid %d cputime %d\n", id, jobid, pp->p_pid, cputime)) } sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } char * cput_proc(pid) pid_t pid; { char *id = "cput_proc"; register struct proc *pp; register struct user *uarea; uint cputime; if (kd == NULL) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return NULL; } if ((pp = kvm_getproc(kd, pid)) == NULL) { sprintf(log_buffer, noproc, pid); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if ((uarea = kvm_getu(kd, pp)) == NULL) { if (errno) { log_err(errno, id, "kvm_getu"); rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; } else { cputime = tv(uarea->u_ru.ru_utime) + tv(uarea->u_ru.ru_stime) + tv(uarea->u_cru.ru_utime) + tv(uarea->u_cru.ru_stime); } sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int i; int memsize, addmem; int found = 0; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (jobid != sess_tbl[i]) continue; found = 1; addmem = pp->p_tsize + pp->p_dsize + pp->p_ssize; memsize += addmem; } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; register struct proc *pp; int memsize; if (kd == NULL) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return NULL; } if ((pp = kvm_getproc(kd, pid)) == NULL) { sprintf(log_buffer, noproc, pid); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } memsize = pp->p_tsize + pp->p_dsize + pp->p_ssize; sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int i; int resisize; int found = 0; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (jobid != sess_tbl[i]) continue; found = 1; resisize += pp->p_rssize; } if (found) { sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; register struct proc *pp; if (kd == NULL) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return NULL; } if ((pp = kvm_getproc(kd, pid)) == NULL) { sprintf(log_buffer, noproc, pid); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", ctob(pp->p_rssize) >> 10); /* KB */ return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; char *fmt; int njids = 0; pid_t *jids, jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((jids = (pid_t *)calloc(nproc, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for job */ for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (pp->p_suid == 0) continue; jobid = sess_tbl[i]; DBPRT(("%s: pid %d sid %u\n", id, (int)pp->p_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ jids[njids++] = jobid; /* so add it to list */ } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i; char *fmt; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; DBPRT(("%s[%d]: pid %d sid %u\n", id, num_pids, pp->p_pid, sess_tbl[i])) if (jobid != sess_tbl[i]) continue; checkret(&fmt, 100); sprintf(fmt, " %d", pp->p_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = (uid_t *)calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if ((uid = pp->p_suid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, (int)pp->p_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } struct anoninfo ai; int getanon(char *id) { static unsigned int lastai = 0; if (lastai == reqnum) /* already have anoninfo */ return 0; if (kd == NULL) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return 1; } if (nl[KSYM_ANON].n_type == 0) { log_err(-1, id, "anoninfo struct not found"); rm_errno = RM_ERR_SYSTEM; return 1; } if (kvm_read(kd, nl[KSYM_ANON].n_value, (char *)&ai, sizeof(struct anoninfo)) != sizeof(struct anoninfo)) { log_err(errno, id, "kvm_read"); rm_errno = RM_ERR_SYSTEM; return 1; } lastai = reqnum; return 0; } static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getanon(id)) return NULL; sprintf(ret_string, "%ukb", ctob(ai.ani_max) >> 10); /* KB */ return ret_string; } static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getanon(id)) return NULL; /* in KB */ sprintf(ret_string, "%dkb", (ctob(ai.ani_max - ai.ani_resv)) >> 10); return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; unsigned int pmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (kd == NULL) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return NULL; } if (nl[KSYM_PHYS].n_type == 0) { log_err(-1, id, "physmem count not found"); rm_errno = RM_ERR_SYSTEM; return 0; } if (kvm_read(kd, nl[KSYM_PHYS].n_value, (char *)&pmem, sizeof(pmem)) != sizeof(pmem)) { log_err(errno, id, "kvm_read"); rm_errno = RM_ERR_SYSTEM; return NULL; } pmem *= getpagesize(); sprintf(ret_string, "%ukb", pmem >> 10); /* KB */ return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bavail) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/kbd"); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ld", (long)MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; register struct user *uarea; pid_t value; int i, job, found = 0; time_t now, start; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { register struct proc *pp = &proc_tbl[i]; if (pp->p_stat == 0) continue; if (job) { if (value != sess_tbl[i]) continue; } else { if (value != pp->p_pid) continue; } if ((uarea = kvm_getu(kd, pp)) == NULL) { log_err(errno, id, "kvm_getu"); rm_errno = RM_ERR_SYSTEM; return NULL; } found = 1; start = MIN(start, uarea->u_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(rv) double *rv { char *id = "get_la"; long load; if (kd == NULL) { log_err(-1, id, nokernel); return (rm_errno = RM_ERR_SYSTEM); } if (nl[KSYM_LOAD].n_type == 0) { log_err(-1, id, "loadaverage count not found"); return (rm_errno = RM_ERR_SYSTEM); } if (kvm_read(kd, nl[KSYM_LOAD].n_value, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "kvm_read"); return (rm_errno = RM_ERR_SYSTEM); } *rv = (double)load / FSCALE; return 0; } u_long gracetime(u_long secs) { time_t now = time((time_t *)NULL); if (secs > now) /* time is in the future */ return (secs - now); else return 0; } static char * quota(struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct mntent *me; struct dqblk qi; FILE *m; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if ((m = setmntent(MOUNTED, "r")) == NULL) { log_err(errno, id, "setmntent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((me = getmntent(m)) != NULL) { if (strcmp(me->mnt_type, MNTTYPE_IGNORE) == 0) continue; if (stat(me->mnt_dir, &sb) == -1) { sprintf(log_buffer, "stat: %s", me->mnt_dir); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", me->mnt_fsname, me->mnt_dir, sb.st_dev)) if (sb.st_dev == dirdev) break; } endmntent(m); if (me == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if (hasmntopt(me, MNTOPT_QUOTA) == NULL) { sprintf(log_buffer, "no quotas on filesystem %s", me->mnt_dir); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } uid = pw->pw_uid; } if (quotactl(Q_GETQUOTA, me->mnt_fsname, uid, &qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* all sizes in KB */ switch (type) { case harddata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_bhardlimit) >> 10); break; case softdata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_bsoftlimit) >> 10); break; case currdata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_curblocks) >> 10); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_fhardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_fsoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curfiles); break; case timedata: sprintf(ret_string, "%u", gracetime(qi.dqb_btimelimit)); break; case timefile: sprintf(ret_string, "%u", gracetime(qi.dqb_ftimelimit)); break; } return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/sunos4/Makefile.am0000664000113300011330000000030611272401243015407 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/job_func.c0000664000113300011330000004403211613641364014066 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Functions which provide basic operation on the job structure * * Included public functions are: * * job_abt abort (remove from server) a job * job_alloc allocate job struct and initialize defaults * job_free free space allocated to the job structure and its * childern structures. * job_purge purge job from server * * job_clone clones a job (for use with job_arrays) * job_clone_wt work task for cloning a job * job_unlink_file() unlinks a given file using job credentials * * Include private function: * job_init_wattr() initialize job working attribute array to "unspecified" */ #include /* the master config generated by configure */ #include #include #include #include #include #include #ifndef SIGKILL #include #endif #if __STDC__ != 1 #include #endif #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "work_task.h" #include "attribute.h" #include "resource.h" #include "server_limits.h" #include "server.h" #include "queue.h" #include "pbs_job.h" #include "log.h" #include "pbs_error.h" #include "svrfunc.h" #include "acct.h" #include "net_connect.h" #include "portability.h" #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif int conn_qsub(char *, long, char *); void job_purge(job *); /* External functions */ extern void mom_checkpoint_delete_files(job *pjob); #if IBM_SP2==2 /* IBM SP PSSP 3.1 */ void unload_sp_switch A_((job *pjob)); #endif /* IBM SP */ #ifdef PENABLE_LINUX26_CPUSETS extern int use_cpusets(job *); #endif /* PENABLE_LINUX26_CPUSETS */ /* Local Private Functions */ static void job_init_wattr A_((job *)); /* Global Data items */ extern gid_t pbsgroup; extern char *msg_abt_err; extern char *path_jobs; extern char *path_spool; extern char *path_aux; extern char server_name[]; extern time_t time_now; extern int LOGLEVEL; extern tlist_head svr_newjobs; extern tlist_head svr_alljobs; void nodes_free A_((job *)); int TTmpDirName A_((job *, char *)); void tasks_free( job *pj) { task *tp = (task *)GET_NEXT(pj->ji_tasks); obitent *op; infoent *ip; while (tp != NULL) { op = (obitent *)GET_NEXT(tp->ti_obits); while (op != NULL) { delete_link(&op->oe_next); free(op); op = (obitent *)GET_NEXT(tp->ti_obits); } /* END while (op != NULL) */ ip = (infoent *)GET_NEXT(tp->ti_info); while (ip != NULL) { delete_link(&ip->ie_next); free(ip->ie_name); free(ip->ie_info); free(ip); ip = (infoent *)GET_NEXT(tp->ti_info); } close_conn(tp->ti_fd); delete_link(&tp->ti_jobtask); free(tp); tp = (task *)GET_NEXT(pj->ji_tasks); } /* END while (tp != NULL) */ return; } /* END tasks_free() */ /* * remtree - remove a tree (or single file) * * returns 0 on success * -1 on failure */ int remtree( char *dirname) { static char id[] = "remtree"; DIR *dir; struct dirent *pdir; char namebuf[MAXPATHLEN], *filnam; int i; int rtnv = 0; #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) struct stat64 sb; #else struct stat sb; #endif #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) if (lstat64(dirname, &sb) == -1) #else if (lstat(dirname, &sb) == -1) #endif { if (errno != ENOENT) log_err(errno, id, "stat"); return(-1); } if (S_ISDIR(sb.st_mode)) { if ((dir = opendir(dirname)) == NULL) { if (errno != ENOENT) log_err(errno, id, "opendir"); return(-1); } strcpy(namebuf, dirname); strcat(namebuf, "/"); i = strlen(namebuf); filnam = &namebuf[i]; while ((pdir = readdir(dir)) != NULL) { if ((pdir->d_name[0] == '.') && ((pdir->d_name[1] == '\0') || (pdir->d_name[1] == '.'))) continue; strcpy(filnam, pdir->d_name); #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) if (lstat64(namebuf, &sb) == -1) #else if (lstat(namebuf, &sb) == -1) #endif { log_err(errno, id, "stat"); rtnv = -1; continue; } if (S_ISDIR(sb.st_mode)) { rtnv = remtree(namebuf); } else if (unlink(namebuf) < 0) { if (errno != ENOENT) { sprintf(log_buffer, "unlink failed on %s", namebuf); log_err(errno, id, log_buffer); rtnv = -1; } } else if (LOGLEVEL >= 7) { sprintf(log_buffer, "unlink(1) succeeded on %s", namebuf); log_ext(-1, id, log_buffer, LOG_DEBUG); } } /* END while ((pdir = readdir(dir)) != NULL) */ closedir(dir); if (rmdir(dirname) < 0) { if ((errno != ENOENT) && (errno != EINVAL)) { sprintf(log_buffer, "rmdir failed on %s", dirname); log_err(errno, id, log_buffer); rtnv = -1; } } else if (LOGLEVEL >= 7) { sprintf(log_buffer, "rmdir succeeded on %s", dirname); log_ext(-1, id, log_buffer, LOG_DEBUG); } } else if (unlink(dirname) < 0) { sprintf(log_buffer, "unlink failed on %s", dirname); log_err(errno, id, log_buffer); rtnv = -1; } else if (LOGLEVEL >= 7) { sprintf(log_buffer, "unlink(2) succeeded on %s", dirname); log_ext(-1, id, log_buffer, LOG_DEBUG); } return(rtnv); } /* END remtree() */ /* * conn_qsub - connect to the qsub that submitted this interactive job * return >= 0 on SUCCESS, < 0 on FAILURE * (this was moved from resmom/mom_inter.c) */ int conn_qsub( char *hostname, /* I */ long port, /* I */ char *EMsg) /* O (optional,minsize=1024) */ { pbs_net_t hostaddr; int s; int flags; if (EMsg != NULL) EMsg[0] = '\0'; if ((hostaddr = get_hostaddr(hostname)) == (pbs_net_t)0) { #if !defined(H_ERRNO_DECLARED) && !defined(_AIX) extern int h_errno; #endif /* FAILURE */ if (EMsg != NULL) { snprintf(EMsg, 1024, "cannot get address for host '%s', h_errno=%d", hostname, h_errno); } return(-1); } s = client_to_svr(hostaddr, (unsigned int)port, 0, EMsg); /* NOTE: client_to_svr() can return 0 for SUCCESS */ /* assume SUCCESS requires s > 0 (USC) was 'if (s >= 0)' */ /* above comment not enabled */ if (s < 0) { /* FAILURE */ return(-1); } /* SUCCESS */ /* this socket should be blocking */ flags = fcntl(s, F_GETFL); flags &= ~O_NONBLOCK; fcntl(s, F_SETFL, flags); return(s); } /* END conn_qsub() */ /* * job_alloc - allocate space for a job structure and initialize working * attribute to "unset" * * Returns: pointer to structure or null is space not available. */ job * job_alloc(void) { job *pj; pj = (job *)calloc(1, sizeof(job)); if (pj == NULL) { log_err(errno, "job_alloc", "no memory"); return(NULL); } pj->ji_qs.qs_version = PBS_QS_VERSION; CLEAR_LINK(pj->ji_alljobs); CLEAR_LINK(pj->ji_jobque); CLEAR_HEAD(pj->ji_tasks); pj->ji_taskid = TM_NULL_TASK + 1; pj->ji_numnodes = 0; pj->ji_numvnod = 0; pj->ji_hosts = NULL; pj->ji_vnods = NULL; pj->ji_resources = NULL; pj->ji_obit = TM_NULL_EVENT; pj->ji_preq = NULL; pj->ji_nodekill = TM_ERROR_NODE; pj->ji_flags = 0; pj->ji_globid = NULL; pj->ji_stdout = 0; pj->ji_stderr = 0; pj->ji_qs.ji_un.ji_momt.ji_exitstat = 0; pj->ji_momhandle = -1; /* mark mom connection invalid */ /* set the working attributes to "unspecified" */ job_init_wattr(pj); return(pj); } /* END job_alloc() */ /* * job_free - free job structure and its various sub-structures */ void job_free( job *pj) /* I (modified) */ { int i; if (LOGLEVEL >= 8) { sprintf(log_buffer, "freeing job"); log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pj->ji_qs.ji_jobid, log_buffer); } /* remove any malloc working attribute space */ for (i = 0;i < (int)JOB_ATR_LAST;i++) { job_attr_def[i].at_free(&pj->ji_wattr[i]); } if (pj->ji_grpcache) free(pj->ji_grpcache); assert(pj->ji_preq == NULL); nodes_free(pj); tasks_free(pj); if (pj->ji_resources) free(pj->ji_resources); if (pj->ji_globid) free(pj->ji_globid); /* now free the main structure */ free((char *)pj); return; } /* END job_free() */ /* * job_unlink_file - unlink file, but drop root credentials before * doing this to avoid removing objects that aren't belong to the user. */ int job_unlink_file( job *pjob, /* I */ const char *name) /* I */ { int saved_errno = 0, result = 0; uid_t uid = geteuid(); gid_t gid = getegid(); if (uid != 0) return unlink(name); if ((setegid(pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1)) return -1; if ((seteuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) == -1)) { saved_errno = errno; setegid(gid); errno = saved_errno; return -1; } result = unlink(name); saved_errno = errno; seteuid(uid); setegid(gid); errno = saved_errno; return result; } /* END job_unlink_file() */ /* * job_init_wattr - initialize job working attribute array * set the types and the "unspecified value" flag */ static void job_init_wattr( job *pj) { int i; for (i = 0;i < (int)JOB_ATR_LAST;i++) { clear_attr(&pj->ji_wattr[i], &job_attr_def[i]); } return; } /* END job_init_wattr() */ /* * job_purge - purge job from system * * The job is dequeued; the job control file, script file and any spooled * output files are unlinked, and the job structure is freed. * If we are MOM, the task files and checkpoint files are also * removed. */ void job_purge( job *pjob) /* I (modified) */ { static char id[] = "job_purge"; char namebuf[MAXPATHLEN + 1]; extern char *msg_err_purgejob; int rc; int pid; extern void MOMCheckRestart A_((void)); pid = fork(); if(pid < 0) { sprintf(log_buffer, "fork() failed in job_purge: %d", errno); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return; } if(pid != 0) { /* we are the parent.*/ delete_link(&pjob->ji_jobque); delete_link(&pjob->ji_alljobs); if (LOGLEVEL >= 6) { sprintf(log_buffer,"removing job"); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } job_free(pjob); /* if no jobs are left, check if MOM should be restarted */ if (((job *)GET_NEXT(svr_alljobs)) == NULL) MOMCheckRestart(); return; } /* This is the child */ if (pjob->ji_flags & MOM_HAS_TMPDIR) { if (TTmpDirName(pjob, namebuf)) { sprintf(log_buffer, "removing transient job directory %s", namebuf); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); if ((setegid(pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1) || (seteuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) == -1)) { /* FAILURE */ _exit(1); } rc = remtree(namebuf); seteuid(0); setegid(pbsgroup); if ((rc != 0) && (LOGLEVEL >= 5)) { sprintf(log_buffer, "recursive remove of job transient tmpdir %s failed", namebuf); log_err(errno, "recursive (r)rmdir", log_buffer); } pjob->ji_flags &= ~MOM_HAS_TMPDIR; } } #ifdef PENABLE_LINUX26_CPUSETS if (use_cpusets(pjob) == TRUE) { extern void cpuset_delete(char *); /* Delete the cpuset for the job. */ cpuset_delete(pjob->ji_qs.ji_jobid); } #endif /* PENABLE_LINUX26_CPUSETS */ /* delete the nodefile if still hanging around */ if (pjob->ji_flags & MOM_HAS_NODEFILE) { char file[MAXPATHLEN + 1]; sprintf(file,"%s/%s", path_aux, pjob->ji_qs.ji_jobid); unlink(file); pjob->ji_flags &= ~MOM_HAS_NODEFILE; } strcpy(namebuf,path_jobs); /* delete script file */ strcat(namebuf,pjob->ji_qs.ji_fileprefix); strcat(namebuf,JOB_SCRIPT_SUFFIX); if (unlink(namebuf) < 0) { if (errno != ENOENT) log_err(errno, id, msg_err_purgejob); } else if (LOGLEVEL >= 6) { sprintf(log_buffer, "removed job script"); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } #if IBM_SP2==2 /* IBM SP PSSP 3.1 */ unload_sp_switch(pjob); #endif /* IBM SP */ strcpy(namebuf, path_jobs); /* job directory path */ strcat(namebuf, pjob->ji_qs.ji_fileprefix); strcat(namebuf, JOB_TASKDIR_SUFFIX); remtree(namebuf); mom_checkpoint_delete_files(pjob); strcpy(namebuf, path_jobs); /* delete job file */ strcat(namebuf, pjob->ji_qs.ji_fileprefix); strcat(namebuf, JOB_FILE_SUFFIX); if (unlink(namebuf) < 0) { if (errno != ENOENT) log_err(errno, id, msg_err_purgejob); } else if (LOGLEVEL >= 6) { sprintf(log_buffer, "removed job file"); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } /* use _exit so we do not run any of the at_exit or on_exit routines */ _exit(0); } /* END job_purge() */ /* * find_job() - find job by jobid * * Search list of all server jobs for one with same job id * Return NULL if not found or pointer to job struct if found */ job *find_job( char *jobid) { char *at; job *pj; if ((at = strchr(jobid, (int)'@')) != NULL) * at = '\0'; /* strip off @server_name */ pj = (job *)GET_NEXT(svr_alljobs); while (pj != NULL) { if (!strcmp(jobid, pj->ji_qs.ji_jobid)) break; pj = (job *)GET_NEXT(pj->ji_alljobs); } if (at) *at = '@'; /* restore @server_name */ return(pj); /* may be NULL */ } /* END find_job() */ /* END job_func.c */ torque-2.4.16/src/resmom/mom_main.c0000664000113300011330000047404511613641364014110 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * The entry point function for MOM. */ #include /* the master config generated by configure */ #include #include #include #include #include #ifdef _CRAY #include #endif /* _CRAY */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if (PLOCK_DAEMONS & 4) #include #endif /* PLOCK_DAEMONS */ #include #include #ifdef _CRAY #include #include #include #endif /* _CRAY */ #include #include #include #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H) #include #endif #include "libpbs.h" #include "pbs_ifl.h" #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" #include "svrfunc.h" #include "pbs_error.h" #include "log.h" #include "net_connect.h" #include "rpp.h" #include "dis.h" #include "dis_init.h" #include "resmon.h" #include "pbs_nodes.h" #include "dis.h" #include "csv.h" #include "utils.h" #include "mcom.h" #ifdef NOPOSIXMEMLOCK #undef _POSIX_MEMLOCK #endif /* NOPOSIXMEMLOCK */ #ifdef _POSIX_MEMLOCK #include #endif /* _POSIX_MEMLOCK */ #define CHECK_POLL_TIME 45 #define DEFAULT_SERVER_STAT_UPDATES 45 #define PMAX_PORT 32000 #define MAX_RESEND_JOBS 512 #define DUMMY_JOB_PTR 1 /* Global Data Items */ char *program_name; int MOMIsLocked = 0; int MOMIsPLocked = 0; int ServerStatUpdateInterval = DEFAULT_SERVER_STAT_UPDATES; int CheckPollTime = CHECK_POLL_TIME; int ForceServerUpdate = 0; int verbositylevel = 0; double cputfactor = 1.00; unsigned int default_server_port = 0; int exiting_tasks = 0; float ideal_load_val = -1.0; int internal_state = 0; /* by default, enforce these policies */ int ignwalltime = 0; int ignmem = 0; int igncput = 0; int ignvmem = 0; int spoolasfinalname = 0; int killdelay = 0; /* end policies */ int lockfds = -1; time_t loopcnt; /* used for MD5 calc */ float max_load_val = -1.0; int hostname_specified = 0; char mom_host[PBS_MAXHOSTNAME + 1]; char TMOMRejectConn[1024]; /* most recent rejected connection */ char mom_short_name[PBS_MAXHOSTNAME + 1]; int num_var_env; char *path_epilog; char *path_epilogp; char *path_epiloguser; char *path_epiloguserp; char *path_epilogpdel; char *path_jobs; char *path_prolog; char *path_prologp; char *path_prologuser; char *path_prologuserp; char *path_spool; char *path_undeliv; char *path_aux; char *path_server_name; char *path_home = PBS_SERVER_HOME; char *mom_home; extern char *msg_daemonname; /* for logs */ extern char *msg_info_mom; /* Mom information message */ extern int pbs_errno; gid_t pbsgroup; unsigned int pbs_mom_port = 0; unsigned int pbs_rm_port = 0; tlist_head mom_polljobs; /* jobs that must have resource limits polled */ tlist_head svr_newjobs; /* jobs being sent to MOM */ tlist_head svr_alljobs; /* all jobs under MOM's control */ tlist_head mom_varattrs; /* variable attributes */ int termin_child = 0; /* boolean - one or more children need to be terminated this iteration */ time_t time_now = 0; time_t last_poll_time = 0; extern tlist_head svr_requests; extern struct var_table vtable; /* see start_exec.c */ double wallfactor = 1.00; long log_file_max_size = 0; long log_file_roll_depth = 1; time_t last_log_check; char *nodefile_suffix = NULL; /* suffix to append to each host listed in job host file */ char *submithost_suffix = NULL; /* suffix to append to submithost for interactive jobs */ char *TNoSpoolDirList[TMAX_NSDCOUNT]; char *TRemChkptDirList[TMAX_RCDCOUNT]; job *JobsToResend[MAX_RESEND_JOBS]; char *AllocParCmd = NULL; /* (alloc) */ int src_login_batch = TRUE; int src_login_interactive = TRUE; /* externs */ extern unsigned int pe_alarm_time; extern time_t pbs_tcp_timeout; extern long MaxConnectTimeout; char tmpdir_basename[MAXPATHLEN]; /* for $TMPDIR */ char rcp_path[MAXPATHLEN]; char rcp_args[MAXPATHLEN]; char xauth_path[MAXPATHLEN]; time_t LastServerUpdateTime = 0; /* NOTE: all servers updated together */ time_t MOMStartTime = 0; int MOMPrologTimeoutCount; int MOMPrologFailureCount; char MOMConfigVersion[64]; char MOMUNameMissing[64]; int MOMConfigDownOnError = 0; int MOMConfigRestart = 0; int MOMConfigRReconfig = 0; long system_ncpus = 0; char *auto_ideal_load = NULL; char *auto_max_load = NULL; #define TMAX_JE 64 pjobexec_t TMOMStartInfo[TMAX_JE]; /* prototypes */ extern void add_resc_def(char *, char *); extern void mom_server_all_diag(char **BPtr, int *BSpace); extern void mom_server_update_receive_time(int stream, const char *command_name); extern void mom_server_all_init(void); extern void mom_server_all_update_stat(void); extern int mark_for_resend(job *); extern int mom_server_all_check_connection(void); extern int mom_server_all_send_state(void); extern int mom_server_add(char *name); extern int mom_server_count; extern int post_epilogue(job *, int); extern int mom_checkpoint_init(void); extern void mom_checkpoint_check_periodic_timer(job *pjob); extern void mom_checkpoint_set_directory_path(char *str); void prepare_child_tasks_for_delete(); #define PMOMTCPTIMEOUT 60 /* duration in seconds mom TCP requests will block */ /* Local Data Items */ static char *log_file = NULL; enum PMOMStateEnum { MOM_RUN_STATE_RUNNING, MOM_RUN_STATE_EXIT, MOM_RUN_STATE_KILLALL, MOM_RUN_STATE_RESTART, MOM_RUN_STATE_LAST }; static enum PMOMStateEnum mom_run_state; static int recover = JOB_RECOV_RUNNING; static int recover_set = FALSE; static int call_hup = 0; static int nconfig; static char *path_log; struct config_list { struct config c; struct config_list *c_link; }; /* NOTE: must adjust RM_NPARM in resmom.h to be larger than number of parameters specified below */ static unsigned long setxauthpath(char *); static unsigned long setrcpcmd(char *); static unsigned long setpbsclient(char *); static unsigned long configversion(char *); static unsigned long cputmult(char *); static unsigned long setallocparcmd(char *); static unsigned long setidealload(char *); static unsigned long setignwalltime(char *); static unsigned long setignmem(char *); static unsigned long setigncput(char *); static unsigned long setignvmem(char *); static unsigned long setlogevent(char *); static unsigned long setloglevel(char *); static unsigned long setumask(char *); static unsigned long setpreexec(char *); static unsigned long setmaxload(char *); static unsigned long setenablemomrestart(char *); static unsigned long prologalarm(char *); static unsigned long restricted(char *); static unsigned long jobstartblocktime(char *); static unsigned long usecp(char *); static unsigned long wallmult(char *); static unsigned long setpbsserver(char *); static unsigned long setnodecheckscript(char *); static unsigned long setnodecheckinterval(char *); static unsigned long settimeout(char *); extern unsigned long mom_checkpoint_set_checkpoint_interval(char *); extern unsigned long mom_checkpoint_set_checkpoint_script(char *); extern unsigned long mom_checkpoint_set_restart_script(char *); extern unsigned long mom_checkpoint_set_checkpoint_run_exe_name(char *); static unsigned long setdownonerror(char *); static unsigned long setstatusupdatetime(char *); static unsigned long setcheckpolltime(char *); static unsigned long settmpdir(char *); static unsigned long setlogfilemaxsize(char *); static unsigned long setlogfilerolldepth(char *); static unsigned long setlogfilesuffix(char *); static unsigned long setlogdirectory(char *); static unsigned long setlogkeepdays(char *); static unsigned long setvarattr(char *); static unsigned long setautoidealload(char *); static unsigned long setautomaxload(char *); static unsigned long setnodefilesuffix(char *); static unsigned long setnospooldirlist(char *); static unsigned long setmomhost(char *); static unsigned long setrreconfig(char *); static unsigned long setsourceloginbatch(char *); static unsigned long setsourcelogininteractive(char *); static unsigned long setspoolasfinalname(char *); static unsigned long setremchkptdirlist(char *); static unsigned long setmaxconnecttimeout(char *); static unsigned long setkilldelay(char *); static struct specials { char *name; u_long(*handler)(); } special[] = { { "alloc_par_cmd", setallocparcmd }, { "auto_ideal_load", setautoidealload }, { "auto_max_load", setautomaxload }, { "xauthpath", setxauthpath }, { "rcpcmd", setrcpcmd }, { "rcp_cmd", setrcpcmd }, { "pbsclient", setpbsclient }, { "configversion", configversion }, { "cputmult", cputmult }, { "ideal_load", setidealload }, { "ignwalltime", setignwalltime }, { "ignmem", setignmem }, { "igncput", setigncput }, { "ignvmem", setignvmem }, { "logevent", setlogevent }, { "loglevel", setloglevel }, { "max_load", setmaxload }, { "enablemomrestart", setenablemomrestart }, { "prologalarm", prologalarm }, { "restricted", restricted }, { "jobstartblocktime", jobstartblocktime }, { "usecp", usecp }, { "wallmult", wallmult }, { "clienthost", setpbsserver }, /* deprecated - use pbsserver */ { "pbsserver", setpbsserver }, { "node_check_script", setnodecheckscript }, { "node_check_interval", setnodecheckinterval }, { "timeout", settimeout }, { "checkpoint_interval", mom_checkpoint_set_checkpoint_interval }, { "checkpoint_script", mom_checkpoint_set_checkpoint_script }, { "restart_script", mom_checkpoint_set_restart_script }, { "checkpoint_run_exe", mom_checkpoint_set_checkpoint_run_exe_name }, { "down_on_error", setdownonerror }, { "status_update_time", setstatusupdatetime }, { "check_poll_time", setcheckpolltime }, { "tmpdir", settmpdir }, { "log_directory", setlogdirectory }, { "log_file_max_size", setlogfilemaxsize }, { "log_file_roll_depth", setlogfilerolldepth }, { "log_file_suffix", setlogfilesuffix }, { "log_keep_days", setlogkeepdays }, { "varattr", setvarattr }, { "nodefile_suffix", setnodefilesuffix }, { "nospool_dir_list", setnospooldirlist }, { "mom_host", setmomhost }, { "remote_reconfig", setrreconfig }, { "job_output_file_umask", setumask }, { "preexec", setpreexec }, { "source_login_batch", setsourceloginbatch }, { "source_login_interactive", setsourcelogininteractive }, { "spool_as_final_name", setspoolasfinalname }, { "remote_checkpoint_dirs", setremchkptdirlist }, { "max_conn_timeout_micro_sec", setmaxconnecttimeout }, { "kill_delay", setkilldelay }, { NULL, NULL } }; static char *arch(struct rm_attribute *); static char *opsys(struct rm_attribute *); static char *requname(struct rm_attribute *); static char *validuser(struct rm_attribute *); static char *reqmsg(struct rm_attribute *); char *reqgres(struct rm_attribute *); static char *reqstate(struct rm_attribute *); static char *getjoblist(struct rm_attribute *); static char *reqvarattr(struct rm_attribute *); /* static char *nullproc(struct rm_attribute *); */ struct config common_config[] = { { "arch", {arch} }, /* machine architecture */ { "opsys", {opsys} }, /* operating system */ { "uname", {requname} }, /* user name ??? */ { "validuser", {validuser} }, /* valid user ??? */ { "message", {reqmsg} }, /* message ??? */ { "gres", {reqgres} }, /* generic resource (licenses...) */ { "state", {reqstate} }, /* state of pbs_mom */ { "jobs", {getjoblist} }, /* job list this pbs_mom */ { "varattr", {reqvarattr} }, /* ??? */ { NULL, {NULL} } }; int LOGLEVEL = 0; /* valid values (0 - 10) */ int LOGKEEPDAYS = 0; /* days each log file should be kept before deleting */ int DEBUGMODE = 0; int DOBACKGROUND = 1; char DEFAULT_UMASK[1024]; char PRE_EXEC[1024]; long TJobStartBlockTime = 5; /* seconds to wait for job to launch before backgrounding */ long TJobStartTimeout = 300; /* seconds to wait for job to launch before purging */ char *ret_string; int ret_size; struct config *config_array = NULL; struct config_list *config_list = NULL; sigset_t allsigs; int rm_errno; unsigned int reqnum = 0; /* the packet number */ int port_care = TRUE; /* secure connecting ports */ uid_t uid = 0; /* uid we are running with */ unsigned int alarm_time = 10; /* time before alarm */ extern tree *okclients; /* accept connections from */ char **maskclient = NULL; /* wildcard connections */ int mask_num = 0; int mask_max = 0; u_long localaddr = 0; char extra_parm[] = "extra parameter(s)"; char no_parm[] = "required parameter not found"; char varattr_delimiter[] = ";"; int cphosts_num = 0; struct cphosts *pcphosts = NULL; static int config_file_specified = 0; static char config_file[_POSIX_PATH_MAX] = "config"; char PBSNodeMsgBuf[1024]; char PBSNodeCheckPath[1024]; int PBSNodeCheckInterval; int PBSNodeCheckProlog = 0; int PBSNodeCheckEpilog = 0; static char *MOMExePath = NULL; static time_t MOMExeTime = 0; /* sync w/#define JOB_SUBSTATE_XXX (in include/pbs_job.h)*/ const char *PJobSubState[] = { "TRANSIN", /* Transit in, wait for commit */ "TRANSICM", /* Transit in, wait for commit */ "TRNOUT", /* transiting job outbound */ "TRNOUTCM", /* transiting outbound, rdy to commit */ "SUBSTATE04", "SUBSTATE05", "SUBSTATE06", "SUBSTATE07", "SUBSTATE08", "SUBSTATE09", "QUEUED", /* job queued and ready for selection */ "PRESTAGEIN", /* job queued, has files to stage in */ "SUBSTATE12", "SYNCRES", /* job waiting on sync start ready */ "STAGEIN", /* job staging in files then wait */ "STAGEGO", /* job staging in files and then run */ "STAGECMP", /* job stage in complete */ "SUBSTATE17", "SUBSTATE18", "SUBSTATE19", "HELD", /* job held - user or operator */ "SYNCHOLD", /* job held - waiting on sync regist */ "DEPNHOLD", /* job held - waiting on dependency */ "SUBSTATE23", "SUBSTATE24", "SUBSTATE25", "SUBSTATE26", "SUBSTATE27", "SUBSTATE28", "SUBSTATE29", "WAITING", /* job waiting on execution time */ "SUBSTATE31", "SUBSTATE32", "SUBSTATE33", "SUBSTATE34", "SUBSTATE35", "SUBSTATE36", "STAGEFAIL", /* job held - file stage in failed */ "SUBSTATE38", "SUBSTATE39", "PRERUN", /* job sent to MOM to run */ "STARTING", /* final job start initiated */ "RUNNING", /* job running */ "SUSPEND", /* job suspended, CRAY only */ "SUBSTATE44", "SUBSTATE45", "SUBSTATE46", "SUBSTATE47", "SUBSTATE48", "SUBSTATE49", "EXITING", /* Start of job exiting processing */ "STAGEOUT", /* job staging out (other) files */ "STAGEDEL", /* job deleteing staged out files */ "EXITED", /* job exit processing completed */ "ABORT", /* job is being aborted by server */ "SUBSTATE55", "SUBSTATE56", "PREOBIT", /* preobit job status */ "OBIT", /* (MOM) job obit notice sent */ "COMPLETED", "RERUN", /* job is rerun, recover output stage */ "RERUN1", /* job is rerun, stageout phase */ "RERUN2", /* job is rerun, delete files stage */ "RERUN3", /* job is rerun, mom delete job */ "RETSTD", /* job has checkpoint file, return stdout / stderr files to server * spool dir so that job can be restarted */ NULL }; /* sync w/#define IS_XXX */ const char *PBSServerCmds[] = { "NULL", "HELLO", "CLUSTER_ADDRS", "UPDATE", "STATUS", NULL }; /* ** These routines are in the "dependent" code. */ extern void dep_initialize A_((void)); extern void dep_cleanup A_((void)); /* External Functions */ extern void catch_child A_((int)); extern void init_abort_jobs A_((int)); extern void scan_for_exiting(); extern void scan_for_terminated(); extern int TMomCheckJobChild(pjobexec_t *, int, int *, int *); extern int TMomFinalizeJob3(pjobexec_t *, int, int, int *); extern void exec_bail(job *, int); extern void check_state(int); extern void DIS_tcp_funcs(); /* Local public functions */ static void stop_me A_((int)); static void PBSAdjustLogLevel A_((int)); int TMOMScanForStarting(void); /* Local private functions */ void check_log A_((void)); char *nullproc( struct rm_attribute *attrib) { char *id = "nullproc"; log_err(-1,id,"should not be called"); return(NULL); } /* END nullproc() */ static char *arch( struct rm_attribute *attrib) /* I */ { char *id = "arch"; struct config *cp; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (config_array == NULL) { return(PBS_MACH); } /* locate arch string */ for (cp = config_array;cp->c_name != NULL;cp++) { if (cp->c_u.c_value == NULL) continue; if (strcmp(cp->c_name, "arch")) continue; return(cp->c_u.c_value); } /* END for (cp) */ return(PBS_MACH); } /* END arch() */ static char *opsys( struct rm_attribute *attrib) /* I */ { char *id = "opsys"; struct config *cp; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (config_array == NULL) { return(PBS_MACH); } /* locate opsys string */ for (cp = config_array;cp->c_name != NULL;cp++) { if (cp->c_u.c_value == NULL) continue; if (strcmp(cp->c_name, "opsys")) continue; return(cp->c_u.c_value); } /* END for (cp) */ return(PBS_MACH); } /* END opsys() */ char * getuname(void) { struct utsname n; static char *name = NULL; if (name == NULL) { if (uname(&n) == -1) { return(NULL); } sprintf(ret_string, "%s %s %s %s %s", n.sysname, n.nodename, n.release, n.version, n.machine); name = strdup(ret_string); } /* END if (name == NULL) */ return(name); } /* END getuname() */ static char *reqmsg( struct rm_attribute *attrib) { char *id = "reqmsg"; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } return(PBSNodeMsgBuf); } /* END reqmsg() */ static char *getjoblist( struct rm_attribute *attrib) /* I */ { static char *list = NULL; static int listlen = 0; job *pjob; int firstjob = 1; if (list == NULL) { if ((list = calloc(BUFSIZ + 50, sizeof(char)))==NULL) { /* FAILURE - cannot alloc memory */ fprintf(stderr,"ERROR: could not calloc!\n"); /* since memory cannot be allocated, report no jobs */ return (" "); } listlen = BUFSIZ; } *list = '\0'; /* reset the list */ if ((pjob = (job *)GET_NEXT(svr_alljobs)) == NULL) { /* no jobs - return space character */ return(" "); } for (;pjob != NULL;pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { if (!firstjob) strcat(list, " "); strcat(list, pjob->ji_qs.ji_jobid); if ((int)strlen(list) >= listlen) { char *tmpList; listlen += BUFSIZ; tmpList = realloc(list,listlen); if (tmpList == NULL) { /* FAILURE - cannot alloc memory */ fprintf(stderr,"ERROR: could not realloc!\n"); /* since memory cannot be allocated, report no jobs */ return(" "); } list = tmpList; } firstjob = 0; } /* END for (pjob) */ if (list[0] == '\0') { /* no jobs - return space character */ strcat(list, " "); } return(list); } /* END getjoblist() */ #define TMAX_VARBUF 65536 static char *reqvarattr( struct rm_attribute *attrib) /* I */ { static char id[] = "reqvarattr"; static char *list = NULL, *child_spot; static int listlen = 0; struct varattr *pva; int fd, len, child_len; int first_line; FILE *child; char *ptr; char *ptr2; char tmpBuf[TMAX_VARBUF + 1]; if (list == NULL) { list = calloc(BUFSIZ + 1024, sizeof(char)); if (list == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,id,"cannot alloc memory"); return(" "); } listlen = BUFSIZ; } *list = '\0'; /* reset the list */ if ((pva = (struct varattr *)GET_NEXT(mom_varattrs)) == NULL) { return(" "); } for (;pva != NULL;pva = (struct varattr *)GET_NEXT(pva->va_link)) { /* loop for each $varattr parameter */ if ((pva->va_lasttime == 0) || (time_now >= (pva->va_ttl + pva->va_lasttime))) { if ((pva->va_ttl == -1) && (pva->va_lasttime != 0)) { if (pva->va_value[0] != '\0') { if (*list != '\0') strcat(list, varattr_delimiter); strcat(list, pva->va_value); } if ((int)strlen(list) >= listlen) { listlen += BUFSIZ; list = realloc(list, listlen); if (list == NULL) { log_err(errno,id,"cannot alloc memory"); return(" "); } } continue; /* ttl of -1 is only run once */ } /* TTL is satisfied, reload value */ pva->va_lasttime = time_now; if (pva->va_value == NULL) pva->va_value = calloc(TMAX_VARBUF, sizeof(char)); /* execute script and get a new value */ if ((child = popen(pva->va_cmd, "r")) == NULL) { sprintf(pva->va_value, "error: %d %s", errno, strerror(errno)); } else { fd = fileno(child); child_spot = tmpBuf; child_len = 0; child_spot[0] = '\0'; retryread: while ((len = read(fd, child_spot, TMAX_VARBUF - child_len)) > 0) { child_len += len; child_spot += len; if (child_len >= TMAX_VARBUF - 1) break; } /* END while ((len = read() > 0) */ if (len == -1) { /* FAILURE - cannot read var script output */ if (errno == EINTR) goto retryread; log_err(errno, id, "pipe read"); sprintf(pva->va_value, "? %d", RM_ERR_SYSTEM); pclose(child); continue; } /* SUCCESS */ pclose(child); tmpBuf[child_len] = '\0'; /* Transfer returned data into var value field */ first_line = TRUE; ptr = strtok(tmpBuf,"\n;"); ptr2 = pva->va_value; ptr2[0] = '\0'; /* * OUTPUT FORMAT: Take what script gives us. * Script should output 1 or more lines of Name=value1+value2+... */ while (ptr != NULL) { if (!first_line) strcat(ptr2,varattr_delimiter); strcat(ptr2,ptr); first_line = FALSE; ptr = strtok(NULL,"\n;"); } /* END while (ptr != NULL) */ } /* END else ((child = popen(pva->va_cmd,"r")) == NULL) */ } /* END if ((pva->va_lasttime == 0) || ...) */ if (pva->va_value[0] != '\0') { if (*list != '\0') strcat(list, varattr_delimiter); strcat(list, pva->va_value); } if ((int)strlen(list) >= listlen) { listlen += BUFSIZ; list = realloc(list, listlen); if (list == NULL) { log_err(errno,id,"cannot alloc memory"); return(" "); } } } /* END for (pva) */ if (list[0] == '\0') strcat(list, " "); return(list); } /* END reqvarattr() */ char *reqgres( struct rm_attribute *attrib) /* I (ignored) */ { char *id = "reqgres"; struct config *cp; static char GResBuf[1024]; char tmpLine[1024]; int sindex; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } /* build gres string */ /* FORMAT: :[+:]... */ GResBuf[0] = '\0'; if (config_array == NULL) { return(GResBuf); } for (cp = config_array;cp->c_name != NULL;cp++) { if (cp->c_u.c_value == NULL) continue; /* verify parameter is not special */ for (sindex = 0;sindex < RM_NPARM;sindex++) { if (special[sindex].name == NULL) break; if (!strcmp(special[sindex].name, cp->c_name)) break; } /* END for (sindex) */ if ((sindex < RM_NPARM) && (special[sindex].name != NULL) && (!strcmp(special[sindex].name, cp->c_name))) { /* specified parameter is special parameter */ continue; } /* verify parameter is not common */ for (sindex = 0;sindex < RM_NPARM;sindex++) { if (common_config[sindex].c_name == NULL) break; if (!strcmp(common_config[sindex].c_name, cp->c_name)) break; } /* END for (sindex) */ if ((sindex < RM_NPARM) && (common_config[sindex].c_name != NULL) && !strcmp(common_config[sindex].c_name, cp->c_name) && strcmp(common_config[sindex].c_name, "gres")) { /* specified parameter is common parameter */ continue; } if (!strncmp(cp->c_name, "size", strlen("size"))) continue; if (GResBuf[0] != '\0') strncat(GResBuf, "+", 1024); snprintf(tmpLine, 1024, "%s:%s", cp->c_name, cp->c_u.c_value); strncat(GResBuf, tmpLine, (sizeof(GResBuf) - strlen(GResBuf) - 1)); } /* END for (cp) */ return(GResBuf); } /* END reqgres() */ static char *reqstate( struct rm_attribute *attrib) /* I (ignored) */ { static char state[1024]; if ((internal_state & INUSE_DOWN) && (MOMConfigDownOnError != 0)) strcpy(state, "down"); else if (internal_state & INUSE_BUSY) strcpy(state, "busy"); else strcpy(state, "free"); return(state); } /* END reqstate() */ static char *requname( struct rm_attribute *attrib) { char *id = "uname"; char *cp; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } cp = getuname(); return(cp); } /* END requname() */ static char *validuser( struct rm_attribute *attrib) { char *id = "valid_user"; struct passwd *p; if ((attrib == NULL) || (attrib->a_value == NULL)) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } p = getpwnam(attrib->a_value); if (p != NULL) { return("yes"); } return("no"); } /* END validuser() */ char *loadave( struct rm_attribute *attrib) { char *id = "loadave"; static char ret_string[20]; double la; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (get_la(&la) != 0) { rm_errno = RM_ERR_SYSTEM; return(NULL); } sprintf(ret_string, "%.2f", la); return(ret_string); } /* END loadave() */ /* ** Search the array of resources read from the config files. */ struct config *rm_search( struct config *where, /* I */ char *what) /* I */ { struct config *cp; if (where == NULL || what == NULL) { return NULL; } for (cp = where;cp->c_name != NULL;cp++) { if (strcmp(cp->c_name, what) == 0) { return(cp); } } /* END for (cp) */ return(NULL); } /* END rm_search() */ /* ** Search the various resource lists. */ char *dependent( char *res, /* I */ struct rm_attribute *attr) /* I */ { struct config *ap; extern struct config standard_config[]; extern struct config dependent_config[]; ap = rm_search(common_config, res); if (ap != NULL) { return(ap->c_u.c_func(attr)); } ap = rm_search(standard_config, res); if (ap != NULL) { return(ap->c_u.c_func(attr)); } ap = rm_search(dependent_config, res); if (ap != NULL) { return(ap->c_u.c_func(attr)); } rm_errno = RM_ERR_UNKNOWN; return(NULL); } /* END dependent() */ void DIS_rpp_reset(void) { if (dis_getc != rpp_getc) { dis_getc = rpp_getc; dis_puts = (int (*) A_((int, const char *, size_t)))rpp_write; dis_gets = (int (*) A_((int, char *, size_t)))rpp_read; disr_skip = (int (*) A_((int, size_t)))rpp_skip; disr_commit = rpp_rcommit; disw_commit = rpp_wcommit; } return; } /* END DIS_rpp_reset() */ /* ** Initialize standard resource array */ void initialize(void) { char *id = "initialize"; log_record(PBSEVENT_SYSTEM, 0, id, "independent"); dep_initialize(); return; } void cleanup(void) { dep_cleanup(); return; } /* ** Clean up after a signal. */ void die( int sig) { char *id = "die"; if (sig > 0) { sprintf(log_buffer, "caught signal %d", sig); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } else { log_record(PBSEVENT_SYSTEM, 0, id, "abnormal termination"); } cleanup(); log_close(1); exit(1); } /* END die() */ /* ** Check for fatal memory allocation error. */ void memcheck( char *buf) { if (buf != NULL) { return; } log_err(-1, "memcheck", "memory allocation failed"); die(0); return; } /* END memcheck() */ /* ** Check the ret_string buffer to make sure that there is ** enought room starting at *spot to hold len characters more. ** If not, realloc the buffer and make *spot point to ** the corresponding place that it used to point to in ** the old buffer. */ void checkret( char **spot, int len) { char *id = "checkret"; char *hold; if ((*spot - ret_string) < (ret_size - len)) { return; } ret_size += len * 2; /* new buf size */ sprintf(log_buffer, "size increased to %d", ret_size); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); hold = realloc(ret_string, ret_size); /* new buf */ memcheck(hold); *spot = *spot - ret_string + hold; /* new spot in buf */ ret_string = hold; return; } /* END checkret() */ char *skipwhite( char *str) { for (;*str;str++) { if (!isspace(*str)) break; } return(str); } char *tokcpy( char *str, char *tok) { for (;*str;str++, tok++) { if (!isalnum(*str) && *str != ':' && *str != '_') break; *tok = *str; } /* END tokcpy() */ *tok = '\0'; return(str); } /* END tokcpy() */ void rmnl( char *str) { int i; i = strlen(str); while (--i) { if ((*(str + i) != '\n') && !isspace((int)*(str + i))) break; *(str + i) = '\0'; } return; } u_long addclient( char *name) /* I */ { static char id[] = "addclient"; struct hostent *host; struct in_addr saddr; u_long ipaddr; /* FIXME: must be able to retry failed lookups later */ if ((host = gethostbyname(name)) == NULL) { sprintf(log_buffer, "host %s not found", name); log_err(-1, id, log_buffer); return(0); } memcpy(&saddr, host->h_addr, host->h_length); ipaddr = ntohl(saddr.s_addr); tinsert(ipaddr, NULL, &okclients); return(ipaddr); } /* END addclient() */ static u_long setpbsclient( char *value) /* I */ { u_long rc; if ((value == NULL) || (value[0] == '\0')) { /* FAILURE */ return(1); } rc = addclient(value); if (rc != 0) { /* FAILURE */ return(1); } return(0); } /* END setpbsclient() */ /* FIXME: we need to handle a non-default port number */ static u_long setpbsserver( char *value) /* I */ { static char id[] = "setpbsserver"; if ((value == NULL) || (*value == '\0')) { return(1); /* FAILURE - nothing specified */ } log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, value); return(mom_server_add(value)); } /* END setpbsserver() */ static u_long settmpdir( char *Value) { static char id[] = "settmpdir"; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, Value); if (*Value != '/') { log_err(-1, id, "tmpdir must be a full path"); return(0); } strncpy(tmpdir_basename, Value, sizeof(tmpdir_basename)); return(1); } static u_long setxauthpath( char *Value) { static char id[] = "setxauthpath"; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, Value); if (*Value != '/') { log_err(-1, id, "xauthpath must be a full path"); return(0); } strncpy(xauth_path, Value, sizeof(xauth_path)); return(1); } static u_long setrcpcmd( char *Value) /* I */ { static char id[] = "rcpcmd"; static char *ptr; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, Value); if (*Value != '/') { log_err(-1, id, "rcpcmd must be a full path"); /* FAILURE */ return(0); } strncpy(rcp_path, Value, sizeof(rcp_path)); strcpy(rcp_args, ""); if ((ptr = strchr(rcp_path, ' ')) != NULL) { *ptr = '\0'; if (*(ptr + 1) != '\0') { strncpy(rcp_args, ptr + 1, sizeof(rcp_args)); } } /* SUCCESS */ return(1); } /* END setrcpcmd() */ static u_long setlogevent( char *value) { char *bad; *log_event_mask = strtol(value, &bad, 0); if ((*bad == '\0') || isspace((int)*bad)) { return(1); } return(0); } /* END setlogevent() */ /* NOTE: maskclient is global */ static u_long restricted( char *name) { static char id[] = "restricted"; char **tmpMaskClient; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, name); if (mask_max == 0) { if ((maskclient = (char **)calloc(4, sizeof(char *))) == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,id,"cannot alloc memory"); return(-1); } mask_max = 4; } maskclient[mask_num] = strdup(name); if (maskclient[mask_num] == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,id,"cannot alloc memory"); return(-1); } mask_num++; if (mask_num == mask_max) { mask_max *= 2; tmpMaskClient = (char **)realloc( maskclient, mask_max * sizeof(char *)); if (tmpMaskClient == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,id,"cannot alloc memory"); return(-1); } maskclient = tmpMaskClient; } /* SUCCESS */ return(1); } /* END restricted() */ static u_long configversion( char *Value) /* I */ { static char id[] = "configversion"; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, Value); if (Value == NULL) { /* FAILURE */ return(0); } strncpy(MOMConfigVersion, Value, sizeof(MOMConfigVersion)); /* SUCCESS */ return(1); } /* END configversion() */ static u_long setdownonerror( char *Value) /* I */ { static char id[] = "setdownonerror"; int enable = -1; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, Value); if (Value == NULL) { /* FAILURE */ return(0); } /* accept various forms of "true", "yes", and "1" */ switch (Value[0]) { case 't': case 'T': case 'y': case 'Y': case '1': enable = 1; break; case 'f': case 'F': case 'n': case 'N': case '0': enable = 0; break; } if (enable != -1) { MOMConfigDownOnError = enable; } return(1); } /* END setdownonerror() */ static u_long setenablemomrestart( char *Value) /* I */ { static char id[] = "setenablemomrestart"; int enable = -1; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, Value); if (Value == NULL) { /* FAILURE */ return(0); } /* accept various forms of "true", "yes", and "1" */ switch (Value[0]) { case 't': case 'T': case 'y': case 'Y': case '1': enable = 1; break; case 'f': case 'F': case 'n': case 'N': case '0': enable = 0; break; } if (enable != -1) { MOMConfigRestart = enable; } return(1); } /* END setenablemomrestart() */ static u_long cputmult( char *value) /* I */ { static char id[] = "cputmult"; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, value); if ((cputfactor = atof(value)) == 0.0) { return(0); /* error */ } return(1); } /* END cputmult() */ static u_long wallmult( char *value) { static char id[] = "wallmult"; double tmpD; if (value == NULL) { /* FAILURE */ return(0); } log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, value); tmpD = atof(value); if ((tmpD == 0.0) && (value[0] != '\0')) { /* FAILURE */ return(0); } /* SUCCESS */ wallfactor = tmpD; return(1); } /* END wallmult() */ static u_long usecp( char *value) /* I */ { char *pnxt; static int cphosts_max = 0; struct cphosts *newp = NULL; static char *id = "usecp"; /* FORMAT: : */ /* * HvB and Willem added this for logging purpose */ log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, value); if (cphosts_max == 0) { pcphosts = malloc(2 * sizeof(struct cphosts)); if (pcphosts == NULL) { sprintf(log_buffer, "%s: out of memory while allocating pcphosts", id); log_err(-1, id, log_buffer); return(0); } cphosts_max = 2; } else if (cphosts_max == cphosts_num) { newp = realloc( pcphosts, (cphosts_max + 2) * sizeof(struct cphosts)); if (newp == NULL) { /* FAILURE */ sprintf(log_buffer,"%s: out of memory while reallocating pcphosts", id); log_err(-1,id,log_buffer); return(0); } pcphosts = newp; cphosts_max += 2; } pnxt = strchr(value, (int)':'); if (pnxt == NULL) { /* request failed */ sprintf(log_buffer, "invalid host specification: %s", value); log_err(-1, id, log_buffer); return(0); } *pnxt++ = '\0'; pcphosts[cphosts_num].cph_hosts = strdup(value); if (pcphosts[cphosts_num].cph_hosts == NULL) { /* FAILURE */ sprintf(log_buffer, "%s: out of memory in strdup(cph_hosts)", id); log_err(-1, id, log_buffer); return(0); } value = pnxt; /* now ptr to path */ while (!isspace(*pnxt)) { if (*pnxt == '\0') { sprintf(log_buffer, "invalid '%s' specification %s: " "missing destination path", id, value); log_err(-1, id, log_buffer); free(pcphosts[cphosts_num].cph_hosts); return(0); } pnxt++; } *pnxt++ = '\0'; pcphosts[cphosts_num].cph_from = strdup(value); if (pcphosts[cphosts_num].cph_from == NULL) { sprintf(log_buffer, "%s: out of memory in strdup(cph_from)", id); log_err(-1, id, log_buffer); free(pcphosts[cphosts_num].cph_hosts); return(0); } pcphosts[cphosts_num].cph_to = strdup(skipwhite(pnxt)); if (pcphosts[cphosts_num].cph_to == NULL) { sprintf(log_buffer, "%s: out of memory in strdup(cph_to)", id); log_err(-1, id, log_buffer); free(pcphosts[cphosts_num].cph_hosts); free(pcphosts[cphosts_num].cph_from); return(0); } cphosts_num++; return(1); } /* END usecp() */ static unsigned long prologalarm( char *value) /* I */ { int i; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "prologalarm", value); i = (int)atoi(value); if (i <= 0) { return(0); /* error */ } pe_alarm_time = (unsigned int)i; return(1); } /* END prologalarm() */ static unsigned long setloglevel( char *value) /* I */ { int i; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setloglevel", value); i = (int)atoi(value); if (i < 0) { return(0); /* error */ } LOGLEVEL = (unsigned int)i; return(1); } /* END setloglevel() */ static unsigned long setumask( char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setumask", value); strncpy(DEFAULT_UMASK, value, sizeof(DEFAULT_UMASK)); return(1); } /* END setumask() */ static unsigned long setpreexec( char *value) /* I */ { #if SHELL_USE_ARGV == 0 static char *id = "setpreexec"; #endif log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setpreexec", value); strncpy(PRE_EXEC, value, sizeof(PRE_EXEC)); #if SHELL_USE_ARGV == 0 log_err(0, id, "pbs_mom not configured with enable-shell-user-argv option"); #endif return(1); } /* END setpreexec() */ static unsigned long setsourceloginbatch( char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setsourceloginbatch", value); if (value[0] != '\0') { /* accept various forms of "true", "yes", and "1" */ switch (value[0]) { case 't': case 'T': case 'y': case 'Y': case '1': src_login_batch = TRUE; break; case 'f': case 'F': case 'n': case 'N': case '0': src_login_batch = FALSE; break; default: sprintf(log_buffer, "Unknown value of %s", value); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setsourceloginbatch", log_buffer); break; } } return(1); } /* END setsourceloginbatch() */ static unsigned long setsourcelogininteractive( char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setsourcelogininteractive", value); if (value[0] != '\0') { /* accept various forms of "true", "yes", and "1" */ switch (value[0]) { case 't': case 'T': case 'y': case 'Y': case '1': src_login_interactive = TRUE; break; case 'f': case 'F': case 'n': case 'N': case '0': src_login_interactive = FALSE; break; default: sprintf(log_buffer, "Unknown value of %s", value); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setsourcelogininteractive", log_buffer); break; } } return(1); } /* END setsourcelogininteractive() */ static unsigned long jobstartblocktime( char *value) /* I */ { int i; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "startblocktime", value); i = (int)strtol(value, NULL, 10); if ((i < 0) || ((i == 0) && (value[0] != '0'))) { return(0); /* error */ } TJobStartBlockTime = i; return(1); } /* END jobstartblocktime() */ static unsigned long setstatusupdatetime( char *value) /* I */ { int i; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setstateuspdatetime", value); i = (int)strtol(value, NULL, 10); if (i < 1) { return(0); /* error */ } ServerStatUpdateInterval = (unsigned int)i; return(1); } /* END setstatusupdatetime() */ static unsigned long setcheckpolltime( char *value) /* I */ { int i; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setcheckpolltime", value); i = (int)strtol(value, NULL, 10); if (i < 1) { return(0); /* error */ } CheckPollTime = (unsigned int)i; return(1); } /* END setcheckpolltime() */ /* ** Add static resource or shell escape line from config file. ** This is a support routine for read_config(). */ static void add_static( char *str, /* I */ char *file, /* I */ int linenum) /* I */ { int i; char name[50]; struct config_list *cp; str = tokcpy(str, name); /* resource name */ str = skipwhite(str); /* resource value */ /* FORMAT: [!] */ if (*str == '!') /* shell escape command */ { /* remove trailing newline */ rmnl(str); } else { /* get the value */ i = strlen(str); while (--i) { /* strip trailing blanks */ if (!isspace((int)*(str + i))) break; *(str + i) = '\0'; } } cp = (struct config_list *)malloc(sizeof(struct config_list)); memcheck((char *)cp); cp->c_link = config_list; cp->c.c_name = strdup(name); memcheck(cp->c.c_name); cp->c.c_u.c_value = strdup(str); memcheck(cp->c.c_u.c_value); sprintf(log_buffer, "%s[%d] add name %s value %s", file, linenum, name, str); log_record( PBSEVENT_DEBUG, 0, "add_static", log_buffer); config_list = cp; return; } /* END add_static() */ static unsigned long setidealload( char *value) { char newstr[50] = "ideal_load "; float val; val = atof(value); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "ideal_load", value); if (val < 0.0) { return(0); /* error */ } ideal_load_val = val; if (max_load_val < 0.0) max_load_val = val; /* set a default */ strcat(newstr, value); return(1); } /* END setidealload() */ static unsigned long setignwalltime( char *value) /* I */ { char newstr[50] = "ignwalltime "; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "ignwalltime", value); if (!strncasecmp(value, "t", 1) || (value[0] == '1') || !strcasecmp(value, "on")) { ignwalltime = 1; } else { ignwalltime = 0; } strcat(newstr, value); /* SUCCESS */ return(1); } /* END setignwalltime() */ static unsigned long setignmem( char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "ignmem", value); if (!strncasecmp(value,"t",1) || (value[0] == '1') || !strcasecmp(value,"on") ) ignmem = 1; else ignmem = 0; return(1); } /* END setignmem() */ static unsigned long setigncput( char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "igncput", value); if (!strncasecmp(value,"t",1) || (value[0] == '1') || !strcasecmp(value,"on") ) igncput = 1; else igncput = 0; return(1); } static unsigned long setignvmem( char *value) /* I */ { char newstr[50] = "setignvmem "; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setignvmem", value); if (!strncasecmp(value, "t", 1) || (value[0] == '1') || !strcasecmp(value, "on")) { ignvmem = 1; } else { ignvmem = 0; } strcat(newstr, value); /* SUCCESS */ return(1); } /* END setignvmem() */ static unsigned long setautoidealload( char *value) { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "auto_ideal_load", value); auto_ideal_load = strdup(value); /* add_static(auto_ideal_load,"config",0); nconfig++; */ return(1); } /* END setautoidealload() */ static unsigned long setallocparcmd( char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "allocparcmd", value); AllocParCmd = strdup(value); return(1); } /* END setallocparcmd() */ static unsigned long setautomaxload( char *value) { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "auto_max_load", value); auto_max_load = strdup(value); /* add_static(auto_ideal_load,"config",0); nconfig++; */ return(1); } /* END setautomaxload() */ static unsigned long setmaxconnecttimeout( char *value) /* I */ { MaxConnectTimeout = strtol(value, NULL, 10); if (MaxConnectTimeout < 0) { MaxConnectTimeout = 10000; return(0); } return(1); } static unsigned long setnodecheckscript( char *value) { char newstr[1024] = "node_check_script "; struct stat sbuf; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "node_check_script", value); if ((stat(value, &sbuf) == -1) || !(sbuf.st_mode & S_IXUSR)) { /* FAILURE */ /* file does not exist or is not executable */ return(0); } strncpy(PBSNodeCheckPath, value, sizeof(PBSNodeCheckPath)); strcat(newstr, value); /* SUCCESS */ return(1); } /* END setnodecheckscript() */ static unsigned long setnodecheckinterval( char *value) { char newstr[1024] = "node_check_interval "; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "node_check_interval", value); PBSNodeCheckInterval = (int)strtol(value, NULL, 10); if (strstr(value, "jobstart")) PBSNodeCheckProlog = 1; if (strstr(value, "jobend")) PBSNodeCheckEpilog = 1; strcat(newstr, value); return(1); } /* END setnodecheckinterval() */ static unsigned long settimeout( char *value) { char newstr[1024]; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "timeout", value); DIS_tcp_settimeout(strtol(value, NULL, 10)); snprintf(newstr, sizeof(newstr), "%s %s", "timeout", value); return(1); } /* END settimeout() */ static unsigned long setmaxload( char *value) /* I */ { char newstr[50] = "max_load "; float val; val = atof(value); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "max_load", value); if (val < 0.0) { return(0); /* error */ } max_load_val = val; if (ideal_load_val < 0.0) ideal_load_val = val; strcat(newstr, value); return(1); } /* END max_load() */ static unsigned long setlogfilemaxsize( char *value) /* I */ { log_file_max_size = strtol(value, NULL, 10); if (log_file_max_size < 0) { log_file_max_size = 0; return(0); } return(1); } static unsigned long setlogfilerolldepth( char *value) /* I */ { log_file_roll_depth = strtol(value, NULL, 10); if (log_file_roll_depth < 1) { log_file_roll_depth = 1; return(0); } return(1); } static unsigned long setlogdirectory( char *value) /* I */ { path_log = strdup(value); return(1); } static unsigned long setlogfilesuffix( char *value) /* I */ { log_init(value, NULL); return(1); } static unsigned long setlogkeepdays( char *value) /* I */ { int i; i = (int)atoi(value); if (i < 0) { return(0); /* error */ } LOGKEEPDAYS = i; return(1); } static u_long setvarattr( char *value) /* I */ { static char *id = "setvarattr"; struct varattr *pva; char *ptr; pva = calloc(1, sizeof(struct varattr)); if (pva == NULL) { /* FAILURE */ log_err(errno, id, "no memory"); return(0); } CLEAR_LINK(pva->va_link); /* FORMAT: */ /* extract TTL */ ptr = value; pva->va_ttl = strtol(ptr, NULL, 10); /* step forward to end of TTL */ while (!isspace(*ptr)) ptr++; if (*ptr == '\0') { free(pva); return(0); } /* skip white space */ while (isspace(*ptr)) ptr++; if (*ptr == '\0') { free(pva); return(0); } /* preserve command and args */ pva->va_cmd = strdup(ptr); append_link(&mom_varattrs, &pva->va_link, pva); /* SUCCESS */ return(1); } /* END setvarattr() */ static unsigned long setnodefilesuffix( char *value) /* I */ { char *ptr; ptr = strtok(value, ","); nodefile_suffix = strdup(ptr); ptr = strtok(NULL, ","); if (ptr != NULL) submithost_suffix = strdup(ptr); /* SUCCESS */ return(1); } /* END setnodexfilesuffix() */ static unsigned long setmomhost( char *value) /* I */ { hostname_specified = 1; strncpy(mom_host, value, PBS_MAXHOSTNAME); /* remember name */ /* SUCCESS */ return(1); } /* END setmomhost() */ static u_long setrreconfig( char *Value) /* I */ { static char id[] = "setrreconfig"; int enable = -1; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, Value); if (Value == NULL) { /* FAILURE */ return(0); } /* accept various forms of "true", "yes", and "1" */ switch (Value[0]) { case 't': case 'T': case 'y': case 'Y': case '1': enable = 1; break; case 'f': case 'F': case 'n': case 'N': case '0': enable = 0; break; } if (enable != -1) { MOMConfigRReconfig = enable; } return(1); } /* END setrreconfig() */ static unsigned long setnospooldirlist( char *value) /* I */ { char *TokPtr; char *ptr; int index = 0; char tmpLine[1024]; ptr = strtok_r(value, " \t\n:,", &TokPtr); while (ptr != NULL) { TNoSpoolDirList[index] = strdup(ptr); snprintf(tmpLine, sizeof(tmpLine), "added NoSpoolDir[%d] '%s'", index, ptr); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setnospooldirlist", tmpLine); index++; if (index >= TMAX_NSDCOUNT) break; ptr = strtok_r(NULL, " \t\n:,", &TokPtr); } /* END while (ptr != NULL) */ /* SUCCESS */ return(1); } /* END setnospooldirlist() */ static unsigned long setspoolasfinalname( char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "spoolasfinalname", value); if (!strncasecmp(value,"t",1) || (value[0] == '1') || !strcasecmp(value,"on") ) spoolasfinalname = 1; else spoolasfinalname = 0; return(1); } /* END setspoolasfinalname() */ static unsigned long setkilldelay( char *value) { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setkilldelay", value); if ((!strncasecmp(value,"t",1)) || (value[0] == '1') || (!strcasecmp(value,"on"))) killdelay = 1; else killdelay = 0; return(1); } /* END setkilldelay() */ static unsigned long setremchkptdirlist( char *value) /* I */ { char *TokPtr; char *ptr; int index = 0; char tmpLine[1024]; while ((TRemChkptDirList[index] != NULL) && (index < TMAX_RCDCOUNT)) { index++; } if (index >= TMAX_RCDCOUNT) return (1); ptr = strtok_r(value, " \t\n:,", &TokPtr); while (ptr != NULL) { TRemChkptDirList[index] = strdup(ptr); snprintf(tmpLine, sizeof(tmpLine), "added RemChkptDir[%d] '%s'", index, ptr); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "setremchkptdirlist", tmpLine); index++; if (index >= TMAX_RCDCOUNT) break; ptr = strtok_r(NULL, " \t\n:,", &TokPtr); } /* END while (ptr != NULL) */ /* SUCCESS */ return (1); } /* END setremchkptdirlist() */ void check_log(void) { last_log_check = time_now; /* periodically record the version and loglevel */ sprintf(log_buffer, msg_info_mom, PACKAGE_VERSION, LOGLEVEL); log_event( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); if (LOGKEEPDAYS > 0) { /* remove logs older than log_keep_days */ snprintf(log_buffer,sizeof(log_buffer),"checking for old pbs_mom logs in dir '%s' (older than %d days)", path_log, LOGKEEPDAYS); log_event( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); if (log_remove_old(path_log,(LOGKEEPDAYS * SECS_PER_DAY)) != 0) { log_err(-1,"check_log","failure occurred when checking for old pbs_mom logs"); } } if (log_file_max_size <= 0) { return; } if (log_size() >= log_file_max_size) { log_event( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, "Rolling log file"); log_roll(log_file_roll_depth); } return; } /* END check_log() */ /* ** Open and read the config file. Save information in a linked ** list. After reading the file, create an array, copy the list ** elements to the array and free the list. */ /* NOTE: add new mom config parameters to 'special[]' */ int read_config( char *file) /* I */ { static char id[] = "read_config"; FILE *conf; struct stat sb; struct config_list *cp; struct config *ap; char line[120]; char name[50]; char *str; char *ptr; int linenum; int i; int IgnConfig = 0; int rc; int n, list_len; char *server_list_ptr; char *tp; if (LOGLEVEL >= 3) { sprintf(log_buffer, "updating configuration using file '%s'", (file != NULL) ? file : "NULL"); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } for (i = 0;i < mask_num;i++) { free(maskclient[i]); } mask_num = 0; if (file == NULL) file = config_file; rc = 0; if (file[0] == '\0') { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "ALERT: no config file specified"); IgnConfig = 1; /* no config file */ } if ((IgnConfig == 0) && (stat(file, &sb) == -1)) { IgnConfig = 1; sprintf(log_buffer, "fstat: %s", file); log_err(errno, id, log_buffer); if (config_file_specified != 0) { /* file specified and not there, return failure */ log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "ALERT: cannot open config file - no file"); rc = 1; } else { /* "config" file not located, return success */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "cannot open file '%s'", file); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } rc = 0; } } /* END if ((IgnConfig == 0) && (stat(file,&sb) == -1)) */ if (IgnConfig == 0) { #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) if (chk_file_sec(file, 0, 0, S_IWGRP | S_IWOTH, 1, NULL)) { /* not authorized to access specified file, return failure */ log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "ALERT: cannot open config file - permissions"); IgnConfig = 1; rc = 1; } #endif /* NO_SECURITY_CHECK */ } /* END if (ignConfig == 0) */ if (IgnConfig == 0) { if ((conf = fopen(file, "r")) == NULL) { sprintf(log_buffer, "fopen: %s", file); log_err(errno, id, log_buffer); IgnConfig = 1; rc = 1; } } /* END if (IgnConfig == 0) */ if (IgnConfig == 0) { nconfig = 0; linenum = 0; while (fgets(line, sizeof(line), conf)) { linenum++; if (line[0] == '#') /* comment */ continue; if ((ptr = strchr(line, '#')) != NULL) { /* allow inline comments */ *ptr = '\0'; } str = skipwhite(line); /* pass over initial whitespace */ if (*str == '\0') continue; if (LOGLEVEL >= 6) { sprintf(log_buffer, "processing config line '%.64s'", str); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if (*str == '$') { /* special command */ str = tokcpy(++str, name); /* resource name */ for (i = 0;special[i].name;i++) { if (strcasecmp(name, special[i].name) == 0) break; } /* END for (i) */ if (special[i].name == NULL) { /* didn't find it */ sprintf(log_buffer, "special command name %s not found (ignoring line)", name); log_err(-1, id, log_buffer); continue; } str = skipwhite(str); /* command param */ rmnl(str); if (special[i].handler(str) == 0) { sprintf(log_buffer, "%s[%d] special command %s failed with %s", file, linenum, name, str); log_err(-1, id, log_buffer); } continue; } add_static(str, file, linenum); nconfig++; } /* END while (fgets()) */ /* ** Create a new array. */ if (config_array != NULL) { for (ap = config_array;ap->c_name != NULL;ap++) { free(ap->c_name); free(ap->c_u.c_value); } free(config_array); } config_array = (struct config *)calloc(nconfig + 1, sizeof(struct config)); memcheck((char *)config_array); /* ** Copy in the new information saved from the file. */ for (i = 0, ap = config_array;i < nconfig;i++, ap++) { *ap = config_list->c; cp = config_list->c_link; free(config_list); /* don't free name and value strings */ config_list = cp; /* they carry over from the list */ } ap->c_name = NULL; /* one extra */ fclose(conf); } /* END if (IgnConfig == 0) */ if (mom_server_count == 0) { /* No server names in torque/mom_priv/config. Get names from torque/server_name. */ server_list_ptr = pbs_get_server_list(); list_len = csv_length(server_list_ptr); for (n = 0; n < list_len; n++) { tp = csv_nth(server_list_ptr, n); if (tp) { setpbsserver(tp); } } } return(rc); } /* END read_config() */ /* ** Get an rm_attribute structure from a string. If a NULL is passed ** for the string, use the previously remembered string. */ struct rm_attribute *momgetattr( char *str) /* I */ { char *id = "momgetattr"; static char cookie[] = "tag:"; /* rm_attribute to ignore */ static char *hold = NULL; static char qual[80] = ""; static char valu[4096] = ""; static struct rm_attribute attr = { qual, valu }; int level, i; if (str == NULL) /* if NULL is passed, use prev value */ str = hold; /* FORMAT: ??? */ do { str = skipwhite(str); if (*str++ != '[') { return(NULL); } str = skipwhite(str); /* copy qualifier */ str = tokcpy(str, qual); str = skipwhite(str); if (*str++ != '=') { return(NULL); } level = 0; for (i = 0;*str;str++, i++) { if (*str == '[') { level++; } else if (*str == ']') { if (level == 0) break; level--; } valu[i] = *str; } if (*str++ != ']') { return(NULL); } valu[i] = '\0'; if (LOGLEVEL >= 7) { sprintf(log_buffer, "found %s = %s", qual, valu); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, log_buffer); } } while (strncmp(qual, cookie, sizeof(cookie) - 1) == 0); hold = str; if (LOGLEVEL >= 5) { sprintf(log_buffer, "passing back %s = %s", qual, valu); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, log_buffer); } return(&attr); } /* END momgetattr() */ /* ** Check the request against the format of the line read from ** the config file. If it is a static value, there should be ** no params. If it is a shell escape, the parameters (if any) ** should match the command line for the system call. */ char *conf_res( char *resline, /* I */ struct rm_attribute *attr) /* I */ { char *id = "conf_res"; char *name[RM_NPARM]; char *value[RM_NPARM]; int used[RM_NPARM]; /* (boolean) */ char param[80], *d; int i, fd, len; FILE *child; char *child_spot; int child_len; if (resline == NULL) { return(""); } if (resline[0] != '!') { /* static value */ if (attr != NULL) { sprintf(ret_string, "? %d", RM_ERR_BADPARAM); return(ret_string); } return(resline); } /* ** From here on we are going to put together a shell command ** to do the requestor's bidding. Parameter substitution ** is the first step. */ for (i = 0;i < RM_NPARM;i++) { /* remember params */ if (attr == NULL) { /* FAILURE */ break; } name[i] = strdup(attr->a_qualifier); memcheck(name[i]); value[i] = strdup(attr->a_value); memcheck(value[i]); used[i] = 0; attr = momgetattr(NULL); } /* END for (i) */ if (attr != NULL) { /* too many params */ log_err(-1, id, "too many params"); sprintf(ret_string, "? %d", RM_ERR_BADPARAM); goto done; } name[i] = NULL; for (d = ret_string, resline++;*resline;) { /* scan command */ if (*resline == '%') { /* possible token */ char *hold; hold = tokcpy(resline + 1, param); for (i = 0;name[i];i++) { if (strcmp(param, name[i]) == 0) break; } if (name[i]) { /* found a match */ char *x = value[i]; while (*x) { *d++ = *x++; } resline = hold; used[i] = 1; } else { *d++ = *resline++; } } else { *d++ = *resline++; } } for (i = 0;name[i];i++) { if (!used[i]) { /* parameter sent but not used */ log_err(-1, id, "unused parameters"); sprintf(ret_string, "? %d", RM_ERR_BADPARAM); goto done; } } /* END for (i) */ *d = '\0'; DBPRT(("command: %s\n", ret_string)) if ((child = popen(ret_string, "r")) == NULL) { log_err(errno, id, "popen"); sprintf(ret_string, "? %d", RM_ERR_SYSTEM); goto done; } fd = fileno(child); child_spot = ret_string; child_len = 0; child_spot[0] = '\0'; retryread: while ((len = read(fd, child_spot, ret_size - child_len)) > 0) { for (i = 0;i < len;i++) { if (child_spot[i] == '\n') break; } if (i < len) { /* found newline */ child_len += i + 1; break; } child_len += len; child_spot += len; checkret(&child_spot, len); } if (len == -1) { if (errno == EINTR) { goto retryread; } log_err(errno, id, "pipe read"); sprintf(ret_string, "? %d", RM_ERR_SYSTEM); fclose(child); goto done; } pclose(child); if (child_len > 0) ret_string[child_len - 1] = '\0'; /* hack off newline */ done: for (i = 0;name[i] != NULL;i++) { /* free up params */ free(name[i]); free(value[i]); } /* END for (i) */ return(ret_string); } /* END conf_res() */ static void catch_abort( int sig) { struct rlimit rlimit; /* * Reset ourselves to the default signal handler to try and * prevent recursive core dumps. */ struct sigaction act; sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_DFL; sigaction(SIGSEGV, &act, NULL); sigaction(SIGBUS, &act, NULL); sigaction(SIGFPE, &act, NULL); sigaction(SIGILL, &act, NULL); sigaction(SIGTRAP, &act, NULL); sigaction(SIGSYS, &act, NULL); log_err(sig, "mom_main", "Caught fatal core signal"); rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CORE, &rlimit); abort(); return; } /* END catch_abort() */ static void catch_hup( int sig) { sprintf(log_buffer, "caught signal %d", sig); log_record(PBSEVENT_SYSTEM, 0, "catch_hup", "reset"); call_hup = 1; rpp_dbprt = 1 - rpp_dbprt; /* toggle debug prints for RPP */ return; } /* END catch_hup() */ /* * Do a restart of resmom. * Read the last seen config file and * Clean up and reinit the dependent code. */ static void process_hup(void) { char *id = "process_hup"; call_hup = 0; log_record(PBSEVENT_SYSTEM, 0, id, "reset"); log_close(1); log_open(log_file, path_log); log_file_max_size = 0; log_file_roll_depth = 1; read_config(NULL); check_log(); cleanup(); initialize(); return; } /* END process_hup() */ /* ** Got an alarm call. ** Close all general network connections, clean up and reinit the ** dependent code. */ void toolong( int sig) { char *id = "toolong"; log_record(PBSEVENT_SYSTEM, 0, id, "alarm call"); if (LOGLEVEL >= 1) DBPRT(("alarm call\n")) return; } /* END toolong() */ #ifdef DEBUG void log_verbose( char *id, char *buf, int len) { int i; char *cp; len = MIN(len, 50); cp = log_buffer; for (i = 0;i < len;i++) { int c = buf[i]; if (isprint(c)) { *cp++ = c; } else { sprintf(cp, "(%d)", c); cp += strlen(cp); } } *cp = '\0'; log_record(PBSEVENT_DEBUG, 0, id, log_buffer); return; } /* END log_verbose() */ #else #define log_verbose(a, b, c) #endif /* ** See if an IP address matches any names stored as "restricted" ** access hosts. Return 0 if a name matches, 1 if not. */ int bad_restrict( u_long ipadd) { struct hostent *host; struct in_addr in; int i, len1, len2; char *cp1, *cp2; in.s_addr = htonl(ipadd); if ((host = gethostbyaddr( (void *) & in, sizeof(struct in_addr), AF_INET)) == NULL) { return(1); } len1 = strlen(host->h_name) - 1; for (i = 0;i < mask_num;i++) { len2 = strlen(maskclient[i]) - 1; if (len1 < len2) continue; cp1 = &host->h_name[len1]; cp2 = &maskclient[i][len2]; /* check case insensitve */ while ((len2 >= 0) && (tolower(*cp1) == tolower(*cp2))) { cp1--; cp2--; len2--; } /* END while () */ if (((len2 == 0) && (*cp2 == '*')) || (len2 == -1)) { return(0); } } /* END for (i) */ return(1); } /* END bad_restrict() */ /* * mom_lock - lock out other MOMs from this directory. */ static void mom_lock( int fds, int op) /* F_WRLCK or F_UNLCK */ { struct flock flock; flock.l_type = op; flock.l_whence = SEEK_SET; flock.l_start = 0; flock.l_len = 0; /* whole file */ if (fcntl(fds, F_SETLK, &flock) < 0) { char tmpPath[256]; tmpPath[0] = '\0'; if (getcwd(tmpPath, sizeof(tmpPath)) == NULL) tmpPath[0] = '\0'; sprintf(log_buffer, "cannot lock '%s/mom.lock' - another mom running", (tmpPath[0] != '\0') ? tmpPath : "$MOM_HOME"); log_err(errno, msg_daemonname, log_buffer); fprintf(stderr, "%s\n", log_buffer); exit(1); } return; } /* END mom_lock() */ /* ** Process a request for the resource monitor. The i/o ** will take place using DIS over a tcp fd or an rpp stream. */ int rm_request( int iochan, int version, int tcp) /* I */ { static char id[] = "rm_request"; char name[100]; char output[BUFSIZ << 2]; int len; int command, ret; int restrictrm = 0; char *curr, *value, *cp, *body; struct config *ap; struct rm_attribute *attr; struct sockaddr_in *addr; unsigned long ipadd; u_short port; void (*close_io) A_((int)); int (*flush_io) A_((int)); extern struct connection svr_conn[]; int NotTrusted = 0; char *BPtr; int BSpace; errno = 0; log_buffer[0] = '\0'; if (tcp) { ipadd = svr_conn[iochan].cn_addr; port = svr_conn[iochan].cn_port; close_io = close_conn; flush_io = DIS_tcp_wflush; } else { addr = rpp_getaddr(iochan); ipadd = ntohl(addr->sin_addr.s_addr); port = ntohs((unsigned short)addr->sin_port); close_io = (void(*) A_((int)))rpp_close; flush_io = rpp_flush; } if (version != RM_PROTOCOL_VER) { sprintf(log_buffer, "protocol version %d unknown", version); goto bad; } if (((port_care != FALSE) && (port >= IPPORT_RESERVED)) || (tfind(ipadd, &okclients) == NULL)) { if (bad_restrict(ipadd)) { sprintf(log_buffer, "bad attempt to connect - unauthorized (port: %d)", port); NotTrusted = 1; goto bad; } restrictrm = 1; } /* looks okay, find out what command it is */ command = disrsi(iochan, &ret); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "no command %s", dis_emsg[ret]); goto bad; } switch (command) { case RM_CMD_CLOSE: /* no response to this */ close_io(iochan); return(1); /*NOTREACHED*/ break; case RM_CMD_REQUEST: /* query resource data */ reqnum++; ret = diswsi(iochan, RM_RSP_OK); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "write request response failed: %s", dis_emsg[ret]); goto bad; } for (;;) { cp = disrst(iochan, &ret); if (ret == DIS_EOD) { break; } if (ret != DIS_SUCCESS) { sprintf(log_buffer, "problem with request line: %s", dis_emsg[ret]); goto bad; } curr = skipwhite(cp); curr = tokcpy(curr, name); if (name[0] == '\0') { /* no name */ sprintf(output, "%s=? %d", cp, RM_ERR_UNKNOWN); } else { if (!strncasecmp(name, "clearjob", strlen("clearjob"))) { char *ptr = NULL; job *pjob = NULL, *pjobnext = NULL; if ((*curr == '=') && ((*curr) + 1 != '\0')) { ptr = curr + 1; } /* purge job if local */ if (ptr == NULL) { strcpy(output, "invalid clearjob request"); } else { char tmpLine[1024]; if (!strcasecmp(ptr, "all")) { if ((pjob = (job *)GET_NEXT(svr_alljobs)) != NULL) { while (pjob != NULL) { sprintf(tmpLine, "clearing job %s", pjob->ji_qs.ji_jobid); log_record(PBSEVENT_SYSTEM, 0, id, tmpLine); pjobnext = (job *)GET_NEXT(pjob->ji_alljobs); job_purge(pjob); pjob = pjobnext; strcat(output, tmpLine); strcat(output, "\n"); } } strcat(output, "clear completed"); } else if ((pjob = find_job(ptr)) != NULL) { sprintf(tmpLine, "clearing job %s", pjob->ji_qs.ji_jobid); log_record(PBSEVENT_SYSTEM, 0, id, tmpLine); job_purge(pjob); strcpy(output, tmpLine); } } } else if (!strncasecmp(name, "clearmsg", strlen("clearmsg"))) { /* clear rm messages */ PBSNodeMsgBuf[0] = '\0'; strcpy(output, "messages cleared"); log_record(PBSEVENT_SYSTEM, 0, id, "messages cleared"); } else if (!strncasecmp(name, "cycle", strlen("cycle"))) { /* force immediate cycle */ LastServerUpdateTime = 0; strcpy(output, "cycle forced"); log_record(PBSEVENT_SYSTEM, 0, id, "reporting cycle forced"); } else if (!strncasecmp(name, "status_update_time", strlen("status_update_time"))) { /* set or report status_update_time */ if ((*curr == '=') && ((*curr) + 1 != '\0')) { setstatusupdatetime(curr + 1); } sprintf(output, "status_update_time=%d", ServerStatUpdateInterval); } else if (!strncasecmp(name, "check_poll_time", strlen("check_poll_time"))) { /* set or report check_poll_time */ if ((*curr == '=') && ((*curr) + 1 != '\0')) { setcheckpolltime(curr + 1); } sprintf(output, "check_poll_time=%d", CheckPollTime); } else if (!strncasecmp(name, "jobstartblocktime", strlen("jobstartblocktime"))) { /* set or report jobstartblocktime */ if ((*curr == '=') && ((*curr) + 1 != '\0')) { jobstartblocktime(curr + 1); } sprintf(output, "jobstartblocktime=%ld", TJobStartBlockTime); } else if (!strncasecmp(name, "loglevel", strlen("loglevel"))) { /* set or report loglevel */ if ((*curr == '=') && ((*curr) + 1 != '\0')) { setloglevel(curr + 1); } sprintf(output, "loglevel=%d", LOGLEVEL); } else if (!strncasecmp(name, "down_on_error", strlen("down_on_error"))) { /* set or report down_on_error */ if ((*curr == '=') && ((*curr) + 1 != '\0')) { setdownonerror(curr + 1); } sprintf(output, "down_on_error=%d", MOMConfigDownOnError); } else if (!strncasecmp(name, "enablemomrestart", strlen("enablemomrestart"))) { /* set or report enablemomrestart */ if ((*curr == '=') && ((*curr) + 1 != '\0')) { setenablemomrestart(curr + 1); } sprintf(output, "enablemomrestart=%d", MOMConfigRestart); } else if (!strncasecmp(name, "rcpcmd", strlen("rcpcmd"))) { /* set or report rcp_path and rcp_args */ if ((*curr == '=') && ((*curr) + 1 != '\0')) { setrcpcmd(curr + 1); } sprintf(output, "rcpcmd=%s %s", rcp_path, rcp_args); } else if (!strncasecmp(name, "version", strlen("version"))) { /* report version */ sprintf(output, "version=%s", PACKAGE_VERSION); } else if ((!strncasecmp(name, "configversion", strlen("configversion"))) && (MOMConfigVersion[0] != '\0')) { /* report configversion */ sprintf(output, "configversion=%s", MOMConfigVersion); } else if (!strncasecmp(name, "diag", strlen("diag"))) { char tmpLine[1024]; char *ptr; int rc; time_t Now; job *pjob; struct varattr *pva; time(&Now); ptr = name + strlen("diag"); verbositylevel = (int)strtol(ptr, NULL, 10); output[0] = '\0'; BPtr = output; BSpace = sizeof(output); sprintf(tmpLine, "\nHost: %s/%s Version: %s PID: %ld\n", mom_short_name, mom_host, PACKAGE_VERSION, (long)getpid()); MUStrNCat(&BPtr, &BSpace, tmpLine); mom_server_all_diag(&BPtr, &BSpace); sprintf(tmpLine, "HomeDirectory: %s\n", (mom_home != NULL) ? mom_home : "N/A"); MUStrNCat(&BPtr, &BSpace, tmpLine); #ifdef HAVE_SYS_STATVFS_H { #include struct statvfs VFSStat; if (statvfs(path_spool, &VFSStat) < 0) { MUSNPrintF(&BPtr, &BSpace, "ALERT: cannot stat stdout/stderr spool directory '%s' (errno=%d) %s\n", path_spool, errno, strerror(errno)); } else { if (VFSStat.f_bavail > 0) { if (verbositylevel >= 1) MUSNPrintF(&BPtr, &BSpace, "stdout/stderr spool directory: '%s' (%d blocks available)\n", path_spool, VFSStat.f_bavail); } else { MUSNPrintF(&BPtr, &BSpace, "ALERT: stdout/stderr spool directory '%s' is full\n", path_spool); } } } /* END BLOCK */ #endif /* HAVE_SYS_STATVFS_H */ if (MOMConfigVersion[0] != '\0') { sprintf(tmpLine, "ConfigVersion: %s\n", MOMConfigVersion); MUStrNCat(&BPtr, &BSpace, tmpLine); } if (verbositylevel >= 3) { #if SYSLOG MUStrNCat(&BPtr, &BSpace, "NOTE: syslog enabled\n"); #else /* SYSLOG */ MUStrNCat(&BPtr, &BSpace, "NOTE: syslog not enabled (use 'configure --enable-syslog' to enable)\n"); #endif /* SYSLOG */ } if (verbositylevel >= 3) { if (PBSNodeCheckPath[0] != '\0') { sprintf(tmpLine, "Node Health Check Script: %s (%d second update interval)\n", PBSNodeCheckPath, PBSNodeCheckInterval * ServerStatUpdateInterval); MUStrNCat(&BPtr, &BSpace, tmpLine); } } sprintf(tmpLine, "MOM active: %ld seconds\n", (long)Now - MOMStartTime); MUStrNCat(&BPtr, &BSpace, tmpLine); if (verbositylevel >= 1) { sprintf(tmpLine, "Check Poll Time: %d seconds\n", CheckPollTime); MUStrNCat(&BPtr, &BSpace, tmpLine); sprintf(tmpLine, "Server Update Interval: %d seconds\n", ServerStatUpdateInterval); MUStrNCat(&BPtr, &BSpace, tmpLine); } if (PBSNodeMsgBuf[0] != '\0') { sprintf(tmpLine, "MOM Message: %s (use 'momctl -q clearmsg' to clear)\n", PBSNodeMsgBuf); MUStrNCat(&BPtr, &BSpace, tmpLine); } if (MOMUNameMissing[0] != '\0') { sprintf(tmpLine, "WARNING: passwd file is corrupt (job requests user '%s' - not found in local passwd file)\n", MOMUNameMissing); MUStrNCat(&BPtr, &BSpace, tmpLine); } if (MOMPrologTimeoutCount > 0) { sprintf(tmpLine, "WARNING: %d prolog timeouts (%d seconds) detected since start up - increase $prologalarm or investigate prolog\n", MOMPrologTimeoutCount, pe_alarm_time); MUStrNCat(&BPtr, &BSpace, tmpLine); } if (MOMPrologFailureCount > 0) { sprintf(tmpLine, "WARNING: %d prolog failures detected since start up - investigate prolog\n", MOMPrologFailureCount); MUStrNCat(&BPtr, &BSpace, tmpLine); } sprintf(tmpLine, "LogLevel: %d (use SIGUSR1/SIGUSR2 to adjust)\n", LOGLEVEL); MUStrNCat(&BPtr, &BSpace, tmpLine); if (verbositylevel >= 1) { #if RPP sprintf(tmpLine, "Communication Model: %s\n", "RPP"); #else /* RPP */ sprintf(tmpLine, "Communication Model: %s\n", "TCP"); #endif /* RPP */ MUStrNCat(&BPtr, &BSpace, tmpLine); if ((MOMIsLocked == 1) || (MOMIsPLocked == 1) || (verbositylevel >= 4)) { sprintf(tmpLine, "MemLocked: %s", (MOMIsLocked == 0) ? "FALSE" : "TRUE"); if (MOMIsLocked == 1) strcat(tmpLine, " (mlock)"); if (MOMIsPLocked == 1) strcat(tmpLine, " (plocked)"); strcat(tmpLine, "\n"); MUStrNCat(&BPtr, &BSpace, tmpLine); } } /* END if (verbositylevel >= 1) */ if ((verbositylevel >= 1) && (pbs_tcp_timeout > 0)) { sprintf(tmpLine, "TCP Timeout: %d seconds\n", (int)pbs_tcp_timeout); MUStrNCat(&BPtr, &BSpace, tmpLine); } if (verbositylevel >= 1) { struct stat s; int prologfound = 0; if (stat(path_prolog, &s) != -1) { MUSNPrintF(&BPtr, &BSpace, "Prolog: %s (enabled)\n", path_prolog); prologfound = 1; } else if (verbositylevel >= 2) { MUSNPrintF(&BPtr, &BSpace, "Prolog: %s (disabled)\n", path_prolog); } if (stat(path_prologp, &s) != -1) { MUSNPrintF(&BPtr, &BSpace, "Parallel Prolog: %s (enabled)\n", path_prologp); prologfound = 1; } if (prologfound == 1) { sprintf(tmpLine, "Prolog Alarm Time: %d seconds\n", pe_alarm_time); MUStrNCat(&BPtr, &BSpace, tmpLine); } } if (verbositylevel >= 2) { /* check alarm */ rc = alarm(alarm_time); alarm(rc); sprintf(tmpLine, "Alarm Time: %d of %d seconds\n", rc, alarm_time); MUStrNCat(&BPtr, &BSpace, tmpLine); } if (verbositylevel >= 1) { /* display okclient list */ tmpLine[0] = '\0'; tlist(okclients, tmpLine, sizeof(tmpLine)); MUSNPrintF(&BPtr, &BSpace, "Trusted Client List: %s\n", tmpLine); } if (verbositylevel >= 1) { tmpLine[0] = '\0'; MUSNPrintF(&BPtr, &BSpace, "Copy Command: %s %s\n", rcp_path, rcp_args); } /* joblist */ if ((pjob = (job *)GET_NEXT(svr_alljobs)) == NULL) { sprintf(tmpLine, "NOTE: no local jobs detected\n"); MUStrNCat(&BPtr, &BSpace, tmpLine); } else { int numvnodes = 0; task *ptask; char SIDList[1024]; char *VPtr; /* job env variable value pointer */ char *SPtr; int SSpace; for (;pjob != NULL;pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { SPtr = SIDList; SSpace = sizeof(SIDList); SIDList[0] = '\0'; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { /* only check on tasks that we think should still be around */ if (ptask->ti_qs.ti_status != TI_STATE_RUNNING) continue; /* NOTE: on linux systems, the session master should have pid == sessionid */ MUSNPrintF(&SPtr, &SSpace, "%s%d", (SIDList[0] != '\0') ? "," : "", ptask->ti_qs.ti_sid); } /* END for (task) */ numvnodes += pjob->ji_numvnod; sprintf(tmpLine, "job[%s] state=%s sidlist=%s", pjob->ji_qs.ji_jobid, PJobSubState[pjob->ji_qs.ji_substate], SIDList); MUStrNCat(&BPtr, &BSpace, tmpLine); if (verbositylevel >= 4) { /* report job variables */ VPtr = get_job_envvar(pjob, "BATCH_PARTITION_ID"); if (VPtr != NULL) { sprintf(tmpLine, " BATCH_PARTITION_ID=%s", VPtr); MUStrNCat(&BPtr, &BSpace, tmpLine); } VPtr = get_job_envvar(pjob, "BATCH_ALLOC_COOKIE"); if (VPtr != NULL) { sprintf(tmpLine, " BATCH_ALLOC_COOKIE=%s", VPtr); MUStrNCat(&BPtr, &BSpace, tmpLine); } } /* END if (verbositylevel >= 4) */ MUStrNCat(&BPtr, &BSpace, "\n"); } /* END for (pjob) */ sprintf(tmpLine, "Assigned CPU Count: %d\n", numvnodes); MUStrNCat(&BPtr, &BSpace, tmpLine); } /* END else ((pjob = (job *)GET_NEXT(svr_alljobs)) == NULL) */ if ((pjob = (job *)GET_NEXT(svr_newjobs)) != NULL) { while (pjob != NULL) { sprintf(tmpLine, "job[%s] state=NEW\n", pjob->ji_qs.ji_jobid); MUStrNCat(&BPtr, &BSpace, tmpLine); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } if ((pva = (struct varattr *)GET_NEXT(mom_varattrs)) != NULL) { MUStrNCat(&BPtr, &BSpace, "Varattrs:\n"); while (pva != NULL) { sprintf(tmpLine, " ttl=%d last=%s cmd=%s\n value=%s\n\n", pva->va_ttl, ctime(&pva->va_lasttime), pva->va_cmd, (pva->va_value != NULL) ? pva->va_value : "NULL"); MUStrNCat(&BPtr, &BSpace, tmpLine); pva = (struct varattr *)GET_NEXT(pva->va_link); } } MUStrNCat(&BPtr, &BSpace, "\ndiagnostics complete\n"); log_record(PBSEVENT_SYSTEM, 0, id, "internal diagnostics complete"); } else { ap = rm_search(config_array, name); attr = momgetattr(curr); if (LOGLEVEL >= 3) log_record(PBSEVENT_SYSTEM, 0, id, "setting alarm in rm_request"); alarm(alarm_time); if ((ap != NULL) && !restrictrm) { /* static */ sprintf(output, "%s=%s", cp, conf_res(ap->c_u.c_value, attr)); } else { /* check dependent code */ log_buffer[0] = '\0'; value = dependent(name, attr); if (value != NULL) { sprintf(output, "%s=%s", cp, value); } else { /* not found anywhere */ sprintf(output, "%s=? %d", cp, rm_errno); } } alarm(0); } } /* END (name[0] == '\0') */ free(cp); ret = diswst(iochan, output); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "write string failed %s", dis_emsg[ret]); goto bad; } } /* END for () */ break; case RM_CMD_CONFIG: { char *ptr; if (MOMConfigRReconfig == FALSE) { log_err(-1, id, "remote reconfiguration disabled, ignoring request"); goto bad; } if (restrictrm) { log_err(-1, id, "restricted configure attempt"); goto bad; } log_record(PBSEVENT_SYSTEM, 0, id, "configure"); body = disrst(iochan, &ret); /* FORMAT: FILE: or (NYI) */ if (ret == DIS_EOD) { /* no file specified, use default */ body = NULL; } else if (ret != DIS_SUCCESS) { sprintf(log_buffer, "problem with config body %s", dis_emsg[ret]); goto bad; } else { FILE *fp; if ((ptr = strstr(body, "CONFIG:")) != NULL) { ptr += strlen("CONFIG:"); /* overwrite config with data and clear body */ if ((fp = fopen(config_file, "w+")) == NULL) { sprintf(log_buffer, "cannot open config file %s", config_file); goto bad; } if (fwrite(ptr, sizeof(char), strlen(ptr) + 1, fp) < (strlen(ptr) + 1)) { fclose(fp); sprintf(log_buffer, "cannot write config file %s", config_file); goto bad; } fclose(fp); body = NULL; } } len = read_config(body); ret = diswsi(iochan, len ? RM_RSP_ERROR : RM_RSP_OK); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "write config response failed %s", dis_emsg[ret]); goto bad; } } /* END (case RM_CMD_CONFIG) */ break; case RM_CMD_SHUTDOWN: if (restrictrm) { log_err(-1, id, "restricted shutdown attempt"); goto bad; } log_record(PBSEVENT_SYSTEM, 0, id, "shutdown"); ret = diswsi(iochan, RM_RSP_OK); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "write shutdown response failed %s", dis_emsg[ret]); log_err(-1, id, log_buffer); } flush_io(iochan); close_io(iochan); mom_lock(lockfds, F_UNLCK); close(lockfds); cleanup(); log_close(1); rpp_shutdown(); exit(0); /*NOTREACHED*/ break; default: sprintf(log_buffer, "unknown command %d", command); log_err(-1, id, log_buffer); ret = diswsi(iochan, RM_RSP_ERROR); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "write default response failed %s", dis_emsg[ret]); goto bad; } ret = diswst(iochan, log_buffer); if (ret != DIS_SUCCESS) { sprintf(log_buffer, "write string failed %s", dis_emsg[ret]); goto bad; } break; } /* END switch(command) */ if (flush_io(iochan) == -1) { log_err(errno, id, "flush"); goto bad; } return 0; bad: sprintf(output, "\n\tmessage refused from port %d addr %s", port, netaddr_pbs_net_t(ipadd)); sprintf(TMOMRejectConn, "%s:%d %s", netaddr_pbs_net_t(ipadd), port, (NotTrusted == 1) ? "(server not authorized)" : "(request corrupt)"); strcat(log_buffer, output); log_err(errno, id, log_buffer); close_io(iochan); return(-1); } /* END rm_request() */ /* * Read a RPP message from a stream, figure out if it is a * Resource Monitor request or an InterMom message. */ void do_rpp( int stream) /* I */ { static char id[] = "do_rpp"; int ret, proto, version; void im_request A_((int, int)); void is_request A_((int, int, int *)); void im_eof A_((int, int)); DIS_rpp_reset(); proto = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: cannot get protocol %s\n", id, dis_emsg[ret])) if (LOGLEVEL >= 6) { sprintf(log_buffer, "cannot get protocol %s", dis_emsg[ret]); log_err(errno, id, log_buffer); } im_eof(stream, ret); return; } version = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: no protocol version number %s\n", id, dis_emsg[ret])) sprintf(log_buffer, "no protocol version number %s", dis_emsg[ret]); log_err(errno, id, log_buffer); im_eof(stream, ret); return; } switch (proto) { case RM_PROTOCOL: DBPRT(("%s: got a resource monitor request\n", id)) if (rm_request(stream, version, 0) == 0) rpp_eom(stream); break; case IM_PROTOCOL: if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, "got an internal task manager request in do_rpp"); } im_request(stream, version); break; case IS_PROTOCOL: { int tmpI; if (LOGLEVEL >= 3) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, "got an inter-server request"); } is_request(stream, version, &tmpI); mom_server_update_receive_time(stream, PBSServerCmds[tmpI]); } break; default: if (LOGLEVEL >= 1) { sprintf(log_buffer, "unexpected request protocol type %d received", proto); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, "got an inter-server request"); } rpp_close(stream); break; } /* END switch (proto) */ return; } /* END do_rpp() */ void rpp_request( int fd) /* not used */ { static char id[] = "rpp_request"; int stream; for (;;) { if ((stream = rpp_poll()) == -1) { log_err(errno, id, "rpp_poll"); break; } if (stream == -2) { /* unknown stream identifier */ break; } do_rpp(stream); } /* END for () */ return; } /* END rpp_request() */ int do_tcp( int fd) { #ifndef NDEBUG static char id[] = "do_tcp"; #endif int ret, proto, version; int tm_request A_((int stream, int version)); time_t tmpT; tmpT = pbs_tcp_timeout; pbs_tcp_timeout = 0; proto = disrsi(fd, &ret); if (tmpT > 0) { /* restore */ pbs_tcp_timeout = tmpT; } else { /* initialize */ pbs_tcp_timeout = PMOMTCPTIMEOUT; } switch (ret) { case DIS_SUCCESS: /* worked */ break; case DIS_EOF: /* closed */ close_conn(fd); /* continue to next case */ case DIS_EOD: /* still open */ return(1); /*NOTREACHED*/ break; default: sprintf(log_buffer, "no protocol number: %s", dis_emsg[ret]); goto bad; /*NOTREACHED*/ break; } /* END switch (ret) */ version = disrsi(fd, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: no protocol version number %s\n", id, dis_emsg[ret])) goto bad; } switch (proto) { case RM_PROTOCOL: { time_t tmpT; DBPRT(("%s: got a resource monitor request\n", id)) tmpT = pbs_tcp_timeout; pbs_tcp_timeout = 0; ret = rm_request(fd, version, 1); if (tmpT > 0) { /* restore */ pbs_tcp_timeout = tmpT; } else { /* initialize */ pbs_tcp_timeout = PMOMTCPTIMEOUT; } } /* END BLOCK (case RM_PROTOCOL) */ break; case TM_PROTOCOL: DBPRT(("%s: got an internal task manager request\n", id)) ret = tm_request(fd, version); break; default: DBPRT(("%s: unknown request %d\n", id, proto)) goto bad; /*NOTREACHED*/ break; } /* END switch (proto) */ return(ret); bad: close_conn(fd); return(-1); } /* END do_tcp() */ void tcp_request( int fd) { static char id[] = "tcp_request"; int c; long ipadd; char address[80]; extern struct connection svr_conn[]; ipadd = svr_conn[fd].cn_addr; sprintf(address, "%s:%d", netaddr_pbs_net_t(ipadd), ntohs(svr_conn[fd].cn_port)); if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: fd %d addr %s", id, fd, address); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, "tcp_request", log_buffer); } DIS_tcp_setup(fd); if (tfind(ipadd, &okclients) == NULL) { sprintf(log_buffer, "bad connect from %s", address); log_err(errno, id, log_buffer); close_conn(fd); return; } log_buffer[0] = '\0'; for (c = 0;;c++) { DIS_tcp_funcs(); if (do_tcp(fd)) break; } /* END for (c = 0) */ DBPRT(("%s: processed %d\n", id, c)) return; } /* END tcp_request() */ char *find_signal_name( int sig) { struct sig_tbl *psigt; extern struct sig_tbl sig_tbl[]; for (psigt = sig_tbl; psigt->sig_name != NULL; psigt++) { if (psigt->sig_val == sig) { return(psigt->sig_name); } } return("unknown signal"); } /* * Kill a job. * Call with the job pointer and a signal number. * * NOTE: sends a signal to a job, does not purge job record * * @see kill_task() - child * @see scan_for_exiting() - parent */ int kill_job( job *pjob, /* I */ int sig, /* I */ char *killer_id_name, /* I - process name of calling routine */ char *why_killed_reason) /* I - reason for killing */ { task *ptask; int ct = 0; char *id = "kill_job"; sprintf(log_buffer, "%s: sending signal %d, \"%s\" to job %s, reason: %s", killer_id_name, sig, find_signal_name(sig), pjob->ji_qs.ji_jobid, why_killed_reason); if (LOGLEVEL >= 2) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, log_buffer); } DBPRT(("%s\n", log_buffer)); /* NOTE: should change be made to only execute precancel epilog if job is active? (NYI) */ /* NOTE: epilog blocks until complete, which may cause issues if shutdown grace time is enabled. Change model to allow epilog.precancel to run in background and have kill_task() executed once it is complete (NYI) */ /* NOTE: this will allow kill_job to return immediately and will require sigchild harvesting and the kill_task loop to be called once this signal is received */ /* NOTE: if path_epilogpdel is not set, kill_task should be called immediately (NYI) */ if(sig == SIGTERM) { if (run_pelog(PE_EPILOGUSER, path_epilogpdel, pjob, PE_IO_TYPE_NULL) != 0) { log_err(-1, (char *)id, "precancel epilog failed"); sprintf(PBSNodeMsgBuf, "ERROR: precancel epilog failed"); } } ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask != NULL) { if (ptask->ti_qs.ti_status == TI_STATE_RUNNING) { if (LOGLEVEL >= 4) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "kill_job found a task to kill"); } ct += kill_task(ptask, sig, 0); } ptask = (task *)GET_NEXT(ptask->ti_jobtask); } /* END while (ptask != NULL) */ if (LOGLEVEL >= 6) { sprintf(log_buffer, "kill_job done (killed %d processes)", ct); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } return(ct); } /* END kill_job() */ /* * size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns the decoded value in kb. * * sizeof(word) = sizeof(int) */ unsigned long getsize( resource *pres) /* I */ { unsigned long value; unsigned long shift; if (pres->rs_value.at_type != ATR_TYPE_SIZE) { return(0); } value = pres->rs_value.at_val.at_size.atsv_num; shift = pres->rs_value.at_val.at_size.atsv_shift; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) { return(0); } value *= sizeof(int); } if (shift > 10) { shift -= 10; return(value << shift); } shift = 10 - shift; return(value >> shift); } /* * time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns the decoded value of time * in seconds. */ unsigned long gettime( resource *pres) { if (pres->rs_value.at_type != ATR_TYPE_LONG) { return(0); } if (pres->rs_value.at_val.at_long < 0) { return(0); } return((unsigned long)pres->rs_value.at_val.at_long); } /* END getttime() */ /* log_buffer reports detailed failure reason */ /* return 0: no issues detected */ /* return 1: over limit/child termination request detected */ int job_over_limit( job *pjob) /* I */ { attribute *attr; attribute *used; resource *limresc; resource *useresc; struct resource_def *rd; unsigned long total; int index, i; unsigned long limit; char *units; if (mom_over_limit(pjob)) { /* mom limits violated, log_buffer populated */ /* no more POLL's */ pjob->ji_nodekill = pjob->ji_nodeid; return(1); } if ((pjob->ji_numnodes == 1) || ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0)) { /* no other nodes or not mother superior */ /* SUCCESS */ return(0); } if (pjob->ji_nodekill != TM_ERROR_NODE) { /* one of the sister nodes reports a fatal error */ hnodent *pnode = &pjob->ji_hosts[pjob->ji_nodekill]; if (pnode->hn_sister != 0) { switch (pnode->hn_sister) { case SISTER_KILLDONE: sprintf(log_buffer, "node %d (%s) requested job terminate, '%s' (%d)", pjob->ji_nodekill, pnode->hn_host, "killdone", pnode->hn_sister); break; case SISTER_BADPOLL: sprintf(log_buffer, "node %d (%s) requested job terminate, '%s' (code %d)", pjob->ji_nodekill, pnode->hn_host, "badpoll", pnode->hn_sister); break; case SISTER_EOF: sprintf(log_buffer, "node %d (%s) requested job terminate, '%s' (code %d) - received SISTER_EOF attempting to communicate with sister MOM's", pjob->ji_nodekill, pnode->hn_host, "EOF", pnode->hn_sister); break; default: sprintf(log_buffer, "node %d (%s) requested job terminate, '%s' (code %d) - internal or network failure attempting to communicate with sister MOM's", pjob->ji_nodekill, pnode->hn_host, "EOF", pnode->hn_sister); break; } /* END switch (pnode->hn_sister) */ /* FAILURE */ return(1); } /* END if (pnode->hn_sister != 0) */ } /* END if (pjob->ji_nodekill != TM_ERROR_NODE) */ attr = &pjob->ji_wattr[JOB_ATR_resource]; used = &pjob->ji_wattr[JOB_ATR_resc_used]; /* only enforce cpu time and memory usage */ for (limresc = (resource *)GET_NEXT(attr->at_val.at_list); limresc != NULL; limresc = (resource *)GET_NEXT(limresc->rs_link)) { if ((limresc->rs_value.at_flags & ATR_VFLAG_SET) == 0) continue; rd = limresc->rs_defin; if (!strcmp(rd->rs_name, "cput")) { if (igncput == TRUE) continue; else index = 0; } else if (!strcmp(rd->rs_name, "mem")) { if (ignmem == TRUE) continue; else index = 1; } else continue; useresc = find_resc_entry(used, rd); if (useresc == NULL) continue; if ((useresc->rs_value.at_flags & ATR_VFLAG_SET) == 0) continue; total = (index == 0) ? gettime(useresc) : getsize(useresc); for (i = 0;i < pjob->ji_numnodes - 1;i++) { noderes *nr = &pjob->ji_resources[i]; total += ((index == 0) ? nr->nr_cput : nr->nr_mem); } limit = (index == 0) ? gettime(limresc) : getsize(limresc); if (limit <= total) break; } /* END for (limresc) */ if (limresc == NULL) { /* no limit violation detected, job ok */ return(0); } units = index == 0 ? "secs" : "kb"; sprintf(log_buffer, "%s job total %lu %s exceeded limit %lu %s", rd->rs_name, total, units, limit, units); pjob->ji_nodekill = pjob->ji_nodeid; return(1); } /* END job_over_limit() */ void usage( char *prog) /* I */ { fprintf(stderr, "Usage: %s\n", prog); fprintf(stderr, " -a \\\\ Alarm Time\n"); fprintf(stderr, " -c \\\\ Config File\n"); fprintf(stderr, " -C \\\\ Checkpoint Dir\n"); fprintf(stderr, " -d \\\\ Home Dir\n"); fprintf(stderr, " -C \\\\ Checkpoint Dir\n"); fprintf(stderr, " -D \\\\ DEBUG - do not background\n"); fprintf(stderr, " -h \\\\ Print Usage\n"); fprintf(stderr, " -H \\\\ Hostname\n"); fprintf(stderr, " -l \\\\ MOM Log Dir Path\n"); fprintf(stderr, " -L \\\\ Logfile\n"); fprintf(stderr, " -M \\\\ MOM Port\n"); fprintf(stderr, " -p \\\\ Recover Jobs (Default)\n"); fprintf(stderr, " -P \\\\ Purge Jobs\n"); fprintf(stderr, " -q \\\\ Do Not Recover Jobs\n"); fprintf(stderr, " -r \\\\ Recover Jobs (2)\n"); fprintf(stderr, " -R \\\\ RM Port\n"); fprintf(stderr, " -s \\\\ Logfile Suffix\n"); fprintf(stderr, " -S \\\\ Server Port\n"); fprintf(stderr, " -v \\\\ Version\n"); fprintf(stderr, " -x \\\\ Do Not Use Privileged Ports\n"); fprintf(stderr, " --about \\\\ Print Build Information\n"); fprintf(stderr, " --help \\\\ Print Usage\n"); fprintf(stderr, " --version \\\\ Version\n"); } /* END usage() */ /* * MOMFindMyExe - attempt to find my running executable file. * returns alloc'd memory that is never freed. */ static char *orig_path; char *MOMFindMyExe( char *argv0) /* I */ { char *link; int has_slash = 0; char *p; char *p_next; char *path; link = calloc(MAXPATHLEN + 1, sizeof(char)); if (link == NULL) { /* FAILURE */ return(NULL); } /* Linux has a handy symlink, so try that first */ if (readlink("/proc/self/exe", link, MAXPATHLEN) > 0) { if (link[0] != '\0' && link[0] != '[') { return(link); } } /* if argv0 has a /, then it should exist relative to $PWD */ for (p = argv0; *p; p++) { if (*p == '/') { has_slash = 1; break; } } if (has_slash) { char resolvedpath[MAXPATHLEN+1]; if (argv0[0] == '/') { strcpy(link, argv0); } else { if (getcwd(link, MAXPATHLEN) == NULL) { free(link); return(NULL); } strcat(link, "/"); strcat(link, argv0); } if (realpath(link, resolvedpath) == NULL) { free(link); return(NULL); } strcpy(link, resolvedpath); if (access(link, X_OK) == 0) { return(link); } return(NULL); } /* argv0 doesn't have a /, so search $PATH */ path = getenv("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { char *q; size_t p_len; for (q = p;*q;q++) { if (*q == ':') break; } p_len = q - p; p_next = (*q == '\0' ? q : q + 1); /* We have a path item at p, of length p_len. Now concatenate the path item and argv0. */ if (p_len == 0) { /* An empty PATH element designates the current directory. */ if (getcwd(link, MAXPATHLEN) == NULL) { free(link); return(NULL); } strcat(link, "/"); strcat(link, argv0); } else { strncpy(link, p, p_len); *(link + p_len) = '\0'; strcat(link, "/"); strcat(link, argv0); } if (access(link, X_OK) == 0) { return(link); } } /* END for (p = path; *p; p = p_next) */ } return(NULL); } /* END MOMFindMyExe() */ /* * MOMGetFileMtime - return the mtime of a file */ time_t MOMGetFileMtime( const char *fpath) { struct stat sbuf; int ret; if ((fpath == NULL) || (*fpath == '\0')) { return(0); } ret = stat(fpath, &sbuf); if (ret == 0) { return(sbuf.st_mtime); } return(0); } /* END MOMGetFileMtime */ /* * MOMCheckRestart() - set mom_run_state to restart if appropriate. * this is called when no jobs are running (below * in the main loop, and in job_purge().) */ void MOMCheckRestart(void) { time_t newmtime; if ((MOMConfigRestart <= 0) || (MOMExeTime <= 0)) { return; } newmtime = MOMGetFileMtime(MOMExePath); if ((newmtime > 0) && (newmtime != MOMExeTime)) { if (mom_run_state == MOM_RUN_STATE_RUNNING) mom_run_state = MOM_RUN_STATE_RESTART; sprintf( log_buffer, "%s has changed, initiating re-exec (now: %ld, was: %ld)", MOMExePath, (long int)newmtime, (long int)MOMExeTime); if (LOGLEVEL > 6) { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); } DBPRT(("%s\n", log_buffer)); } } /* END MOMCheckRestart() */ /* * initialize_globals */ void initialize_globals(void) { char *ptr; /* local tmp variable */ strcpy(pbs_current_user, "pbs_mom"); msg_daemonname = pbs_current_user; time(&MOMStartTime); CLEAR_HEAD(svr_newjobs); CLEAR_HEAD(svr_alljobs); CLEAR_HEAD(mom_polljobs); CLEAR_HEAD(svr_requests); CLEAR_HEAD(mom_varattrs); if (getenv("PBSMOMHOME") != NULL) { path_home = getenv("PBSMOMHOME"); } MOMConfigVersion[0] = '\0'; mom_server_all_init(); pbsgroup = getgid(); loopcnt = time(NULL); MOMExePath = MOMFindMyExe(program_name); MOMExeTime = MOMGetFileMtime(MOMExePath); strcpy(xauth_path, XAUTH_PATH); strcpy(rcp_path, RCP_PATH); strcpy(rcp_args, RCP_ARGS); #ifdef DEFAULT_MOMLOGDIR path_log = strdup(DEFAULT_MOMLOGDIR); #endif #ifdef DEFAULT_MOMLOGSUFFIX log_init(DEFAULT_MOMLOGSUFFIX, NULL); #endif /* PATH is restored before a restart */ if (getenv("PATH") != NULL) { orig_path = strdup(getenv("PATH")); } /* get default service port */ ptr = getenv("PBS_MOM_SERVICE_PORT"); if (ptr != NULL) { pbs_mom_port = (int)strtol(ptr, NULL, 10); } if (pbs_mom_port <= 0) { pbs_mom_port = get_svrport( PBS_MOM_SERVICE_NAME, "tcp", PBS_MOM_SERVICE_PORT); } ptr = getenv("PBS_BATCH_SERVICE_PORT"); if (ptr != NULL) { default_server_port = (int)strtol(ptr, NULL, 10); } if (default_server_port <= 0) { default_server_port = get_svrport( PBS_BATCH_SERVICE_NAME, "tcp", PBS_BATCH_SERVICE_PORT_DIS); } ptr = getenv("PBS_MANAGER_SERVICE_PORT"); if (ptr != NULL) { pbs_rm_port = (int)strtol(ptr, NULL, 10); } if (pbs_rm_port <= 0) { pbs_rm_port = get_svrport( PBS_MANAGER_SERVICE_NAME, "tcp", PBS_MANAGER_SERVICE_PORT); } /* set timeout values for MOM */ MaxConnectTimeout = 10000; /* in microseconds */ memset(JobsToResend,0,sizeof(JobsToResend)); } /* END initialize_globals() */ /* * stop_me = signal handler for SIGTERM */ static void stop_me( int sig) /* I */ { const char *dowhat; /* just exit, leaving jobs running */ mom_run_state = MOM_RUN_STATE_EXIT; dowhat = "leaving jobs running, just exiting"; sprintf(log_buffer, "caught signal %d: %s", sig, dowhat); log_record( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); return; } /* END void stop_me() */ /* * PBSAdjustLogLevel */ static void PBSAdjustLogLevel( int sig) /* I */ { if (sig == SIGUSR1) { /* increase log level */ LOGLEVEL = MIN(LOGLEVEL + 1, 10); } else if (sig == SIGUSR2) { /* increase log level */ LOGLEVEL = MAX(LOGLEVEL - 1, 0); } sprintf(log_buffer, "received signal %d: adjusting loglevel to %d", sig, LOGLEVEL); log_record( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); return; } /* END PBSAdjustLogLevel() */ /* * mk_dirs - make the directory names used by MOM */ char *mk_dirs( char *base) /* I */ { char *pn; int ltop = strlen(path_home); pn = malloc(ltop + strlen(base) + 2); if (pn == NULL) { /* cannot allocate memory */ exit(2); } strcpy(pn, path_home); if (*(path_home + ltop - 1) != '/') strcat(pn, "/"); strcat(pn, base); return(pn); } /* END mk_dirs() */ /* * parse_command_line */ void parse_command_line( int argc, /* I */ char *argv[]) /* I */ { extern char *optarg; extern int optind; int errflg; int c; char *ptr; /* local tmp variable */ errflg = 0; while ((c = getopt(argc, argv, "a:c:C:d:DhH:l:L:M:pPqrR:s:S:vx-:")) != -1) { switch (c) { case '-': if (optarg == NULL) break; if (!strcmp(optarg, "about")) { printf("package: %s\n", PACKAGE_STRING); printf("sourcedir: %s\n", PBS_SOURCE_DIR); printf("configure: %s\n", PBS_CONFIG_ARGS); printf("buildcflags: %s\n", PBS_CFLAGS); printf("buildhost: %s\n", PBS_BUILD_HOST); printf("builddate: %s\n", PBS_BUILD_DATE); printf("builddir: %s\n", PBS_BUILD_DIR); printf("builduser: %s\n", PBS_BUILD_USER); printf("installdir: %s\n", PBS_INSTALL_DIR); printf("serverhome: %s\n", PBS_SERVER_HOME); printf("version: %s\n", PACKAGE_VERSION); exit(0); } else if (!strcmp(optarg, "version")) { printf("version: %s\n", PACKAGE_VERSION); exit(0); } else if (!strcmp(optarg, "help")) { usage(argv[0]); exit(0); } else { errflg = 1; } break; case 'a': alarm_time = (int)strtol(optarg, &ptr, 10); if ((alarm_time <= 0) || (*ptr != '\0')) { fprintf(stderr, "%s: bad alarm time\n", optarg); errflg = 1; } break; case 'c': /* config file */ config_file_specified = 1; strcpy(config_file, optarg); /* remember name */ break; case 'h': usage(argv[0]); /* exits */ exit(0); break; case 'H': /* multihomed host */ hostname_specified = 1; strncpy(mom_host, optarg, PBS_MAXHOSTNAME); /* remember name */ break; case 'C': mom_checkpoint_set_directory_path(optarg); break; case 'd': /* directory */ path_home = optarg; break; case 'D': /* debug */ DOBACKGROUND = 0; break; case 'l': path_log = strdup(optarg); break; case 'L': log_file = optarg; break; case 'M': pbs_mom_port = (unsigned int)atoi(optarg); if (pbs_mom_port == 0) { fprintf(stderr, "Bad MOM port value %s\n", optarg); exit(1); } break; case 'p': if (!recover_set) { recover = JOB_RECOV_RUNNING; recover_set = TRUE; } else { errflg = 1; } break; case 'P': if ( !recover_set ) { recover = JOB_RECOV_DELETE; recover_set = TRUE; } else { errflg = 1; } break; case 'r': if (!recover_set) { recover = JOB_RECOV_TERM_REQUE; recover_set = TRUE; } else { errflg = 1; } break; case 'q': if (!recover_set) { recover = JOB_RECOV_REQUE; recover_set = TRUE; } else { errflg = 1; } break; case 'R': pbs_rm_port = (unsigned int)atoi(optarg); if (pbs_rm_port == 0) { fprintf(stderr, "Bad RM port value %s\n", optarg); exit(1); } break; case 's': log_init(optarg, NULL); break; case 'S': default_server_port = (unsigned int)atoi(optarg); if (default_server_port == 0) { fprintf(stderr, "Bad Server port value %s\n", optarg); exit(1); } break; case 'v': fprintf(stderr, "version: %s\n", PACKAGE_VERSION); exit(0); break; case 'x': port_care = FALSE; break; case '?': default: errflg = 1; break; } /* END switch(c) */ } /* END while ((c = getopt(argc,argv,"a:c:C:d:Dh:L:M:prR:S:vx-:")) != -1) */ if ((errflg > 0) || (optind != argc)) { usage(argv[0]); /* exits */ exit(1); } return; } /* END parse_command_line() */ /** * setup_program_environment */ int setup_program_environment(void) { static char id[] = "setup_program_environment"; int c; int hostc = 1; #ifndef DEBUG FILE *dummyfile; #endif int tryport; int rppfd; /* fd for rm and im comm */ int privfd = 0; /* fd for sending job info */ struct sigaction act; char *ptr; /* local tmp variable */ /* must be started with real and effective uid of 0 */ if ((getuid() != 0) || (geteuid() != 0)) { /* FAILURE */ fprintf(stderr, "must be run as root\n"); return(1); } /* The following is code to reduce security risks */ /* start out with standard umask, system resource limit infinite */ umask(022); if (getenv("PBSLOGLEVEL") != NULL) { LOGLEVEL = (int)strtol(getenv("PBSLOGLEVEL"), NULL, 0); } if (getenv("PBSDEBUG") != NULL) { DEBUGMODE = 1; DOBACKGROUND = 0; } /* modify program environment */ if ((num_var_env = setup_env(PBS_ENVIRON)) == -1) { exit(1); } c = getgid(); /* secure suppl. groups */ if (setgroups(1,(gid_t *)&c) != 0) { snprintf(log_buffer, sizeof(log_buffer), "Unable to drop secondary groups. Some MAC framework is active?\n"); log_err(errno, id, log_buffer); snprintf(log_buffer, sizeof(log_buffer), "setgroups(group = %lu) failed: %s\n", (unsigned long)c, strerror(errno)); log_err(errno, id, log_buffer); return(1); } #ifndef DEBUG #ifdef _CRAY limit(C_JOB, 0, L_CPROC, 0); limit(C_JOB, 0, L_CPU, 0); limit(C_JOBPROCS, 0, L_CPU, 0); limit(C_PROC, 0, L_FD, 255); limit(C_JOB, 0, L_FSBLK, 0); limit(C_JOBPROCS, 0, L_FSBLK, 0); limit(C_JOB, 0, L_MEM , 0); limit(C_JOBPROCS, 0, L_MEM , 0); #else /* _CRAY */ { struct rlimit rlimit; rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CPU, &rlimit); setrlimit(RLIMIT_FSIZE, &rlimit); setrlimit(RLIMIT_DATA, &rlimit); #ifdef RLIMIT_RSS setrlimit(RLIMIT_RSS, &rlimit); #endif /* RLIMIT_RSS */ #ifdef RLIMIT_VMEM setrlimit(RLIMIT_VMEM, &rlimit); #endif /* RLIMIT_VMEM */ } /* END BLOCK */ #endif /* else _CRAY */ #endif /* DEBUG */ /* set up and validate home paths */ c = 0; mom_home = mk_dirs("mom_priv"); path_jobs = mk_dirs("mom_priv/jobs/"); path_epilog = mk_dirs("mom_priv/epilogue"); path_prolog = mk_dirs("mom_priv/prologue"); path_epiloguser = mk_dirs("mom_priv/epilogue.user"); path_prologuser = mk_dirs("mom_priv/prologue.user"); path_epilogp = mk_dirs("mom_priv/epilogue.parallel"); path_prologp = mk_dirs("mom_priv/prologue.parallel"); path_epiloguserp = mk_dirs("mom_priv/epilogue.user.parallel"); path_prologuserp = mk_dirs("mom_priv/prologue.user.parallel"); path_epilogpdel = mk_dirs("mom_priv/epilogue.precancel"); #ifndef DEFAULT_MOMLOGDIR if (path_log == NULL) path_log = mk_dirs("mom_logs"); #endif path_spool = mk_dirs("spool/"); path_undeliv = mk_dirs("undelivered/"); path_aux = mk_dirs("aux/"); path_server_name = mk_dirs("server_name"); init_resc_defs(); c |= mom_checkpoint_init(); /* change working directory to mom_priv */ if (chdir(mom_home) == -1) { char tmpLine[1024]; sprintf(tmpLine, "cannot change directory to home '%s'", mom_home); perror(tmpLine); return(1); } #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) c |= chk_file_sec(path_jobs, 1, 0, S_IWGRP | S_IWOTH, 1, NULL); c |= chk_file_sec(path_aux, 1, 0, S_IWGRP | S_IWOTH, 1, NULL); c |= chk_file_sec(path_spool, 1, 1, S_IWOTH, 0, NULL); c |= chk_file_sec(path_undeliv, 1, 1, S_IWOTH, 0, NULL); c |= chk_file_sec(PBS_ENVIRON, 0, 0, S_IWGRP | S_IWOTH, 0, NULL); if (c) { return(3); } #endif /* not DEBUG and not NO_SECURITY_CHECK */ if (hostname_specified == 0) { hostc = gethostname(mom_host, PBS_MAXHOSTNAME); } log_init(NULL, mom_host); /* open log file while std in,out,err still open, forces to fd 4 */ if ((c = log_open(log_file, path_log)) != 0) { /* use given name */ fprintf(stderr, "pbs_mom: Unable to open logfile\n"); return(1); } check_log(); /* see if this log should be rolled */ lockfds = open("mom.lock", O_CREAT | O_WRONLY, 0644); if (lockfds < 0) { sprintf(log_buffer, "pbs_mom: unable to open lock file - errno=%d '%s'\n", errno, strerror(errno)); fprintf(stderr, "%s", log_buffer); return(1); } mom_lock(lockfds, F_WRLCK); /* See if other MOMs are running */ /* initialize the network interface */ if (init_network(pbs_mom_port, process_request) != 0) { c = errno; sprintf(log_buffer, "server port = %u, errno = %d (%s)", pbs_mom_port, c, strerror(c)); if (c == EADDRINUSE) strcat(log_buffer, ", already in use"); log_err(-1, msg_daemonname, log_buffer); strcat(log_buffer, "\n"); fprintf(stderr, "%s", log_buffer); return(3); } if (init_network(pbs_rm_port, tcp_request) != 0) { c = errno; sprintf(log_buffer, "resource (tcp) port = %u, errno = %d (%s)", pbs_rm_port, c, strerror(c)); if (c == EADDRINUSE) strcat(log_buffer, ", already in use"); log_err(-1, msg_daemonname, log_buffer); strcat(log_buffer, "\n"); fprintf(stderr, "%s", log_buffer); return(3); } /* go into the background and become own session/process group */ #ifndef DEBUG mom_lock(lockfds, F_UNLCK); /* unlock so child can relock */ if (DOBACKGROUND == 1) { if (fork() > 0) { exit(0); /* parent goes away */ } if (setsid() == -1) { log_err(errno, msg_daemonname, "setsid failed"); return(2); } fclose(stdin); fclose(stdout); fclose(stderr); dummyfile = fopen("/dev/null", "r"); assert((dummyfile != 0) && (fileno(dummyfile) == 0)); dummyfile = fopen("/dev/null", "w"); assert((dummyfile != 0) && (fileno(dummyfile) == 1)); dummyfile = fopen("/dev/null", "w"); assert((dummyfile != 0) && (fileno(dummyfile) == 2)); } /* END if (DOBACKGROUND == 1) */ mom_lock(lockfds, F_WRLCK); /* lock out other MOMs */ #else /* DEBUG */ #if defined(_CRAY) /* CRAY cannot restart checkpointed job if MOM has controlling tty */ sprintf(log_buffer, "/tmp/pbs_mom.%d", getpid()); printf("Debug output will be in %s\n", log_buffer); freopen(log_buffer, "w", stdout); freopen(log_buffer, "w", stderr); ioctl(0, TCCLRCTTY, 0); close(0); #endif /* _CRAY */ setvbuf(stdout, NULL, _IOLBF, 0); setvbuf(stderr, NULL, _IOLBF, 0); #endif /* DEBUG */ /* write MOM's pid into lockfile */ if (ftruncate(lockfds, (off_t)0) != 0) { log_err(errno, msg_daemonname, "failed to truncate lockfile"); return(2); } sprintf(log_buffer, "%ld\n", (long)getpid()); if (write(lockfds, log_buffer, strlen(log_buffer) + 1) != (ssize_t)(strlen(log_buffer) + 1)) { log_err(errno, msg_daemonname, "failed to write to lockfile"); return(2); } #if (PLOCK_DAEMONS & 4) /* lock daemon into memory */ /* NOTE: should reduce maximum stack limit using ulimit() before calling plock */ if (plock(PROCLOCK) == -1) { log_err(errno, msg_daemonname, "failed to lock mom into memory with plock"); } else { MOMIsPLocked = 1; } #endif /* PLOCK_DAEMONS */ sigemptyset(&allsigs); act.sa_mask = allsigs; act.sa_flags = 0; /* ** Signals to be ignored. */ act.sa_handler = SIG_IGN; sigaction(SIGPIPE, &act, NULL); #ifdef SIGINFO sigaction(SIGINFO, &act, NULL); #endif /* SIGINFO */ sigaddset(&allsigs, SIGHUP); /* remember to block these */ sigaddset(&allsigs, SIGINT); /* during critical sections */ sigaddset(&allsigs, SIGTERM); /* so we don't get confused */ sigaddset(&allsigs, SIGCHLD); #ifdef _CRAY sigaddset(&allsigs, WJSIGNAL); #endif act.sa_mask = allsigs; /* ** We want to abort system calls ** and call a function. */ #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; /* don't restart system calls */ #endif #ifdef NOSIGCHLDMOM act.sa_handler = SIG_DFL; #else act.sa_handler = catch_child; /* set up to catch death of child */ #endif sigaction(SIGCHLD, &act, NULL); #ifdef _CRAY sigaction(WJSIGNAL, &act, NULL); #endif /* * Catch these signals to ensure we core dump even if * our rlimit for core dumps is set to 0 initially. * * Chris Samuel - VPAC * csamuel@vpac.org - 29th July 2003 * * Now conditional on the PBSCOREDUMP environment variable. */ if (getenv("PBSCOREDUMP")) { act.sa_handler = catch_abort; /* make sure we core dump */ sigaction(SIGSEGV, &act, NULL); sigaction(SIGBUS, &act, NULL); sigaction(SIGFPE, &act, NULL); sigaction(SIGILL, &act, NULL); sigaction(SIGTRAP, &act, NULL); sigaction(SIGSYS, &act, NULL); } act.sa_handler = catch_hup; /* do a restart on SIGHUP */ sigaction(SIGHUP, &act, NULL); act.sa_handler = toolong; /* handle an alarm call */ sigaction(SIGALRM, &act, NULL); act.sa_handler = stop_me; /* shutdown for these */ sigaction(SIGINT, &act, NULL); sigaction(SIGTERM, &act, NULL); act.sa_handler = PBSAdjustLogLevel; sigaction(SIGUSR1, &act, NULL); sigaction(SIGUSR2, &act, NULL); #ifdef SIGXCPU sigaction(SIGXCPU, &act, NULL); #endif #ifdef SIGXFSZ sigaction(SIGXFSZ, &act, NULL); #endif #ifdef SIGCPULIM sigaction(SIGCPULIM, &act, NULL); #endif #ifdef SIGSHUTDN sigaction(SIGSHUTDN, &act, NULL); #endif #ifdef _CRAY /* Special code for CRAY MLS Systems */ if (sysconf(_SC_CRAY_SECURE_SYS)) { struct usrv usrv; if (getusrv(&usrv) < 0) { fprintf(stderr, "cannot get security info\n"); return(1); } usrv.sv_permit = 0; usrv.sv_intcat = 0; usrv.sv_valcat = 0; if (setusrv(&usrv) < 0) { fprintf(stderr, "cannot put security info\n"); return(1); } if (setucat(0) < 0) { fprintf(stderr, "cannot put security cat\n"); return(2); } } #endif /* _CRAY */ /* initialize variables */ if ((hostname_specified != 0) || (hostc == 0)) { strcpy(mom_short_name, mom_host); c = get_fullhostname(mom_host, mom_host, PBS_MAXHOSTNAME, NULL); if (c != 0) { char logbuf[1024]; snprintf(logbuf, 1024, "Unable to get my full hostname for %s error %d", mom_host, c); log_err(-1, msg_daemonname, logbuf); return(-1); } } if (c == -1) { log_err(-1, msg_daemonname, "Unable to get my host name"); return(-1); } time_now = time((time_t *)0); ret_size = 4096; if ((ret_string = malloc(ret_size)) == NULL) { perror("malloc"); exit(1); } if ((rppfd = rpp_bind(pbs_rm_port)) == -1) { log_err(errno, id, "rpp_bind"); exit(1); } rpp_fd = -1; /* force rpp_bind() to get another socket */ tryport = (port_care != FALSE) ? IPPORT_RESERVED : PMAX_PORT; while (--tryport > 0) { if ((privfd = rpp_bind(tryport)) != -1) break; if ((errno != EADDRINUSE) && (errno != EADDRNOTAVAIL)) break; } if (privfd == -1) { log_err(errno, id, "no privileged ports"); exit(1); } localaddr = addclient("localhost"); addclient(mom_host); if (gethostname(ret_string, ret_size) == 0) addclient(ret_string); tmpdir_basename[0] = '\0'; if (read_config(NULL)) { fprintf(stderr, "%s: cannot load config file '%s'\n", program_name, config_file); exit(1); } initialize(); /* init RM code */ add_conn(rppfd, Primary, (pbs_net_t)0, 0, PBS_SOCK_INET, rpp_request); add_conn(privfd, Primary, (pbs_net_t)0, 0, PBS_SOCK_INET, rpp_request); /* initialize machine-dependent polling routines */ if ((c = mom_open_poll()) != PBSE_NONE) { log_err(c, msg_daemonname, "pre_poll failed"); return(3); } if (mom_get_sample() != PBSE_NONE) { log_err(c, msg_daemonname, "mom_get_sample failed after mom_open_poll"); return(3); } /* recover & abort jobs which were under MOM's control */ log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, msg_daemonname, "before init_abort_jobs"); init_abort_jobs(recover); #ifdef _POSIX_MEMLOCK /* call mlockall() only 1 time, since it seems to leak mem */ if (MOMIsLocked == 0) { int mlockall_return; /* make sure pbs_mom stays in RAM and doesn't get paged out */ mlockall_return = mlockall(MCL_CURRENT | MCL_FUTURE); /* exit iff mlock failed, but ignore function not implemented error */ if ((mlockall_return == -1) && (errno != ENOSYS)) { perror("pbs_mom:mom_main.c:mlockall()"); exit(1); } MOMIsLocked = 1; } #endif /* _POSIX_MEMLOCK */ /* record the fact that we are up and running */ log_record( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, "Is up"); DBPRT(("MOM is up\n")); sprintf( log_buffer, "MOM executable path and mtime at launch: %s %ld", MOMExePath == NULL ? "NULL" : MOMExePath, (long int)MOMExeTime); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); ptr = getenv("MOMSLEEPTIME"); if (ptr != NULL) { long tmpL; tmpL = strtol(ptr, NULL, 10); srand(getpid()); sleep(tmpL % (rand() + 1)); } /* END if (ptr != NULL) */ return(0); } /* END setup_program_environment() */ /* * TMOMJobGetStartInfo * * NOTE: if pjob is NULL, return empty slot, otherwise return slot containing job. */ int TMOMJobGetStartInfo( job *pjob, /* I */ pjobexec_t **TJEP) /* O */ { int index; for (index = 0;index < TMAX_JE;index++) { if (TMOMStartInfo[index].pjob == pjob) { *TJEP = &TMOMStartInfo[index]; return(SUCCESS); } } /* END for (index) */ return(FAILURE); } /* END TMOMJobGetStartInfo() */ /* * TMOMScanForStarting */ int TMOMScanForStarting(void) { job *pjob; job *nextjob; int Count; int RC; int SC; #ifdef MSIC list_link *tmpL; #endif const char *id = "TMOMScanForStarting"; #ifdef MSIC /* NOTE: solaris system is choking on GET_NEXT - isolate */ tmpL = GET_NEXT(svr_alljobs); tmpL = svr_alljobs.ll_next->ll_struct; pjob = (job *)tmpL; #endif /* MSIC */ pjob = (job *)GET_NEXT(svr_alljobs); while (pjob != NULL) { nextjob = (job *)GET_NEXT(pjob->ji_alljobs); if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_STARTING) { pjobexec_t *TJE; if (LOGLEVEL >= 2) { snprintf(log_buffer, 1024, "checking job start in %s - examining pipe from child", id); log_record( PBSEVENT_JOB | PBSEVENT_FORCE, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } if (TMOMJobGetStartInfo(pjob, &TJE) == FAILURE) { sprintf(log_buffer, "job %s start data lost, server will retry", pjob->ji_qs.ji_jobid); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exec_bail(pjob, JOB_EXEC_RETRY); pjob = nextjob; continue; } /* check if job is ready */ if (TMomCheckJobChild(TJE, 1, &Count, &RC) == FAILURE) { long STime; if (LOGLEVEL >= 3) { sprintf(log_buffer, "job %s child not started, will check later", pjob->ji_qs.ji_jobid); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } /* if job has been in prerun > TJobStartTimeout, purge job */ STime = pjob->ji_wattr[(int)JOB_ATR_mtime].at_val.at_long; if ((STime > 0) && ((time_now - STime) > TJobStartTimeout)) { sprintf(log_buffer, "job %s child not started after %ld seconds, server will retry", pjob->ji_qs.ji_jobid, TJobStartTimeout); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, JOB_EXEC_RETRY); } } else { /* NOTE: TMomFinalizeJob3() populates SC */ if (TMomFinalizeJob3(TJE, Count, RC, &SC) == FAILURE) { /* no need to log this, TMomFinalizeJob3() already did */ memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, SC); } else { /* job successfully started */ memset(TJE, 0, sizeof(pjobexec_t)); if (LOGLEVEL >= 3) { sprintf(log_buffer, "job %s reported successful start", pjob->ji_qs.ji_jobid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } } /* END else (TMomCheckJobChild() == FAILURE) */ } /* END if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_STARTING) */ pjob = nextjob; } /* END while (pjob != NULL) */ return(SUCCESS); } /* END TMOMScanForStarting() */ /** * examine_all_polled_jobs * * check on over limit condition for polled jobs */ void examine_all_polled_jobs(void) { static char id[] = "examine_all_polled_jobs"; job *pjob; int c; for (pjob = (job *)GET_NEXT(mom_polljobs);pjob; pjob = (job *)GET_NEXT(pjob->ji_jobque)) { if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) continue; /* ** Send message to get info from other MOM's ** if I am Mother Superior for the job and ** it is not being killed. */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) && (pjob->ji_nodekill == TM_ERROR_NODE)) { /* ** If can't send poll to everybody, the ** time has come to die. */ if (send_sisters(pjob, IM_POLL_JOB) != pjob->ji_numnodes - 1) { sprintf(log_buffer, "cannot contact all sisters"); log_record(PBSEVENT_JOB | PBSEVENT_FORCE, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } c = pjob->ji_qs.ji_svrflags; if (c & JOB_SVFLG_OVERLMT2) { kill_job(pjob, SIGKILL, id, "job is over-limit-2"); continue; } if (c & JOB_SVFLG_OVERLMT1) { kill_job(pjob, SIGTERM, id, "job is over-limit-1"); pjob->ji_qs.ji_svrflags |= JOB_SVFLG_OVERLMT2; continue; } log_buffer[0] = '\0'; if (job_over_limit(pjob) != 0) { log_record( PBSEVENT_JOB | PBSEVENT_FORCE, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); if (c & JOB_SVFLG_HERE) { char *kill_msg; kill_msg = malloc(80 + strlen(log_buffer)); if (kill_msg != NULL) { sprintf(kill_msg,"=>> PBS: job killed: %s\n", log_buffer); message_job(pjob,StdErr,kill_msg); free(kill_msg); } } kill_job(pjob, SIGTERM, id, "job is over-limit-0"); pjob->ji_qs.ji_svrflags |= JOB_SVFLG_OVERLMT1; } } /* END for (pjob) */ return; } /* END examine_all_polled_jobs() */ /* * examine_all_running_jobs */ void examine_all_running_jobs(void) { job *pjob; #ifdef _CRAY int c; #endif task *ptask; for (pjob = (job *)GET_NEXT(svr_alljobs); pjob != NULL; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) continue; /* This job is not running, skip it. */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; /* We are not the Mother Superior for this job, skip it. */ /* update information for my tasks */ mom_set_use(pjob); /* Machine dependent function to compute and set attributes like cput, vmem, etc. */ /* Have all job processes vanished undetected? */ /* double check by sig0 to session pid for each task */ /* But why not use the proc_array? */ if (pjob->ji_flags & MOM_NO_PROC) { pjob->ji_flags &= ~MOM_NO_PROC; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { #ifdef _CRAY if (pjob->ji_globid == NULL) break; c = atoi(pjob->ji_globid); if ((kill((pid_t)c, 0) == -1) && (errno == ESRCH)) #else /* not cray */ if ((kill(ptask->ti_qs.ti_sid, 0) == -1) && (errno == ESRCH)) #endif /* not cray */ { if (LOGLEVEL >= 3) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "no active process found"); } ptask->ti_qs.ti_exitstat = 0; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = 0; if (LOGLEVEL >= 6) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "saving task (main loop)"); } task_save(ptask); exiting_tasks = 1; } /* END if ((kill == -1) && ...) */ } /* END while (ptask != NULL) */ } /* END if (pjob->ji_flags & MOM_NO_PROC) */ mom_checkpoint_check_periodic_timer(pjob); } /* END for (pjob) */ return; } /* END examine_all_running_jobs() */ /** * examine_all_jobs_to_resend * * tries to resend each of the jobs that hasn't been sent yet */ void examine_all_jobs_to_resend(void) { int jindex; for (jindex=0;jindex < MAX_RESEND_JOBS;jindex++) { /* no job ptrs are stored after a NULL value */ if (JobsToResend[jindex] == NULL) break; /* skip dummy job */ if (JobsToResend[jindex] == (job *)DUMMY_JOB_PTR) continue; if (!post_epilogue(JobsToResend[jindex], MOM_OBIT_RETRY)) { if (LOGLEVEL >= 7) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, JobsToResend[jindex]->ji_qs.ji_jobid, "job obit resent"); } /* sent successfully, make this slot the dummy pointer */ JobsToResend[jindex] = (job *)DUMMY_JOB_PTR; } } } /* END examine_all_jobs_to_resend() */ /* * kill_all_running_jobs */ void kill_all_running_jobs(void) { job *pjob; for (pjob = (job *)GET_NEXT(svr_alljobs); pjob != NULL; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_RUNNING) { kill_job(pjob, SIGKILL, "kill_all_running_jobs", "mom is terminating with kill jobs flag"); pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; job_save(pjob, SAVEJOB_QUICK); } else { term_job(pjob); } } /* END for (pjob) */ #ifndef NOSIGCHLDMOM if (termin_child != 0) #endif scan_for_terminated(); if (exiting_tasks) scan_for_exiting(); return; } /* END kill_all_running_jobs() */ /** * mark_for_resend * * used to keep track of jobs whose obits weren't sent correctly * marks them so they can be resent * * @param pjob - the job that should be resent */ int mark_for_resend( job *pjob) /* I */ { int jindex; int rc = FAILURE; if (pjob == NULL) return(rc); for (jindex = 0;jindex < MAX_RESEND_JOBS;jindex++) { if ((JobsToResend[jindex] == NULL) || (JobsToResend[jindex] == (job *)DUMMY_JOB_PTR)) { JobsToResend[jindex] = pjob; if (LOGLEVEL >= 7) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "marking job for resend"); } rc = SUCCESS; break; } } return(rc); } /** * main_loop * * @see main() - parent */ void main_loop(void) { static char id[] = "main_loop"; extern time_t wait_time; double myla; job *pjob; time_t tmpTime; #ifdef USESAVEDRESOURCES int check_dead = TRUE; #endif /* USESAVEDRESOURCES */ mom_run_state = MOM_RUN_STATE_RUNNING; /* mom_run_state is altered by stop_me() or MOMCheckRestart() */ while (mom_run_state == MOM_RUN_STATE_RUNNING) { rpp_io(); if (call_hup) { process_hup(); /* Do a restart of resmom */ } dep_main_loop_cycle(); /* Call machine dependent code periodically */ time_now = time(NULL); /* check if loadave means we should be "busy" */ if (max_load_val > 0.0) { get_la(&myla); /* Machine dependent load average computation (for linux read contents of /proc/loadavg) */ /* check if need to update busy state */ check_busy(myla); } /* should we check the log file ?*/ if (time_now >= (last_log_check + PBS_LOG_CHECK_RATE)) { check_log(); /* Possibly do a log_roll */ } #if 1 if (mom_server_all_check_connection() == 0) /* Are we connected to any server? */ { /* Don't do any other processing until we've re-established * contact with at least one server */ sleep(1); /* sleep to prevent too many messages sent to server under certain failure conditions */ } else #else mom_server_all_check_connection(); #endif { if ((time_now >= (LastServerUpdateTime + ServerStatUpdateInterval)) || (ForceServerUpdate == TRUE)) { ForceServerUpdate = FALSE; /* Update the server on the status of this mom. */ if (PBSNodeCheckInterval > 0) check_state((LastServerUpdateTime == 0)); mom_server_all_update_stat(); LastServerUpdateTime = time_now; } /* if needed, update server with my state change */ /* can be changed in check_busy(), query_adp(), and is_update_stat() */ mom_server_all_send_state(); #ifdef USESAVEDRESOURCES /* if -p, must poll tasks inside jobs to look for completion */ if ((check_dead) && (recover == JOB_RECOV_RUNNING)) { scan_non_child_tasks(); } #endif /* USESAVEDRESOURCES */ if (time_now >= (last_poll_time + CheckPollTime)) { last_poll_time = time_now; if (GET_NEXT(svr_alljobs)) { /* There are jobs, update process status from the OS */ if (mom_get_sample() == PBSE_NONE) { /* no errors in getting process status information */ examine_all_running_jobs(); examine_all_polled_jobs(); examine_all_jobs_to_resend(); } } } } /* END BLOCK */ #ifdef USESAVEDRESOURCES check_dead = FALSE; #endif /* USESAVEDRESOURCES */ #ifndef NOSIGCHLDMOM if (termin_child != 0) /* termin_child is a flag set by the catch_child signal handler */ #endif scan_for_terminated(); /* machine dependent (calls mom_get_sample()???) */ /* if -p, must poll tasks inside jobs to look for completion */ if (recover == JOB_RECOV_RUNNING) scan_non_child_tasks(); if(recover == JOB_RECOV_DELETE) { prepare_child_tasks_for_delete(); /* we can only do this once so set recover back to the default */ recover = JOB_RECOV_RUNNING; } if (exiting_tasks) scan_for_exiting(); TMOMScanForStarting(); rpp_request(42); /* cycle the rpp messaging system */ /* unblock signals */ if (sigprocmask(SIG_UNBLOCK, &allsigs, NULL) == -1) log_err(errno, id, "sigprocmask(UNBLOCK)"); time_now = time((time_t *)0); tmpTime = MIN(wait_time, time_now - (LastServerUpdateTime + ServerStatUpdateInterval)); tmpTime = MIN(tmpTime, time_now - (last_poll_time + CheckPollTime)); tmpTime = MAX(1, tmpTime); if (LastServerUpdateTime == 0) tmpTime = 1; /* wait_request does a select and then calls the connection's cn_func for sockets with data */ if (wait_request(tmpTime, NULL) != 0) { if (errno == EBADF) { init_network(pbs_mom_port, process_request); init_network(pbs_rm_port, tcp_request); } log_err(-1, msg_daemonname, "wait_request failed"); } /* block signals while we do things */ if (sigprocmask(SIG_BLOCK, &allsigs, NULL) == -1) log_err(errno, id, "sigprocmask(BLOCK)"); if ((pjob = (job *)GET_NEXT(svr_alljobs)) == NULL) { MOMCheckRestart(); /* There are no jobs, see if the server needs to be restarted. */ } } /* END while (mom_run_state == MOM_RUN_STATE_RUNNING) */ return; } /* END main_loop() */ /* * restart_mom */ void restart_mom( int argc, char *argv[]) { static char id[] = "restart_mom"; char *envstr; envstr = malloc( (strlen("PATH") + strlen(orig_path) + 2) * sizeof(char)); if (!envstr) { sprintf(log_buffer, "malloc failed prior to execing myself: %s (%d)", strerror(errno), errno); log_err(errno, id, log_buffer); return; } strcpy(envstr, "PATH="); strcat(envstr, orig_path); putenv(envstr); DBPRT(("Re-execing myself now...\n")); execvp(MOMExePath, argv); sprintf(log_buffer, "execing myself failed: %s (%d)", strerror(errno), errno); log_err(errno, id, log_buffer); return; } /* END restart_mom() */ /* * This is for a mom starting with the -P option. Set all existing * tasks to TI_STATE_EXITED so they can be cleanup up on the mom * and at the server */ void prepare_child_tasks_for_delete() { char *id = "prepare_child_tasks_for_delete"; job *job; extern tlist_head svr_alljobs; for (job = GET_NEXT(svr_alljobs);job != NULL;job = GET_NEXT(job->ji_alljobs)) { task *task; for (task = GET_NEXT(job->ji_tasks);task != NULL;task = GET_NEXT(task->ti_jobtask)) { char buf[128]; extern int exiting_tasks; sprintf(buf, "preparing exited session %d for task %d in job %s for deletion", (int)task->ti_qs.ti_sid, task->ti_qs.ti_task, job->ji_qs.ji_jobid); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, buf); task->ti_qs.ti_exitstat = 0; /* actually unknown */ task->ti_qs.ti_status = TI_STATE_EXITED; task_save(task); exiting_tasks = 1; } } } /* * main - the main program of MOM * * @see main_loop() - child */ int main( int argc, /* I */ char *argv[]) /* I */ { int rc; int tmpFD; tmpFD = sysconf(_SC_OPEN_MAX); /* close any inherited extra files, leaving stdin, stdout, and stderr open */ while (--tmpFD > 2) close(tmpFD); program_name = argv[0]; initialize_globals(); parse_command_line(argc, argv); /* Calls exit on command line error */ if ((rc = setup_program_environment()) != 0) { return(rc); } main_loop(); if (mom_run_state == MOM_RUN_STATE_KILLALL) { kill_all_running_jobs(); } /* shutdown mom */ mom_close_poll(); rpp_shutdown(); net_close(-1); /* close all network connections */ if (mom_run_state == MOM_RUN_STATE_RESTART) { sprintf(log_buffer, "Will be restarting: %s", MOMExePath); log_record(PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); } log_record(PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, "Is down"); log_close(1); if (mom_run_state == MOM_RUN_STATE_RESTART) { restart_mom(argc, argv); } return(0); } /* END main() */ /* END mom_main.c */ torque-2.4.16/src/resmom/irix5/0000777000113300011330000000000011614035172013247 500000000000000torque-2.4.16/src/resmom/irix5/mom_start.c0000664000113300011330000002352611272401244015343 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 0x100; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ int open_master( char **rtn_name /* RETURN name of slave pts */ ) { int fds; *rtn_name = _getpty(&fds, O_RDWR | O_NOCTTY, 0600, 1); if (*rtn_name == (char *)0) return (-1); else return (fds); } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/irix5/mom_mach.h0000664000113300011330000001244311272401244015117 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: sgi */ #ifndef MOM_MACH #define MOM_MACH "irix5" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/irix5/Makefile.in0000664000113300011330000004376711605403752015256 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/irix5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/irix5/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/irix5/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/irix5/pe_input.c0000664000113300011330000001062611272401244015156 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For irix - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/irix5/mom_mach.c0000664000113300011330000015530111272401244015113 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a Silicon Graphics (SGI) machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information (sizes in KB) */ static char ident[] = "@(#) sgi/$RCSfile$ $Revision: 3151 $"; #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ static char procfs[] = "/proc"; static char procfmts[] = "/proc/%s"; static char procfmtd[] = "/proc/%d"; static DIR *pdir = NULL; static char pinfofs[] = "/proc/pinfo"; static char pinfofmts[] = "/proc/pinfo/%s"; static DIR *pinfodir = NULL; static int pagesize; static int kfd = -1; extern char *ret_string; time_t wait_time = 10; extern char extra_parm[]; extern char no_parm[]; extern time_t time_now; /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { NULL, {nullproc} }, }; int kern_addr[] = { -1, /* KSYM_PHYS */ -1, /* KSYM_LOAD */ }; #define KSYM_PHYS 0 #define KSYM_LOAD 1 #define MAPNUM 512 /* max number of mem segs */ void dep_initialize(void) { char *id = "dep_initialize"; static char mem[] = "/dev/kmem"; pagesize = getpagesize(); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } if ((pinfodir = opendir(pinfofs)) == NULL) { log_err(errno, id, pinfofs); return; } kern_addr[KSYM_PHYS] = SEEKLIMIT & sysmp(MP_KERNADDR, MPKA_PHYSMEM); kern_addr[KSYM_LOAD] = SEEKLIMIT & sysmp(MP_KERNADDR, MPKA_AVENRUN); if ((kfd = open(mem, O_RDONLY)) == -1) { log_err(errno, id, mem); return; } return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) { closedir(pdir); pdir = NULL; } if (pinfodir) { closedir(pinfodir); pdir = NULL; } if (kfd != -1) close(kfd); } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a timestruc_t pointer. Returns unsigned long * time in seconds. */ #define tv(val) (ulong)((val).tv_sec + ((val).tv_nsec + 500000000)/1000000000) /* ** Scan a list of tasks and return true if one of them matches ** the process (sid or pid) represented by *psp. */ static int injob(tlist_head *phead, prpsinfo_t *psp) { task *ptask; pid_t key; key = (psp->pr_sid == 0) ? psp->pr_pid : psp->pr_sid; for (ptask = (task *)GET_NEXT(*phead); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == key) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds, * adjusted by cputfactor. */ static unsigned long cput_sum(tlist_head *phead) { char *id = "cput_sum"; int fd; struct dirent *dent; char procname[100]; ulong cputime, addtime; prpsinfo_t pi; int nps = 0; DBPRT(("%s: entered\n", id)) cputime = 0.0; rewinddir(pinfodir); for (fd = -1; (dent = readdir(pinfodir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, pinfofmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCSTATUS)", procname); log_err(errno, id, log_buffer); continue; } if (!injob(phead, &pi)) continue; nps++; addtime = tv(pi.pr_time) + tv(pi.pr_ctime); cputime += addtime; DBPRT(("%s: ses %d pid %d cputime %d\n", id, pi.pr_sid, pi.pr_pid, addtime, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcpu_proc(tlist_head *phead, unsigned long limit) { char *id = "overcpu_proc"; int fd; char procname[100]; struct dirent *dent; prpsinfo_t pi; rewinddir(pinfodir); for (fd = -1; (dent = readdir(pinfodir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, pinfofmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if (!injob(phead, &pi)) continue; if ((unsigned long)((double)tv(pi.pr_time) *cputfactor) > limit) return (TRUE); } return (FALSE); } /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the list of tasks. */ static unsigned long mem_sum(tlist_head *phead) { static char id[] = "mem_sum"; int fd; struct dirent *dent; char procname[100]; int i; ulong_t segadd; prpsinfo_t pi; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) rewinddir(pdir); segadd = 0; for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); } continue; } if (!injob(phead, &pi)) continue; DBPRT(("%s: %s(%d:%d) mem %lu\n", id, pi.pr_fname, pi.pr_sid, pi.pr_pid, (ulong)pi.pr_size * (ulong)pagesize)) segadd += (ulong)pi.pr_size * (ulong)pagesize; } DBPRT(("%s: total mem %lu\n\n", id, segadd)) return (segadd); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(tlist_head *phead) { static char id[] = "resi_ses"; ulong resisize, resisub; int fd; int num, i; char procname[100]; struct dirent *dent; ulong_t lastseg, nbps; prmap_sgi_t map[MAPNUM]; prmap_sgi_t *mp; prmap_sgi_arg_t maparg; prpsinfo_t pi; rewinddir(pdir); resisize = 0; lastseg = 99999; nbps = (pagesize / sizeof(uint_t)) * pagesize; /* sysmacros.h says "4Meg" ...hmmm */ for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); } continue; } if (!injob(phead, &pi)) continue; if ((num = ioctl(fd, PIOCMAP_SGI, &maparg)) == -1) { log_err(errno, id, "ioctl(PIOCMAP_SGI)"); continue; } DBPRT(("%s: %s(%d:%d) rss %lu\n", id, pi.pr_fname, pi.pr_sid, pi.pr_pid, (ulong)pi.pr_size * (ulong)pagesize)) resisub = 0; for (i = 0, mp = map; i < num; i++, mp++) { u_long cnt = mp->pr_mflags >> MA_REFCNT_SHIFT; u_long end = (u_long)mp->pr_vaddr + mp->pr_size - 1; u_long seg1 = (u_long)mp->pr_vaddr / nbps; u_long seg2 = end / nbps; u_long numseg = seg2 - seg1; if (lastseg != seg2) numseg++; lastseg = seg2; numseg = numseg * pagesize / cnt; numseg += mp->pr_wsize * pagesize / MA_WSIZE_FRAC / cnt; resisub += numseg; DBPRT(("%s: %d\t%luk\t%luk\n", id, i, numseg / 1024, resisub / 1024)) } resisize += resisub; DBPRT(("%s: %s subtotal rss %lu\n", id, pi.pr_fname, resisub)) } DBPRT(("%s: total rss %lu\n\n", id, resisize)) return (resisize); } /* * Return TRUE if any process in the session is over limit for memory usage. */ static int overmem_proc(tlist_head *phead, unsigned long limit) { char *id = "overmem_proc"; int fd; char procname[100]; struct dirent *dent; prpsinfo_t pi; rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); } continue; } if (!injob(phead, &pi)) continue; if (pagesize * pi.pr_size > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) pagesize = getpagesize(); return (PBSE_NONE); } /* * Declare start of polling loop. * * A no-op on the SGI. */ int mom_get_sample(void) { return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname,"cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(&pjob->ji_tasks)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname,"pcput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcpu_proc(&pjob->ji_tasks, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(&pjob->ji_tasks)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(&pjob->ji_tasks, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)value * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(&pjob->ji_tasks); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(&pjob->ji_tasks) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(&pjob->ji_tasks) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int fd; char procname[100]; struct dirent *dent; prpsinfo_t pi; int sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); } continue; } if (sesid == pi.pr_sid) { (void)kill(pi.pr_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. */ int mom_close_poll(void) { char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) if (pdir) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return a -1 on error or sid. */ long mach_restart(task *ptask, char *file) { return (-1); } #define dsecs(val) ( (double)(val).tv_sec + ((double)(val).tv_nsec * 1.0e-9) ) char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int fd; struct dirent *dent; char procname[100]; double cputime, addtime; prstatus_t ps; cputime = 0.0; rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCSTATUS, &ps) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCSTATUS)", procname); log_err(errno, id, log_buffer); continue; } if (jobid != ps.pr_sid) continue; found = 1; addtime = dsecs(ps.pr_utime) + dsecs(ps.pr_stime) + dsecs(ps.pr_cutime) + dsecs(ps.pr_cstime); cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, ps.pr_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; char procname[100]; double cputime; int fd; prstatus_t ps; cputime = 0.0; sprintf(procname, procfmtd, pid); if ((fd = open(procname, O_RDONLY)) == -1) { rm_errno = RM_ERR_EXIST; return NULL; } if (ioctl(fd, PIOCSTATUS, &ps) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCSTATUS)", procname); log_err(errno, id, log_buffer); close(fd); rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = dsecs(ps.pr_utime) + dsecs(ps.pr_stime) + dsecs(ps.pr_cutime) + dsecs(ps.pr_cstime); close(fd); sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(sid) pid_t sid; { ulong memsize; static tlist_head taskhead; static task onetask; static int first = 1; if (first) { CLEAR_HEAD(taskhead); CLEAR_LINK(onetask.ti_jobtask); append_link(&taskhead, &onetask.ti_jobtask, &onetask); first = 0; } onetask.ti_qs.ti_sid = sid; memsize = mem_sum(&taskhead); if (memsize == 0) { rm_errno = RM_ERR_EXIST; return NULL; } else { sprintf(ret_string, "%lukb", memsize >> 10); /* in KB */ return ret_string; } } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; char procname[100]; int fd; prpsinfo_t pi; sprintf(procname, procfmtd, pid); if ((fd = open(procname, O_RDONLY)) == -1) { rm_errno = RM_ERR_EXIST; return NULL; } if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); close(fd); rm_errno = RM_ERR_SYSTEM; return NULL; } close(fd); sprintf(ret_string, "%lukb", ((ulong)pi.pr_size * (ulong)pagesize) >> 10); /* in KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; ulong resisize; int fd; int found = 0; char procname[100]; struct dirent *dent; prpsinfo_t pi; resisize = 0; rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if (jobid != pi.pr_sid) continue; found = 1; resisize += pi.pr_rssize; } if (found) { /* in KB */ sprintf(ret_string, "%lukb", (resisize * (ulong)pagesize) >> 10); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; char procname[100]; int fd; prpsinfo_t pi; sprintf(procname, procfmtd, pid); if ((fd = open(procname, O_RDONLY)) == -1) { rm_errno = RM_ERR_EXIST; return NULL; } if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); close(fd); rm_errno = RM_ERR_SYSTEM; return NULL; } close(fd); sprintf(ret_string, "%lukb", ((ulong)pi.pr_rssize * (ulong)pagesize) >> 1024); /* KB */ return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int fd, j; struct dirent *dent; prpsinfo_t pi; char procname[100]; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if (pi.pr_uid == 0) continue; if ((jobid = pi.pr_sid) == 0) continue; DBPRT(("%s[%d]: pid %d sid %d\n", id, njids, pi.pr_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int fd; char procname[100]; struct dirent *dent; prpsinfo_t pi; int i; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } /* ** Search for members of session */ rewinddir(pdir); fmt = ret_string; for (fd = -1, num_pids = 0; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } DBPRT(("%s[%d]: pid: %s sid %d\n", id, num_pids, dent->d_name, pi.pr_sid)) if (jobid != pi.pr_sid) continue; sprintf(fmt, "%s ", dent->d_name); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int fd, j; struct dirent *dent; prpsinfo_t pi; char procname[100]; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if ((uid = pi.pr_uid) == 0) continue; DBPRT(("%s[%d]: pid %d uid %d\n", id, nuids, pi.pr_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%d blocks=%d\n", id, fsbuf.f_bsize, fsbuf.f_blocks)) sprintf(ret_string, "%lukb", ((ulong)fsbuf.f_bsize * (ulong)fsbuf.f_blocks) >> 10); /* KB */ return ret_string; } static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%d bfree=%d\n", id, fsbuf.f_bsize, fsbuf.f_bfree)) sprintf(ret_string, "%lukb", ((ulong)fsbuf.f_bsize * (ulong)fsbuf.f_bfree) >> 10); /* KB */ return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; unsigned int pmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%d", sysmp(MP_NAPROCS)); system_ncpus = sysmp(MP_NAPROCS); return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; unsigned int pmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (lseek(kfd, (off_t)kern_addr[KSYM_PHYS], SEEK_SET) == -1) { sprintf(log_buffer, "lseek to 0x%x", kern_addr[KSYM_PHYS]); log_err(errno, id, log_buffer); rm_errno = RM_ERR_SYSTEM; return NULL; } if (read(kfd, (char *)&pmem, sizeof(pmem)) != sizeof(pmem)) { log_err(errno, id, "read"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* return KB */ sprintf(ret_string, "%lukb", ((ulong)pmem * (ulong)pagesize) >> 10); return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%lukb", (ulong)(((double)fsbuf.f_bsize * (double)fsbuf.f_bfree) / 1024.0)); /* KB */ return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; char procname[100]; int fd; int value, job, found = 0; time_t now, start; prpsinfo_t pi; struct dirent *dent; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if (job) { if (value != pi.pr_sid) continue; } else { if ((pid_t)value != pi.pr_pid) continue; } found = 1; start = MIN(start, pi.pr_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; long load; if (lseek(kfd, (off_t)kern_addr[KSYM_LOAD], SEEK_SET) == -1) { sprintf(log_buffer, "lseek to 0x%x", kern_addr[KSYM_LOAD]); log_err(errno, id, log_buffer); return (rm_errno = RM_ERR_SYSTEM); } if (read(kfd, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "read"); return (rm_errno = RM_ERR_SYSTEM); } /* ** SGI does not have FSCALE like the SUN so the 1024 ** divisor was found by experment compairing the result ** of this routine to uptime. */ *rv = (double)load / 1024.0; return 0; } u_long gracetime(u_long secs) { time_t now = time((time_t *)NULL); if (secs > now) /* time is in the future */ return (secs - now); else return 0; } static char * quota(struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct mntent *me; struct dqblk qi; FILE *m; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if ((m = setmntent(MOUNTED, "r")) == NULL) { log_err(errno, id, "setmntent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((me = getmntent(m)) != NULL) { if (strcmp(me->mnt_type, MNTTYPE_IGNORE) == 0) continue; if (stat(me->mnt_dir, &sb) == -1) { sprintf(log_buffer, "stat: %s", me->mnt_dir); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", me->mnt_fsname, me->mnt_dir, sb.st_dev)) if (sb.st_dev == dirdev) break; } endmntent(m); if (me == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if (hasmntopt(me, MNTOPT_QUOTA) == NULL) { sprintf(log_buffer, "no quotas on filesystem %s", me->mnt_dir); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } uid = pw->pw_uid; } if (quotactl(Q_GETQUOTA, me->mnt_fsname, uid, (caddr_t)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* all in KB */ switch (type) { case harddata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_bhardlimit) >> 10); break; case softdata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_bsoftlimit) >> 10); break; case currdata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_curblocks) >> 10); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_fhardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_fsoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curfiles); break; case timedata: sprintf(ret_string, "%u", gracetime((u_long)qi.dqb_btimelimit)); break; case timefile: sprintf(ret_string, "%u", gracetime((u_long)qi.dqb_ftimelimit)); break; } return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/irix5/Makefile.am0000664000113300011330000000030611272401244015215 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/irix6array/0000777000113300011330000000000011614035173014310 500000000000000torque-2.4.16/src/resmom/irix6array/mom_start.c0000664000113300011330000003107511272401243016400 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ static PROJ sgiprojtoken; /* * open_sgi_proj() - open access to project files for use by set_sgi_proj() */ int open_sgi_proj(void) { sgiprojtoken = openproj(NULL, NULL); if (sgiprojtoken == NULL) { LOG_EVENT(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, "open_sgi_proj", "could not open project id files"); return -1; } else { return 0; } } /* * set_sgi_proj - set SGI project id for job/task * * As a side effect, the access to the project files is closed. */ int set_sgi_proj( char *usern, /* the user name */ attribute *acct /* the account attribute or NULL */ ) { prid_t prid; if ((acct == 0) || ((acct->at_flags & ATR_VFLAG_SET) == 0)) { /* use default projid for user */ prid = fgetdfltprojuser(sgiprojtoken, usern); } else { /* use Account as project name, if valid --- convert to id */ prid = fvalidateproj(sgiprojtoken, usern, acct->at_val.at_str); } if ((prid == -1) || (setprid(prid) == -1)) return -1; closeproj(sgiprojtoken); return 0; } /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; char cvtbuf[20]; if (pjob->ji_globid == NULL || strcmp(pjob->ji_globid, noglobid) == 0) { if (newarraysess() == -1) { sprintf(log_buffer, "newarraysess failed %d", errno); return (-2); } sjr->sj_ash = getash(); #ifdef ARSOP_RESTRICT_NEW /* prevent SGI's mpirun from changing the ASH */ if (arsop(ARSOP_RESTRICT_NEW, sjr->sj_ash, 0, 0) == -1) { sprintf(log_buffer, "arsop failed %d", errno); return (-2); } #endif /* ARSOP_RESTRICT_NEW */ } else { if (sscanf(pjob->ji_globid, "%llx", &sjr->sj_ash) != 1) { sprintf(log_buffer, "invalid global id %s", pjob->ji_globid); return (-2); } if (syssgi(SGI_JOINARRAYSESS, -1, &sjr->sj_ash) == -1) { sprintf(log_buffer, "cannot set ash %llx err %d", sjr->sj_ash, errno); return (-2); } } if (set_sgi_proj(pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str, &pjob->ji_wattr[(int)JOB_ATR_account]) < 0) { (void)sprintf(log_buffer, "Invalid project id"); return (-2); } return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid( job *pjob, /* I */ struct startjob_rtn *sjr) /* I (optional) */ { char cvtbuf[20]; if (pjob == NULL) { return; } if (sjr != NULL) { sprintf(cvtbuf, "%llx", sjr->sj_ash); } else { cvtbuf[0] = '\0'; } if (pjob->ji_globid) free(pjob->ji_globid); pjob->ji_globid = strdup(cvtbuf); decode_str( &pjob->ji_wattr[JOB_ATR_altid], ATTR_altid, NULL, cvtbuf); pjob->ji_wattr[(int)JOB_ATR_altid].at_flags |= ATR_VFLAG_SEND; return; } /* END set_globid() */ /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars(job *pjob, struct var_table *vtab) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_RUNNING) mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } /* ** We found task within the job which has exited. */ DBPRT(("%s: task %ld pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "task %ld terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ int open_master( char **rtn_name /* RETURN name of slave pts */ ) { int fds; *rtn_name = _getpty(&fds, O_RDWR | O_NOCTTY, 0600, 1); if (*rtn_name == (char *)0) return (-1); else return (fds); } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/irix6array/mom_mach.h0000664000113300011330000001247211272401243016160 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: sgi */ #ifndef MOM_MACH #define MOM_MACH "irix6array" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ ash_t sj_ash; /* Irix 6.x Array Session Handle */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/irix6array/Makefile.in0000664000113300011330000004400611605403753016302 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/irix6array ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/irix6array/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/irix6array/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/irix6array/pe_input.c0000664000113300011330000001062611272401243016215 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For irix - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/irix6array/mom_mach.c0000664000113300011330000015025011272401243016150 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if MOM_CHECKPOINT == 1 #include #endif /* MOM_CHECKPOINT */ #if NODEMASK != 0 #include #include #include #endif /* NODEMASK */ #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a Silicon Graphics (SGI) machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** loadave current load average ** quota quota information (sizes in KB) */ static char ident[] = "@(#) sgi/$RCSfile$ $Revision: 3151 $"; #define SGI_ZOMBIE_WRONG 1 #define COMPLEX_MEM_CALC 0 #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #if COMPLEX_MEM_CALC==1 static char procfs[] = "/proc"; static char procfmts[] = "/proc/%s"; #else static char procfs[] = "/proc/pinfo"; static char procfmts[] = "/proc/pinfo/%s"; #endif /* COMPLEX_MEM_CALC */ static DIR *pdir = NULL; static int pagesize; static int kfd = -1; static time_t sampletime; #define TBL_INC 100 /* initial proc table */ #define MAPNUM 512 /* max number of mem segs */ static int nproc = 0; static int max_proc = 0; struct proc_info { prpsinfo_t info; #if COMPLEX_MEM_CALC==1 int map_num; prmap_sgi_t *map; #endif /* COMPLEX_MEM_CALC */ ash_t procash; }; static struct proc_info *proc_array = NULL; extern char *ret_string; time_t wait_time = 10; extern char extra_parm[]; extern char no_parm[]; extern time_t time_now; extern time_t last_scan; /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern char *loadave A_((struct rm_attribute *attrib)); extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions and data */ static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); #if NODEMASK != 0 static char *availmask A_((struct rm_attribute *attrib)); #endif /* NODEMASK */ extern char *nullproc A_((struct rm_attribute *attrib)); /* ** local resource array */ struct config dependent_config[] = { { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "quota", {quota} }, #if NODEMASK != 0 { "availmask", {availmask} }, #endif /* NODEMASK */ { NULL, {nullproc} }, }; off_t kern_addr[] = { -1, /* KSYM_PHYS */ -1, /* KSYM_LOAD */ }; #define KSYM_PHYS 0 #define KSYM_LOAD 1 void dep_initialize(void) { int i; char *id = "dep_initialize"; static char mem[] = "/dev/kmem"; pagesize = getpagesize(); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } kern_addr[KSYM_PHYS] = SEEKLIMIT & sysmp(MP_KERNADDR, MPKA_PHYSMEM); kern_addr[KSYM_LOAD] = SEEKLIMIT & sysmp(MP_KERNADDR, MPKA_AVENRUN); if ((kfd = open(mem, O_RDONLY)) == -1) { log_err(errno, id, mem); return; } /* insure /dev/kmem closed on exec */ if ((i = fcntl(kfd, F_GETFD)) == -1) { log_err(errno, id, "F_GETFD"); } i |= FD_CLOEXEC; if (fcntl(kfd, F_SETFD, i) == -1) { log_err(errno, id, "F_SETFD"); } return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) { closedir(pdir); pdir = NULL; } if (kfd != -1) close(kfd); } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned 64 bit integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(pres, ret) resource *pres; rlim64_t *ret; { rlim64_t value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { value *= sizeof(int); } *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int getlong(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a timestruc_t pointer. Returns unsigned long * time in seconds, rounded. */ #define tv(val) (ulong)((val).tv_sec + ((val).tv_nsec + 500000000)/1000000000) /* ** Scan a list of tasks and return true if one of them matches ** the ash. */ static int injob(pjob, pash) job *pjob; ash_t *pash; { ash_t ash; sscanf(pjob->ji_globid, "%llx", &ash); return (ash == *pash); } /* * Internal session cpu time decoding routine. * * Accepts a head of a task list. Returns the sum of all cpu time * consumed for all tasks in the list, in seconds, adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_ses"; int i; int inproc = 0; ulong cputime; ulong deltat; int nps = 0; ulong proctime; ulong perc; prpsinfo_t *pi; cputime = 0; if (pjob->ji_globid == NULL) { pjob->ji_flags |= MOM_NO_PROC; return (cputime); } for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(pjob, &proc_array[i].procash)) if (!inproc) continue; else break; inproc = 1; nps++; proctime = tv(pi->pr_time) + tv(pi->pr_ctime); cputime += proctime; DBPRT(("%s: ses %d pid %d pcput %lu cputime %lu\n", id, pi->pr_sid, pi->pr_pid, proctime, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcpu_proc(job *pjob, unsigned long limit) { ulong cputime; int i; int inproc = 0; prpsinfo_t *pi; if (pjob->ji_globid == NULL) return FALSE; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(pjob, &proc_array[i].procash)) if (!inproc) continue; else break; inproc = 1; cputime = tv(pi->pr_time) + tv(pi->pr_ctime); if (cputime > limit) return (TRUE); } return (FALSE); } /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the list of tasks. */ static rlim64_t mem_sum(pjob) job *pjob; { static char id[] = "mem_sum"; int i; int inproc = 0; rlim64_t segadd; prpsinfo_t *pi; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) segadd = 0; if (pjob->ji_globid == NULL) return (segadd); for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(pjob, &proc_array[i].procash)) if (!inproc) continue; else break; DBPRT(("%s: %s(%d:%d) mem %llu\n", id, pi->pr_fname, pi->pr_sid, pi->pr_pid, (rlim64_t)((rlim64_t)pi->pr_size * (rlim64_t)pagesize))) segadd += (rlim64_t)((rlim64_t)pi->pr_size * (rlim64_t)pagesize); } DBPRT(("%s: total mem %llu\n\n", id, segadd)) return (segadd); } #if COMPLEX_MEM_CALC==1 /* * Internal session resident memory size function. COMPLEX VERSION * * Returns in a 64 bit intege the number of bytes used by session */ static rlim64_t resi_sum(pjob) job *pjob; { static char id[] = "resi_sum"; rlim64_t resisize, resisub; int num, i, j; int inproc = 0; prpsinfo_t *pi; prmap_sgi_t *mp; u_long lastseg, nbps; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) resisize = 0; if (pjob->ji_globid == NULL) return (resisize); lastseg = 99999; nbps = (pagesize / sizeof(uint_t)) * pagesize; /* sysmacros.h says "4Meg" ...hmmm */ for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(pjob, &proc_array[i].procash)) if (!inproc) continue; else break; DBPRT(("%s: %s(%d:%d) rss %llu (%lu pages)\n", id, pi->pr_fname, pi->pr_sid, pi->pr_pid, (rlim64_t)((rlim64_t)pi->pr_rssize*(rlim64_t)pagesize), pi->pr_rssize)) resisub = 0; num = proc_array[i].map_num; mp = proc_array[i].map; for (j = 0; j < num; j++, mp++) { u_long cnt = mp->pr_mflags >> MA_REFCNT_SHIFT; u_long end = (u_long)mp->pr_vaddr + mp->pr_size - 1; u_long seg1 = (u_long)mp->pr_vaddr / nbps; u_long seg2 = end / nbps; rlim64_t numseg = seg2 - seg1; if (lastseg != seg2) numseg++; lastseg = seg2; numseg = numseg * pagesize / cnt; numseg += mp->pr_wsize * pagesize / MA_WSIZE_FRAC / cnt; resisub += numseg; DBPRT(("%s: %d\t%lluk\t%lluk\n", id, j, numseg / 1024, resisub / 1024)) } resisize += resisub; DBPRT(("%s: %s subtotal rss %llu\n", id, pi->pr_fname, resisub)) } DBPRT(("%s: total rss %llu\n\n", id, resisize)) return (resisize); } #else /* COMPLEX_MEM_CALC==0 */ /* * Internal session mem (workingset) size function. SIMPLE CALC VERSION * * Returns in a 64 bit intege the number of bytes used by session */ static rlim64_t resi_sum(pjob) job *pjob; { static char id[] = "resi_sum"; int i; int inproc = 0; rlim64_t resisize, resisub; prpsinfo_t *pi; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(pjob, &proc_array[i].procash)) if (!inproc) continue; else break; DBPRT(("%s: %s(%d:%d) rss %llu (%lu pages)\n", id, pi->pr_fname, pi->pr_sid, pi->pr_pid, (rlim64_t)((rlim64_t)pi->pr_rssize*(rlim64_t)pagesize), pi->pr_rssize)) resisize += (rlim64_t)((rlim64_t)pagesize * pi->pr_rssize); } DBPRT(("%s: total rss %llu\n\n", id, resisize)) return (resisize); } #endif /* COMPLEX_MEM_CALC */ /* * Return TRUE if any process in the session is over limit for memory usage. */ static int overmem_proc(pjob, limit) job *pjob; rlim64_t limit; { int i; int inproc = 0; prpsinfo_t *pi; if (pjob->ji_globid == NULL) return (FALSE); for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(pjob, &proc_array[i].procash)) if (!inproc) continue; else break; if ((rlim64_t)((rlim64_t)pagesize * pi->pr_size) > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; rlim64_t sizeval; /* place to build 64 bit value */ unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit64 res64lim; rlim64_t mem_limit = 0; #if NODEMASK != 0 __uint64_t rvalue; __uint64_t nodemask; #endif /* NODEMASK */ log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "ncpus") == 0) { char hold[16]; extern struct var_table vtable; retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); sprintf(hold, "%d", (int)pres->rs_value.at_val.at_long); bld_env_variables(&vtable, "NCPUS", hold); } else if (strcmp(pname, "cput") == 0) /* check */ { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); res64lim.rlim_cur = res64lim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit64(RLIMIT_CPU, &res64lim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); res64lim.rlim_cur = res64lim.rlim_max = sizeval; if (setrlimit64(RLIMIT_FSIZE, &res64lim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (sizeval < mem_limit)) mem_limit = sizeval; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (sizeval < mem_limit)) mem_limit = sizeval; } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); res64lim.rlim_cur = res64lim.rlim_max = sizeval; if (setrlimit64(RLIMIT_RSS, &res64lim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } #if NODEMASK != 0 } else if (strcmp(pname, "nodemask") == 0) /* set nodemask */ { /* call special node mask function */ nodemask = pres->rs_value.at_val.at_ll; rvalue = (__uint64_t)pmoctl(61, nodemask, 0); if (rvalue != nodemask) { (void)sprintf(log_buffer, "Tried to set node mask to 0x%0llx, was set to 0x%0llx", nodemask, rvalue); LOG_EVENT(PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } #endif /* NODEMASK */ } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { res64lim.rlim_cur = res64lim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit64(RLIMIT_VMEM, &res64lim) < 0)) return (error("RLIMIT_VMEM", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "mem") == 0 || strcmp(pname, "ncpus") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. * Also open sgi project files. */ int mom_open_poll(void) { char *id = "mom_open_poll"; extern int open_sgi_proj(); DBPRT(("%s: entered\n", id)) pagesize = getpagesize(); proc_array = (struct proc_info *)calloc(TBL_INC, sizeof(struct proc_info)); if (proc_array == NULL) { log_err(errno, id, "malloc"); return (PBSE_SYSTEM); } max_proc = TBL_INC; return (open_sgi_proj()); } /* * Declare start of polling loop. * * for each job, obtain ASH from task tables * then obtain list of pids in each ASH in turn * open and process /proc/(pid) */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; int fd; struct dirent *dent; char procname[100]; int np; int num; int mapsize; time_t currtime; prmap_sgi_arg_t maparg; struct proc_info *pi; prmap_sgi_t map[MAPNUM]; job *pjob; aspidlist_t *taskpids = 0; ash_t ash; extern aserror_t aserrorcode; extern tlist_head svr_alljobs; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) rewinddir(pdir); nproc = 0; pi = proc_array; mapsize = sizeof(prmap_sgi_t) * MAPNUM; maparg.pr_size = mapsize; currtime = time(0); for (pjob = (job *)GET_NEXT(svr_alljobs); pjob; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) continue; if (pjob->ji_globid == NULL) continue; sscanf(pjob->ji_globid, "%llx", &ash); DBPRT(("%s: looking at job %s ASH %llx\n", id, pjob->ji_qs.ji_jobid, ash)) taskpids = aspidsinash_local(ash); if (taskpids == NULL) { sprintf(log_buffer, "no pids in ash %lld for job %s", ash, pjob->ji_qs.ji_jobid); log_err(aserrorcode, id, log_buffer); continue; } for (np = 0; np < taskpids->numpids; ++np, (void)close(fd)) { DBPRT(("%s:\t\t pid %d\n", id, taskpids->pids[np])) sprintf(procname, "%s/%d", procfs, taskpids->pids[np]); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi->info) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); } continue; } #if COMPLEX_MEM_CALC==1 if (pi->map) { free(pi->map); /* free any old space */ pi->map = NULL; } pi->map_num = 0; maparg.pr_vaddr = (caddr_t)map; if ((num = ioctl(fd, PIOCMAP_SGI, &maparg)) == -1) { if (errno != ENOENT) log_err(errno, id, "ioctl(PIOCMAP_SGI)"); free(map); continue; } if (num > 0) { size_t nb = sizeof(prmap_sgi_t) * num; assert(num < MAPNUM); pi->map = (prmap_sgi_t *) malloc(nb); memcpy(pi->map, map, nb); pi->map_num = num; } #endif /* COMPLEX_MEM_CALC */ /* save the ASH to which the proc belongs */ pi->procash = ash; if (++nproc == max_proc) { struct proc_info *hold; DBPRT(("%s: alloc more table space %d\n", id, nproc)) max_proc *= 2; hold = (struct proc_info *)realloc(proc_array, max_proc * sizeof(struct proc_info)); assert(hold != NULL); proc_array = hold; memset(&proc_array[nproc], '\0', sizeof(struct proc_info) * (max_proc >> 1)); } pi = &proc_array[nproc]; } if (taskpids != NULL) asfreepidlist(taskpids, 0); } sampletime = time(0); if ((sampletime - currtime) > 5) { sprintf(log_buffer, "time lag %d secs", sampletime - currtime); log_err(-1, id, log_buffer); return PBSE_SYSTEM; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *pname; int retval; rlim64_t sizeval; unsigned long value, num; rlim64_t num64; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "ncpus") == 0) { attribute *at; resource_def *rd; resource *prescpup; retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); rd = find_resc_def(svr_resc_def, "cpupercent", svr_resc_size); assert(rd != NULL); prescpup = find_resc_entry(at, rd); assert(prescpup != NULL); num = prescpup->rs_value.at_val.at_long; if (num > (value*100 + 10)) { sprintf(log_buffer, "ncpus %.2f exceeded limit %lu", (float)num / 100.0, value); #if !defined(SGI_ZOMBIE_WRONG) return (TRUE); #else LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); #endif /* SGI_ZOMBIE_WRONG */ } } else if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; if (overcpu_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num64 = mem_sum(pjob)) > sizeval)) { sprintf(log_buffer, "vmem %llu exceeded limit %llu", num64, sizeval); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, sizeval))) { sprintf(log_buffer, "pvmem exceeded limit %llukb", sizeval); return (TRUE); } } else if (strcmp(pname, "mem") == 0) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) continue; if ((num64 = resi_sum(pjob)) > sizeval) { sprintf(log_buffer, "mem %llu exceeded limit %llu", num64, sizeval); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %lu exceeded limit %lu", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. */ int mom_set_use(job *pjob) { resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum, newcpu, oldcpu; long dur; unsigned long percent; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "cpupercent", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; oldcpu = *lp; lnum = cput_sum(pjob); if (lnum > *lp) { *lp = lnum; if ((dur = sampletime - pjob->ji_sampletim) > 10) { newcpu = *lp; /* save new cput */ rd = find_resc_def(svr_resc_def, "cpupercent", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; percent = (newcpu - oldcpu) * 100 / dur; *lp = MAX(*lp, percent); DBPRT(("cpu %% : ses %ld (new %lu - old %lu)/delta %ld = %lu%%\n", pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long, newcpu, oldcpu, dur, percent)) } pjob->ji_sampletim = sampletime; } rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* as KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; ash_t ash; int ct = 0; int np; struct startjob_rtn sgid; aspidlist_t *taskpids = 0; extern aserror_t aserrorcode; if (ptask->ti_job->ji_globid != NULL) { sscanf(ptask->ti_job->ji_globid, "%llx", &ash); } else { ash = asashofpid(ptask->ti_qs.ti_sid); sgid.sj_ash = ash; set_globid(ptask->ti_job, &sgid); } if ((ash != 0LL) && (ash != -1LL)) { taskpids = aspidsinash_local(ash); if (taskpids) { for (np = 0; np < taskpids->numpids; ++np) { (void)kill(taskpids->pids[np], sig); ++ct; } } else { sprintf(log_buffer, "no pids in ash %lld in %s", ash, id); log_err(aserrorcode, id, log_buffer); } } return ct; } /* * Clean up everything related to polling. */ int mom_close_poll(void) { char *id = "mom_close_poll"; int i; DBPRT(("%s: entered\n", id)) if (proc_array) { #if COMPLEX_MEM_CALC==1 for (i = 0; i < max_proc; i++) { struct proc_info *pi = &proc_array[i]; if (pi->map) free(pi->map); } #endif /* COMPLEX_MEM_CALC */ free(proc_array); } if (pdir) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { #if MOM_CHECKPOINT == 1 return (CST_MACH_DEP); #else /* MOM_CHECKPOINT */ return (CST_NONE); #endif /* MOM_CHECKPOINT */ } /* * Checkpoint the task. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { #if MOM_CHECKPOINT == 1 ash_t ash; sscanf(ptask->ti_job->ji_globid, "%llx", &ash); /* ckpt_setup(0, 0); Does nothing so why have it */ if (abort) cpr_flags = CKPT_CHECKPOINT_KILL | CKPT_NQE; else cpr_flags = CKPT_CHECKPOINT_CONT | CKPT_NQE; return (ckpt_create(file, ash, P_ASH, 0, 0)); /* return ( ckpt_create(file, ptask->ti_qs.ti_sid, P_SID, 0, 0) ); */ #else /* MOM_CHECKPOINT */ return (-1); #endif /* MOM_CHECKPOINT */ } /* * Restart the task from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { #if MOM_CHECKPOINT == 1 ckpt_id_t rc; ash_t momash; ash_t oldash = 0; char cvtbuf[20]; cpr_flags = CKPT_NQE; /* KLUDGE to work-around SGI problem, for some reason ckpt_restart() */ /* passes open file descriptor to /proc to restarted process */ if (pdir) closedir(pdir); /* To restart the job with its old ASH, Mom must be in that ASH */ /* When she does the restart. However, before changing to that */ /* ASH, Mom must put herself in a new ASH all by herself, otherwise */ /* she will take other system daemons with her into the job's ASH */ momash = getash(); newarraysess(); /* isolate Mom in a ASH by herself */ if (ptask->ti_job->ji_globid != NULL) { /* now get job's old ASH and set it */ sscanf(ptask->ti_job->ji_globid, "%llx", &oldash); if (setash(oldash) == -1) { DBPRT(("setash failed before restart, errno = %d", errno)) } } rc = ckpt_restart(file, (struct ckpt_args **)0, 0); if ((ptask->ti_job->ji_globid == NULL) && (rc > 0)) { (void)sprintf(cvtbuf, "%llx", rc); ptask->ti_job->ji_globid = strdup(cvtbuf); } newarraysess(); /* again, isolate Mom into ASH by herself */ if (setash(momash) == -1) /* put Mom back to her old ASH */ { DBPRT(("setash failed after restart, errno = %d", errno)) } /* KLUDGE TO work-around SGI problem, ckpt_restart sets the uid of */ /* the calling process (me) to that of the restarted process */ (void)setuid(0); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, "mach_restart", "opendir"); } return ((int)rc); #else /* MOM_CHECKPOINT */ return (-1); #endif /* MOM_CHECKPOINT */ } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput(struct rm_attribute *attrib) { rm_errno = RM_ERR_UNKNOWN; return NULL; } char * mem(struct rm_attribute *attrib) { rm_errno = RM_ERR_UNKNOWN; return NULL; } char * sessions(struct rm_attribute *attrib) { rm_errno = RM_ERR_UNKNOWN; return NULL; } char * pids(struct rm_attribute *attrib) { rm_errno = RM_ERR_UNKNOWN; return NULL; } char * nsessions(struct rm_attribute *attrib) { rm_errno = RM_ERR_UNKNOWN; return NULL; } char * nusers(struct rm_attribute *attrib) { rm_errno = RM_ERR_UNKNOWN; return NULL; } static char * totmem(struct rm_attribute *attrib) { static char id[] = "totmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%ld blocks=%lld\n", id, fsbuf.f_bsize, fsbuf.f_blocks)) sprintf(ret_string, "%llukb", ((rlim64_t)fsbuf.f_bsize * (rlim64_t)fsbuf.f_blocks) >> 10); return ret_string; } /* * availmem() - return amount of available memory in system in KB as string */ static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%ld bfree=%lld\n", id, fsbuf.f_bsize, fsbuf.f_bfree)) sprintf(ret_string, "%llukb", ((rlim64_t)fsbuf.f_bsize * (rlim64_t)fsbuf.f_bfree) >> 10); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ld", sysmp(MP_NAPROCS)); system_ncpus = sysmp(MP_NAPROCS); return ret_string; } /* * physmem() - return amount of physical memory in system in KB as string */ static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; unsigned int pmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (lseek(kfd, (off_t)kern_addr[KSYM_PHYS], SEEK_SET) == -1) { sprintf(log_buffer, "lseek to 0x%llx", kern_addr[KSYM_PHYS]); log_err(errno, id, log_buffer); rm_errno = RM_ERR_SYSTEM; return NULL; } if (read(kfd, (char *)&pmem, sizeof(pmem)) != sizeof(pmem)) { log_err(errno, id, "read"); rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%llukb", ((rlim64_t)pmem*(rlim64_t)pagesize) >> 10); return ret_string; } /* * size_fs() - return file system size in Kb as string */ char * size_fs(char *param) { char *id = "size_fs"; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%llukb", ((rlim64_t)fsbuf.f_bsize * (rlim64_t)fsbuf.f_bfree) >> 10); return ret_string; } /* * size_file() - return file size in Kb as string */ char * size_file(char *param) { char *id = "size_file"; struct stat64 sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat64(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%llukb", (sbuf.st_size + 512) >> 10); return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; static void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } int get_la(double *rv) { char *id = "get_la"; int load; if (lseek(kfd, (off_t)kern_addr[KSYM_LOAD], SEEK_SET) == -1) { sprintf(log_buffer, "lseek to 0x%llx", kern_addr[KSYM_LOAD]); log_err(errno, id, log_buffer); return (rm_errno = RM_ERR_SYSTEM); } if (read(kfd, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "read"); return (rm_errno = RM_ERR_SYSTEM); } /* ** SGI does not have FSCALE like the SUN so the 1024 ** divisor was found by experment compairing the result ** of this routine to uptime. */ *rv = (double)load / 1024.0; return 0; } u_long gracetime(u_long secs) { time_t now = time((time_t *)NULL); if (secs > now) /* time is in the future */ return (secs - now); else return 0; } static char * quota(struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct mntent *me; struct dqblk qi; FILE *m; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if ((m = setmntent(MOUNTED, "r")) == NULL) { log_err(errno, id, "setmntent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((me = getmntent(m)) != NULL) { if (strcmp(me->mnt_type, MNTTYPE_IGNORE) == 0) continue; if (stat(me->mnt_dir, &sb) == -1) { sprintf(log_buffer, "stat: %s", me->mnt_dir); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", me->mnt_fsname, me->mnt_dir, sb.st_dev)) if (sb.st_dev == dirdev) break; } endmntent(m); if (me == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if (hasmntopt(me, MNTOPT_QUOTA) == NULL) { sprintf(log_buffer, "no quotas on filesystem %s", me->mnt_dir); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } uid = pw->pw_uid; } if (quotactl(Q_GETQUOTA, me->mnt_fsname, uid, (caddr_t)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* all size values in KB */ switch (type) { case harddata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_bhardlimit) >> 10); break; case softdata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_bsoftlimit) >> 10); break; case currdata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_curblocks) >> 10); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_fhardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_fsoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curfiles); break; case timedata: sprintf(ret_string, "%lu", gracetime((u_long)qi.dqb_btimelimit)); break; case timefile: sprintf(ret_string, "%lu", gracetime((u_long)qi.dqb_ftimelimit)); break; } return ret_string; } #if NODEMASK != 0 #define MAXCNODES 64 /* Maximum number of nodes available in a nodemask. */ /* ** Return a MAXCNODES-bit string with a '1' in each position where there ** are two CPUs available for a node. */ static char * availmask(struct rm_attribute *attrib) { char *id = "availmask"; int nprocs, i; cnodeid_t cpumap[MAXCNODES * 2]; char nodect[MAXCNODES]; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } /* Initialize cpu/node count and cpumap. */ for (i = 0; i < MAXCNODES; i++) { nodect[i] = 0; cpumap[i * 2] = cpumap[i * 2 + 1] = -1; } nprocs = sysmp(MP_NPROCS); if (nprocs < 1) { log_err(errno, id, "sysmp(MP_NPROCS"); rm_errno = RM_ERR_SYSTEM; return (NULL); } if (sysmp(MP_NUMA_GETCPUNODEMAP, (void *)cpumap, sizeof(cnodeid_t) * nprocs) != 0) { log_err(errno, id, "sysmp(MP_NUMA_GETCPUNODEMAP"); rm_errno = RM_ERR_SYSTEM; return (NULL); } /* * cpumap[] now contains either -1, or the number of the node that * corresponds to that CPU. Each node needs to have 2 CPUs - count * up the references to each node, and generate the return string * based on whether exactly 2 CPUs map to the node at the n'th * position (from the right) or not. */ for (i = 0; i < MAXCNODES * 2; i++) if (cpumap[i] != (cnodeid_t)(-1)) nodect[cpumap[i]] ++; /* Create the null-terminated string for the nodect ref'd in map[]. */ for (i = 0; i < MAXCNODES; i++) ret_string[MAXCNODES - (i + 1)] = (nodect[i] == 2 ? '1' : '0'); ret_string[i] = '\0'; return ret_string; } #endif /* NODEMASK */ void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/irix6array/Makefile.am0000664000113300011330000000030611272401243016254 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/requests.c0000664000113300011330000025045311501722635014157 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dis.h" #include "libpbs.h" #include "pbs_error.h" #include "server_limits.h" #include "list_link.h" #include "credential.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "batch_request.h" #include "mom_mach.h" #include "mom_func.h" #include "log.h" #include "rpp.h" #include "resmon.h" #include "net_connect.h" #include "utils.h" #ifdef _CRAY #include #endif #ifdef HAVE_WORDEXP #include extern struct var_table vtable; /* see start_exec.c */ extern char **environ; extern int InitUserEnv( job *pjob, /* I */ task *ptask, /* I (optional) */ char **envp, /* I (optional) */ struct passwd *pwdp, /* I (optional) */ char *shell); /* I (optional) */ extern int mkdirtree( char *dirpath, /* I */ mode_t mode); extern int TTmpDirName(job*, char *); #endif /* HAVE_WORDEXP */ /* External Global Data Items */ extern unsigned int alarm_time; extern unsigned int default_server_port; extern int exiting_tasks; extern tlist_head svr_alljobs; extern char mom_host[]; extern char *msg_err_unlink; extern char *path_spool; extern char *path_undeliv; extern attribute_def job_attr_def[]; extern char *msg_jobmod; extern char *msg_manager; extern time_t time_now; extern int resc_access_perm; /* see encode_resc() */ extern int spoolasfinalname; /* in attr_fn_resc.c */ extern char MOMUNameMissing[]; extern int pbs_rm_port; extern char rcp_path[]; extern char rcp_args[]; extern char *TNoSpoolDirList[]; extern char path_checkpoint[]; /* Local Data Items */ static uid_t useruid; static gid_t usergid; static int ngroup; static int *groups; #if NO_SPOOL_OUTPUT == 0 static char *output_retained = "Output retained on that host in: "; #endif /* !NO_SPOOL_OUTPUT */ static char rcperr[MAXPATHLEN]; /* file to contain rcp error */ extern char PBSNodeMsgBuf[1024]; extern int LOGLEVEL; extern int im_compose A_((int, char *, char *, int, tm_event_t, tm_task_id)); extern int mom_open_socket_to_jobs_server A_((job *, char *, void (*) A_((int)))); /* prototypes */ char *get_job_envvar(job *, char *); int replace_checkpoint_path(char *); int in_remote_checkpoint_dir(char *); /* loaded in mom_mach.h */ /* END prototypes */ char *get_job_envvar( job *pjob, /* I */ char *variable) /* I */ { char *pc; if (pjob == NULL) { return(NULL); } pc = arst_string( variable, &pjob->ji_wattr[(int)JOB_ATR_variables]); if (pc != NULL) { if ((pc = strchr(pc, (int)'=')) != NULL) pc++; } return(pc); } /* END get_job_envvar() */ /* * fork_to_user - fork mom and go to user's home directory * also sets up the global useruid and usergid in the child * * WARNING: valid only if called when preq points to a cpyfiles structure */ static pid_t fork_to_user( struct batch_request *preq, /* I */ int SetUID, /* I (boolean) */ char *HDir, /* O (job/user home directory) */ char *EMsg) /* I (optional,minsize=1024) */ { char *id = "fork_to_user"; struct group *grpp; pid_t pid; job *pjob; struct passwd *pwdp; static int fgrp[NGROUPS_MAX]; char *idir; char *hdir; struct stat sb; /* initialize */ if (EMsg != NULL) EMsg[0] = '\0'; if ((pjob = find_job(preq->rq_ind.rq_cpyfile.rq_jobid)) && (pjob->ji_grpcache != 0) && (preq->rq_ind.rq_cpyfile.rq_dir != CKPT_DIR_IN) && (preq->rq_ind.rq_cpyfile.rq_dir != CKPT_DIR_OUT)) { /* use information cached in the job structure */ useruid = pjob->ji_qs.ji_un.ji_momt.ji_exuid; usergid = pjob->ji_qs.ji_un.ji_momt.ji_exgid; ngroup = pjob->ji_grpcache->gc_ngroup; groups = pjob->ji_grpcache->gc_groups; if ((idir = get_job_envvar(pjob, "PBS_O_INITDIR")) != NULL) { hdir = idir; } else { hdir = pjob->ji_grpcache->gc_homedir; } } else { if ((pwdp = getpwnam(preq->rq_ind.rq_cpyfile.rq_user)) == NULL) { if (MOMUNameMissing[0] == '\0') strncpy(MOMUNameMissing, preq->rq_ind.rq_cpyfile.rq_user, 64); sprintf(log_buffer, "cannot find user '%s' in password file", preq->rq_ind.rq_cpyfile.rq_user); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); log_err(errno, id, log_buffer); return(-PBSE_BADUSER); } useruid = pwdp->pw_uid; if (preq->rq_ind.rq_cpyfile.rq_group[0] == '\0') { usergid = pwdp->pw_gid; /* default to login group */ } else if ((grpp = getgrnam(preq->rq_ind.rq_cpyfile.rq_group)) != NULL) { usergid = grpp->gr_gid; } else { sprintf(log_buffer, "cannot find group '%s' for user '%s' in password file", preq->rq_ind.rq_cpyfile.rq_group, preq->rq_ind.rq_cpyfile.rq_user); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); log_err(errno, id, log_buffer); return(-PBSE_BADUSER); } ngroup = init_groups(pwdp->pw_name, usergid, NGROUPS_MAX, fgrp); if (ngroup < 0) ngroup = 0; groups = fgrp; /* determine user`s home directory */ if ((pjob != NULL) && ((idir = get_job_envvar(pjob, "PBS_O_INITDIR")) != NULL)) { hdir = idir; } else { hdir = pwdp->pw_dir; } } /* END if ((pjob = find_job(preq->rq_ind.rq_cpyfile.rq_jobid)) && ...) */ if (hdir == NULL) { /* FAILURE */ log_err(PBSE_UNKRESC, id, "cannot determine home directory"); if (EMsg != NULL) strncpy(EMsg, "cannot determine home directory", 1024); return(-PBSE_UNKRESC); } /* check user home directory as root and log failures */ /* NOTE: root may not be able to see user home directory due to root_squash permissions but routine will test and log what is detected. Some issues will be logged by the parent but TORQUE will only fail if the problems persist in the child after the setuid() call */ if (stat(hdir, &sb) != 0) { sprintf(log_buffer, "invalid home directory '%s' specified, errno=%d (%s)", hdir, errno, strerror(errno)); if (LOGLEVEL >= 2) { log_err(errno, id, log_buffer); } if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); /* NOTE: warn only, root may not be able to stat directory */ /* return(-PBSE_UNKRESC); */ } else if (!S_ISDIR(sb.st_mode)) { sprintf(log_buffer, "invalid home directory '%s' specified, not a directory", hdir); log_err(PBSE_UNKRESC, id, log_buffer); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); return(-PBSE_UNKRESC); } if (LOGLEVEL >= 1) { sprintf(log_buffer, "forking to user, uid: %ld gid: %ld homedir: '%s'", (long)useruid, (long)usergid, hdir); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "N/A", log_buffer); } if (HDir != NULL) strcpy(HDir, hdir); pid = fork_me(preq->rq_conn); if (pid < 0) { /* fork failed */ sprintf(log_buffer, "forked failed, errno=%d (%s)", errno, strerror(errno)); log_err(-1, id, log_buffer); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); return(-PBSE_SYSTEM); } if (pid > 0) { /* parent - note leave connection open */ free_br(preq); return(pid); } /* the child */ /* NOTE: writing to log as child may cause corruption */ #ifdef _CRAY if ((pjob = find_job(preq->rq_ind.rq_cpyfile.rq_jobid)) && (pjob->ji_grpcache != 0)) { /* set account id */ if (pjob->ji_wattr[(int)JOB_ATR_account].at_flags & ATR_VFLAG_SET) { acctid(0, nam2acid(pjob->ji_wattr[(int)JOB_ATR_account].at_val.at_str)); } } #endif /* _CRAY */ /* NOTE: only chdir now if SetUID is TRUE */ if (SetUID == TRUE) { if (setgroups(ngroup,(gid_t *)groups) != 0 || setgid(usergid) != 0) { /* unable to set user groups */ return(-PBSE_BADGRP); } if (setuid(useruid) == -1) { /* cannot run as the user */ return(-PBSE_BADUSER); } if (chdir(hdir) == -1) { /* cannot change directory to user home dir (or 'INITDIR' if specified) */ return(-PBSE_UNKRESC); } } #ifdef HAVE_WORDEXP { /* set some useful env variables */ char *envstr; envstr = malloc((strlen("HOME=") + strlen(hdir) + 1) * sizeof(char)); if (envstr == NULL) { sprintf(log_buffer, "malloc failed, errno=%d (%s)", errno, strerror(errno)); log_err(-1, id, log_buffer); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); return(-PBSE_SYSTEM); } sprintf(envstr, "HOME=%s", hdir); putenv(envstr); envstr = malloc((strlen("PBS_JOBID=") + strlen(preq->rq_ind.rq_cpyfile.rq_jobid) + 1) * sizeof(char)); if (envstr == NULL) { sprintf(log_buffer, "malloc failed, errno=%d (%s)", errno, strerror(errno)); log_err(-1, id, log_buffer); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); return(-PBSE_SYSTEM); } sprintf(envstr, "PBS_JOBID=%s", preq->rq_ind.rq_cpyfile.rq_jobid); putenv(envstr); } #endif /* END HAVE_WORDEXP */ return(pid); } /* END fork_to_user() */ /* * add_bad_list - add bad file message to bad file list */ static void add_bad_list( char **pbl, char *newtext, int nl) { int needed = 0; char *pnew; if (*pbl != NULL) { needed += strlen(*pbl) + strlen(newtext) + nl + 1; pnew = realloc(*pbl, needed); } else { needed += strlen(newtext) + nl + 1; pnew = malloc(needed); if (pnew != NULL) *pnew = '\0'; } if (pnew == NULL) { /* cannot allocate memory - FAILURE */ return; } *pbl = pnew; while (nl--) /* prefix new-lines */ strcat(*pbl, "\n"); strcat(*pbl, newtext); return; } /* END add_bad_list() */ #define RT_BLK_SZ 4096 /* return 0 on failure */ static int return_file( job *pjob, enum job_file which, int sock, int remove_file) { int amt; char buf[RT_BLK_SZ]; int fds; char *filename; struct batch_request *prq; int rc = 0; int seq = 0; filename = std_file_name(pjob, which, &amt); /* amt is place holder */ /* We need to check for NULL which may be returned */ if (filename == NULL) { return(-1); } if (strcmp(filename, "/dev/null") == 0) { return(0); } fds = open(filename, O_RDONLY, 0); if (fds < 0) { return(0); } prq = alloc_br(PBS_BATCH_MvJobFile); if (prq == NULL) { /* no memory */ return(PBSE_SYSTEM); } strcpy(prq->rq_host, mom_host); strcpy(prq->rq_ind.rq_jobfile.rq_jobid, pjob->ji_qs.ji_jobid); while ((amt = read(fds, buf, RT_BLK_SZ)) > 0) { /* prq->rq_ind.rq_jobfile.rq_sequence = seq++; */ /* prq->rq_ind.rq_jobfile.rq_type = (int)which; */ /* prq->rq_ind.rq_jobfile.rq_size = amt; */ /* prq->rq_ind.rq_jobfile.rq_data = buf; */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_MvJobFile, pbs_current_user)) || (rc = encode_DIS_JobFile(sock, seq++, buf, amt, pjob->ji_qs.ji_jobid, which)) || (rc = encode_DIS_ReqExtend(sock, NULL))) { break; } DIS_tcp_wflush(sock); if ((DIS_reply_read(sock, &prq->rq_reply) != 0) || (prq->rq_reply.brp_code != 0)) { close(fds); rc = -1; break; } } /* END while ((amt = read()) */ free_br(prq); close(fds); if (remove_file == TRUE && rc == 0) job_unlink_file(pjob, filename); return(rc); } /* END return_file() */ /* * wchost_match - wild card host name match * * return 1 if can"idate" matches master name * 0 if not a match * master name may be wild carded at beginning */ static int wchost_match( const char *can, /* I candidate */ const char *master) /* I */ { const char *pc; const char *pm; /* FORMAT: master = [*], candidate = */ /* start at end and work backwards */ pc = can + strlen(can) - 1; pm = master + strlen(master) - 1; while ((pc > can) && (pm > master)) { if (*pc != *pm) { /* no match */ return(0); } pc--; pm--; } /* comparison of one or both reached the start of the string */ if (pm == master) { if (*pm == '*') { /* reached master wild card, all candidates match */ return(1); } if ((pc == can) && (*pc == *pm)) { /* start of candidate reached, always match */ /* NOTE: this seems wrong (CRI) ie, can=dog.com master=*.bigdog.com */ return(1); } } /* no match */ return(0); } /* END wchost_match() */ /* Determine which local path to copy to if specified using $usecp */ static int told_to_cp( char *host, /* I */ char *oldpath, /* I */ char **newpath) /* O */ { int i; int nh; const char *id = "told_to_cp"; static char newp[MAXPATHLEN + 1]; char linkpath[MAXPATHLEN + 1]; int max_links; extern struct cphosts *pcphosts; for (max_links = 16;max_links > 0;max_links--) { for (nh = 0;nh < cphosts_num;nh++) { if (wchost_match(host, pcphosts[nh].cph_hosts)) { if (LOGLEVEL >= 5) { sprintf(log_buffer, "host '%s' pcphosts[%d].cph_hosts: %s", host, nh, pcphosts[nh].cph_hosts); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, (char *)id, log_buffer); } i = strlen(pcphosts[nh].cph_from); if (strncmp(pcphosts[nh].cph_from, oldpath, i) == 0) { int nchars, link_size; nchars = snprintf(newp, sizeof(newp), "%s%s", pcphosts[nh].cph_to, oldpath + i); if (nchars >= (int)sizeof(newp)) { snprintf(log_buffer, sizeof(log_buffer), "too long string when transforming path '%s' to '%s%s'\n", oldpath, pcphosts[nh].cph_to, oldpath + i); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, (char *)id, log_buffer); return(0); } link_size = readlink((const char *)newp, linkpath, sizeof(linkpath) - 1); if (link_size == -1) { /* * Catching only too many symbolic links, bad buffer * location and insufficient kernel memory cases. */ if (errno == ELOOP || errno == EFAULT || errno == ENOMEM) { snprintf(log_buffer, sizeof(log_buffer), "translation of symbolic link '%s' failed: %s\n", newp, strerror(errno)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, (char *)id, log_buffer); return(0); } /* * We're done. All other errors (if any) will be * reported in the respective routines. * * At least ENOENT and EINVAL are good error codes: * they correspond to non-existent object or to * object that is not a symbolic link. */ else { *newpath = newp; /* success */ return(1); } } else { linkpath[link_size] = '\0'; { snprintf(log_buffer, sizeof(log_buffer), "translated symbolic link '%s:%s' to '%s:%s'; " "restarting $usecp search\n", host, newp, host, linkpath); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, (char *)id, log_buffer); } oldpath = linkpath; } break; } } if (LOGLEVEL >= 5) { sprintf(log_buffer, "host '%s' and path '%s' does not match usecp[%d] (host '%s' path '%s')\n", host, oldpath, nh, (pcphosts + nh)->cph_hosts, (pcphosts + nh)->cph_from); log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, (char *)id, log_buffer); } } /* END for (nh) */ } /* END for (max_links) */ /* failure */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "no local path matches host '%s' and path '%s' (%d paths checked)\n", host, oldpath, nh); log_ext(-1, (char *)id, log_buffer, LOG_DEBUG); } return(0); } /* END told_to_cp() */ /* * local_or_remote() - is the specified path to a local or remote file * checks to see if there is a hostname which matches this host * * returns: 1 if remote and 0 if local * also updates the path pointer to just the path name if local */ static int local_or_remote( char **path) /* I */ { int len; char *pcolon; pcolon = strchr(*path, (int)':'); if (pcolon == NULL) { /* local file */ return(0); } *pcolon = '\0'; len = strlen(*path); if ((strncmp("localhost", *path, 9) == 0) || ((strncmp(mom_host, *path, len) == 0) && ((mom_host[len] == '\0') || (mom_host[len] == '.')))) { /* we have a host match, file is local */ *pcolon = ':'; *path = pcolon + 1; /* local file */ return(0); } else if (told_to_cp(*path, pcolon + 1, path)) { /* path updated in told_to_cp() */ /* local file */ return(0); } /* remote file */ *pcolon = ':'; return(1); } /* END local_or_remote() */ /* * is_file_same() - are two paths pointing to the same file * returns: 1 if are the same * 0 if not the same (or cannot tell) */ static int is_file_same( char *file1, char *file2) { #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) struct stat64 sb1, sb2; #else struct stat sb1, sb2; #endif #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) if ((stat64(file1, &sb1) == 0) && (stat64(file2, &sb2) == 0)) #else if ((stat(file1, &sb1) == 0) && (stat(file2, &sb2) == 0)) #endif { if (!memcmp(&sb1.st_dev, &sb2.st_dev, sizeof(dev_t)) && !memcmp(&sb1.st_ino, &sb2.st_ino, sizeof(ino_t))) { /* files are same */ return(1); } } return(0); } /* End of is_file_same() */ /* * is_file_going_to_dir() - is file going to destination directory * returns: 1 if file is going to directory * 0 if not going to the directory or destiation is not a directory (or cannot tell) */ static int is_file_going_to_dir( char *file, char *destdir) { char *id = "is_file_going_to_dir"; #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) struct stat64 sb1; #else struct stat sb1; #endif #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) if (stat64(destdir, &sb1) == 0) #else if (stat(destdir, &sb1) == 0) #endif { char *ptr1; char filename[MAXPATHLEN+1]; int complen = 0; /* Make sure the destination is a directory */ if (!S_ISDIR(sb1.st_mode)) { /* destination is not a directory */ return(0); } strcpy(filename,file); /* Does directory match the files path? */ ptr1 = strrchr(filename, '/'); if (ptr1 != NULL) { ptr1[0] = '\0'; complen = strlen(destdir); if (destdir[complen - 1] == '/') { /* don't include trailing slash (if any) in comparision */ complen--; } if (memcmp(filename, destdir, complen) == 0) { /* file is going to directory*/ return(1); } } } else if (errno == 2) { /* * This is okay. Probably a file that does not yet exist because * we have not copied it yet */ } else { sprintf(log_buffer, "File %s stat failed, errno = %d", destdir, errno); log_err(-1, id, log_buffer); } return(0); } /* End of is_file_going_to_dir() */ void req_deletejob( struct batch_request *preq) /* I */ { job *pjob; pjob = find_job(preq->rq_ind.rq_delete.rq_objname); if (pjob != NULL) { if (LOGLEVEL >= 3) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "deleting job"); } /* assume success? */ mom_deljob(pjob); reply_ack(preq); } else { req_reject(PBSE_UNKJOBID, 0, preq, mom_host, "cannot locate job to delete"); } return; } /* END req_deletejob() */ /* * req_holdjob - checkpoint and terminate job */ void req_holdjob( struct batch_request *preq) { int rc; job *pjob; svrattrl *pal; attribute tmph; /* If checkpoint supported, do it and terminate the job */ /* otherwise, return PBSE_NOSUP */ if ((pjob = find_job(preq->rq_ind.rq_hold.rq_orig.rq_objname)) == NULL) { rc = PBSE_UNKJOBID; } else { /* propagate servers hold state to job */ clear_attr(&tmph, &job_attr_def[(int)JOB_ATR_hold]); if ((pal = (svrattrl *)GET_NEXT(preq->rq_ind.rq_hold.rq_orig.rq_attr)) != NULL) { job_attr_def[(int)JOB_ATR_hold].at_decode( &tmph, pal->al_name, NULL, pal->al_value); } if ((rc = start_checkpoint(pjob,1,preq)) != PBSE_NONE) req_reject(rc,0,preq,mom_host,"cannot checkpoint job"); /* unable to start checkpoint */ } return; } /* END req_holdjob() */ /* * req_checkpointjob - checkpoint and continue job */ void req_checkpointjob( struct batch_request *preq) { int rc; job *pjob; /* If checkpoint supported, do it and terminate the job */ /* otherwise, return PBSE_NOSUP */ pjob = find_job(preq->rq_ind.rq_manager.rq_objname); if (pjob == NULL) { rc = PBSE_UNKJOBID; req_reject(rc, 0, preq, mom_host, "job does not exist on mom"); } else { if ((rc = start_checkpoint(pjob, 0, preq)) != PBSE_NONE) req_reject(rc, 0, preq, mom_host, "cannot checkpoint job"); /* unable to start checkpoint */ } /* note, normally the reply to the server is in start_checkpoint() */ } /* * Write text into a job's output file, * Return a PBS error code. */ int message_job( job *pjob, enum job_file jft, /* I */ char *text) { char *pstr = NULL; int len; int fds; int rc; if (pjob == NULL) { return(PBSE_UNKJOBID); } /* must be Mother Superior for this to make sense */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { log_err(errno, "message_job", "cannot message job, not mother superior"); return(PBSE_MOMREJECT); } len = is_joined(pjob); if (len == -1) jft = StdErr; /* only have stderr open */ else if (len == 1) jft = StdOut; /* only have stdout open */ if ((fds = open_std_file( pjob, jft, O_WRONLY | O_APPEND, pjob->ji_qs.ji_un.ji_momt.ji_exgid)) < 0) { sprintf(log_buffer, "cannot open %s file for job '%s' (msg: '%.64s')", (jft == StdErr) ? "stderr" : "stdout", pjob->ji_qs.ji_jobid, text); log_err(errno, "message_job", log_buffer); return(PBSE_MOMREJECT); } len = strlen(text); if (text[len - 1] != '\n') { if ((pstr = malloc(len + 2)) == NULL) { return(PBSE_INTERNAL); } strcpy(pstr, text); pstr[len++] = '\n'; /* append new-line */ text = pstr; } rc = PBSE_NONE; alarm(alarm_time); if (write(fds, text, len) != len) { log_err(errno, "message_job", "unable to write message to job"); rc = PBSE_INTERNAL; } alarm(0); if (close(fds) != 0) { log_err(errno, "message_job", "unable to write message to job"); rc = PBSE_INTERNAL; } if (pstr != NULL) free(pstr); /* SUCCESS */ return(rc); } /* END message_job() */ /* * req_messagejob - Append message to job's output/error file */ void req_messagejob( struct batch_request *preq) { int ret = 0; job *pjob; pjob = find_job(preq->rq_ind.rq_message.rq_jid); if ((preq->rq_ind.rq_message.rq_file == PBS_BATCH_FileOpt_Default) || (preq->rq_ind.rq_message.rq_file & PBS_BATCH_FileOpt_OFlg)) { ret = message_job(pjob, StdOut, preq->rq_ind.rq_message.rq_text); } if ((preq->rq_ind.rq_message.rq_file & PBS_BATCH_FileOpt_EFlg) && (ret == 0)) { ret = message_job(pjob, StdErr, preq->rq_ind.rq_message.rq_text); } if (ret == PBSE_NONE) { /* message request successful */ reply_ack(preq); } else { req_reject(ret, 0, preq, mom_host, "cannot add message to job output/error buffer"); } } /* END req_messagejob() */ const char *TJobAttr[] = { "jobname", /* this set appears first as they show */ "job_owner", /* in a basic job status display */ "resc_used", "state", "in_queue", "at_server", /* 5 */ "account", /* the bulk of the attributes are in */ "chkpnt", /* alphabetic order for no good reason */ "ctime", "depend", "errpath", "exec_host", "exectime", "grouplst", "hold", "interactive", "join", "keep", "mailpnts", "mailuser", "mtime", /* 20 */ "outpath", "priority", "qtime", "rerunable", "resource", "session_id", "shell", "stagein", "stageout", "substate", "userlst", "variables", /* 32 */ "euser", /* execution user name for MOM */ "egroup", /* execution group name for MOM */ "hashname", /* job name hashed into 14 characters */ "hopcount", "qrank", "queuetype", "schedhint", /* 39 */ "security", "comment", "cookie", "altid", "etime", "exitstat", "forwardx11", "submitargs", "jobarrayid", "jobarrayreq", "umask", /* 50 */ "start_time", "start_count", "chkptdir", "chkptname", "chkpttime", "restartstat", "restartname", "faulttol", "comp_time", "reported", /* 60 */ "job_type", "inter_cmd", "proxy_user", #ifdef USEJOBCREATE "pagg_id", #endif /* USEJOBCREATE */ NULL }; /* * req_modifyjob - service the Modify Job Request * * This request modifies a job's attributes. */ void req_modifyjob( struct batch_request *preq) /* I */ { int bad = 0; int i; attribute newattr[(int)JOB_ATR_LAST]; attribute *pattr; job *pjob; svrattrl *plist; int rc; char tmpLine[1024]; pjob = find_job(preq->rq_ind.rq_modify.rq_objname); if (pjob == NULL) { sprintf(tmpLine, "modify job failed, unknown job %s", preq->rq_ind.rq_modify.rq_objname); req_reject(PBSE_UNKJOBID, 0, preq, mom_host, tmpLine); return; } if (LOGLEVEL >= 3) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "modifying job"); } plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_modify.rq_attr); if (plist == NULL) { /* nothing to do */ reply_ack(preq); /* SUCCESS */ return; } /* modify the jobs attributes */ bad = 0; pattr = pjob->ji_wattr; /* call attr_atomic_set to decode and set a copy of the attributes */ rc = attr_atomic_set( plist, pattr, newattr, job_attr_def, JOB_ATR_LAST, -1, ATR_DFLAG_MGWR | ATR_DFLAG_MOM, &bad); if (rc != 0) { /* FAILURE - leave old values, free the new ones */ for (i = 0;i < JOB_ATR_LAST;i++) { job_attr_def[i].at_free(newattr + i); } /* cannot set attributes, return FAILURE */ req_reject(rc, 0, preq, mom_host, "cannot set attributes"); return; } /* OK, now copy the new values into the job attribute array */ for (i = 0;i < JOB_ATR_LAST;i++) { if (!(newattr[i].at_flags & ATR_VFLAG_MODIFY)) continue; if (LOGLEVEL >= 5) { char tmpLine[1024]; strcpy(tmpLine, "???"); if (newattr[i].at_type == ATR_TYPE_STR) { if (newattr[i].at_val.at_str != NULL) strncpy(tmpLine, newattr[i].at_val.at_str, sizeof(tmpLine)); } else if (newattr[i].at_type == ATR_TYPE_LONG) { sprintf(tmpLine, "%ld", newattr[i].at_val.at_long); } else if (newattr[i].at_type == ATR_TYPE_CHAR) { sprintf(tmpLine, "%c", newattr[i].at_val.at_char); } else if (newattr[i].at_type == ATR_TYPE_RESC) { sprintf(tmpLine, "%s", "RESC"); } else if (newattr[i].at_type == ATR_TYPE_ARST) { if (i == JOB_ATR_variables) { char *tmpPtr; tmpLine[0] = '\0'; tmpPtr = arst_string( "", &newattr[i]); if (tmpPtr != NULL) strncpy(tmpLine, tmpPtr, sizeof(tmpLine)); } else { sprintf(tmpLine, "%s", "ARST"); } } sprintf(log_buffer, "modifying type %d attribute %s of job (value: '%s')", newattr[i].at_type, (i <= JOB_ATR_checkpoint_name) ? TJobAttr[i] : "Unkn", tmpLine); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "N/A", log_buffer); } /* END if (LOGLEVEL >= 5) */ if (job_attr_def[i].at_action != NULL) job_attr_def[i].at_action(&newattr[i], pjob, ATR_ACTION_ALTER); job_attr_def[i].at_free(pattr + i); if ((newattr[i].at_type == ATR_TYPE_LIST) || (newattr[i].at_type == ATR_TYPE_RESC)) { list_move(&newattr[i].at_val.at_list, &(pattr + i)->at_val.at_list); } #ifdef TNOT else if (newattr[i].at_type == ATR_TYPE_ARST) { set_arst(&(pattr + i)->at_val, newattr[i], SET); /* set_arst(patr,&temp,INCR) */ } #endif /* TNOT */ else { *(pattr + i) = newattr[i]; } (pattr + i)->at_flags = newattr[i].at_flags; } /* END for (i) */ /* note, the newattr[] attributes are on the stack, they go away auto */ if (rc == 0) { rc = mom_set_limits(pjob, SET_LIMIT_ALTER); } if (rc != 0) { req_reject(rc, bad, preq, mom_host, "cannot set limits"); return; } job_save(pjob, SAVEJOB_FULL); sprintf(log_buffer, msg_manager, msg_jobmod, preq->rq_user, preq->rq_host); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* SUCCESS */ reply_ack(preq); return; } /* END req_modifyjob() */ void req_shutdown( struct batch_request *preq) /* I */ { req_reject(PBSE_NOSUP, 0, preq, NULL, NULL); return; } #ifdef _CRAY /* * cray_susp_resum - special cray suspend/resume function */ static void cray_susp_resum( job *pjob, int which, struct batch_request *preq) { int i; int ct; task *ptask; pid_t pid; long sess; int sock; sock = preq->rq_conn; pid = fork_me(sock); if (pid > 0) { /* record pid in job for when child terminates */ pjob->ji_momsubt = pid; if (which == 1) { pjob->ji_mompost = post_suspend; /* save stop time for adjusting walltime */ pjob->ji_momstat = time_now; } else { pjob->ji_mompost = post_resume; } free_br(preq); return; } else if (pid == -1) { /* fork failed - still the main mom */ log_err(-1, id, "cannot fork child for cray suspend"); req_reject(PBSE_SYSTEM, errno, preq, NULL, NULL); return; } /* child of MOM, cannot update job struct */ for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { sess = ptask->ti_qs.ti_sid; for (ct = 0;ct < 3;ct++) { i = (which == 1) ? suspend(C_JOB, sess) : resume(C_JOB, sess); if (i == 0) break; if ((errno != EAGAIN) && (errno != EINTR)) break; } if (i == -1) { /* error */ req_reject(PBSE_SYSTEM, errno, preq, NULL, NULL); exit(1); } } reply_ack(preq); exit(0); } /* END cray_susp_resum() */ #endif /* _CRAY */ /* send a signal to all tasks on sisters */ int sigalltasks_sisters( job *pjob, int signum) { #ifndef NDEBUG char id[] = "sigalltasks_sisters"; #endif char *cookie; eventent *ep; int i; cookie = pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str; for (i = 0;i < pjob->ji_numnodes;i++) { int ret; hnodent *np = &pjob->ji_hosts[i]; if (np->hn_node == pjob->ji_nodeid) /* this is me */ continue; DBPRT(("%s: sending sig%d to all tasks on sister %s\n", id, signum, np->hn_host)); if (np->hn_stream == -1) np->hn_stream = rpp_open(np->hn_host, pbs_rm_port, NULL); ep = event_alloc(IM_SIGNAL_TASK, np, TM_NULL_EVENT, TM_NULL_TASK); if (np->hn_stream == -1) { np->hn_stream = rpp_open(np->hn_host, pbs_rm_port, NULL); } ret = im_compose(np->hn_stream, pjob->ji_qs.ji_jobid, cookie, IM_SIGNAL_TASK, ep->ee_event, TM_NULL_TASK); if (ret != DIS_SUCCESS) { return ret; } ret = diswui(np->hn_stream, pjob->ji_nodeid); /* XXX */ if (ret != DIS_SUCCESS) { return ret; } ret = diswsi(np->hn_stream, TM_NULL_TASK); if (ret != DIS_SUCCESS) { return ret; } ret = diswsi(np->hn_stream, signum); if (ret != DIS_SUCCESS) { return ret; } ret = rpp_flush(np->hn_stream); if (ret != DIS_SUCCESS) { return ret; } } return(0); } /* END sigalltasks_sisters() */ static void resume_suspend( job *pjob, int susp, /* I (0=FALSE, 1=TRUE) */ struct batch_request *preq) { static char *id = "resume_suspend"; task *tp; int stat = 0; int savederr = 0; int signum; signum = (susp == 1) ? SIGSTOP : SIGCONT; if (LOGLEVEL >= 2) { sprintf(log_buffer, "%s: %s job", id, (susp == 1) ? "suspending" : "resuming"); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "N/A", log_buffer); } /* Once upon a time, suspend/resume signals weren't propagated to sisters. Verily, the parallel jobs weren't correctly suspended or resumed. Then it was decided that SIGTSTP would be used instead of SIGSTOP so that specially patched MPI launchers could suspend the sisters. To keep serial jobs suspending, a delayed SIGSTOP was added after the SIGTSTP. Of course, non-MPI parallel jobs were still not suspended properly. Now we are sending SIGTSTP only to the top-level task on MS, then SIGSTOP to all tasks and given MOM the ability to propagate suspend/resume signals to sisters. The End. */ /* NOTE: format {suspend[:X]|resume[:X]} should be supported to allow job state change AND custom suspend/resume signal (NYI) */ if (susp == 1) { kill_task((task *)GET_NEXT(pjob->ji_tasks), SIGTSTP, 0); MUSleep(50000); } for (tp = (task *)GET_NEXT(pjob->ji_tasks); tp != NULL; tp = (task *)GET_NEXT(tp->ti_jobtask)) { if (tp->ti_qs.ti_status != TI_STATE_RUNNING) continue; DBPRT(("%s: inspecting %d from node %d\n", id, tp->ti_qs.ti_task, tp->ti_qs.ti_parentnode)); stat = kill_task(tp, signum, 0); if (stat < 0) { /* couldn't send signal, don't signal more tasks */ savederr = errno; break; } /* END if (stat < 0) */ } /* END for (tp) */ if (stat >= 0) { if (pjob->ji_numnodes > 1) { stat = sigalltasks_sisters(pjob, signum); if (stat < 0) { savederr = errno; } } } if (stat < 0) { /* We couldn't signal all the tasks, signal them back to their old state */ if (LOGLEVEL >= 1) { sprintf(log_buffer, "cannot send signal %s to tasks of job in %s (errno=%d %s) - attempt aborted", (susp == 1) ? "SIGSTOP" : "SIGCONT", id, savederr, pbs_strerror(savederr)); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "N/A", log_buffer); } signum = (susp == 1) ? SIGCONT : SIGSTOP; for (tp = (task *)GET_NEXT(pjob->ji_tasks); tp != NULL; tp = (task *)GET_NEXT(tp->ti_jobtask)) { if (tp->ti_qs.ti_status != TI_STATE_RUNNING) continue; kill_task(tp, signum, 0); } if (pjob->ji_numnodes > 1) { sigalltasks_sisters(pjob, signum); } /* report suspend/resume failure */ req_reject(PBSE_SYSTEM, savederr, preq, NULL, NULL); return; } /* END if (stat < 0) */ /* signals sent to all tasks, now adjust job state */ if (susp == 1) { /* Successfully suspended, let's update status */ /* This is needed for calculating correct walltime */ pjob->ji_momstat = time_now; pjob->ji_qs.ji_substate = JOB_SUBSTATE_SUSPEND; pjob->ji_qs.ji_svrflags |= JOB_SVFLG_Suspend; if (LOGLEVEL >= 1) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "N/A", "job suspended - adjusted job state"); } } else { pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; /* Ok, we resumed'em, we have set ji_momstat to the time we suspended the job. We use this to compute a new start-time for the job, so that walltime is computed correctly elsewhere */ if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) { /* If it's suspended, update the start time */ pjob->ji_qs.ji_stime = pjob->ji_qs.ji_stime - pjob->ji_momstat + time_now; } /* clear the Suspend bit */ pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_Suspend; if (LOGLEVEL >= 1) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "N/A", "job resumed - adjusted job state"); } } /* END else (susp != 0) */ /* acknowledge change to pbs_server */ reply_ack(preq); /* SUCCESS */ return; } /* END resume_suspend() */ /** * req_signaljob - issue (kill) a specified signal to a job * Signal may be either a numeric string or a signal name * with or without the "SIG" prefix. * * NOTE: process_request() set up as request handler via accept_conn() * * @see process_request->dispatch_request() - parent * @see req_signaljob() in server/req_signal.c - peer */ void req_signaljob( struct batch_request *preq) /* I */ { char id[] = "req_signaljob"; job *pjob; int sig; int numprocs=0; char *sname; struct sig_tbl *psigt; extern struct sig_tbl sig_tbl[]; pjob = find_job(preq->rq_ind.rq_signal.rq_jid); if (pjob == NULL) { req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); return; } sname = preq->rq_ind.rq_signal.rq_signame; if (LOGLEVEL >= 3) { sprintf(log_buffer, "signaling job with signal %s", sname); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } if (!strcasecmp(sname, SIG_SUSPEND)) { if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) { req_reject(PBSE_BADSTATE, 0, preq, NULL, NULL); } else { #ifdef _CRAY /* suspend/resume on Cray only */ cray_susp_resum(pjob, 1, preq); #else resume_suspend(pjob, 1, preq); #endif /* _CRAY */ } return; } if (!strcasecmp(sname, SIG_RESUME)) { if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_SUSPEND) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "resume request on job that is not suspended"); } #ifdef _CRAY cray_susp_resum(pjob, 0, preq); #else resume_suspend(pjob, 0, preq); #endif /* _CRAY */ return; } /* standard signal received - signal tasks but do not change job state */ if (isdigit((int)*sname)) { sig = atoi(sname); } else { if (!strncasecmp("SIG", sname, 3)) sname += 3; psigt = sig_tbl; while (psigt->sig_name != NULL) { if (!strcasecmp(sname, psigt->sig_name)) break; psigt++; } sig = psigt->sig_val; } if (sig < 0) { req_reject(PBSE_UNKSIG, 0, preq, NULL, NULL); return; } if ((sig == SIGTERM) && (pjob->ji_qs.ji_substate == JOB_SUBSTATE_SUSPEND)) { /* if job is suspended, resume, and then kill - allow job to clean up on sigterm */ kill_job(pjob, SIGCONT, id, "job is suspended, resume and kill"); sleep(1); } /* * When kill_job is launched, processes are killed and waitpid() should harvest the process * and takes action to send an obit. If no matching process exists, then an obit may never be * sent due to the current way that TORQUE's state machine works. */ numprocs = kill_job(pjob, sig, id, "killing job"); if ((numprocs == 0) && ((sig == 0)||(sig == SIGKILL)) && (pjob->ji_qs.ji_substate != JOB_SUBSTATE_OBIT)) { /* SIGNUL and no procs found, force job to exiting */ /* force issue of (another) job obit */ sprintf(log_buffer, "job recycled into exiting on SIGNULL/KILL from substate %d", pjob->ji_qs.ji_substate); LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; job_save(pjob, SAVEJOB_QUICK); exiting_tasks = 1; } reply_ack(preq); return; } /* END req_signaljob() */ /** * Encodes the used resource information (cput, mem, walltime, etc.) * about the given job. (The data is encoded in preparation for * being sent to the pbs_server.) * */ void encode_used( job *pjob, /* I */ tlist_head *phead) /* O */ { unsigned long lnum; int i; attribute *at; attribute_def *ad; resource *rs; at = &pjob->ji_wattr[JOB_ATR_resc_used]; ad = &job_attr_def[JOB_ATR_resc_used]; if ((at->at_flags & ATR_VFLAG_SET) == 0) { return; } for (rs = (resource *)GET_NEXT(at->at_val.at_list); rs != NULL; rs = (resource *)GET_NEXT(rs->rs_link)) { resource_def *rd = rs->rs_defin; attribute val; int rc; if ((rd->rs_flags & resc_access_perm) == 0) continue; val = rs->rs_value; /* copy resource attribute */ /* count up sisterhood too */ if (pjob->ji_resources != NULL) { lnum = 0; if (!strcmp(rd->rs_name, "cput")) { for (i = 0;i < pjob->ji_numnodes - 1;i++) { lnum += pjob->ji_resources[i].nr_cput; } } else if (!strcmp(rd->rs_name, "mem")) { for (i = 0;i < pjob->ji_numnodes - 1;i++) { lnum += pjob->ji_resources[i].nr_mem; } } else if (!strcmp(rd->rs_name, "vmem")) { for (i = 0;i < pjob->ji_numnodes - 1;i++) { lnum += pjob->ji_resources[i].nr_vmem; } } val.at_val.at_long += lnum; } rc = rd->rs_encode( &val, phead, ad->at_name, rd->rs_name, ATR_ENCODE_CLIENT); if (rc < 0) break; } /* END for (rs) */ return; } /* END encode_used() */ void encode_flagged_attrs( job *pjob, /* I */ tlist_head *phead) /* O */ { int index; attribute *at; attribute_def *ad; for (index = 0;(int)index < JOB_ATR_LAST;++index) { at = &pjob->ji_wattr[index]; ad = &job_attr_def[index]; if (at->at_flags & ATR_VFLAG_SEND) { /* turn off "need to send" flag */ at->at_flags &= ~ATR_VFLAG_SEND; if (LOGLEVEL >= 4) { sprintf(log_buffer, "encoding \"send flagged\" attr: %s", ad->at_name); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } ad->at_encode( at, phead, ad->at_name, NULL, ATR_ENCODE_CLIENT); } } } /* * req_stat_job - return the status of one (if id is specified) or all * jobs (if id is the null string). * * This is usually triggered due to a request from the pbs_server to learn * about this (or all) jobs. The server will query the MOM periodically * for this information. It is controlled by the pbs_server attributes * 'job_stat_rate' and 'poll_jobs'. * * This data is different than the occasional status update sent to * the server that tells the server the MOM's general stats (see mom_server_all_update_stat()). */ void req_stat_job( struct batch_request *preq) /* I */ { int all; char *name; job *pjob; struct batch_reply *preply = &preq->rq_reply; struct brp_status *pstat; /* * first, validate the name of the requested object, either * a single job or all jobs */ name = preq->rq_ind.rq_status.rq_id; if ((*name == '\0') || (*name == '@')) { all = 1; pjob = (job *)GET_NEXT(svr_alljobs); } else { all = 0; pjob = find_job(name); if (pjob == NULL) { req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); return; } } preply->brp_choice = BATCH_REPLY_CHOICE_Status; CLEAR_HEAD(preply->brp_un.brp_status); /* pass user-client privilege to encode_resc() */ resc_access_perm = preq->rq_perm & ATR_DFLAG_RDACC; for (;pjob;pjob = all ? (job *)GET_NEXT(pjob->ji_alljobs) : NULL) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; /* not Mother Superior */ if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) continue; /* allocate reply structure and fill in header portion */ pstat = (struct brp_status *)malloc(sizeof(struct brp_status)); assert(pstat != NULL); CLEAR_LINK(pstat->brp_stlink); pstat->brp_objtype = MGR_OBJ_JOB; strcpy(pstat->brp_objname, pjob->ji_qs.ji_jobid); CLEAR_HEAD(pstat->brp_attr); append_link(&preply->brp_un.brp_status, &pstat->brp_stlink, pstat); encode_used(pjob, &pstat->brp_attr); /* adds resources_used attr */ encode_flagged_attrs(pjob, &pstat->brp_attr); /* adds other flagged attrs */ } reply_send(preq); return; } /* END req_stat_job() */ /* * del_files - delete the files in a copy files or delete files request * * WARNING WARNING WARNING WARNING WARNING WARNING WARNING * * fork_to_user() must be called first so that useruid/gid is set up */ static int del_files( struct batch_request *preq, /* I */ char *HDir, /* I (home directory) */ int setuserenv,/* I */ char **pbadfile) /* O */ { char id[] = "del_files"; int AsUser = FALSE; int UID0 = TRUE; int EUID0 = TRUE; struct rqfpair *pair; int rc = 0; char *path; char *pp; char *prmt; int del_dir = 0; struct stat sb; #if NO_SPOOL_OUTPUT == 1 char path_alt[MAXPATHLEN + 1]; int rcstat; struct stat myspooldir; #endif #ifdef HAVE_WORDEXP job *pjob; wordexp_t pathexp; #endif path = malloc(sizeof(char)*(MAXPATHLEN + 1)); if (path==NULL) { add_bad_list(pbadfile,"malloc failed",1); return(-1); } /* * NOTE: may be called as root in TORQUE home dir * or as user in user homedir. Let's determine if we will * be permitted to run setXid()/setgroup calls. */ if (getuid() != 0) UID0 = FALSE; if (geteuid() != 0) EUID0 = FALSE; /* * Build up path of file using local name only, then unlink it. * The first set of files may have the STDJOBFILE * flag set, which we need to unlink as root, the others as the user. */ if (HDir != NULL) { /* ignore failure */ if (chdir(HDir) == -1) {} } for (pair = (struct rqfpair *)GET_NEXT(preq->rq_ind.rq_cpyfile.rq_pair); pair != NULL; pair = (struct rqfpair *)GET_NEXT(pair->fp_link)) { prmt = pair->fp_rmt; *path = '\0'; if (pair->fp_flag == STDJOBFILE) { /* the job's stdout/stderr */ #if NO_SPOOL_OUTPUT == 0 strncpy(path, path_spool, sizeof(path)); #endif /* !NO_SPOOL_OUTPUT */ } else if (AsUser == FALSE) { if (setgroups(ngroup,(gid_t *)groups) != 0 && UID0 == TRUE) { snprintf(log_buffer,sizeof(log_buffer), "%s: setgroups() for UID = %lu failed: %s", id, (unsigned long)useruid, strerror(errno)); add_bad_list(pbadfile,log_buffer,1); return(-1); } if (setgid(usergid) != 0 && EUID0 == TRUE) { snprintf(log_buffer,sizeof(log_buffer), "%s: setgid(%lu) for UID = %lu failed: %s", id, (unsigned long)usergid, (unsigned long)useruid, strerror(errno)); add_bad_list(pbadfile,log_buffer,1); return(-1); } /* run as the user */ if (setuid(useruid) != 0 && EUID0 == TRUE) { snprintf(log_buffer,sizeof(log_buffer), "%s: setuid(%lu) failed: %s", id, (unsigned long)useruid, strerror(errno)); add_bad_list(pbadfile,log_buffer,1); return(-1); } EUID0 = FALSE; UID0 = FALSE; if (HDir != NULL) { /* ignore failure of chdir */ if (chdir(HDir) == -1) {} } #ifdef HAVE_WORDEXP if (setuserenv && (pjob = find_job(preq->rq_ind.rq_cpyfile.rq_jobid)) != NULL) { InitUserEnv(pjob, NULL, NULL, NULL, NULL); *(vtable.v_envp + vtable.v_used) = NULL; environ = vtable.v_envp; } #endif AsUser = TRUE; } strcat(path, pair->fp_local); del_dir = replace_checkpoint_path(path); if (local_or_remote(&prmt) == 0) { /* local file, do source and destination match? */ /* if so, don't delete it */ if (is_file_same(prmt, path) == 1) { continue; } } #ifdef HAVE_WORDEXP switch (wordexp(path, &pathexp, WRDE_NOCMD | WRDE_UNDEF)) { case 0: break; /* Successful */ case WRDE_NOSPACE: wordfree(&pathexp); /* fall through */ default: sprintf(log_buffer, "*** failed to delete files, expansion of %s failed", path); add_bad_list(pbadfile, log_buffer, 1); return(-1); /*NOTREACHED*/ break; } strcpy(path, pathexp.we_wordv[0]); wordfree(&pathexp); #endif if (stat(path, &sb) == 0) { if (S_ISDIR(sb.st_mode)) { /* have a directory, must append last segment */ /* of source name to it for the unlink */ #if NO_SPOOL_OUTPUT == 1 /* check for ~/.pbs_spool */ /* if it isn't a dir., use $HOME us usual */ strcpy(path_alt, path); strcat(path_alt, "/.pbs_spool/"); rcstat = stat(path_alt, &myspooldir); if ((rcstat == 0) && (S_ISDIR(myspooldir.st_mode)) && ((myspooldir.st_mode & S_IXOTH) == S_IXOTH)) { strcpy(path, path_alt); } else #endif /* NO_SPOOL_OUTPUT */ { strcat(path, "/"); } pp = strrchr(prmt, (int)'/'); if (pp != NULL) { ++pp; } else if ((pp = strrchr(prmt, (int)':'))) { ++pp; } else { pp = prmt; } strcat(path, pp); } } else { sprintf(log_buffer, "cannot stat %s", path); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_REQUEST, id, log_buffer); } /* * This should only be set it we are trying to delete a checkpoint restart * file that is in the moms default checkpoint directory. We change the * path to remove the jobs checkpoint directory not just the checkpoint itself. * Do not remove if it is in the remote checkpoint directory list */ if (del_dir) { char *ptr; ptr = strrchr(path,'/'); if (ptr != NULL) { ptr[0] = '\0'; } } if (!in_remote_checkpoint_dir(path)) { if (remtree(path) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "Unable to delete file %s for user %s, error = %d %s", path, preq->rq_ind.rq_cpyfile.rq_user, errno, pbs_strerror(errno)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_REQUEST, id, log_buffer); add_bad_list(pbadfile, log_buffer, 2); rc = errno; } #ifdef DEBUG } else { sprintf(log_buffer, "Deleted file %s for user %s", path, preq->rq_ind.rq_cpyfile.rq_user); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_FILE, id, log_buffer); #endif /* DEBUG */ } } } return(rc); } /* END del_files() */ void req_rerunjob( struct batch_request *preq) /* I */ { static char *id = "req_rerunjob"; job *pjob; int sock; int rc; int retrycnt = 0; pjob = find_job(preq->rq_ind.rq_rerun); if (pjob == NULL) { req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); return; } if (LOGLEVEL >= 3) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "rerunning job"); } /* fork to send files back */ if ((rc = fork_me(preq->rq_conn)) > 0) { free_br(preq); /* parent - note leave connection open */ return; } else if (rc < 0) { req_reject(-rc, 0, preq, NULL, NULL); return; } /* Child process ... for each standard file generate and send a Job Files request(s). * No message handler function is needed because return_file blocks and waits for reply. * This is acceptable because we are a child process, not pbs_mom. */ retry: sock = mom_open_socket_to_jobs_server(pjob, id, NULL); if (sock < 0) { retrycnt++; if (retrycnt < 10) { sleep(1); goto retry; } /* FAILURE */ req_reject(PBSE_NOSERVER, 0, preq, NULL, NULL); exit(0); } if (((rc = return_file(pjob, StdOut, sock, TRUE)) != 0) || ((rc = return_file(pjob, StdErr, sock, TRUE)) != 0) || ((rc = return_file(pjob, Checkpoint, sock, TRUE)) != 0)) { /* FAILURE - cannot report file to server */ LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_REQUEST, id, "cannot move output files to server"); req_reject(rc, 0, preq, NULL, NULL); } else { /* SUCCESS */ reply_ack(preq); close(sock); exit(0); } return; } /* END req_rerunjob() */ void req_returnfiles( struct batch_request *preq) { int rc; struct job *pjob; int sock; static char *id = "req_returnfiles"; pjob = find_job(preq->rq_ind.rq_returnfiles.rq_jobid); if (pjob != NULL) { retry: sock = mom_open_socket_to_jobs_server(pjob, id, NULL); if (sock < 0) { /* XXX TODO */ sprintf(log_buffer, "mom_open_socket_to_jobs_server FAILED to get socket: %d for job %s", sock, pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); sleep(1); goto retry; } if (preq->rq_ind.rq_returnfiles.rq_return_stdout) { rc = return_file(pjob, StdOut, sock, FALSE); } if (preq->rq_ind.rq_returnfiles.rq_return_stderr) { rc = return_file(pjob, StdErr, sock, FALSE); } reply_ack(preq); close(sock); } else { req_reject(PBSE_UNKJOBID, 0, preq, mom_host, "cannot locate job"); } return; } /* * sys_copy - issue system call to copy file * * Check error and retry as required */ static int sys_copy( int rmtflg, /* I */ char *ag2, /* I (is this source or destination?) */ char *ag3, /* I (is this source or destination?) */ int conn) /* I */ { char *ag0; char *ag1; int i; static char *id = "sys_copy"; int loop; int rc; sprintf(rcperr, "%srcperr.%ld", path_spool, (long)getpid()); if (rmtflg == 0) { /* local copy */ ag0 = "/bin/cp"; ag1 = "-rp"; } else { ag0 = rcp_path; ag1 = rcp_args; } if (LOGLEVEL >= 6) { sprintf(log_buffer, "executing copy command: %s %s %s %s", ag0, ag1, ag2, ag3); log_ext(-1, id, log_buffer, LOG_DEBUG); } for (loop = 1;loop < 4;++loop) { if ((rc = fork()) > 0) { /* Parent - wait for copy to complete */ while (((i = wait(&rc)) < 0) && (errno == EINTR)); if (i == -1) { rc = (20000 + errno); /* 200xx is error on wait */ } else if (WIFEXITED(rc)) { if ((rc = WEXITSTATUS(rc)) == 0) { return(rc); /* good, stop now */ } } else if (WIFSTOPPED(rc)) { rc = (30000 + WSTOPSIG(rc)); /* 300xx is stopped */ } else if (WIFSIGNALED(rc)) { rc = (40000 + WTERMSIG(rc)); /* 400xx is signaled */ } } else if (rc < 0) { rc = errno + 10000; /* error on fork (100xx), retry */ } else { int fd; /* child - exec the copy command */ rpp_terminate(); close(conn); /* redirect stderr to make error from rcp available to MOM */ unlink(rcperr); /* likely failing, ignore */ if ((fd = open(rcperr, O_RDWR | O_CREAT | O_EXCL, 0644)) < 0) { sprintf(log_buffer, "can't open %s, error = %d %s", rcperr, errno, pbs_strerror(errno)); log_err(errno, id, log_buffer); exit(12); }; if (fd != 2) { dup2(fd, 2); close(fd); } /* NOTE: arg2 should be source, arg3 should be destination */ execl(ag0, ag0, ag1, ag2, ag3, NULL); /* reached only if execl() fails */ sprintf(log_buffer, "exec of command '%s %s %s %s' failed, errno=%d %s", ag0, ag1, ag2, ag3, errno, pbs_strerror(errno)); log_err(errno, id, log_buffer); exit(13); /* 13, an unlucky number */ } /* END else ((rc = fork()) > 0) */ /* copy did not work, try again */ if ((loop % 2) == 0) sleep(loop / 2 * 3 + 1); } /* END for (loop) */ /* tried a bunch of times, just give up */ sprintf(log_buffer, "command '%s %s %s %s' failed with status=%d, giving up after %d attempts", ag0, ag1, ag2, ag3, rc, loop); log_err(-1, id, log_buffer); return(rc); } /* END sys_copy() */ /* * req_cpyfile - process the Copy Files request from the server to dispose * of output from the job. This is done by a child of MOM since it * might take time. * * The supplied PBS means of moving the file is by "rcp". * A site may wish to change this. */ /* NOTE: --------------------------------------------------------------------------- PBS_BATCH_RunJob (received from sched) req_runjob svr_startjob svr_stagein ----------------------> req_cpyfile fork_to_user[1] svr_strtjob2 send_job PBSD_queuejob ----> req_quejob[2] PBSD_jscript -----> req_jobscript PBSD_rdytocmt ----> req_rdytocommit PBSD_commit ------> req_commit[3] [1] job not in svr_alljobs list (pjob == NULL) [2] added to svr_newjobs list [3] deleted from svr_newjobs, added to srv_alljobs therefore it is normal for pjob to be NULL in req_cpyfile. */ void req_cpyfile( struct batch_request *preq) /* I */ { char id[] = "req_cpyfile"; char *arg2 = NULL; char *arg3 = NULL; int bad_files = 0; char *bad_list = NULL; int dir = 0; int from_spool = 0; /* boolean - set if file must be removed from spool after copy */ int len; char localname[MAXPATHLEN + 1]; /* used only for in-bound */ struct rqfpair *pair = NULL; char *prmt; int rc; int rmtflag = 0; #if NO_SPOOL_OUTPUT == 0 char undelname[MAXPATHLEN + 1]; #endif /* !NO_SPOOL_OUTPUT */ #ifdef _CRAY char tmpdirname[MAXPATHLEN + 1]; #endif /* _CRAY */ char localname_alt[MAXPATHLEN + 1]; struct stat myspooldir; int rcstat; char homespool[MAXPATHLEN + 1]; int havehomespool; char EMsg[1024]; char HDir[1024]; job *pjob = NULL; #ifdef HAVE_WORDEXP int madefaketmpdir = 0; int usedfaketmpdir = 0; wordexp_t arg2exp, arg3exp; int arg2index = -1; char faketmpdir[1024]; int wordexperr = 0; #endif /* there is nothing to copy */ if (spoolasfinalname == TRUE) { reply_ack(preq); return; } if (LOGLEVEL >= 3) { pair = (struct rqfpair *)GET_NEXT(preq->rq_ind.rq_cpyfile.rq_pair); if ((pair != NULL) && (pair->fp_rmt != NULL)) { sprintf(log_buffer, "attempting to copy file '%s'", pair->fp_rmt); } else { sprintf(log_buffer, "copy file request is corrupt"); } LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, preq->rq_ind.rq_cpyfile.rq_jobid, log_buffer); } rc = (int)fork_to_user(preq, TRUE, HDir, EMsg); if (rc < 0) { char tmpLine[1024]; /* FAILURE */ req_reject(-rc, 0, preq, mom_host, EMsg); if ((rc != -PBSE_SYSTEM) && (rc != -PBSE_BADUSER)) { sprintf(tmpLine, "fork_to_user failed with rc=%d '%s' - exiting", rc, EMsg); log_err(errno, id, tmpLine); exit(rc); } sprintf(tmpLine, "fork_to_user failed with rc=%d '%s' - returning failure", rc, EMsg); log_err(errno, id, tmpLine); return; } /* END if (rc < 0) */ if (rc > 0) { /* parent - continue with other tasks */ /* SUCCESS */ return; } /* child */ /* now running as user in the user's home directory */ #if NO_SPOOL_OUTPUT == 1 snprintf(homespool, sizeof(homespool), "%s/.pbs_spool/", HDir); rcstat = stat(homespool, &myspooldir); if ((rcstat == 0) && S_ISDIR(myspooldir.st_mode)) { havehomespool = 1; } else { havehomespool = 0; } #else /* NO_SPOOL_OUTPUT == 1 */ homespool[0] = '\0'; havehomespool = 0; #endif /* END NO_SPOOL_OUTPUT == 1 */ if ((havehomespool == 0) && (TNoSpoolDirList[0] != NULL)) { int dindex; char *wdir; if ((pjob = find_job(preq->rq_ind.rq_cpyfile.rq_jobid)) == NULL) { wdir = NULL; } else { wdir = get_job_envvar(pjob, "PBS_O_WORKDIR"); } if (wdir != NULL) { /* check if job's work dir matches the no-spool directory list */ for (dindex = 0;dindex < TMAX_NSDCOUNT;dindex++) { if (TNoSpoolDirList[dindex] == NULL) break; if (!strcasecmp(TNoSpoolDirList[dindex], "$WORKDIR") || !strcmp(TNoSpoolDirList[dindex], "*")) { havehomespool = 1; strncpy(homespool, wdir, sizeof(homespool)); break; } if (!strncmp(TNoSpoolDirList[dindex], wdir, strlen(TNoSpoolDirList[dindex]))) { havehomespool = 1; strncpy(homespool, wdir, sizeof(homespool)); break; } } /* END for (dindex) */ } /* END if (wdir != NULL) */ } /* END if ((havehomespool == 0) && (TNoSpoolDirList != NULL)) */ #ifdef HAVE_WORDEXP faketmpdir[0] = '\0'; if ((pjob = find_job(preq->rq_ind.rq_cpyfile.rq_jobid)) == NULL) { /* This is a stagein which happens before the job struct to sent to MOM * or a checkpoint file coming in. * This limits the available variables we can use. fork_to_user() * has already set PBS_JOBID and HOME for us. Now just fake a TMPDIR * if we need it. */ pjob = job_alloc(); if (pjob == NULL) { /* FAILURE - in child process */ sprintf(log_buffer,"alloc failed with errno=%d - returning failure", errno); log_err(errno,id,log_buffer); bad_files = 1; goto error; } strcpy(pjob->ji_qs.ji_jobid, preq->rq_ind.rq_cpyfile.rq_jobid); if (TTmpDirName(pjob, faketmpdir)) { if (!mkdirtree(faketmpdir, 0755)) { char *envstr; envstr = malloc((strlen("TMPDIR=") + strlen(faketmpdir) + 1) * sizeof(char)); if (envstr == NULL) { /* FAILURE - in child process */ sprintf(log_buffer,"alloc failed with errno=%d - returning failure", errno); log_err(errno,id,log_buffer); bad_files = 1; goto error; } sprintf(envstr, "TMPDIR=%s", faketmpdir); putenv(envstr); madefaketmpdir = 1; } } } else { InitUserEnv(pjob, NULL, NULL, NULL, NULL); *(vtable.v_envp + vtable.v_used) = NULL; environ = vtable.v_envp; } #endif /* END HAVE_WORDEXP */ /* build up cp/rcp command(s), one per file pair */ arg2 = malloc(sizeof(char)*(MAXPATHLEN + 1)); arg3 = malloc(sizeof(char)*(MAXPATHLEN + 1)); if ((arg2==NULL) || (arg3==NULL)) { /* FAILURE - in child process */ sprintf(log_buffer,"alloc failed with errno=%d - returning failure", errno); log_err(errno,id,log_buffer); bad_files = 1; goto error; } dir = preq->rq_ind.rq_cpyfile.rq_dir; for (pair = (struct rqfpair *)GET_NEXT(preq->rq_ind.rq_cpyfile.rq_pair); pair != NULL; pair = (struct rqfpair *)GET_NEXT(pair->fp_link)) { if ((pair->fp_rmt != NULL) && (strstr(pair->fp_rmt, ":/dev/null"))) { /* ignore copies to/from /dev/null */ continue; } from_spool = 0; prmt = pair->fp_rmt; if (local_or_remote(&prmt) == 0) { /* destination host is this host, use cp */ rmtflag = 0; } else { /* destination host is another, use (pbs_)rcp */ rmtflag = 1; } /* which way to copy, in or out? */ if ((dir == STAGE_DIR_OUT) || (dir == CKPT_DIR_OUT)) { /* * out bound copy ... * build "from" path name, local to this system */ if (pair->fp_flag == STDJOBFILE) { #if NO_SPOOL_OUTPUT == 0 if (havehomespool == 1) { /* only use spooldir if the job file exists */ strcpy(localname_alt, homespool); strcat(localname_alt, "/"); strcat(localname_alt, pair->fp_local); rcstat = stat(localname_alt, &myspooldir); if ((rcstat == 0) && S_ISREG(myspooldir.st_mode)) { strcpy(localname, localname_alt); } else { /* what should be done here??? */ strcpy(localname, localname_alt); } } else { /* stdout | stderr from MOM's spool area (ie, /var/spool/torque/spool ) */ strcpy(localname, path_spool); strcat(localname, pair->fp_local); /* from location */ from_spool = 1; /* flag as being in spool dir */ } #else strcpy(localname, pair->fp_local); /* from location */ if (havehomespool) { /* only use ~/.pbs_spool if the file actually exists */ strcpy(localname_alt, homespool); strcat(localname_alt, "/"); strcat(localname_alt, pair->fp_local); rcstat = stat(localname_alt, &myspooldir); if ((rcstat == 0) && S_ISREG(myspooldir.st_mode)) { strcpy(localname, localname_alt); } else { /* what should be done here??? */ strcpy(localname, localname_alt); } } #endif /* NO_SPOOL_OUTPUT */ } /* END if (pair->fp_flag == STDJOBFILE) */ else if (pair->fp_flag == JOBCKPFILE) { strncpy(localname, pair->fp_local, sizeof(localname) - 1); /* from location */ replace_checkpoint_path(localname); /* * If the checkpoint directory * is in the the TRemChkptDirList then we do not transfer since directory * is remotely mounted. */ if (in_remote_checkpoint_dir(localname)) { continue; } } /* END if (pair->fp_flag == JOBCKPFILE) */ else { /* user-supplied stage-out file */ strncpy(localname, pair->fp_local, sizeof(localname) - 1); /* from location */ } #if SRFS /* Is this file part of $BIGDIR or $FASTDIR ? */ if (!strncmp(localname, "/BIGDIR", 7)) { sprintf(tmpname, "%s/%s", tmpdirname(var_value("BIGDIR", preq->rq_ind.rq_cpyfile.rq_jobid)), &localname[7]); strcpy(localname, tmpname); } else if (!strncmp(localname, "/FASTDIR", 8)) { sprintf(tmpname, "%s/%s", tmpdirname(var_value("BIGDIR", preq->rq_ind.rq_cpyfile.rq_jobid)), &localname[8]); strcpy(localname, tmpname); } #endif /* SRFS */ strcpy(arg2, localname); /* take (remote) destination name from request */ *arg3 = '\0'; if (rmtflag) { /* using rcp, need to prepend the owner name */ strcat(arg3, preq->rq_ind.rq_cpyfile.rq_owner); strcat(arg3, "@"); } strcat(arg3, prmt); } /* END if (dir == STAGE_DIR_OUT) */ else { /* in bound (stage-in) file */ /* take (remote) source name from request */ strcpy(arg3, pair->fp_local); if (pair->fp_flag == JOBCKPFILE) { int path_changed = 0; path_changed = replace_checkpoint_path(arg3); /* * If the checkpoint directory * is in the the TRemChkptDirList then we do not transfer since directory * is remotely mounted. */ if (in_remote_checkpoint_dir(arg3)) { continue; } /* * We may need to create the directory for this inbound checkpoint / * restart file. If we changed the path and the last segment of the * path does not exist then create it. */ if (path_changed == 1) { char needdir[MAXPATHLEN + 1]; int saveumask; char *ptr; strcpy(needdir,arg3); ptr = strrchr(needdir,'/'); if (ptr != NULL) { ptr[0] = '\0'; } saveumask = umask(0000); if ((mkdir(needdir, 1777) == -1) && (errno != EEXIST)) { log_err(errno, id, "Failed to create jobs checkpoint directory"); } umask(saveumask); } } /* END if (pair->fp_flag == JOBCKPFILE) */ *arg2 = '\0'; if (rmtflag) { /* using rcp, need to prepend the owner name */ strcat(arg2, preq->rq_ind.rq_cpyfile.rq_owner); strcat(arg2, "@"); } strcat(arg2, prmt); } /* END else (dir == STAGE_DIR_OUT) */ #ifdef HAVE_WORDEXP /* Expand and verify arg2 (source path) */ switch (wordexp(arg2, &arg2exp, WRDE_NOCMD | WRDE_UNDEF)) { case 0: wordexperr = 0; break; /* Successful */ case WRDE_NOSPACE: wordfree(&arg2exp); /* fall through */ default: sprintf(log_buffer, "Failed to expand source path in data staging: %s", arg2); add_bad_list(&bad_list, log_buffer, 2); bad_files = 1; wordexperr = 1; /* ensure we don't attempt a second source file */ goto error; /*NOTREACHED*/ break; } /* END switch () */ /* Expand and verify arg3 (destination path) */ switch (wordexp(arg3, &arg3exp, WRDE_NOCMD | WRDE_UNDEF)) { case 0: /* success - allow if word count is 1 */ if (arg3exp.we_wordc == 1) { strcpy(arg3, arg3exp.we_wordv[0]); wordfree(&arg3exp); wordexperr = 0; break; /* Successful */ } /* fall through */ case WRDE_NOSPACE: wordfree(&arg3exp); /* fall through */ default: sprintf(log_buffer, "Failed to expand destination path in data staging: %s", arg3); add_bad_list(&bad_list, log_buffer, 2); bad_files = 1; wordexperr = 1; /* ensure we don't attempt a second destination file */ goto error; break; } /* END switch () */ /* NOTE: more than one word is only allowed for arg2 (source) */ arg2index = -1; nextword: arg2index++; if (arg2index >= (int)arg2exp.we_wordc) { /* no more words */ wordfree(&arg2exp); continue; } strcpy(arg2, arg2exp.we_wordv[arg2index]); if (dir == STAGE_DIR_OUT) { strcpy(localname, arg2); } /* if we made a fake TMPDIR, and we are using it, don't delete after stagein */ if (madefaketmpdir && (faketmpdir[0] != '\0') && !strncmp(faketmpdir, arg3, strlen(faketmpdir))) { usedfaketmpdir = 1; } else { usedfaketmpdir = 0; } #endif /* HAVE_WORDEXP */ if ((rmtflag == 0) && ((is_file_same(arg2, arg3) == 1) || (is_file_going_to_dir(arg2, arg3) == 1))) { /* * If this is a local file then don't copy it * if source file and destination file are the same file or * if the destination (arg3) is a directory not a file name * and the source file (arg2) is in the destination directory (arg3) */ continue; } if ((rc = sys_copy(rmtflag, arg2, arg3, preq->rq_conn)) != 0) { FILE *fp; /* copy failed */ bad_files = 1; sprintf(log_buffer, "Unable to copy file %s to %s", arg2, arg3); add_bad_list(&bad_list, log_buffer, 2); log_err(-1, id, log_buffer); /* copy message from rcp as well */ if ((fp = fopen(rcperr, "r")) != NULL) { add_bad_list(&bad_list, "*** error from copy", 1); while (fgets(log_buffer, LOG_BUF_SIZE, fp) != NULL) { len = strlen(log_buffer) - 1; if (log_buffer[len] == '\n') log_buffer[len] = '\0'; add_bad_list(&bad_list, log_buffer, 1); } fclose(fp); add_bad_list(&bad_list, "*** end error output", 1); } error: if ((dir == STAGE_DIR_IN) || (dir == CKPT_DIR_IN)) { /* delete the stage_in files that were just copied in */ /* NOTE: running as user in user homedir */ del_files(preq, NULL, 1, &bad_list); #if NO_SPOOL_OUTPUT == 0 } else if (from_spool == 1) { /* copy out of spool */ /* Copying out files and in spool area ... */ /* move to "undelivered" directory */ strncpy(localname, path_spool, sizeof(localname)); strncat(localname, pair->fp_local, (sizeof(localname) - strlen(localname) - 1)); strncpy(undelname, path_undeliv, sizeof(undelname)); strncat(undelname, pair->fp_local, (sizeof(undelname) - strlen(undelname) - 1)); if (rename(localname, undelname) == 0) { add_bad_list(&bad_list, output_retained, 1); add_bad_list(&bad_list, undelname, 0); } else { sprintf(log_buffer, "Unable to rename %s to %s", localname, undelname); log_err(errno, id, log_buffer); } #endif /* !NO_SPOOL_OUTPUT */ } if ((dir == STAGE_DIR_IN) || (dir == CKPT_DIR_IN)) { unlink(rcperr); break; } } /* END if ((rc = sys_copy(rmtflag,arg2,arg3,preq->rq_conn)) != 0) */ else { /* Copy in/out succeeded */ if (LOGLEVEL >= 7) { sprintf(log_buffer,"copy succeeded (%s) from (%s) to (%s)\n", (dir == 0)? "In" : "Out", arg2, arg3); log_ext(-1, id, log_buffer, LOG_DEBUG); } if (dir == STAGE_DIR_OUT) { /* have copied out, ok to remove local one */ if (remtree(localname) < 0) { sprintf(log_buffer, msg_err_unlink, "stage out", localname); log_err(errno, id, log_buffer); add_bad_list(&bad_list, log_buffer, 2); bad_files = 1; } } else if (dir == CKPT_DIR_OUT) { /* if we are using the default checkpoint path then we need to clean * up the job directory */ if (strncmp(localname, path_checkpoint, strlen(path_checkpoint)) == 0) { char *ptr1; ptr1 = strrchr(localname, '/'); if (ptr1 != NULL) { ptr1[0] = '\0'; } /* * If the checkpoint directory * is in the the TRemChkptDirList then we do not delete since directory * is remotely mounted. */ if (in_remote_checkpoint_dir(localname)) { continue; } if (LOGLEVEL >= 7) { sprintf(log_buffer,"removing checkpoint file directory (%s)\n", localname); log_ext(-1, id, log_buffer, LOG_DEBUG); } } else { if (LOGLEVEL >= 7) { sprintf(log_buffer,"removing local checkpoint file (%s)\n", localname); log_ext(-1, id, log_buffer, LOG_DEBUG); } } /* have copied out, ok to remove local one */ if (remtree(localname) < 0) { sprintf(log_buffer, msg_err_unlink, "checkpoint", localname); log_err(errno, id, log_buffer); add_bad_list(&bad_list, log_buffer, 2); bad_files = 1; } } } unlink(rcperr); #ifdef HAVE_WORDEXP if (!wordexperr) goto nextword; /* ugh, it's hard to use a real loop when your feature is #ifdef's out */ #endif } /* END for (pair) */ #ifdef HAVE_WORDEXP if (madefaketmpdir && !usedfaketmpdir) { remtree(faketmpdir); } #endif if (bad_files) { reply_text(preq, PBSE_NOCOPYFILE, bad_list); } else { reply_ack(preq); } /* we are the child, exit not return */ /* SUCCESS */ exit(0); } /* END req_cpyfile() */ /* * req_delfile - delete the specifled output/staged files */ void req_delfile( struct batch_request *preq) /* I */ { int rc; char *bad_list = NULL; char HDir[1024]; char EMsg[1024]; rc = (int)fork_to_user(preq, FALSE, HDir, EMsg); if (rc < 0) { /* FAILURE */ req_reject(-rc, 0, preq, mom_host, EMsg); return; } if (rc > 0) { /* parent */ /* continue with other tasks */ /* SUCCESS */ return; } /* child */ /* running as root in TORQUE homedir */ /* delete the files */ if ((rc = del_files(preq, HDir, 1, &bad_list))) { /* FAILURE */ reply_text(preq, rc, bad_list); exit(0); } /* SUCCESS */ reply_ack(preq); /* we are the child, exit not return */ exit(0); } /* END req_delfile() */ /* END requests.c */ torque-2.4.16/src/resmom/mom_server.c0000664000113300011330000016524611533010306014455 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /*============================================================================ * mom_server.c *============================================================================ * * This file contains code related to mom's servers. A pbs_mom process * receives messages from a pbs_server process and replies back to these * messages. A pbs_mom will ONLY talk to pre-defined instances of pbs_server. * These are defined by config files and the in-memory instances of these * server definitions are maintained in mom_server structures. * * In this file, the naming convention for routines will be of the form * mom_server_xxx where xxx is the method name and mom_server corresponds * to the class name so this is equivalent to mom_server::xxx if this were * a C++ program. This describes functions which operate on a instance * of a mom_server. There will also be aggregate functions that operate * on the set of all mom_servers. These names will be of the form * mom_server_all_xxx. * * Note that there are two senarios being encompassed in this code. One * is the idea of independent pbs_servers controlling and receiving status * updates from a compute node. The other idea is the newer one of having * the two or more pbs_servers operating as redundant sets. * * The practical implication of this becomes apparent when a job finishes * and an OBIT message must be sent up to the job's controlling pbs_server. * If the servers are independent, then the OBIT must go only to the server * that sent the queuejob request. However, if the servers are a redundant * set, then the code sending the OBIT must iterate through the set attempting * to sent the OBIT until it succeeds. * * The mom_server structure contains a reference to a connection. Connections * are basically a socket and event handler pair. Connections are also used * in communication with a scheduler and with sister moms. * * Here are the senarios pertaining to this module. * * HELLO sent by pbs_server first * ------------------------------ * * pbs_server pbs_mom * | | * +--- HELLO ----------->| * | | * |<----------- HELLO ---+ * | | * +--- CLUSTER_ADDRS --->| * | | * * * HELLO sent by pbs_mom first * --------------------------- * * pbs_server pbs_mom * | | * |<----------- HELLO ---+ * | | * +--- CLUSTER_ADDRS --->| * | | * * * HELLO sent by both * ------------------ * Both HELLO's are launched at the same time. * This is my best guess at how this works. * In mom_server_valid_message_source it tries to match the * stream number on which the message arrived with a server. * If the stream is found, the message is valid. Otherwise, * an attempt is made to match the IP address from the message * source with the IP address of some existing server stream. * If a match is found, a message is logged about a duplicate * stream, the previous stream associated with the server is * closed and the new stream replaces it. * * pbs_server pbs_mom * | | * +--- HELLO ----------->| * | | * |<----------- HELLO ---+ * | | * +--- CLUSTER_ADDRS --->| * | | * * * STATUS sent by pbs_mom * ---------------------- * The pbs_mom has timer and when it fires, a IS_STATUS message * is sent to all servers. There is no response from the server. * * pbs_server pbs_mom * | | * |<---------- STATUS ---+ * | | * * * UPDATE sent by pbs_mom * ---------------------- * Each server has a flag, ReportMomState, that is set whenever * the state changes. Every time the main loop cycles, all servers * are checked and if the flag is set, an IS_UPDATE message is * sent to the server. There is no response from the server. * The state is also sent periodically in the STATUS message * and so when this message is sent, the ReportMomState flag is * cleared. * * pbs_server pbs_mom * | | * |<---------- UPDATE ---+ * | | * * *---------------------------------------------------------------------------- */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H) #include #endif #include "pbs_ifl.h" #include "pbs_error.h" #include "log.h" #include "net_connect.h" #include "rpp.h" #include "dis.h" #include "dis_init.h" #include "list_link.h" #include "attribute.h" #include "pbs_nodes.h" #include "resmon.h" #include "server_limits.h" #include "pbs_job.h" #include "utils.h" #include "mcom.h" /* Global Data Items */ #include "Long.h" #define MAX_RETRY_TIME_IN_SECS (5 * 60) #define STARTING_RETRY_INTERVAL_IN_SECS 2 typedef struct mom_server { int SStream; /* streams to pbs_server daemons */ char pbs_servername[PBS_MAXSERVERNAME + 1]; time_t next_connect_time; int connect_failure_count; int sent_hello_count; char ReportMomState; time_t MOMLastSendToServerTime; time_t MOMLastRecvFromServerTime; char MOMLastRecvFromServerCmd[MMAX_LINE]; int received_hello_count; int received_cluster_address_count; char MOMSendStatFailure[MMAX_LINE]; } mom_server; mom_server mom_servers[PBS_MAXSERVER]; int mom_server_count = 0; pbs_net_t down_svraddrs[PBS_MAXSERVER]; extern unsigned int default_server_port; extern char mom_host[]; extern char *path_jobs; extern char *path_home; extern char *path_spool; extern int pbs_errno; extern unsigned int pbs_mom_port; extern unsigned int pbs_rm_port; extern unsigned int pbs_tm_port; extern int internal_state; extern int LOGLEVEL; extern char PBSNodeCheckPath[1024]; extern int PBSNodeCheckInterval; extern char PBSNodeMsgBuf[1024]; extern int received_hello_count[]; extern char TMOMRejectConn[]; extern time_t LastServerUpdateTime; extern int ServerStatUpdateInterval; extern long system_ncpus; extern int alarm_time; /* time before alarm */ extern int rm_errno; extern time_t time_now; extern int verbositylevel; extern tree *okclients; /* accept connections from */ extern struct config *rm_search(struct config *where, char *what); extern struct rm_attribute *momgetattr(char *str); extern char *conf_res(char *resline, struct rm_attribute *attr); extern char *dependent(char *res, struct rm_attribute *attr); extern char *reqgres(struct rm_attribute *); char TORQUE_JData[MMAX_LINE]; void state_to_server A_((int, int)); extern void DIS_rpp_reset A_((void)); /** * mom_server_init * * Does the memory intialization for an instance of a mom server * structure. * * @param pms pointer to mom_server instance * @see mom_server_all_init */ void mom_server_init( mom_server *pms) { pms->SStream = -1; pms->MOMLastRecvFromServerTime = 0; pms->ReportMomState = 1; return; } /** * mom_server_all_init * * Does the memory intialization for all instances of the mom server * structures. Called from the pbs_mom startup code. * @see setup_program_envrionment */ void mom_server_all_init(void) { int sindex; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { mom_server_init(&mom_servers[sindex]); } mom_server_count = 0; return; } /* END mom_server_all_init() */ /*-------------------------------------------------------------------- * mom_server_find_by_name *-------------------------------------------------------------------- * Find an instance of a mom server structure given a server name. * * @param stream number to find * @see mom_server_find_by_ip */ mom_server *mom_server_find_by_name( char *name) { mom_server *pms; int sindex; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { pms = &mom_servers[sindex]; if (!strcmp(pms->pbs_servername, name)) { return(pms); } } return(NULL); } /*-------------------------------------------------------------------- * mom_server_find_by_stream *-------------------------------------------------------------------- * Find an instance of a mom server structure given a stream number. * * @param stream number to find * @see mom_server_find_by_ip */ mom_server *mom_server_find_by_stream( int stream) { mom_server *pms; int sindex; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { pms = &mom_servers[sindex]; if (pms->SStream == stream) { return(pms); } } return(NULL); } /*-------------------------------------------------------------------- * mom_server_find_by_ip *-------------------------------------------------------------------- * Find an instance of a mom server structure given an ip address. * * @param ipaddr IP address to find * @see mom_server_find_by_stream */ mom_server *mom_server_find_by_ip( u_long search_ipaddr) { mom_server *pms; int sindex; struct sockaddr_in *addr; u_long ipaddr; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { pms = &mom_servers[sindex]; if (pms->SStream != -1) { addr = rpp_getaddr(pms->SStream); if (addr == NULL) { /* FAILURE */ return(NULL); } ipaddr = ntohl(addr->sin_addr.s_addr); if (ipaddr == search_ipaddr) { return(pms); } } } /* END for (sindex) */ /* FAILURE */ return(NULL); } /* END mom_server_find_by_ip() */ /*-------------------------------------------------------------------- * mom_server_find_empty_slot *-------------------------------------------------------------------- * Find a free instance of a mom server structure. * */ mom_server *mom_server_find_empty_slot(void) { mom_server *pms; int sindex; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { pms = &mom_servers[sindex]; if (pms->pbs_servername[0] == 0) { return(pms); } } return(NULL); } /** * mom_server_add * * Allocate a mom server structure from the global array. * * @param value name of the new server to be added * @see setpbsservername */ int mom_server_add( char *value) { static char *id = "mom_server_add"; mom_server *pms; if ((pms = mom_server_find_by_name(value))) { /* This server name has already been added. */ sprintf(log_buffer, "server host %s already added", value); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else if ((pms = mom_server_find_empty_slot()) != NULL) { /* Fill in the new server instance */ strncpy(pms->pbs_servername, value, PBS_MAXSERVERNAME); mom_server_count++; sprintf(log_buffer, "server %s added", pms->pbs_servername); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { sprintf(log_buffer, "server table overflow (max=%d) - server host %s not added", PBS_MAXSERVER, value); log_err(-1, id, log_buffer); return(0); /* FAILURE */ } /* Leaving this out breaks things but seems bad because if gethostbyname fails, * there is no retry except for the old way reinserting the name over and over again. * And what happens if the server connect via a different interface than the * one that gethostbyname returns? It really seems better to not deal with * the IP address here but rather do what needs to be done when a connection * is established. Anyway, this should fix things for now. */ { struct hostent *host; struct in_addr saddr; u_long ipaddr; /* FIXME: must be able to retry failed lookups later */ if ((host = gethostbyname(pms->pbs_servername)) == NULL) { sprintf(log_buffer, "host %s not found", pms->pbs_servername); log_err(-1, id, log_buffer); } else { memcpy(&saddr, host->h_addr, host->h_length); ipaddr = ntohl(saddr.s_addr); if (ipaddr != 0) tinsert(ipaddr, NULL, &okclients); } } /* END BLOCK */ return(1); /* SUCCESS */ } /* END mom_server_add() */ /** * mom_server_open_stream * * Open a connection to a pbs_server. * * @param pms pointer to mom_server instance * * @see mom_server_check_connection() - parent */ int mom_server_open_stream( mom_server *pms) { static char id[] = "mom_server_open_stream"; static int PassCount = 0; char server_name[PBS_MAXSERVERNAME + 1]; int port = default_server_port; char *portstr; /* Make a copy of the server name because it might have a port number. */ strcpy(server_name, pms->pbs_servername); if ((portstr = strchr(server_name, ':')) != NULL) { *(portstr) = '\0'; if (*(portstr + 1) != '\0') port = atoi(portstr + 1); } if (LOGLEVEL >= 5) { sprintf(log_buffer, "%s: trying to open RPP conn to %s port %d", id, server_name, port); log_record(PBSEVENT_SYSTEM,0,id,log_buffer); } if ((pms->SStream = rpp_open( server_name, port, pms->MOMSendStatFailure)) < 0) { /* FAILURE */ if ((PassCount == 0) || (LOGLEVEL >= 6)) { if (errno == ENOENT) { sprintf(log_buffer, "%s: cannot open rpp connection to %s, errno=%d, %s (check /etc/hosts file?)", id, server_name, errno, pms->MOMSendStatFailure); } else { sprintf(log_buffer, "%s: cannot open rpp connection to %s, errno=%d, %s", id, server_name, errno, pms->MOMSendStatFailure); } log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } PassCount = 1; pms->SStream = -1; return(DIS_EOF); } /* END if ((pms->SStream = rpp_open()) < 0) */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "%s: added connection to %s port %d", id, server_name, port); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } return(DIS_SUCCESS); } /* END mom_server_open_stream() */ void mom_server_close_stream( int stream) { mom_server *pms; if ((pms = mom_server_find_by_stream(stream)) != NULL) { pms->SStream = -1; /* Force new connection to server next time mom_server_check_connections is called. */ } return; } void mom_server_stream_error( mom_server *pms, char *id, char *message) { sprintf(log_buffer, "error %s to server %s", message, pms->pbs_servername); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); rpp_close(pms->SStream); pms->SStream = -1; /* Force new connection to server next time mom_server_check_connections is called. */ return; } /* END mom_server_stream_error() */ /** * mom_server_flush_io * * A wrapper function for the library that adds logging and error * handling specific to the mom_server module. * * @param pms pointer to mom_server instance */ int mom_server_flush_io( mom_server *pms, char *id, char *message) { if (rpp_flush(pms->SStream) == -1) { log_err(errno, id, message); rpp_close(pms->SStream); pms->SStream = -1; /* Force new connection to server next time mom_server_check_connections is called. */ return(DIS_PROTO); } return(DIS_SUCCESS); } /** * Create an inter-server message to send to pbs_server (i.e., 'send status update') * * @see state_to_server() - parent - create state IS_UPDATE message * @see is_update_stat() - parent - create full IS_UPDATE message * @see is_request() - peer - process hello/cluster_addrs requests from pbs_server */ int is_compose( mom_server *pms, int command) { int ret; if (pms->SStream < 0) { return(DIS_EOF); } DIS_rpp_reset(); if ((ret = diswsi(pms->SStream, IS_PROTOCOL)) != DIS_SUCCESS) { mom_server_stream_error(pms, "is_compose", "writing protocol"); return(ret); } else if ((ret = diswsi(pms->SStream, IS_PROTOCOL_VER)) != DIS_SUCCESS) { mom_server_stream_error(pms, "is_compose", "writing protocol version"); return(ret); } else if ((ret = diswsi(pms->SStream, command)) != DIS_SUCCESS) { mom_server_stream_error(pms, "is_compose", "writing protocol version"); return(ret); } return(DIS_SUCCESS); } /* END is_compose() */ /** * generate_server_status * * This should update the PBS server with the status information * that the resource manager should need. This should allow for * less trouble on the part of the resource manager. It can get * this information from the server rather than going to each mom. * * This was originally part of is_update_stat, a very complicated * routine. I have broken this into pieces so that the special cases * a each in a specific routine. The routine gen_gen is the one * for the general case. * * The old is_update_stat used to write directly to a DIS stream. * Now we generate the strings in to a buffer, each string terminated * with a NULL and a double NULL at the end. * * Warning: Because of the complexity of the old is_update_stat, it * was very hard to break out the special cases. I actually had to * go back and look at older code before there were multiple server * arrays to try and figure out what should be happening. * * If there is some trouble with some status getting back to the * pbs_server, this is the place to look. */ extern struct config *config_array; /** * gen_size * * For the size attribute to be returned, it must be * defined in the pbs_mom config file. The syntax * is unique in that you must ask for the size of * either a file or a file system. * * For example: * size[fs=/] * size[file=/home/user/test.txt] */ void gen_size( char *name, char **BPtr, int *BSpace) { struct config *ap; struct rm_attribute *attr; char *value; ap = rm_search(config_array, name); if (ap) { attr = momgetattr(ap->c_u.c_value); if (attr) { value = dependent(name, attr); if (value && *value) { MUSNPrintF(BPtr, BSpace, "%s=%s", name, value); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } } } return; } void gen_arch( char *name, char **BPtr, int *BSpace) { struct config *ap; ap = rm_search(config_array,name); if (ap != NULL) { MUSNPrintF(BPtr,BSpace,"%s=%s", name, ap->c_u.c_value); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } return; } void gen_opsys( char *name, char **BPtr, int *BSpace) { struct config *ap; ap = rm_search(config_array,name); if (ap != NULL) { MUSNPrintF(BPtr,BSpace,"%s=%s", name, ap->c_u.c_value); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } return; } void gen_jdata( char *name, char **BPtr, int *BSpace) { if (TORQUE_JData[0] != '\0') { MUSNPrintF(BPtr,BSpace,"%s=%s", name, TORQUE_JData); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } return; } void gen_gres( char *name, char **BPtr, int *BSpace) { char *value; value = reqgres(NULL); if (value != NULL) { MUSNPrintF(BPtr, BSpace, "%s=%s", name, value); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } return; } /* END gen_gres() */ void gen_gen( char *name, char **BPtr, int *BSpace) { struct config *ap; char *value; char *ptr; ap = rm_search(config_array,name); if (ap != NULL) { ptr = conf_res(ap->c_u.c_value, NULL); if (ptr && *ptr) { MUSNPrintF(BPtr,BSpace,"%s=%s", name, ptr); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } } else { value = dependent(name, NULL); if (value == NULL) { /* value not set (attribute required) */ MUSNPrintF(BPtr,BSpace,"%s=? %d", name, rm_errno); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } else if (value[0] == '\0') { /* value not set (attribute optional) */ } else { MUSNPrintF(BPtr, BSpace, "%s=%s", name, value); (*BPtr)++; /* Need to start the next string after the null */ (*BSpace)--; } } /* else if (ap) */ return; } /* END gen_gen() */ typedef void (*gen_func_ptr)(char *, char **, int *); typedef struct stat_record { char *name; gen_func_ptr func; } stat_record; stat_record stats[] = { {"arch", gen_arch}, {"opsys", gen_gen}, {"uname", gen_gen}, {"sessions", gen_gen}, {"nsessions", gen_gen}, {"nusers", gen_gen}, {"idletime", gen_gen}, {"totmem", gen_gen}, {"availmem", gen_gen}, {"physmem", gen_gen}, {"ncpus", gen_gen}, {"loadave", gen_gen}, {"message", gen_gen}, {"gres", gen_gres}, {"netload", gen_gen}, {"size", gen_size}, {"state", gen_gen}, {"jobs", gen_gen}, {"jobdata", gen_jdata}, {"varattr", gen_gen}, {NULL, NULL} }; /** * generate_server_status * */ void generate_server_status( char *buffer, int buffer_size) { int i; char *BPtr = buffer; int BSpace = buffer_size; for (i = 0;stats[i].name != NULL;i++) { alarm(alarm_time); if (stats[i].func) { (stats[i].func)(stats[i].name, &BPtr, &BSpace); } alarm(0); } /* END for (i) */ TORQUE_JData[0] = '\0'; return; } /* END generate_server_status */ /** * mom_server_update_stat * * Send a status update message to a server. * * NOTE: if interface is bad, try to recover is ??? * * @param mom_server_all_update_stat() - parent * @param pms pointer to mom_server instance */ void mom_server_update_stat( mom_server *pms, char *status_strings) { static char *id = "mom_server_update_stat"; char *cp; if (pms->pbs_servername[0] == 0) { /* No server is defined for this slot */ return; } if (pms->SStream == -1) { sprintf(log_buffer, "server \"%s\" has no active stream", pms->pbs_servername); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); return; } pms->MOMLastSendToServerTime = time(0); /* Generate the message header. */ if (is_compose(pms,IS_STATUS) != DIS_SUCCESS) { return; } /* For each string, put it into the message. */ for (cp = status_strings;cp && *cp;cp += strlen(cp) + 1) { if (LOGLEVEL >= 7) { sprintf(log_buffer,"%s: sending to server \"%s\"", id, cp); log_record(PBSEVENT_SYSTEM,0,id,log_buffer); } if (diswst(pms->SStream,cp) != DIS_SUCCESS) { mom_server_stream_error(pms, id, "writing status string"); /* FAILURE */ return; } } /* Launch the message */ if (mom_server_flush_io(pms, id, "flush") != DIS_SUCCESS) { /* FAILURE */ return; } if (LOGLEVEL >= 3) { sprintf(log_buffer, "status update successfully sent to %s", pms->pbs_servername); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } /* It would be redundant to send state since it is already in status */ pms->ReportMomState = 0; return; } /* END mom_server_update_stat() */ /** * mom_server_all_update_stat * * This is the former is_update_stat. It has been reworked to * first generate the strings and then walk the server list sending * the strings to each server. */ void mom_server_all_update_stat(void) { static char *id = "mom_server_all_update_stat"; static char status_strings[16 * 1024]; /* Big but smaller than before in is_update_stat */ int sindex; /* We generate the status once, because this might be costly. * The buffer status_strings will contain NULL terminated strings. * The end of the buffer is marked with an empty string i.e. NULL NULL. */ if (LOGLEVEL >= 6) { log_record(PBSEVENT_SYSTEM, 0, id, "composing status update for server"); } memset(status_strings, 0, sizeof(status_strings)); generate_server_status(status_strings, sizeof(status_strings)); for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { mom_server_update_stat(&mom_servers[sindex],status_strings); } return; } /* END mom_server_all_update_stat() */ /** * power */ long power( register int x, register int n) { register long p; for (p = 1;n > 0;--n) { p *= x; } return(p); } int calculate_retry_seconds( int count) { int retry_seconds = 0; /* Why are we using this hand-crafted power function instead of pow()? */ /* pow() is probably using a more efficient processor instruction on most * architectures */ retry_seconds = power(STARTING_RETRY_INTERVAL_IN_SECS, count); /* the (retry_seconds <= 0) condition helps avoid overflow! */ if ((retry_seconds > MAX_RETRY_TIME_IN_SECS) || (retry_seconds <= 0)) { retry_seconds = MAX_RETRY_TIME_IN_SECS; } return(retry_seconds); } /** * mom_server_send_hello * * This sends a hello message to server. * * @param pms pointer to mom_server instance * @return count 0 or -1 * */ int mom_server_send_hello( mom_server *pms) { static char id[] = "mom_server_send_hello"; if (is_compose(pms, IS_HELLO) == -1) { return(-1); } if (mom_server_flush_io(pms, id, "flush") != DIS_SUCCESS) { return(-1); } pms->sent_hello_count++; return(0); } /* END mom_server_send_hello() */ /** * mom_server_check_connection * * This checks the status of one server. * * @param pms pointer to mom_server instance * @return count 0 or 1 * * @see mom_server_all_check_connection() - parent * @see mom_server_open_stream() - child * @see calculate_retry_seconds() - child * * NOTE: time_now updated in main_loop() */ int mom_server_check_connection( mom_server *pms) { static char id[] = "mom_server_check_connection"; if (pms->pbs_servername[0] == '\0') { return(0); } if ((pms->SStream != -1) && (time_now >= (pms->MOMLastSendToServerTime + (ServerStatUpdateInterval*2)))) { sprintf(log_buffer,"connection to server %s timeout", pms->pbs_servername); log_record(PBSEVENT_SYSTEM,0,id,log_buffer); rpp_close(pms->SStream); pms->SStream = -1; } if (pms->SStream == -1) { /* No connection to server */ if ((pms->next_connect_time == 0) || (pms->next_connect_time <= time_now)) { if (mom_server_open_stream(pms) == DIS_SUCCESS) { pms->connect_failure_count = 0; pms->received_cluster_address_count = 0; } else { pms->connect_failure_count++; pms->next_connect_time = time_now + calculate_retry_seconds(pms->connect_failure_count); sprintf(log_buffer, "unable to establish/restore connection to server %s (failcount=%d, retry in %ld seconds)", pms->pbs_servername, pms->connect_failure_count, pms->next_connect_time - (long)time_now); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); return(0); /* attempt to restore connection to pbs_server failed */ } sprintf(log_buffer, "sending hello to server %s", pms->pbs_servername); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); pms->MOMLastSendToServerTime = time_now; if (mom_server_send_hello(pms) == -1) { return(0); } } } /* END if (pms->SStream == -1) */ return(pms->received_cluster_address_count); } /* END mom_server_check_connection() */ /** * mom_server_all_check_connection * * This routine checks all of the servers to see * if they are active and up. * * @return count of active servers * * @see mom_server_check_connection() - child */ int mom_server_all_check_connection(void) { int sindex; /* server index */ int TotalClusterAddrsCount; TotalClusterAddrsCount = 0; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { if (mom_servers[sindex].pbs_servername[0] == '\0') continue; TotalClusterAddrsCount += mom_server_check_connection(&mom_servers[sindex]); } /* END for (sindex) */ return(TotalClusterAddrsCount); } /* END mom_server_all_check_connection() */ /** * mom_server_diag * * This routine generates the diagnostic information for a single server * instance. Note that the strings generated are newline separated. * * @param pms pointer to mom_server instance * @param sindex the mom_server index (used to display a server ID name) * @param BPtr pointer to space for writing the string * @param BSpace amount of space remaining * @see mom_server_all_diag */ void mom_server_diag( mom_server *pms, int sindex, char **BPtr, int *BSpace) { char tmpLine[1024]; time_t Now; if (pms->pbs_servername[0] == '\0') { return; } time(&Now); sprintf(tmpLine, "Server[%d]: %s (%s)\n", sindex, pms->pbs_servername, netaddr(rpp_getaddr(pms->SStream))); MUStrNCat(BPtr, BSpace, tmpLine); if ((pms->received_hello_count > 0) || (pms->received_cluster_address_count > 0)) { if (verbositylevel >= 1) { sprintf(tmpLine, " Init Msgs Received: %d hellos/%d cluster-addrs\n", pms->received_hello_count, pms->received_cluster_address_count); MUStrNCat(BPtr, BSpace, tmpLine); sprintf(tmpLine, " Init Msgs Sent: %d hellos\n", pms->sent_hello_count); MUStrNCat(BPtr, BSpace, tmpLine); } } else { sprintf(tmpLine, " WARNING: no hello/cluster-addrs messages received from server\n"); MUStrNCat(BPtr, BSpace, tmpLine); sprintf(tmpLine, " Init Msgs Sent: %d hellos\n", pms->sent_hello_count); MUStrNCat(BPtr, BSpace, tmpLine); } if (pms->MOMSendStatFailure[0] != '\0') { sprintf(tmpLine, " WARNING: could not open connection to server, %s%s\n", pms->MOMSendStatFailure, (strstr(pms->MOMSendStatFailure, "cname") != NULL) ? " (check name resolution - /etc/hosts?)" : ""); MUStrNCat(BPtr, BSpace, tmpLine); } if (TMOMRejectConn[0] != '\0') { MUSNPrintF(BPtr, BSpace, " WARNING: invalid attempt to connect from server %s\n", TMOMRejectConn); } if (pms->MOMLastRecvFromServerTime > 0) { sprintf(tmpLine, " Last Msg From Server: %ld seconds (%s)\n", (long)Now - pms->MOMLastRecvFromServerTime, (pms->MOMLastRecvFromServerCmd[0] != '\0') ? pms->MOMLastRecvFromServerCmd : "N/A"); } else { sprintf(tmpLine, " WARNING: no messages received from server\n"); } MUStrNCat(BPtr, BSpace, tmpLine); if (pms->MOMLastSendToServerTime > 0) { sprintf(tmpLine, " Last Msg To Server: %ld seconds\n", (long)Now - pms->MOMLastSendToServerTime); } else { sprintf(tmpLine, " WARNING: no messages sent to server\n"); } MUStrNCat(BPtr, BSpace, tmpLine); return; } /* END mom_server_diag() */ /** * mom_server_all_diag * * This routine is called as a result of a momctl -d3 command. * It generates strings that are sent back to the momctl * program to display diagnostic information about the servers. * This is called from mom_main where the message is recognized * and the other parts of the diagnostics are generated. */ void mom_server_all_diag( char **BPtr, int *BSpace) { int sindex; if (mom_servers[0].pbs_servername[0] == '\0') { MUStrNCat(BPtr, BSpace, "WARNING: server not specified (set $pbsserver)\n"); } else { for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { mom_server_diag(&mom_servers[sindex], sindex, BPtr, BSpace); } } return; } /** * mom_server_update_receive_time * * This is called from is_request whenever a message is received * from a pbs_server. The information saved here is used to * display diagnostics and to decide if the server is up and active. * * @param stream The stream number to update. * @param command_name The name of the command that was received. */ void mom_server_update_receive_time(int stream, char *command_name) { mom_server *pms; if ((pms = mom_server_find_by_stream(stream)) != NULL) { pms->MOMLastRecvFromServerTime = time(0); strcpy(pms->MOMLastRecvFromServerCmd, command_name); } } /** * mom_server_update_receive_time_by_ip * * This is a little weird as this is called from code * in the server directory, process_request. There is * no stream number there but instead there is an IP * address and so we use that to look up the server * and update the info. * * @param ipaddr The IP address from which the command was received. * @param command_name The name of the command that was received. */ void mom_server_update_receive_time_by_ip( u_long ipaddr, char *command_name) { mom_server *pms; if ((pms = mom_server_find_by_ip(ipaddr)) != NULL) { pms->MOMLastRecvFromServerTime = time(0); strcpy(pms->MOMLastRecvFromServerCmd, command_name); } return; } /** ** Modified by Tom Proett for PBS. */ tree *okclients = NULL; /* tree of ip addrs */ /** * mom_server_valid_message_source * * This routine is called from is_request to validate * that the request is coming from a know server. * If the server is good, a pointer to the server * instance is returned. Otherwise NULL indicates error. * * @param stream The stream number in question * @return pms A pointer to the server instance. * @see is_request */ mom_server *mom_server_valid_message_source( int stream) { static char *id = "mom_server_valid_message_source"; struct sockaddr_in *addr = NULL; u_long ipaddr; mom_server *pms; /* Check for the normal case, where some server has an open, * establish stream connection to the place where this * message came from. */ if ((pms = mom_server_find_by_stream(stream))) { return(pms); } addr = rpp_getaddr(stream); /* Get pointer to sockaddr_in for message source address */ ipaddr = ntohl(addr->sin_addr.s_addr); /* Extract IP address of source of the message. */ /* So the stream number did not match any server but maybe * the server has another stream connection open to the IP address. */ if ((pms = mom_server_find_by_ip(ipaddr))) { /* This case can happen when both the pbs_mom and the pbs_server initiate * a communication session with the HELLO protocol on startup. * We then have a stream open from both sides. In this case, the pbs_mom * defers and closes the existing stream, replacing it with the new one * from the server. */ if (pms->SStream != -1) { sprintf(log_buffer, "duplicate connection from %s - closing original connection", netaddr(addr)); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); rpp_close(pms->SStream); } /* Now this is the current stream number for this server */ pms->SStream = stream; mom_server_send_hello(pms); return(pms); } else { /* There is no existing stream connection to the server. */ /* Maybe the right thing to do now is to iterate over all defined * servers. If there are servers defined with no open stream * and a gethostbyname result matches the message source IP address, * then accept the stream and put the stream number into the * server struct. Then in the future, the normal case above * will match. This approach doesn't have the mom's madly * attempting to clobber the network with gethostbyname if * the DNS server is dead. We only do gethostbyname if we * get a message from the pbs_server. */ #if 1 { int sindex; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { pms = &mom_servers[sindex]; if (pms->pbs_servername[0] && pms->SStream != -1) { struct hostent *host; struct in_addr saddr; u_long server_ip; if ((host = gethostbyname(pms->pbs_servername)) != NULL) { memcpy(&saddr, host->h_addr, host->h_length); server_ip = ntohl(saddr.s_addr); if (ipaddr == server_ip) { tinsert(ipaddr, NULL, &okclients); pms->SStream = stream; return(pms); } } } } } /* END BLOCK */ #endif sprintf(log_buffer, "bad connect from %s - unauthorized server", netaddr(addr)); sprintf(TMOMRejectConn, "%s %s", netaddr(addr), "(server not authorized)"); log_ext(-1,id,log_buffer,LOG_ALERT); rpp_close(stream); } return(NULL); } /* END mom_server_valid_message_source() */ /** * Request is coming from another server (i.e., pbs_server) over a DIS rpp * stream (process 'hello' and 'cluster_addrs' request). * * @see is_compose() - peer - generate message to send to pbs_server. * @see process_request() - peer - handle jobstart, jobcancel, etc messages. * * Read the stream to get a Inter-Server request. */ void is_request( int stream, /* I */ int version, /* I */ int *cmdp) /* O (optional) */ { static char id[] = "is_request"; int command = 0; int ret = DIS_SUCCESS; mom_server *pms; struct sockaddr_in *addr = NULL; u_long ipaddr; extern char *PBSServerCmds[]; if (cmdp != NULL) *cmdp = 0; if (LOGLEVEL >= 4) { sprintf(log_buffer, "stream %d version %d", stream, version); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } if (version != IS_PROTOCOL_VER) { sprintf(log_buffer, "protocol version %d unknown", version); log_ext(-1,id,log_buffer,LOG_ALERT); rpp_close(stream); return; } /* check that machine is okay to be a server */ /* If the stream is the SStream we already opened, then it's fine */ if ((pms = mom_server_valid_message_source(stream)) == NULL) return; command = disrsi(stream, &ret); if (ret != DIS_SUCCESS) goto err; if (cmdp != NULL) *cmdp = command; if (LOGLEVEL >= 3) { sprintf(log_buffer, "command %d, \"%s\", received", command, PBSServerCmds[command]); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } mom_server_update_receive_time(stream, PBSServerCmds[command]); switch (command) { case IS_NULL: /* a ping from the server */ /* nothing seems to ever generate an IS_NULL message */ if (internal_state & INUSE_DOWN) { int sindex; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { if (mom_servers[sindex].SStream != -1) state_to_server(sindex, 1); } } break; case IS_HELLO: /* server wants a return ping */ if (is_compose(pms, IS_HELLO) != DIS_SUCCESS) { break; } if (mom_server_flush_io(pms, id, "flush") != DIS_SUCCESS) break; pms->received_hello_count++; /* FORCE immediate server update */ LastServerUpdateTime = 0; break; case IS_CLUSTER_ADDRS: for (;;) { ipaddr = disrul(stream, &ret); if (ret != DIS_SUCCESS) break; tinsert(ipaddr, NULL, &okclients); if (LOGLEVEL >= 4) { char tmpLine[1024]; sprintf(tmpLine, "%s:\t%s added to okclients", id, netaddr_pbs_net_t(ipaddr)); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, tmpLine); } } /* END for (;;) */ if (ret != DIS_EOD) goto err; pms->received_cluster_address_count++; /* FORCE immediate update server */ LastServerUpdateTime = 0; break; default: sprintf(log_buffer, "unknown command %d sent", command); log_ext(-1,id,log_buffer,LOG_ALERT); goto err; } /* END switch(command) */ rpp_eom(stream); return; err: /* We come here if we got a DIS read error or a protocol ** element is missing. */ sprintf(log_buffer, "%s from %s", dis_emsg[ret], (addr != NULL) ? netaddr(addr) : "???"); log_ext(-1,id,log_buffer,LOG_ALERT); rpp_close(stream); if (pms) pms->SStream = -1; /* Force new connection to server next time mom_server_check_connections is called. */ } /* END is_request() */ float compute_load_threshold( char *config, int numvnodes, float threshold) { float retval = -1; float tmpval; char *op; if (numvnodes <= 0) { return(threshold); } if ((config == NULL) || (*config == '0')) { return(threshold); } switch (*config) { case 'c': retval = system_ncpus; break; case 't': retval = numvnodes; break; default: return(threshold); /*NOTREACHED*/ break; } config++; switch (*config) { case '+': case '-': case '*': case '/': op = config; break; default: return(retval); /*NOTREACHED*/ break; } config++; tmpval = atof(config); if (!tmpval) { return(retval); } switch (*op) { case '+': retval = retval + tmpval; break; case '-': retval = retval - tmpval; break; case '*': retval = retval * tmpval; break; case '/': retval = retval / tmpval; break; } return(retval); } /* END compute_load_threshold() */ /* * check_busy() - * If current load average ge max_load_val and busy not already set * set it * If current load average lt ideal_load_val and busy currently set * unset it */ void check_busy( double mla) /* I */ { static char id[] = "check_busy"; int sindex; int numvnodes = 0; job *pjob; float myideal_load; float mymax_load; extern int internal_state; extern float ideal_load_val; extern float max_load_val; extern char *auto_ideal_load; extern char *auto_max_load; extern tlist_head svr_alljobs; if ((auto_max_load != NULL) || (auto_ideal_load != NULL)) { if ((pjob = (job *)GET_NEXT(svr_alljobs)) != NULL) { for (;pjob != NULL;pjob = (job *)GET_NEXT(pjob->ji_alljobs)) numvnodes += pjob->ji_numvnod; } mymax_load = compute_load_threshold(auto_max_load, numvnodes, max_load_val); myideal_load = compute_load_threshold(auto_ideal_load, numvnodes, ideal_load_val); } else { mymax_load = max_load_val; myideal_load = ideal_load_val; } if ((mla >= mymax_load) && ((internal_state & INUSE_BUSY) == 0)) { /* node transitioned from free to busy, report state */ if (LOGLEVEL >= 2) { sprintf(log_buffer, "state changed from idle to busy (load max=%f detected=%f)\n", mymax_load, mla); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } internal_state |= INUSE_BUSY; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { if (mom_servers[sindex].SStream != -1) mom_servers[sindex].ReportMomState = 1; } } else if ((mla < myideal_load) && ((internal_state & INUSE_BUSY) != 0)) { /* node transitioned from busy to free, report state */ if (LOGLEVEL >= 4) { sprintf(log_buffer, "state changed from busy to idle (load max=%f detected=%f)\n", mymax_load, mla); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } internal_state = (internal_state & ~INUSE_BUSY); for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { if (mom_servers[sindex].SStream != -1) mom_servers[sindex].ReportMomState = 1; } } return; } /* END check_busy() */ /* * check_state() - * if down criteria satisfied and node is up, mark node down * if down criteria is not set and node is down, mark it up */ void check_state( int Force) /* I */ { static int ICount = 0; static char tmpPBSNodeMsgBuf[1024]; char *id = "check_state"; if (Force) { ICount = 0; } /* conditions: external state should be down if - inadequate file handles available (for period X) - external health check fails */ /* verify adequate space in spool directory */ #define TMINSPOOLBLOCKS 100 /* blocks available in spool directory required for proper operation */ #if MOMCHECKLOCALSPOOL { char *sizestr; u_Long freespace; extern char *size_fs(char *); /* FIXME: put this in a header file */ /* size_fs() is arch-specific method in mom_mach.c */ sizestr = size_fs(path_spool); /* returns "free:total" */ freespace = strTouL(sizestr, NULL, 10); if (freespace < TMINSPOOLBLOCKS) { /* inadequate disk space in spool directory */ strcpy(PBSNodeMsgBuf, "ERROR: torque spool filesystem full"); /* NOTE: adjusting internal state may not be proper behavior, see note below */ internal_state |= INUSE_DOWN; } } /* END BLOCK */ #endif /* MOMCHECKLOCALSPOOL */ if (PBSNodeCheckPath[0] != '\0') { int IsError = 0; if (ICount == 0) { /* only clear when we're checking again */ /* clear node state and node messages */ internal_state &= ~INUSE_DOWN; PBSNodeMsgBuf[0] = '\0'; if (MUReadPipe( PBSNodeCheckPath, tmpPBSNodeMsgBuf, sizeof(tmpPBSNodeMsgBuf)) == 0) { if (!strncasecmp(tmpPBSNodeMsgBuf, "ERROR", strlen("ERROR"))) { IsError = 1; } else if (!strncasecmp(tmpPBSNodeMsgBuf, "EVENT:", strlen("EVENT:"))) { /* pass event directly to scheduler for processing */ /* NO-OP */ } else { /* ignore non-error messages */ tmpPBSNodeMsgBuf[0] = '\0'; } } } /* END if (ICount == 0) */ if (tmpPBSNodeMsgBuf[0] != '\0') { /* update node msg buffer */ strncpy( PBSNodeMsgBuf, tmpPBSNodeMsgBuf, sizeof(PBSNodeMsgBuf)); PBSNodeMsgBuf[sizeof(PBSNodeMsgBuf) - 1] = '\0'; /* NOTE: not certain this is the correct behavior, scheduler should probably make this decision as proper action may be context sensitive */ if (IsError == 1) { internal_state |= INUSE_DOWN; snprintf(log_buffer,sizeof(log_buffer), "Setting node to down. The node health script output the following message:\n%s\n", tmpPBSNodeMsgBuf); log_event(PBSEVENT_SYSTEM,PBS_EVENTCLASS_NODE,id,log_buffer); } else { snprintf(log_buffer,sizeof(log_buffer), "Node health script ran and says the node is healthy with this message:\n%s\n", tmpPBSNodeMsgBuf); log_event(PBSEVENT_SYSTEM,PBS_EVENTCLASS_NODE,id,log_buffer); } } } /* END if (PBSNodeCheckPath[0] != '\0') */ ICount ++; ICount %= MAX(1, PBSNodeCheckInterval); return; } /* END check_state() */ /** * state_to_server() - if ReportMomState is set, send state message to * the server. * * @see is_compose() - child */ void state_to_server( int ServerIndex, /* I */ int force) /* I (boolean) */ { static char id[] = "state_to_server"; mom_server *pms = &mom_servers[ServerIndex]; if ((force == 0) && (pms->ReportMomState == 0)) { return; /* Do nothing, just return */ } if (is_compose(pms, IS_UPDATE) != DIS_SUCCESS) { return; } if (diswui(pms->SStream, internal_state) != DIS_SUCCESS) { mom_server_stream_error(pms, id, "writing internal state"); return; } if (mom_server_flush_io(pms, id, "flush") == DIS_SUCCESS) { /* send successful, unset ReportMomState */ pms->ReportMomState = 0; if (LOGLEVEL >= 4) { sprintf(log_buffer, "sent updated state 0x%x to server %s", internal_state, pms->pbs_servername); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } } return; } /* END state_to_server() */ void mom_server_all_send_state(void) { int sindex; mom_server *pms; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { pms = &mom_servers[sindex]; if (pms->ReportMomState != 0) state_to_server(sindex, 0); } return; } /* * The job needs to originate a message to the server. * So we are opening a communication socket to the * server associated with the job. * * Most messages from the mom to the server are replies * to a message originated from the server and use * the socket stream established by the server. * So this routine is rarely called. It is mostly * used for job obits. * * The server address is saved two ways, as an * string attribute in the job and also as a long. * The long value must somehow get set by the * server as it does not appear to be set anywhere here. * The string address is an IP address or host name with an * optional port number, i.e. format "xx.xx.xx.xx[:xxx]". * All we do here is extract the port number from the * string if it is present. * * What are the implications of the job server address * being hard-coded for a job with regards to high * availability? If the original server fails, will * the job be able to send the obit's to the alternate * server? * * @see add_conn() - child */ int mom_open_socket_to_jobs_server( job *pjob, char *caller_id, void (*message_handler) A_((int))) { char *svrport = NULL; char *serverAddr = NULL; char error_buffer[1024]; int sock; int sock3; int port; int sindex; mom_server *pms; /* See if the server address string has a ':' implying a port number. */ serverAddr = pjob->ji_wattr[(int)JOB_ATR_at_server].at_val.at_str; if (serverAddr != NULL) { svrport = strchr(serverAddr, (int)':'); } if (svrport) port = atoi(svrport + 1); /* Yes, use the specified server port number. */ else port = default_server_port; /* No, use the global default server port. */ sock = client_to_svr( pjob->ji_qs.ji_un.ji_momt.ji_svraddr, /* This is set in req_queuejob. */ port, 1, /* use local socket */ error_buffer); /* O */ if (sock < 0) { /* error_buffer is filled in by the library with a message describing the failure */ log_err(errno, caller_id, error_buffer); /* Try to make HA work. * Perhaps we should keep a list identifying who has been tried? * But for now, just see if there is another server * not at the IP address of where the job came from. */ for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { struct sockaddr_in *addr; u_long ipaddr; u_short ipport; pms = &mom_servers[sindex]; if (pms->SStream != -1) { addr = rpp_getaddr(pms->SStream); if (addr == NULL) { continue; } ipaddr = ntohl(addr->sin_addr.s_addr); ipport = ntohs(addr->sin_port); if (ipaddr != pjob->ji_qs.ji_un.ji_momt.ji_svraddr) { sock = client_to_svr( ipaddr, ipport, 1, /* use local socket */ error_buffer); /* O */ if (sock >= 0) break; } } } } /* The epilogue code needs the socket number at 3 or above. */ if ((sock >= 0) && (sock < 3)) { sock3 = fcntl(sock, F_DUPFD, 3); close(sock); sock = sock3; } /* * ji_momhandle is used to match reply messages to their job. * Why not use the job number to find the job when we receive a reply message? */ pjob->ji_momhandle = sock; /* Associate a message handler with the connection */ if ((sock >= 0) && (message_handler != NULL)) { add_conn( sock, ToServerDIS, pjob->ji_qs.ji_un.ji_momt.ji_svraddr, port, PBS_SOCK_INET, message_handler); } return(sock); } /* END mom_open_socket_to_jobs_server() */ /** * clear_down_mom_servers * * Clears the mom_server down address list. * Called from the catch_child code. * * @see scan_for_exiting */ void clear_down_mom_servers(void) { int sindex; for (sindex = 0;sindex < PBS_MAXSERVER;sindex++) { down_svraddrs[sindex] = 0; } return; } /** * is_mom_server_down * * Checks to see if the server address is in the down list. * Called from the catch_child code. * @see scan_for_exiting */ int is_mom_server_down( pbs_net_t server_address) { int sindex; for (sindex = 0; sindex < PBS_MAXSERVER && down_svraddrs[sindex] != 0; sindex++) { if (down_svraddrs[sindex] == server_address) { return(1); } } return(0); } /** * no_mom_servers_down * * Checks to see if the server address down list is empty. * Called from the catch_child code. * @see scan_for_exiting */ int no_mom_servers_down(void) { if (down_svraddrs[0] == 0) { return(1); } return(0); } /** * set_mom_server_down * * Add this server address to the down list. * Called from the catch_child code. * @see scan_for_exiting */ void set_mom_server_down( pbs_net_t server_address) { int sindex; for (sindex = 0; sindex < PBS_MAXSERVER; sindex++) { if (down_svraddrs[sindex] == 0) { down_svraddrs[sindex] = server_address; break; } } return; } /* END mom_server.c */ torque-2.4.16/src/resmom/linux/0000777000113300011330000000000011614035173013347 500000000000000torque-2.4.16/src/resmom/linux/mom_start.c0000664000113300011330000004062411403757171015451 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "libpbs.h" #include #include #include #include #include #include #ifndef USEOLDTTY #include #endif /* USEOLDTTY */ #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; extern int killdelay; extern int LOGLEVEL; extern char *AllocParCmd; /* Private variables */ #define TMAX_TJCACHESIZE 128 job *TJCache[TMAX_TJCACHESIZE]; /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * NOTE: This routine is run as root after fork for both parallel and serial jobs * NOTE: This routine is called by TMOMFinalizeChild() * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job( job *pjob, /* I (not used) */ struct startjob_rtn *sjr) /* I (modified,optional) */ { char id[] = "set_job"; char *PPtr; char *CPtr; int rc; long sid; sid = setsid(); if (sjr != NULL) sjr->sj_session = sid; /* NOTE: only activate partition create script for XT4+ environments */ if (((PPtr = get_job_envvar(pjob, "BATCH_PARTITION_ID")) != NULL) && ((CPtr = get_job_envvar(pjob, "BATCH_ALLOC_COOKIE")) != NULL) && !strcmp(CPtr, "0")) { char tmpLine[1024]; if (AllocParCmd == NULL) AllocParCmd = strdup("/opt/moab/default/tools/partition.create.xt4.pl"); #ifdef USEJOBCREATE #ifndef FORCESID if ((pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_flags & ATR_VFLAG_SET) && (pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll != (long)JOB_FAIL) && (pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll > 0x00000000ffffffff)) { snprintf(tmpLine, sizeof(tmpLine), "%s --confirm -p %s -j %s -a %lld", AllocParCmd, PPtr, pjob->ji_qs.ji_jobid, pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll); } else #endif /* FORCESID */ #endif /* USEJOBCREATE */ { snprintf(tmpLine, sizeof(tmpLine), "%s --confirm -p %s -j %s -a %ld", AllocParCmd, PPtr, pjob->ji_qs.ji_jobid, sid); } log_ext( -1, id, tmpLine, LOG_DEBUG); rc = system(tmpLine); if (WEXITSTATUS(rc) != 0) { snprintf(log_buffer, 1024, "cannot create alloc partition"); sid = -3; if (sjr != NULL) sjr->sj_session = sid; log_err( -1, id, log_buffer); return(sid); } } /* END if (((PPtr = get_job_envvar(pjob,"BATCH_PARTITION_ID")) != NULL) && ...) */ return(sid); } /* END set_job() */ /* ** set_globid - set the global id for a machine type. */ void set_globid( job *pjob, /* I (modified) */ struct startjob_rtn *sjr) /* I (not used) */ { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); return; } /* END set_globid() */ /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab) /* pointer to variable table */ { return(0); } char *set_shell( job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp != NULL) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return(shell); } /* END set_shell() */ /** * scan_for_terminated - scan the list of running jobs for one whose * session id matches that of a terminated child pid. Mark that * job as Exiting. * * @see finish_loop() - parent * @see scan_for_exiting() - peer - called later to harvest jobs with exiting tasks * */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval = 0; pid_t pid; job *pjob; task *ptask = NULL; int statloc; int tcount; if (LOGLEVEL >= 7) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, "entered"); } /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_PRIOR(svr_alljobs); while (pjob != NULL) { mom_set_use(pjob); pjob = (job *)GET_PRIOR(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ /* NOTE: does a job's tasks include its epilog? */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_PRIOR(svr_alljobs); while (pjob != NULL) { /* * see if process was a child doing a special * function for MOM */ if (LOGLEVEL >= 7) { snprintf(log_buffer, 1024, "checking job w/subtask pid=%d (child pid=%d)", pjob->ji_momsubt, pid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } if (pid == pjob->ji_momsubt) { if (LOGLEVEL >= 7) { snprintf(log_buffer, 1024, "found match with job subtask for pid=%d", pid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } break; } /* look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); /* locate task with associated process id */ tcount = 0; while (ptask != NULL) { if ((ptask->ti_qs.ti_sid == pid) && (ptask->ti_qs.ti_status != TI_STATE_EXITED)) { if (LOGLEVEL >= 7) { snprintf(log_buffer, 1024, "found match with job task %d for pid=%d", tcount, pid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } break; } ptask = (task *)GET_NEXT(ptask->ti_jobtask); tcount++; } /* END while (ptask) */ if (ptask != NULL) { /* pid match located - break out of job loop */ break; } pjob = (job *)GET_PRIOR(pjob->ji_alljobs); } /* END while (pjob != NULL) */ if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 0x100; else exiteval = 1; if (pjob == NULL) { if (LOGLEVEL >= 1) { sprintf(log_buffer, "pid %d not tracked, statloc=%d, exitval=%d", pid, statloc, exiteval); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, log_buffer); } continue; } /* END if (pjob == NULL) */ if (pid == pjob->ji_momsubt) { /* PID matches job mom subtask */ /* NOTE: both ji_momsubt and ji_mompost normally set in routine preobit_reply() after epilog child is successfully forked */ if (pjob->ji_mompost != NULL) { if (pjob->ji_mompost(pjob, exiteval) == 0) { /* success */ pjob->ji_mompost = NULL; } } /* END if (pjob->ji_mompost != NULL) */ else { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "job has no postprocessing routine registered"); } /* clear mom sub-task */ pjob->ji_momsubt = 0; job_save(pjob, SAVEJOB_QUICK); continue; } /* END if (pid == pjob->ji_momsubt) */ /* what happens if mom PID is reaped before subtask? */ if (LOGLEVEL >= 2) { sprintf(log_buffer, "pid %d harvested for job %s, task %d, exitcode=%d", pid, pjob->ji_qs.ji_jobid, ptask->ti_qs.ti_task, exiteval); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, log_buffer); } /* where is job purged? How do we keep job from progressing in state until the obit is sent? */ if (killdelay == 0) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "%s: job %s task %d terminated, sid=%d", id, pjob->ji_qs.ji_jobid, ptask->ti_qs.ti_task, ptask->ti_qs.ti_sid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } /* END while ((pid = waitpid(-1,&statloc,WNOHANG)) > 0) */ return; } /* END scan_for_terminated() */ /* SNL patch to use openpty() system call rather than search /dev */ /* * create the master pty, this particular * piece of code depends on multiplexor /dev/ptc aka /dev/ptmx */ #define PTY_SIZE 64 #ifndef USEOLDTTY int open_master( char **rtn_name) /* RETURN name of slave pts */ { int master; int slave; static char slave_name[PTY_SIZE]; int status = openpty(&master, &slave, slave_name, 0, 0); if (status < 0) { log_err(errno, "open_master", "failed in openpty()"); return(-1); } close(slave); /* open_master has no way to return this, must return slave_name instead */ *rtn_name = slave_name; return(master); } /* END open_master() */ #else /* USEOLDTTY */ int open_master( char **rtn_name) /* RETURN name of slave pts */ { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE + 1]; /* "/dev/[pt]tyXY" */ strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1;*pc1 != '\0';++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2;*pc2 != '\0';++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return(ptc); } else if (errno == ENOENT) { return(-1); /* tried all entries, give up */ } } } return(-1); /* tried all entries, give up */ } /* END open_master() */ #endif /* USEOLDTTY */ /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, /* { "suspend", SIGSTOP }, - NOTE: changed for MPI jobs - NORWAY */ { "suspend", SIGTSTP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "CLD", SIGCHLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "POLL", SIGPOLL }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "WINCH", SIGWINCH }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; torque-2.4.16/src/resmom/linux/mom_mach.h0000664000113300011330000001541711337353047015233 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: linux */ #ifndef MOM_MACH #define MOM_MACH "linux" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 #ifdef USEJOBCREATE #ifndef JOBFAKE #include #define JOB_FAIL (jid_t)-1 #else #include typedef uint64_t jid_t; #define JOB_FAIL (jid_t)-1 #endif /* JOBFAKE */ #endif /* USEJOBCREATE */ /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ #ifdef USEJOBCREATE jid_t sj_jobid; #endif /* USEJOBCREATE */ }; extern int mom_set_limits A_((job *, int)); /* Set job's limits */ extern int mom_do_poll A_((job *)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *)); /* Is polled job over limit? */ extern int mom_set_use A_((job *)); /* Set resource_used list */ extern int mom_kill A_((int, int)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *, int)); extern long mach_restart A_((struct task *, char *)); /* Restart checkpointed job */ typedef struct proc_stat { int session; /* session id */ char state; /* one of RSDZTW: Running, Sleeping, Sleeping (uninterruptable), Zombie, Paging (W), Traced or stopped on signal */ unsigned long utime; /* utime this process */ unsigned long stime; /* stime this process */ unsigned long cutime; /* sum of children's utime */ unsigned long cstime; /* sum of children's stime */ int pid; /* process id */ int ppid; /* process id */ int pgrp; /* process group */ char *name; /* name of exec'd command */ unsigned long long vsize; /* virtual memory size for proc */ unsigned long long rss; /* resident set size */ unsigned long start_time; /* start time of this process */ unsigned flags; /* the flags of the process */ unsigned uid; /* uid of the process owner */ int processor; /* CPU number last executed on */ } proc_stat_t; typedef struct proc_map { unsigned long vm_start; /* start of vm for process */ unsigned long vm_end; /* end of vm for process */ unsigned long vm_size; /* vm_end - vm_start */ unsigned long vm_offset; /* offset into vm? */ unsigned inode; /* inode of region */ char *dev; /* device */ } proc_map_t; #endif /* MOM_MACH */ torque-2.4.16/src/resmom/linux/Makefile.in0000664000113300011330000004445411605403754015351 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk @BUILD_L26_CPUSETS_TRUE@am__append_1 = cpuset.c subdir = src/resmom/linux ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am__libmommach_a_SOURCES_DIST = mom_mach.c mom_mach.h mom_start.c \ pe_input.c cpuset.c @BUILD_L26_CPUSETS_TRUE@am__objects_1 = cpuset.$(OBJEXT) am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) $(am__objects_1) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(am__libmommach_a_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c \ $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/linux/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/linux/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpuset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/linux/pe_input.c0000664000113300011330000001054211272401243015251 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For linux - /dev/null */ int pe_input( char *jobid) { return(open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/linux/mom_mach.c0000664000113300011330000025472611477227465015247 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef Q_6_5_QUOTAON /* remap dqblk for SUSE 9.0 */ #define dqblk if_dqblk #endif /* Q_6_5_QUOTAON */ /* #ifndef dqblk #include #define dqblk v1_disk_dqblk #endif */ #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "mom_func.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a Linux i386 machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information (sizes in kb) ** netload number of bytes transferred for all interfaces */ #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ static char procfs[] = "/proc"; static DIR *pdir = NULL; static int pagesize; extern char *ret_string; extern char extra_parm[]; extern char no_parm[]; extern time_t time_now; extern int LOGLEVEL; extern char PBSNodeMsgBuf[1024]; #define TBL_INC 200 /* initial proc table */ static proc_stat_t *proc_array = NULL; static int nproc = 0; static int max_proc = 0; /* ** external functions and data */ extern struct config *search A_((struct config *,char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *)); static char *totmem A_((struct rm_attribute *)); static char *availmem A_((struct rm_attribute *)); static char *physmem A_((struct rm_attribute *)); static char *ncpus A_((struct rm_attribute *)); static char *walltime A_((struct rm_attribute *)); static char *quota A_((struct rm_attribute *)); static char *netload A_((struct rm_attribute *)); #ifndef mbool_t #define mbool_t char #endif /* mbool_t */ mbool_t ProcIsChild(char *,char *,char *); extern char *loadave A_((struct rm_attribute *)); extern char *nullproc A_((struct rm_attribute *)); time_t wait_time = 10; typedef struct proc_mem { unsigned long long mem_total; unsigned long long mem_used; unsigned long long mem_free; unsigned long long swap_total; unsigned long long swap_used; unsigned long long swap_free; } proc_mem_t; /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { "netload", {netload} }, { "size", {size} }, { NULL, {nullproc} } }; unsigned linux_time = 0; /* * support routine for getting system time -- sets linux_time */ void proc_get_btime(void) { FILE *fp; char label[256]; if ((fp = fopen("/proc/stat", "r")) == NULL) { return; } while (!feof(fp)) { if (fscanf(fp, "%s", label) != 1) { fclose(fp); return; } if (strcmp(label, "btime")) { if (fscanf(fp, "%*[^\n]%*c") != 0) { fclose(fp); return; } } else { if (fscanf(fp, "%u", &linux_time) != 1) {} fclose(fp); return; } } /* END while (!feof(fp)) */ fclose(fp); return; } /* END proc_get_btime() */ /* NOTE: see 'man 5 proc' for /proc/pid/stat format and description */ /* NOTE: leading '*' indicates that field should be ignored */ /* FORMAT: [] [] [] [] [] [] [] [] [<0>] [] [] [] ... */ static char stat_str[] = " %c %d %d %d %*d %*d %u %*u \ %*u %*u %*u %lu %lu %lu %lu %*ld %*ld %*u %*ld %lu %llu %lld %*lu %*lu \ %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu"; /* * Convert jiffies to seconds. * * Hertz is sysconf(_SC_CLK_TCK) in get_proc_stat() */ #define JTOS(x) (x) / Hertz; /* * Linux /proc status routine. * * Returns a pointer to a static proc_stat_t structure given * a process number, or NULL if there is an error. Takes the * place of the ioctl call PIOCSTATUS in the irix imp of mom_mach.c * */ proc_stat_t *get_proc_stat( int pid) /* I */ { static proc_stat_t ps; static char path[1024]; static char readbuf[4096]; static char *lastbracket; FILE *fd; unsigned long jstarttime; /* number of jiffies since OS start time when process started */ struct stat sb; static int Hertz = 0; int Hertz_errored = 0; if (Hertz <= 0) { Hertz = sysconf(_SC_CLK_TCK); /* returns 0 on error */ if (Hertz <= 0) { /* FAILURE */ if (!Hertz_errored) log_err(errno, "get_proc_stat", "sysconf(_SC_CLK_TCK) failed, unable to monitor processes"); Hertz_errored = 1; return(NULL); } } Hertz_errored = 0; sprintf(path, "/proc/%d/stat", pid); if ((fd = fopen(path, "r")) == NULL) { /* FAILURE */ return(NULL); } /* use 'man 5 proc' for /proc/pid/stat format */ if (!fgets(readbuf, sizeof(readbuf), fd)) { fclose(fd); return(NULL); } lastbracket = strrchr(readbuf, ')'); if (lastbracket == NULL) { fclose(fd); return(NULL); } *lastbracket = '\0'; /* We basically split the string here, overwriting the ')'. */ lastbracket++; if (sscanf(readbuf,"%d (%[^\n]",&ps.pid,path) != 2) { /* FAILURE */ fclose(fd); return(NULL); } /* see stat_str[] value for mapping 'stat' format */ if (sscanf(lastbracket,stat_str, &ps.state, /* state (one of RSDZTW) */ &ps.ppid, /* ppid */ &ps.pgrp, /* pgrp */ &ps.session, /* session id */ &ps.flags, /* flags - kernel flags of the process, see the PF_* in */ &ps.utime, /* utime - jiffies that this process has been scheduled in user mode */ &ps.stime, /* stime - jiffies that this process has been scheduled in kernel mode */ &ps.cutime, /* cutime - jiffies that this process’s waited-for children have been scheduled in user mode */ &ps.cstime, /* cstime - jiffies that this process’s waited-for children have been scheduled in kernel mode */ &jstarttime, /* starttime */ &ps.vsize, /* vsize */ &ps.rss) != 12) /* rss */ { /* FAILURE */ fclose(fd); return(NULL); } if (fstat(fileno(fd), &sb) == -1) { /* FAILURE */ fclose(fd); return(NULL); } ps.uid = sb.st_uid; ps.start_time = linux_time + JTOS(jstarttime); ps.name = path; ps.utime = JTOS(ps.utime); ps.stime = JTOS(ps.stime); ps.cutime = JTOS(ps.cutime); ps.cstime = JTOS(ps.cstime); /* SUCCESS */ fclose(fd); return(&ps); } /* END get_proc_stat() */ proc_mem_t *get_proc_mem(void) { static proc_mem_t mm; FILE *fp; char str[32]; unsigned long long bfsz, casz; if ((fp = fopen("/proc/meminfo","r")) == NULL) { return(NULL); } if (fscanf(fp,"%30s",str) != 1) { return(NULL); } if (!strncmp(str,"total:",sizeof(str))) { /* old format */ if (fscanf(fp,"%*[^\n]%*c") != 0) /* remove text header */ { return(NULL); } /* umu vmem patch */ if (fscanf(fp, "%*s %llu %llu %llu %*u %llu %llu", &mm.mem_total, &mm.mem_used, &mm.mem_free, &bfsz, &casz) != 5) { return(NULL); } mm.mem_free += casz + bfsz; /* if (fscanf(fp,"%*s %lu %lu %lu %*[^\n]%*c", &mm.mem_total, &mm.mem_used, &mm.mem_free) != 3) { return(NULL); } */ if (fscanf(fp, "%*s %llu %llu %llu %*[^\n]%*c", &mm.swap_total, &mm.swap_used, &mm.swap_free) != 3) { return(NULL); } } else { do { /* new format (kernel > 2.4) the first 'str' has been read */ if (!strncmp(str, "MemTotal:", sizeof(str))) { if (fscanf(fp, "%llu", &mm.mem_total) != 1) { return(NULL); } mm.mem_total *= 1024; /* the unit is kB */ } else if (!strncmp(str, "MemFree:", sizeof(str))) { if (fscanf(fp, "%llu", &mm.mem_free) != 1) { return(NULL); } mm.mem_free *= 1024; } else if (!strncmp(str, "Buffers:", sizeof(str))) { if (fscanf(fp, "%llu", &bfsz) != 1) { return(NULL); } mm.mem_free += bfsz * 1024; } else if (!strncmp(str, "Cached:", sizeof(str))) { if (fscanf(fp, "%llu", &casz) != 1) { return(NULL); } mm.mem_free += casz * 1024; } else if (!strncmp(str, "SwapTotal:", sizeof(str))) { if (fscanf(fp, "%llu", &mm.swap_total) != 1) { return(NULL); } mm.swap_total *= 1024; } else if (!strncmp(str, "SwapFree:", sizeof(str))) { if (fscanf(fp, "%llu", &mm.swap_free) != 1) { return(NULL); } mm.swap_free *= 1024; } } while (fscanf(fp, "%30s", str) == 1); } /* END else */ fclose(fp); return(&mm); } /* END get_proc_mem() */ #ifdef PNOT proc_mem_t * get_proc_mem(void) { static proc_mem_t mm; FILE *fp; unsigned long m_tot, m_use, m_free; unsigned long s_tot, s_use, s_free; if ((fp = fopen("/proc/meminfo", "r")) == NULL) { return(NULL); } fscanf(fp, "%*[^\n]%*c"); /* remove text header */; fscanf(fp, "%*s %lu %lu %lu %*[^\n]%*c", &m_tot, &m_use, &m_free); fscanf(fp, "%*s %lu %lu %lu %*[^\n]%*c", &s_tot, &s_use, &s_free); mm.total = m_tot + s_tot; mm.used = m_use + s_use; mm.free = m_free + s_free; fclose(fp); return(&mm); } /* END get_proc_mem() */ #endif /* PNOT */ void dep_initialize(void) { char *id = "dep_initialize"; pagesize = getpagesize(); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } proc_get_btime(); return; } /* END dep_initialize() */ void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) { closedir(pdir); pdir = NULL; } return; } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize( resource *pres, /* I */ unsigned long *ret) /* O */ { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) { return(PBSE_ATTRTYPE); } value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) { return(PBSE_BADATVAL); } value *= sizeof(int); } if (value > (ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift)) { return(PBSE_BADATVAL); } *ret = (value << pres->rs_value.at_val.at_size.atsv_shift); return(PBSE_NONE); } /* END getsize() */ /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime( resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) { return(PBSE_ATTRTYPE); } if (pres->rs_value.at_val.at_long < 0) { return(PBSE_BADATVAL); } *ret = pres->rs_value.at_val.at_long; return(PBSE_NONE); } static int injob( job *pjob, pid_t sid) { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sid) { return(TRUE); } } return(FALSE); } /* END injob() */ /* * Internal session CPU time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds, * adjusted by cputfactor. */ static unsigned long cput_sum( job *pjob) /* I */ { char *id = "cput_sum"; ulong cputime; int nps = 0; int i; proc_stat_t *ps; cputime = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loop start - jobid = %s", pjob->ji_qs.ji_jobid); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if ((LOGLEVEL >= 6) && (ps == NULL)) { sprintf(log_buffer, "proc_array loop end - nproc=%d, i=%d, ps is null", nproc, i); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } if (!injob(pjob, ps->session)) continue; nps++; cputime += (ps->utime + ps->stime + ps->cutime + ps->cstime); if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: session=%d pid=%d cputime=%lu (cputfactor=%f)", id, ps->session, ps->pid, cputime, cputfactor); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } } /* END for (i) */ if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return((unsigned long)((double)cputime * cputfactor)); } /* END cput_sum() */ /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcpu_proc( job *pjob, unsigned long limit) /* I */ { char *id = "overcpu_proc"; ulong memsize; struct dirent *dent; ulong cputime; proc_stat_t *ps; memsize = 0; rewinddir(pdir); while ((dent = readdir(pdir)) != NULL) { if (!isdigit(dent->d_name[0])) continue; if ((ps = get_proc_stat(atoi(dent->d_name))) == NULL) { if (errno != ENOENT) { sprintf(log_buffer, "%s: get_proc_stat", dent->d_name); log_err(errno, id, log_buffer); } continue; } if (!injob(pjob, ps->session)) continue; /* change from ps->cutime to ps->utime, and ps->cstime to ps->stime */ cputime = (ulong)((double)(ps->utime + ps->stime) * cputfactor); if (cputime > limit) { return(TRUE); } } return(FALSE); } /* END overcpu_proc() */ /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current processes within the job. */ /* NOTE: routine should be modified to return llu */ static unsigned long long mem_sum( job *pjob) { char *id = "mem_sum"; int i; unsigned long long segadd; proc_stat_t *ps; segadd = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loop start - jobid = %s", pjob->ji_qs.ji_jobid); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (!injob(pjob, ps->session)) continue; segadd += ps->vsize; } /* END for (i) */ return(segadd); } /* END mem_sum() */ /* * Internal session workingset size function. */ static unsigned long resi_sum( job *pjob) { char *id = "resi_sum"; ulong resisize; int i; proc_stat_t *ps; resisize = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loop start - jobid = %s", pjob->ji_qs.ji_jobid); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (!injob(pjob, ps->session)) continue; resisize += ps->rss * pagesize; } /* END for (i) */ return(resisize); } /* END resi_sum() */ /* * Return TRUE if any process in the job is over limit for memory usage. */ static int overmem_proc( job *pjob, /* I */ unsigned long long limit) /* I */ { char *id = "overmem_proc"; unsigned long long memsize; int i; proc_stat_t *ps; memsize = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loop start - jobid = %s", pjob->ji_qs.ji_jobid); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (!injob(pjob, ps->session)) continue; if (ps->vsize > limit) { return(TRUE); } } /* END for (i) */ return(FALSE); } /* END overmem_proc() */ extern char *msg_momsetlim; /* * Internal error routine */ int error( char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); fprintf(stderr, msg_momsetlim, string, message); fflush(stderr); return(value); } /* END error() */ /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are being called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, /* I */ int set_mode) /* SET_LIMIT_SET or SET_LIMIT_ALTER */ { char *id = "mom_set_limits"; char *pname = NULL; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long vmem_limit = 0; unsigned long mem_limit = 0; /* NOTE: log_buffer is exported */ if (LOGLEVEL >= 2) { sprintf(log_buffer, "%s(%s,%s) entered", id, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "NULL", (set_mode == SET_LIMIT_SET) ? "set" : "alter"); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); log_buffer[0] = '\0'; } assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *)GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * cycle through all the resource specifications, * setting limits appropriately. */ memset(&reslim, 0, sizeof(reslim)); while (pres != NULL) { if (pres->rs_defin != NULL) pname = pres->rs_defin->rs_name; else pname = NULL; if (LOGLEVEL >= 2) { sprintf(log_buffer, "setting limit for attribute '%s'", (pname != NULL) ? pname : "NULL"); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); log_buffer[0] = '\0'; } assert(pres->rs_defin != NULL); assert(pname != NULL); assert(pname[0] != '\0'); if (!strcmp(pname, "cput")) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) { sprintf(log_buffer, "cput gettime failed in %s",id); return(error(pname, retval)); } } } else if (!strcmp(pname, "pcput")) { if (igncput == FALSE) { if (set_mode == SET_LIMIT_SET) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) { sprintf(log_buffer, "pcput gettime failed in %s",id); return(error(pname, retval)); } reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (LOGLEVEL >= 2) { sprintf(log_buffer, "setting cpu time limit to %ld for job %s", (long int)reslim.rlim_cur, pjob->ji_qs.ji_jobid); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); log_buffer[0] = '\0'; } /* NOTE: some versions of linux have a bug which causes the parent process to receive a SIGKILL if the child's cpu limit is exceeded */ if (setrlimit(RLIMIT_CPU, &reslim) < 0) { sprintf(log_buffer, "setrlimit for RLIMIT_CPU failed in %s, errno=%d (%s)", id, errno, strerror(errno)); return(error("RLIMIT_CPU", PBSE_SYSTEM)); } } /* END if (set_mode == SET_LIMIT_SET) */ } } else if (!strcmp(pname, "file")) { /* set */ if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) { sprintf(log_buffer, "getsize() failed for file in %s", id); return(error(pname, retval)); } if (value > ULONG_MAX) { if (LOGLEVEL >= 0) { sprintf(log_buffer, "cannot set file limit to %ld for job %s (value too large)", (long int)reslim.rlim_cur, pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); log_buffer[0] = '\0'; } return(error(pname, PBSE_BADATVAL)); } reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) { sprintf(log_buffer, "cannot set file limit to %ld for job %s (setrlimit failed - check default user limits)", (long int)reslim.rlim_max, pjob->ji_qs.ji_jobid); log_err(errno, id, log_buffer); log_buffer[0] = '\0'; return(error(pname, PBSE_SYSTEM)); } } } else if (!strcmp(pname, "vmem")) { if (ignvmem == FALSE) { /* check */ retval = getsize(pres, &value); if (retval != PBSE_NONE) { sprintf(log_buffer, "getsize() failed for vmem in %s",id); return(error(pname, retval)); } if ((vmem_limit == 0) || (value < vmem_limit)) vmem_limit = value; } } else if (!strcmp(pname, "pvmem")) { if (ignvmem == FALSE) { /* set */ if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) { sprintf(log_buffer, "getsize() failed for pvmem in %s", id); return(error(pname, retval)); } if (value > ULONG_MAX) { log_buffer[0] = '\0'; sprintf(log_buffer, "invalid value returned by getsize() for pvmem in %s", id); return(error(pname, PBSE_BADATVAL)); } if ((vmem_limit == 0) || (value < vmem_limit)) vmem_limit = value; } } } else if ((!strcmp(pname,"mem") && (pjob->ji_numnodes != 1)) || !strcmp(pname,"mppmem")) { /* ignore. If we ever get rid of support for the UNICOS OS then we can remove the ATR_DFLAG_MOM | ATR_DFLAG_ALTRUN flags from mppmem */ } else if ((!strcmp(pname, "mem") && (pjob->ji_numnodes == 1)) || !strcmp(pname, "pmem")) { if (ignmem == FALSE) { /* set */ if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) { sprintf(log_buffer, "getsize() failed for mem/pmem in %s", id); return(error(pname, retval)); } reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_DATA, &reslim) < 0) { sprintf(log_buffer, "cannot set data limit to %ld for job %s (setrlimit failed w/errno=%d (%s) - check default user limits)", (long int)reslim.rlim_max, pjob->ji_qs.ji_jobid, errno, strerror(errno)); return(error("RLIMIT_DATA", PBSE_SYSTEM)); } if (setrlimit(RLIMIT_RSS, &reslim) < 0) { sprintf(log_buffer, "cannot set RSS limit to %ld for job %s (setrlimit failed w/errno=%d (%s) - check default user limits)", (long int)reslim.rlim_max, pjob->ji_qs.ji_jobid, errno, strerror(errno)); return(error("RLIMIT_RSS", PBSE_SYSTEM)); } #ifdef __GATECH /* NOTE: best patch may be to change to 'vmem_limit = value;' */ if (setrlimit(RLIMIT_STACK, &reslim) < 0) { sprintf(log_buffer, "cannot set stack limit to %ld for job %s (setrlimit failed w/errno=%d (%s) - check default user limits)", (long int)reslim.rlim_max, pjob->ji_qs.ji_jobid, errno, strerror(errno)); return(error("RLIMIT_STACK", PBSE_SYSTEM)); } /* set address space */ if (setrlimit(RLIMIT_AS, &reslim) < 0) { sprintf(log_buffer, "cannot set AS limit to %ld for job %s (setrlimit failed w/errno=%d (%s) - check default user limits)", (long int)reslim.rlim_max, pjob->ji_qs.ji_jobid, errno, strerror(errno)); return(error("RLIMIT_AS", PBSE_SYSTEM)); } #endif /* __GATECH */ mem_limit = value; if (getrlimit(RLIMIT_STACK, &reslim) >= 0) { /* NOTE: mem_limit no longer used with UMU patch in place */ mem_limit = value + reslim.rlim_cur; } } } } /* END else if (!strcmp(pname,"mem") && ... */ else if (!strcmp(pname, "walltime")) { /* check */ retval = gettime(pres, &value); if (retval != PBSE_NONE) { sprintf(log_buffer, "gettime() failed for walltime in %s\n", id); return(error(pname, retval)); } } else if (!strcmp(pname, "nice")) { /* set nice */ if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) { sprintf(log_buffer, "nice() failed w/errno=%d (%s) in %s\n", errno, strerror(errno), id); return(error(pname, PBSE_BADATVAL)); } } } else if (!strcmp(pname, "size")) { /* ignore */ /* NO-OP */ } else if(!strcmp(pname, "prologue")) { } else if(!strcmp(pname, "epilogue")) { } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) { /* don't recognize and not marked as ignore by mom */ sprintf(log_buffer, "do not know how to process resource '%s' in %s\n", pname, id); return(error(pname, PBSE_UNKRESC)); } pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (vmem_limit != 0) { /* Don't make (p)vmem < pmem */ if (mem_limit > vmem_limit) { vmem_limit = mem_limit; } reslim.rlim_cur = reslim.rlim_max = vmem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_AS, &reslim) < 0)) { sprintf(log_buffer, "setrlimit() failed setting AS for vmem_limit mod in %s\n", id); return(error("RLIMIT_AS", PBSE_SYSTEM)); } /* UMU vmem patch sets RLIMIT_AS rather than RLIMIT_DATA and RLIMIT_STACK */ /* reslim.rlim_cur = reslim.rlim_max = mem_limit; if (setrlimit(RLIMIT_DATA,&reslim) < 0) { sprintf(log_buffer,"setrlimit() failed setting data for vmem_limit mod in %s\n", id); return(error("RLIMIT_DATA",PBSE_SYSTEM)); } if (setrlimit(RLIMIT_STACK,&reslim) < 0) { sprintf(log_buffer,"setrlimit() failed setting stack for vmem_limit mod in %s\n", id); return(error("RLIMIT_STACK",PBSE_SYSTEM)); } */ } } if (LOGLEVEL >= 5) { sprintf(log_buffer, "%s(%s,%s) completed", id, (pjob != NULL) ? pjob->ji_qs.ji_jobid : "NULL", (set_mode == SET_LIMIT_SET) ? "set" : "alter"); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); log_buffer[0] = '\0'; } /* SUCCESS */ return(PBSE_NONE); } /* END mom_set_limits() */ /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll( job *pjob) /* I */ { char *pname; resource *pres; assert(pjob != NULL); if (LOGLEVEL >= 4) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "evaluating limits for job"); } assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *)GET_NEXT( pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) { return(TRUE); } pres = (resource *)GET_NEXT(pres->rs_link); } return(FALSE); } /* END mom_do_poll() */ /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; if (LOGLEVEL >= 6) { log_record(PBSEVENT_SYSTEM, 0, id, "started"); } pagesize = getpagesize(); proc_array = (proc_stat_t *)calloc(TBL_INC, sizeof(proc_stat_t)); if (proc_array == NULL) { log_err(errno, id, "malloc"); return(PBSE_SYSTEM); } max_proc = TBL_INC; return(PBSE_NONE); } /* END mom_open_poll() */ /* * Declare start of polling loop. * * This function caches information about all of processes * on the compute node (pbs_mom calls this function). Each process * in /proc/ is queried by looking at the 'stat' file. Statistics like * CPU usage time, memory consumption, etc. are gathered in the proc_array * list. This list is then used throughout the pbs_mom to get information * about tasks it is monitoring. * * This function is called from the main MOM loop once every "check_poll_interval" * seconds. * * @see get_proc_stat() - child * @see mom_set_use() - Aggregates data collected here * * NOTE: populates global 'proc_array[]' variable. * NOTE: reallocs proc_array[] as needed to accomodate processes. * * @see mom_open_poll() - allocs proc_array table. * @see mom_close_poll() - frees procs_array. * @see setup_program_environment() - parent - called at pbs_mom start * @see main_loop() - parent - called once per iteration * @see mom_set_use() - populate job structure with usage data for local use or to send to mother superior */ int mom_get_sample(void) { char *id = "mom_get_sample"; struct dirent *dent; proc_stat_t *pi; proc_stat_t *ps; rewinddir(pdir); nproc = 0; pi = proc_array; if (LOGLEVEL >= 6) { log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, "proc_array load started"); } while ((dent = readdir(pdir)) != NULL) { if (!isdigit(dent->d_name[0])) continue; if ((ps = get_proc_stat(atoi(dent->d_name))) == NULL) { if (errno != ENOENT) { sprintf(log_buffer, "%s: get_proc_stat", dent->d_name); log_err(errno, id, log_buffer); } continue; } /* nproc++; -- we need to increment AFTER assigning this ps to the proc_array--otherwise we could skip it in for loops */ if ((nproc + 1) >= max_proc) { proc_stat_t *hold; if (LOGLEVEL >= 8) { log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, "alloc more proc_array"); } max_proc *= 2; hold = (proc_stat_t *)realloc(proc_array, (max_proc + 1) * sizeof(proc_stat_t)); if (proc_array == NULL) { log_err(errno, id, "unable to realloc space for proc_array sample"); return(PBSE_SYSTEM); } proc_array = hold; memset(&proc_array[(nproc+1)], '\0', sizeof(proc_stat_t) * (max_proc >> 1)); } /* END if ((nproc+1) == max_proc) */ pi = &proc_array[nproc++]; memcpy(pi, ps, sizeof(proc_stat_t)); } /* END while ((dent = readdir(pdir)) != NULL) */ if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loaded - nproc=%d", nproc); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } return(PBSE_NONE); } /* END mom_get_sample() */ /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. log_buffer is populated with failure. */ int mom_over_limit( job *pjob) /* I */ { char *pname; int retval; unsigned long value; unsigned long num; unsigned long long numll; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *)GET_NEXT( pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); for (;pres != NULL;pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return(TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcpu_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return(TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((numll = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %llu exceeded limit %lu", numll, value); return(TRUE); } } else if (strcmp(pname, "pvmem") == 0) { unsigned long long valuell; retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; valuell = (unsigned long long)value; if ((ignvmem == 0) && (overmem_proc(pjob, valuell))) { sprintf(log_buffer, "pvmem exceeded limit %llu", valuell); return(TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { /* no need to check walltime on sisters, MS will get it */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %ld exceeded limit %ld", num, value); return(TRUE); } } } /* END for (pres) */ return(FALSE); } /* END mom_over_limit() */ /* * Update the job attribute for resources used. * * The first time this function is called for a job, * it sets up resource entries for * each resource that can be reported for this machine. * * Subsequent calls update the resource usage information based on * stats gathered by the mom_get_sample() function. This function * is often called by "im_request()" as a result of POLL_JOB query * from the mother superior. * * @see im_request() - parent - respond to poll_job request from mother superior * @see examine_all_running_jobs() - parent - update local use on mother superior * @see TMomFinalizeJob1() - parent - update serial job immediately at job start * * @return An error code if something goes wrong. */ int mom_set_use( job *pjob) /* I (modified) */ { resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); #ifdef USESAVEDRESOURCES /* don't update jobs that are marked as recovery */ if (pjob->ji_flags & MOM_JOB_RECOVERY) { return(PBSE_NONE); } #endif /* USESAVEDRESOURCES */ at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { /* initialize usage structures */ at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; } /* END if ((at->at_flags & ATR_VFLAG_SET) == 0) */ /* get cputime */ rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); /* get swap */ rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> pres->rs_value.at_val.at_size.atsv_shift; /* as KB */ *lp = MAX(*lp, lnum); /* get walltime */ rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); /* NOTE: starting jobs can come through here before stime is recorded */ if (pjob->ji_qs.ji_stime == 0) pres->rs_value.at_val.at_long = 0; else pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); /* get memory */ rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> pres->rs_value.at_val.at_size.atsv_shift; /* as KB */ *lp = MAX(*lp, lnum); return(PBSE_NONE); } /* END mom_set_use() */ /** * Kill a task session. * Call with the task pointer and a signal number. * * @return number of tasks signalled (0 = failure) * * @see kill_job() - parent * * NOTE: should support killpg() or killpidtree() - (NYI) * may be required for suspend/resume */ int kill_task( task *ptask, /* I */ int sig, /* I */ int pg) /* I (1=signal process group, 0=signal master process only) */ { char *id = "kill_task"; int ct = 0; /* num of processes killed */ int NumProcessesFound = 0; /* number of processes found with session ID */ struct dirent *dent; proc_stat_t *ps; int sesid; pid_t mompid; sesid = ptask->ti_qs.ti_sid; mompid = getpid(); if (LOGLEVEL >= 5) { sprintf(log_buffer, "%s: sending signal %d to task %d, session %d", id, sig, ptask->ti_qs.ti_task, sesid); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } if (sesid <= 1) { if (LOGLEVEL >= 3) { sprintf(log_buffer, "cannot send signal %d to task (no session id)", sig); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } /* FAILURE */ return(0); } /* pdir is global */ /* NOTE: do not use cached proc-buffer since we need up-to-date info */ /* pdir is global */ rewinddir(pdir); while ((dent = readdir(pdir)) != NULL) { if (!isdigit(dent->d_name[0])) continue; if ((ps = get_proc_stat(atoi(dent->d_name))) == NULL) { if (errno != ENOENT) { sprintf(log_buffer, "%s: get_proc_stat", dent->d_name); log_err(errno,id,log_buffer); } continue; } if ((sesid == ps->session) || (ProcIsChild(procfs,dent->d_name,ptask->ti_job->ji_qs.ji_jobid) == TRUE)) { NumProcessesFound++; if ((ps->state == 'Z') || (ps->pid == 0)) { /* * Killing a zombie is sure death! Its pid is zero, * which to kill(2) means 'every process in the process * group of the current process'. */ sprintf(log_buffer, "%s: not killing process (pid=%d/state=%c) with sig %d", id, ps->pid, ps->state, sig); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } /* END if ((ps->state == 'Z') || (ps->pid == 0)) */ else { int i = 0; if (ps->pid == mompid) { /* * there is a race condition with newly started jobs that * can be killed before they've established their own * session id. This means the child tasks still have MOM's * session id. We check this to make sure MOM doesn't kill * herself. */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "%s: not killing process %d. Avoid sending signal because child task still has MOM's session id", id, ps->pid); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } continue; } /* END if (ps->pid == mompid) */ if (sig == SIGKILL) { struct timespec req; req.tv_sec = 0; req.tv_nsec = 250000000; /* .25 seconds */ /* give the process some time to quit gracefully first (up to .25*20=5 seconds) */ sprintf(log_buffer, "%s: killing pid %d task %d gracefully with sig %d", id, ps->pid, ptask->ti_qs.ti_task, SIGTERM); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); if (pg == 0) kill(ps->pid, SIGTERM); else killpg(ps->pid, SIGTERM); for (i = 0;i < 20;i++) { /* check if process is gone */ if ((ps = get_proc_stat(ps->pid)) == NULL) { break; } else { sprintf(log_buffer, "%s: process (pid=%d/state=%c) after sig %d", id, ps->pid, ps->state, sig); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); if (ps->state == 'Z') break; } /* try to kill again */ if (kill(ps->pid, 0) == -1) break; nanosleep(&req, NULL); } /* END for (i = 0) */ } /* END if (sig == SIGKILL) */ else { i = 20; } if (i >= 20) { /* NOTE: handle race-condition where process goes zombie as a result of previous SIGTERM */ /* update proc info from /proc//stat */ if ((ps = get_proc_stat(ps->pid)) != NULL) { if (ps->state == 'Z') { /* * Killing a zombie is sure death! Its pid is zero, * which to kill(2) means 'every process in the process * group of the current process'. */ sprintf(log_buffer, "%s: not killing process (pid=%d/state=%c) with sig %d", id, ps->pid, ps->state, sig); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } /* END if ((ps->state == 'Z') || (ps->pid == 0)) */ else { /* kill process hard */ /* why is this not killing with SIGKILL? */ sprintf(log_buffer, "%s: killing pid %d task %d with sig %d", id, ps->pid, ptask->ti_qs.ti_task, sig); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); if (pg == 0) kill(ps->pid, sig); else killpg(ps->pid, sig); } } /* END if ((ps = get_proc_stat(ps->pid)) != NULL) */ } /* END if (i >= 20) */ ++ct; } /* END else ((ps->state == 'Z') || (ps->pid == 0)) */ } /* END if (sesid == ps->session) */ } /* END while ((dent = readdir(pdir)) != NULL) */ /* NOTE: to fix bad state situations resulting from a hard crash, the logic below should be triggered any time no processes are found (NYI) */ if (IS_ADOPTED_TASK(ptask->ti_qs.ti_task) && (NumProcessesFound == 0)) { /* no process was found, but for an adopted task this is OK (we don't find * out about the adopted task's termination via waitpid()--so we can safely * say that we have "killed" the task, even though the task was killed/died * some other way */ ct++; /* do code to mark task as finished (borrowed from Linux scan_for_terminated())... */ ptask->ti_qs.ti_exitstat = 0; /* assume successful completion */ ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "%s: job %s adopted task %d was marked as terminated because task's PID was no longer found, sid=%d", id, ptask->ti_job->ji_qs.ji_jobid, ptask->ti_qs.ti_task, ptask->ti_qs.ti_sid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } if ((NumProcessesFound == 0) && (ct <= 0)) { /* we can't find any processes belonging to given session, so we can safely say * that we "killed" the task and have TORQUE clean it up */ ct++; /* do code to mark task as finished (borrowed from Linux scan_for_terminated())... */ ptask->ti_qs.ti_exitstat = 0; /* assume successful completion */ ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); if (LOGLEVEL >= 5) { sprintf(log_buffer, "%s: could not send signal %d to task %d (session %d)--no process was found with this session ID (marking task as killed)!", id, sig, ptask->ti_qs.ti_task, sesid); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } } /* SUCCESS */ return(ct); } /* END kill_task() */ /* * Clean up everything related to polling. */ int mom_close_poll(void) { char *id = "mom_close_poll"; if (LOGLEVEL >= 6) { log_record( PBSEVENT_SYSTEM, 0, id, "entered"); } if (pdir != NULL) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return(PBSE_SYSTEM); } pdir = NULL; } if (proc_array != NULL) { free(proc_array); } return(PBSE_NONE); } /* END mom_close_poll() */ /* * mom_does_checkpoint * * @returns CST values as described in resmon.h. */ int mom_does_checkpoint(void) { return(CST_BLCR); /* Use the BLCR checkpointing system. */ } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint( task *ptask, /* I */ char *file, /* I */ int abort) /* I */ { return(-1); } /* END mach_checkpoint() */ /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart( task *ptask, char *file) { return(-1); } #define dsecs(val) ( (double)(val) ) char *cput_job( pid_t jobid) { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; proc_stat_t *ps; cputime = 0.0; if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loop start - jobid = %d", jobid); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (jobid != ps->session) continue; found = 1; /* add utime and stime (AKE) */ addtime = dsecs(ps->utime) + dsecs(ps->stime) + dsecs(ps->cutime) + dsecs(ps->cstime); cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, ps->pid, addtime)) } /* END for (i) */ if (!found) { rm_errno = RM_ERR_EXIST; return(NULL); } sprintf(ret_string, "%.2f", cputime * cputfactor); return(ret_string); } /* END cput_job() */ char *cput_proc( pid_t pid) { char *id = "cput_proc"; double cputime; proc_stat_t *ps; cputime = 0.0; if ((ps = get_proc_stat(pid)) == NULL) { if (errno != ENOENT) { sprintf(log_buffer, "%d: get_proc_stat", pid); log_err(errno, id, log_buffer); } rm_errno = RM_ERR_SYSTEM; return(NULL); } cputime = dsecs(ps->utime) + dsecs(ps->stime); sprintf(ret_string, "%.2f", cputime * cputfactor); return(ret_string); } /* END cput_proc() */ char *cput( struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (strcmp(attrib->a_qualifier, "session") == 0) { return(cput_job((pid_t)value)); } if (strcmp(attrib->a_qualifier, "proc") == 0) { return(cput_proc((pid_t)value)); } rm_errno = RM_ERR_BADPARAM; return(NULL); } /* END cput() */ char *mem_job( pid_t sid) /* I */ { static char id[] = "mem_job"; unsigned long long memsize; int i; proc_stat_t *ps; /* max memsize ??? */ memsize = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loop start - sid = %d", sid); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (sid != ps->session) continue; memsize += ps->vsize; } /* END for (i) */ if (memsize == 0) { rm_errno = RM_ERR_EXIST; return(NULL); } sprintf(ret_string, "%llukb", memsize >> 10); /* KB */ return(ret_string); } /* END mem_job() */ char *mem_proc( pid_t pid) { char *id = "mem_proc"; proc_stat_t *ps; if ((ps = get_proc_stat(pid)) == NULL) { if (errno != ENOENT) { sprintf(log_buffer, "%d: get_proc_stat", pid); log_err(errno, id, log_buffer); } rm_errno = RM_ERR_SYSTEM; return(NULL); } sprintf(ret_string, "%llukb", (unsigned long long)ps->vsize >> 10); /* KB */ return(ret_string); } /* END mem_proc() */ char *mem( struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (strcmp(attrib->a_qualifier, "session") == 0) { return(mem_job((pid_t)value)); } else if (strcmp(attrib->a_qualifier, "proc") == 0) { return(mem_proc((pid_t)value)); } else { rm_errno = RM_ERR_BADPARAM; return(NULL); } return(NULL); } /* END mem() */ static char *resi_job( pid_t jobid) { char *id = "resi_job"; ulong resisize; int found = 0; proc_stat_t *ps; int i; resisize = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer, "proc_array loop start - jobid = %d", jobid); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (jobid != ps->session) continue; found = 1; resisize += ps->rss; } /* END for (i) */ if (found) { /* in KB */ sprintf(ret_string, "%lukb", (resisize * (ulong)pagesize) >> 10); return(ret_string); } rm_errno = RM_ERR_EXIST; return(NULL); } /* END resi_job() */ static char *resi_proc( pid_t pid) { char *id = "resi_proc"; proc_stat_t *ps; if ((ps = get_proc_stat(pid)) == NULL) { if (errno != ENOENT) { sprintf(log_buffer, "%d: get_proc_stat(PIOCPSINFO)", pid); log_err(errno, id, log_buffer); } rm_errno = RM_ERR_SYSTEM; return(NULL); } /* in KB */ sprintf(ret_string, "%lukb", ((ulong)ps->rss * (ulong)pagesize) >> 10); return(ret_string); } /* END resi_proc() */ static char *resi( struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (strcmp(attrib->a_qualifier, "session") == 0) { return(resi_job((pid_t)value)); } if (strcmp(attrib->a_qualifier, "proc") == 0) { return(resi_proc((pid_t)value)); } rm_errno = RM_ERR_BADPARAM; return(NULL); } /* END resi() */ char *sessions( struct rm_attribute *attrib) /* I */ { char *id = "sessions"; int i; int j; proc_stat_t *ps; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return(NULL); } /* Search for members of session */ for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (ps->uid == 0) continue; if ((jobid = ps->session) == 0) continue; if (LOGLEVEL >= 7) { sprintf(log_buffer, "%s[%d]: pid %d sid %d", id, njids, ps->pid, jobid); log_record( PBSEVENT_SYSTEM, 0, id, log_buffer); } for (j = 0;j < njids;j++) { if (jids[j] == jobid) break; } if (j == njids) { /* not found */ if (njids == maxjid) { /* need more space */ maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return(NULL); } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } if (njids == 0) { free(jids); return(NULL); } fmt = ret_string; for (j = 0;j < njids;j++) { checkret(&fmt, 100); if (j == 0) { sprintf(fmt, "%d", (int)jids[j]); } else { sprintf(fmt, " %d", (int)jids[j]); } fmt += strlen(fmt); } /* END for (j) */ free(jids); return(ret_string); } /* END sessions() */ char *nsessions( struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) { return(result); } for (ch = result;*ch;ch++) { if (*ch == ' ') /* count blanks */ num++; } /* END for (ch) */ sprintf(ret_string, "%d", num); return(ret_string); } /* END nsessions() */ char *pids( struct rm_attribute *attrib) /* I */ { char *id = "pids"; pid_t jobid; proc_stat_t *ps; char *fmt; int i; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return(NULL); } /* Search for members of session */ fmt = ret_string; for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (LOGLEVEL >= 6) { DBPRT(("%s[%d]: pid: %d sid: %d\n", id, num_pids, ps->pid, ps->session)) } if (jobid != ps->session) continue; sprintf(fmt, "%d ", ps->pid); fmt += strlen(fmt); num_pids++; } /* END for (i) */ if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return(NULL); } return(ret_string); } /* END pids() */ char *nusers( struct rm_attribute *attrib) { char *id = "nusers"; int j; int i; proc_stat_t *ps; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return(NULL); } for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if ((uid = ps->uid) == 0) continue; if (LOGLEVEL >= 7) { sprintf(log_buffer, "%s[%d]: pid %d uid %d", id, nuids, ps->pid, uid); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } for (j = 0;j < nuids;j++) { if (uids[j] == uid) break; } if (j == nuids) { /* not found */ if (nuids == maxuid) { /* need more space */ maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return(NULL); } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } /* END for (i) */ sprintf(ret_string, "%d", nuids); free(uids); return(ret_string); } /* END nusers() */ static char *totmem( struct rm_attribute *attrib) { char *id = "totmem"; proc_mem_t *mm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((mm = get_proc_mem()) == NULL) { log_err(errno, id, "get_proc_mem"); rm_errno = RM_ERR_SYSTEM; return(NULL); } if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: total mem=%llu", id, mm->mem_total + mm->swap_total); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } sprintf(ret_string, "%lukb", (ulong)((mm->mem_total >> 10) + (mm->swap_total >> 10))); /* KB */ return(ret_string); } /* END totmem() */ static char *availmem( struct rm_attribute *attrib) { char *id = "availmem"; proc_mem_t *mm; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((mm = get_proc_mem()) == NULL) { log_err(errno, id, "get_proc_mem"); rm_errno = RM_ERR_SYSTEM; return(NULL); } /* END availmem() */ if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: free mem=%llu", id, mm->mem_free + mm->swap_free); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } sprintf(ret_string, "%lukb", (ulong)((mm->mem_free >> 10) + (mm->swap_free >> 10))); /* KB */ return(ret_string); } /* END availmem() */ static char *ncpus( struct rm_attribute *attrib) { char *id = "ncpus"; char label[128]; FILE *fp; int procs; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((fp = fopen("/proc/cpuinfo", "r")) == NULL) { return(NULL); } procs = 0; while (!feof(fp)) { if (fscanf(fp, "%s %*[^\n]%*c", label) == 0) { getc(fp); /* must do something to get to eof */ } else if (strcmp("processor", label) == 0) procs++; } sprintf(ret_string, "%d", procs); system_ncpus = procs; fclose(fp); return(ret_string); } /* END ncpus() */ #define PMEMBUF_SIZE 2048 static const char path_meminfo[] = "/proc/meminfo"; static char *physmem( struct rm_attribute *attrib) { char *id = "physmem"; char tmpBuf[PMEMBUF_SIZE]; char *BPtr; int BSpace; unsigned long long mem; FILE *fp; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (!(fp = fopen(path_meminfo, "r"))) { rm_errno = RM_ERR_SYSTEM; return(NULL); } BPtr = tmpBuf; BSpace = sizeof(tmpBuf); BPtr[0] = '\0'; while (!feof(fp)) { if (fgets(BPtr, BSpace, fp) == NULL) { break; } BSpace -= strlen(BPtr); BPtr += strlen(BPtr); } fclose(fp); /* FORMAT: '...\nMemTotal: XXX kB\n' */ if ((BPtr = strstr(tmpBuf, "MemTotal:")) != NULL) { BPtr += strlen("MemTotal:"); if (sscanf(BPtr, "%llu", &mem) != 1) { rm_errno = RM_ERR_SYSTEM; return(NULL); } /* value specified in kb */ } else { /* attempt to load first numeric value */ if (sscanf(BPtr, "%*s %llu", &mem) != 1) { rm_errno = RM_ERR_SYSTEM; return(NULL); } /* value specified in bytes */ mem >>= 10; } sprintf(ret_string, "%llukb", mem); return(ret_string); } /* END physmem() */ char *size_fs( char *param) { char *id = "size_fs"; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return(NULL); } #ifdef RPT_BAVAIL #define RPT_STATFS_MEMBER f_bavail #else #define RPT_STATFS_MEMBER f_bfree #endif sprintf(ret_string, "%lukb:%lukb", (ulong)(((double)fsbuf.f_bsize * (double)fsbuf.RPT_STATFS_MEMBER) / 1024.0), (ulong)(((double)fsbuf.f_bsize * (double)fsbuf.f_blocks) / 1024.0)); /* KB */ return(ret_string); } /* END size_fs() */ char *size_file( char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return(NULL); } sprintf(ret_string, "%lukb", (unsigned long)sbuf.st_size >> 10); /* KB */ return(ret_string); } /* END size_file() */ char *size( struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) { return(size_file(param)); } if (strcmp(attrib->a_qualifier, "fs") == 0) { return(size_fs(param)); } rm_errno = RM_ERR_BADPARAM; return(NULL); } /* END size() */ /* * For a recovering (-p) mom, look through existing tasks in existing * jobs for things that have exited that are not owned by us through a * parent-child relationship. Otherwise we cannot report back to tm * clients when tasks have exited. */ void scan_non_child_tasks(void) { char *id = "scan_non_child_tasks"; job *job; extern tlist_head svr_alljobs; static int first_time = TRUE; DIR *pdir; /* use local pdir to prevent race conditions associated w/global pdir (VPAC) */ pdir = opendir("/proc"); for (job = GET_NEXT(svr_alljobs);job != NULL;job = GET_NEXT(job->ji_alljobs)) { task *task; for (task = GET_NEXT(job->ji_tasks);task != NULL;task = GET_NEXT(task->ti_jobtask)) { struct dirent *dent; int found; /* * Check for tasks that were exiting when mom went down, set back to * running so we can reprocess them and send the obit */ if ((first_time) && (task->ti_qs.ti_sid != 0) && ((task->ti_qs.ti_status == TI_STATE_EXITED) || (task->ti_qs.ti_status == TI_STATE_DEAD))) { if (LOGLEVEL >= 7) { sprintf(log_buffer, "marking task %d as TI_STATE_RUNNING was %d", task->ti_qs.ti_task, task->ti_qs.ti_status); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, job->ji_qs.ji_jobid, log_buffer); } task->ti_qs.ti_status = TI_STATE_RUNNING; } /* only check on tasks that we think should still be around */ if (task->ti_qs.ti_status != TI_STATE_RUNNING) continue; /* look for processes with this session id */ found = 0; /* NOTE: on linux systems, the session master should have pid == sessionid */ if (kill(task->ti_qs.ti_sid, 0) != -1) { found = 1; } else { /* session master cannot be found, look for other pid in session */ rewinddir(pdir); while ((dent = readdir(pdir)) != NULL) { proc_stat_t *ps; if (!isdigit(dent->d_name[0])) continue; ps = get_proc_stat(atoi(dent->d_name)); if (ps == NULL) continue; if (ps->session == task->ti_qs.ti_sid) { found = 1; break; } } /* END while ((dent) != NULL) */ } if (!found) { char buf[1024]; extern int exiting_tasks; sprintf(buf, "found exited session %d for task %d in job %s", task->ti_qs.ti_sid, task->ti_qs.ti_task, job->ji_qs.ji_jobid); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, buf); task->ti_qs.ti_exitstat = 0; /* actually unknown */ task->ti_qs.ti_status = TI_STATE_EXITED; task_save(task); #ifdef USESAVEDRESOURCES if (first_time) { job->ji_flags |= MOM_JOB_RECOVERY; if (LOGLEVEL >= 7) { sprintf(buf, "marking job as MOM_JOB_RECOVERY for task %d", task->ti_qs.ti_task); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, job->ji_qs.ji_jobid, buf); } } #endif /* USESAVEDRESOURCES */ exiting_tasks = 1; } } } /* END for (job = GET_NEXT(svr_alljobs)) */ closedir(pdir); first_time = FALSE; return; } /* END scan_non_child_tasks() */ time_t maxtm; void setmax( char *dev) { struct stat sb; if (stat(dev, &sb) == -1) { return; } if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } /* END setmax() */ char *idletime( struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return(NULL); } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ld", (long)MAX(0, curtm - maxtm)); return(ret_string); } /* END idletime() */ static char *walltime( struct rm_attribute *attrib) { char *id = "walltime"; int value, job, found = 0; time_t now, start; proc_stat_t *ps; int i; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (strcmp(attrib->a_qualifier, "proc") == 0) { job = 0; } else if (strcmp(attrib->a_qualifier, "session") == 0) { job = 1; } else { rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return(NULL); } start = now; for (i = 0;i < nproc;i++) { ps = &proc_array[i]; if (job != 0) { if (value != ps->session) continue; } else { if (value != ps->pid) continue; } found = 1; start = MIN((unsigned)start, ps->start_time); } /* END for (i) */ if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return(ret_string); } rm_errno = RM_ERR_EXIST; return(NULL); } /* END walltime() */ int get_la( double *rv) /* O */ { FILE *fp; char *id = "get_la"; float load; if ((fp = fopen("/proc/loadavg", "r")) == NULL) { rm_errno = RM_ERR_SYSTEM; return(rm_errno); } if (fscanf(fp, "%f", &load) != 1) { log_err(errno, id, "fscanf of load in /proc/loadavg"); fclose(fp); rm_errno = RM_ERR_SYSTEM; return(rm_errno); } *rv = (double)load; fclose(fp); return(0); } /* END get_la() */ u_long gracetime( u_long secs) { time_t now = time((time_t *)NULL); if (secs > (u_long)now) /* time is in the future */ return(secs - now); return(0); } static char *quota( struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct mntent *me; struct dqblk qi; FILE *m; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", NULL }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } for (type = 0;type < type_end;type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) { /* check to see if command is legal */ sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } dirdev = (dev_t)sb.st_dev; DBPRT(("dir has devnum %d\n", (int)dirdev)) if ((m = setmntent(MOUNTED, "r")) == NULL) { log_err(errno, id, "setmntent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((me = getmntent(m)) != NULL) { if (strcmp(me->mnt_type, MNTTYPE_IGNORE) == 0) continue; if (stat(me->mnt_dir, &sb) == -1) { sprintf(log_buffer, "stat: %s", me->mnt_dir); log_err(errno, id, log_buffer); continue; } if (LOGLEVEL >= 6) DBPRT(("%s\t%s\t%d\n", me->mnt_fsname, me->mnt_dir, (int)dirdev)) if (!memcmp(&sb.st_dev, &dirdev, sizeof(dev_t))) break; } endmntent(m); if (me == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } #if defined(MNTOPT_NOQUOTA) if (hasmntopt(me, MNTOPT_NOQUOTA) != NULL) { sprintf(log_buffer, "no quotas on filesystem %s", me->mnt_dir); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } #endif /* MNTOPT_NOQUOTA */ if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } uid = pw->pw_uid; } if (syscall( SYS_quotactl, QCMD(Q_GETQUOTA, USRQUOTA), me->mnt_fsname, uid, (caddr_t)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return(NULL); } /* sizes in KB */ switch (type) { case harddata: sprintf(ret_string, "%lukb", (u_long)qi.dqb_bhardlimit >> 10); break; case softdata: sprintf(ret_string, "%lukb", (u_long)qi.dqb_bsoftlimit >> 10); break; case currdata: #if defined(TENABLEQUOTA) #if _LINUX_QUOTA_VERSION < 2 sprintf(ret_string, "%lukb", (u_long)qi.dqb_curblocks >> 10); #else /* _LINUX_QUOTA_VERSION < 2 */ sprintf(ret_string, "%lukb", (u_long)qi.dqb_curspace >> 10); #endif /* _LINUX_QUOTA_VERSION < 2 */ #endif /* TENABLEQUOTA */ break; case hardfile: sprintf(ret_string, "%lu", (u_long)qi.dqb_ihardlimit); break; case softfile: sprintf(ret_string, "%lu", (u_long)qi.dqb_isoftlimit); break; case currfile: sprintf(ret_string, "%lu", (u_long)qi.dqb_curinodes); break; case timedata: sprintf(ret_string, "%lu", gracetime((u_long)qi.dqb_btime)); break; case timefile: sprintf(ret_string, "%lu", gracetime((u_long)qi.dqb_itime)); break; } /* END switch() */ return(ret_string); } /* END quota() */ /* tested for linux 2.4 kernel (not tested on 2.6) */ #define MAX_INTERFACES 10 /*the maximum number of interfaces*/ #define HEADER_STR "%*[^\n]\n%*[^\n]\n" #define INTERFACE_STR "%[^:]:%lu %*d %*d %*d %*d %*d %*d %*d %lu %*d %*d %*d %*d %*d %*d %*d\n" static char *netload( struct rm_attribute *attrib) { FILE *fp; int rc; /*read count*/ char interfaceName[MAX_INTERFACES][32]; unsigned long int bytesRX[MAX_INTERFACES + 1]; unsigned long int bytesTX[MAX_INTERFACES + 1]; int interface = 0; /* int ethNum = 0; */ char *id = "netload"; if ((fp = fopen("/proc/net/dev", "r")) == NULL) { rm_errno = RM_ERR_SYSTEM; return(NULL); } rc = fscanf(fp, HEADER_STR); /*strip off header lines*/ if (rc < 0) { log_err(errno, id, "fscanf of header lines in /proc/net/dev"); fclose(fp); rm_errno = RM_ERR_SYSTEM; return(NULL); } /* read in interface stats until we can't */ /* sum all interface stats, excluding 'lo'*/ memset(bytesRX, 0, sizeof(bytesRX)); memset(bytesTX, 0, sizeof(bytesTX)); for (interface = 0;interface < MAX_INTERFACES;interface++) { rc = fscanf(fp, INTERFACE_STR, interfaceName[interface], &bytesRX[interface], &bytesTX[interface]); if (rc != 3) { interface++; /*adjust counter for future decrement*/ break; } if (strcmp(interfaceName[interface], "lo") != 0) /* don't count 'lo' interfaces' stats */ { /* For singling out ethernet interfaces */ /* if (strncmp(interfaceName[interface],"eth",3) == 0) { rc = sscanf(interfaceName[interface],"eth%d", ðNum); } */ bytesRX[MAX_INTERFACES] += bytesRX[interface]; bytesTX[MAX_INTERFACES] += bytesTX[interface]; } } /* END for (interface) */ /* remove lo from interface count */ --interface; fclose(fp); sprintf(ret_string, "%lu", bytesRX[MAX_INTERFACES] + bytesTX[MAX_INTERFACES]); return(ret_string); } /* END netload() */ mbool_t ProcIsChild( char *Dir, /* I */ char *PID, /* I */ char *JobID) /* I */ { return(FALSE); } /* END ProcIsChild() */ /* END mom_mach.c */ torque-2.4.16/src/resmom/linux/cpuset.c0000664000113300011330000004732511417372214014750 00000000000000#include #include #include #include #include #include #include #include #include "libpbs.h" #include "attribute.h" #include "resource.h" #include "server_limits.h" #include "pbs_job.h" #include "log.h" /* NOTE: move these three things to utils when lib is checked in */ #ifndef MAXPATHLEN #define MAXPATHLEN 1024 #endif /* MAXPATHLEN */ #ifndef FAILURE #define FAILURE 0 #endif /* FAILURE */ #ifndef SUCCESS #define SUCCESS 1 #endif /* SUCCESS */ #define TTORQUECPUSET_PATH "/dev/cpuset/torque" #define TROOTCPUSET_PATH "/dev/cpuset" /* FIXME: TODO: TTORQUECPUSET_PATH, enabling cpuset support, and correct error * checking need a run-time config */ int *VPToCPUMap = NULL; /* map of virtual processors to cpus (alloc) */ extern char mom_host[]; extern char mom_short_name[]; /* private functions */ void remove_defunct_cpusets(); int get_cpu_string(job *pjob,char *); int create_vnodesets(job *,char *path,char *,mode_t); int init_jobset(char *,job *,mode_t,char *); /* end private functions */ /** * deletes a cpuset * * @param cpusetname - name of cpuset to be deleted * @return -1 on failure, 0 otherwise */ int cpuset_delete( char *cpusetname) /* I */ { char path[MAXPATHLEN + 1]; char childpath[MAXPATHLEN + 1]; pid_t killpids; FILE *fd; DIR *dir; struct dirent *pdirent; static char id[] = "cpuset_delete"; struct stat statbuf; /* accept a full path or jobid */ if (cpusetname[0] == '/') strcpy(path, cpusetname); else sprintf(path, "%s/%s", TTORQUECPUSET_PATH, cpusetname); if ((dir = opendir(path)) == NULL) { /* cpuset does not exist... no one cares! */ return(-1); } while ((pdirent = readdir(dir)) != NULL) { /* Skip parent and current directory. */ if (!strcmp(pdirent->d_name, ".") || !strcmp(pdirent->d_name, "..")) continue; /* Prepend directory name to file name for lstat. */ snprintf(childpath,sizeof(childpath),"%s/%s",path,pdirent->d_name); /* Skip file on error. */ if (!(lstat(childpath, &statbuf) >= 0)) continue; /* If a directory is found try to get cpuset info about it. */ if (statbuf.st_mode&S_IFDIR) { if (cpuset_delete(childpath) == 0) { sprintf(log_buffer, "Unused cpuset '%s' deleted.", childpath); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { sprintf(log_buffer, "Could not delete unused cpuset %s.", childpath); log_err(-1, id, log_buffer); } } else if (!strcmp(pdirent->d_name, "tasks")) { /* FIXME: need a more careful mechanism here... including a possibly useless sleep */ if ((fd = fopen(childpath, "r")) != NULL) { while (fscanf(fd, "%d", &killpids) == 1) kill(killpids, SIGKILL); fclose(fd); } sleep(1); } /* FIXME: only need when testing with a fake /dev/cpuset */ /* does this mean it should be removed for production? */ if (!(statbuf.st_mode & S_IFDIR)) unlink(childpath); } /* END while((pdirent = readdir(dir)) != NULL) */ closedir(dir); if (rmdir(path) != 0) { /* FAILURE */ return(-1); } /* SUCCESS */ return(0); } /* END cpuset_delete() */ /** * removes cpusets for jobs that no longer exist * * @see initialize_root_cpuset() - parent */ void remove_defunct_cpusets() { DIR *dir; struct dirent *pdirent; struct stat statbuf; char *id = "remove_defunct_cpusets"; char path[MAXPATHLEN]; /* Find all the job cpusets. */ if ((dir = opendir(TTORQUECPUSET_PATH)) == NULL) { sprintf(log_buffer, "opendir(%s) failed.\n",TTORQUECPUSET_PATH); log_err(-1, id, log_buffer); } while ((pdirent = readdir(dir)) != NULL) { /* Skip parent and current directory. */ if (!strcmp(pdirent->d_name, ".") || !strcmp(pdirent->d_name, "..")) continue; /* Prepend directory name to file name for lstat. */ strcpy(path, TTORQUECPUSET_PATH); if (path[strlen(path)-1] != '/') strcat(path, "/"); strcat(path, pdirent->d_name); /* Skip file on error. */ if (!(lstat(path, &statbuf) >= 0)) continue; /* If a directory is found try to get cpuset info about it. */ if (statbuf.st_mode&S_IFDIR) { /* If the job isn't found, delete its cpuset. */ if (find_job(pdirent->d_name) == NULL) { if (cpuset_delete(pdirent->d_name) == 0) { sprintf(log_buffer, "Unused cpuset '%s' deleted.", path); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { sprintf(log_buffer, "Could not delete unused cpuset %s.", path); log_err(-1, id, log_buffer); } } } } /* END while ((pdirent = readdir(dir)) != NULL) */ closedir(dir); } /* END remove_defunct_cpusets() */ /* * Create the root cpuset for Torque if it doesn't already exist. * clear out any job cpusets for jobs that no longer exist. * * @see remove_defunct_cpusets() - child */ void initialize_root_cpuset(void) { static char id[] = "initialize_root_cpuset"; char path[MAXPATHLEN + 1]; struct stat statbuf; char cpuset_buf[MAXPATHLEN]; FILE *fp; sprintf(log_buffer, "Init TORQUE cpuset %s.", TTORQUECPUSET_PATH); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); /* make sure cpusets are available */ sprintf(path, "%s/cpus", TROOTCPUSET_PATH); if (lstat(path, &statbuf) != 0) { sprintf(log_buffer, "cannot locate %s - cpusets not configured/enabled on host\n", path); log_err(-1, id, log_buffer); /* FAILURE */ return; } sprintf(path, "%s", TTORQUECPUSET_PATH); if (lstat(path, &statbuf) != 0) { sprintf(log_buffer, "TORQUE cpuset %s does not exist, creating it now.\n", path); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); mkdir(path, 0755); /* load all cpus in root set */ sprintf(path, "%s/cpus", TROOTCPUSET_PATH); fp = fopen(path, "r"); if (fp != NULL) { char *cptr; char *dptr; char *ptr; int maxindex; int mindex; char tmpBuf[MAXPATHLEN]; /* FORMAT: [][,[]]... */ /* read cpus from root cpuset */ if (fread(cpuset_buf, sizeof(char), sizeof(cpuset_buf), fp) != sizeof(cpuset_buf)) { if (ferror(fp) != 0) { log_err(-1,id, "An error occurred while reading the root cpuset, attempting to continue.\n"); } } /* Replace trailing newline with NULL */ *(index(cpuset_buf, '\n')) = '\0'; fclose(fp); sprintf(log_buffer, "root cpuset %s loaded with value '%s'\n", path, cpuset_buf); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); /* convert string to lookup table */ strncpy(tmpBuf, cpuset_buf, sizeof(tmpBuf)); /* extract last cpu index value */ cptr = strchr(cpuset_buf, ','); dptr = strchr(cpuset_buf, '-'); ptr = MAX(cptr, dptr); if (ptr == NULL) ptr = cpuset_buf; else ptr++; maxindex = strtol(ptr, NULL, 10); VPToCPUMap = (int *)calloc(1, sizeof(int) * maxindex); strncpy(tmpBuf, cpuset_buf, sizeof(tmpBuf)); mindex = 0; ptr = strtok(tmpBuf, ","); /* Commented out as currently results in an infinite loop */ #if 0 while (ptr != NULL) { ptr = strtok(ptr, "-"); while (ptr != NULL) { /* What was meant to be here ? - csamuel@vpac.org */ } } #endif /* NOTE: load 'boot' set */ sprintf(path, "%s/boot/cpus", TROOTCPUSET_PATH); fp = fopen(path, "r"); if (fp != NULL) { char bootbuf[MAXPATHLEN]; /* what is format of data? */ /* read cpus from boot cpuset */ /* FIXME: need proper error checking and response */ if (fread(bootbuf, sizeof(char), sizeof(bootbuf), fp) != sizeof(bootbuf)) { if (ferror(fp) != 0) { log_err(-1,id, "An error occurred while reading the root cpuset, attempting to continue.\n"); } } /* Replace trailing newline with NULL */ *(index(bootbuf, '\n')) = '\0'; fclose(fp); /* subtract bootset from rootset */ /* NYI */ } /* END if (fp != NULL) */ /* create new TORQUE set */ sprintf(path, "%s/cpus", TTORQUECPUSET_PATH); fp = fopen(path, "w"); if (fp != NULL) { /* write all root cpus into TORQUE cpuset */ unsigned int len = strlen(cpuset_buf); if (fwrite(cpuset_buf, sizeof(char), len, fp) != len) { log_err(-1,id,"ERROR: Unable to write cpus to cpuset\n"); } else { sprintf(log_buffer, "adding cpus %s to %s", cpuset_buf, path); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } fclose(fp); } memset(cpuset_buf, '\0', sizeof(cpuset_buf)); } /* END if (fp != NULL) */ /* add all mems to torqueset */ sprintf(path, "%s/mems", TROOTCPUSET_PATH); fp = fopen(path, "r"); if (fp != NULL) { /* what is format of data? */ /* read all mems from root cpuset */ if (fread(cpuset_buf, sizeof(char), sizeof(cpuset_buf), fp) != sizeof(cpuset_buf)) { if (ferror(fp) != 0) { log_err(-1,id, "An error occurred while reading the root cpuset, attempting to continue.\n"); } } fclose(fp); sprintf(path, "%s/mems", TTORQUECPUSET_PATH); fp = fopen(path, "w"); if (fp != NULL) { /* write all root mems into TORQUE cpuset */ unsigned int len = strlen(cpuset_buf); if (fwrite(cpuset_buf, sizeof(char), len, fp) != len) { log_err(-1,id,"ERROR: Unable to write mems to cpuset\n"); } else { sprintf(log_buffer, "adding mems %s to %s", cpuset_buf, path); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } fclose(fp); } memset(cpuset_buf, '\0', sizeof(cpuset_buf)); } /* END if (fp != NULL) */ } /* END if (lstat(path,&statbuf) != 0) */ else { /* The cpuset already exists, delete any cpusets for jobs that no longer exist. */ remove_defunct_cpusets(); } return; } /* END initialize_root_cpuset() */ /** * get_cpu_string * @see add_cpus_to_jobset() - parent * * @param pjob - (I) the job whose cpu string we're building * @param CpuStr - (O) the cpu string * @return 1 if the cpu string is built, 0 otherwise */ int get_cpu_string( job *pjob, /* I */ char *CpuStr) /* O */ { vnodent *np = pjob->ji_vnods; int j; char tmpStr[MAXPATHLEN]; if ((pjob == NULL) || (CpuStr == NULL)) return(FAILURE); CpuStr[0] = '\0'; for (j = 0;j < pjob->ji_numvnod;++j, np++) { if (pjob->ji_nodeid == np->vn_host->hn_node) { if (CpuStr[0] != '\0') strcat(CpuStr, ","); sprintf(tmpStr, "%d", np->vn_index); strcat(CpuStr, tmpStr); } } return(SUCCESS); } /** * initializes the cpuset for the job * * deletes any existing cpuset * creates the directory * copies relevant memory information * * @see create_jobset() - parent * @param path - (I) the path where the job's cpuset should be * @param pjob - (I) the job * @param savemask - (I) the settings to be restored * @param membuf- (O) the contents of the memory being moved */ int init_jobset( char *path, /* I */ job *pjob, /* I */ mode_t savemask, /* I */ char *membuf) /* O */ { char *id = "init_jobset"; char tmppath[MAXPATHLEN+1]; FILE *fd; if ((path == NULL) || (pjob == NULL) || (membuf == NULL)) return(FAILURE); membuf[0] = '\0'; /* delete the current cpuset for the job if it exists */ if (access(path, F_OK) == 0) { if (cpuset_delete(path) != 0) { sprintf(log_buffer, "Could not delete cpuset for job %s.\n", pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); umask(savemask); return(FAILURE); } } /* don't "else return(FAILURE);" because the directory doesn't necessarily exist */ /* create the directory and copy the relevant memory data */ if (access(TTORQUECPUSET_PATH, F_OK) == 0) { /* create the jobset */ mkdir(path, 0755); /* add all mems to jobset */ snprintf(tmppath,sizeof(tmppath),"%s/mems",TTORQUECPUSET_PATH); fd = fopen(tmppath, "r"); if (fd) { if (fread(membuf, sizeof(char), sizeof(membuf), fd)) { if (ferror(fd) != 0) { log_err(-1,id, "An error occurred while reading cpuset's memory\n"); return(FAILURE); } } fclose(fd); snprintf(tmppath,sizeof(tmppath),"%s/mems",path); fd = fopen(tmppath, "w"); if (fd) { unsigned int len = strlen(membuf); if (fwrite(membuf, sizeof(char), len, fd) != len) { log_err(-1,id,"ERROR: Unable to write mems to cpuset\n"); } fclose(fd); } return(SUCCESS); } } return(FAILURE); } /** * creates the vnodesets for the job * * creates and writes the files for each virtual node on the job * * @see create_jobset() - parent * * @param pjob (I) - the job whose vnodesets are being created * @param path (I) - path to the job's cpuset directory * @param membuf (I) - the memory information to be copied * @param savemask (I) - the settings to be restored */ int create_vnodesets( job *pjob, /* I */ char *path, /* I */ char *membuf, /* I */ mode_t savemask) /* I */ { FILE *fd; vnodent *np; int j; int rc = SUCCESS; char *id = "create_vnodesets"; char cpusbuf[MAXPATHLEN+1]; char tasksbuf[MAXPATHLEN+1]; char tmppath[MAXPATHLEN+1]; np = pjob->ji_vnods; cpusbuf[0] = '\0'; for (j = 0;j < pjob->ji_numvnod;++j, np++) { if (pjob->ji_nodeid == np->vn_host->hn_node) { snprintf(tmppath,sizeof(tmppath),"%s/%d",path,np->vn_node); mkdir(tmppath, 0755); chmod(tmppath, 00755); sprintf(tasksbuf, "%d", np->vn_index); strcat(tmppath, "/cpus"); sprintf(log_buffer, "TASKSET: %s cpus %s\n", tmppath, tasksbuf); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); fd = fopen(tmppath, "w"); if (fd) { unsigned int len = strlen(tasksbuf); if (fwrite(tasksbuf, sizeof(char), len, fd) != len) { log_err(-1,id,"ERROR: Unable to write cpus\n"); rc = FAILURE; } fclose(fd); } else rc = FAILURE; memset(tasksbuf, '\0', sizeof(tasksbuf)); /* add all mems to torqueset - membuf has info stored */ sprintf(tmppath, "%s/%d/%s",path,np->vn_node,"/mems"); fd = fopen(tmppath, "w"); if (fd) { unsigned int len = strlen(membuf); if (fwrite(membuf, sizeof(char), len, fd) != len) { log_err(-1,id,"ERROR: Unable to write mems\n"); } else { sprintf(log_buffer, "adding %s to %s", tasksbuf, tmppath); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } fclose(fd); } else rc = FAILURE; } } umask(savemask); return(rc); } /** * adds the cpus to the jobset * * @param pjob - the job associated with the jobset * @param path - the path to the jobset directory * @return SUCCESS if the files are correctly written, else FALSE */ int add_cpus_to_jobset( char *path, job *pjob) { FILE *fd; char *id = "add_cpus_to_jobset"; char cpusbuf[MAXPATHLEN+1]; char tmppath[MAXPATHLEN+1]; if ((pjob == NULL) || (path == NULL)) { return(FAILURE); } /* Make the string defining the CPUs to add into the jobset */ get_cpu_string(pjob,cpusbuf); snprintf(tmppath,sizeof(tmppath),"%s/cpus",path); sprintf(log_buffer, "CPUSET: %s job %s path %s\n", cpusbuf, pjob->ji_qs.ji_jobid, tmppath); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); fd = fopen(tmppath, "w"); if (fd) { unsigned int len = strlen(cpusbuf); if (fwrite(cpusbuf, sizeof(char), len, fd) != len) { log_err(-1,id,"ERROR: Unable to write cpus to cpuset\n"); fclose(fd); return(FAILURE); } fclose(fd); return(SUCCESS); } return(FAILURE); } int create_jobset( job *pjob) /* I */ { char path[MAXPATHLEN+1]; char membuf[MAXPATHLEN+1]; mode_t savemask; savemask = (umask(0022)); snprintf(path,sizeof(path),"%s/%s",TTORQUECPUSET_PATH,pjob->ji_qs.ji_jobid); if (init_jobset(path,pjob,savemask,membuf) == FAILURE) { return(FAILURE); } /* add the CPUs to the jobset */ if (add_cpus_to_jobset(path,pjob) == FAILURE) { return(FAILURE); } /* Create the vnodesets */ if (create_vnodesets(pjob,path,membuf,savemask) == FAILURE) { return(FAILURE); } return(SUCCESS); } /* END create_jobset() */ int move_to_jobset( pid_t pid, /* I */ job *pjob) /* I */ { char *id = "move_to_jobset"; char pidbuf[MAXPATHLEN]; char taskspath[MAXPATHLEN]; FILE *fd; mode_t savemask; savemask = (umask(0022)); sprintf(pidbuf, "%d", pid); sprintf(taskspath, "%s/%s/tasks", TTORQUECPUSET_PATH, pjob->ji_qs.ji_jobid); sprintf(log_buffer, "CPUSET MOVE: %s %s\n", taskspath, pidbuf); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); fd = fopen(taskspath, "w"); if (fd) { unsigned int len = strlen(pidbuf); if (fwrite(pidbuf, sizeof(char), len, fd) != len) { log_err(-1,id,"ERROR: Unable to bind job to cpuset\n"); fclose(fd); return(FAILURE); } fclose(fd); } /* ERROR HANDLING - job won't be bound correctly */ memset(pidbuf, '\0', sizeof(pidbuf)); umask(savemask); return(SUCCESS); } /* END move_to_jobset() */ int move_to_taskset( pid_t pid, job *pjob, /* I */ char * vnodeid) /* I */ { char *id = "move_to_taskset"; char pidbuf[MAXPATHLEN]; char taskspath[MAXPATHLEN]; FILE *fd; mode_t savemask; savemask = (umask(0022)); sprintf(pidbuf, "%d", pid); sprintf(taskspath, "%s/%s/%s/tasks", TTORQUECPUSET_PATH, pjob->ji_qs.ji_jobid, vnodeid); sprintf(log_buffer, "TASKSET MOVE: %s %s\n", taskspath, pidbuf); log_event(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); fd = fopen(taskspath, "w"); if (fd) { unsigned int len = strlen(pidbuf); if (fwrite(pidbuf, sizeof(char), len, fd) != len) { log_err(-1,id,"ERROR: Unable to bind job to cpuset\n"); fclose(fd); return(-1); } fclose(fd); } /* ERROR HANDLING - job won't be bound correctly */ memset(pidbuf, '\0', sizeof(pidbuf)); umask(savemask); return 0; } /* END move_to_taskset() */ torque-2.4.16/src/resmom/linux/Makefile.am0000664000113300011330000000040311272401243015311 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c if BUILD_L26_CPUSETS libmommach_a_SOURCES += cpuset.c endif torque-2.4.16/src/resmom/Makefile.in0000664000113300011330000012415011605403743014200 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(pbs_demux_SOURCES) $(pbs_mom_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk sbin_PROGRAMS = pbs_mom$(EXEEXT) pbs_demux$(EXEEXT) @BUILDCPA_TRUE@am__append_1 = cray_cpa.c subdir = src/resmom ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_pbs_demux_OBJECTS = pbs_demux.$(OBJEXT) pbs_demux_OBJECTS = $(am_pbs_demux_OBJECTS) pbs_demux_LDADD = $(LDADD) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = ../lib/Libattr/libattr.a ../lib/Libsite/libsite.a \ ../lib/Libutils/libutils.a ../lib/Libpbs/libtorque.la pbs_demux_DEPENDENCIES = @PBS_MACH@/libmommach.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) am__pbs_mom_SOURCES_DIST = catch_child.c mom_comm.c mom_inter.c \ mom_main.c mom_server.c prolog.c requests.c start_exec.c \ checkpoint.c tmsock_recov.c req_quejob.c job_func.c \ ../server/attr_recov.c ../server/dis_read.c \ ../server/job_attr_def.c ../server/job_recov.c \ ../server/process_request.c ../server/reply_send.c \ ../server/resc_def_all.c ../server/job_qs_upgrade.c cray_cpa.c @BUILDCPA_TRUE@am__objects_1 = cray_cpa.$(OBJEXT) am_pbs_mom_OBJECTS = catch_child.$(OBJEXT) mom_comm.$(OBJEXT) \ mom_inter.$(OBJEXT) mom_main.$(OBJEXT) mom_server.$(OBJEXT) \ prolog.$(OBJEXT) requests.$(OBJEXT) start_exec.$(OBJEXT) \ checkpoint.$(OBJEXT) tmsock_recov.$(OBJEXT) \ req_quejob.$(OBJEXT) job_func.$(OBJEXT) attr_recov.$(OBJEXT) \ dis_read.$(OBJEXT) job_attr_def.$(OBJEXT) job_recov.$(OBJEXT) \ process_request.$(OBJEXT) reply_send.$(OBJEXT) \ resc_def_all.$(OBJEXT) job_qs_upgrade.$(OBJEXT) \ $(am__objects_1) pbs_mom_OBJECTS = $(am_pbs_mom_OBJECTS) pbs_mom_LDADD = $(LDADD) pbs_mom_DEPENDENCIES = @PBS_MACH@/libmommach.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pbs_demux_SOURCES) $(pbs_mom_SOURCES) DIST_SOURCES = $(pbs_demux_SOURCES) $(am__pbs_mom_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/resmom/@PBS_MACH@ -DPBS_MOM \ -DDEMUX=\"$(program_prefix)$(DEMUX_PATH)$(program_suffix)\" \ -DRCP_PATH=\"$(program_prefix)$(RCP_PATH)$(program_suffix)\" \ -DRCP_ARGS=\"$(RCP_ARGS)\" \ -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" \ -DPBS_ENVIRON=\"$(PBS_ENVIRON)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter SUBDIRS = @PBS_MACH@ DIST_SUBDIRS = aix4 aix5 darwin digitalunix freebsd freebsd5 fujitsu hpux10 hpux11 \ irix5 irix6 irix6array linux netbsd solaris5 solaris7 sunos4 unicos8 unicosmk2 PBS_LIBS = ../lib/Libattr/libattr.a \ ../lib/Libsite/libsite.a \ ../lib/Libutils/libutils.a \ ../lib/Libpbs/libtorque.la EXTRA_DIST = rm_dep.h LDADD = @PBS_MACH@/libmommach.a $(MOMLIBS) $(PBS_LIBS) pbs_mom_SOURCES = catch_child.c mom_comm.c mom_inter.c mom_main.c \ mom_server.c prolog.c requests.c start_exec.c checkpoint.c \ tmsock_recov.c req_quejob.c job_func.c ../server/attr_recov.c \ ../server/dis_read.c ../server/job_attr_def.c \ ../server/job_recov.c ../server/process_request.c \ ../server/reply_send.c ../server/resc_def_all.c \ ../server/job_qs_upgrade.c $(am__append_1) pbs_demux_SOURCES = pbs_demux.c all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done pbs_demux$(EXEEXT): $(pbs_demux_OBJECTS) $(pbs_demux_DEPENDENCIES) @rm -f pbs_demux$(EXEEXT) $(LINK) $(pbs_demux_LDFLAGS) $(pbs_demux_OBJECTS) $(pbs_demux_LDADD) $(LIBS) pbs_mom$(EXEEXT): $(pbs_mom_OBJECTS) $(pbs_mom_DEPENDENCIES) @rm -f pbs_mom$(EXEEXT) $(LINK) $(pbs_mom_LDFLAGS) $(pbs_mom_OBJECTS) $(pbs_mom_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_recov.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/catch_child.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkpoint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cray_cpa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_attr_def.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_func.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_qs_upgrade.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_recov.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_comm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_inter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_demux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_request.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prolog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reply_send.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/req_quejob.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/requests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resc_def_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/start_exec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmsock_recov.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< attr_recov.o: ../server/attr_recov.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT attr_recov.o -MD -MP -MF "$(DEPDIR)/attr_recov.Tpo" -c -o attr_recov.o `test -f '../server/attr_recov.c' || echo '$(srcdir)/'`../server/attr_recov.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/attr_recov.Tpo" "$(DEPDIR)/attr_recov.Po"; else rm -f "$(DEPDIR)/attr_recov.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/attr_recov.c' object='attr_recov.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o attr_recov.o `test -f '../server/attr_recov.c' || echo '$(srcdir)/'`../server/attr_recov.c attr_recov.obj: ../server/attr_recov.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT attr_recov.obj -MD -MP -MF "$(DEPDIR)/attr_recov.Tpo" -c -o attr_recov.obj `if test -f '../server/attr_recov.c'; then $(CYGPATH_W) '../server/attr_recov.c'; else $(CYGPATH_W) '$(srcdir)/../server/attr_recov.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/attr_recov.Tpo" "$(DEPDIR)/attr_recov.Po"; else rm -f "$(DEPDIR)/attr_recov.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/attr_recov.c' object='attr_recov.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o attr_recov.obj `if test -f '../server/attr_recov.c'; then $(CYGPATH_W) '../server/attr_recov.c'; else $(CYGPATH_W) '$(srcdir)/../server/attr_recov.c'; fi` dis_read.o: ../server/dis_read.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dis_read.o -MD -MP -MF "$(DEPDIR)/dis_read.Tpo" -c -o dis_read.o `test -f '../server/dis_read.c' || echo '$(srcdir)/'`../server/dis_read.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dis_read.Tpo" "$(DEPDIR)/dis_read.Po"; else rm -f "$(DEPDIR)/dis_read.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/dis_read.c' object='dis_read.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dis_read.o `test -f '../server/dis_read.c' || echo '$(srcdir)/'`../server/dis_read.c dis_read.obj: ../server/dis_read.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dis_read.obj -MD -MP -MF "$(DEPDIR)/dis_read.Tpo" -c -o dis_read.obj `if test -f '../server/dis_read.c'; then $(CYGPATH_W) '../server/dis_read.c'; else $(CYGPATH_W) '$(srcdir)/../server/dis_read.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dis_read.Tpo" "$(DEPDIR)/dis_read.Po"; else rm -f "$(DEPDIR)/dis_read.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/dis_read.c' object='dis_read.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dis_read.obj `if test -f '../server/dis_read.c'; then $(CYGPATH_W) '../server/dis_read.c'; else $(CYGPATH_W) '$(srcdir)/../server/dis_read.c'; fi` job_attr_def.o: ../server/job_attr_def.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT job_attr_def.o -MD -MP -MF "$(DEPDIR)/job_attr_def.Tpo" -c -o job_attr_def.o `test -f '../server/job_attr_def.c' || echo '$(srcdir)/'`../server/job_attr_def.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/job_attr_def.Tpo" "$(DEPDIR)/job_attr_def.Po"; else rm -f "$(DEPDIR)/job_attr_def.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/job_attr_def.c' object='job_attr_def.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o job_attr_def.o `test -f '../server/job_attr_def.c' || echo '$(srcdir)/'`../server/job_attr_def.c job_attr_def.obj: ../server/job_attr_def.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT job_attr_def.obj -MD -MP -MF "$(DEPDIR)/job_attr_def.Tpo" -c -o job_attr_def.obj `if test -f '../server/job_attr_def.c'; then $(CYGPATH_W) '../server/job_attr_def.c'; else $(CYGPATH_W) '$(srcdir)/../server/job_attr_def.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/job_attr_def.Tpo" "$(DEPDIR)/job_attr_def.Po"; else rm -f "$(DEPDIR)/job_attr_def.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/job_attr_def.c' object='job_attr_def.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o job_attr_def.obj `if test -f '../server/job_attr_def.c'; then $(CYGPATH_W) '../server/job_attr_def.c'; else $(CYGPATH_W) '$(srcdir)/../server/job_attr_def.c'; fi` job_recov.o: ../server/job_recov.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT job_recov.o -MD -MP -MF "$(DEPDIR)/job_recov.Tpo" -c -o job_recov.o `test -f '../server/job_recov.c' || echo '$(srcdir)/'`../server/job_recov.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/job_recov.Tpo" "$(DEPDIR)/job_recov.Po"; else rm -f "$(DEPDIR)/job_recov.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/job_recov.c' object='job_recov.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o job_recov.o `test -f '../server/job_recov.c' || echo '$(srcdir)/'`../server/job_recov.c job_recov.obj: ../server/job_recov.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT job_recov.obj -MD -MP -MF "$(DEPDIR)/job_recov.Tpo" -c -o job_recov.obj `if test -f '../server/job_recov.c'; then $(CYGPATH_W) '../server/job_recov.c'; else $(CYGPATH_W) '$(srcdir)/../server/job_recov.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/job_recov.Tpo" "$(DEPDIR)/job_recov.Po"; else rm -f "$(DEPDIR)/job_recov.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/job_recov.c' object='job_recov.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o job_recov.obj `if test -f '../server/job_recov.c'; then $(CYGPATH_W) '../server/job_recov.c'; else $(CYGPATH_W) '$(srcdir)/../server/job_recov.c'; fi` process_request.o: ../server/process_request.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT process_request.o -MD -MP -MF "$(DEPDIR)/process_request.Tpo" -c -o process_request.o `test -f '../server/process_request.c' || echo '$(srcdir)/'`../server/process_request.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/process_request.Tpo" "$(DEPDIR)/process_request.Po"; else rm -f "$(DEPDIR)/process_request.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/process_request.c' object='process_request.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o process_request.o `test -f '../server/process_request.c' || echo '$(srcdir)/'`../server/process_request.c process_request.obj: ../server/process_request.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT process_request.obj -MD -MP -MF "$(DEPDIR)/process_request.Tpo" -c -o process_request.obj `if test -f '../server/process_request.c'; then $(CYGPATH_W) '../server/process_request.c'; else $(CYGPATH_W) '$(srcdir)/../server/process_request.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/process_request.Tpo" "$(DEPDIR)/process_request.Po"; else rm -f "$(DEPDIR)/process_request.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/process_request.c' object='process_request.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o process_request.obj `if test -f '../server/process_request.c'; then $(CYGPATH_W) '../server/process_request.c'; else $(CYGPATH_W) '$(srcdir)/../server/process_request.c'; fi` reply_send.o: ../server/reply_send.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reply_send.o -MD -MP -MF "$(DEPDIR)/reply_send.Tpo" -c -o reply_send.o `test -f '../server/reply_send.c' || echo '$(srcdir)/'`../server/reply_send.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/reply_send.Tpo" "$(DEPDIR)/reply_send.Po"; else rm -f "$(DEPDIR)/reply_send.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/reply_send.c' object='reply_send.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reply_send.o `test -f '../server/reply_send.c' || echo '$(srcdir)/'`../server/reply_send.c reply_send.obj: ../server/reply_send.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reply_send.obj -MD -MP -MF "$(DEPDIR)/reply_send.Tpo" -c -o reply_send.obj `if test -f '../server/reply_send.c'; then $(CYGPATH_W) '../server/reply_send.c'; else $(CYGPATH_W) '$(srcdir)/../server/reply_send.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/reply_send.Tpo" "$(DEPDIR)/reply_send.Po"; else rm -f "$(DEPDIR)/reply_send.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/reply_send.c' object='reply_send.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reply_send.obj `if test -f '../server/reply_send.c'; then $(CYGPATH_W) '../server/reply_send.c'; else $(CYGPATH_W) '$(srcdir)/../server/reply_send.c'; fi` resc_def_all.o: ../server/resc_def_all.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT resc_def_all.o -MD -MP -MF "$(DEPDIR)/resc_def_all.Tpo" -c -o resc_def_all.o `test -f '../server/resc_def_all.c' || echo '$(srcdir)/'`../server/resc_def_all.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resc_def_all.Tpo" "$(DEPDIR)/resc_def_all.Po"; else rm -f "$(DEPDIR)/resc_def_all.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/resc_def_all.c' object='resc_def_all.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o resc_def_all.o `test -f '../server/resc_def_all.c' || echo '$(srcdir)/'`../server/resc_def_all.c resc_def_all.obj: ../server/resc_def_all.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT resc_def_all.obj -MD -MP -MF "$(DEPDIR)/resc_def_all.Tpo" -c -o resc_def_all.obj `if test -f '../server/resc_def_all.c'; then $(CYGPATH_W) '../server/resc_def_all.c'; else $(CYGPATH_W) '$(srcdir)/../server/resc_def_all.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/resc_def_all.Tpo" "$(DEPDIR)/resc_def_all.Po"; else rm -f "$(DEPDIR)/resc_def_all.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/resc_def_all.c' object='resc_def_all.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o resc_def_all.obj `if test -f '../server/resc_def_all.c'; then $(CYGPATH_W) '../server/resc_def_all.c'; else $(CYGPATH_W) '$(srcdir)/../server/resc_def_all.c'; fi` job_qs_upgrade.o: ../server/job_qs_upgrade.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT job_qs_upgrade.o -MD -MP -MF "$(DEPDIR)/job_qs_upgrade.Tpo" -c -o job_qs_upgrade.o `test -f '../server/job_qs_upgrade.c' || echo '$(srcdir)/'`../server/job_qs_upgrade.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/job_qs_upgrade.Tpo" "$(DEPDIR)/job_qs_upgrade.Po"; else rm -f "$(DEPDIR)/job_qs_upgrade.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/job_qs_upgrade.c' object='job_qs_upgrade.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o job_qs_upgrade.o `test -f '../server/job_qs_upgrade.c' || echo '$(srcdir)/'`../server/job_qs_upgrade.c job_qs_upgrade.obj: ../server/job_qs_upgrade.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT job_qs_upgrade.obj -MD -MP -MF "$(DEPDIR)/job_qs_upgrade.Tpo" -c -o job_qs_upgrade.obj `if test -f '../server/job_qs_upgrade.c'; then $(CYGPATH_W) '../server/job_qs_upgrade.c'; else $(CYGPATH_W) '$(srcdir)/../server/job_qs_upgrade.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/job_qs_upgrade.Tpo" "$(DEPDIR)/job_qs_upgrade.Po"; else rm -f "$(DEPDIR)/job_qs_upgrade.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../server/job_qs_upgrade.c' object='job_qs_upgrade.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o job_qs_upgrade.obj `if test -f '../server/job_qs_upgrade.c'; then $(CYGPATH_W) '../server/job_qs_upgrade.c'; else $(CYGPATH_W) '$(srcdir)/../server/job_qs_upgrade.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive \ clean-sbinPROGRAMS ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-exec-hook \ install-info install-info-am install-man install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-hook uninstall-info-am uninstall-sbinPROGRAMS install-exec-hook: $(PBS_MKDIRS) aux || : $(PBS_MKDIRS) mom rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qnoded$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbs_mom$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(sbindir)/$(program_prefix)qnoded$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(PBS_ENVIRON) rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qnoded$(program_suffix)$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/solaris5/0000777000113300011330000000000011614035173013751 500000000000000torque-2.4.16/src/resmom/solaris5/mom_start.c0000664000113300011330000002516311326373231016047 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include #include #include #include #include #include #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 3384 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask = NULL; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, (int)pid, (int)exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, (int)ptask->ti_qs.ti_task, (int)pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); pc1 = ident; /* this is to remove unused ident warning in compiler */ for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/solaris5/mom_mach.h0000664000113300011330000001252011272401244015614 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: solaris5 */ #ifndef MOM_MACH #define MOM_MACH "solaris5" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mach_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ extern int mom_close_poll A_(()); /* Terminate poll ability */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/solaris5/Makefile.in0000664000113300011330000004400011605403755015737 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/solaris5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/solaris5/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/solaris5/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/solaris5/pe_input.c0000664000113300011330000001077411326373231015667 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 3393 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For solaris5 - /dev/null */ int pe_input(char *jobid) { char *message; message = ident; if(message) return (open("/dev/null", O_RDONLY, 0)); return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/solaris5/mom_mach.c0000664000113300011330000012755311326373231015630 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" #include "mom_func.h" /* ** System dependent code to gather information for the resource ** monitor for a Sun Solaris machine ** ** Resources known by this code: ** cput cpu time for a pid or job ** mem memory size for a pid or job in KB ** resi resident memory size for a pid or job in KB ** sessions list of sessions in the system ** pids list of pids in a job ** nsessions number of sessions in the system ** nusers number of users in the system ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average */ static char ident[] = "@(#) solaris5/$RCSfile$ $Revision: 3393 $"; #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* MAX */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *platform A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); char procfs[] = "/proc"; char procfmts[] = "/proc/%s"; char procfmtd[] = "/proc/%05.5d"; DIR *pdir; extern char *ret_string; extern int ret_size; time_t wait_time = 10; int nproc = 0; int max_proc = 0; prstatus_t *proc_status = NULL; prpsinfo_t *proc_info = NULL; static long page_size; #define TBL_INC 20 extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char no_count[] = "count not found"; /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "platform", {platform} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* Don't need any periodic procsessing. */ } void dep_initialize(void) { char *id = "dep_initialize"; page_size = sysconf(_SC_PAGESIZE); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) closedir(pdir); } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a timestruc_t pointer. Returns unsigned long * time in seconds. (tv_nsec is nano seconds) */ #define tv(val) (ulong)((val).tv_sec + ((val).tv_nsec + 500000000)/1000000000) static int injob(pjob, sid) job *pjob; pid_t sid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds. * The "real" time is adjusted by "cputfactor" */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; ulong cputime, addtime; int i; int nps = 0; prstatus_t *ps; prpsinfo_t *pi; cputime = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; nps++; if (pi->pr_state == SZOMB) { cputime += tv(pi->pr_time); DBPRT(("%s: ses %d pid %d (zombie) cputime %ld\n", id, (int)pi->pr_sid, (int)pi->pr_pid, cputime)) continue; } ps = &proc_status[i]; addtime = tv(ps->pr_utime) + tv(ps->pr_stime) + tv(ps->pr_cutime) + tv(ps->pr_cstime); cputime += addtime; DBPRT(("%s: ses %d pid %d cputime %ld\n", id, (int)pi->pr_sid, (int)ps->pr_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage * adjusted by cputfactor. */ static int overcput_proc(job *pjob, unsigned long limit) { ulong memsize; ulong cputime; int i; prstatus_t *ps; memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pr_sid)) continue; cputime = (ulong)(cputfactor * (double)( tv(ps->pr_utime) + tv(ps->pr_stime) + tv(ps->pr_cutime) + tv(ps->pr_cstime))); if (cputime > limit) return (TRUE); } return (FALSE); } /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the session. */ static unsigned long mem_sum(job *pjob) { ulong memsize; int i; prpsinfo_t *pi; memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; memsize += pi->pr_size * page_size; } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { ulong resisize; int i; prpsinfo_t *pi; resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; resisize += pi->pr_rssize * page_size; } return (resisize); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = ident; /* this is here to only make the compiler not give a warning for an unused variable ident */ message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) /* cpu time - check */ { if (igncput == FALSE) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "mem") == 0) /* check */ { if (ignmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_DATA, &reslim) < 0) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if (setrlimit(RLIMIT_STACK, &reslim) < 0) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given,set sys limit of lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_VMEM, &reslim) < 0)) return (error("RLIMIT_VMEM", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) proc_status = (prstatus_t *)malloc(sizeof(prstatus_t) * TBL_INC); proc_info = (prpsinfo_t *)malloc(sizeof(prpsinfo_t) * TBL_INC); if (proc_status == NULL || proc_info == NULL) { log_err(errno, id, "malloc"); return (PBSE_SYSTEM); } max_proc = TBL_INC; return (PBSE_NONE); } /* * Declare start of polling loop. */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; int fd; struct dirent *dent; char procname[100]; prstatus_t *ps; prpsinfo_t *pi; DBPRT(("%s: entered\n", id)) rewinddir(pdir); ps = proc_status; pi = proc_info; nproc = 0; for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if (ioctl(fd, PIOCSTATUS, ps) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCSTATUS)", procname); log_err(errno, id, log_buffer); } memset(ps, sizeof(prstatus_t), '\0'); } if (++nproc == max_proc) { void *hold; DBPRT(("%s: alloc more table space %d\n", id, nproc)) max_proc += TBL_INC; hold = realloc((void *)proc_status, max_proc * sizeof(prstatus_t)); assert(hold != NULL); proc_status = (prstatus_t *)hold; hold = realloc((void *)proc_info, max_proc * sizeof(prpsinfo_t)); assert(hold != NULL); proc_info = (prpsinfo_t *)hold; } ps = &proc_status[nproc]; pi = &proc_info[nproc]; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcput_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %ld exceeded limit %ld", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { int ct = 0; prpsinfo_t *pi; int i, sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; (void)mom_get_sample(); for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (sesid == pi->pr_sid) { (void)kill(pi->pr_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) if (proc_status) free(proc_status); if (proc_info) free(proc_info); if (pdir) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } double dsecs(t) timestruc_t *t; { DBPRT(("\tsecs: %d\tnsecs: %ld\n", (int)t->tv_sec, t->tv_nsec)) return ((double)t->tv_sec + ((double)t->tv_nsec * 1.0e-9)); } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; prstatus_t *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pr_sid) continue; found = 1; addtime = dsecs(&ps->pr_utime) + dsecs(&ps->pr_stime) + dsecs(&ps->pr_cutime) + dsecs(&ps->pr_cstime); cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, (int)ps->pr_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { double cputime; int i; prstatus_t *ps = NULL; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } cputime = dsecs(&ps->pr_utime) + dsecs(&ps->pr_stime) + dsecs(&ps->pr_cutime) + dsecs(&ps->pr_cstime); sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int memsize; int i; int found = 0; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; memsize += pi->pr_size; DBPRT(("%s: total %ld pid %d %ld\n", id, memsize*page_size, (int)pi->pr_pid, pi->pr_size*page_size)) } if (found) { sprintf(ret_string, "%ldkb", (memsize*page_size) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { prpsinfo_t *pi = NULL; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ldkb", (pi->pr_size * page_size) >> 10); /* KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { int resisize; int i; int found = 0; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; resisize += pi->pr_rssize; } if (found) { sprintf(ret_string, "%ldkb", (resisize*page_size) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { prpsinfo_t *pi = NULL; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ldkb", (pi->pr_rssize * page_size) >> 10); /* KB */ return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; prpsinfo_t *pi; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of job */ for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_uid == 0) continue; if ((jobid = pi->pr_sid) == 0) continue; DBPRT(("%s[%d]: pid %d sid %d\n", id, (int)njids, (int)pi->pr_pid, (int)jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i; prpsinfo_t *pi; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; num_pids = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; DBPRT(("%s[%d]: pid: %d sid %d\n", id, num_pids, (int)pi->pr_pid, (int)pi->pr_sid)) if (jobid != pi->pr_sid) continue; sprintf(fmt, "%d ", (int)pi->pr_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; prpsinfo_t *pi; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if ((uid = pi->pr_uid) == 0) continue; DBPRT(("%s[%d]: pid %d uid %d\n", id, nuids, (int)pi->pr_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ld", sysconf(_SC_NPROCESSORS_ONLN)); system_ncpus = sysconf(_SC_NPROCESSORS_ONLN); return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; unsigned int pmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } pmem = (unsigned int)sysconf(_SC_PHYS_PAGES) * page_size; sprintf(ret_string, "%ukb", pmem >> 10); /* KB */ return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; struct statvfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statvfs(param, &fsbuf) == -1) { log_err(errno, id, "statvfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bfree) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ldkb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev/pts")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { char *name = de->d_name; if (maxtm >= curtm) break; if (*name == '.') continue; sprintf(ttyname, "/dev/pts/%s", name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ld", (long)MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; int i; int value, job, found = 0; time_t now, start; prpsinfo_t *pi; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (job) { if (value != pi->pr_sid) continue; } else { if ((pid_t)value != pi->pr_pid) continue; } found = 1; start = MIN(start, pi->pr_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; kvm_t *kd; long load; char *avenrun = "avenrun"; static struct nlist nl[2]; nl[0].n_name = avenrun; nl[0].n_value = 0; nl[0].n_scnum = 0; nl[0].n_type = 0; nl[0].n_sclass = NULL; nl[0].n_numaux = NULL; nl[1].n_name = NULL; kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (kd == NULL) { log_err(errno, id, "kvm_open"); return (rm_errno = RM_ERR_SYSTEM); } if (kvm_nlist(kd, nl) == -1) { log_err(errno, id, "kvm_nlist"); kvm_close(kd); return (rm_errno = RM_ERR_SYSTEM); } if (nl[0].n_type == 0) { log_err(-1, id, no_count); kvm_close(kd); return (rm_errno = RM_ERR_SYSTEM); } if (kvm_read(kd, nl[0].n_value, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "kvm_read"); kvm_close(kd); return (rm_errno = RM_ERR_SYSTEM); } kvm_close(kd); *rv = (double)load / FSCALE; return 0; } static char * platform(struct rm_attribute *attrib) { char *id = "platform"; int err; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } err = sysinfo(SI_PLATFORM, ret_string, ret_size - 1); if (err < 0) { return "unknown [error]"; } else { return ret_string; } } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/solaris5/Makefile.am0000664000113300011330000000030611272401244015716 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/pbs_demux.c0000664000113300011330000002101411272401244014252 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * pbs_demux - handle I/O from multiple node job * * Standard Out and Standard Error of each task is bound to * stream sockets connected to pbs_demux which inputs from the * various streams and writes to the JOB's out and error. */ #include /* the master config generated by configure */ #include "server_limits.h" #include #include #include #include #include #include #include #include #include #include #if defined(FD_SET_IN_SYS_SELECT_H) # include #endif enum rwhere {invalid, new_out, new_err, old_out, old_err}; struct routem { enum rwhere r_where; short r_nl; }; fd_set readset; void readit( int sock, struct routem *prm) { int amt; char buf[256]; FILE *fil; int i; char *pc; if (prm->r_where == old_out) fil = stdout; else fil = stderr; i = 0; if ((amt = read(sock, buf, 256)) > 0) { /* disable cookie search PW - mpiexec patch */ /* if (prm->r_first == 1) { i = strlen(cookie); if (strncmp(buf,cookie,i) != 0) { close(sock); prm->r_where = invalid; FD_CLR(sock,&readset); } prm->r_first = 0; } */ for (pc = buf + i;pc < buf + amt;++pc) { #ifdef DEBUG if (prm->r_nl != 0) { fprintf(fil, "socket %d: ", sock); prm->r_nl = 0; } #endif /* DEBUG */ putc(*pc, fil); if (*pc == '\n') { prm->r_nl = 1; fflush(fil); } } } else { close(sock); prm->r_where = invalid; FD_CLR(sock, &readset); } return; } /* END readit() */ int main( int argc, char *argv[]) { struct timeval timeout; int i; int maxfd; int main_sock_out = 3; int main_sock_err = 4; int n; int newsock; pid_t parent; fd_set selset; struct routem *routem; parent = getppid(); /* disable cookie search - PW - mpiexec patch */ /* cookie = getenv("PBS_JOBCOOKIE"); if (cookie == 0) { fprintf(stderr, "%s: no PBS_JOBCOOKIE found in the env\n", argv[0]); exit(3); } #ifdef DEBUG printf("Cookie found in environment: %s\n", cookie); #endif */ maxfd = sysconf(_SC_OPEN_MAX); routem = (struct routem *)malloc(maxfd * sizeof(struct routem)); if (routem == NULL) { perror("cannot alloc memory"); exit(5); } for (i = 0;i < maxfd;++i) { routem[i].r_where = invalid; routem[i].r_nl = 1; } routem[main_sock_out].r_where = new_out; routem[main_sock_err].r_where = new_err; FD_ZERO(&readset); FD_SET(main_sock_out, &readset); FD_SET(main_sock_err, &readset); if (listen(main_sock_out, TORQUE_LISTENQUEUE) < 0) { perror("listen on out"); exit(5); } if (listen(main_sock_err, TORQUE_LISTENQUEUE) < 0) { perror("listen on err"); exit(5); } while (1) { selset = readset; timeout.tv_usec = 0; timeout.tv_sec = 10; n = select(FD_SETSIZE, &selset, (fd_set *)0, (fd_set *)0, &timeout); if (n == -1) { if (errno == EINTR) { n = 0; } else { fprintf(stderr, "%s: select failed\n", argv[0]); exit(1); } } else if (n == 0) { /* NOTE: on TRU64, init process does not have pid==1 */ if (getppid() != parent) { #ifdef DEBUG fprintf(stderr, "%s: Parent has gone, and so will I\n", argv[0]); #endif /* DEBUG */ break; } } /* END else if (n == 0) */ for (i = 0;(n != 0) && (i < maxfd);++i) { if (FD_ISSET(i, &selset)) { /* this socket has data */ n--; switch ((routem + i)->r_where) { case new_out: case new_err: newsock = accept(i, 0, 0); (routem + newsock)->r_where = (routem + i)->r_where == new_out ? old_out : old_err; FD_SET(newsock, &readset); break; case old_out: case old_err: readit(i, routem + i); break; default: fprintf(stderr, "%s: internal error\n", argv[0]); exit(2); /*NOTREACHED*/ break; } } } } /* END while(1) */ return(0); } /* END main() */ /* END pbs_demux.c */ torque-2.4.16/src/resmom/netbsd/0000777000113300011330000000000011614035173013467 500000000000000torque-2.4.16/src/resmom/netbsd/mom_start.c0000664000113300011330000002421111272401243015551 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) != 0) { if ((pid == -1) && (errno != EINTR)) break; pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (pjob == NULL) { DBPRT(("%s: pid %d not a task\n", id, pid)) continue; } /* ** We found task within the job which has exited. */ if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code does it the hard way, it searches */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "WINCH", SIGWINCH }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; torque-2.4.16/src/resmom/netbsd/mom_mach.h0000664000113300011330000001240511272401243015333 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: freebsd */ #ifndef MOM_MACH #define MOM_MACH "netbsd" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/netbsd/Makefile.in0000664000113300011330000004377211605403755015474 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/netbsd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/netbsd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/netbsd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/netbsd/pe_input.c0000664000113300011330000001063311272401243015372 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For the Sun - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/netbsd/mom_mach.c0000664000113300011330000014253611272401243015337 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** System dependent code to gather information for a Sun machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "pbs_error.h" #include "log.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" static char ident[] = "@(#) netbsd/$RCSfile$ $Revision: 3151 $"; #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; /* wow, no ncpus on netbsd - extern long system_ncpus; */ extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { NULL, {nullproc} }, }; time_t wait_time = 10; kvm_t *kd = NULL; struct kinfo_proc *proc_tbl = NULL; pid_t *sess_tbl = NULL; int nproc = 0; extern char *ret_string; extern char extra_parm[]; extern char no_parm[]; char nokernel[] = "kernel not available"; char noproc[] = "process %d does not exist"; void dep_initialize(void) { char *id = "dep_initialize"; if (kd == NULL) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "resmom"); if (kd == NULL) { log_err(errno, id, "kvm_open"); return; } } } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (kd) kvm_close(kd); kd = NULL; } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* Don't need any periodic processing. */ } extern time_t time_now; /* * Time decoding macro. Accepts a timeval structure. Returns unsigned long * time in milliseconds. */ #define tv(val) ((val).tv_sec + ((unsigned long)(val).tv_usec + 500000)/1000000) /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For SunOS, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in milliseconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* ** Scan a list of tasks and return true if one of them matches ** the process (sid or pid) represented by *psp. */ static int injob(pjob, sesid) job *pjob; pid_t sesid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) return TRUE; } return FALSE; } #define MINPROC 10 #define MAXPROC 10000 /* * Internal session cpu time decoding routine. * * Accepts a job id. Returns the sum of all cpu time consumed for all * tasks executed by the job, in seconds, adjusted by "cputfactor". */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; int i; u_long cputime; int nps = 0; cputime = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; nps++; cputime += tv(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { struct pstats ps; if (pp->kp_proc.p_stats == NULL) continue; if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); continue; } cputime += tv(ps.p_ru.ru_utime) + tv(ps.p_ru.ru_stime) + tv(ps.p_cru.ru_utime) + tv(ps.p_cru.ru_stime); } else { struct rusage ru; if (kvm_read(kd, (u_long)pp->kp_proc.p_ru, &ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); continue; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: ses %d pid %d cputime %d\n", id, sess_tbl[i], pp->kp_proc.p_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned)((double)cputime * cputfactor)); } /* * Internal session memory usage function. * * Accepts a job ID. Returns the total number of bytes of address * space consumed by all current tasks within the job. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; memsize += ctob(pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize); DBPRT(("%s: ses %d pid=%d totmem=%lu\n", id, sess_tbl[i], pp->kp_proc.p_pid, memsize)) } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; memsize += ctob(pp->kp_eproc.e_vm.vm_rssize); DBPRT(("%s: pid=%d ses=%d mem=%d totmem=%d\n", id, pp->kp_proc.p_pid, sess_tbl[i], pp->kp_eproc.e_vm.vm_rssize, memsize)) } return (memsize); } /* * Return TRUE if any task in the job is over limit for memory usage. */ static int overmem_proc(job *pjob, unsigned long limit) { int i; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; if (ctob(pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize) > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately (SET_LIMIT_SET). */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) if (kd == NULL) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "mom"); if (kd == NULL) { log_err(errno, id, "kvm_open"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } int qs_cmp( const void *a, const void *b) { return((int)((struct kinfo_proc *)a)->kp_eproc.e_paddr - (int)((struct kinfo_proc *)b)->kp_eproc.e_paddr); } int bs_cmp( const void *key, const void *member) { return((int)((struct session *)key)->s_leader - (int)((struct kinfo_proc *)member)->kp_eproc.e_paddr); } /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { char *id = "mom_get_sample"; int i; struct session ss; struct kinfo_proc *kp; struct kinfo_proc *leader; pid_t sid; DBPRT(("%s: entered\n", id)) if (sess_tbl) free(sess_tbl); if (kd == NULL) return (PBSE_INTERNAL); proc_tbl = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); if (proc_tbl == NULL) { sprintf(log_buffer, "kvm_getprocs: %s", kvm_geterr(kd)); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } sess_tbl = (pid_t *)calloc(nproc, sizeof(pid_t)); if (sess_tbl == NULL) { sprintf(log_buffer, "can't allocate memory for session table"); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } qsort(proc_tbl, nproc, sizeof(struct kinfo_proc), qs_cmp); for (i = 0, kp = proc_tbl; i < nproc; i++, kp++) { if (kvm_read(kd, (u_long)kp->kp_eproc.e_sess, &ss, sizeof(ss)) != sizeof(ss)) { sprintf(log_buffer, "kvm_read: %s", kvm_geterr(kd)); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } DBPRT(("%s: pid %d ", id, kp->kp_proc.p_pid)) if (ss.s_leader == kp->kp_eproc.e_paddr || ss.s_leader == NULL) { DBPRT(("own leader 0x%x\n", ss.s_leader)) sid = kp->kp_proc.p_pid; } else { leader = bsearch(&ss, proc_tbl, nproc, sizeof(struct kinfo_proc), bs_cmp); sid = leader ? leader->kp_proc.p_pid : 0; DBPRT(("search got %d\n", sid)) } sess_tbl[i] = sid; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)(wallfactor * (double)(time_now - pjob->ji_qs.ji_stime)); if (num > value) { sprintf(log_buffer, "walltime %lu exceeded limit %lu", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 0; pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = resi_sum(pjob); *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a job task. * Call with the job and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int i, err; int sesid; DBPRT(("%s entered\n", id)) sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; if ((err = mom_get_sample()) != PBSE_NONE) return 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (sesid != sess_tbl[i]) continue; DBPRT(("%s: send signal %d to pid %d\n", id, sig, pp->kp_proc.p_pid)) (void)kill(pp->kp_proc.p_pid, sig); ++ct; } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { DBPRT(("mom_close_poll entered\n")) if (kd) { if (kvm_close(kd) != 0) { log_err(errno, "mom_close_poll", "kvm_close"); return (PBSE_SYSTEM); } kd = NULL; } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; char *id = "getprocs"; caddr_t *kernel_proc; int i, len; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; double ses_time; int i; unsigned long cputime; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; cputime += tv(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { struct pstats ps; if (pp->kp_proc.p_stats == NULL) continue; if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); continue; } cputime += tv(ps.p_ru.ru_utime) + tv(ps.p_ru.ru_stime) + tv(ps.p_cru.ru_utime) + tv(ps.p_cru.ru_stime); } else { struct rusage ru; if (kvm_read(kd, (u_long)pp->kp_proc.p_ru, &ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); continue; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: ses %d pid %d cputime %d\n", id, jobid, pp->kp_proc.p_pid, cputime)) } sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } char * cput_proc(pid) pid_t pid; { char *id = "cput_proc"; struct pstats ps; uint i, cputime; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; cputime = tv(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { struct pstats ps; if (pp->kp_proc.p_stats == NULL) break; if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); break; } cputime += tv(ps.p_ru.ru_utime) + tv(ps.p_ru.ru_stime) + tv(ps.p_cru.ru_utime) + tv(ps.p_cru.ru_stime); } else { struct rusage ru; if (kvm_read(kd, (u_long)pp->kp_proc.p_ru, &ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); break; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: pid %d cputime %d\n", id, pid, cputime)) sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int i; int memsize, addmem; int found = 0; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; addmem = pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize; memsize += addmem; } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* in KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; int i, memsize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; memsize = pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize; sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* in KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int i, found; int resisize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; found = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; resisize += pp->kp_eproc.e_vm.vm_rssize; } if (found) { sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* in kb */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; int i; int resisize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; resisize = pp->kp_eproc.e_vm.vm_rssize; sprintf(ret_string, "%ukbd", ctob(resisize) >> 10); /* in KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; char *fmt; int njids = 0; pid_t *jids, jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((jids = (pid_t *)calloc(nproc, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for job */ for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pp->kp_eproc.e_pcred.p_ruid == 0) continue; jobid = sess_tbl[i]; DBPRT(("%s: pid %d sid %u\n", id, (int)pp->kp_proc.p_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ jids[njids++] = jobid; /* so add it to list */ } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i; char *fmt; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; DBPRT(("%s[%d]: pid %d sid %u\n", id, num_pids, pp->kp_proc.p_pid, sess_tbl[i])) if (jobid != sess_tbl[i]) continue; checkret(&fmt, 100); sprintf(fmt, " %d", pp->kp_proc.p_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = (uid_t *)calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if ((uid = pp->kp_eproc.e_pcred.p_ruid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, (int)pp->kp_proc.p_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; int mib[2]; int physmem; size_t len = sizeof(physmem); if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; if (sysctl(mib, 2, &physmem, &len, NULL, 0) < 0) { log_err(errno, id, "sysctl"); rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%ukb", physmem >> 10); /* in KB */ return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bavail) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* in KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) { DBPRT(("setmax: dev %s access %d replaces max %d\n", dev, sb.st_atime, maxtm)) maxtm = sb.st_atime; } return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; struct pstats ps; pid_t value; int i, job, found = 0; time_t now, start; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (job) { if (value != sess_tbl[i]) continue; } else { if (value != pp->kp_proc.p_pid) continue; } if (pp->kp_proc.p_stats == NULL) { rm_errno = RM_ERR_SYSTEM; return NULL; } if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); rm_errno = RM_ERR_SYSTEM; return NULL; } found = 1; start = MIN(start, ps.p_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; int mib[2]; struct loadavg la; size_t len = sizeof(la); mib[0] = CTL_VM; mib[1] = VM_LOADAVG; if (sysctl(mib, 2, &la, &len, NULL, 0) < 0) { log_err(errno, id, "sysctl(VM_LOADAVG)"); return (rm_errno = RM_ERR_SYSTEM); } *rv = (double)la.ldavg[0] / la.fscale; return 0; } u_long gracetime(u_long secs) { time_t now = time((time_t *)NULL); if (secs > now) /* time is in the future */ return (secs - now); else return 0; } static char * quota(struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct fstab *fs; struct dqblk qi; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if (setfsent() == NULL) { log_err(errno, id, "setfsent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((fs = getfsent()) != NULL) { if (strcmp(fs->fs_type, FSTAB_XX) == 0 || strcmp(fs->fs_type, FSTAB_SW) == 0) continue; if (stat(fs->fs_file, &sb) == -1) { sprintf(log_buffer, "stat: %s", fs->fs_file); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", fs->fs_spec, fs->fs_file, sb.st_dev)) if (sb.st_dev == dirdev) break; } endfsent(); if (fs == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } uid = pw->pw_uid; } if (quotactl(fs->fs_file, Q_GETQUOTA, uid, (char *)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return NULL; } switch (type) { case harddata: sprintf(ret_string, "%u", dbtob(qi.dqb_bhardlimit)); break; case softdata: sprintf(ret_string, "%u", dbtob(qi.dqb_bsoftlimit)); break; case currdata: sprintf(ret_string, "%u", dbtob(qi.dqb_curblocks)); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_ihardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_isoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curinodes); break; case timedata: sprintf(ret_string, "%u", gracetime(qi.dqb_btime)); break; case timefile: sprintf(ret_string, "%u", gracetime(qi.dqb_itime)); break; } return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/netbsd/Makefile.am0000664000113300011330000000030611272401243015433 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/hpux11/0000777000113300011330000000000011614035172013335 500000000000000torque-2.4.16/src/resmom/hpux11/mom_start.c0000664000113300011330000002502611272401243015425 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include #include #include #include #include #include #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; ptask->ti_qs.ti_sid = 0; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/hpux11/mom_mach.h0000664000113300011330000001245111272401243015203 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: hpux11 */ #ifndef MOM_MACH #define MOM_MACH "hpux11" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* from mom child process back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *ptask, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/hpux11/Makefile.in0000664000113300011330000004377211605403751015337 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/hpux11 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/hpux11/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/hpux11/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/hpux11/pe_input.c0000664000113300011330000001063011272401243015236 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For hpux10 - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/hpux11/mom_mach.c0000664000113300011330000014034111272401243015176 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a HP-UX 10.x machine ** ** Resources known by this code: ** cput cpu time for a pid or job ** mem memory size for a pid or job in KB ** resi resident memory size for a pid or job in KB ** sessions list of sessions in the system ** pids list of pids in a job ** nsessions number of sessions in the system ** nusers number of users in the system ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** cpuspeed clock rate of the CPU ** cputype cpu type ** platform platform name (as string) ** valid_user is user name valid.. */ #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* MAX */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *cpuspeed A_((struct rm_attribute *attrib)); static char *cputype A_((struct rm_attribute *attrib)); static char *platform A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *valid_user A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); extern char *ret_string; time_t wait_time = 10; int nproc = 0; int max_proc = 0; struct pst_status *proc_status = NULL; #define TBL_INC 20 extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char no_count[] = "count not found"; static long page_size; /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "cpuspeed", {cpuspeed} }, { "cputype", {cputype} }, { "platform", {platform} }, { "valid_user", {valid_user} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } void dep_initialize(void) { page_size = sysconf(_SC_PAGESIZE); } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } static int getlong(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a long time in seconds. Returns unsigned long * time in seconds. */ #define tv(val) ((unsigned long)((val))) static int injob(pjob, sid) job *pjob; pid_t sid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; unsigned long cputime, addtime; int i; int nps = 0; struct pst_status *ps; cputime = 0.0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; nps++; if (ps->pst_stat == PS_ZOMBIE) { cputime += tv(ps->pst_utime) + tv(ps->pst_stime) + tv(ps->pst_child_utime.pst_sec) + tv(ps->pst_child_stime.pst_sec); DBPRT(("%s: ses %d pid %d (zombie) cputime %d\n", id, ps->pst_sid, ps->pst_pid, cputime)) continue; } addtime = tv(ps->pst_utime) + tv(ps->pst_stime) + tv(ps->pst_child_utime.pst_sec) + tv(ps->pst_child_stime.pst_sec); cputime += addtime; DBPRT(("%s: ses %d pid %d cputime %d\n", id, ps->pst_sid, ps->pst_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcput_proc(job *pjob, unsigned long limit) { char *id = "overcput_proc"; unsigned long memsize; unsigned long cputime; int i; struct pst_status *ps; memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; cputime = (unsigned long)(cputfactor * (double)(tv(ps->pst_utime) + tv(ps->pst_stime) + tv(ps->pst_child_utime.pst_sec) + tv(ps->pst_child_stime.pst_sec))); if (cputime > limit) return (TRUE); } return (FALSE); } /* virtual memory size of a process; add up sizes of all regions */ #define VSIZE(p) ((p)->pst_vtsize + (p)->pst_vdsize + (p)->pst_vssize + \ (p)->pst_vshmsize + (p)->pst_vmmsize + (p)->pst_vusize + \ (p)->pst_viosize) /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the session. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; unsigned long memsize; int i; struct pst_status *ps; memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; memsize += VSIZE(ps) * page_size; } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; unsigned long resisize; int i; struct pst_status *ps; resisize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pst_sid)) continue; resisize += ps->pst_rssize * page_size; } return (resisize); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "ncpus") == 0) { char hold[16]; extern struct var_table vtable; retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); sprintf(hold, "%d", (int)pres->rs_value.at_val.at_long); bld_env_variables(&vtable, "NCPUS", hold); } else if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "mem") == 0) /* check */ { /* don't care */ } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_AS, &reslim) < 0)) return (error("RLIMIT_AS", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * allocate memory for data structure */ int mom_open_poll(void) { return (PBSE_NONE); } /* * Declare start of polling loop. */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; struct pst_dynamic pst_d; long pset; int np, i; DBPRT(("%s: entered\n", id)) if (pstat_getdynamic(&pst_d, sizeof(struct pst_dynamic), 1, 0) != 1) { sprintf(log_buffer, "pstat_getdynamic"); log_err(errno, id, log_buffer); nproc = 0; return (PBSE_SYSTEM); } nproc = pst_d.psd_activeprocs + TBL_INC; if (max_proc < nproc) { max_proc = nproc; proc_status = (struct pst_status *) realloc((void *)proc_status, max_proc * sizeof(struct pst_status)); if (proc_status == 0) { return (PBSE_SYSTEM); } } nproc = pstat_getproc(proc_status, sizeof(struct pst_status), nproc, 0); if (nproc < 0) { sprintf(log_buffer, "pstat_getproc"); log_err(errno, id, log_buffer); memset(proc_status, sizeof(struct pst_status) * max_proc, '\0'); nproc = 0; return (PBSE_SYSTEM); } // Only keep procs in current pset pset = pset_ctl(PSET_GETCURRENTPSET, 0, 0); np = 0; for (i = 0; i < nproc; i++) { if (proc_status[i].pst_pset_id == pset) { if (i != np) proc_status[np] = proc_status[i]; np++; } } nproc = np; return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; unsigned long usedwall = 0, usedcput = 0, ncpus = 0; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) usedcput = cput_sum(pjob); for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "ncpus") == 0) { retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; ncpus = pres->rs_value.at_val.at_long; } else if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (usedcput > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcput_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } usedwall = time_now - pjob->ji_qs.ji_stime; if (usedwall*usedcput*ncpus != 0 && usedcput > 1.1*usedwall*ncpus) { /* None of them are zero, and we used more than we asked for */ sprintf(log_buffer, "too many cpus used"); return TRUE; } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; struct pst_status *ps; int i, sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; (void)mom_get_sample(); for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (sesid == ps->pst_sid) { (void)kill(ps->pst_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. * */ int mom_close_poll(void) { char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) if (proc_status) free(proc_status); return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. Return -1 on error. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; static char id[] = "getprocs"; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pst_sid) continue; found = 1; addtime = ps->pst_utime + ps->pst_stime + ps->pst_child_utime.pst_sec + ps->pst_child_stime.pst_sec; cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, ps->pst_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; double cputime; int i; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } cputime = ps->pst_utime + ps->pst_stime + ps->pst_child_utime.pst_sec + ps->pst_child_stime.pst_sec; sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int memsize; int i; int found = 0; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pst_sid) continue; found = 1; memsize += VSIZE(ps); DBPRT(("%s: total %d pid %d %d\n", id, memsize*page_size, ps->pst_pid, VSIZE(ps)*page_size)) } if (found) { /* in KB */ sprintf(ret_string, "%ukb", (memsize * page_size) >> 10); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; struct pst_status *ps; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", (VSIZE(ps) * page_size) >> 10); /* KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int resisize; int i; int found = 0; struct pst_status *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pst_sid) continue; found = 1; resisize += ps->pst_rssize; } if (found) { sprintf(ret_string, "%ukb", (resisize*page_size) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; struct pst_status *ps; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", (ps->pst_rssize*page_size) >> 10); /* KB */ return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; struct pst_status *ps; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of job */ for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pst_uid == 0) continue; if ((jobid = ps->pst_sid) == 0) continue; DBPRT(("%s[%d]: pid %d sid %d\n", id, njids, ps->pst_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i, j; struct pst_status *ps; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; num_pids = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; DBPRT(("%s[%d]: pid: %d sid %d\n", id, num_pids, ps->pst_pid, ps->pst_sid)) if (jobid != ps->pst_sid) continue; sprintf(fmt, "%d ", ps->pst_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; struct pst_status *ps; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if ((uid = ps->pst_uid) == 0) continue; DBPRT(("%s[%d]: pid %d uid %d\n", id, nuids, ps->pst_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char *ncpus( struct rm_attribute *attrib) { char *id = "ncpus"; struct pst_dynamic pst_d; struct pst_processor *pst_p; long pset; int ncpus; int retval; int i; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (pstat_getdynamic(&pst_d, sizeof(struct pst_dynamic), 1, 0) == -1) { sprintf(log_buffer, "pstat_getdynamic"); log_err(errno, id, log_buffer); return(NULL); } ncpus = pst_d.psd_proc_cnt; pset = pset_ctl(PSET_GETCURRENTPSET, 0, 0); /* Loop over processors, count the ones in this pset*/ pst_p = (struct pst_processor*) malloc(ncpus * sizeof(*pst_p)); if (pst_p == NULL) { sprintf(log_buffer, "malloc"); log_err(errno, id, log_buffer); return "1"; } if (pstat_getprocessor(pst_p, sizeof(*pst_p), ncpus, 0) == -1) { free(pst_p); sprintf(log_buffer, "pstat_getprocessor"); log_err(errno, id, log_buffer); return "1"; } retval = 0; for (i = 0; i < ncpus; i++) { if (pst_p[i].psp_pset_id == pset) retval++; } free(pst_p); sprintf(ret_string, "%d", retval); system_ncpus = retval; return ret_string; } static char *physmem( struct rm_attribute *attrib) { char *id = "physmem"; struct pst_static pst_s; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (pstat_getstatic(&pst_s, sizeof(struct pst_static), 1, 0) == -1) { sprintf(log_buffer, "pstat_getstatic"); log_err(errno, id, log_buffer); return(NULL); } /* physical_memory is in pages - convert to KB */ sprintf(ret_string, "%lukb", (unsigned long)(pst_s.physical_memory / 1024 * pst_s.page_size)); return(ret_string); } /* END physmem() */ static char *totmem( struct rm_attribute *attrib) { return physmem(attrib); } /* END totmem() */ static char *availmem( struct rm_attribute *attrib) { char *id = "availmem"; struct pst_dynamic pst_d; struct pst_static pst_s; long psize; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (pstat_getstatic(&pst_s, sizeof(struct pst_static), 1, 0) == -1) { sprintf(log_buffer, "pstat_getstatic"); log_err(errno, id, log_buffer); return(NULL); } psize = pst_s.page_size; if (pstat_getdynamic(&pst_d, sizeof(struct pst_dynamic), 1, 0) == -1) { sprintf(log_buffer, "pstat_getdynamic"); log_err(errno, id, log_buffer); return(NULL); } /* free_mem is in pages - convert to KB */ sprintf(ret_string, "%lukb", (unsigned long)(pst_d.psd_free / 1024 * psize)); return(ret_string); } /* END availmem() */ char *size_fs( char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statvfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (statvfs(param, &fsbuf) == -1) { log_err(errno, id, "statvfs"); rm_errno = RM_ERR_BADPARAM; return(NULL); } /* in KB */ sprintf(ret_string, "%lukb:%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bfree) / 1024.0), (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_blocks) / 1024.0)); return(ret_string); } /* END size_fs() */ char *size_file( char *param) { char *id = "size_file"; struct stat sbuf; if ((param == NULL) || (param[0] != '/')) { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return(NULL); } sprintf(ret_string, "%lukb", (unsigned long)sbuf.st_size >> 10); /* KB */ return(ret_string); } /* END size_file() */ char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char *idletime( struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev/pts")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { char *name = de->d_name; if (maxtm >= curtm) break; if (*name == '.') continue; sprintf(ttyname, "/dev/pts/%s", name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ul", MAX(0, (unsigned long)curtm - maxtm)); return(ret_string); } /* END idletime() */ static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; int i; int value, job, found = 0; time_t now, start; struct pst_status *ps; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (job) { if (value != ps->pst_sid) continue; } else { if ((pid_t)value != ps->pst_pid) continue; } found = 1; start = MIN(start, ps->pst_start); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; struct pst_processor *pst_p; struct pst_dynamic pst_d; long pset; int ncpus, i; double la; if (pstat_getdynamic(&pst_d, sizeof(struct pst_dynamic), 1, 0) == -1) { sprintf(log_buffer, "pstat_getdynamic"); log_err(errno, id, log_buffer); return (rm_errno = RM_ERR_SYSTEM); } ncpus = pst_d.psd_proc_cnt; // *rv = (double)(pst_d.psd_avg_1_min*pst_d.psd_proc_cnt); /* Only get the load in the pset we're running in. */ pset = pset_ctl(PSET_GETCURRENTPSET, 0, 0); /* Loop over processors, adding load from the processors in this pset */ pst_p = (struct pst_processor*) malloc(ncpus * sizeof(*pst_p)); if (pst_p == NULL) { sprintf(log_buffer, "malloc"); log_err(errno, id, log_buffer); return (rm_errno = RM_ERR_SYSTEM); } if (pstat_getprocessor(pst_p, sizeof(*pst_p), ncpus, 0) == -1) { free(pst_p); sprintf(log_buffer, "pstat_getprocessor"); log_err(errno, id, log_buffer); return (rm_errno = RM_ERR_SYSTEM); } la = 0; for (i = 0; i < ncpus; i++) { if (pst_p[i].psp_pset_id == pset) la += pst_p[i].psp_avg_1_min; } *rv = la; free(pst_p); return 0; } static char * cpuspeed(struct rm_attribute *attrib) { char *id = "cpuspeed"; double scale; double freq; struct pst_processor pst_p; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } /* Fetch speed from first processor */ if (pstat_getprocessor(&pst_p, sizeof(pst_p), 1, 0) > 0) { freq = (double)pst_p.psp_iticksperclktick * (double) sysconf(_SC_CLK_TCK); } else { /* whoops - fake it */ freq = 100 * 1000 * 1000; } /* * Scale is the 1 over the clock frequency, in Mhz */ scale = ((double) freq / (1000 * 1000)); sprintf(ret_string, "%d", (int) scale); return ret_string; } static char * cputype(struct rm_attribute *attrib) { char *id = "cputype"; static long cputype = -1; static char *cputypename; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (cputype == -1) { cputype = sysconf(_SC_CPU_VERSION); if (cputype < 0) { sprintf(cputypename, "[errno = %d]", errno); } else { switch (cputype) { case CPU_HP_MC68020: cputypename = "Motorola MC68020"; break; case CPU_HP_MC68030: cputypename = "Motorola MC68030"; break; case CPU_HP_MC68040: cputypename = "Motorola MC68040"; break; case CPU_PA_RISC1_0: cputypename = "HP PA-RISC1.0"; break; case CPU_PA_RISC1_1: cputypename = "HP PA-RISC1.1"; break; case CPU_PA_RISC1_2: cputypename = "HP PA-RISC1.2"; break; case CPU_PA_RISC2_0: cputypename = "HP PA-RISC2.0"; break; default: cputypename = "unknown"; } } } return cputypename; } static char * platform(struct rm_attribute *attrib) { char *id = "platform"; struct utsname name; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } uname(&name); sprintf(ret_string, "%s %s %s", name.sysname, name.release, name.machine); return ret_string; } static char * valid_user(struct rm_attribute *attrib) { char *id = "valid_user"; struct passwd *p; if (attrib == NULL || attrib -> a_value == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } p = getpwnam(attrib -> a_value); if (p) { return "yes"; } else { return "no"; } } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/hpux11/Makefile.am0000664000113300011330000000030611272401243015302 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/mom_inter.c0000664000113300011330000003773411272401244014275 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #ifdef sun #include #include #endif /* sun */ #if defined(HAVE_SYS_IOCTL_H) #include #endif #if !defined(sgi) && !defined(_AIX) && !defined(linux) #include #endif /* ! sgi */ #include "portability.h" #include "pbs_ifl.h" #include "server_limits.h" #include "net_connect.h" #include "log.h" #include "list_link.h" #include "attribute.h" #include "pbs_job.h" #include "port_forwarding.h" static char cc_array[PBS_TERM_CCA]; static struct winsize wsz; extern int mom_reader_go; static int IPv4or6 = AF_UNSPEC; extern int conn_qsub(char *, int, char *); extern char xauth_path[]; extern int DEBUGMODE; /* * read_net - read data from network till received amount expected * * returns >0 amount read * -1 on error */ static int read_net( int sock, char *buf, int amt) { int got; int total = 0; while (amt > 0) { got = read(sock, buf, amt); if (got == 0) { /* end of file */ break; } if (got < 0) { /* FAILURE */ return(-1); } /* read (some) data */ amt -= got; buf += got; total += got; } /* END while (amt > 0) */ return(total); } /* END read_net() */ /* * rcvttype - receive the terminal type of the real terminal * * Sent over network as "TERM=type_string" */ char *rcvttype( int sock) { static char buf[PBS_TERM_BUF_SZ]; /* read terminal type as sent by qsub */ if ((read_net(sock, buf, PBS_TERM_BUF_SZ) != PBS_TERM_BUF_SZ) || (strncmp(buf, "TERM=", 5) != 0)) { return(NULL); } /* get the basic control characters from qsub's termial */ if (read_net(sock, cc_array, PBS_TERM_CCA) != PBS_TERM_CCA) { return(NULL); } return(buf); } /* * set_termcc - set the basic modes for the slave terminal, and set the * control characters to those sent by qsub. */ void set_termcc( int fd) { struct termios slvtio; #ifdef PUSH_STREAM ioctl(fd, I_PUSH, "ptem"); ioctl(fd, I_PUSH, "ldterm"); #endif /* PUSH_STREAM */ if (tcgetattr(fd, &slvtio) < 0) { return; /* cannot do it, leave as is */ } #ifdef IMAXBEL slvtio.c_iflag = (BRKINT | IGNPAR | ICRNL | IXON | IXOFF | IMAXBEL); #else slvtio.c_iflag = (BRKINT | IGNPAR | ICRNL | IXON | IXOFF); #endif slvtio.c_oflag = (OPOST | ONLCR); #if defined(ECHOKE) && defined(ECHOCTL) slvtio.c_lflag = (ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOKE | ECHOCTL); #else slvtio.c_lflag = (ISIG | ICANON | ECHO | ECHOE | ECHOK); #endif slvtio.c_cc[VEOL] = '\0'; slvtio.c_cc[VEOL2] = '\0'; slvtio.c_cc[VSTART] = '\021'; /* ^Q */ slvtio.c_cc[VSTOP] = '\023'; /* ^S */ #if defined(VDSUSP) slvtio.c_cc[VDSUSP] = '\031'; /* ^Y */ #endif #if defined(VREPRINT) slvtio.c_cc[VREPRINT] = '\022'; /* ^R */ #endif slvtio.c_cc[VLNEXT] = '\017'; /* ^V */ slvtio.c_cc[VINTR] = cc_array[0]; slvtio.c_cc[VQUIT] = cc_array[1]; slvtio.c_cc[VERASE] = cc_array[2]; slvtio.c_cc[VKILL] = cc_array[3]; slvtio.c_cc[VEOF] = cc_array[4]; slvtio.c_cc[VSUSP] = cc_array[5]; tcsetattr(fd, TCSANOW, &slvtio); return; } /* END set_termcc() */ /* * rcvwinsize - receive the window size of the real terminal window * * Sent over network as "WINSIZE rn cn xn yn" where .n is numeric string */ int rcvwinsize( int sock) { char buf[PBS_TERM_BUF_SZ]; if (read_net(sock, buf, PBS_TERM_BUF_SZ) != PBS_TERM_BUF_SZ) { /* FAILURE */ return(-1); } if (sscanf(buf, "WINSIZE %hu,%hu,%hu,%hu", &wsz.ws_row, &wsz.ws_col, &wsz.ws_xpixel, &wsz.ws_ypixel) != 4) { /* FAILURE */ return(-1); } return(0); } /* END rcvwinsize() */ int setwinsize(int pty) { if (ioctl(pty, TIOCSWINSZ, &wsz) < 0) { perror("ioctl TIOCSWINSZ"); return (-1); } return (0); } /* * reader process - reads from the remote socket, and writes * to the master pty */ int mom_reader( int s, int ptc) { extern ssize_t read_blocking_socket(int fd, void *buf, ssize_t count); char buf[1024]; int c; /* read from the socket, and write to ptc */ while (mom_reader_go) { c = read_blocking_socket(s, buf, sizeof(buf)); if (c > 0) { int wc; char *p = buf; while (c > 0) { if ((wc = write(ptc, p, c)) < 0) { if (errno == EINTR) { /* write interrupted - retry */ continue; } /* FAILURE - write failed */ return(-1); } c -= wc; p += wc; } /* END while (c > 0) */ continue; } if (c == 0) { /* SUCCESS - all data written */ return (0); } if (c < 0) { if (errno == EINTR) { /* read interrupted - retry */ continue; } /* FAILURE - read failed */ return(-1); } } /* END while (1) */ /* NOTREACHED*/ return(0); } /* END mom_reader() */ /* * Writer process: reads from master pty, and writes * data out to the rem socket */ int mom_writer( int s, int ptc) { char buf[1024]; int c; /* read from ptc, and write to the socket */ while (1) { c = read(ptc, buf, sizeof(buf)); if (c > 0) { int wc; char *p = buf; while (c > 0) { if ((wc = write(s, p, c)) < 0) { if (errno == EINTR) { continue; } /* FAILURE - write failed */ return(-1); } c -= wc; p += wc; } /* END while (c > 0) */ continue; } /* END if (c > 0) */ if (c == 0) { /* SUCCESS - all data read */ return(0); } if (c < 0) { if (errno == EINTR) { /* read interupted, retry */ continue; } /* FAILURE - read failed */ return(-1); } } /* END while(1) */ /*NOTREACHED*/ return(-1); } /* END mom_writer */ /* adapted from openssh */ /* * Creates an internet domain socket for listening for X11 connections. * Returns a suitable display number (>0) for the DISPLAY variable * or -1 if an error occurs. */ int x11_create_display( int x11_use_localhost, /* non-zero to use localhost only */ char *display, /* O */ char *phost, /* hostname where qsub is waiting */ int pport, /* port where qsub is waiting */ char *homedir, /* need to set $HOME for xauth */ char *x11authstr) /* proto:data:screen */ { int display_number, sock; u_short port; struct addrinfo hints, *ai, *aitop; char strport[NI_MAXSERV]; int gaierr, n, num_socks = 0; unsigned int x11screen; char x11proto[512], x11data[512], cmd[512]; char auth_display[512]; FILE *f; pid_t childpid; struct pfwdsock *socks; char *homeenv; *display = '\0'; if ((socks = calloc(sizeof(struct pfwdsock), NUM_SOCKS)) == NULL) { /* FAILURE - cannot alloc memory */ fprintf(stderr,"ERROR: could not calloc!\n"); return(-1); } if ((homeenv = malloc(strlen("HOME=") + strlen(homedir) + 2)) == NULL) { /* FAILURE - cannot alloc memory */ fprintf(stderr, "ERROR: could not malloc!\n"); return(-1); } sprintf(homeenv, "HOME=%s", homedir); putenv(homeenv); for (n = 0;n < NUM_SOCKS;n++) socks[n].active = 0; x11proto[0] = x11data[0] = '\0'; errno = 0; if ((n = sscanf(x11authstr, "%511[^:]:%511[^:]:%u", x11proto, x11data, &x11screen)) != 3) { fprintf(stderr, "sscanf(%s)=%d failed: %s\n", x11authstr, n, strerror(errno)); free(socks); return(-1); } for (display_number = X11OFFSET;display_number < MAX_DISPLAYS;display_number++) { port = 6000 + display_number; memset(&hints, 0, sizeof(hints)); hints.ai_family = IPv4or6; hints.ai_flags = x11_use_localhost ? 0 : AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof(strport), "%d", port); if ((gaierr = getaddrinfo(NULL, strport, &hints, &aitop)) != 0) { fprintf(stderr, "getaddrinfo: %.100s\n", gai_strerror(gaierr)); free(socks); return(-1); } /* create a socket and bind it to display_number foreach address */ for (ai = aitop;ai != NULL;ai = ai->ai_next) { if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) continue; sock = socket(ai->ai_family, SOCK_STREAM, 0); if (sock < 0) { if ((errno != EINVAL) && (errno != EAFNOSUPPORT)) { fprintf(stderr, "socket: %.100s\n", strerror(errno)); free(socks); return (-1); } else { DBPRT(("x11_create_display: Socket family %d *NOT* supported\n", ai->ai_family)); continue; } } DBPRT(("x11_create_display: Socket family %d is supported\n", ai->ai_family)); #ifdef IPV6_V6ONLY if (ai->ai_family == AF_INET6) { int on = 1; if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { DBPRT(("setsockopt IPV6_V6ONLY: %.100s\n", strerror(errno))); } } #endif if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { DBPRT(("bind port %d: %.100s\n", port, strerror(errno))); close(sock); if (ai->ai_next) continue; for (n = 0; n < num_socks; n++) { close(socks[n].sock); } num_socks = 0; break; } socks[num_socks].sock = sock; socks[num_socks].active = 1; num_socks++; #ifndef DONT_TRY_OTHER_AF if (num_socks == NUM_SOCKS) break; #else if (x11_use_localhost) { if (num_socks == NUM_SOCKS) break; } else { break; } #endif } freeaddrinfo(aitop); if (num_socks > 0) break; } /* END for (display) */ if (display_number >= MAX_DISPLAYS) { fprintf(stderr, "Failed to allocate internet-domain X11 display socket.\n"); free(socks); return(-1); } /* Start listening for connections on the socket. */ for (n = 0;n < num_socks;n++) { DBPRT(("listening on fd %d\n", socks[n].sock)); if (listen(socks[n].sock,TORQUE_LISTENQUEUE) < 0) { fprintf(stderr,"listen: %.100s\n", strerror(errno)); close(socks[n].sock); free(socks); return(-1); } socks[n].listening = 1; } /* END for (n) */ /* setup local xauth */ sprintf(display, "localhost:%u.%u", display_number, x11screen); snprintf(auth_display, sizeof(auth_display), "unix:%u.%u", display_number, x11screen); snprintf(cmd, sizeof(cmd), "%s %s -", xauth_path, DEBUGMODE ? "-v" : "-q"); f = popen(cmd, "w"); if (f != NULL) { fprintf(f, "remove %s\n", auth_display); fprintf(f, "add %s %s %s\n", auth_display, x11proto, x11data); pclose(f); } else { fprintf(stderr, "could not run %s\n", cmd); free(socks); return(-1); } if ((childpid = fork()) > 0) { free(socks); DBPRT(("successful x11 init, returning display %d\n", display_number)); return(display_number); } if (childpid < 0) { fprintf(stderr, "failed x11 init fork\n"); free(socks); return(-1); } DBPRT(("entering port_forwarder\n")); port_forwarder(socks, conn_qsub, phost, pport, NULL); exit(EXIT_FAILURE); } /* END x11_create_display() */ /* END mom_inter.c */ torque-2.4.16/src/resmom/freebsd/0000777000113300011330000000000011614035172013621 500000000000000torque-2.4.16/src/resmom/freebsd/mom_start.c0000664000113300011330000002477611272401243015724 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for a task whose * session id matched that of a terminated child pid. Mark that * task as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code does it the hard way, it searches */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "WINCH", SIGWINCH }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; torque-2.4.16/src/resmom/freebsd/mom_mach.h0000664000113300011330000001240611272401243015467 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: freebsd */ #ifndef MOM_MACH #define MOM_MACH "freebsd" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/freebsd/Makefile.in0000664000113300011330000004377511605403747015633 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/freebsd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/freebsd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/freebsd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/freebsd/pe_input.c0000664000113300011330000001063211272401243015524 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For the Sun - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/freebsd/mom_mach.c0000664000113300011330000014773211272401243015475 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** System dependent code to gather information for a Sun machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** ncpus number of cpus ** nsessions number of sessions in the system ** nusers number of users in the system ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information (sizes in KB) */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_SYSCTL #include #endif #include "portability.h" #include "pbs_error.h" #include "log.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int LOGLEVEL; /* ** local functions */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { NULL, {nullproc} }, }; struct nlist nl[] = { { "_anoninfo" }, /* 0 */ { "_cnt" }, /* 1 */ { "_averunnable" }, /* 2 */ { "" } }; #define KSYM_ANON 0 #define KSYM_PHYS 1 #define KSYM_LOAD 2 time_t wait_time = 10; kvm_t *kd = NULL; struct kinfo_proc *proc_tbl = NULL; pid_t *sess_tbl = NULL; int nproc = 0; extern char *ret_string; extern char extra_parm[]; extern char no_parm[]; char nokernel[] = "kernel not available"; char noproc[] = "process %d does not exist"; static int nncpus = 0; void dep_initialize(void) { char *id = "dep_initialize"; int mib[2]; size_t len; if (kd == NULL) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "resmom"); if (kd == NULL) { log_err(errno, id, "kvm_open"); return; } } if (kvm_nlist(kd, nl) == -1) { log_err(errno, id, "kvm_nlist"); return; } mib[0] = CTL_HW; /* get number of processors */ mib[1] = HW_NCPU; len = sizeof(nncpus); (void)sysctl(mib, 2, &nncpus, &len, NULL, 0); return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (kd) kvm_close(kd); kd = NULL; } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } extern time_t time_now; /* * Time decoding macro. Accepts a timeval structure. Returns unsigned long * time in seconds. */ #define tv(val) ((val).tv_sec+((unsigned long)(val).tv_usec+500000)/1000000) #if __FreeBSD_version >= 300000 /* a u_int64_t in micro-seconds */ #define tvk(val) ((unsigned long)(val)/1000000) #define p_rtime p_runtime #else #define tvk tv #endif /* __FreeBSD_version */ /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For SunOS, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* ** Scan a list of tasks and return true if one of them matches ** the process (sid or pid) represented by *psp. */ static int injob(pjob, sesid) job *pjob; pid_t sesid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) return TRUE; } return FALSE; } #define MINPROC 10 #define MAXPROC 10000 /* * Internal session cpu time decoding routine. * * Accepts a job id. Returns the sum of all cpu time consumed for all * tasks executed by the job, in seconds, adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { static char id[] = "cput_sum"; int i; u_long cputime; int nps = 0; cputime = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; nps++; cputime += tvk(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { struct pstats ps; DBPRT(("%s: p_stats 0x%lx\n", id, (u_long)pp->kp_proc.p_stats)) if (pp->kp_proc.p_stats == NULL) continue; if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); continue; } cputime += tv(ps.p_ru.ru_utime) + tv(ps.p_ru.ru_stime) + tv(ps.p_cru.ru_utime) + tv(ps.p_cru.ru_stime); } else { struct rusage ru; DBPRT(("%s: p_ru 0x%lx\n", id, (u_long)pp->kp_proc.p_ru)) if (kvm_read(kd, (u_long)pp->kp_proc.p_ru, &ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); continue; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: ses %d pid %d cputime %d\n", id, sess_tbl[i], pp->kp_proc.p_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Internal session memory usage function. * * Accepts a job ID. Returns the total number of bytes of address * space consumed by all current tasks within the job. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; memsize += ctob(pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize); DBPRT(("%s: ses %d pid=%d totmem=%lu\n", id, sess_tbl[i], pp->kp_proc.p_pid, memsize)) } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; memsize += ctob(pp->kp_eproc.e_vm.vm_rssize); DBPRT(("%s: pid=%d ses=%d mem=%d totmem=%d\n", id, pp->kp_proc.p_pid, sess_tbl[i], pp->kp_eproc.e_vm.vm_rssize, memsize)) } return (memsize); } /* * Return TRUE if any task in the job is over limit for memory usage. */ static int overmem_proc(job *pjob, unsigned long limit) { int i; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; if (ctob(pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize) > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately (SET_LIMIT_SET). */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; log_record(PBSEVENT_SYSTEM, 0, id, "entered"); if (kd == NULL) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "mom"); if (kd == NULL) { log_err(errno, id, "kvm_open"); return (PBSE_SYSTEM); } } if (kvm_nlist(kd, nl) == -1) { log_err(errno, id, "kvm_nlist"); return (PBSE_SYSTEM); } return (PBSE_NONE); } int qs_cmp( const void *a, const void *b) { return((int)((struct kinfo_proc *)a)->kp_eproc.e_paddr - (int)((struct kinfo_proc *)b)->kp_eproc.e_paddr); } int bs_cmp( const void *key, const void *member) { return((int)((struct session *)key)->s_leader - (int)((struct kinfo_proc *)member)->kp_eproc.e_paddr); } /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { char *id = "mom_get_sample"; int i; struct session ss; struct kinfo_proc *kp; struct kinfo_proc *leader; pid_t sid; DBPRT(("%s: entered\n", id)) if (sess_tbl) free(sess_tbl); if (kd == NULL) return (PBSE_INTERNAL); proc_tbl = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); if (proc_tbl == NULL) { sprintf(log_buffer, "kvm_getprocs: %s", kvm_geterr(kd)); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } sess_tbl = (pid_t *)calloc(nproc, sizeof(pid_t)); if (sess_tbl == NULL) { sprintf(log_buffer, "can't allocate memory for session table"); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } qsort(proc_tbl, nproc, sizeof(struct kinfo_proc), qs_cmp); for (i = 0, kp = proc_tbl; i < nproc; i++, kp++) { if (kvm_read(kd, (u_long)kp->kp_eproc.e_sess, &ss, sizeof(ss)) != sizeof(ss)) { sprintf(log_buffer, "kvm_read: %s", kvm_geterr(kd)); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } if (ss.s_leader == kp->kp_eproc.e_paddr || ss.s_leader == NULL) { sid = kp->kp_proc.p_pid; } else { leader = bsearch(&ss, proc_tbl, nproc, sizeof(struct kinfo_proc), bs_cmp); sid = leader ? leader->kp_proc.p_pid : 0; } sess_tbl[i] = sid; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "mem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((num = mem_sum(pjob)) > value) { sprintf(log_buffer, "mem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)(wallfactor * (double)(time_now - pjob->ji_qs.ji_stime)); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a job task. * Call with the job and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int i, err; int sesid; DBPRT(("%s entered\n", id)) sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; if ((err = mom_get_sample()) != PBSE_NONE) return 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (sesid != sess_tbl[i]) continue; DBPRT(("%s: send signal %d to pid %d\n", id, sig, pp->kp_proc.p_pid)) (void)kill(pp->kp_proc.p_pid, sig); ++ct; } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { DBPRT(("mom_close_poll entered\n")) if (kd) { if (kvm_close(kd) != 0) { log_err(errno, "mom_close_poll", "kvm_close"); return (PBSE_SYSTEM); } kd = NULL; } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; char *id = "getprocs"; caddr_t *kernel_proc; int i, len; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; double ses_time; int i; unsigned long cputime; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; cputime += tvk(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { struct pstats ps; if (pp->kp_proc.p_stats == NULL) continue; if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); continue; } cputime += tv(ps.p_ru.ru_utime) + tv(ps.p_ru.ru_stime) + tv(ps.p_cru.ru_utime) + tv(ps.p_cru.ru_stime); } else { struct rusage ru; if (kvm_read(kd, (u_long)pp->kp_proc.p_ru, &ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); continue; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: ses %d pid %d cputime %d\n", id, jobid, pp->kp_proc.p_pid, cputime)) } sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } char * cput_proc(pid) pid_t pid; { char *id = "cput_proc"; struct pstats ps; uint i, cputime; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; cputime = tvk(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { struct pstats ps; if (pp->kp_proc.p_stats == NULL) break; if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); break; } cputime += tv(ps.p_ru.ru_utime) + tv(ps.p_ru.ru_stime) + tv(ps.p_cru.ru_utime) + tv(ps.p_cru.ru_stime); } else { struct rusage ru; if (kvm_read(kd, (u_long)pp->kp_proc.p_ru, &ru, sizeof(ru)) != sizeof(ru)) { log_err(errno, id, "kvm_read(session)"); break; } cputime += tv(ru.ru_utime) + tv(ru.ru_stime); } DBPRT(("%s: pid %d cputime %d\n", id, pid, cputime)) sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int i; int memsize, addmem; int found = 0; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; addmem = pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize; memsize += addmem; } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; int i, memsize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; memsize = pp->kp_eproc.e_vm.vm_tsize + pp->kp_eproc.e_vm.vm_dsize + pp->kp_eproc.e_vm.vm_ssize; sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int i, found; int resisize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; found = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; resisize += pp->kp_eproc.e_vm.vm_rssize; } if (found) { sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; int i; int resisize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; resisize = pp->kp_eproc.e_vm.vm_rssize; sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; char *fmt; int njids = 0; pid_t *jids, jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((jids = (pid_t *)calloc(nproc, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for job */ for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pp->kp_eproc.e_pcred.p_ruid == 0) continue; jobid = sess_tbl[i]; DBPRT(("%s: pid %d sid %u\n", id, (int)pp->kp_proc.p_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ jids[njids++] = jobid; /* so add it to list */ } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i; char *fmt; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; DBPRT(("%s[%d]: pid %d sid %u\n", id, num_pids, pp->kp_proc.p_pid, sess_tbl[i])) if (jobid != sess_tbl[i]) continue; checkret(&fmt, 100); sprintf(fmt, " %d", pp->kp_proc.p_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = (uid_t *)calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if ((uid = pp->kp_eproc.e_pcred.p_ruid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, (int)pp->kp_proc.p_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { if (attrib) { log_err(-1, "ncpus", extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%d", nncpus); system_ncpus = nncpus; return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; struct vmmeter sum; u_int val; #ifdef USE_SYSCTL int mib[2]; size_t len; unsigned int phys_mem; int page_size; #endif if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } #ifndef USE_SYSCTL if (kd == NULL) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return NULL; } if (nl[KSYM_PHYS].n_type == 0) { log_err(-1, id, "vmmeter not found"); rm_errno = RM_ERR_SYSTEM; return 0; } if (kvm_read(kd, nl[KSYM_PHYS].n_value, (char *)&sum, sizeof(sum)) != sizeof(sum)) { log_err(errno, id, "kvm_read"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (sum.v_page_size < 1024) { val = 1024 / sum.v_page_size; val = sum.v_page_count / val; } else { val = sum.v_page_size / 1024; val *= sum.v_page_count; } #else mib[0] = CTL_HW; /* get physical memory */ mib[1] = HW_PHYSMEM; len = sizeof(phys_mem); (void)sysctl(mib, 2, &phys_mem, &len, NULL, 0); val = phys_mem / 1024; #endif sprintf(ret_string, "%ukb", val); return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bavail) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* in KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax( char *dev) { struct stat sb; char *id = "setmax"; if (stat(dev, &sb) == -1) { return; } if (maxtm < sb.st_atime) { if (LOGLEVEL >= 2) { sprintf(log_buffer, "setmax: dev %s access %d replaces max %ld\n", dev, sb.st_atime, (long)maxtm); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } maxtm = sb.st_atime; } return; } char *idletime( struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ld", (long)MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; struct pstats ps; pid_t value; int i, job, found = 0; time_t now, start; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (job) { if (value != sess_tbl[i]) continue; } else { if (value != pp->kp_proc.p_pid) continue; } if (pp->kp_proc.p_stats == NULL) { rm_errno = RM_ERR_SYSTEM; return NULL; } if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, sizeof(ps)) != sizeof(ps)) { log_err(errno, id, "kvm_read(pstats)"); rm_errno = RM_ERR_SYSTEM; return NULL; } found = 1; start = MIN(start, ps.p_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; long la[3]; #ifdef USE_SYSCTL int mib[2]; size_t len; unsigned int phys_mem; int page_size; #endif #ifndef USE_SYSCTL if (kd == NULL) { log_err(-1, id, nokernel); return (rm_errno = RM_ERR_SYSTEM); } if (nl[KSYM_LOAD].n_type == 0) { log_err(-1, id, "loadaverage count not found"); return (rm_errno = RM_ERR_SYSTEM); } if (kvm_read(kd, nl[KSYM_LOAD].n_value, la, sizeof(la)) != sizeof(la)) { log_err(errno, id, "kvm_read"); return (rm_errno = RM_ERR_SYSTEM); } #else mib[0] = CTL_VM; /* get load average */ mib[1] = VM_LOADAVG; len = sizeof(la); (void)sysctl(mib, 2, &la, &len, NULL, 0); #endif *rv = (double)la[0] / (double)FSCALE; return 0; } u_long gracetime(u_long secs) { time_t now = time((time_t *)NULL); if (secs > now) /* time is in the future */ return (secs - now); else return 0; } static char * quota(struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct fstab *fs; struct dqblk qi; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if (setfsent() == NULL) { log_err(errno, id, "setfsent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((fs = getfsent()) != NULL) { if (strcmp(fs->fs_type, FSTAB_XX) == 0 || strcmp(fs->fs_type, FSTAB_SW) == 0) continue; if (stat(fs->fs_file, &sb) == -1) { sprintf(log_buffer, "stat: %s", fs->fs_file); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", fs->fs_spec, fs->fs_file, sb.st_dev)) if (sb.st_dev == dirdev) break; } endfsent(); if (fs == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } uid = pw->pw_uid; } if (quotactl(fs->fs_file, Q_GETQUOTA, uid, (char *)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* all sizes in KB */ switch (type) { case harddata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_bhardlimit) >> 10); break; case softdata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_bsoftlimit) >> 10); break; case currdata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_curblocks) >> 10); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_ihardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_isoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curinodes); break; case timedata: sprintf(ret_string, "%u", gracetime(qi.dqb_btime)); break; case timefile: sprintf(ret_string, "%u", gracetime(qi.dqb_itime)); break; } return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/freebsd/Makefile.am0000664000113300011330000000030611272401243015566 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/tmsock_recov.c0000664000113300011330000000453411272401244014772 00000000000000/* * tmsock_recov.c - This file contains the functions to record a job's * demux socket numbers, nodeid, and last task id */ #include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" #include #include #include #include #include #include #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "pbs_job.h" #include "log.h" #include "svrfunc.h" u_long addclient(char *name); /* * save_tmsock() - Saves the tm sockets of a job to disk * */ int save_tmsock( job *pjob) /* pointer to job structure */ { static int sizeofint = sizeof(int); if ((pjob->ji_stdout > 0) && (pjob->ji_stdout < 1024)) { /* We don't have real port numbers (yet), so don't bother */ return(0); } DBPRT(("saving extra job info stdout=%d stderr=%d taskid=%u nodeid=%u\n", pjob->ji_stdout, pjob->ji_stderr, pjob->ji_taskid, pjob->ji_nodeid)); /* FIXME: need error checking here */ save_struct((char *)&pjob->ji_stdout, sizeofint); save_struct((char *)&pjob->ji_stderr, sizeofint); save_struct((char *)&pjob->ji_taskid, sizeof(tm_task_id)); save_struct((char *)&pjob->ji_nodeid, sizeof(tm_node_id)); return(0); } /* END save_tmsock() */ /* * recov_tmsock() - Recovers the tm sockets of a job * */ int recov_tmsock( int fds, job *pjob) /* I */ /* pathname to job save file */ { char *id = "recov_tmsock"; static int sizeofint = sizeof(int); if (read(fds, (char *)&pjob->ji_stdout, sizeofint) != sizeofint) { log_err(errno, id, "read"); return(1); } if (read(fds, (char *)&pjob->ji_stderr, sizeofint) != sizeofint) { log_err(errno, id, "read"); return(1); } if (read(fds, (char *)&pjob->ji_taskid, sizeof(tm_task_id)) != sizeof(tm_task_id)) { log_err(errno, id, "read"); return(1); } if (read(fds, (char *)&pjob->ji_nodeid, sizeof(tm_node_id)) != sizeof(tm_node_id)) { log_err(errno, id, "read"); return(1); } DBPRT(("recovered extra job info stdout=%d stderr=%d taskid=%u nodeid=%u\n", pjob->ji_stdout, pjob->ji_stderr, pjob->ji_taskid, pjob->ji_nodeid)); return(0); } /* END recov_tmsock() */ torque-2.4.16/src/resmom/solaris7/0000777000113300011330000000000011614035173013753 500000000000000torque-2.4.16/src/resmom/solaris7/mom_start.c0000664000113300011330000002504311515623003016041 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include #include #include #include #include #include #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 4432 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job( job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %ld not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %ld exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; (void)task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/solaris7/mom_mach.h0000664000113300011330000001343111272401244015620 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: solaris7 */ #ifndef MOM_MACH #define MOM_MACH "solaris7" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 #define PBS_PROC_SID(x) proc_info[x].pr_sid #define PBS_PROC_PID(x) proc_info[x].pr_pid #define PBS_PROC_PPID(x) proc_info[x].pr_ppid #define PBS_SUPPORT_SUSPEND 1 typedef struct pbs_plinks /* struct to link processes */ { pid_t pl_pid; /* pid of this proc */ pid_t pl_ppid; /* parent pid of this proc */ int pl_child; /* index to child */ int pl_sib; /* index to sibling */ int pl_parent; /* index to parent */ } pbs_plinks; /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mach_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ extern int mom_close_poll A_(()); /* Terminate poll ability */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/solaris7/Makefile.in0000664000113300011330000004400011605403756015742 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/solaris7 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/solaris7/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/solaris7/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/solaris7/pe_input.c0000664000113300011330000001063211272401244015656 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For solaris5 - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/solaris7/mom_mach.c0000664000113300011330000013154711272401244015624 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ /* just playing with LFS -garrick #ifdef _FILE_OFFSET_BITS #undef _FILE_OFFSET_BITS #endif */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" #include "mom_func.h" /* ** System dependent code to gather information for the resource ** monitor for a Sun Solaris machine ** ** Resources known by this code: ** cput cpu time for a pid or job ** mem memory size for a pid or job in KB ** resi resident memory size for a pid or job in KB ** sessions list of sessions in the system ** pids list of pids in a job ** nsessions number of sessions in the system ** nusers number of users in the system ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average */ #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* MAX */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *platform A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); char procfs[] = "/proc"; char procfmts[] = "/proc/%s/psinfo"; DIR *pdir; extern char *ret_string; extern int ret_size; time_t wait_time = 10; int nproc = 0; int max_proc = 0; psinfo_t *proc_info = NULL; static long page_size; static int myproc_ct; /* count of processes in a session */ static int myproc_max = 0; pbs_plinks *Proc_lnks = NULL; /* process links table head */ #define TBL_INC 50 extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char no_count[] = "count not found"; /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "platform", {platform} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } void dep_initialize(void) { char *id = "dep_initialize"; page_size = sysconf(_SC_PAGESIZE); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) closedir(pdir); } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int local_getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int local_gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a timestruc_t pointer. * Returns unsigned long time in seconds. */ #define tv(val) (ulong)((val).tv_sec) static int injob(pjob, sid) job *pjob; pid_t sid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds. * The "real" time is adjusted by "cputfactor" */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; ulong cputime, addtime; int i; int nps = 0; psinfo_t *pi; cputime = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; nps++; if (pi->pr_nlwp == 0) /* zombie */ { cputime += tv(pi->pr_time); DBPRT(("%s: ses %ld pid %ld (zombie) cputime %ld\n", id, pi->pr_sid, pi->pr_pid, cputime)) continue; } pi = &proc_info[i]; addtime = tv(pi->pr_time) + tv(pi->pr_ctime); cputime += addtime; DBPRT(("%s: ses %ld pid %ld cputime %ld\n", id, pi->pr_sid, pi->pr_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage * adjusted by cputfactor. */ static int overcput_proc(job *pjob, unsigned long limit) { char *id = "overcput_proc"; ulong cputime; int i; psinfo_t *pi; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; cputime = (ulong)(cputfactor * (double)( tv(pi->pr_time) + tv(pi->pr_ctime))); if (cputime > limit) return (TRUE); } return (FALSE); } /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the session. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; ulong memsize; int i; psinfo_t *pi; memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; memsize += pi->pr_size * 1024; DBPRT(("mem_sum: pid: %ld pr_size: %d total: %ld\n", pi->pr_pid, pi->pr_size * 1024, memsize)) } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; ulong resisize; int i; psinfo_t *pi; resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; resisize += pi->pr_rssize * 1024; } return (resisize); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) /* cpu time - check */ { if (igncput == FALSE) { retval = local_gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = local_gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = local_getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > LONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "mem") == 0) /* check */ { if (ignmem == FALSE) { retval = local_getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = local_getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > LONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_DATA, &reslim) < 0) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if (setrlimit(RLIMIT_STACK, &reslim) < 0) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = local_getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { retval = local_getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > LONG_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = local_gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given,set sys limit of lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_VMEM, &reslim) < 0)) return (error("RLIMIT_VMEM", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) proc_info = (psinfo_t *)malloc(sizeof(psinfo_t) * TBL_INC); if (proc_info == NULL) { log_err(errno, id, "malloc"); return (PBSE_SYSTEM); } max_proc = TBL_INC; return (PBSE_NONE); } /* * Declare start of polling loop. */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; int fd; struct dirent *dent; char procname[256]; psinfo_t *pi; DBPRT(("%s: entered\n", id)) rewinddir(pdir); pi = proc_info; nproc = 0; for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (read(fd, pi, sizeof(psinfo_t)) != sizeof(psinfo_t)) { sprintf(log_buffer, "read of %s failed", procname); log_err(errno, id, log_buffer); continue; } if (++nproc == max_proc) { void *hold; DBPRT(("%s: alloc more proc table space %d\n", id, nproc)) max_proc += TBL_INC; hold = realloc((void *)proc_info, max_proc * sizeof(psinfo_t)); assert(hold != NULL); proc_info = (psinfo_t *)hold; } pi = &proc_info[nproc]; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = local_gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = local_gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcput_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = local_getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = local_gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %ld exceeded limit %ld", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; DBPRT(("%s for job %s\n", id, pjob->ji_qs.ji_jobid)) assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * bld_ptree - establish links (parent, child, and sibling) for processes * in a given session. * * The PBS_PROC_* macros are defined in resmom/.../mom_mach.h * to refer to the correct machine dependent table. */ static int bld_ptree(sid) pid_t sid; { int i, j; if (Proc_lnks == NULL) { Proc_lnks = (pbs_plinks *)malloc(TBL_INC * sizeof(pbs_plinks)); assert(Proc_lnks != NULL); myproc_max = TBL_INC; } /* * Build links for processes in the session in question. * First, load with the processes in the session. */ myproc_ct = 0; for (i = 0; i < nproc; i++) { if ((int)PBS_PROC_SID(i) == sid) { Proc_lnks[myproc_ct].pl_pid = PBS_PROC_PID(i); Proc_lnks[myproc_ct].pl_ppid = PBS_PROC_PPID(i); Proc_lnks[myproc_ct].pl_parent = -1; Proc_lnks[myproc_ct].pl_sib = -1; Proc_lnks[myproc_ct].pl_child = -1; if (++myproc_ct == myproc_max) { void * hold; myproc_max += TBL_INC; hold = realloc((void *)Proc_lnks, myproc_max * sizeof(pbs_plinks)); assert(hold != NULL); Proc_lnks = (pbs_plinks *)hold; } } } /* Now build the tree for those processes */ for (i = 0; i < myproc_ct; i++) { /* * Find all the children for this process, establish links. */ for (j = 0; j < myproc_ct; j++) { if (j == i) continue; if (Proc_lnks[j].pl_ppid == Proc_lnks[i].pl_pid) { Proc_lnks[j].pl_parent = i; Proc_lnks[j].pl_sib = Proc_lnks[i].pl_child; Proc_lnks[i].pl_child = j; } } } return (myproc_ct); /* number of processes in session */ } /* * pid_to_idx - find index into the Proc_lnks table for a given pid * pid: pid * return: index to the table for pid */ static int pid_to_idx(pid) pid_t pid; { int i; for (i = 0; i < myproc_ct; i++) { if (Proc_lnks[i].pl_pid == pid) return (i); } return (-1); } /* * kill_ptree - traverse the process tree, killing the processes as we go * idx: current pid index * flag: traverse order, top down (1) or bottom up (0) * sig: the signal to send */ static void kill_ptree(int idx, int flag, int sig) { int child, sib; if (flag) /* top down */ { (void)kill(Proc_lnks[idx].pl_pid, sig); } child = Proc_lnks[idx].pl_child; while (child != -1) { kill_ptree(child, flag, sig); child = Proc_lnks[child].pl_sib; } if (!flag) /* bottom up */ { (void)kill(Proc_lnks[idx].pl_pid, sig); } } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int i, sesid; psinfo_t *pi; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; (void)mom_get_sample(); for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (sesid == pi->pr_sid) { (void)kill(pi->pr_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) if (proc_info) free(proc_info); if (pdir) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; static char id[] = "getprocs"; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; psinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; addtime = (double)(tv(pi->pr_time) + tv(pi->pr_ctime)); cputime += addtime; DBPRT(("%s: total %.2f pid %ld %.2f\n", id, cputime, pi->pr_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; double cputime; int i; psinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } cputime = (double)(tv(pi->pr_time) + tv(pi->pr_ctime)); sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; size_t memsize; int i; int found = 0; psinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; memsize += pi->pr_size; DBPRT(("%s: total %dkb pid %ld %dkb\n", id, memsize, pi->pr_pid, pi->pr_size)) } if (found) { sprintf(ret_string, "%dkb", memsize); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; psinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", pi->pr_size); /* KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int resisize; int i; int found = 0; psinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; resisize += pi->pr_rssize; } if (found) { sprintf(ret_string, "%ukb", resisize); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; psinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", pi->pr_rssize); /* KB */ return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; psinfo_t *pi; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of job */ for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_uid == 0) continue; if ((jobid = pi->pr_sid) == 0) continue; DBPRT(("%s[%d]: pid %ld sid %ld\n", id, njids, pi->pr_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i, j; psinfo_t *pi; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; num_pids = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; DBPRT(("%s[%d]: pid: %ld sid %ld\n", id, num_pids, pi->pr_pid, pi->pr_sid)) if (jobid != pi->pr_sid) continue; sprintf(fmt, "%ld ", pi->pr_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; psinfo_t *pi; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if ((uid = pi->pr_uid) == 0) continue; DBPRT(("%s[%d]: pid %ld uid %ld\n", id, nuids, pi->pr_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ld", sysconf(_SC_NPROCESSORS_ONLN)); system_ncpus = sysconf(_SC_NPROCESSORS_ONLN); return ret_string; } static char *physmem( struct rm_attribute *attrib) { char *id = "physmem"; unsigned long long pmem; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } pmem = (unsigned long long)sysconf(_SC_PHYS_PAGES) * page_size; sprintf(ret_string, "%llukb", pmem >> 10); /* KB */ return(ret_string); } /* END physmem() */ char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statvfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statvfs(param, &fsbuf) == -1) { log_err(errno, id, "statvfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_frsize * (double)fsbuf.f_bfree) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%lukb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev/pts")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { char *name = de->d_name; if (maxtm >= curtm) break; if (*name == '.') continue; sprintf(ttyname, "/dev/pts/%s", name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ld", (long)MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; int i; int value, job, found = 0; time_t now, start; psinfo_t *pi; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (job) { if (value != pi->pr_sid) continue; } else { if ((pid_t)value != pi->pr_pid) continue; } found = 1; start = MIN(start, pi->pr_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; double la[3]; if (getloadavg(la, 3) == -1) { log_err(errno, id, "getloadavg"); return (rm_errno = RM_ERR_SYSTEM); } *rv = la[0]; return 0; } static char * platform(struct rm_attribute *attrib) { char *id = "platform"; int err; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } err = sysinfo(SI_PLATFORM, ret_string, ret_size - 1); if (err < 0) { return "unknown [error]"; } else { return ret_string; } } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/solaris7/Makefile.am0000664000113300011330000000030611272401244015720 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/irix6/0000777000113300011330000000000011614035173013251 500000000000000torque-2.4.16/src/resmom/irix6/mom_start.c0000664000113300011330000002674111272401244015346 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ static PROJ sgiprojtoken; /* * open_sgi_proj() - open access to project files for use by set_sgi_proj() */ int open_sgi_proj(void) { sgiprojtoken = openproj(NULL, NULL); if (sgiprojtoken == NULL) { LOG_EVENT(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, "open_sgi_proj", "could not open project id files"); return -1; } else { return 0; } } /* * set_sgi_proj - set SGI project id for job/task * * As a side effect, the access to the project files is closed. */ int set_sgi_proj( char *usern, /* the user name */ attribute *acct /* the account attribute or NULL */ ) { prid_t prid; if ((acct == 0) || ((acct->at_flags & ATR_VFLAG_SET) == 0)) { /* use default projid for user */ prid = fgetdfltprojuser(sgiprojtoken, usern); } else { /* use Account as project name, if valid --- convert to id */ prid = fvalidateproj(sgiprojtoken, usern, acct->at_val.at_str); } if ((prid == -1) || (setprid(prid) == -1)) return -1; closeproj(sgiprojtoken); return 0; } /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Irix6 has ASH but can't join an existing one. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; char cvtbuf[20]; if (newarraysess() == -1) { sprintf(log_buffer, "newarraysess failed %d", errno); return (-2); } sjr->sj_ash = getash(); if (set_sgi_proj(pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str, &pjob->ji_wattr[(int)JOB_ATR_account]) < 0) { (void)sprintf(log_buffer, "Invalid project id"); return (-2); } return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. ** Just use "none" since everybody has a different ASH. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars(job *pjob, struct var_table *vtab) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_RUNNING) mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } /* ** We found task within the job which has exited. */ DBPRT(("%s: task %ld pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "task %ld terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ int open_master( char **rtn_name /* RETURN name of slave pts */ ) { int fds; *rtn_name = _getpty(&fds, O_RDWR | O_NOCTTY, 0600, 1); if (*rtn_name == (char *)0) return (-1); else return (fds); } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/irix6/mom_mach.h0000664000113300011330000001246511272401244015124 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: sgi */ #ifndef MOM_MACH #define MOM_MACH "irix6" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ ash_t sj_ash; /* Irix 6.x Array Session Handle */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/irix6/Makefile.in0000664000113300011330000004376711605403753015260 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/irix6 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/irix6/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/irix6/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/irix6/pe_input.c0000664000113300011330000001062611272401244015157 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For irix - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/irix6/mom_mach.c0000664000113300011330000016646311272401244015127 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #define SGI_ZOMBIE_WRONG 1 #define COMPLEX_MEM_CALC 0 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if MOM_CHECKPOINT == 1 #include #endif /* MOM_CHECKPOINT */ #if NODEMASK != 0 #include #include #include #endif /* NODEMASK */ #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a Silicon Graphics (SGI) machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information (sizes in KB) */ static char ident[] = "@(#) sgi/$RCSfile$ $Revision: 3151 $"; #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #if COMPLEX_MEM_CALC==1 static char procfs[] = "/proc"; static char procfmts[] = "/proc/%s"; #else static char procfs[] = "/proc/pinfo"; static char procfmts[] = "/proc/pinfo/%s"; #endif /* COMPLEX_MEM_CALC */ static DIR *pdir = NULL; static int pagesize; static int kfd = -1; #define TBL_INC 200 /* initial proc table */ #define MAPNUM 512 /* max number of mem segs */ static int nproc = 0; static int max_proc = 0; struct proc_info /* structure used to hold proc info */ { prpsinfo_t info; #if COMPLEX_MEM_CALC==1 int map_num; prmap_sgi_t *map; #endif /* COMPLEX_MEM_CALC */ }; static struct proc_info *proc_array = NULL; static time_t sampletime; extern char *ret_string; time_t wait_time = 10; extern char extra_parm[]; extern char no_parm[]; extern time_t time_now; extern time_t last_scan; /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { NULL, {nullproc} }, }; off_t kern_addr[] = { -1, /* KSYM_PHYS */ -1, /* KSYM_LOAD */ }; #define KSYM_PHYS 0 #define KSYM_LOAD 1 void dep_initialize(void) { int i; char *id = "dep_initialize"; static char mem[] = "/dev/kmem"; pagesize = getpagesize(); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } kern_addr[KSYM_PHYS] = SEEKLIMIT & sysmp(MP_KERNADDR, MPKA_PHYSMEM); kern_addr[KSYM_LOAD] = SEEKLIMIT & sysmp(MP_KERNADDR, MPKA_AVENRUN); if ((kfd = open(mem, O_RDONLY)) == -1) { log_err(errno, id, mem); return; } /* insure /dev/kmem closed on exec */ if ((i = fcntl(kfd, F_GETFD)) == -1) { log_err(errno, id, "F_GETFD"); } i |= FD_CLOEXEC; if (fcntl(kfd, F_SETFD, i) == -1) { log_err(errno, id, "F_SETFD"); } return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) { closedir(pdir); pdir = NULL; } if (kfd != -1) close(kfd); } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* Don't need any periodic procsessing. */ } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned 64 bit integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(pres, ret) resource *pres; rlim64_t *ret; { rlim64_t value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { value *= sizeof(int); } *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int getlong(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a timestruc_t pointer. Returns unsigned long * time in seconds, rounded. */ #define tv(val) (ulong)((val).tv_sec + ((val).tv_nsec + 500000000)/1000000000) /* ** Scan a list of tasks and return true if one of them matches ** the process (sid or pid) represented by *psp. */ static int injob(tlist_head *phead, prpsinfo_t *psp) { task *ptask; pid_t key; key = (psp->pr_sid == 0) ? psp->pr_pid : psp->pr_sid; for (ptask = (task *)GET_NEXT(*phead); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == key) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_ses"; int i; ulong cputime; int nps = 0; tlist_head *phead; ulong proctime; prpsinfo_t *pi; phead = &pjob->ji_tasks; cputime = 0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(phead, pi)) continue; nps++; proctime = tv(pi->pr_time) + tv(pi->pr_ctime); cputime += proctime; DBPRT(("%s: ses %d pid %d pcput %lu cputime %lu\n", id, pi->pr_sid, pi->pr_pid, proctime, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcpu_proc(tlist_head *phead, unsigned long limit) { ulong cputime; int i; prpsinfo_t *pi; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(phead, pi)) continue; cputime = tv(pi->pr_time) + tv(pi->pr_ctime); if ((ulong)((double)cputime * cputfactor) > limit) return (TRUE); } return (FALSE); } /* * Internal session memory usage function. * * Returns the total number of bytes of address space (virtual mem) * consumed by all current tasks within the list of tasks. */ static rlim64_t mem_sum(phead) tlist_head *phead; { static char id[] = "mem_sum"; int i; rlim64_t segadd; prpsinfo_t *pi; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) segadd = 0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(phead, pi)) continue; DBPRT(("%s: %s(%d:%d) mem %llu\n", id, pi->pr_fname, pi->pr_sid, pi->pr_pid, (rlim64_t)((rlim64_t)pi->pr_size * (rlim64_t)pagesize))) segadd += (rlim64_t)((rlim64_t)pi->pr_size * (rlim64_t)pagesize); } DBPRT(("%s: total mem %llu\n\n", id, segadd)) return (segadd); } #if COMPLEX_MEM_CALC==1 /* * Internal session mem (workingset) size function. COMPLEX CALC VERSION * * Returns in a 64 bit intege the number of bytes used by session */ static rlim64_t resi_sum(phead) tlist_head *phead; { static char id[] = "resi_sum"; rlim64_t resisize, resisub; int num, i, j; prpsinfo_t *pi; prmap_sgi_t *mp; u_long lastseg, nbps; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) resisize = 0; lastseg = 99999; nbps = (pagesize / sizeof(uint_t)) * pagesize; /* sysmacros.h says "4Meg" ...hmmm */ for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(phead, pi)) continue; DBPRT(("%s: %s(%d:%d) rss %llu\n", id, pi->pr_fname, pi->pr_sid, pi->pr_pid, (rlim64_t)((rlim64_t)pi->pr_rssize * (rlim64_t)pagesize))) resisub = 0; num = proc_array[i].map_num; mp = proc_array[i].map; for (j = 0; j < num; j++, mp++) { u_long cnt = mp->pr_mflags >> MA_REFCNT_SHIFT; u_long end = (u_long)mp->pr_vaddr + mp->pr_size - 1; u_long seg1 = (u_long)mp->pr_vaddr / nbps; u_long seg2 = end / nbps; rlim64_t numseg = seg2 - seg1; if (lastseg != seg2) numseg++; lastseg = seg2; numseg = numseg * pagesize / cnt; numseg += mp->pr_wsize * pagesize / MA_WSIZE_FRAC / cnt; resisub += numseg; DBPRT(("%s: %d\t%lluk\t%lluk\n", id, j, numseg / 1024, resisub / 1024)) } resisize += resisub; DBPRT(("%s: %s subtotal rss %llu\n", id, pi->pr_fname, resisub)) } DBPRT(("%s: total rss %llu\n\n", id, resisize)) return (resisize); } #else /* COMPLEX_MEM_CALC == 0 */ /* * Internal session mem (workingset) size function. SIMPLE CALC VERSION * * Returns in a 64 bit intege the number of bytes used by session */ static rlim64_t resi_sum(phead) tlist_head *phead; { static char id[] = "resi_sum"; int i; rlim64_t resisize, resisub; prpsinfo_t *pi; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(phead, pi)) continue; DBPRT(("%s: %s(%d:%d) rss %llu\n", id, pi->pr_fname, pi->pr_sid, pi->pr_pid, (rlim64_t)((rlim64_t)pi->pr_rssize * (rlim64_t)pagesize))) resisize += (rlim64_t)((rlim64_t)pagesize * pi->pr_rssize); } DBPRT(("%s: total rss %llu\n\n", id, resisize)) return (resisize); } #endif /* COMPLEX_MEM_CALC */ /* * Return TRUE if any process in the session is over limit for Vir memory usage. */ static int overmem_proc(phead, limit) tlist_head *phead; rlim64_t limit; { ulong memsize; int i; prpsinfo_t *pi; memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (!injob(phead, pi)) continue; if ((rlim64_t)((rlim64_t)pagesize * pi->pr_size) > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; rlim64_t sizeval; /* place to build 64 bit value */ unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit64 res64lim; rlim64_t mem_limit = 0; #if NODEMASK != 0 __uint64_t rvalue; __uint64_t nodemask; #endif /* NODEMASK */ log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "ncpus") == 0) { char hold[16]; extern struct var_table vtable; retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); sprintf(hold, "%d", (int)pres->rs_value.at_val.at_long); bld_env_variables(&vtable, "NCPUS", hold); } else if (strcmp(pname, "cput") == 0) /* check */ { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); res64lim.rlim_cur = res64lim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit64(RLIMIT_CPU, &res64lim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); res64lim.rlim_cur = res64lim.rlim_max = sizeval; if (setrlimit64(RLIMIT_FSIZE, &res64lim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (sizeval < mem_limit)) mem_limit = sizeval; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (sizeval < mem_limit)) mem_limit = sizeval; } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) return (error(pname, retval)); res64lim.rlim_cur = res64lim.rlim_max = sizeval; if (setrlimit64(RLIMIT_RSS, &res64lim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } #if NODEMASK != 0 } else if (strcmp(pname, "nodemask") == 0) /* set nodemask */ { /* call special node mask function */ nodemask = pres->rs_value.at_val.at_ll; rvalue = (__uint64_t)pmoctl(61, nodemask, 0); if (rvalue != nodemask) { (void)sprintf(log_buffer, "Tried to set node mask to 0x%0llx, was set to 0x%0llx", nodemask, rvalue); LOG_EVENT(PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } #endif /* NODEMASK */ } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { res64lim.rlim_cur = res64lim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit64(RLIMIT_VMEM, &res64lim) < 0)) return (error("RLIMIT_VMEM", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "ncpus") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. * Also open sgi project files. */ int mom_open_poll(void) { char *id = "mom_open_poll"; extern int open_sgi_proj(); DBPRT(("%s: entered\n", id)) pagesize = getpagesize(); proc_array = (struct proc_info *)calloc(TBL_INC, sizeof(struct proc_info)); if (proc_array == NULL) { log_err(errno, id, "malloc"); return (PBSE_SYSTEM); } max_proc = TBL_INC; return (open_sgi_proj()); } /* * Declare start of polling loop. */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; int fd; struct dirent *dent; char procname[100]; int num; int mapsize; time_t currtime; prmap_sgi_arg_t maparg; struct proc_info *pi; prmap_sgi_t map[MAPNUM]; DBPRT(("%s: entered pagesize %d\n", id, pagesize)) rewinddir(pdir); nproc = 0; pi = proc_array; mapsize = sizeof(prmap_sgi_t) * MAPNUM; maparg.pr_size = mapsize; currtime = time(0); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi->info) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); } continue; } #if COMPLEX_MEM_CALC==1 if (pi->map) { free(pi->map); /* free any old space */ pi->map = NULL; } pi->map_num = 0; maparg.pr_vaddr = (caddr_t)map; if ((num = ioctl(fd, PIOCMAP_SGI, &maparg)) == -1) { if (errno != ENOENT) log_err(errno, id, "ioctl(PIOCMAP_SGI)"); continue; } if (num > 0) { size_t nb = sizeof(prmap_sgi_t) * num; assert(num < MAPNUM); pi->map = (prmap_sgi_t *) malloc(nb); memcpy(pi->map, map, nb); pi->map_num = num; } #endif /* COMPLEX_MEM_CALC */ if (++nproc == max_proc) { struct proc_info *hold; DBPRT(("%s: alloc more table space %d\n", id, nproc)) max_proc *= 2; hold = (struct proc_info *)realloc(proc_array, max_proc * sizeof(struct proc_info)); assert(hold != NULL); proc_array = hold; memset(&proc_array[nproc], '\0', sizeof(struct proc_info) * (max_proc >> 1)); } pi = &proc_array[nproc]; } sampletime = time(0); if ((sampletime - currtime) > 5) { sprintf(log_buffer, "time lag %ld secs", (long)(sampletime - currtime)); log_err(-1, id, log_buffer); return PBSE_SYSTEM; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *pname; int retval; rlim64_t sizeval; unsigned long value, num; rlim64_t num64; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "ncpus") == 0) { attribute *at; resource_def *rd; resource *prescpup; retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); rd = find_resc_def(svr_resc_def, "cpupercent", svr_resc_size); assert(rd != NULL); prescpup = find_resc_entry(at, rd); assert(prescpup != NULL); num = prescpup->rs_value.at_val.at_long; if (num > (value*100 + 10)) { sprintf(log_buffer, "ncpus %.2f exceeded limit %lu", (float)num / 100.0, value); #if !defined(SGI_ZOMBIE_WRONG) return (TRUE); #else LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); #endif /* SGI_ZOMBIE_WRONG */ } } else if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == (FALSE)) && (strcmp(pname, "pcput") == 0)) { retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; if (overcpu_proc(&pjob->ji_tasks, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num64 = mem_sum(&pjob->ji_tasks)) > sizeval)) { sprintf(log_buffer, "vmem %llu exceeded limit %llu", num64, sizeval); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &sizeval); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(&pjob->ji_tasks, sizeval))) { sprintf(log_buffer, "pvmem exceeded limit %llukb", sizeval); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %ld exceeded limit %lu", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. */ int mom_set_use(job *pjob) { resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum, newcpu, oldcpu; long dur; unsigned long percent; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "cpupercent", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; oldcpu = *lp; lnum = cput_sum(pjob); if (lnum > *lp) { *lp = lnum; if ((dur = sampletime - pjob->ji_sampletim) > 10) { newcpu = *lp; rd = find_resc_def(svr_resc_def, "cpupercent", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; percent = (newcpu - oldcpu) * 100 / dur; *lp = MAX(*lp, percent); DBPRT(("cpu %% : ses %ld (new %lu - old %lu)/delta %ld = %lu%%\n", pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long, newcpu, oldcpu, dur, percent)) } pjob->ji_sampletim = sampletime; } rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(&pjob->ji_tasks) + 1023) >> 10; /* as KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(&pjob->ji_tasks) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int fd; char procname[100]; struct dirent *dent; prpsinfo_t pi; int sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; rewinddir(pdir); for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, &pi) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); } continue; } if (sesid == pi.pr_sid) { (void)kill(pi.pr_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. */ int mom_close_poll(void) { char *id = "mom_close_poll"; int i; DBPRT(("%s: entered\n", id)) if (proc_array) { #if COMPLEX_MEM_CALC==1 for (i = 0; i < max_proc; i++) { struct proc_info *pi = &proc_array[i]; if (pi->map) free(pi->map); } #endif /* COMPLEX_MEM_CALC */ free(proc_array); } if (pdir) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { #if MOM_CHECKPOINT == 1 return (CST_MACH_DEP); #else /* MOM_CHECKPOINT */ return (CST_NONE); #endif /* MOM_CHECKPOINT */ } /* * Checkpoint the task. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { #if MOM_CHECKPOINT == 1 /* ckpt_setup(0, 0); Does nothing so why have it */ if (abort) cpr_flags = CKPT_CHECKPOINT_KILL | CKPT_NQE; else cpr_flags = CKPT_CHECKPOINT_CONT | CKPT_NQE; /* return ( ckpt_create(file, ptask->ti_qs.ti_u.ti_ash, P_ASH, 0, 0) ); */ return (ckpt_create(file, ptask->ti_qs.ti_sid, P_SID, 0, 0)); #else /* MOM_CHECKPOINT */ return (-1); #endif /* MOM_CHECKPOINT */ } /* * Restart the task from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { #if MOM_CHECKPOINT == 1 ckpt_id_t rc; cpr_flags = CKPT_NQE; /* KLUDGE to work-around SGI problem, for some reason ckpt_restart() */ /* passes open file descriptor to /proc to restarted process */ if (pdir) closedir(pdir); rc = ckpt_restart(file, (struct ckpt_args **)0, 0); /* KLUDGE TO work-around SGI problem, ckpt_restart sets the uid of */ /* the calling process (me) to that of the restarted process */ (void)setuid(0); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, "mach_restart", "opendir"); } return ((int)rc); #else /* MOM_CHECKPOINT */ return (-1); #endif /* MOM_CHECKPOINT */ } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } #define dsecs(val) ( (double)(val).tv_sec + ((double)(val).tv_nsec * 1.0e-9) ) char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (jobid != pi->pr_sid) continue; found = 1; addtime = dsecs(pi->pr_time) + dsecs(pi->pr_ctime); cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, pi->pr_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = PBSE_RMEXIST; return NULL; } char * cput_proc(pid) pid_t pid; { double cputime; int i; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (pid == pi->pr_pid) break; } if (i == nproc) { rm_errno = PBSE_RMEXIST; return NULL; } cputime = dsecs(pi->pr_time) + dsecs(pi->pr_ctime); sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = PBSE_RMBADPARAM; return NULL; } } /* * mem_job() - return memory in KB used by job as a numerical string */ char * mem_job(sid) pid_t sid; { rlim64_t memsize; static tlist_head taskhead; static task onetask; static int first = 1; if (first) { CLEAR_HEAD(taskhead); CLEAR_LINK(onetask.ti_jobtask); append_link(&taskhead, &onetask.ti_jobtask, &onetask); first = 0; } if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } onetask.ti_qs.ti_sid = sid; memsize = mem_sum(&taskhead); if (memsize == 0) { rm_errno = PBSE_RMEXIST; return NULL; } else { sprintf(ret_string, "%llukb", memsize >> 10); /* in KB */ return ret_string; } } char * mem_proc(pid) pid_t pid; { prpsinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (pid == pi->pr_pid) break; } if (i == nproc) { rm_errno = PBSE_RMEXIST; return NULL; } sprintf(ret_string, "%llukb", ((rlim64_t)pi->pr_size * (rlim64_t)pagesize) >> 10); /* in KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = PBSE_RMBADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { rlim64_t memsize; static tlist_head taskhead; static task onetask; static int first = 1; if (first) { CLEAR_HEAD(taskhead); CLEAR_LINK(onetask.ti_jobtask); append_link(&taskhead, &onetask.ti_jobtask, &onetask); first = 0; } if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } onetask.ti_qs.ti_sid = jobid; memsize = resi_sum(&taskhead); sprintf(ret_string, "%llukb", memsize >> 10); /* in KB */ return ret_string; } static char * resi_proc(pid) pid_t pid; { prpsinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (pid == pi->pr_pid) break; } if (i == nproc) { rm_errno = PBSE_RMEXIST; return NULL; } sprintf(ret_string, "%llukb", ((rlim64_t)pi->pr_rssize * pagesize) >> 10); return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = PBSE_RMBADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; prpsinfo_t *pi; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = PBSE_RMSYSTEM; return NULL; } /* ** Search for members of session */ for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (pi->pr_uid == 0) continue; if ((jobid = pi->pr_sid) == 0) continue; DBPRT(("%s[%d]: pid %d sid %d\n", id, njids, pi->pr_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = PBSE_RMSYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; prpsinfo_t *pi; int i; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = PBSE_RMBADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; num_pids = 0; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; DBPRT(("%s[%d]: pid: %d sid %d\n", id, num_pids, pi->pr_pid, pi->pr_sid)) if (jobid != pi->pr_sid) continue; sprintf(fmt, "%d ", pi->pr_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = PBSE_RMEXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; prpsinfo_t *pi; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = PBSE_RMSYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if ((uid = pi->pr_uid) == 0) continue; DBPRT(("%s[%d]: pid %d uid %d\n", id, nuids, pi->pr_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = PBSE_RMSYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } /* * totmem() - return amount of total memory on system in KB as numeric string */ static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = PBSE_RMSYSTEM; return NULL; } DBPRT(("%s: bsize=%ld blocks=%lu\n", id, fsbuf.f_bsize, fsbuf.f_blocks)) sprintf(ret_string, "%llukb", ((rlim64_t)fsbuf.f_bsize * (rlim64_t)fsbuf.f_blocks) >> 10); return ret_string; } /* * availmem() - return amount of available memory in system in KB as string */ static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = PBSE_RMSYSTEM; return NULL; } DBPRT(("%s: bsize=%ld bfree=%ld\n", id, fsbuf.f_bsize, fsbuf.f_bfree)) sprintf(ret_string, "%llukb", ((rlim64_t)fsbuf.f_bsize * (rlim64_t)fsbuf.f_bfree) >> 10); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } sprintf(ret_string, "%ld", sysmp(MP_NAPROCS)); system_ncpus = sysmp(MP_NAPROCS); return ret_string; } /* * physmem() - return amount of physical memory in system in KB as string */ static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; unsigned int pmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (lseek(kfd, (off_t)kern_addr[KSYM_PHYS], SEEK_SET) == -1) { sprintf(log_buffer, "lseek to 0x%llx", kern_addr[KSYM_PHYS]); log_err(errno, id, log_buffer); rm_errno = PBSE_RMSYSTEM; return NULL; } if (read(kfd, (char *)&pmem, sizeof(pmem)) != sizeof(pmem)) { log_err(errno, id, "read"); rm_errno = PBSE_RMSYSTEM; return NULL; } sprintf(ret_string, "%llukb", ((rlim64_t)pmem*(rlim64_t)pagesize) >> 10); return ret_string; } /* * size_fs() - return file system size in Kb as string */ char * size_fs(char *param) { char *id = "size_fs"; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (statfs(param, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = PBSE_RMBADPARAM; return NULL; } sprintf(ret_string, "%llukb", ((rlim64_t)fsbuf.f_bsize * (rlim64_t)fsbuf.f_bfree) >> 10); return ret_string; } /* * size_file() - return file size in Kb as string */ char * size_file(char *param) { char *id = "size_file"; struct stat64 sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (stat64(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = PBSE_RMBADPARAM; return NULL; } sprintf(ret_string, "%llukb", (sbuf.st_size + 512) >> 10); return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = PBSE_RMBADPARAM; return NULL; } } time_t maxtm; static void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = PBSE_RMSYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; int value, job, found = 0; int i; time_t now, start; prpsinfo_t *pi; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = PBSE_RMBADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = PBSE_RMBADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = PBSE_RMSYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = PBSE_RMSYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { pi = &proc_array[i].info; if (job) { if (value != pi->pr_sid) continue; } else { if ((pid_t)value != pi->pr_pid) continue; } found = 1; start = MIN(start, pi->pr_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = PBSE_RMEXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; int load; /* 4 byte data item */ if (lseek(kfd, (off_t)kern_addr[KSYM_LOAD], SEEK_SET) == -1) { sprintf(log_buffer, "lseek to 0x%llx", kern_addr[KSYM_LOAD]); log_err(errno, id, log_buffer); return (rm_errno = PBSE_RMSYSTEM); } if (read(kfd, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "read"); return (rm_errno = PBSE_RMSYSTEM); } /* ** SGI does not have FSCALE like the SUN so the 1024 ** divisor was found by experment compairing the result ** of this routine to uptime. */ sprintf(ret_string, "%.2f", (double)load / 1024.0); *rv = (double)load / 1024.0; return 0; } u_long gracetime(u_long secs) { time_t now = time((time_t *)NULL); if (secs > now) /* time is in the future */ return (secs - now); else return 0; } static char * quota(struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct mntent *me; struct dqblk qi; FILE *m; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = PBSE_RMEXIST; return NULL; } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if ((m = setmntent(MOUNTED, "r")) == NULL) { log_err(errno, id, "setmntent"); rm_errno = PBSE_RMSYSTEM; return NULL; } while ((me = getmntent(m)) != NULL) { if (strcmp(me->mnt_type, MNTTYPE_IGNORE) == 0) continue; if (stat(me->mnt_dir, &sb) == -1) { sprintf(log_buffer, "stat: %s", me->mnt_dir); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", me->mnt_fsname, me->mnt_dir, sb.st_dev)) if (sb.st_dev == dirdev) break; } endmntent(m); if (me == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMEXIST; return NULL; } if (hasmntopt(me, MNTOPT_QUOTA) == NULL) { sprintf(log_buffer, "no quotas on filesystem %s", me->mnt_dir); log_err(-1, id, log_buffer); rm_errno = PBSE_RMEXIST; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = PBSE_RMNOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMBADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = PBSE_RMEXIST; return NULL; } uid = pw->pw_uid; } if (quotactl(Q_GETQUOTA, me->mnt_fsname, uid, (caddr_t)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = PBSE_RMSYSTEM; return NULL; } /* all size values are in KB */ switch (type) { case harddata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_bhardlimit) >> 10); break; case softdata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_bsoftlimit) >> 10); break; case currdata: sprintf(ret_string, "%ukb", BBTOB(qi.dqb_curblocks) >> 10); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_fhardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_fsoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curfiles); break; case timedata: sprintf(ret_string, "%lu", gracetime((u_long)qi.dqb_btimelimit)); break; case timefile: sprintf(ret_string, "%lu", gracetime((u_long)qi.dqb_ftimelimit)); break; } return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/irix6/Makefile.am0000664000113300011330000000030611272401244015216 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/req_quejob.c0000664000113300011330000006254211605403054014434 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * req_quejob.c * * Functions relating to the Queue Job Batch Request sequence, including * Queue Job, Job Script, Ready to Commit, and Commit. * * Included functions are: * req_quejob() * req_jobcredential() * req_jobscript() * req_rdycommit() * req_commit() */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include "libpbs.h" #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "queue.h" #include "net_connect.h" #include "pbs_error.h" #include "log.h" #include "svrfunc.h" #include #include "mom_func.h" #include "pbs_nodes.h" /* External Functions Called: */ extern int reply_jid A_((char *)); extern void start_exec A_((job *)); extern int svr_authorize_jobreq A_((struct batch_request *, job *)); extern int svr_chkque A_((job *, pbs_queue *, char *, int, char *)); extern int job_route A_((job *)); extern void check_state(int); extern void mom_server_all_update_stat(); /* Global Data Items: */ extern int PBSNodeCheckProlog; extern int internal_state; extern const char *PJobSubState[]; /* sync w/enum job_file TJobFileType[]) */ const char *TJobFileType[] = { "jobscript", "stdin", "stdout", "stderr", "ckpt", NULL }; extern int resc_access_perm; extern tlist_head svr_alljobs; extern tlist_head svr_newjobs; extern attribute_def job_attr_def[]; extern char *path_jobs; extern char *pbs_o_host; extern char *msg_script_open; extern char *msg_script_write; extern char *msg_init_abt; extern char *msg_jobnew; extern time_t time_now; extern int LOGLEVEL; extern char *msg_daemonname; extern int decode_arst_merge(struct attribute *,char *,char *,char *); /* Private Functions in this file */ static job *locate_new_job A_((int, char *)); #ifdef PNOT static int user_account_verify A_((char *, char *)); static char *user_account_default A_((char *)); static int user_account_read_user A_((char *)); #endif /* PNOT */ /* * req_quejob - Queue Job Batch Request processing routine * NOTE: calls svr_chkque() to validate queue access * */ void req_quejob( struct batch_request *preq) /* ptr to the decoded request */ { char *id = "req_quejob"; char basename[PBS_JOBBASE + 1]; int created_here = 0; int index; char *jid; attribute_def *pdef; job *pj; svrattrl *psatl; int rc; int sock = preq->rq_conn; int IsCheckpoint = 0; /* set basic (user) level access permission */ resc_access_perm = ATR_DFLAG_USWR | ATR_DFLAG_Creat; if (PBSNodeCheckProlog) { check_state(1); mom_server_all_update_stat(); if (internal_state & INUSE_DOWN) { req_reject(PBSE_MOMREJECT,0,preq,NULL,NULL); return; } } if (preq->rq_fromsvr) { /* from another server - accept the extra attributes */ resc_access_perm |= ATR_DFLAG_MGWR | ATR_DFLAG_SvWR | ATR_DFLAG_MOM; jid = preq->rq_ind.rq_queuejob.rq_jid; } else { /* request must be from server */ log_err(errno, id, "request not from server"); req_reject(PBSE_IVALREQ, 0, preq, NULL, "request not received from server"); return; } /* does job already exist, check both old and new jobs */ if ((pj = find_job(jid)) == NULL) { pj = (job *)GET_NEXT(svr_newjobs); while (pj != NULL) { if (!strcmp(pj->ji_qs.ji_jobid, jid)) break; pj = (job *)GET_NEXT(pj->ji_alljobs); } } /* * New job ... * * for MOM - rather than make up a hashname, we use the name sent * to us by the server as an attribute. */ psatl = (svrattrl *)GET_NEXT(preq->rq_ind.rq_queuejob.rq_attr); while (psatl != NULL) { if (!strcmp(psatl->al_name,ATTR_hashname)) { strcpy(basename,psatl->al_value); break; } psatl = (svrattrl *)GET_NEXT(psatl->al_link); } if (pj != NULL) { /* newly queued job already exists */ if (pj->ji_qs.ji_substate == JOB_SUBSTATE_RUNNING) { /* FAILURE - job exists and is running */ log_err(errno,id,"cannot queue new job, job exists and is running"); req_reject(PBSE_JOBEXIST,0,preq,NULL,"job is running"); return; } /* if checkpointed, then keep old and skip rest of process */ if (pj->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) { IsCheckpoint = 1; } /* END if (pj->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) */ else { /* unlink job from svr_alljobs since it will be placed on newjobs */ delete_link(&pj->ji_alljobs); } } /* END if (pj != NULL) */ else { /* if not already here, allocate job struct */ if ((pj = job_alloc()) == NULL) { /* FAILURE */ req_reject(PBSE_SYSTEM, 0, preq, NULL, "cannot allocate new job structure"); return; } } /* END else (pj != NULL) */ if (IsCheckpoint == 0) { strcpy(pj->ji_qs.ji_jobid,jid); strcpy(pj->ji_qs.ji_fileprefix,basename); pj->ji_modified = 1; pj->ji_qs.ji_svrflags = created_here; pj->ji_qs.ji_un_type = JOB_UNION_TYPE_NEW; } /* decode attributes from request into job structure */ psatl = (svrattrl *)GET_NEXT(preq->rq_ind.rq_queuejob.rq_attr); while (psatl != NULL) { if (IsCheckpoint == 1) { if (strcmp(psatl->al_name,ATTR_checkpoint_name) && strcmp(psatl->al_name,ATTR_v)) { psatl = (svrattrl *)GET_NEXT(psatl->al_link); continue; } } /* identify the attribute by name */ index = find_attr(job_attr_def,psatl->al_name,JOB_ATR_LAST); if (index < 0) { /* FAILURE */ /* didn`t recognize the name */ job_purge(pj); /* CRI - 12/20/2004 */ reply_badattr(PBSE_NOATTR,1,psatl,preq); return; } pdef = &job_attr_def[index]; /* Is attribute not writeable by manager or by a server? */ if ((pdef->at_flags & resc_access_perm) == 0) { /* FAILURE */ job_purge(pj); reply_badattr(PBSE_ATTRRO,1,psatl,preq); return; } /* decode attribute */ if (!strcmp(psatl->al_name,ATTR_v)) { rc = decode_arst_merge( &pj->ji_wattr[index], psatl->al_name, psatl->al_resc, psatl->al_value); } else { rc = pdef->at_decode( &pj->ji_wattr[index], psatl->al_name, psatl->al_resc, psatl->al_value); } if (rc != 0) { /* FAILURE */ /* all errors are fatal for MOM */ job_purge(pj); reply_badattr(rc,1,psatl,preq); return; } if (psatl->al_op == DFLT) { if (psatl->al_resc) { resource *presc; resource_def *prdef; prdef = find_resc_def(svr_resc_def,psatl->al_resc,svr_resc_size); if (prdef == NULL) { job_purge(pj); reply_badattr(rc,1,psatl, preq); return; } presc = find_resc_entry(&pj->ji_wattr[index],prdef); if (presc != NULL) presc->rs_value.at_flags |= ATR_VFLAG_DEFLT; } else { pj->ji_wattr[index].at_flags |= ATR_VFLAG_DEFLT; } } /* END if (psatl->al_op == DFLT) */ psatl = (svrattrl *)GET_NEXT(psatl->al_link); } /* END while (psatl != NULL) */ if (IsCheckpoint == 1) { pj->ji_qs.ji_substate = JOB_SUBSTATE_TRANSIN; if (reply_jobid(preq,pj->ji_qs.ji_jobid,BATCH_REPLY_CHOICE_Queue) == 0) { delete_link(&pj->ji_alljobs); append_link(&svr_newjobs,&pj->ji_alljobs,pj); pj->ji_qs.ji_un_type = JOB_UNION_TYPE_NEW; pj->ji_qs.ji_un.ji_newt.ji_fromsock = sock; pj->ji_qs.ji_un.ji_newt.ji_fromaddr = get_connectaddr(sock); pj->ji_qs.ji_un.ji_newt.ji_scriptsz = 0; /* Per Eric R., req_mvjobfile was giving error in open_std_file, showed up as fishy error message */ if (pj->ji_grpcache != NULL) { free(pj->ji_grpcache); pj->ji_grpcache = NULL; } } else { close_conn(sock); } /* SUCCESS */ return; } /* set remaining job structure elements */ pj->ji_qs.ji_state = JOB_STATE_TRANSIT; pj->ji_qs.ji_substate = JOB_SUBSTATE_TRANSIN; pj->ji_wattr[(int)JOB_ATR_mtime].at_val.at_long = (long)time_now; pj->ji_wattr[(int)JOB_ATR_mtime].at_flags |= ATR_VFLAG_SET; pj->ji_qs.ji_un_type = JOB_UNION_TYPE_NEW; pj->ji_qs.ji_un.ji_newt.ji_fromsock = sock; pj->ji_qs.ji_un.ji_newt.ji_fromaddr = get_connectaddr(sock); pj->ji_qs.ji_un.ji_newt.ji_scriptsz = 0; /* acknowledge the request with the job id */ if (reply_jobid(preq, pj->ji_qs.ji_jobid, BATCH_REPLY_CHOICE_Queue) != 0) { /* reply failed, purge the job and close the connection */ close_conn(sock); job_purge(pj); return; } /* link job into server's new jobs list request */ append_link(&svr_newjobs, &pj->ji_alljobs, pj); return; } /* END req_quejob() */ /* * req_jobcredential - receive a set of credentials to be used by the job * * THIS IS JUST A PLACE HOLDER FOR NOW * It does nothing but acknowledge the request */ void req_jobcredential( struct batch_request *preq) /* ptr to the decoded request */ { job *pj; pj = locate_new_job(preq->rq_conn, NULL); if (pj == NULL) { req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); return; } reply_ack(preq); return; } /* END req_jobcredential() */ /* * req_jobscript - receive job script section * * Each section is appended to the file */ void req_jobscript( struct batch_request *preq) /* ptr to the decoded request*/ { char *id = "req_jobscript"; int fds; char namebuf[MAXPATHLEN]; job *pj; int filemode = 0700; extern char mom_host[]; errno = 0; pj = locate_new_job(preq->rq_conn, preq->rq_ind.rq_jobfile.rq_jobid); if (pj == NULL) { log_err(errno, id, "cannot locate new job"); req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); return; } /* what is the difference between JOB_SUBSTATE_TRANSIN and TRANSICM? */ if (pj->ji_qs.ji_substate != JOB_SUBSTATE_TRANSIN) { if (errno == 0) { sprintf(log_buffer, "job %s in unexpected state '%s'", pj->ji_qs.ji_jobid, PJobSubState[pj->ji_qs.ji_substate]); } else { sprintf(log_buffer, "job %s in unexpected state '%s' (errno=%d - %s)", pj->ji_qs.ji_jobid, PJobSubState[pj->ji_qs.ji_substate], errno, strerror(errno)); } log_err(errno, id, log_buffer); req_reject(PBSE_IVALREQ, 0, preq, mom_host, log_buffer); return; } /* mom - if job has been checkpointed, discard script,already have it */ if (pj->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) { /* SUCCESS - do nothing, ignore script */ reply_ack(preq); return; } strcpy(namebuf, path_jobs); strcat(namebuf, pj->ji_qs.ji_fileprefix); strcat(namebuf, JOB_SCRIPT_SUFFIX); if (pj->ji_qs.ji_un.ji_newt.ji_scriptsz == 0) { /* NOTE: fail is job script already exists */ fds = open(namebuf, O_WRONLY | O_CREAT | O_EXCL | O_Sync, filemode); } else { fds = open(namebuf, O_WRONLY | O_APPEND | O_Sync, filemode); } if (fds < 0) { char tmpLine[1024]; snprintf(tmpLine, sizeof(tmpLine), "cannot open '%s' errno=%d - %s", namebuf, errno, strerror(errno)); /* FAILURE */ /* NOTE: log_err may modify errno */ log_err(errno, id, msg_script_open); req_reject(PBSE_INTERNAL, 0, preq, mom_host, tmpLine); return; } if (write( fds, preq->rq_ind.rq_jobfile.rq_data, (unsigned)preq->rq_ind.rq_jobfile.rq_size) != preq->rq_ind.rq_jobfile.rq_size) { /* FAILURE */ log_err(errno, id, msg_script_write); req_reject(PBSE_INTERNAL, 0, preq, mom_host, "cannot write job command file"); close(fds); return; } close(fds); pj->ji_qs.ji_un.ji_newt.ji_scriptsz += preq->rq_ind.rq_jobfile.rq_size; /* job has a script file */ pj->ji_qs.ji_svrflags = (pj->ji_qs.ji_svrflags & ~JOB_SVFLG_CHECKPOINT_FILE) | JOB_SVFLG_SCRIPT; /* SUCCESS */ reply_ack(preq); return; } /* END req_jobscript() */ /* * req_mvjobfile - move the specifled job standard files * This is MOM's version. The files are owned by the user and placed * in either the spool area or the user's home directory depending * on the compile option, see std_file_name(). */ void req_mvjobfile( struct batch_request *preq) /* I */ { int fds; enum job_file jft; int oflag; job *pj; struct passwd *pwd; jft = (enum job_file)preq->rq_ind.rq_jobfile.rq_type; if (preq->rq_ind.rq_jobfile.rq_sequence == 0) oflag = O_CREAT | O_WRONLY | O_TRUNC; else oflag = O_CREAT | O_WRONLY | O_APPEND; pj = locate_new_job(preq->rq_conn, NULL); if (pj == NULL) pj = find_job(preq->rq_ind.rq_jobfile.rq_jobid); if (pj == NULL) { snprintf(log_buffer, 1024, "cannot find job %s for move of %s file", preq->rq_ind.rq_jobfile.rq_jobid, TJobFileType[jft]); log_err(-1, "req_mvjobfile", log_buffer); req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); return; } if ((pj->ji_grpcache == NULL) && (check_pwd(pj) == NULL)) { req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); return; } if ((pwd = getpwnam(pj->ji_wattr[(int)JOB_ATR_euser].at_val.at_str)) == NULL) { /* FAILURE */ req_reject(PBSE_MOMREJECT, 0, preq, NULL, "password lookup failed"); return; } if ((fds = open_std_file(pj, jft, oflag, pwd->pw_gid)) < 0) { int keeping = 1; char *path = std_file_name(pj, jft, &keeping); snprintf(log_buffer,sizeof(log_buffer), "Cannot create file %s", path); req_reject(PBSE_SYSTEM, 0, preq, NULL, log_buffer); return; } if (write( fds, preq->rq_ind.rq_jobfile.rq_data, preq->rq_ind.rq_jobfile.rq_size) != preq->rq_ind.rq_jobfile.rq_size) { req_reject(PBSE_SYSTEM, 0, preq, NULL, "cannot create file"); } else { reply_ack(preq); } close(fds); if (LOGLEVEL >= 6) { sprintf(log_buffer, "successfully moved %s file for job '%s'", TJobFileType[jft], preq->rq_ind.rq_jobfile.rq_jobid); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pj != NULL) ? pj->ji_qs.ji_jobid : "NULL", log_buffer); } return; } /* END req_mvjobfile() */ /* * req_rdytocommit - Ready To Commit Batch Request * * Set substate to JOB_SUBSTATE_TRANSICM and * record job to permanent storage, i.e. written to the job save file * (called by both pbs_server and pbs_mom) */ void req_rdytocommit( struct batch_request *preq) /* I */ { job *pj; int sock = preq->rq_conn; int OrigState; int OrigSState; char OrigSChar; long OrigFlags; pj = locate_new_job(sock, preq->rq_ind.rq_rdytocommit); if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pj != NULL) ? pj->ji_qs.ji_jobid : "NULL", "ready to commit job"); } if (pj == NULL) { log_err(errno, "req_rdytocommit", "unknown job id"); req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); /* FAILURE */ return; } if (pj->ji_qs.ji_substate != JOB_SUBSTATE_TRANSIN) { log_err(errno, "req_rdytocommit", "cannot commit job in unexpected state"); req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); /* FAILURE */ return; } OrigState = pj->ji_qs.ji_state; OrigSState = pj->ji_qs.ji_substate; OrigSChar = pj->ji_wattr[(int)JOB_ATR_state].at_val.at_char; OrigFlags = pj->ji_wattr[(int)JOB_ATR_state].at_flags; pj->ji_qs.ji_state = JOB_STATE_TRANSIT; pj->ji_qs.ji_substate = JOB_SUBSTATE_TRANSICM; pj->ji_wattr[(int)JOB_ATR_state].at_val.at_char = 'T'; pj->ji_wattr[(int)JOB_ATR_state].at_flags |= ATR_VFLAG_SET; if (job_save(pj, SAVEJOB_NEW) == -1) { char tmpLine[1024]; sprintf(tmpLine, "cannot save job - errno=%d - %s", errno, strerror(errno)); log_err(errno, "req_rdytocommit", tmpLine); /* commit failed, backoff state changes */ pj->ji_qs.ji_state = OrigState; pj->ji_qs.ji_substate = OrigSState; pj->ji_wattr[(int)JOB_ATR_state].at_val.at_char = OrigSChar; pj->ji_wattr[(int)JOB_ATR_state].at_flags = OrigFlags; req_reject(PBSE_SYSTEM, 0, preq, NULL, tmpLine); /* FAILURE */ return; } /* acknowledge the request with the job id */ if (reply_jobid(preq, pj->ji_qs.ji_jobid, BATCH_REPLY_CHOICE_RdytoCom) != 0) { /* reply failed, purge the job and close the connection */ sprintf(log_buffer, "cannot report jobid - errno=%d - %s", errno, strerror(errno)); log_err(errno, "req_rdytocommit", log_buffer); close_conn(sock); job_purge(pj); /* FAILURE */ return; } if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pj != NULL) ? pj->ji_qs.ji_jobid : "NULL", "ready to commit job completed"); } return; } /* END req_rdytocommit() */ /* * req_commit - commit ownership of job * * Set state of job to JOB_STATE_QUEUED (or Held or Waiting) and * enqueue the job into its destination queue. */ void req_commit( struct batch_request *preq) /* I */ { job *pj; pj = locate_new_job(preq->rq_conn, preq->rq_ind.rq_commit); if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pj != NULL) ? pj->ji_qs.ji_jobid : "NULL", "committing job"); } if (pj == NULL) { req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); return; } if (pj->ji_qs.ji_substate != JOB_SUBSTATE_TRANSICM) { log_err(errno, "req_commit", "cannot commit job in unexpected state"); req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); return; } /* move job from new job list to "all" job list, set to running state */ delete_link(&pj->ji_alljobs); append_link(&svr_alljobs, &pj->ji_alljobs, pj); /* ** Set JOB_SVFLG_HERE to indicate that this is Mother Superior. */ pj->ji_qs.ji_svrflags |= JOB_SVFLG_HERE; pj->ji_qs.ji_state = JOB_STATE_RUNNING; pj->ji_qs.ji_substate = JOB_SUBSTATE_PRERUN; pj->ji_qs.ji_un_type = JOB_UNION_TYPE_MOM; pj->ji_qs.ji_un.ji_momt.ji_svraddr = get_connectaddr(preq->rq_conn); pj->ji_qs.ji_un.ji_momt.ji_exitstat = 0; /* For MOM - start up the job (blocks) */ if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pj != NULL) ? pj->ji_qs.ji_jobid : "NULL", "starting job execution"); } start_exec(pj); if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pj != NULL) ? pj->ji_qs.ji_jobid : "NULL", "job execution started"); } /* if start request fails, reply with failure string */ if (pj->ji_qs.ji_substate == JOB_SUBSTATE_EXITING) { char tmpLine[1024]; if ((pj->ji_hosts != NULL) && (pj->ji_nodekill >= 0) && (pj->ji_hosts[pj->ji_nodekill].hn_host != NULL)) { sprintf(tmpLine, "start failed on node %s", pj->ji_hosts[pj->ji_nodekill].hn_host); } else { sprintf(tmpLine, "start failed on unknown node"); } if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, (pj != NULL) ? pj->ji_qs.ji_jobid : "NULL", tmpLine); } reply_text(preq, 0, tmpLine); } else { reply_jobid(preq, pj->ji_qs.ji_jobid, BATCH_REPLY_CHOICE_Commit); } job_save(pj, SAVEJOB_FULL); /* NOTE: we used to flag JOB_ATR_errpath, JOB_ATR_outpath, * JOB_ATR_session_id, and JOB_ATR_altid as modified at this point to make sure * pbs_server got these attr values. This worked fine before TORQUE modified * job launched into an async process. At 2.0.0p6, a new attribute "SEND" flag * was added to handle this process. */ return; } /* END req_commit() */ /* * locate_new_job - locate a "new" job which has been set up req_quejob on * the servers new job list. * * This function is used by the sub-requests which make up the global * "Queue Job Request" to locate the job structure. * * If the jobid is specified (will be for rdytocommit and commit, but not * for script), we search for a matching jobid. * * The job must (also) match the socket specified and the host associated * with the socket unless ji_fromsock == -1, then its a recovery situation. */ /* FIXME: why bother checking for matching sock if a jobid is supplied? Seems * to me that a reconnect immediately invalidates fromsock. */ static job *locate_new_job( int sock, /* I */ char *jobid) /* I (optional) */ { job *pj; pj = (job *)GET_NEXT(svr_newjobs); while (pj != NULL) { if ((pj->ji_qs.ji_un.ji_newt.ji_fromsock == -1) || ((pj->ji_qs.ji_un.ji_newt.ji_fromsock == sock) && (pj->ji_qs.ji_un.ji_newt.ji_fromaddr == get_connectaddr(sock)))) { if ((jobid != NULL) && (*jobid != '\0')) { if (!strncmp(pj->ji_qs.ji_jobid, jobid, PBS_MAXSVRJOBID)) { /* requested job located */ break; } } else if (pj->ji_qs.ji_un.ji_newt.ji_fromsock == -1) { /* empty job slot located */ break; } else { /* matching job slot located */ break; } } /* END if ((pj->ji_qs.ji_un.ji_newt.ji_fromsock == -1) || ...) */ pj = (job *)GET_NEXT(pj->ji_alljobs); } /* END while(pj != NULL) */ /* return job slot located (NULL on FAILURE) */ return(pj); } /* END locate_new_job() */ /* END req_quejob.c() */ torque-2.4.16/src/resmom/start_exec.c0000664000113300011330000044076111605403053014443 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * * 1. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 4, this list of conditions * and the disclaimer contained in paragraph 5. * * 2. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 4, this list of * conditions and the disclaimer contained in paragraph 5 in the * documentation and/or other materials provided with the distribution. * * 3. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 4. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 5. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifdef USEJOBCREATE #ifndef JOBFAKE #include #endif /* JOBFAKE */ #endif /* USEJOBCREATE */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if IBM_SP2==2 /* IBM SP with PSSP 3.1 */ #include #endif /* IBM SP */ #include "libpbs.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "resmon.h" #include "pbs_job.h" #include "log.h" #include "rpp.h" #include "mom_mach.h" #include "mom_func.h" #include "pbs_error.h" #include "svrfunc.h" #include "net_connect.h" #include "dis.h" #include "batch_request.h" #include "md5.h" #include "mcom.h" #include "resource.h" #ifdef ENABLE_CPA #include "pbs_cpa.h" #endif #ifdef PENABLE_LINUX26_CPUSETS #include "pbs_cpuset.h" #endif #ifdef HAVE_WORDEXP #include #endif /* HAVE_WORDEXP */ #ifdef ENABLE_CSA #ifndef CSAFAKE #include "csa_api.h" #include "csaacct.h" #else typedef enum { WM_INFO = 1, /* Informational */ WM_RECV, /* Request received */ WM_INIT, /* Request initiated */ WM_SPOOL, /* Request output spooled */ WM_TERM /* Request terminated */ } wm_type; /* * Subtypes for workload management accounting record type WM_RECV. */ #define WM_RECV_NEW 1 /* New request */ /* * Subtypes for workload management accounting record type WM_INIT. */ #define WM_INIT_START 1 /* Request started for first time */ #define WM_INIT_RESTART 2 /* Request restarted */ #define WM_INIT_RERUN 3 /* Request rerun */ /* * Subtypes for workload management accounting record type WM_TERM. */ #define WM_TERM_EXIT 1 /* Request exited */ #define WM_TERM_REQUEUE 2 /* Request requeued */ #define WM_TERM_HOLD 3 /* Request checkpointed and held */ #define WM_TERM_RERUN 4 /* Request will be rerun */ #define WM_TERM_MIGRATE 5 /* Request will be migrated */ #endif /* CSAFAKE */ #endif /* ENABLE_CSA */ #ifdef NOPOSIXMEMLOCK #undef _POSIX_MEMLOCK #endif /* NOPOSIXMEMLOCK */ #define EXTRA_VARIABLE_SPACE 2000 #define EXTRA_ENV_PTRS 32 /* Global Variables */ extern int spoolasfinalname; extern int num_var_env; extern char **environ; extern int exiting_tasks; extern int lockfds; extern tlist_head mom_polljobs; extern char *path_jobs; extern char *path_prolog; extern char *path_prologuser; extern char *path_prologp; extern char *path_prologuserp; extern char *path_spool; extern char *path_aux; extern gid_t pbsgroup; extern time_t time_now; extern unsigned int pbs_rm_port; extern u_long localaddr; extern char *nodefile_suffix; extern char *submithost_suffix; extern char DEFAULT_UMASK[]; extern char PRE_EXEC[]; extern int LOGLEVEL; extern long TJobStartBlockTime; extern char path_checkpoint[]; int mom_reader_go; /* see catchinter() & mom_writer() */ struct var_table vtable; /* for building up job's environ */ extern char tmpdir_basename[]; /* for TMPDIR */ extern int src_login_batch; extern int src_login_interactive; /* Local Variables */ static int script_in; /* script file, will be stdin */ static pid_t writerpid; /* writer side of interactive job */ static pid_t shellpid; /* shell part of interactive job */ /* sync w/variables_else[] */ enum TVarElseEnum { tveHome = 0, tveLogName, tveJobName, tveJobID, tveQueue, tveShell, tveUser, tveJobCookie, tveNodeNum, tveTaskNum, tveMOMPort, tveNodeFile, tveNumNodes, tveTmpDir, tveVerID, tveNumNodesStr, tveNumPpn, tveLAST }; static char *variables_else[] = /* variables to add, value computed */ { "HOME", "LOGNAME", "PBS_JOBNAME", "PBS_JOBID", "PBS_QUEUE", "SHELL", "USER", "PBS_JOBCOOKIE", "PBS_NODENUM", "PBS_TASKNUM", "PBS_MOMPORT", "PBS_NODEFILE", "PBS_NNODES", /* number of nodes specified by size */ "TMPDIR", "PBS_VERSION", "PBS_NUM_NODES", /* number of nodes specified by nodes string */ "PBS_NUM_PPN", /* ppn value specified by nodes string */ NULL }; static int num_var_else = tveLAST; /* prototypes */ static void starter_return A_((int, int, int, struct startjob_rtn *)); static void catchinter A_((int)); #ifdef PENABLE_LINUX26_CPUSETS extern int use_cpusets(job *); #endif /* PENABLE_LINUX26_CPUSETS */ int TMomFinalizeJob1(job *, pjobexec_t *, int *); int TMomFinalizeJob2(pjobexec_t *, int *); int TMomFinalizeJob3(pjobexec_t *, int, int, int *); int expand_path(job *,char *,int,char *); int TMomFinalizeChild(pjobexec_t *); int TMomCheckJobChild(pjobexec_t *, int, int *, int *); int InitUserEnv(job *,task *,char **,struct passwd *pwdp,char *); int mkdirtree(char *,mode_t); int TTmpDirName(job*, char *); static int search_env_and_open(const char *, u_long); extern int TMOMJobGetStartInfo(job *, pjobexec_t **); extern int mom_reader(int, int); extern int mom_writer(int, int); extern int x11_create_display(int, char *, char *phost, int pport, char *homedir, char *x11authstr); extern int blcr_restart_job(job *pjob, char *file); extern int mom_checkpoint_job_is_checkpointable(job *pjob); extern int mom_checkpoint_job_has_checkpoint(job *pjob); extern int mom_checkpoint_execute_job(job *pjob, char *shell, char *arg[], struct var_table *vtable); extern void mom_checkpoint_init_job_periodic_timer(job *pjob); extern int mom_checkpoint_start_restart(job *pjob); extern void get_jobs_default_checkpoint_dir(job *pjob, char *defaultpath); extern char *cat_dirs(char *root, char *base); extern char *get_local_script_path(job *pjob, char *base); /* END prototypes */ #ifdef USEJOBCREATE uint64_t get_jobid(char *); #endif /* USEJOBCREATE */ #ifdef ENABLE_CSA void add_wkm_start(uint64_t, char *); void add_wkm_end(uint64_t, int64_t, char *); /* valid commands for csaswitch checking */ enum csa_chk_cmd { IS_INSTALLED = 0, IS_UP = 1 }; #endif /* ENABLE_CSA */ #define FDMOVE(fd) if (fd < 3) { \ int hold = fcntl(fd,F_DUPFD,3); \ close(fd); \ fd = hold; \ } /* * no_hang() - interrupt handler for alarm() around attempt to connect * to qsub for interactive jobs. If qsub hung or suspended or if the * network is fouled up, mom cannot afford to wait forever. */ static void no_hang( int sig) /* I (not used) */ { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_REQUEST, " ", "alarm timed-out connect to qsub"); return; } /* END no_hang() */ struct passwd *check_pwd( job *pjob) /* I (modified) */ { struct passwd *pwdp; struct group *grpp; char *ptr; /* NOTE: should cache entire pwd object (NYI) */ ptr = pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str; if (ptr == NULL) { /* FAILURE */ sprintf(log_buffer, "no user specified for job"); return(NULL); } pwdp = getpwnam(ptr); if (pwdp == NULL) { /* FAILURE */ sprintf(log_buffer, "no password entry for user %s", ptr); return(NULL); } if (pjob->ji_grpcache != NULL) { /* SUCCESS */ /* group cache previously loaded and cached */ return(pwdp); } pjob->ji_qs.ji_un_type = JOB_UNION_TYPE_MOM; pjob->ji_qs.ji_un.ji_momt.ji_exuid = pwdp->pw_uid; pjob->ji_grpcache = malloc(sizeof(struct grpcache) + strlen(pwdp->pw_dir) + 1); if (pjob->ji_grpcache == NULL) { /* FAILURE */ sprintf(log_buffer, "malloc failed"); return(NULL); } strcpy(pjob->ji_grpcache->gc_homedir, pwdp->pw_dir); /* get the group and supplimentary under which the job is to be run */ if ((pjob->ji_wattr[(int)JOB_ATR_egroup].at_flags & (ATR_VFLAG_SET | ATR_VFLAG_DEFLT)) == ATR_VFLAG_SET) { /* execution group specified and not default of login group */ /* NOTE: ideally egroup should be groupname, not groupid, but pbs_server * code will send a group ID over in some instances, so we should try * to work with a groupid if provided */ grpp = getgrnam(pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str); if (grpp != NULL) { pjob->ji_qs.ji_un.ji_momt.ji_exgid = grpp->gr_gid; } else { int tmpGID; /* check to see if we were given a groupid (group names cannot start * with a number) */ tmpGID = (int)strtol(pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str,NULL,10); if (tmpGID != 0) { pjob->ji_qs.ji_un.ji_momt.ji_exgid = tmpGID; } else { /* FAILURE */ sprintf(log_buffer, "no group entry for group %s, user=%s, errno=%d (%s)", pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str, ptr, errno, strerror(errno)); return(NULL); } } /* END if (grpp != NULL) */ } else { /* if no group specified, default to login group */ pjob->ji_qs.ji_un.ji_momt.ji_exgid = pwdp->pw_gid; } if ((pjob->ji_grpcache->gc_ngroup = init_groups( pwdp->pw_name, pjob->ji_qs.ji_un.ji_momt.ji_exgid, NGROUPS_MAX, pjob->ji_grpcache->gc_groups)) < 0) { /* FAILURE */ sprintf(log_buffer, "too many group entries"); return(NULL); } /* perform site specific check on validatity of account */ if (site_mom_chkuser(pjob)) { /* FAILURE */ sprintf(log_buffer, "site_mom_chkuser failed"); return(NULL); } /* SUCCESS */ return(pwdp); } /* END check_pwd() */ /** * @see send_sisters() - child - send ABORT request to sisters * @see start_exec() - parent */ void exec_bail( job *pjob, /* I */ int code) /* I */ { static char id[] = "exec_bail"; int nodecount; nodecount = send_sisters(pjob, IM_ABORT_JOB); if (nodecount != pjob->ji_numnodes - 1) { sprintf(log_buffer, "%s: sent %d ABORT requests, should be %d", id, nodecount, pjob->ji_numnodes - 1); log_err(-1, id, log_buffer); } /* inform non-MS nodes that job is aborting */ pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = code; job_save(pjob, SAVEJOB_QUICK); exiting_tasks = 1; if (pjob->ji_stdout > 0) close(pjob->ji_stdout); if (pjob->ji_stderr > 0) close(pjob->ji_stderr); return; } /* END exec_bail() */ #define RETRY 3 int open_demux( u_long addr, /* I */ int port) /* I */ { static char id[] = "open_demux"; int sock; int i; struct sockaddr_in remote; remote.sin_addr.s_addr = addr; remote.sin_port = htons((unsigned short)port); remote.sin_family = AF_INET; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { sprintf(log_buffer, "%s: socket %s", id, netaddr(&remote)); log_err(errno, id, log_buffer); return(-1); } for (i = 0;i < RETRY;i++) { if (connect(sock, (struct sockaddr *)&remote, sizeof(remote)) == 0) { /* success */ return(sock); } switch (errno) { case EINTR: case ETIMEDOUT: case ECONNRESET: sleep(2); continue; /*NOTREACHED*/ break; case EADDRINUSE: case ECONNREFUSED: sprintf(log_buffer, "%s: cannot connect to %s", id, netaddr(&remote)); log_err(errno, id, log_buffer); sleep(2); continue; /*NOTREACHED*/ break; default: /* NO-OP */ break; } /* END switch (errno) */ break; } /* END for (i) */ sprintf(log_buffer, "%s: connect %s", id, netaddr(&remote)); log_err(errno, id, log_buffer); close(sock); return(-1); } /* END open_demux() */ /* * open_pty - open slave side of master/slave pty */ static int open_pty( job *pjob) /* I */ { char *name; int pts; /* Open the slave pty as the controlling tty */ name = pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str; if ((pts = open(name, O_RDWR, 0600)) < 0) { log_err(errno, "open_pty", "cannot open slave"); } else { FDMOVE(pts); fchmod(pts, 0620); if (fchown(pts, pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1) { close(pts); log_err(errno, "open_pty", "cannot change slave's owner"); return -1; } #ifdef SETCONTROLLINGTTY #if defined(_CRAY) ioctl(0, TCCLRCTTY, 0); ioctl(pts, TCSETCTTY, 0); /* make controlling */ #elif defined(TCSETCTTY) ioctl(pts, TCSETCTTY, 0); /* make controlling */ #elif defined(TIOCSCTTY) ioctl(pts, TIOCSCTTY, 0); #endif #endif /* SETCONTROLLINGTTY */ } return(pts); } /* END open_pty() */ /* * is_joined - determine if standard out and stardard error are joined together * (-j option) and if so which is first * Returns: 0 - no join, separate files * +1 - joined as stdout * -1 - joined as stderr */ int is_joined( job *pjob) /* I */ { attribute *pattr; pattr = &pjob->ji_wattr[(int)JOB_ATR_join]; if ((pattr->at_flags & ATR_VFLAG_SET) && (pattr->at_val.at_str[0] != 'n')) { if ((pattr->at_val.at_str[0] == 'o') && (strchr(pattr->at_val.at_str, (int)'e') != 0)) { return(1); } if ((pattr->at_val.at_str[0] == 'e') && (strchr(pattr->at_val.at_str, (int)'e') != 0)) { return(-1); } } return(0); } /* END is_joined() */ /* * open_std_out_err - open standard out and err to files */ static int open_std_out_err( job *pjob, /* I */ int timeout) /* I (optional,>0 to set) */ { int i; int file_out = -2; int file_err = -2; int filemode = O_CREAT | O_WRONLY | O_APPEND | O_EXCL; /* if std out/err joined (set and != "n"), which file is first */ i = is_joined(pjob); if (timeout > 0) { alarm(timeout); } if (i == 1) { file_out = open_std_file( pjob, StdOut, filemode, pjob->ji_qs.ji_un.ji_momt.ji_exgid); file_err = dup(file_out); } else if (i == -1) { file_err = open_std_file( pjob, StdErr, filemode, pjob->ji_qs.ji_un.ji_momt.ji_exgid); file_out = dup(file_err); } if (file_out == -2) file_out = open_std_file( pjob, StdOut, filemode, pjob->ji_qs.ji_un.ji_momt.ji_exgid); if (file_err == -2) file_err = open_std_file( pjob, StdErr, filemode, pjob->ji_qs.ji_un.ji_momt.ji_exgid); alarm(0); /* disable alarm */ if ((file_out < 0) || (file_err < 0)) { /* FAILURE - cannot load files */ if ((file_out == -2) || (file_err == -2)) { /* timeout occurred */ char *path; int keeping; path = std_file_name(pjob, StdOut, &keeping); sprintf(log_buffer, "unable to stat/open file '%s' within %d seconds - check filesystem", (path != NULL) ? path : "???", timeout); log_err( errno, "open_std_out_err", log_buffer); } else { log_err( errno, "open_std_out_err", "unable to open standard output/error"); } return(-1); } /* END if ((file_out < 0) || (file_err < 0)) */ FDMOVE(file_out); /* make sure descriptor > 2 */ FDMOVE(file_err); /* so don't clobber stdin/out/err */ if (file_out != 1) { close(1); if (dup(file_out) == -1) { } close(file_out); } if (file_err != 2) { close(2); if (dup(file_err) == -1) { } close(file_err); } return(0); } /* END open_std_out_err() */ int mkdirtree( char *dirpath, /* I */ mode_t mode) /* I */ { char *part; int rc = 0; mode_t oldmask = 0; char *path = NULL; if (*dirpath != '/') { rc = -1; goto done; } /* make a copy to scribble NULLs on */ if ((path = strdup(dirpath)) == NULL) { rc = -1; goto done; } oldmask = umask(0000); part = strtok(path, "/"); if (part == NULL) { rc = -1; goto done; } *(part - 1) = '/'; /* leading '/' */ while ((part = strtok(NULL, "/")) != NULL) { if (mkdir(path, mode) == -1) { if (errno != EEXIST) { rc = errno; goto done; } } *(part - 1) = '/'; } /* very last component */ if (mkdir(path, mode) == -1) { if (errno != EEXIST) { rc = errno; goto done; } } done: if (oldmask != 0) umask(oldmask); if (path != NULL) free(path); return(rc); } /* END mkdirtree() */ /* If our config allows it, construct tmpdir path */ int TTmpDirName( job *pjob, /* I */ char *tmpdir) /* O */ { if (tmpdir_basename[0] == '/') { snprintf(tmpdir, MAXPATHLEN, "%s/%s", tmpdir_basename, pjob->ji_qs.ji_jobid); } else { *tmpdir = '\0'; } return(*tmpdir != '\0'); /* return "true" if tmpdir is set */ } int TMakeTmpDir( job *pjob, /* I */ char *tmpdir) /* I */ { char id[] = "TMakeTmpDir"; int rc; int retval; struct stat sb; if ((setegid(pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1) || (seteuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) == -1)) { return(0); } retval = mkdirtree(tmpdir, 0755); if (retval == 0) { /* We made it, it's ours */ pjob->ji_flags |= MOM_HAS_TMPDIR; } else { rc = stat(tmpdir, &sb); if (rc) rc = errno; switch (rc) { case ENOENT: sprintf(log_buffer, "Unable to make job transient directory: %s", tmpdir); break; case 0: if (S_ISDIR(sb.st_mode)) { if (sb.st_uid == pjob->ji_qs.ji_un.ji_momt.ji_exuid) { retval = 0; /* owned by the job, allowed */ } else { sprintf(log_buffer, "Job transient tmpdir %s already exists, owned by %d", tmpdir, sb.st_uid); retval = -1; } } else { sprintf(log_buffer, "Job transient tmpdir %s exists, but is not a directory", tmpdir); retval = -1; } break; default: sprintf(log_buffer, "Cannot name job tmp directory %s (on stat)", tmpdir); return(0); break; } } /* END if (retval == 0) */ seteuid(0); setegid(pbsgroup); if (retval != 0) log_err(retval, id, log_buffer); return(retval == 0); /* return boolean */ } /* END TMakeTmpDir() */ /* Sets up env for a user process, used by TMomFinalizeJob1, start_process, * and file copies */ int InitUserEnv( job *pjob, /* I */ task *ptask, /* I (optional) */ char **envp, /* I (optional) */ struct passwd *pwdp, /* I (optional) */ char *shell) /* I (optional) */ { char id[] = "InitUserEnv"; struct array_strings *vstrs; int j = 0; int ebsize = 0; char buf[MAXPATHLEN + 2]; int usertmpdir = 0; int num_nodes = 1; int num_ppn = 1; attribute *pattr; resource *presc; resource_def *prd; if (pjob == NULL) { sprintf(log_buffer, "passed a NULL pjob!"); log_err(errno, id, log_buffer); return(-1); } /* initialize vtable */ if (envp != NULL) { for (j = 0, ebsize = 0;envp[j] != NULL;j++) ebsize += strlen(envp[j]); } if (LOGLEVEL >= 10) { sprintf(log_buffer, "creating env buffer, count: %d size: %d", j, ebsize); log_ext(-1, id, log_buffer, LOG_DEBUG); } vstrs = pjob->ji_wattr[(int)JOB_ATR_variables].at_val.at_arst; vtable.v_bsize = ebsize + EXTRA_VARIABLE_SPACE + (vstrs != NULL ? (vstrs->as_next - vstrs->as_buf) : 0); vtable.v_block = malloc(vtable.v_bsize); if (vtable.v_block == NULL) { sprintf(log_buffer, "PBS: failed to init env, malloc: %s\n", strerror(errno)); log_err(errno, id, log_buffer); return(-1); } vtable.v_ensize = num_var_else + num_var_env + j + EXTRA_ENV_PTRS + (vstrs != NULL ? vstrs->as_usedptr : 0); vtable.v_used = 0; vtable.v_envp = malloc(vtable.v_ensize * sizeof(char *)); if (vtable.v_envp == NULL) { sprintf(log_buffer, "PBS: failed to init env, malloc: %s\n", strerror(errno)); log_err(errno, id, log_buffer); return(-1); } /* First variables from the local environment */ for (j = 0;j < num_var_env;++j) bld_env_variables(&vtable, environ[j], NULL); if (LOGLEVEL >= 10) { sprintf(log_buffer, "local env added, count: %d", j); log_ext(-1, id, log_buffer, LOG_DEBUG); } /* Next, the variables passed with the job. They may */ /* be overwritten with new correct values for this job */ if (vstrs != NULL) { for (j = 0;j < vstrs->as_usedptr;++j) { bld_env_variables(&vtable, vstrs->as_string[j], NULL); if (!strncmp( vstrs->as_string[j], variables_else[tveTmpDir], strlen(variables_else[tveTmpDir]))) usertmpdir = 1; } if (LOGLEVEL >= 10) { sprintf(log_buffer, "job env added, count: %d", j); log_ext(-1, id, log_buffer, LOG_DEBUG); } } /* END if (vstrs != NULL) */ /* HOME */ if (pjob->ji_grpcache != NULL) bld_env_variables(&vtable, variables_else[tveHome], pjob->ji_grpcache->gc_homedir); /* LOGNAME */ if (pwdp != NULL) bld_env_variables(&vtable, variables_else[tveLogName], pwdp->pw_name); /* PBS_JOBNAME */ bld_env_variables( &vtable, variables_else[tveJobName], pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str); /* PBS_JOBID */ bld_env_variables(&vtable, variables_else[tveJobID], pjob->ji_qs.ji_jobid); /* PBS_QUEUE */ bld_env_variables( &vtable, variables_else[tveQueue], pjob->ji_wattr[(int)JOB_ATR_in_queue].at_val.at_str); /* SHELL */ if (shell != NULL) bld_env_variables(&vtable, variables_else[tveShell], shell); /* USER, for compatability */ if (pwdp != NULL) bld_env_variables(&vtable, variables_else[tveUser], pwdp->pw_name); /* PBS_JOBCOOKIE */ bld_env_variables( &vtable, variables_else[tveJobCookie], pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str); /* PBS_NODENUM */ sprintf(buf, "%d", pjob->ji_nodeid); bld_env_variables(&vtable, variables_else[tveNodeNum], buf); /* PBS_TASKNUM */ if (ptask != NULL) { sprintf(buf, "%d", (int)ptask->ti_qs.ti_task); bld_env_variables(&vtable, variables_else[tveTaskNum], buf); } /* PBS_MOMPORT */ sprintf(buf, "%d", pbs_rm_port); bld_env_variables(&vtable, variables_else[tveMOMPort], buf); /* PBS_NODEFILE */ if (pjob->ji_flags & MOM_HAS_NODEFILE) { sprintf(buf, "%s/%s", path_aux, pjob->ji_qs.ji_jobid); bld_env_variables(&vtable, variables_else[tveNodeFile], buf); } /* PBS_NNODES */ pattr = &pjob->ji_wattr[(int)JOB_ATR_resource]; prd = find_resc_def(svr_resc_def, "size", svr_resc_size); presc = find_resc_entry(pattr, prd); if (presc != NULL) { sprintf(buf, "%ld", presc->rs_value.at_val.at_long); bld_env_variables(&vtable, variables_else[tveNumNodes], buf); } /* PBS_NUM_NODES and PBS_NPPN */ prd = find_resc_def(svr_resc_def,"nodes",svr_resc_size); presc = find_resc_entry(pattr,prd); if (presc != NULL) { char *ppn_str = "ppn="; char *tmp; if (presc->rs_value.at_val.at_str != NULL) { num_nodes = atoi(presc->rs_value.at_val.at_str); if (num_nodes != 0) { if ((tmp = strstr(presc->rs_value.at_val.at_str,ppn_str)) != NULL) { tmp += strlen(ppn_str); num_ppn = atoi(tmp); } } } } /* these values have been initialized to 1, and will always be in the * environment */ sprintf(buf,"%d",num_nodes); bld_env_variables(&vtable,variables_else[tveNumNodesStr],buf); sprintf(buf,"%d",num_ppn); bld_env_variables(&vtable,variables_else[tveNumPpn],buf); /* setup TMPDIR */ if (!usertmpdir && TTmpDirName(pjob, buf)) bld_env_variables(&vtable, variables_else[tveTmpDir], buf); /* PBS_VERSION */ sprintf(buf, "TORQUE-%s", PACKAGE_VERSION); bld_env_variables(&vtable, variables_else[tveVerID], buf); /* passed-in environment for tasks */ if (envp != NULL) { for (j = 0;envp[j];j++) bld_env_variables(&vtable, envp[j], NULL); } return(0); } /* END InitUserEnv() */ /* * Used by MOM superior to start the shell process. * perform all server level pre-job tasks, collect information * create parent-child pipes * * @see mom_set_use() - child */ int TMomFinalizeJob1( job *pjob, /* I (modified) */ pjobexec_t *TJE, /* O */ int *SC) /* O */ { static char *id = "TMomFinalizeJob1"; torque_socklen_t slen; int i; int rc; attribute *pattr; attribute *pattri; resource *presc; resource_def *prd; struct sockaddr_in saddr; char buf[MAXPATHLEN + 2]; time_t time_now; struct stat sb; *SC = 0; time_now = time(0); if (TJE == NULL) { sprintf(log_buffer, "bad param in %s", id); *SC = JOB_EXEC_RETRY; return(FAILURE); } /* initialize job exec struct */ memset(TJE, 0, sizeof(pjobexec_t)); TJE->ptc = -1; TJE->pjob = (void *)pjob; /* prepare job environment */ if (pjob->ji_numnodes > 1) { /* ** Get port numbers from file decriptors in job struct. The ** sockets are stored there so they can be closed later as ** Main MOM will not need them after the job is going. */ slen = sizeof(saddr); if (getsockname( pjob->ji_stdout, (struct sockaddr *)&saddr, &slen) == -1) { sprintf(log_buffer, "getsockname on stdout"); *SC = JOB_EXEC_RETRY; return(FAILURE); } TJE->port_out = (int)ntohs(saddr.sin_port); slen = sizeof(saddr); if (getsockname( pjob->ji_stderr, (struct sockaddr *)&saddr, &slen) == -1) { sprintf(log_buffer, "getsockname on stderr"); *SC = JOB_EXEC_RETRY; return(FAILURE); } TJE->port_err = (int)ntohs(saddr.sin_port); } else { TJE->port_out = -1; TJE->port_err = -1; } /* did the job request nodes? will need to setup node file */ pattr = &pjob->ji_wattr[(int)JOB_ATR_resource]; prd = find_resc_def(svr_resc_def, "neednodes", svr_resc_size); presc = find_resc_entry(pattr, prd); #ifdef MOM_FORCENODEFILE pjob->ji_flags |= MOM_HAS_NODEFILE; #else /* MOM_FORCENODEFILE */ if (presc != NULL) pjob->ji_flags |= MOM_HAS_NODEFILE; #endif /* MOM_FORCENODEFILE */ /* * get the password entry for the user under which the job is to be run * we do this now to save a few things in the job structure */ if ((TJE->pwdp = (void *)check_pwd(pjob)) == NULL) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); *SC = JOB_EXEC_FAIL1; return(FAILURE); } #if IBM_SP2==2 /* IBM SP with PSSP 3.1 */ /* load IBM SP switch table */ if (load_sp_switch(pjob) != 0) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); *SC = JOB_EXEC_RETRY; return(FAILURE); } #endif /* IBM SP */ /* Starting job */ mom_checkpoint_init_job_periodic_timer(pjob); if (mom_checkpoint_job_has_checkpoint(pjob)) { rc = mom_checkpoint_start_restart(pjob); if (rc == PBSE_NONE) { /* SUCCESS */ log_ext(-1, id, "Restart succeeded", LOG_DEBUG); /* reset mtime so walltime will not include held time */ /* update to time now minus the time already used */ /* unless it is suspended, see request.c/req_signal() */ get_jobs_default_checkpoint_dir(pjob, buf); stat(buf, &sb); if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) == 0) { if ((pjob->ji_qs.ji_stime == 0) && (pjob->ji_wattr[(int)JOB_ATR_start_time].at_flags & ATR_VFLAG_SET)) { pjob->ji_qs.ji_stime = (time_t)pjob->ji_wattr[(int)JOB_ATR_start_time].at_val.at_long; } pjob->ji_qs.ji_stime = time_now - (sb.st_mtime - pjob->ji_qs.ji_stime); pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; if (mom_get_sample() != PBSE_NONE) mom_set_use(pjob); } else { pjob->ji_qs.ji_substate = JOB_SUBSTATE_SUSPEND; } *SC = 0; return(FAILURE); } else { /* FAILURE */ log_err(-1, id, "Restart failed"); /* retry for any kind of changable thing */ if ((errno == EAGAIN) || #ifdef ERFLOCK (errno == ERFLOCK) || #endif #ifdef EQUSR (errno == EQUSR) || #endif #ifdef EQGRP (errno == EQGRP) || #endif #ifdef EQACT (errno == EQACT) || #endif #ifdef ENOSDS (errno == ENOSDS) || #endif (errno == ENOMEM) || (errno == ENOLCK) || (errno == ENOSPC) || (errno == ENFILE) || (errno == EDEADLK) || (errno == EBUSY)) { pjob->ji_qs.ji_un.ji_momt.ji_exitstat = JOB_EXEC_RETRY; *SC = JOB_EXEC_RETRY; } else { pjob->ji_qs.ji_un.ji_momt.ji_exitstat = JOB_EXEC_BADRESRT; *SC = JOB_EXEC_FAIL1; } pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; exiting_tasks = 1; sprintf(log_buffer, "Restart failed, error %d (%s)", errno, pbs_strerror(errno)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return(FAILURE); } } /* end of if mom_checkpoint_job_has_checkpoint(pjob) */ /* * if certain resource limits require that the job usage be * polled or it is a multinode job, we link the job to mom_polljobs. * * NOTE: we overload the job field ji_jobque for this as it * is not used otherwise by MOM */ if ((pjob->ji_numnodes > 1) || (mom_do_poll(pjob) != 0)) append_link(&mom_polljobs, &pjob->ji_jobque, pjob); pattri = &pjob->ji_wattr[(int)JOB_ATR_interactive]; if ((pattri->at_flags & ATR_VFLAG_SET) && (pattri->at_val.at_long != 0)) { TJE->is_interactive = TRUE; } else { TJE->is_interactive = FALSE; } if (TJE->is_interactive == TRUE) { /* * open a master pty, need to do it here before we fork, * to save the slave name in the master's job structure */ if ((TJE->ptc = open_master(&TJE->ptc_name)) < 0) { log_err(errno, id, "cannot open master pty"); *SC = JOB_EXEC_RETRY; return(FAILURE); } FDMOVE(TJE->ptc) /* save pty name in job output/error file name */ pattr = &pjob->ji_wattr[(int)JOB_ATR_outpath]; job_attr_def[(int)JOB_ATR_outpath].at_free(pattr); job_attr_def[(int)JOB_ATR_outpath].at_decode( pattr, NULL, NULL, TJE->ptc_name); pjob->ji_wattr[(int)JOB_ATR_outpath].at_flags = (ATR_VFLAG_SET | ATR_VFLAG_MODIFY | ATR_VFLAG_SEND); pattr = &pjob->ji_wattr[(int)JOB_ATR_errpath]; job_attr_def[(int)JOB_ATR_errpath].at_free(pattr); job_attr_def[(int)JOB_ATR_errpath].at_decode( pattr, NULL, NULL, TJE->ptc_name); pjob->ji_wattr[(int)JOB_ATR_errpath].at_flags = (ATR_VFLAG_SET | ATR_VFLAG_MODIFY | ATR_VFLAG_SEND); } /* END if (TJE->is_interactive == TRUE) */ #if SHELL_USE_ARGV == 0 #if SHELL_INVOKE == 1 if (TJE->is_interactive == FALSE) { /* need a pipe on which to write the shell script */ /* file name to the input of the shell */ if (pipe(TJE->pipe_script) == -1) { sprintf(log_buffer, "Failed to create shell name pipe, errno = %d (%s)", errno, strerror(errno)); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); *SC = JOB_EXEC_RETRY; return(FAILURE); } } /* END if (TJE->is_interactive == FALSE) */ #endif /* SHELL_INVOKE */ #endif /* !SHELL_USE_ARGV */ /* create pipes between MOM and the job starter */ /* fork the job starter which will become the job */ if ((pipe(TJE->mjspipe) == -1) || (pipe(TJE->jsmpipe) == -1)) { i = -1; } else { i = 0; /* make sure pipe file descriptors are above 2 */ if (TJE->jsmpipe[1] < 3) { TJE->upfds = fcntl(TJE->jsmpipe[1], F_DUPFD, 3); close(TJE->jsmpipe[1]); TJE->jsmpipe[1] = 0; } else { TJE->upfds = TJE->jsmpipe[1]; } if (TJE->mjspipe[0] < 3) { TJE->downfds = fcntl(TJE->mjspipe[0], F_DUPFD, 3); close(TJE->mjspipe[0]); TJE->mjspipe[0] = 0; } else { TJE->downfds = TJE->mjspipe[0]; } } if ((i == -1) || (TJE->upfds < 3) || (TJE->downfds < 3)) { sprintf(log_buffer, "cannot create communication pipe"); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); *SC = JOB_EXEC_RETRY; return(FAILURE); } if ((TJE->ptask = (void *)pbs_task_create(pjob, TM_NULL_TASK)) == NULL) { sprintf(log_buffer, "cannot create job task"); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); *SC = JOB_EXEC_RETRY; return(FAILURE); } pjob->ji_qs.ji_substate = JOB_SUBSTATE_STARTING; pjob->ji_qs.ji_stime = time_now; return(SUCCESS); } /* END TMomFinalizeJob1() */ /* fork child/prolog */ int TMomFinalizeJob2( pjobexec_t *TJE, /* I */ int *SC) /* O */ { static char *id = "TMomFinalizeJob2"; char buf[MAXPATHLEN + 2]; pid_t cpid; #if SHELL_USE_ARGV == 0 #if SHELL_INVOKE == 1 int i, j; #endif /* SHELL_INVOKE */ #endif /* !SHELL_USE_ARGV */ job *pjob; task *ptask; pjob = (job *)TJE->pjob; ptask = (task *)TJE->ptask; if (LOGLEVEL >= 4) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "about to fork child which will become job"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } /* ** fork the child that will become the job. */ if ((cpid = fork_me(-1)) < 0) { /* fork failed */ sprintf(log_buffer, "fork of job '%s' failed in (errno=%d, '%s')", pjob->ji_qs.ji_jobid, errno, strerror(errno)); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); *SC = JOB_EXEC_RETRY; return(FAILURE); } if (cpid == 0) { /* CHILD: handle child activities */ TMomFinalizeChild(TJE); /*NOTREACHED*/ } /* parent */ close(TJE->upfds); close(TJE->downfds); if (TJE->ptc >= 0) close(TJE->ptc); strcpy(buf, path_jobs); strcat(buf, pjob->ji_qs.ji_fileprefix); strcat(buf, JOB_SCRIPT_SUFFIX); if (chown( buf, pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1) { } #if SHELL_USE_ARGV == 0 #if SHELL_INVOKE == 1 if (TJE->is_interactive == FALSE) { int k; /* pass name of shell script on pipe */ /* will be stdin of shell */ close(TJE->pipe_script[0]); strcat(buf, "\n"); /* setup above */ i = strlen(buf); j = 0; while (j < i) { if ((k = write(TJE->pipe_script[1], buf + j, i - j)) < 0) { if (errno == EINTR) continue; break; } j += k; } close(TJE->pipe_script[1]); } /* END if (TJE->is_interactive == FALSE) */ #endif /* SHELL_INVOKE */ #endif /* !SHELL_USE_ARGV */ /* SUCCESS: parent returns */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "phase 2 of job launch successfully completed"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } *SC = 0; return(SUCCESS); } /* END TMomFinalizeJob2() */ int determine_umask( int uid /* I */ ) { static char *id = "determine_umask"; int UMaskVal = 0077; struct passwd *pwdp; FILE *fp; char retdata[20]; char command[100]; if (DEFAULT_UMASK[0] != '\0') { if (!strcasecmp(DEFAULT_UMASK, "userdefault")) { /* apply user default */ /* do we inherit umask when we do setuid(), NO */ /* we want to try and determine what the users umask is */ /* then we return its value so it can be set correctly */ if ((pwdp = getpwuid(uid)) == NULL) { sprintf(log_buffer, "FAILED to get password structure for uid %d", uid); log_err(-1, id, log_buffer); } else { sprintf(command, "/bin/su - %s -c umask", pwdp->pw_name); if ((fp = popen(command, "r")) != NULL) { if (fgets(retdata, 20, fp) != NULL) { /* set the umask value from returned data */ UMaskVal = strtol(retdata, NULL, 8); } pclose(fp); } } } else { UMaskVal = (int)strtol(DEFAULT_UMASK, NULL, 0); } /* make sure that we have access to the file when we move the spooled file */ UMaskVal = UMaskVal & 0377; if (LOGLEVEL > 7) { sprintf(log_buffer, "Using $job_output_file_umask value of %o", UMaskVal); log_ext(-1, id, log_buffer, LOG_DEBUG); } } return(UMaskVal); } /* END determine_umask() */ #ifdef PENABLE_LINUX26_CPUSETS /** * indicates whether or not cpusets should be used to run this job * * @param pjob - the job to check * @return TRUE if either GEOMETRY_REQUESTS is undefined or a request was made * else FALSE */ int use_cpusets( job *pjob) /* I */ { #ifdef ALWAYS_USE_CPUSETS return(TRUE); #else #ifdef GEOMETRY_REQUESTS resource *presc; resource_def *prd; if (pjob == NULL) return(FALSE); prd = find_resc_def(svr_resc_def,"procs_bitmap",svr_resc_size); presc = find_resc_entry(&pjob->ji_wattr[(int)JOB_ATR_resource],prd); /* don't create a cpuset unless one was specifically requested */ if ((presc == NULL) || (presc->rs_value.at_flags & ATR_VFLAG_SET) == FALSE) { return(FALSE); } else return(TRUE); #else return(TRUE); #endif /* GEOMETRY_REQUESTS */ #endif /* ALWAYS_USE_CPUSETS */ } /* END use_cpusets() */ #endif /* PENABLE_LINUX26_CPUSETS */ /* child portion of job launch executed as user - called by TMomFinalize2() */ /* will execute run_pelog() * issues setuid to pjob->ji_qs.ji_un.ji_momt.ji_exuid */ int TMomFinalizeChild( pjobexec_t *TJE) /* I */ { static char *id = "TMomFinalizeChild"; int aindex; char *arg[32]; char buf[MAXPATHLEN + 2]; pid_t cpid; int i, j, vnodenum; char qsubhostname[1024]; char *phost = NULL; int pport = 0; int pts; int qsub_sock; char *shell; char *shellname; char *idir; char *termtype; resource *presc; char *path_prologuserjob; #ifdef USEJOBCREATE struct startjob_rtn sjr = { 0, 0, 0}; #else struct startjob_rtn sjr = { 0, 0}; #endif /* USEJOBCREATE */ job *pjob; task *ptask; struct passwd *pwdp; char EMsg[1024]; pjob = (job *)TJE->pjob; ptask = (task *)TJE->ptask; pwdp = (struct passwd *)TJE->pwdp; /*******************************************/ /* */ /* The child process - will become the job */ /* */ /*******************************************/ /* NOTE: This child is launched on the mother superior node. It does not have access to stdout/stderr, failure messages will route to syslog via log_err() */ if (LOGLEVEL >= 10) log_ext(-1, id, "starting", LOG_DEBUG); if (lockfds >= 0) { close(lockfds); lockfds = -1; } close(TJE->jsmpipe[0]); close(TJE->mjspipe[1]); /* * find which shell to use, one specified or the login shell */ shell = set_shell(pjob, pwdp); /* in the machine dependent section */ if (LOGLEVEL >= 10) log_ext(-1, id, "shell initialized", LOG_DEBUG); /* Setup user env */ if (InitUserEnv(pjob, ptask, NULL, pwdp, shell) < 0) { log_err(-1, id, "failed to setup user env"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_RETRY, &sjr); } if (LOGLEVEL >= 10) log_ext(-1, id, "env initialized", LOG_DEBUG); /* Create the job's nodefile */ vnodenum = pjob->ji_numvnod; if (pjob->ji_flags & MOM_HAS_NODEFILE) { FILE *nhow; char *BPtr; sprintf(buf, "%s/%s", path_aux, pjob->ji_qs.ji_jobid); if ((nhow = fopen(buf, "w")) == NULL) { sprintf(log_buffer, "cannot open %s", buf); log_err(errno, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } /* ** The file must be owned by root and readable by ** the user. We take the easy way out and make ** it readable by anyone. */ if (fchmod(fileno(nhow), 0644) == -1) { sprintf(log_buffer, "cannot chmod %s", buf); log_err(errno, id, log_buffer); fclose(nhow); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } /* NOTE: if BEOWULF_JOB_MAP is set, populate node file with this info */ BPtr = get_job_envvar(pjob, "BEOWULF_JOB_MAP"); if (BPtr != NULL) { char tmpBuffer[1000000]; char *ptr; /* FORMAT: [:]... */ strncpy(tmpBuffer, BPtr, sizeof(tmpBuffer)); ptr = strtok(tmpBuffer, ":"); while (ptr != NULL) { if (nodefile_suffix != NULL) { fprintf(nhow, "%s%s\n", ptr, nodefile_suffix); } else { fprintf(nhow, "%s\n", ptr); } ptr = strtok(NULL, ":"); } } else { for (j = 0;j < vnodenum;j++) { vnodent *vp = &pjob->ji_vnods[j]; if (nodefile_suffix != NULL) { fprintf(nhow, "%s%s\n", vp->vn_host->hn_host, nodefile_suffix); } else { fprintf(nhow, "%s\n", vp->vn_host->hn_host); } } /* END for (j) */ } fclose(nhow); } /* END if (pjob->ji_flags & MOM_HAS_NODEFILE) */ if (LOGLEVEL >= 10) log_ext(-1, id, "node file created", LOG_DEBUG); /* Set PBS_VNODENUM */ sprintf(buf, "%d", 0); bld_env_variables(&vtable, "PBS_VNODENUM", buf); #ifdef PENABLE_LINUX26_CPUSETS if (use_cpusets(pjob) == TRUE) { sprintf(log_buffer, "about to create cpuset for job %s.\n", pjob->ji_qs.ji_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); if (create_jobset(pjob) == FAILURE) { /* FAILURE */ sprintf(log_buffer, "Could not create cpuset for job %s.\n", pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_RETRY, &sjr); } } #endif /* END PENABLE_LINUX26_CPUSETS */ #ifdef ENABLE_CPA /* Cray CPA setup */ if ((j = CPACreatePartition(pjob, &vtable)) != 0) { log_err(-1, id, "CPACreatePartition failed"); starter_return(TJE->upfds, TJE->downfds, j, &sjr); /* exits */ /*NOTREACHED*/ exit(1); } #endif /* END ENABLE_CPA */ /* specific system related variables */ j = set_mach_vars(pjob, &vtable); if (j != 0) { log_err(-1, id, "failed to set mach vars"); starter_return(TJE->upfds, TJE->downfds, j, &sjr); /* exits */ /*NOTREACHED*/ exit(1); } if (LOGLEVEL >= 10) log_ext(-1, id, "system vars set", LOG_DEBUG); umask(determine_umask(pjob->ji_qs.ji_un.ji_momt.ji_exuid)); if (TJE->is_interactive == TRUE) { struct sigaction act; /*************************************************************/ /* We have an "interactive" job, connect the standard */ /* streams to a socket connected to qsub. */ /*************************************************************/ sigemptyset(&act.sa_mask); #ifdef SA_INTERRUPT act.sa_flags = SA_INTERRUPT; #else act.sa_flags = 0; #endif /* SA_INTERRUPT */ act.sa_handler = no_hang; sigaction(SIGALRM, &act, NULL); /* only giving ourselves 5 seconds to connect to qsub * and get term settings */ alarm(5); /* once we connect to qsub and open a pty, the user can send us * a ctrl-c. It is important that we block this until we exec() * the user's shell or we exit and the job gets stuck */ act.sa_handler = SIG_IGN; sigaction(SIGINT, &act, (struct sigaction *)0); /* Set environment to reflect interactive */ bld_env_variables(&vtable, "PBS_ENVIRONMENT", "PBS_INTERACTIVE"); /* get host where qsub resides */ phost = arst_string("PBS_O_HOST", &pjob->ji_wattr[(int)JOB_ATR_variables]); pport = pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long; if ((phost == NULL) || ((phost = strchr(phost, '=')) == NULL)) { log_err(-1, id, "PBS_O_HOST not set"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } phost++; if (submithost_suffix != NULL) { snprintf(qsubhostname, sizeof(qsubhostname), "%s%s", phost, submithost_suffix); } else { strncpy(qsubhostname, phost, sizeof(qsubhostname)); } qsub_sock = conn_qsub(qsubhostname, pport, EMsg); if (qsub_sock < 0) { snprintf(log_buffer, 1024, "cannot open interactive qsub socket to host %s:%d - '%s' - check routing tables/multi-homed host issues", qsubhostname, pport, EMsg); log_err(errno, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } FDMOVE(qsub_sock); /* send job id as validation to qsub */ if (write( qsub_sock, pjob->ji_qs.ji_jobid, PBS_MAXSVRJOBID + 1) != PBS_MAXSVRJOBID + 1) { log_err(errno, id, "cannot write jobid"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); } /* receive terminal type and window size */ if ((termtype = rcvttype(qsub_sock)) == NULL) { log_err(errno, id, "cannot get termtype"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } bld_env_variables(&vtable, termtype, NULL); *(vtable.v_envp + vtable.v_used) = NULL; /* null term */ if (rcvwinsize(qsub_sock) == -1) { log_err(errno, id, "cannot get winsize"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } /* turn off alarm set around qsub connect activities */ alarm(0); act.sa_handler = SIG_DFL; act.sa_flags = 0; sigaction(SIGALRM, &act, NULL); #ifdef USEJOBCREATE /* * Get a job id from the system */ sjr.sj_jobid = get_jobid(pjob->ji_qs.ji_jobid); pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll = sjr.sj_jobid; pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY; #endif /* USEJOBCREATE */ /* set up the job session (update sjr) */ j = set_job(pjob, &sjr); memcpy(TJE->sjr, &sjr, sizeof(sjr)); if (j < 0) { if (j == -1) { /* set_job didn't leave message in log_buffer */ strcpy(log_buffer, "unable to set session"); } log_err(-1, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } /* open the slave pty as the controlling tty */ if ((pts = open_pty(pjob)) < 0) { log_err(errno, id, "cannot open slave"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } act.sa_handler = SIG_IGN; /* setup to ignore SIGTERM */ writerpid = fork(); if (writerpid == 0) { /* child is "writer" process */ sigaction(SIGTERM, &act, NULL); close(TJE->upfds); close(TJE->downfds); close(pts); mom_writer(qsub_sock, TJE->ptc); shutdown(qsub_sock, 2); exit(0); } if (writerpid > 0) { /* ** parent -- it first runs the prolog then forks ** again. the child becomes the job while the ** parent becomes the reader. */ close(1); close(2); dup2(pts, 1); dup2(pts, 2); fflush(stdout); fflush(stderr); set_termcc(pts); /* set terminal control char */ setwinsize(pts); /* set window size to qsub's */ /* run prolog - interactive job */ if (run_pelog( PE_PROLOG, path_prolog, pjob, PE_IO_TYPE_ASIS) != 0) { log_err(-1, id, "interactive prolog failed"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); } #ifdef ENABLE_CSA /* * Add a workload management start record */ add_wkm_start(sjr.sj_jobid, pjob->ji_qs.ji_jobid); #endif /* ENABLE_CSA */ /* run user prolog */ if (run_pelog( PE_PROLOGUSER, path_prologuser, pjob, PE_IO_TYPE_ASIS) != 0) { log_err(-1, id, "interactive user prolog failed"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); /*NOTREACHED*/ } presc = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], find_resc_def(svr_resc_def, "prologue", svr_resc_size)); if ((presc != NULL)) { if((presc->rs_value.at_flags & ATR_VFLAG_SET) && (presc->rs_value.at_val.at_str)) { path_prologuserjob = get_local_script_path(pjob, presc->rs_value.at_val.at_str); if(path_prologuserjob) { if (run_pelog( PE_PROLOGUSERJOB, path_prologuserjob, pjob, PE_IO_TYPE_ASIS)) { log_err(-1, id, "batch job local user prolog failed"); free(path_prologuserjob); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); /*NOTREACHED*/ } free(path_prologuserjob); } } } shellpid = fork(); if (shellpid == 0) { /*********************************************/ /* child - this will be the interactive job */ /* i/o is to slave tty */ /*********************************************/ close(0); dup2(pts, 0); fflush(stdin); close(TJE->ptc); /* close master side */ close(pts); /* dup'ed above */ close(qsub_sock); /* continue setting up and exec-ing shell */ } else { if (shellpid > 0) { /* fork, parent is "reader" process */ sigaction(SIGTERM, &act, NULL); close(pts); close(TJE->upfds); close(TJE->downfds); close(1); close(2); sigemptyset(&act.sa_mask); act.sa_flags = SA_NOCLDSTOP; act.sa_handler = catchinter; sigaction(SIGCHLD, &act, NULL); mom_reader_go = 1; mom_reader(qsub_sock, TJE->ptc); } else { log_err(errno, id, "can't fork reader"); } /* make sure qsub gets EOF */ shutdown(qsub_sock, 2); /* change pty back to available after job is done */ chmod(TJE->ptc_name, 0666); if (chown(TJE->ptc_name, 0, 0) == -1) { } exit(0); } } /* END if (writerpid > 0) */ else { /* FAILURE - fork failed */ log_err(errno, id, "cannot fork nanny"); /* change pty back to available */ chmod(TJE->ptc_name, 0666); if (chown(TJE->ptc_name, 0, 0) == -1) { } starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_RETRY, &sjr); } } /* END if (TJE->is_interactive == TRUE) */ else { /*************************************************************/ /* We have a "normal" batch job, connect the standard */ /* streams to files */ /*************************************************************/ /* set Environment to reflect batch */ bld_env_variables(&vtable, "PBS_ENVIRONMENT", "PBS_BATCH"); bld_env_variables(&vtable, "ENVIRONMENT", "BATCH"); #if SHELL_USE_ARGV == 1 /* connect stdin to /dev/null and feed the name of * the script on the command line */ if (TJE->is_interactive == FALSE) script_in = open("/dev/null", O_RDONLY, 0); #elif SHELL_INVOKE == 1 /* if passing script file name as input to shell */ close(TJE->pipe_script[1]); script_in = TJE->pipe_script[0]; #else /* SHELL_USE_ARGV || SHELL_INVOKE */ /* if passing script itself as input to shell */ strcpy(buf, path_jobs); strcat(buf, pjob->ji_qs.ji_fileprefix); strcat(buf, JOB_SCRIPT_SUFFIX); if ((script_in = open(buf, O_RDONLY, 0)) < 0) { if (errno == ENOENT) script_in = open("/dev/null", O_RDONLY, 0); } #endif /* SHELL_USE_ARGV */ if (LOGLEVEL >= 10) log_ext(-1, id, "opening script", LOG_DEBUG); if (script_in < 0) { log_err(errno, id, "unable to open script"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } FDMOVE(script_in); /* make sure descriptor > 2 */ if (script_in != 0) { close(0); if (dup(script_in) == -1) { } close(script_in); } /* NOTE: set arg2 to 5 to enable file open timeout check */ if (open_std_out_err(pjob, 0) == -1) { log_err(-1, id, "unable to open stdout/stderr descriptors"); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_STDOUTFAIL, &sjr); /*NOTREACHED*/ exit(1); } if (LOGLEVEL >= 10) log_ext(-1, id, "stdout/stderr opened", LOG_DEBUG); #ifdef USEJOBCREATE /* * Get a job id from the system */ sjr.sj_jobid = get_jobid(pjob->ji_qs.ji_jobid); pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll = sjr.sj_jobid; pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY; #endif /* USEJOBCREATE */ /* set up the job session (update sjr) */ j = set_job(pjob, &sjr); if (LOGLEVEL >= 10) log_ext(-1, id, "set_job complete", LOG_DEBUG); memcpy(TJE->sjr, &sjr, sizeof(sjr)); if (j < 0) { /* FAILURE */ if (j != -2 && j != -3) { /* set_job didn't leave message in log_buffer */ strcpy(log_buffer, "unable to set session"); } /* set_job leaves message in log_buffer */ log_err(-1, id, log_buffer); if (j == -3) { starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_RETRY, &sjr); } else { starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); } /*NOTREACHED*/ exit(1); } /* run prolog - standard batch job */ if ((j = run_pelog( PE_PROLOG, path_prolog, pjob, PE_IO_TYPE_ASIS)) != 0) { log_err(-1, id, "batch job prolog failed"); if (j == 1) { /* permanent failure - abort job */ starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); } else { /* retry - requeue job */ starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_RETRY, &sjr); } /*NOTREACHED*/ } if (LOGLEVEL >= 10) log_ext(-1, id, "prolog complete", LOG_DEBUG); #ifdef ENABLE_CSA /* * Add a workload management start record */ add_wkm_start(sjr.sj_jobid, pjob->ji_qs.ji_jobid); #endif /* ENABLE_CSA */ /* run user prolog */ if ((j = run_pelog( PE_PROLOGUSER, path_prologuser, pjob, PE_IO_TYPE_ASIS)) != 0) { log_err(-1, id, "batch job user prolog failed"); if (j == 1) { /* permanent failure - abort job */ starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); } else { /* retry - requeue job */ starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_RETRY, &sjr); } /*NOTREACHED*/ } presc = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], find_resc_def(svr_resc_def, "prologue", svr_resc_size)); if (presc != NULL) { if((presc->rs_value.at_flags & ATR_VFLAG_SET) && (presc->rs_value.at_val.at_str != NULL)) { path_prologuserjob = get_local_script_path(pjob, presc->rs_value.at_val.at_str); if(path_prologuserjob) { if ((j = run_pelog( PE_PROLOGUSERJOB, path_prologuserjob, pjob, PE_IO_TYPE_ASIS)) != 0) { log_err(-1, id, "batch job user prolog failed"); if (j == 1) { /* permanent failure - abort job */ free(path_prologuserjob); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); } else { /* retry - requeue job */ free(path_prologuserjob); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_RETRY, &sjr); } /*NOTREACHED*/ } free(path_prologuserjob); } } } } /* END else (TJE->is_interactive == TRUE) */ /***********************************************************************/ /* Set resource limits */ /* Both normal batch and interactive job come through here */ /* */ /* output fds to the user are setup at this point, so write() all */ /* errors (with a \n) directly to the user on fd 2 and fscync(2) it */ /***********************************************************************/ pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long = sjr.sj_session; pjob->ji_wattr[(int)JOB_ATR_session_id].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY | ATR_VFLAG_SEND; /* leaving a note for myself to check this later... why is it necessary to set JOB_ATR_session_id above? We are a child process and setting that attr should be useless. But if it isn't set, MOM sometimes SIGKILLs herself with interactive jobs -garrick */ #ifdef PENABLE_LINUX26_CPUSETS /* Move this mom process into the cpuset so the job will start in it. */ if (use_cpusets(pjob) == TRUE) { move_to_jobset(getpid(), pjob); } #endif /* (PENABLE_LINUX26_CPUSETS) */ if (site_job_setup(pjob) != 0) { /* FAILURE */ sprintf(log_buffer, "PBS: site specific job setup failed\n"); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); /* exits */ /*NOTREACHED*/ } if (LOGLEVEL >= 10) log_ext(-1, id, "setting system limits", LOG_DEBUG); log_buffer[0] = '\0'; if ((i = mom_set_limits(pjob, SET_LIMIT_SET)) != PBSE_NONE) { if (log_buffer[0] != '\0') { /* report error to user via stderr file */ if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); } if (i == PBSE_RESCUNAV) { /* resource temp unavailable */ if (TJE->is_interactive == TRUE) j = JOB_EXEC_FAIL2; else j = JOB_EXEC_RETRY; } else { j = JOB_EXEC_FAIL2; } if (log_buffer[0] != '\0') { log_err(errno, id, log_buffer); } else { log_err(errno, id, "mom_set_limits failed"); } starter_return(TJE->upfds, TJE->downfds, j, &sjr); /* exits */ /*NOTREACHED*/ return(-1); } /* END if (mom_set_limits() == 0) */ endpwent(); if (LOGLEVEL >= 10) log_ext(-1, id, "system limits set", LOG_DEBUG); if ((idir = get_job_envvar(pjob, "PBS_O_ROOTDIR")) != NULL) { if (chroot(idir) == -1) { sprintf(log_buffer, "PBS: chroot to '%.256s' failed: %s\n", idir, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); /*NOTREACHED*/ return(-1); } } /* * become the user, execv the shell and become the real job */ if (LOGLEVEL >= 10) { sprintf(log_buffer, "setting user/group credentials to %d/%d", pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid); log_ext(-1, id, log_buffer, LOG_DEBUG); } if (setgroups( pjob->ji_grpcache->gc_ngroup, (gid_t *)pjob->ji_grpcache->gc_groups) != 0) { snprintf(log_buffer,sizeof(log_buffer), "PBS: setgroups for UID = %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno,id,log_buffer); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); } if (setgid(pjob->ji_qs.ji_un.ji_momt.ji_exgid) != 0) { snprintf(log_buffer,sizeof(log_buffer), "PBS: setgid to %lu for UID = %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exgid, (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno,id,log_buffer); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); } if (setuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) < 0) { snprintf(log_buffer,sizeof(log_buffer), "PBS: setuid to %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); } #ifdef _CRAY seteuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid); /* cray kludge */ #endif /* CRAY */ /* * cwd to PBS_O_INITDIR if specified, otherwise User's Home */ if ((idir = get_job_envvar(pjob, "PBS_O_INITDIR")) != NULL) { /* in TMomFinalizeChild() executed as user */ if (chdir(idir) == -1) { sprintf(log_buffer, "PBS: chdir to '%.256s' failed: %s\n", idir, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); /*NOTREACHED*/ return(-1); } } else { /* in TMomFinalizeChild() executed as user */ if (chdir(pwdp->pw_dir) == -1) { sprintf(log_buffer, "PBS: chdir to '%.256s' failed: %s\n", pwdp->pw_dir, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_FAIL2, &sjr); /*NOTREACHED*/ return(-1); } } if (LOGLEVEL >= 10) { sprintf(log_buffer, "initial directory set to %s\n", idir != NULL ? idir : pwdp->pw_dir); log_ext(-1, id, log_buffer, LOG_DEBUG); } /* X11 forwarding init */ if ((TJE->is_interactive == TRUE) && pjob->ji_wattr[(int)JOB_ATR_forwardx11].at_val.at_str) { char display[512]; if (x11_create_display( 1, /* use localhost only */ display, /* output */ qsubhostname, pport, pjob->ji_grpcache->gc_homedir, pjob->ji_wattr[(int)JOB_ATR_forwardx11].at_val.at_str) >= 0) { bld_env_variables(&vtable, "DISPLAY", display); } else { sprintf(log_buffer, "PBS: X11 forwarding init failed\n"); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); } } /* NULL terminate the envp array, This is MUST DO */ *(vtable.v_envp + vtable.v_used) = NULL; /* tell mom we are going */ if (LOGLEVEL >= 10) log_ext(-1, id, "forking child", LOG_DEBUG); starter_return(TJE->upfds, TJE->downfds, JOB_EXEC_OK, &sjr); log_close(0); /* FIXME: this is useless, right? */ if ((pjob->ji_numnodes == 1) || ((cpid = fork()) > 0)) { /* parent does the shell */ /* close sockets that child uses */ if (pjob->ji_stdout >= 0) close(pjob->ji_stdout); if (pjob->ji_stderr >= 0) close(pjob->ji_stderr); /* construct argv array */ shellname = strrchr(shell, '/'); if (shellname != NULL) ++shellname; /* go past last '/' */ else shellname = shell; aindex = 0; /* determine whether or not we bypass the sourcing of login shells */ if (((TJE->is_interactive == TRUE) && (src_login_interactive == FALSE)) || ((TJE->is_interactive != TRUE) && (src_login_batch == FALSE))) { arg[aindex] = malloc(strlen(shellname) + 1); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } strcpy(arg[aindex], shellname); if (LOGLEVEL >= 7) { sprintf(log_buffer, "bypass sourcing of login files for job %s", pjob->ji_qs.ji_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } } else { arg[aindex] = malloc(strlen(shellname) + 2); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } /* specifying '-' indicates this is a 'login' shell */ strcpy(arg[aindex], "-"); strcat(arg[aindex], shellname); } arg[aindex + 1] = NULL; aindex++; if (PRE_EXEC[0] != '\0') { arg[aindex] = strdup(PRE_EXEC); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } arg[aindex + 1] = NULL; aindex++; } /* END if (PRE_EXEC[0] != '\0') */ #if SHELL_USE_ARGV == 1 /* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */ if (TJE->is_interactive == FALSE) { arg[aindex] = malloc( strlen(path_jobs) + strlen(pjob->ji_qs.ji_fileprefix) + strlen(JOB_SCRIPT_SUFFIX) + 1); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } strcpy(arg[aindex], path_jobs); strcat(arg[aindex], pjob->ji_qs.ji_fileprefix); strcat(arg[aindex], JOB_SCRIPT_SUFFIX); arg[aindex + 1] = NULL; aindex++; } #endif /* SHELL_USE_ARGV */ if (TJE->is_interactive == TRUE) { struct sigaction act; /* restore SIGINT so that the child shell can use ctrl-c */ sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_DFL; sigaction(SIGINT, &act, (struct sigaction *)0); /* if the user specified command(s) then invoke it */ if ((pjob->ji_wattr[(int)JOB_ATR_inter_cmd].at_flags & ATR_VFLAG_SET) != 0) { arg[aindex] = malloc(strlen("-c") + 1); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } strcpy(arg[aindex], "-c"); arg[aindex + 1] = NULL; aindex++; arg[aindex] = malloc(strlen(pjob->ji_wattr[(int)JOB_ATR_inter_cmd].at_val.at_str) + 1); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } log_ext(-1, id, log_buffer, LOG_DEBUG); strcpy(arg[aindex], pjob->ji_wattr[(int)JOB_ATR_inter_cmd].at_val.at_str); arg[aindex + 1] = NULL; aindex++; } } if (mom_checkpoint_job_is_checkpointable(pjob)) { if (mom_checkpoint_execute_job(pjob, shell, arg, &vtable) == -1) { starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } } else { if (LOGLEVEL >= 10) { char cmd[1024]; int i; strcpy(cmd,arg[0]); strcat(cmd,","); for (i = 1; arg[i] != NULL; i++) { strcat(cmd," "); strcat(cmd,arg[i]); strcat(cmd,","); } strcat(cmd,")"); sprintf(log_buffer, "execing command (%s) args (%s)\n", shell, cmd); log_ext(-1, id, log_buffer, LOG_DEBUG); } execve(shell, arg, vtable.v_envp); } } /* END if ((pjob->ji_numnodes == 1) || ...) */ else if (cpid == 0) { /* child does demux */ char *demux = DEMUX; /* setup descriptors 3 and 4 */ dup2(pjob->ji_stdout, 3); if (pjob->ji_stdout > 3) close(pjob->ji_stdout); dup2(pjob->ji_stderr, 4); if (pjob->ji_stderr > 4) close(pjob->ji_stderr); /* construct argv array */ shellname = strrchr(demux, '/'); if (shellname != NULL) ++shellname; /* go past last '/' */ else shellname = shell; aindex = 0; arg[aindex] = malloc(strlen(shellname) + 1); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } strcpy(arg[aindex], shellname); arg[aindex + 1] = NULL; aindex++; if (PRE_EXEC[0] != '\0') { arg[aindex] = strdup(PRE_EXEC); if (arg[aindex] == NULL) { log_err(errno,id,"cannot alloc env"); starter_return(TJE->upfds,TJE->downfds,JOB_EXEC_FAIL2,&sjr); /*NOTREACHED*/ return(-1); } arg[aindex + 1] = NULL; aindex++; } /* END if (PRE_EXEC[0] != '\0') */ execve(demux, arg, vtable.v_envp); /* reached only if execve fails */ shell = demux; /* for fprintf below */ } /* END else if (cpid == 0) */ sprintf(log_buffer, "PBS: exec of shell '%.256s' failed\n", shell); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); if (strlen(shell) == 0) { #ifndef NDEBUG extern char mom_host[]; #endif DBPRT(("user \"%s\" may not have a shell defined on node \"%s\"\n", pwdp->pw_name, mom_host)); } else if (strstr(shell, "/bin/false") != NULL) { #ifndef NDEBUG extern char mom_host[]; #endif DBPRT(("user \"%s\" has shell \"/bin/false\" on node \"%s\"\n", pwdp->pw_name, mom_host)); } else { struct stat buf; if (stat(shell, &buf) != 0) { DBPRT(("stat of shell \"%s\" failed with error %d\n", shell, errno)); } else if (S_ISREG(buf.st_mode) == 0) { DBPRT(("shell \"%s\" is not a file\n", shell)); } else if ((buf.st_mode & S_IXUSR) != 0) { DBPRT(("shell \"%s\" is not executable by user \"%s\"\n", shell, pwdp->pw_name)); } } exit(254); /* should never, ever get here */ /*NOTREACHED*/ return(-1); } /* END TMomFinalizeChild() */ /* Child has already reported in via pipe (info in TJE->sjr) which was created in TMomFinalizeJob2->TMomFinalizeChild. Perform final job tasks. Change pjob substate from JOB_SUBSTATE_PRERUN to JOB_SUBSTATE_RUNNING */ int TMomFinalizeJob3( pjobexec_t *TJE, /* I (modified) */ int ReadSize, /* I (bytes read from child pipe) */ int ReadErrno, /* I (errno value from read) */ int *SC) /* O (return code) */ { char *id = "TMomFinalizeJob3"; struct startjob_rtn sjr; job *pjob; task *ptask; pjob = (job *)TJE->pjob; ptask = (task *)TJE->ptask; /* sjr populated in TMomFinalizeJob2() */ memcpy(&sjr, TJE->sjr, sizeof(sjr)); close(TJE->jsmpipe[0]); if (ReadSize != sizeof(sjr)) { /* FAILURE */ sprintf(log_buffer, "read of pipe for sid failed for job %s (%d of %d bytes)", pjob->ji_qs.ji_jobid, ReadSize, (int)sizeof(sjr)); log_err(ReadErrno, id, log_buffer); sprintf(log_buffer, "start failed, improper sid"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); close(TJE->mjspipe[1]); *SC = JOB_EXEC_RETRY; return(FAILURE); } /* send back as an acknowledgement that MOM got it */ if (write(TJE->mjspipe[1], &sjr, sizeof(sjr)) == -1) { } close(TJE->mjspipe[1]); if (LOGLEVEL >= 3) { #ifdef USEJOBCREATE sprintf(log_buffer, "Job %s read start return code=%d session=%ld jobid=%lx", pjob->ji_qs.ji_jobid, sjr.sj_code, (long)sjr.sj_session, sjr.sj_jobid); #else sprintf(log_buffer, "Job %s read start return code=%d session=%ld", pjob->ji_qs.ji_jobid, sjr.sj_code, (long)sjr.sj_session); #endif /* USEJOBCREATE */ log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } if (sjr.sj_code < 0) { char tmpLine[1024]; /* FAILURE */ tmpLine[0] = '\0'; switch (sjr.sj_code) { case JOB_EXEC_OK: /* 0 */ strcpy(tmpLine, "no failure"); break; case JOB_EXEC_FAIL1: /* -1 */ strcpy(tmpLine, "job exec failure, before files staged, no retry"); break; case JOB_EXEC_FAIL2: /* -2 */ strcpy(tmpLine, "job exec failure, after files staged, no retry"); break; case JOB_EXEC_RETRY: /* -3 */ strcpy(tmpLine, "job exec failure, retry will be attempted"); if (sjr.sj_session < 0) { /* NOTE: push sjr.sj_sid into job attribute X to be used by encode_used */ ptask->ti_qs.ti_sid = sjr.sj_session; } break; case JOB_EXEC_STDOUTFAIL: /* -9 */ strcpy(tmpLine,"job exec failure, could not open/create stdout/stderr files, no retry"); break; default: sprintf(tmpLine, "job exec failure, code=%d", sjr.sj_code); break; } /* END switch (sjr.sj_code) */ sprintf(log_buffer, "job not started, %s %s (see syslog for more information)", (sjr.sj_code == JOB_EXEC_RETRY) ? "Retry" : "Failure", tmpLine); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); *SC = sjr.sj_code; return(FAILURE); } /* END if (sjr.sj_code < 0) */ /* pjob modified */ set_globid(pjob, &sjr); ptask->ti_qs.ti_sid = sjr.sj_session; ptask->ti_qs.ti_status = TI_STATE_RUNNING; strcpy(ptask->ti_qs.ti_parentjobid, pjob->ji_qs.ji_jobid); if (LOGLEVEL >= 6) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "saving task (TMomFinalizeJob3)"); } if (task_save(ptask) == -1) { /* FAILURE */ sprintf(log_buffer, "Task save failed"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); *SC = JOB_EXEC_RETRY; return(FAILURE); } if (pjob->ji_numnodes > 1) { /* ** Put port numbers into job struct and close sockets. ** The job uses them to talk to demux, but main MOM ** doesn't need them. The port numbers are stored ** here for use in start_process(), to connect to ** pbs_demux. */ close(pjob->ji_stdout); pjob->ji_stdout = TJE->port_out; close(pjob->ji_stderr); pjob->ji_stderr = TJE->port_err; } /* return from the starter indicated the job is a go ... */ /* record the start time and session/process id */ pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long = sjr.sj_session; pjob->ji_wattr[(int)JOB_ATR_session_id].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY | ATR_VFLAG_SEND; #ifdef USEJOBCREATE pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll = sjr.sj_jobid; pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY; #endif /* USEJOBCREATE */ pjob->ji_qs.ji_state = JOB_STATE_RUNNING; pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; pjob->ji_qs.ji_stime = time_now; /* changed from SAVEJOB_QUICK to SAVEJOB_FULL (USC - 2/5/2005) */ job_save(pjob, SAVEJOB_FULL); sprintf(log_buffer, "job %s started, pid = %ld", pjob->ji_qs.ji_jobid, (long)sjr.sj_session); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); return(SUCCESS); } /* END TMomFinalizeJob3() */ /** * Start a process for a spawn request. This will be different from * a job's initial shell task in that the environment will be specified * and no interactive code need be included. * * NOTE: Called for sisters after mother superior receives IM_SPAWN_TASK request */ int start_process( task *ptask, /* I */ char **argv, /* I */ char **envp) /* I */ { static char id[] = "start_process"; char *idir; job *pjob = ptask->ti_job; pid_t pid; int pipes[2], kid_read, kid_write, parent_read, parent_write; int pts; int i, j; int fd0, fd1, fd2; u_long ipaddr; #ifdef USEJOBCREATE struct startjob_rtn sjr = { 0, 0, 0 }; #else struct startjob_rtn sjr = { 0, 0 }; #endif /* USEJOBCREATE */ if (pipe(pipes) == -1) { return(-1); } if (pipes[1] < 3) { kid_write = fcntl(pipes[1], F_DUPFD, 3); close(pipes[1]); } else { kid_write = pipes[1]; } parent_read = pipes[0]; if (pipe(pipes) == -1) { return(-1); } if (pipes[0] < 3) { kid_read = fcntl(pipes[0], F_DUPFD, 3); close(pipes[0]); } else { kid_read = pipes[0]; } parent_write = pipes[1]; /* ** Get ipaddr to Mother Superior. */ if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) /* I'm MS */ { ipaddr = htonl(localaddr); } else { struct sockaddr_in *ap; /* ** We always have a stream open to MS at node 0. */ i = pjob->ji_hosts[0].hn_stream; if ((ap = rpp_getaddr(i)) == NULL) { sprintf(log_buffer, "job %s has no stream to MS", pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); return(-1); } ipaddr = ap->sin_addr.s_addr; } /* END else (pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) */ /* A restarted mom will not have called this yet, but it is needed * to spawn tasks (ji_grpcache). */ if (!check_pwd(pjob)) { log_err(-1, id, log_buffer); return(-1); } /* ** Begin a new process for the fledgling task. */ if ((pid = fork_me(-1)) == -1) { /* fork failed */ return(-1); } if (pid != 0) { /* parent */ int gotsuccess = 0; close(kid_read); close(kid_write); /* read sid */ for (;;) { i = read(parent_read, (char *) & sjr, sizeof(sjr)); if ((i == -1) && (errno == EINTR)) continue; if ((i == sizeof(sjr)) && (sjr.sj_code == 0) && !gotsuccess) { gotsuccess = 1; if (write(parent_write, &sjr, sizeof(sjr)) == -1) { } continue; } if (gotsuccess) { i = sizeof(sjr); } break; } /* END for(;;) */ j = errno; close(parent_read); if (i != sizeof(sjr)) { sprintf(log_buffer, "read of pipe for sid job %s got %d not %ld (errno: %d, %s)", pjob->ji_qs.ji_jobid, i, (long)sizeof(sjr), j, strerror(j)); log_err(j, id, log_buffer); close(parent_write); return(-1); } /* This write to the pipe is redundant and leads to a sigpipe because of a * race condition with the child */ /* if (write(parent_write, &sjr, sizeof(sjr)) == -1) {} */ close(parent_write); DBPRT(("%s: read start return %d %ld\n", id, sjr.sj_code, (long)sjr.sj_session)) if (sjr.sj_code < 0) { char tmpLine[1024]; tmpLine[0] = '\0'; switch (sjr.sj_code) { case JOB_EXEC_OK: /* 0 */ /* NO-OP */ break; case JOB_EXEC_FAIL1: /* -1 */ case JOB_EXEC_STDOUTFAIL: /* -9 */ strcpy(tmpLine, "stdio setup failed"); break; case JOB_EXEC_FAIL2: /* -2 */ strcpy(tmpLine, "env setup or user dir problem"); break; case JOB_EXEC_RETRY: /* -3 */ strcpy(tmpLine, "unable to set limits, retry will be attempted"); break; case JOB_EXEC_CMDFAIL: /* -8 */ strcpy(tmpLine, "command exec failed"); break; default: sprintf(tmpLine, "code=%d", sjr.sj_code); break; } /* END switch (sjr.sj_code) */ sprintf(log_buffer, "task not started, '%s', %s (see syslog)", argv[0], tmpLine); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return(-1); } /* END if (sjr.sj_code < 0) */ set_globid(pjob, &sjr); ptask->ti_qs.ti_sid = sjr.sj_session; ptask->ti_qs.ti_status = TI_STATE_RUNNING; if (LOGLEVEL >= 6) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "task set to running/saving task (start_process)"); } task_save(ptask); if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_RUNNING) { pjob->ji_qs.ji_state = JOB_STATE_RUNNING; pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; job_save(pjob, SAVEJOB_QUICK); } sprintf(log_buffer, "%s: task started, tid %d, sid %ld, cmd %s", id, ptask->ti_qs.ti_task, (long)ptask->ti_qs.ti_sid, argv[0]); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return(0); } /* END else if (pid != 0) */ /************************************************/ /* The child process - will become the TASK */ /************************************************/ if (LOGLEVEL >= 10) log_ext(-1, id, "child starting", LOG_DEBUG); if (lockfds >= 0) { close(lockfds); lockfds = -1; } close(parent_read); close(parent_write); /* set up the environmental variables to be given to the job */ /* NOTE: use log_err beyond this point to write messages to syslog */ if (InitUserEnv(pjob, ptask, envp, NULL, NULL) < 0) { log_err(errno, id, "failed to setup user env"); starter_return(kid_write, kid_read, JOB_EXEC_RETRY, &sjr); /*NOTREACHED*/ exit(1); } if (LOGLEVEL >= 10) log_ext(-1, id, "user env initialized", LOG_DEBUG); if (set_mach_vars(pjob, &vtable) != 0) { strcpy(log_buffer, "PBS: machine dependent environment variable setup failed\n"); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } if (LOGLEVEL >= 10) log_ext(-1, id, "mach vars set", LOG_DEBUG); umask(077); /* set environment to reflect batch */ bld_env_variables(&vtable, "PBS_ENVIRONMENT", "PBS_BATCH"); bld_env_variables(&vtable, "ENVIRONMENT", "BATCH"); /* Set limits for the child */ if (mom_set_limits(pjob, SET_LIMIT_SET) != PBSE_NONE) { strcpy(log_buffer, "PBS: resource limits setup failed\n"); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } /* NULL terminate the envp array, This is MUST DO */ *(vtable.v_envp + vtable.v_used) = NULL; /* ** Set up stdin. */ /* look through env for a port# on MS we should use for stdin */ if ((fd0 = search_env_and_open("MPIEXEC_STDIN_PORT", ipaddr)) == -2) { log_err(errno, id, "cannot locate MPIEXEC_STDIN_PORT"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } if ((fd0 < 0) && ((fd0 = search_env_and_open("TM_STDIN_PORT", ipaddr)) == -2)) { log_err(errno, id, "cannot locate TM_STDIN_PORT"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } /* use /dev/null if no env var found */ if ((fd0 < 0) && (fd0 = open("/dev/null", O_RDONLY)) == -1) { log_err(errno, id, "could not open dev/null"); close(0); } else { dup2(fd0, 0); if (fd0 > 0) close(fd0); } /* look through env for a port# on MS we should use for stdout/err */ if ((fd1 = search_env_and_open("MPIEXEC_STDOUT_PORT", ipaddr)) == -2) { log_err(errno, id, "cannot locate MPIEXEC_STDOUT_PORT"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } if (fd1 < 0) { if ((fd1 = search_env_and_open("TM_STDOUT_PORT", ipaddr)) == -2) { log_err(errno, id, "cannot locate TM_STDOUT_PORT"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } } if ((fd2 = search_env_and_open("MPIEXEC_STDERR_PORT", ipaddr)) == -2) { log_err(errno, id, "cannot locate MPIEXEC_STDERR_PORT"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } if (fd2 < 0) { if ((fd2 = search_env_and_open("TM_STDERR_PORT", ipaddr)) == -2) { log_err(errno, id, "cannot locate TM_STDERR_PORT"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } } if (LOGLEVEL >= 10) log_ext(-1, id, "MPI/TM variables set", LOG_DEBUG); #ifdef PENABLE_LINUX26_CPUSETS if (use_cpusets(pjob) == TRUE) { int j; char nodeidbuf[1024]; /* FIXME: vnodenum needs to be stored in the task struct so that we don't * have to fish it out here. Then we just pass the int to move_to_taskset * (changing the type of arg3) */ for (j = 0;j < vtable.v_used;j++) { if (!strncmp(vtable.v_envp[j], "PBS_VNODENUM=", strlen("PBS_VNODENUM="))) { strcpy(nodeidbuf, vtable.v_envp[j] + strlen("PBS_VNODENUM=")); /* FIXME: temp debugging info */ sprintf(log_buffer, "about to move to taskset for job %s/%s.\n", pjob->ji_qs.ji_jobid, nodeidbuf); log_ext(-1, id, log_buffer, LOG_DEBUG); /* Move this mom process into the cpuset so the job will start in it. */ /* Changed to move_to_jobset for OpenMPI jobs - CS - 20080526 */ /* move_to_taskset(getpid(),pjob,nodeidbuf); */ move_to_jobset(getpid(), pjob); } } } #endif /* (PENABLE_LINUX26_CPUSETS) */ if (pjob->ji_numnodes > 1) { /* ** Open sockets to demux proc for stdout and stderr. */ if ((fd1 < 0) && ((fd1 = open_demux(ipaddr, pjob->ji_stdout)) == -1)) { log_err(errno, id, "cannot open mux stdout port"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } dup2(fd1, 1); if (fd1 > 1) close(fd1); if ((fd2 < 0) && ((fd2 = open_demux(ipaddr, pjob->ji_stderr)) == -1)) { log_err(errno, id, "cannot open mux stderr port"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } dup2(fd2, 2); if (fd2 > 2) close(fd2); /* never send cookie - PW mpiexec patch */ /* if (write(1,pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str, strlen(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str)) == -1) {} if (write(2,pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str, strlen(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str)) == -1) {} */ } else if ((pjob->ji_wattr[(int)JOB_ATR_interactive].at_flags&ATR_VFLAG_SET) && (pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long > 0)) { /* interactive job, single node, write to pty */ pts = -1; if ((fd1 < 0) || (fd2 < 0)) { if ((pts = open_pty(pjob)) < 0) { log_err(errno, id, "cannot open slave pty"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); /*NOTREACHED*/ exit(1); } if (fd1 < 0) fd1 = pts; if (fd2 < 0) fd2 = pts; } dup2(fd1, 1); dup2(fd2, 2); if (fd1 != pts) close(fd1); if (fd2 != pts) close(fd2); } else { /* This code block may be dead (may never be run). This is due to the fact that * start_process() is only called by a sister who has received a IM_SPAWN_TASK, * but the below comment states that the code only runs for a "single node" job, * and all sisters are part of a multi-node job. */ /* normal batch job, single node, write straight to files */ pts = -1; if ((fd1 < 0) || (fd2 < 0)) { if (open_std_out_err(pjob, -1) == -1) { log_err(errno, id, "cannot open job stderr/stdout files"); starter_return(kid_write, kid_read, JOB_EXEC_FAIL1, &sjr); } } if (fd1 >= 0) { close(1); dup2(fd1, 1); if (fd1 > 1) close(fd1); } if (fd2 >= 0) { close(2); dup2(fd2, 2); if (fd2 > 2) close(fd2); } } /* END else */ /******************************************************* * At this point, output fds are setup for the job, * any further error messages should be written * directly to fd 2, with a \n, and ended with fsync(2) *******************************************************/ if (LOGLEVEL >= 10) log_ext(-1, id, "about to perform set_job", LOG_DEBUG); j = set_job(pjob, &sjr); if (j < 0) { if (j != -2) { /* set_job didn't leave message in log_buffer */ strcpy(log_buffer, "PBS: unable to set task session\n"); } if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_FAIL2, &sjr); } ptask->ti_qs.ti_sid = sjr.sj_session; log_buffer[0] = '\0'; if ((i = mom_set_limits(pjob, SET_LIMIT_SET)) != PBSE_NONE) { if (log_buffer[0] != '\0') { /* report error to user via stderr file */ if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); } sprintf(log_buffer, "PBS: unable to set limits, err=%d\n", i); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); if (i == PBSE_RESCUNAV) /* resource temp unavailable */ j = JOB_EXEC_RETRY; else j = JOB_EXEC_FAIL2; log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, j, &sjr); } if (LOGLEVEL >= 10) log_ext(-1, id, "set_job complete", LOG_DEBUG); if ((idir = get_job_envvar(pjob, "PBS_O_ROOTDIR")) != NULL) { if (chroot(idir) == -1) { sprintf(log_buffer, "PBS: chroot to %.256s failed: %s\n", idir, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_FAIL2, &sjr); } } /* become the user and execv the shell and become the real job */ if (setgroups(pjob->ji_grpcache->gc_ngroup, (gid_t *)pjob->ji_grpcache->gc_groups) != 0) { snprintf(log_buffer,sizeof(log_buffer), "PBS: setgroups for UID = %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno,id,log_buffer); starter_return(kid_write,kid_read,JOB_EXEC_FAIL2,&sjr); } if (setgid(pjob->ji_qs.ji_un.ji_momt.ji_exgid) != 0) { snprintf(log_buffer,sizeof(log_buffer), "PBS: setgid to %lu for UID = %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exgid, (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno,id,log_buffer); starter_return(kid_write,kid_read,JOB_EXEC_FAIL2,&sjr); } if (setuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) < 0) { snprintf(log_buffer,sizeof(log_buffer), "PBS: setuid to %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_FAIL2, &sjr); } #ifdef _CRAY seteuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid); /* cray kludge */ #endif /* CRAY */ /* cwd to PBS_O_INITDIR if specified, otherwise User's Home */ if ((idir = get_job_envvar(pjob, "PBS_O_INITDIR")) != NULL) { /* in start_process() executed as user */ if (chdir(idir) == -1) { sprintf(log_buffer, "PBS: chdir to %.256s failed: %s\n", idir, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_FAIL2, &sjr); } } else { /* in start_process() executed as user */ if (chdir(pjob->ji_grpcache->gc_homedir) == -1) { sprintf(log_buffer, "PBS: chdir to %.256s failed: %s\n", pjob->ji_grpcache->gc_homedir, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_FAIL2, &sjr); } } if (LOGLEVEL >= 10) log_ext(-1, id, "done - writing pipe and exec'ing", LOG_DEBUG); starter_return( kid_write, kid_read, JOB_EXEC_OK, &sjr); fcntl(kid_write, F_SETFD, FD_CLOEXEC); #if 0 /* def DEBUG */ for (i = 3;i < 40;++i) { /* check for any extra open descriptors */ if (close(i) >= 0) fprintf(stderr, "Closed file %d\n", i); } #endif /* DEBUG */ environ = vtable.v_envp; execvp(argv[0], argv); /* only reached if execvp() fails */ sprintf(log_buffer, "PBS: %.256s: %s\n", argv[0], strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { } fsync(2); log_err(errno, id, log_buffer); starter_return(kid_write, kid_read, JOB_EXEC_CMDFAIL, &sjr); exit(254); /*NOTREACHED*/ return(-1); } /* END start_process() */ /* ** Free the ji_hosts and ji_vnods arrays for a job. If any events are ** attached to an array element, free them as well. */ void nodes_free( job *pj) /* I */ { void arrayfree A_((char **)); hnodent *np; if (pj->ji_vnods != NULL) { free(pj->ji_vnods); pj->ji_vnods = NULL; } if (pj->ji_hosts != NULL) { for (np = pj->ji_hosts;np->hn_node != TM_ERROR_NODE;np++) { eventent *ep = (eventent *)GET_NEXT(np->hn_events); if (np->hn_host) free(np->hn_host); /* don't close stream incase another job uses it */ while (ep) { if (ep->ee_argv) arrayfree(ep->ee_argv); if (ep->ee_envp) arrayfree(ep->ee_envp); delete_link(&ep->ee_next); free(ep); ep = (eventent *)GET_NEXT(np->hn_events); } /* END while (ep) */ } /* END for (np) */ free(pj->ji_hosts); pj->ji_hosts = NULL; } /* END if (pj->ji_hosts != NULL) */ return; } /* END nodes_free() */ /** * Generate array hosts & vnodes for a job from the exec_host attribute. * Call nodes_free() just in case we have seen this job before. * Parse exec_host first to count the number of nodes and allocate * an array of nodeent's. Then, parse it again to get the hostname * of each node and init the other fields of each nodeent element. * The final element will have the ne_node field set to TM_ERROR_NODE. * * @see start_exec() - parent */ void job_nodes( job *pjob) /* I */ { char *id = "job_nodes"; int i, j, nhosts, nodenum; int ix; char *cp, *nodestr; hnodent *hp; vnodent *np; extern char mom_host[]; nodes_free(pjob); nodenum = 1; if (pjob->ji_wattr[(int)JOB_ATR_exec_host].at_flags & ATR_VFLAG_SET) { nodestr = pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str; if (nodestr != NULL) { for (cp = nodestr;*cp;cp++) { if (*cp == '+') nodenum++; } } } else { nodestr = mom_host; } pjob->ji_hosts = (hnodent *)calloc(nodenum + 1, sizeof(hnodent)); pjob->ji_vnods = (vnodent *)calloc(nodenum + 1, sizeof(vnodent)); assert(pjob->ji_hosts); assert(pjob->ji_vnods); pjob->ji_numvnod = nodenum; nhosts = 0; np = pjob->ji_vnods; for (i = 0;i < nodenum;i++, np++) { char *dp, nodename[MAXPATHLEN + 1]; ix = 0; for (cp = nodestr, dp = nodename;*cp;cp++, dp++) { if (*cp == '/') { ix = atoi(cp + 1); while ((*cp != '\0') && (*cp != '+')) ++cp; if (*cp == '\0') { nodestr = cp; break; } } if (*cp == '+') { nodestr = cp + 1; break; } *dp = *cp; } *dp = '\0'; /* see if we already have this host */ for (j = 0;j < nhosts;++j) { if (strcmp(nodename, pjob->ji_hosts[j].hn_host) == 0) break; } hp = &pjob->ji_hosts[j]; if (j == nhosts) { /* need to add host to tn_host */ hp->hn_node = nhosts++; hp->hn_stream = -1; hp->hn_sister = SISTER_OKAY; hp->hn_host = strdup(nodename); CLEAR_HEAD(hp->hn_events); } np->vn_node = i; /* make up node id */ np->vn_host = &pjob->ji_hosts[j]; np->vn_index = ix; if (LOGLEVEL >= 4) { sprintf(log_buffer, "%d: %s/%d", np->vn_node, np->vn_host->hn_host, np->vn_index); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } } /* END for (i) */ np->vn_node = TM_ERROR_NODE; pjob->ji_hosts[nhosts].hn_node = TM_ERROR_NODE; pjob->ji_numnodes = nhosts; pjob->ji_numvnod = nodenum; if (LOGLEVEL >= 2) { sprintf(log_buffer, "job: %s numnodes=%d numvnod=%d", pjob->ji_qs.ji_jobid, nhosts, nodenum); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, id, log_buffer); } return; } /* END job_nodes() */ /** * Start execution of a job. * * @see req_commit() - parent - handle 'commit' request from pbs_server * * @see TMomFinalizeJob1() - child * @see TMomFinalizeJob2() - child * @see TMomFinalizeJob3() - child * * @see start_process() - peer - called for sisters after receiving IM_SPAWN_TASK request * * NOTE: prior to calling start_exec, job is newly allocated, and added to * svr_alljobs w/pjob->ji_qs.ji_state = JOB_STATE_RUNNING and * pjob->ji_qs.ji_substate = JOB_SUBSTATE_PRERUN. * * NOTE: For parallel jobs, this routine will open connections to each sister * mom and will send a join_job request along each connection. */ void start_exec( job *pjob) /* I (modified) */ { static char *id = "start_exec"; eventent *ep; int i, nodenum; int ports[2], socks[2]; struct sockaddr_in saddr; hnodent *np; attribute *pattr; tlist_head phead; svrattrl *psatl; int stream; char tmpdir[MAXPATHLEN]; torque_socklen_t slen; void im_compose A_((int stream, char *jobid, char *cookie, int command, tm_event_t event, tm_task_id taskid)); /* Step 1.0 Generate Cookie */ if (!(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_flags & ATR_VFLAG_SET)) { char *tt; extern time_t loopcnt; MD5_CTX c; int i; /* alloc 33 bytes? */ tt = malloc(33); if (tt == NULL) { log_err(-1,id,"cannot alloc memory"); exec_bail(pjob,JOB_EXEC_FAIL1); return; } pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str = tt; pjob->ji_wattr[(int)JOB_ATR_Cookie].at_flags |= ATR_VFLAG_SET; loopcnt++; MD5Init(&c); MD5Update(&c, (unsigned char *)&loopcnt, sizeof(loopcnt)); MD5Update(&c, (unsigned char *)pjob, sizeof(job)); MD5Final(&c); for (i = 0;i < 16;i++) { sprintf(&tt[i * 2], "%02X", c.digest[i]); } DBPRT(("===== MD5 %s\n", tt)) } /* END if () */ /* Step 2.0 Initialize Job */ /* update nodes info w/in job based on exec_hosts attribute */ job_nodes(pjob); /* start_exec only executed on mother superior */ pjob->ji_nodeid = 0; /* I'm MS */ nodenum = pjob->ji_numnodes; /* Step 3.0 Validate/Initialize Environment */ /* check creds early because we need the uid/gid for TMakeTmpDir() */ if (!check_pwd(pjob)) { log_err(-1, id, log_buffer); exec_bail(pjob, JOB_EXEC_FAIL1); return; } /* should we make a tmpdir? */ if (TTmpDirName(pjob, tmpdir)) { if (!TMakeTmpDir(pjob, tmpdir)) { snprintf(log_buffer, 1024, "cannot create temp dir '%s'", tmpdir); log_err(-1, id, log_buffer); exec_bail(pjob, JOB_EXEC_FAIL1); return; } } /* if nodecount > 1, return once joins are sent, if nodecount == 1, return once job is started */ if (nodenum > 1) { /* Step 4.0A Send Join Request to Sisters */ /* parallel job */ pjob->ji_resources = (noderes *)calloc(nodenum - 1, sizeof(noderes)); assert(pjob->ji_resources != NULL); CLEAR_HEAD(phead); pattr = pjob->ji_wattr; for (i = 0;i < (int)JOB_ATR_LAST;i++) { (job_attr_def + i)->at_encode( pattr + i, &phead, (job_attr_def + i)->at_name, NULL, ATR_ENCODE_MOM); } /* END for (i) */ attrl_fixlink(&phead); /* Open streams to the sisterhood. */ for (i = 1;i < nodenum;i++) { np = &pjob->ji_hosts[i]; log_buffer[0] = '\0'; /* rpp_open() will succeed even if MOM is down */ np->hn_stream = rpp_open(np->hn_host, pbs_rm_port, log_buffer); if (np->hn_stream < 0) { pjob->ji_nodekill = i; if (log_buffer[0] != '\0') { sprintf(log_buffer, "rpp_open failed on %s", np->hn_host); } log_err(errno, id, log_buffer); exec_bail(pjob, JOB_EXEC_FAIL1); return; } } /* END for (i) */ /* Open two sockets for use by demux program later. */ for (i = 0;i < 2;i++) socks[i] = -1; for (i = 0;i < 2;i++) { if ((socks[i] = socket(AF_INET, SOCK_STREAM, 0)) == -1) break; memset(&saddr, '\0', sizeof(saddr)); saddr.sin_addr.s_addr = INADDR_ANY; saddr.sin_family = AF_INET; if (bind( socks[i], (struct sockaddr *)&saddr, sizeof(saddr)) == -1) { break; } slen = sizeof(saddr); if (getsockname(socks[i], (struct sockaddr *)&saddr, &slen) == -1) break; ports[i] = (int)ntohs(saddr.sin_port); } /* END for (i) */ if (i < 2) { /* ERROR: cannot open sockets for stdout and stderr */ for (i = 0;i < 2;i++) { if (socks[i] != -1) close(socks[i]); } /* command sisters to abort job and continue */ log_err(errno, id, "stdout/err socket"); exec_bail(pjob, JOB_EXEC_FAIL1); return; } pjob->ji_stdout = socks[0]; pjob->ji_stderr = socks[1]; /* Send out a JOIN_JOB message to all the MOM's in the sisterhood. */ /* NOTE: does not check success of join request */ for (i = 1;i < nodenum;i++) { np = &pjob->ji_hosts[i]; stream = np->hn_stream; ep = event_alloc(IM_JOIN_JOB, np, TM_NULL_EVENT, TM_NULL_TASK); /* im_compose() will succeed even if mom is down */ im_compose( stream, pjob->ji_qs.ji_jobid, pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str, IM_JOIN_JOB, ep->ee_event, TM_NULL_TASK); diswsi(stream, i); /* nodeid of receiver */ diswsi(stream, nodenum); /* number of nodes */ diswsi(stream, ports[0]); /* out port number */ diswsi(stream, ports[1]); /* err port number */ /* write jobattrs */ psatl = (svrattrl *)GET_NEXT(phead); encode_DIS_svrattrl(stream, psatl); /* NOTE: rpp_flush() will succeed even if MOM is down */ if (rpp_flush(stream) != 0) { sprintf(log_buffer, "ALERT: unable to send join_job message to %s", np->hn_host); log_err(errno, id, log_buffer); } } /* END for (i) */ free_attrlist(&phead); } /* END if (nodenum > 1) */ else { /* Step 4.0B Launch Serial Task Locally */ /* serial job */ int SC; int RC; int Count; pjobexec_t *TJE; /* single node job - no sisters */ ports[0] = -1; ports[1] = -1; pjob->ji_stdout = -1; pjob->ji_stderr = -1; if (TMOMJobGetStartInfo(NULL, &TJE) == FAILURE) { sprintf(log_buffer, "ALERT: cannot locate available job slot"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* on failure, TJE is NULL */ exec_bail(pjob, JOB_EXEC_RETRY); return; } if (TMomFinalizeJob1(pjob, TJE, &SC) == FAILURE) { /* FAILURE (or at least do not continue) */ if (SC != 0) { memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, SC); } return; } /* TMomFinalizeJob2() blocks until job is fully launched */ if (TMomFinalizeJob2(TJE, &SC) == FAILURE) { if (SC != 0) { memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, SC); } return; } if (TMomCheckJobChild(TJE, TJobStartBlockTime, &Count, &RC) == FAILURE) { if (LOGLEVEL >= 3) { sprintf(log_buffer, "job not ready after %ld second timeout, MOM will recheck", TJobStartBlockTime); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } return; } /* NOTE: TMomFinalizeJob3() populates SC */ if (TMomFinalizeJob3(TJE, Count, RC, &SC) == FAILURE) { /* no need to log an error, TMomFinalizeJob3 already does it */ memset(TJE, 0, sizeof(pjobexec_t)); exec_bail(pjob, SC); return; } /* SUCCESS: MOM returns */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "job successfully started"); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } /* clear old TJE */ memset(TJE, 0, sizeof(pjobexec_t)); } /* END else (nodenum > 1) */ /* SUCCESS */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "job %s reported successful start on %d node(s)", pjob->ji_qs.ji_jobid, nodenum); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } return; } /* END start_exec() */ /* * fork_me - fork mom, close all other connections and set default signal actions */ pid_t fork_me( int conn) /* I */ { struct sigaction act; pid_t pid; fflush(stdout); fflush(stderr); pid = fork(); if (pid == 0) { /* now the child */ /* Turn off alarm if it should happen to be on */ alarm(0); rpp_terminate(); /* Reset signal actions for most to SIG_DFL */ sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_DFL; sigaction(SIGCHLD, &act, (struct sigaction *)0); #ifdef _CRAY sigaction(WJSIGNAL, &act, (struct sigaction *)0); #endif /* _CRAY */ sigaction(SIGHUP, &act, (struct sigaction *)0); sigaction(SIGINT, &act, (struct sigaction *)0); sigaction(SIGTERM, &act, (struct sigaction *)0); /* reset signal mask */ sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); mom_close_poll(); /* NOTE: close logfile, lockfile, and connection to server (NYI) */ if (lockfds >= 0) { close(lockfds); lockfds = -1; } log_close(0); net_close(conn); /* close all but for the current */ /* release mlock; it seems to be inherited even though the * man page claims otherwise */ #ifdef _POSIX_MEMLOCK munlockall(); #endif /* _POSIX_MEMLOCK */ } else if (pid < 0) { log_err(errno, "fork_me", "fork failed"); } return(pid); } /* END fork_me() */ /* * starter_return - return starter value, * exit if negative */ static void starter_return( int upfds, /* I */ int downfds, /* I */ int code, /* I */ struct startjob_rtn *sjrtn) /* I */ { struct startjob_rtn ack; int i; sjrtn->sj_code = code; if (write(upfds, (char *)sjrtn, sizeof(*sjrtn)) == -1) { } if (code < 0) close(upfds); /* wait for acknowledgement */ do { i = read(downfds, &ack, sizeof(ack)); if ((i == -1) && (errno != EINTR)) { break; } } while (i < 0); close(downfds); if (code < 0) { exit(254); } return; } /* END starter_return() */ /* * remove_leading_hostname * * removes the leading hostname from the output path in jobpath * the path is stored as : * this retrieves just the path * * @param jobpath - the altered path, I/O * @return SUCCESS if hostname is removed, FALSE otherwise */ int remove_leading_hostname( char **jobpath) /* I / O */ { char *ptr; if ((jobpath == NULL) || (*jobpath == NULL)) { return(FAILURE); } ptr = strchr(*jobpath,':'); if (ptr == NULL) { return(FAILURE); } /* SUCCESS, move past the ':' and return the rest */ ptr++; *jobpath = ptr; return(SUCCESS); } /* * std_file_name - generate the fully qualified path/name for a * job standard stream * * called by TMomFinalizeJob2 fork_me TMomFinalizeChild open_std_out_err open_std_file std_file_name */ char *std_file_name( job *pjob, /* I */ enum job_file which, /* I */ int *keeping) /* O (0 is no keep, 1 is keep) */ { static char path[MAXPATHLEN + 1]; char key; int len; char *pd; char *suffix; char *jobpath = NULL; char *id = "std_file_name"; #ifdef QSUB_KEEP_NO_OVERRIDE char *pt; char endpath[MAXPATHLEN + 1]; #endif #if NO_SPOOL_OUTPUT == 0 int havehomespool = 0; extern char *TNoSpoolDirList[]; #else /* NO_SPOOL_OUTPUT */ struct stat myspooldir; static char path_alt[MAXPATHLEN + 1]; int rcstat; #endif /* NO_SPOOL_OUTPUT */ if (LOGLEVEL >= 5) { sprintf(log_buffer, "getting %s file name", (which == StdOut) ? "stdout" : "stderr"); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } if (keeping == NULL) { /* FAILURE */ return(NULL); } if ((pjob->ji_wattr[(int)JOB_ATR_interactive].at_flags & ATR_VFLAG_SET) && (pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long > 0)) { /* interactive job, name of pty is in outpath */ *keeping = 0; return(pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str); } if (pjob->ji_grpcache == NULL) { /* FAILURE - ji_grpcache required for gc_homedir information */ return(NULL); } switch (which) { case StdOut: key = 'o'; suffix = JOB_STDOUT_SUFFIX; if (pjob->ji_wattr[(int)JOB_ATR_outpath].at_flags & ATR_VFLAG_SET) { jobpath = pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str; if (spoolasfinalname == TRUE) { remove_leading_hostname(&jobpath); if (expand_path(pjob,jobpath,sizeof(path),path) != SUCCESS) { return(NULL); } } } break; case StdErr: key = 'e'; suffix = JOB_STDERR_SUFFIX; if (pjob->ji_wattr[(int)JOB_ATR_errpath].at_flags & ATR_VFLAG_SET) { jobpath = pjob->ji_wattr[(int)JOB_ATR_errpath].at_val.at_str; if (spoolasfinalname == TRUE) { remove_leading_hostname(&jobpath); if (expand_path(pjob,jobpath,sizeof(path),path) != SUCCESS) { return(NULL); } } } break; case Checkpoint: default: key = '\001'; /* should never be found */ suffix = JOB_CHECKPOINT_SUFFIX; break; } /* END switch (which) */ /* everything that changes the path here is ignored if spoolasfinalname is set * to true. spoolasfinalname specifies directly spooling as the output file */ /* Is file to be kept?, if so, place the stderr/stdout files in the * path specified by the user. The path must be local to the execution node, * if a hostname is supplied, it will be stripped off. The only suppported * environment variable is $HOME--any other will cause files to be placed in * the home directory (the default location). */ if ((pjob->ji_wattr[(int)JOB_ATR_keep].at_flags & ATR_VFLAG_SET) && (strchr(pjob->ji_wattr[(int)JOB_ATR_keep].at_val.at_str, key))) { /* yes, it is to be kept */ if (spoolasfinalname == FALSE) { strcpy(path, pjob->ji_grpcache->gc_homedir); pd = strrchr(pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str, '/'); if (pd == NULL) { pd = pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str; strcat(path, "/"); } #ifdef QSUB_KEEP_NO_OVERRIDE /* don't do for checkpoint file names, only StdErr and StdOut */ if (strcmp(suffix, JOB_CHECKPOINT_SUFFIX) != 0) { pt = strstr(jobpath, "$HOME"); if (pt != NULL) { strcpy(endpath, pt + 5); strcpy(pt, pjob->ji_grpcache->gc_homedir); strcat(jobpath, endpath); } if ((strstr(jobpath, pd) == NULL) && (strchr(jobpath, '$') == NULL)) { if (jobpath[strlen(jobpath) - 1] != '/') { strcat(jobpath, "/"); } pt = strchr(jobpath, ':'); if (pt == NULL) { strcpy(path, jobpath); } else { strcpy(path, pt + 1); } } } #endif strcat(path, pd); /* start with the job name */ len = strlen(path); *(path + len++) = '.'; /* the dot */ *(path + len++) = key; /* the letter */ pd = pjob->ji_qs.ji_jobid; /* the seq_number */ while (isdigit((int)*pd)) *(path + len++) = *pd++; *(path + len) = '\0'; } /* END if (spoolasfinalname == FALSE) */ *keeping = 1; } else { /* don't bother keeping output if the user actually wants to discard it */ if ((jobpath != NULL) && (*jobpath != '\0')) { char *ptr; if ((ptr = strchr(jobpath, ':')) != NULL) { jobpath = ptr + 1; } if (!strcmp(jobpath, "/dev/null")) { strcpy(path, "/dev/null"); *keeping = 1; return(path); } } /* put into spool directory unless NO_SPOOL_OUTPUT is defined */ #if NO_SPOOL_OUTPUT == 1 if (spoolasfinalname == FALSE) { /* force all output to user's HOME */ strncpy(path, pjob->ji_grpcache->gc_homedir, sizeof(path)); /* check for $HOME/.pbs_spool */ /* if it's not a directory, just use $HOME us usual */ strncpy(path_alt, path, sizeof(path_alt)); strncat(path_alt, "/.pbs_spool/", sizeof(path_alt)); if (seteuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) == -1) { return(NULL); } rcstat = stat(path_alt, &myspooldir); seteuid(0); if ((rcstat == 0) && (S_ISDIR(myspooldir.st_mode))) strncpy(path, path_alt, sizeof(path)); else strncat(path, "/", sizeof(path)); *keeping = 1; } /* END if (spoolasfinalname == FALSE) */ #else /* NO_SPOOL_OUTPUT */ if (spoolasfinalname == FALSE) { if ((TNoSpoolDirList[0] != NULL)) { int dindex; char *wdir; wdir = get_job_envvar(pjob, "PBS_O_WORKDIR"); if (LOGLEVEL >= 10) { sprintf(log_buffer, "wdir: %s", wdir); log_ext(-1, id, log_buffer, LOG_DEBUG); } if (wdir != NULL) { /* check if job's work dir matches the no-spool directory list */ if (LOGLEVEL >= 10) log_ext(-1, id, "inside wdir != NULL", LOG_DEBUG); for (dindex = 0;dindex < TMAX_NSDCOUNT;dindex++) { if (TNoSpoolDirList[dindex] == NULL) break; if (!strcasecmp(TNoSpoolDirList[dindex], "$WORKDIR") || !strcmp(TNoSpoolDirList[dindex], "*")) { havehomespool = 1; if (LOGLEVEL >= 10) log_ext(-1, id, "inside !strcasecmp", LOG_DEBUG); strncpy(path, wdir, sizeof(path)); break; } if (!strncmp(TNoSpoolDirList[dindex], wdir, strlen(TNoSpoolDirList[dindex]))) { havehomespool = 1; if (LOGLEVEL >= 10) log_ext(-1, id, "inside !strncmp", LOG_DEBUG); strncpy(path, wdir, sizeof(path)); break; } } /* END for (dindex) */ } /* END if (wdir != NULL) */ } /* END if (TNoSpoolDirList != NULL) */ if (havehomespool == 0) { strncpy(path, path_spool, sizeof(path)); } else { strncat(path, "/", sizeof(path)); } } /* END if (spoolasfinalname == FALSE) */ *keeping = 0; #endif /* NO_SPOOL_OUTPUT */ if (spoolasfinalname == FALSE) { strncat(path, pjob->ji_qs.ji_fileprefix, (sizeof(path) - strlen(path) - 1)); strncat(path, suffix, (sizeof(path) - strlen(path) - 1)); if (LOGLEVEL >= 10) { sprintf(log_buffer, "path: '%s' prefix: '%s' suffix: '%s'", path, pjob->ji_qs.ji_fileprefix, suffix); log_ext(-1, id, log_buffer, LOG_DEBUG); } } /* END if (spoolasfinalname == FALSE) */ } /* END else ((pjob->ji_wattr[(int)JOB_ATR_keep].at_flags & ...)) */ return(path); } /* END std_file_name() */ /** * open_std_file - open/create either standard output or standard error * for the job. * * NOTE: called by pbs_mom child - cannot log to mom log file - use * log_err to report to syslog * * RETURN: -1 on failure, -2 on timeout, or file descriptor on success */ int open_std_file( job *pjob, /* I */ enum job_file which, /* which file */ int mode, /* file mode */ gid_t exgid) /* gid for file */ { int fds; int keeping; /* boolean: 1=TRUE, 0=FALSE */ char *path; int old_umask = 0; char *id = "open_std_file"; struct stat statbuf; if ((path = std_file_name(pjob, which, &keeping)) == NULL) { log_err(-1, id, "cannot determine filename"); /* FAILURE - cannot determine filename */ return(-1); } /* these checks are a bit complicated. If keeping, we do what the user * says. Otherwise, make sure we aren't following a symlink and that the user owns the file without breaking /dev/null. */ if (keeping) { mode &= ~O_EXCL; } else { if (lstat(path, &statbuf) == 0) { /* lstat succeeded */ if (S_ISLNK(statbuf.st_mode)) { log_err(-1, id, "std file is symlink, someone is doing something fishy"); return(-1); } if (S_ISREG(statbuf.st_mode)) { if (statbuf.st_uid != pjob->ji_qs.ji_un.ji_momt.ji_exuid) { log_err(-1, id, "std file exists with the wrong owner, someone is doing something fishy"); return(-1); } if ((statbuf.st_gid != exgid) && (statbuf.st_gid != 0)) { int i; int equal = FALSE; /* check all of the secondary groups before throwing an error */ for (i = 0; i < pjob->ji_grpcache->gc_ngroup; i++) { if (statbuf.st_gid == (gid_t)pjob->ji_grpcache->gc_groups[i]) { equal = TRUE; break; } } if (equal == FALSE) { log_err(-1, id, "std file exists with the wrong group, someone is doing something fishy"); return(-1); } } } /* seems reasonably safe to append to the existing file */ /* file exists - do not need to create or open exclusive */ mode &= ~(O_EXCL | O_CREAT); } /* END if (lstat(path,&statbuf) == 0) */ else { /* lstat failed - should we return failure in all cases? */ if (errno == EINTR) { sprintf(log_buffer, "cannot stat stdout/stderr file '%s' (timeout)", path); if (LOGLEVEL >= 6) log_err(errno, id, log_buffer); /* fail on timeout */ return(-2); } else { sprintf(log_buffer, "cannot stat stdout/stderr file '%s' - file does not exist, will create", path); if (LOGLEVEL >= 6) log_ext(errno, id, log_buffer, LOG_DEBUG); } } } /* END else (keeping) */ /* become user to create file, if we aren't already the user. In * run_pelog setuid etc. are called and the this function is invoked, * so doing this again fails and is unnecessary */ if (getuid() == 0) { if (setgroups(pjob->ji_grpcache->gc_ngroup,(gid_t *)pjob->ji_grpcache->gc_groups) != 0) { snprintf(log_buffer,sizeof(log_buffer), "setgroups failed for UID = %lu, error: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); log_err(errno,id,log_buffer); } if (setegid(pjob->ji_qs.ji_un.ji_momt.ji_exgid) != 0) { snprintf(log_buffer,sizeof(log_buffer), "setegid(%lu) failed for UID = %lu, error: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exgid, (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); log_err(errno,id,log_buffer); return(-1); } if (seteuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) != 0) { snprintf(log_buffer,sizeof(log_buffer), "seteuid(%lu) failed, error: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); log_err(errno,id,log_buffer); return(-1); } } if (pjob->ji_wattr[(int)JOB_ATR_umask].at_flags & ATR_VFLAG_SET) { old_umask = umask(pjob->ji_wattr[(int)JOB_ATR_umask].at_val.at_long); } /* open file */ fds = open(path, mode, 0666); if (fds == -1) { sprintf(log_buffer, "cannot open/create stdout/stderr file '%s' (mode: %o, keeping: %s)", path, mode, (keeping == 0) ? "FALSE" : "TRUE"); log_err(errno, id, log_buffer); if (errno == ENOENT) { char *ptr; char tmpLine[1024]; /* parent directory does not exist - find out what part of subtree exists */ strncpy(tmpLine, path, sizeof(tmpLine)); while ((ptr = strrchr(tmpLine, '/')) != NULL) { *ptr = '\0'; if (lstat(tmpLine, &statbuf) == 0) { /* lstat succeeded */ sprintf(log_buffer, "'%s' exists\n", tmpLine); break; } /* END if (lstat(tmpLine,&statbuf) == 0) */ else { /* lstat failed - should we return failure in all cases? */ if (errno == EINTR) sprintf(log_buffer, "cannot stat stdout/stderr file '%s' (timeout)\n", tmpLine); else sprintf(log_buffer, "cannot stat stdout/stderr file '%s' - file does not exist\n", tmpLine); } } /* END while ((ptr = strrchr(tmpLine,'/')) != NULL) */ } /* END if (errno == ENOENT) */ } /* END if (fds == -1) */ if (old_umask) { umask(old_umask); } seteuid(0); setegid(pbsgroup); if (fds == -1) { /* FAILURE - cannot open file */ if (errno == EINTR) { /* TIMEOUT */ return(-2); } } if (LOGLEVEL >= 4) { if (fds >= 0) { sprintf(log_buffer, "successfully created/opened stdout/stderr file '%s'", path); log_ext(-1, id, log_buffer, LOG_DEBUG); } } return(fds); } /* END open_std_file() */ /* * find_env_slot - find if the environment variable is already in the table, * If so, replease existing one with new one. */ static int find_env_slot( struct var_table *ptbl, char *pstr) { int i; int len = 1; /* one extra for '=' */ for (i = 0;(*(pstr + i) != '\0') && (*(pstr + i) != '=');++i) ++len; for (i = 0;i < ptbl->v_used;++i) { if (strncmp(ptbl->v_envp[i], pstr, len) == 0) { return(i); } } /* END for (i) */ return(-1); } /* END find_env_slot() */ /* * bld_env_variables - build up the array of environment variables which are * passed to the job. * * Value may be null if total string (name=value) is included in "name". */ void bld_env_variables( struct var_table *vtable, /* I (modified) */ char *name, /* I (required) */ char *value) /* I (optional) */ { int amt; int i; if (vtable->v_used == vtable->v_ensize) { /* FAILURE - no room for pointer */ return; } if ((name == NULL) || (name[0] == '\0')) { /* FAILURE - name required */ if (LOGLEVEL >= 7) { log_err(-1, "bld_env_variables", "invalid name passed"); } } if (LOGLEVEL >= 10) { char tmpLine[1024]; snprintf(tmpLine, sizeof(tmpLine), "building var '%s' (value: '%.64s')", name, (value != NULL) ? value : "NULL"); log_ext(-1, "bld_env_variables", tmpLine, LOG_DEBUG); } /* * We do not want the BATCH_PARTITION_ID to be passed down to the child. * It just needs to be checked for the job submitted by the user, not for * any jobs that the job might qsub. */ if (memcmp(name,"BATCH_PARTITION_ID",strlen("BATCH_PARTITION_ID")) == 0) { return; } amt = strlen(name) + 1; if (value != NULL) amt += strlen(value) + 1; /* plus 1 for "=" */ if (amt > vtable->v_bsize) { /* FAILURE - no room for string */ return; } strcpy(vtable->v_block, name); if (value != NULL) { strcat(vtable->v_block, "="); strcat(vtable->v_block, value); } if ((i = find_env_slot(vtable, vtable->v_block)) < 0) { *(vtable->v_envp + vtable->v_used++) = vtable->v_block; } else { *(vtable->v_envp + i) = vtable->v_block; } vtable->v_block += amt; vtable->v_bsize -= amt; return; } /* END bld_env_variables() */ #ifndef __TOLDGROUP /* * init_groups - build the group list via an LDAP friendly method */ int init_groups( char *pwname, /* I User's name */ int pwgrp, /* I User's group from pw entry */ int groupsize,/* I size of the array, following argument */ int *groups) /* O ptr to group array, list build there */ { /* DJH Jan 2004. The original implementation looped over all groups looking for membership. Thats OK for /etc/groups, but thrashes LDAP if you're using that for groups in nsswitch.conf. Since there is an explicit LDAP backend to do initgroups (3) efficiently in nss_ldap (on Linux), lets use initgroups() to figure out the group membership. A little clunky, but not too ugly. */ /* return -1 on failure */ char id[] = "init_groups"; extern sigset_t allsigs; /* set up at the start of mom_main */ sigset_t savedset; int n, nsaved; gid_t savedgroups[NGROUPS_MAX + 16]; /* plus one for the egid below */ gid_t momegid; int i; /* save current group access because we're about to overwrite it */ nsaved = getgroups(NGROUPS_MAX, savedgroups); if (nsaved < 0) { log_err(errno, id, "getgroups"); return(-1); } /* From the Linux man page: It is unspecified whether the effective group ID of the calling process is included in the returned list. (Thus, an application should also call getegid(2) and add or remove the resulting value.) */ momegid = getegid(); /* search for duplicates */ for (i = 0;i < nsaved;i++) { if (savedgroups[i] == momegid) break; } if (i >= nsaved) savedgroups[nsaved++] = momegid; if (pwgrp == 0) { /* Emulate the original init_groups() behaviour which treated gid==0 as a special case */ struct passwd *pwe = getpwnam(pwname); if (pwe == NULL) { log_err(errno, id, "no such user"); return(-1); } pwgrp = pwe->pw_gid; } if (LOGLEVEL >= 4) { log_ext(-1, id, "pre-sigprocmask", LOG_DEBUG); } /* Block signals while we do this or else the signal handler might run with strange group access */ if (sigprocmask(SIG_BLOCK, &allsigs, &savedset) == -1) { log_err(errno, id, "sigprocmask(BLOCK)"); return(-1); } n = 0; if (initgroups(pwname, pwgrp) < 0) { log_err(errno, id, "initgroups"); n = -1; } else { n = getgroups(groupsize, (gid_t *)groups); } if (LOGLEVEL >= 4) { log_ext(-1, id, "post-initgroups", LOG_DEBUG); } /* restore state */ if (setgroups(nsaved, savedgroups) < 0) log_err(errno, id, "setgroups"); if (sigprocmask(SIG_SETMASK, &savedset, NULL) == -1) log_err(errno, id, "sigprocmask(SIG_SETMASK)"); return(n); } /* END init_groups() */ #else /* !__TOLDGROUP */ /* * init_groups - read the /etc/group file and build an array of * group memberships for user pwname. */ int init_groups( char *pwname, /* I User's name */ int pwgrp, /* I User's group from pw entry */ int groupsize, /* I size of the array, following argument */ int *groups) /* O ptr to group array, list build there */ { struct group *grp; int i; int n; n = 0; if (pwgrp != 0) *(groups + n++) = pwgrp; setgrent(); while ((grp = getgrent())) { if (grp->gr_gid == (gid_t)pwgrp) continue; for (i = 0;grp->gr_mem[i];i++) { if (!strcmp(grp->gr_mem[i], pwname)) { if (n == groupsize) { endgrent(); return(-1); } *(groups + n++) = grp->gr_gid; } } } /* END while (grp) */ endgrent(); return(n); } /* END init_groups() */ #endif /* !__TOLDGROUP */ /* * catchinter = catch death of writer child and/or shell child of interactive * When one dies, kill off the other; there is no mercy in this family. */ static void catchinter( int sig) /* I (not used) */ { int status; pid_t pid; pid = waitpid(-1, &status, WNOHANG); if (pid == 0) { return; } if (pid == writerpid) { kill(shellpid, SIGKILL); wait(&status); } else { kill(writerpid, SIGKILL); wait(&status); } mom_reader_go = 0; return; } /* END catchinter() */ /* * Look for a certain environment variable which has a port# which should * be opened on the MS to establish communication for one of the 3 stdio * streams. >=0 return is that valid fd, -1 means no env var found, * -2 means malformed env value or failure to connect. */ static int search_env_and_open( const char *envname, /* I */ u_long ipaddr) /* I */ { static char *id = "search_env_and_open"; int i, len; len = strlen(envname); for (i = 0;i < vtable.v_used;i++) { if (!strncmp(vtable.v_envp[i], envname, len)) { const char *cp = vtable.v_envp[i] + len; char *cq; int fd, port; if (*cp++ != '=') break; /* empty, ignore it */ port = strtol(cp, &cq, 10); if (*cq) { sprintf(log_buffer, "improper value for %s", envname); log_err(errno, id, log_buffer); return(-2); } #if 0 /* debugging */ log_err(-1, "search_env_and_open attempting open", vtable.v_envp[i]); #endif if ((fd = open_demux(ipaddr, port)) < 0) { sprintf(log_buffer, "failed connect to stdio on %s:%d", vtable.v_envp[i], port); log_err(errno, id, log_buffer); return(-2); } return(fd); } } /* END for (i) */ /* not found */ return(-1); } /* END search_env_and_open() */ int TMomCheckJobChild( pjobexec_t *TJE, /* I */ int Timeout, /* I (in seconds) */ int *Count, /* O (bytes read) */ int *RC) /* O (return code/errno) */ { int i; fd_set fdset; int rc; struct timeval timeout; /* NOTE: assume if anything is on pipe, everything is on pipe (may reasult in hang) */ /* block up to timeout, wait for child to complete indicating success/failure of job launch */ /* read returns the session id or error */ timeout.tv_sec = Timeout; timeout.tv_usec = 0; errno = 0; FD_ZERO(&fdset); FD_SET(TJE->jsmpipe[0], &fdset); rc = select( TJE->jsmpipe[0] + 1, &fdset, (fd_set *)NULL, (fd_set *)NULL, &timeout); if (rc <= 0) { /* TIMEOUT - data not yet available */ return(FAILURE); } for (;;) { i = read( TJE->jsmpipe[0], (char *) & TJE->sjr, sizeof(struct startjob_rtn)); if ((i == -1) && (errno == EINTR)) continue; break; } *RC = errno; *Count = i; if (LOGLEVEL >= 4) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, (TJE->pjob != NULL) ? ((job *)TJE->pjob)->ji_qs.ji_jobid : "???", "task/session info loaded"); } return(SUCCESS); } /* END TMomCheckJobChild() */ #ifdef USEJOBCREATE /* * Get a job_id from the system. Return job id or -1 if error */ uint64_t get_jobid( char* pbs_jobid) { static char *id = "get_jobid"; uint64_t job_id; #ifndef JOBFAKE job_id = job_create(0, getuid(), 0); #else static long fakejobid = 0x00000000ffffffff; srand(getpid() + time(NULL)); job_id = fakejobid + rand(); #endif /* JOBFAKE */ if (job_id == JOB_FAIL) { if (LOGLEVEL >= 3) { sprintf(log_buffer, "Failed to get system job id for pbs job %s", pbs_jobid); log_err(-1, id, log_buffer); } return(job_id); } if (LOGLEVEL >= 7) { sprintf(log_buffer, "Got system job id = %lx(%ld) for pbs job %s", job_id, job_id, pbs_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } return(job_id); } /* END get_jobid() */ #endif /* USEJOBCREATE */ #ifdef ENABLE_CSA /* * Check to see if CSA in installed or turned on. Return 1 if it is good else 0 */ int check_csa_status(enum csa_chk_cmd chk_action) { #ifndef CSAFAKE static char *id = "check_csa_status"; #endif /* CSAFAKE */ int csa_stat = 0; #ifndef CSAFAKE struct csa_check_req ck_req; ck_req.ck_stat.am_id = (chk_action == IS_INSTALLED) ? ACCT_KERN_CSA : ACCT_DMD_WKMG; ck_req.ck_stat.am_status = ACS_OFF; ck_req.ck_stat.am_param = 0; if (csa_check(&ck_req) != 0) { if (errno != ENOSYS) { sprintf("check_csa_status errno = %d\n", errno); log_err(-1, id, log_buffer); } return 0; } if (chk_action == IS_INSTALLED) { /* since the call to csa_check was successful, we know csa is installed */ csa_stat = 1; } else { csa_stat = (ck_req.ck_stat.am_status != ACS_ON) ? 0 : 1; } #else csa_stat = 1; #endif /* CSAFAKE */ return(csa_stat); } /* * createWLMRec() Create Workload Management Record * Inputs: job_id - job ID * type - start or termination record * subtype - Subtype of record * prid - project ID * ash - Array session handle * code - account ID * reqid - Request ID * compCode - Request completion code * calls: csa_wracct() * Return 1 if it is good, otherwise 0 * */ int create_WLM_Rec( char* pbs_jobid, uint64_t job_id, int type, int subtype, uint64_t prid, uint64_t ash, int64_t compCode, int64_t reqid) { static char *id = "create_WLM_Rec"; #ifndef CSAFAKE struct csa_wra_req cw; struct wkmgmtbs wkm; #endif /* CSAFAKE */ char rec_type[8]; char sub_type[8]; /* * First, create an workload management record */ if (type == WM_INIT) { strcpy(rec_type, "init"); if (subtype == WM_INIT_START) { strcpy(sub_type, "start"); } else if (subtype == WM_INIT_RESTART) { strcpy(sub_type, "restart"); } else if (subtype == WM_INIT_RERUN) { strcpy(sub_type, "rerun"); } else { sprintf(log_buffer, "WM_INIT bad sub type = %d for pbs job %s", subtype, pbs_jobid); log_err(-1, id, log_buffer); return 0; } } else if (type == WM_TERM) { strcpy(rec_type, "term"); if (subtype == WM_TERM_EXIT) { strcpy(sub_type, "exited"); } else if (subtype == WM_TERM_REQUEUE) { strcpy(sub_type, "requeue"); } else if (subtype == WM_TERM_HOLD) { strcpy(sub_type, "hold"); } else if (subtype == WM_TERM_RERUN) { strcpy(sub_type, "rerun"); } else if (subtype == WM_TERM_MIGRATE) { strcpy(sub_type, "migrate"); } else { sprintf(log_buffer, "WM_TERM bad sub type = %d for pbs job %s", subtype, pbs_jobid); log_err(-1, id, log_buffer); return 0; } } else if (type == WM_RECV) { strcpy(rec_type, "recv"); if (subtype == WM_RECV_NEW) { strcpy(sub_type, "new"); } else { sprintf(log_buffer, "WM_RECV bad sub type = %d for pbs job %s", subtype, pbs_jobid); log_err(-1, id, log_buffer); return 0; } } else { sprintf(log_buffer, "bad record type = %d for pbs job %s", type, pbs_jobid); log_err(-1, id, log_buffer); return 0; } #ifdef CSAFAKE if (LOGLEVEL >= 7) { sprintf(log_buffer, "Creating FAKE CSA workload management %s - %s record for: " "job_id = %lx, compCode = %d, pbs job %s", (char*)&rec_type, (char*)&sub_type, job_id, (int)compCode, pbs_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } #else if (LOGLEVEL >= 7) { sprintf(log_buffer, "Creating CSA workload management %s - %s record for: " "job_id = %llx, compCode = %d, pbs job %s", &rec_type, &sub_type, job_id, compCode, pbs_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } memset(&wkm, 0, sizeof(wkm)); /* fill in header data */ wkm.hdr.ah_magic = ACCT_MAGIC; wkm.hdr.ah_revision = REV_APP; wkm.hdr.ah_type = ACCT_DAEMON_WKMG; if (!getuid() || ! geteuid()) wkm.hdr.ah_flag |= ASU; /* set super user flag */ wkm.hdr.ah_size = sizeof(struct wkmgmtbs); /* fill in rest of needed data */ wkm.type = type; wkm.subtype = subtype; wkm.arrayid = 0; strncpy(&wkm.serv_provider[0], "TORQUE ", sizeof(wkm.serv_provider)); if ((wkm.time = time(NULL)) == (time_t) - 1) { sprintf(log_buffer, "error setting time, errno = %d - %s pbs job = %s", errno, strerror(errno), pbs_jobid); log_err(-1, id, log_buffer); return 0; } if ((wkm.enter_time = time(NULL)) == (time_t) - 1) { sprintf(log_buffer, "error setting INIT enter time, errno = %d - %s pbs job = %s", errno, strerror(errno), pbs_jobid); log_err(-1, id, log_buffer); return 0; } wkm.uid = getuid(); wkm.prid = prid; wkm.ash = ash; wkm.jid = job_id; /* * character fields need to be NULL terminated */ strncpy(&wkm.machname[0], "TORQUE-MACHINE", sizeof(wkm.machname) - 1); strncpy(&wkm.reqname[0], "TORQUE-REQUEST", sizeof(wkm.reqname) - 1); strncpy(&wkm.quename[0], "TORQUE-QUEUE", sizeof(wkm.quename) - 1); wkm.reqid = reqid; if (type == WM_TERM) { wkm.code = compCode; } /* * Fill in the CSA_WRACCT request structure for csa ioctl call */ memset(&cw, 0, sizeof(cw)); cw.wra_did = ACCT_DMD_WKMG; /* daemon ID */ cw.wra_len = sizeof(struct wkmgmtbs); /* length of app record */ cw.wra_jid = job_id; /* job Id from job create */ cw.wra_buf = (char *) & wkm; /* pointer to record */ if (csa_wracct(&cw)) { /* EINVAL is okay for a WM_TERM */ if ((type != WM_TERM) && (errno != EINVAL)) { sprintf(log_buffer, "error writing wkm %s record, errno=%d - %s pbs job = %s", &rec_type, errno, strerror(errno), pbs_jobid); log_err(-1, id, log_buffer); return 0; } } #endif /* CSAFAKE */ return 1; } /* * add_wkm_start - Add an start workload management record for a job */ void add_wkm_start( uint64_t job_id, char* pbs_jobid) { static char *id = "add_wkm_start"; if (check_csa_status(IS_UP)) { /* check if we have a valid job id, if not just return */ if (job_id == JOB_FAIL) { if (LOGLEVEL >= 2) { sprintf(log_buffer, "%s called with bad job id = %lx for pbs job %s", id, job_id, pbs_jobid); log_err(-1, id, log_buffer); } return; } /* Add a workload management received record before the start */ if (create_WLM_Rec(pbs_jobid, job_id, WM_RECV, WM_RECV_NEW, 0, 0, 0, 0)) { if (LOGLEVEL >= 7) { sprintf(log_buffer, "Added CSA workload management WM_RECV for job id = %lx for pbs job %s", job_id, pbs_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } } else { if (LOGLEVEL >= 2) { sprintf(log_buffer, "Failed to add CSA workload management WM_RECV for job id = %lx for pbs job %s", job_id, pbs_jobid); log_err(-1, id, log_buffer); } return; } if (create_WLM_Rec(pbs_jobid, job_id, WM_INIT, WM_INIT_START, 0, 0, 0, 0)) { if (LOGLEVEL >= 7) { sprintf(log_buffer, "Added CSA workload management WM_INIT for job id = %lx for pbs job %s", job_id, pbs_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } } else if (LOGLEVEL >= 2) { sprintf(log_buffer, "Failed to add CSA workload management WM_INIT for job id = %lx for pbs job %s", job_id, pbs_jobid); log_err(-1, id, log_buffer); } } return; } /* END add_wkm_start() */ /* * add_wkm_end - Add an end workload management record for a job */ void add_wkm_end( uint64_t job_id, int64_t comp_code, char* pbs_jobid) { static char *id = "add_wkm_end"; if (check_csa_status(IS_UP)) { /* check if we have a valid job id, if not just return */ if (job_id == JOB_FAIL) { if (LOGLEVEL >= 2) { sprintf(log_buffer, "%s called with bad job id = %lx for pbs job %s", id, job_id, pbs_jobid); log_err(-1, id, log_buffer); } return; } if (create_WLM_Rec(pbs_jobid, job_id, WM_TERM, WM_TERM_EXIT, 0, 0, comp_code, 0)) { if (LOGLEVEL >= 7) { sprintf(log_buffer, "Added CSA workload management WM_TERM for job id = %lx for pbs job %s", job_id, pbs_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } } else if (LOGLEVEL >= 2) { sprintf(log_buffer, "Failed to add CSA workload management WM_TERM for job id = %lx for pbs job %s", job_id, pbs_jobid); log_err(-1, id, log_buffer); } } return; } /* END add_wkm_end() */ #endif /* ENABLE_CSA */ /* * @param pjob - used to set up the user's environment if desired * @param path_in - the path that will be expanded * @param pathlen - viable space in path * @param path - where to save the new path */ int expand_path( job *pjob, /* I optional */ char *path_in, /* I */ int pathlen, /* I */ char *path) /* I */ { #ifndef HAVE_WORDEXP /* no need for expansion if this isn't defined */ return(SUCCESS); #else wordexp_t exp; if ((path_in == NULL) || (path == NULL)) { /* must have inputs and outputs */ return(FAILURE); } if (vtable.v_envp == NULL) { if (pjob != NULL) { InitUserEnv(pjob,NULL,NULL,NULL,NULL); *(vtable.v_envp + vtable.v_used) = NULL; environ = vtable.v_envp; } else { /* if there is no environment, there's no way to expand words */ path = path_in; return(SUCCESS); } } else { *(vtable.v_envp + vtable.v_used) = NULL; environ = vtable.v_envp; } /* expand the path */ switch (wordexp(path_in, &exp, WRDE_NOCMD | WRDE_UNDEF)) { case 0: /* success - allow if word count is 1 */ if (exp.we_wordc == 1) { snprintf(path,pathlen,"%s",exp.we_wordv[0]); wordfree(&exp); return(SUCCESS); } /* fall through */ case WRDE_NOSPACE: wordfree(&exp); /* fall through */ default: return(FAILURE); } /* END switch () */ /* not reached */ return(FAILURE); #endif /* HAVE_WORD_EXP */ } /* END start_exec.c */ torque-2.4.16/src/resmom/checkpoint.c0000664000113300011330000014360111605403054014423 00000000000000 /* Copyright 2008 Cluster Resources */ /** * checkpoint.c * * Support for job checkpoint and restart. * * Note that there are two coexistent systems for implementing * checkpoint and restart. The older one is based on machine * dependent code in the mom_mach.c module. The newer one uses * the BLCR system modules. The working of the code below is * based on the variable checkpoint_system_type which can have * the values CST_NONE, CST_MACH_DEP or CST_BLCR. This variable * is set by calling mom_does_checkpoint at system startup time. * * The CST_MACH_DEP system uses a directory based scheme of * taking a checkpoint and produces a file for each task. The * restart code iterates over the directory and does a restart * task for each file it finds. The entire set of files must * be written for the checkpoint to be valid. To ensure this, * an existing checkpoint directory is renamed with a .old * extension while writing a new checkpoint. If something * fails during this process, recovery code will notice the * .old directory and deduce that the existing directory is * invalid and should be deleted at the same time renaming * the backup to the current. * * In the case of the CST_BLCR system, BLCR is MPI aware and * takes care of doing the checkpoints for each task. * By the way, a task as defined in Torque is a process group * executing on a node. * So the checkpoint and restore for BLCR is done on the head * node task. A directory can be specified where the checkpoint * image will reside but there is only one file per checkpoint. * BLCR also differs in that multiple checkpoint images are * allowed to exist on the disk and when the restart is performed, * the name in the job is used to decide which one of these is * to be used. This name may be altered to a previous image by * the operators use of the qalter command. * */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dis.h" #include "libpbs.h" #include "pbs_error.h" #include "pbs_job.h" #include "batch_request.h" #include "attribute.h" #include "resmon.h" #include "mom_mach.h" #include "mom_func.h" #include "log.h" #include "mcom.h" #include "net_connect.h" #include "resource.h" #include "csv.h" #include "svrfunc.h" #include "pbs_ifl.h" extern int exiting_tasks; extern int LOGLEVEL; extern int lockfds; extern int ForceServerUpdate; extern char TORQUE_JData[]; extern int task_recov(job *pjob); extern char *path_spool; extern char *path_jobs; extern char *TRemChkptDirList[]; #ifdef USEJOBCREATE extern uint64_t get_jobid(char *); #endif /* USEJOBCREATE */ #ifdef ENABLE_CSA extern void add_wkm_start(uint64_t, char *); #endif /* ENABLE_CSA */ int checkpoint_system_type = CST_NONE; char path_checkpoint[MAXPATHLEN + 1]; /* BLCR variables */ char checkpoint_script_name[MAXPATHLEN + 1]; char restart_script_name[MAXPATHLEN + 1]; char checkpoint_run_exe_name[MAXPATHLEN + 1]; int default_checkpoint_interval = 10; /* minutes */ extern char *mk_dirs A_((char *)); extern int mom_open_socket_to_jobs_server A_((job *, char *, void (*) A_((int)))); extern void set_attr A_((struct attrl **, char *, char *)); int create_missing_files(job *pjob); /* The following is used for building command line args * and makes sure that at least something is generated * for each arg so that the script gets a consistent * command line. */ #define SET_ARG(x) (((x) == NULL) || (*(x) == 0))?"-":(x) /** * mom_checkpoint_job_is_checkpointable * * @param pjob Pointer to job structure. * @see TMomFinalizeChild */ int mom_checkpoint_job_is_checkpointable(job *pjob) { attribute *pattr; int rc; pattr = &pjob->ji_wattr[(int)JOB_ATR_checkpoint]; rc = checkpoint_system_type != CST_NONE && checkpoint_script_name[0] != 0 && (pattr->at_flags & ATR_VFLAG_SET) && ((csv_find_string(pattr->at_val.at_str, "c") != NULL) || (csv_find_string(pattr->at_val.at_str, "s") != NULL) || (csv_find_string(pattr->at_val.at_str, "enabled") != NULL) || (csv_find_string(pattr->at_val.at_str, "shutdown") != NULL) || (csv_find_string(pattr->at_val.at_str, "periodic") != NULL)); return(rc); } /** * mom_checkpoint_execute_job * * This routine is called from the newly created child process. * It is required for the BLCR system because the job must run as * a child of the cr_run program. * * @param pjob Pointer to job structure. * @see TMomFinalizeChild */ int mom_checkpoint_execute_job(job *pjob, char *shell, char *arg[], struct var_table *vtable) { static char *id = "mom_checkpoint_execute_job"; /* Launch job executable with cr_run command so that cr_checkpoint command will work. */ /* shuffle up the existing args */ arg[5] = arg[4]; arg[4] = arg[3]; arg[3] = arg[2]; arg[2] = arg[1]; /* replace first arg with shell name note, this func is called from a child process that exits after the executable is launched, so we don't have to worry about freeing this malloc later */ arg[1] = malloc(strlen(shell) + 1); if (arg[1] == NULL) { log_err(errno,id,"cannot alloc env"); return(-1); } strcpy(arg[1], shell); arg[0] = checkpoint_run_exe_name; if (LOGLEVEL >= 10) { char cmd[MAXPATHLEN + 1]; int i; strcpy(cmd,arg[0]); for (i = 1; arg[i] != NULL; i++) { strcat(cmd," "); strcat(cmd,arg[i]); } strcat(cmd,")"); log_buffer[0] = '\0'; sprintf(log_buffer, "execing checkpoint command (%s)\n", cmd); log_ext(-1, id, log_buffer, LOG_DEBUG); } execve(checkpoint_run_exe_name, arg, vtable->v_envp); return (0); } /** * mom_checkpoint_init * * This routine is called from the mom startup code. * @see setup_program_environment */ int mom_checkpoint_init(void) { int c = 0; char *path_checkpt_tmp; checkpoint_system_type = mom_does_checkpoint(); /* {CST_NONE, CST_MACH_DEP, CST_BLCR} */ if (strlen(path_checkpoint) == 0) /* if not -C option */ { /* mk_dirs mallocs the string it returns so this string must be freed */ path_checkpt_tmp = mk_dirs("checkpoint/"); snprintf(path_checkpoint,sizeof(path_checkpoint),"%s",path_checkpt_tmp); free(path_checkpt_tmp); } #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) c = chk_file_sec(path_checkpoint, 1, 0, S_IWGRP | S_IWOTH, 1, NULL); #endif /* not DEBUG and not NO_SECURITY_CHECK */ return(c); } /*========================================================================*/ /* Routines called from the config file parsing to set various variables. */ /*========================================================================*/ void mom_checkpoint_set_directory_path( char *str) { char *cp; strcpy(path_checkpoint, str); cp = &path_checkpoint[strlen(path_checkpoint)]; if (*cp != '/') { *cp++ = '/'; *cp++ = 0; } } unsigned long mom_checkpoint_set_checkpoint_interval(char *value) /* I */ { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "checkpoint_interval", value); default_checkpoint_interval = atoi(value); return(1); } /* END set_checkpoint_script() */ unsigned long mom_checkpoint_set_checkpoint_script(char *value) /* I */ { struct stat sbuf; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "checkpoint_script", value); if ((stat(value, &sbuf) == -1) || !(sbuf.st_mode & S_IXUSR)) { /* file does not exist or is not executable */ return(0); /* error */ } strncpy(checkpoint_script_name, value, sizeof(checkpoint_script_name)); return(1); } /* END set_checkpoint_script() */ unsigned long mom_checkpoint_set_restart_script(char *value) /* I */ { struct stat sbuf; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "restart_script", value); if ((stat(value, &sbuf) == -1) || !(sbuf.st_mode & S_IXUSR)) { /* file does not exist or is not executable */ return(0); /* error */ } strncpy(restart_script_name, value, sizeof(restart_script_name)); return(1); } /* END set_restart_script() */ unsigned long mom_checkpoint_set_checkpoint_run_exe_name(char *value) /* I */ { struct stat sbuf; log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "checkpoint_run_exe", value); if ((stat(value, &sbuf) == -1) || !(sbuf.st_mode & S_IXUSR)) { /* file does not exist or is not executable */ return(0); /* error */ } strncpy(checkpoint_run_exe_name, value, sizeof(checkpoint_run_exe_name)); return(1); } /* END set_checkpoint_run_exe() */ /* * get_jobs_default_checkpoint_dir - Fills in jobs default checkpoint path. */ void get_jobs_default_checkpoint_dir( job *pjob, /* I */ char *defaultpath) /* O */ { strcpy(defaultpath, path_checkpoint); strcat(defaultpath, pjob->ji_qs.ji_fileprefix); strcat(defaultpath, JOB_CHECKPOINT_SUFFIX); return; } /* END get_jobs_default_checkpoint_dir() */ /* * replace_checkpoint_path - Replaces MOM_DEFAULT_CHECKPOINT_DIR in string * with the default checkpoint path. Returns 1 if path was changed else 0. */ int replace_checkpoint_path( char *path) /* I */ { char *id = "replace_checkpoint_path"; char *ptr1; char *ptr2; char tmppath[MAXPATHLEN+1]; int len; int rtnval = 0; memcpy(tmppath, path, strlen(path)); ptr1 = strstr(path, MOM_DEFAULT_CHECKPOINT_DIR); ptr2 = strstr(tmppath, MOM_DEFAULT_CHECKPOINT_DIR); if (ptr1 != NULL) { ptr1++; ptr1 = strchr(ptr1,'$'); ptr1++; len = strlen(path_checkpoint); memcpy(ptr2, path_checkpoint, len); ptr2 += len; if ((path_checkpoint[strlen(path_checkpoint) - 1] == '/') && (ptr1[0] == '/')) { ptr1++; } strcpy(ptr2, ptr1); strcpy(path, tmppath); sprintf(log_buffer,"Converted filename is (%s)\n", path); log_ext(-1, id, log_buffer, LOG_DEBUG); rtnval = 1; } return (rtnval); } /* END replace_checkpoint_path() */ /* * in_remote_checkpoint_dir - Checks if path is in the remote checkpoint * directories list TRemChkptDirList. If it is then returns TRUE else FALSE * */ int in_remote_checkpoint_dir( char *ckpt_path) /* I */ { char *id = "in_remote_checkpoint_dir"; int dindex; /* * Is the checkpoint directory in the TRemChkptDirList */ for (dindex = 0;dindex < TMAX_RCDCOUNT;dindex++) { if (TRemChkptDirList[dindex] == NULL) { if ((LOGLEVEL >= 10) && (dindex == 0)) { sprintf(log_buffer, "NO remote checkpoint directories configured"); log_ext(-1, id, log_buffer, LOG_DEBUG); } break; } if (!strncasecmp(TRemChkptDirList[dindex], ckpt_path, strlen(TRemChkptDirList[dindex])) || !strcmp(TRemChkptDirList[dindex], "*")) { if (LOGLEVEL >= 10) { sprintf(log_buffer, "Checkpoint file %s matched in remote directory %s\n", ckpt_path, TRemChkptDirList[dindex]); log_ext(-1, id, log_buffer, LOG_DEBUG); } return (TRUE); } } /* END for (dindex) */ return (FALSE); } /* END in_remote_checkpoint_dir() */ /** * delete_blcr_checkpoint_files * * This routine is called to remove a checkpoint file / directory * * @param pjob Pointer to the job structure * @param local_only Set TRUE to delete only local files * @param forced Set TRUE to delete the default job checkpoint directory */ void delete_blcr_checkpoint_files( job *pjob, int local_only, int forced) { static char id[] = "delete_blcr_checkpoint_files"; char namebuf[MAXPATHLEN+1]; if ((pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_flags & ATR_VFLAG_SET) == 0) { if (LOGLEVEL > 7) { sprintf(log_buffer, "No checkpoint directory specified for %s\n", pjob->ji_qs.ji_jobid); log_ext(-1, id, log_buffer, LOG_DEBUG); } return; } if (pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_flags & ATR_VFLAG_SET) { /* delete any checkpoint file */ strcpy(namebuf, pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str); strcat(namebuf, "/"); strcat(namebuf, pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_val.at_str); /* if we are using the default checkpoint path then we may need to clean * up the job directory but not if we are running on the server node */ if ((forced) && (strncmp(namebuf, path_checkpoint, strlen(path_checkpoint)) == 0)) { char *ptr1; ptr1 = strrchr(namebuf, '/'); if (ptr1 != NULL) { ptr1[0] = '\0'; } } if ((!local_only) || (!in_remote_checkpoint_dir(namebuf))) { if (LOGLEVEL >= 7) { sprintf(log_buffer, "remtree for checkpoint %s\n",namebuf); log_ext(-1, id, log_buffer, LOG_DEBUG); } remtree(namebuf); } } if (pjob->ji_wattr[(int)JOB_ATR_restart_name].at_flags & ATR_VFLAG_SET) { /* delete any checkpoint restart file */ strcpy(namebuf, pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str); strcat(namebuf, "/"); strcat(namebuf, pjob->ji_wattr[(int)JOB_ATR_restart_name].at_val.at_str); /* if we are using the default checkpoint path then we may need to clean * up the job directory but not if we are running on the server node */ if ((forced) && (strncmp(namebuf, path_checkpoint, strlen(path_checkpoint)) == 0)) { char *ptr1; ptr1 = strrchr(namebuf, '/'); if (ptr1 != NULL) { ptr1[0] = '\0'; } } if ((!local_only) || (!in_remote_checkpoint_dir(namebuf))) { if (LOGLEVEL >= 7) { sprintf(log_buffer, "remtree for restart %s\n",namebuf); log_ext(-1, id, log_buffer, LOG_DEBUG); } remtree(namebuf); } } return; } /* END delete_blcr_checkpoint_files() */ /** * mom_checkpoint_delete_files * * This routine is called from the job_purge routine * which cleans up all files related to a job. * * @param pjob Pointer to the job structure * @see job_purge */ void mom_checkpoint_delete_files( job *pjob) { char namebuf[MAXPATHLEN+1]; if (checkpoint_system_type == CST_MACH_DEP) { /* delete any checkpoint file */ get_jobs_default_checkpoint_dir(pjob, namebuf); remtree(namebuf); } else if (checkpoint_system_type == CST_BLCR) { delete_blcr_checkpoint_files(pjob, TRUE, FALSE); } return; } /* END mom_checkpoint_delete_files() */ /** * mom_checkpoint_recover * * This routine is called from init_abort_jobs which in turn is called * on mom startup. The purpose is to recover jobs listed in the mom_priv/jobs * directory. * * This routine does not actually start the job. This happens in start_exec.c. * It's purpose is to remove a partially completed checkpoint directory, * signified by the name suffix of ".old". * * @param pjob Pointer to job data structure * @see init_abort_jobs */ void mom_checkpoint_recover( job *pjob) { char path[MAXPATHLEN + 1]; char oldp[MAXPATHLEN + 1]; struct stat statbuf; if (checkpoint_system_type == CST_MACH_DEP) { /* ** Check to see if a checkpoint.old dir exists. ** If so, remove the regular checkpoint dir ** and rename the old to the regular name. */ get_jobs_default_checkpoint_dir(pjob, path); strncpy(oldp, path, MAXPATHLEN); strncat(oldp, ".old", MAXPATHLEN); if (stat(oldp, &statbuf) == 0) { remtree(path); if (rename(oldp, path) == -1) remtree(oldp); } } return; } /** * mom_checkpoint_check_periodic_timer * * This routine is called from the main loop routine examine_all_running_jobs. * Each job that is checkpointable will have timer variables set up. * This routine checks the timer variables and if set and it is time * to do a checkpoint, fires the code that starts a checkpoint. * * @param pjob Pointer to the job structure * @see examine_all_running_jobs * @see main_loop */ void mom_checkpoint_check_periodic_timer( job *pjob) { resource *prwall; extern int start_checkpoint(); int rc; static resource_def *rdwall; /* see if need to checkpoint any job */ if (pjob->ji_checkpoint_time != 0) /* ji_checkpoint_time gets set below */ { if (rdwall == NULL) { rdwall = find_resc_def(svr_resc_def, "walltime", svr_resc_size); } if (rdwall != NULL) { prwall = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resc_used], rdwall); /* resource definition cput set in startup */ if (prwall && (prwall->rs_value.at_val.at_long >= pjob->ji_checkpoint_next)) { pjob->ji_checkpoint_next = prwall->rs_value.at_val.at_long + pjob->ji_checkpoint_time; if ((rc = start_checkpoint(pjob, 0, 0)) != PBSE_NONE) { sprintf(log_buffer, "Checkpoint failed, error %d", rc); message_job(pjob, StdErr, log_buffer); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } } } return; } /* END mom_checkpoint_check_periodic_timer() */ /** * blcr_checkpoint_job * * This routine lauches the checkpoint script for a BLCR * checkpoint system. * currently only supports single process job, so a BLCR job will * only have one task associated with the job. * * @see start_checkpoint() - parent * * @returns PBSE_NONE if no error */ int blcr_checkpoint_job( job *pjob, /* I */ int abort, /* I */ struct batch_request *preq) /* may be null */ { char *id = "blcr_checkpoint_job"; char sid[20]; char *arg[20]; char buf[1024]; char **ap; FILE *fs; char *cmd; int rc; int request_type = 0; char err_buf[4098]; char line[1028]; int conn; int err; struct attrl *attrib = NULL; time_t epoch; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str != NULL); /* Make sure that the specified directory exists. */ if (mkdir(pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str, 0755) == 0) { /* Change the owner of the checkpoint directory to be the user */ if (chown(pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str, pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1) { log_err(errno, id, "cannot change checkpoint directory owner"); } } /* if a checkpoint script is defined launch it */ if (checkpoint_script_name[0] == '\0') { log_err(PBSE_RMEXIST, id, "No checkpoint script defined"); if (preq != NULL) { req_reject(PBSE_RMEXIST,PBS_CHECKPOINT_MIGRATE,preq,NULL,NULL); } exit(PBSE_RMEXIST); } /* Checkpoint successful (assumed) */ pjob->ji_qs.ji_svrflags |= JOB_SVFLG_CHECKPOINT_FILE; job_save(pjob,SAVEJOB_FULL); /* to save resources_used so far */ sprintf(log_buffer,"checkpointed to %s / %s at %ld", pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str, pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_val.at_str, pjob->ji_wattr[(int)JOB_ATR_checkpoint_time].at_val.at_long); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); sprintf(sid,"%ld", pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long); arg[0] = checkpoint_script_name; arg[1] = sid; arg[2] = SET_ARG(pjob->ji_qs.ji_jobid); arg[3] = SET_ARG(pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str); arg[4] = SET_ARG(pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str); arg[5] = SET_ARG(pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str); arg[6] = SET_ARG(pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_val.at_str); arg[7] = (abort) ? "15" /*abort*/ : "0" /*run/continue*/; arg[8] = SET_ARG(csv_find_value(pjob->ji_wattr[(int)JOB_ATR_checkpoint].at_val.at_str, "depth")); arg[9] = NULL; /* XXX this should be fixed to make sure there is no chance of a buffer overrun */ strcpy(buf,"checkpoint args:"); cmd = buf + strlen("checkpoint args: "); /* this extra space compared to above is intentional... */ for (ap = arg; *ap; ap++) { strcat(buf, " "); strcat(buf, *ap); } strcat(buf, " 2>&1 1>/dev/null"); log_ext(-1, id, buf, LOG_DEBUG); if (preq != NULL) { request_type = preq->rq_type; reply_ack(preq); } /* execv(arg[0], arg); */ /* change execv to popen so we can grab the stderr */ fs = popen(cmd, "r"); /* create a read pipe for the command */ rc = 0; if (fs == NULL) { sprintf(buf, "error executing checkpoint script"); log_err(errno, id, buf); rc = -1; } else { err_buf[0] = '\0'; while (fgets(line, 1024, fs) != NULL && strlen(err_buf) + strlen(line) + 1 < 4098) { strcat(err_buf, line); } rc = pclose(fs); if (rc != -1) { rc = WEXITSTATUS(rc); } if (rc != 0) { sprintf(buf, "checkpoint script returned value %d\n", rc); log_err(-1, id, buf); } } if (rc != 0) { /* * If the checkpoint script did not return data for the err_buf, * fill it in so we can show that something went wrong */ if (strlen(err_buf) == 0) { sprintf(err_buf,"Checkpoint script failed with return value of %d", rc); } /* checkpoint script returned a non-zero value. We assume the checkpoint failed */ /* open a connection to the server */ conn = pbs_connect(pjob->ji_wattr[(int)JOB_ATR_at_server].at_val.at_str); set_attr(&attrib, ATTR_comment, err_buf); err = pbs_alterjob(conn, pjob->ji_qs.ji_jobid, attrib, NULL); if (err != 0) { sprintf(buf, "pbs_alterjob requested on job %s failed (%d)\n", pjob->ji_qs.ji_jobid, err); log_err(-1, id, buf); if (err == PBSE_UNKJOBID) { /* TODO: GB - can the job exit while waiting for the checkpoint script to exit?? call log_err */ pbs_disconnect(conn); goto done; } } if (abort != 0) { /* * we need to tell the server to release the hold (abort is non-zero * which means we are trying to hold the job) */ /* * send release job request, the job will still be running, * so it shouldn't have any holds set so we will send "uos" * to clear all holds */ pbs_rlsjob(conn, pjob->ji_qs.ji_jobid, "uos", NULL); } /* END if (abort != 0) */ pbs_disconnect(conn); } /* END if (rc != 0) */ else { char timestr[80]; /* checkpoint script returned a zero value. We assume the checkpoint suceeded */ /* open a connection to the server */ conn = pbs_connect(pjob->ji_wattr[(int)JOB_ATR_at_server].at_val.at_str); sprintf(timestr,"%ld", (long)pjob->ji_wattr[(int)JOB_ATR_checkpoint_time].at_val.at_long); epoch = (time_t)pjob->ji_wattr[(int)JOB_ATR_checkpoint_time].at_val.at_long; sprintf(err_buf,"Job %s was checkpointed and %s to %s/%s at %s", pjob->ji_qs.ji_jobid, (request_type == PBS_BATCH_HoldJob) ? "terminated" : "continued", pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str, pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_val.at_str, ctime(&epoch)); set_attr(&attrib, ATTR_comment, err_buf); set_attr(&attrib, ATTR_checkpoint_name, pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_val.at_str); set_attr(&attrib, ATTR_checkpoint_time, timestr); err = pbs_alterjob(conn, pjob->ji_qs.ji_jobid, attrib, (request_type == PBS_BATCH_HoldJob) ? CHECKPOINTHOLD : CHECKPOINTCONT); if (err != 0) { sprintf(buf, "pbs_alterjob requested on job %s failed (%d)\n", pjob->ji_qs.ji_jobid, err); log_err(-1, id, buf); if (err == PBSE_UNKJOBID) { /* TODO: GB - can the job exit while waiting for the checkpoint script to exit?? call log_err */ pbs_disconnect(conn); /* * If we get an unknown jobid after succesfully doing a non-hold * checkpoint, then it is most likely the result of a periodic * checkpoint for a job that had a qdel -p done, so we get rid of * any local checkpoint / restart files */ if (request_type == 0) { delete_blcr_checkpoint_files(pjob, FALSE, TRUE); } goto done; } } pbs_disconnect(conn); if (rc == 0) { /* Normally, this is an empty routine and does nothing. */ rc = site_mom_postchk(pjob,abort); } } done: exit (rc); } /* END blcr_checkpoint_job() */ /* * Checkpoint the job. * * If abort is TRUE, kill it too. Return a PBS error code. */ int mom_checkpoint_job( job *pjob, /* I */ int abort) /* I */ { int hasold = 0; int sesid = -1; int ckerr; struct stat statbuf; char path[MAXPATHLEN + 1]; char oldp[MAXPATHLEN + 1]; char file[MAXPATHLEN + 1]; int filelen; task *ptask; assert(pjob != NULL); get_jobs_default_checkpoint_dir(pjob, path); if (stat(path, &statbuf) == 0) { strcpy(oldp, path); /* file already exists, rename it */ strcat(oldp, ".old"); if (rename(path, oldp) < 0) { return(errno); } hasold = 1; } mkdir(path, 0755); filelen = strlen(path); strcpy(file, path); #ifdef _CRAY /* * if job is suspended and if is set, resume job first, * this is so job will be "Q"ueued and then back into "R"unning * when restarted. */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) && abort) { for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { sesid = ptask->ti_qs.ti_sid; if (ptask->ti_qs.ti_status != TI_STATE_RUNNING) continue; /* XXX: What to do if some resume work and others don't? */ if ((ckerr = resume(C_JOB, sesid)) == 0) { post_resume(pjob, ckerr); } else { sprintf(log_buffer, "checkpoint failed: errno=%d sid=%d", errno, sesid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return(errno); } } } #endif /* _CRAY */ for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { sesid = ptask->ti_qs.ti_sid; if (ptask->ti_qs.ti_status != TI_STATE_RUNNING) continue; if (mach_checkpoint(ptask, file, abort) == -1) goto fail; } /* Checkpoint successful */ pjob->ji_qs.ji_svrflags |= JOB_SVFLG_CHECKPOINT_FILE; job_save(pjob, SAVEJOB_FULL); /* to save resources_used so far */ sprintf(log_buffer, "checkpointed to %s", path); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); if (hasold) remtree(oldp); return(PBSE_NONE); fail: /* A checkpoint has failed. Log and return error. */ ckerr = errno; sprintf(log_buffer, "checkpoint failed:errno=%d sid=%d", errno, sesid); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* ** See if any checkpoints worked and abort is set. ** If so, we need to restart these tasks so the whole job is ** still running. This has to wait until we reap the ** aborted task(s). */ if (abort) { return(PBSE_CKPSHORT); } /* Clean up files */ remtree(path); if (hasold) { if (rename(oldp, path) == -1) pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_CHECKPOINT_FILE; } if (ckerr == EAGAIN) { return(PBSE_CKPBSY); } return(ckerr); } /* END mom_checkpoint_job() */ /* * post_checkpoint - post processor for start_checkpoint() * * @see scan_for_terminated() - parent * * Called from scan_for_terminated() when found in ji_mompost; * * This sets the "has checkpoint image" bit in the job. * * job is referenced by parent after calling this routine - do not 'purge' * job from inside this routine */ void post_checkpoint( job *pjob, /* I - may be purged */ int ev) /* I */ { char path[MAXPATHLEN + 1]; DIR *dir; struct dirent *pdir; tm_task_id tid; task *ptask; int abort = pjob->ji_flags & MOM_CHECKPOINT_ACTIVE; exiting_tasks = 1; /* make sure we call scan_for_exiting() */ pjob->ji_flags &= ~MOM_CHECKPOINT_ACTIVE; if (ev == 0) { pjob->ji_qs.ji_svrflags |= JOB_SVFLG_CHECKPOINT_FILE; return; } /* since checkpointing failed, clear out checkpoint name and time */ pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_flags = 0; pjob->ji_wattr[(int)JOB_ATR_checkpoint_time].at_flags = 0; /* ** If we get here, an error happened. Only try to recover ** if we had abort set. */ if (abort == 0) { return; } /* ** Set a flag for scan_for_exiting() to be able to ** deal with a failed checkpoint rather than doing ** the usual processing. */ pjob->ji_flags |= MOM_CHECKPOINT_POST; /* ** Set the TI_FLAGS_CHECKPOINT flag for each task that ** was checkpointed and aborted. */ get_jobs_default_checkpoint_dir(pjob, path); dir = opendir(path); if (dir == NULL) { return; } while ((pdir = readdir(dir)) != NULL) { if (pdir->d_name[0] == '.') continue; tid = atoi(pdir->d_name); if (tid == 0) continue; ptask = task_find(pjob,tid); if (ptask == NULL) continue; ptask->ti_flags |= TI_FLAGS_CHECKPOINT; } /* END while ((pdir = readdir(dir)) != NULL) */ closedir(dir); return; } /* END post_checkpoint() */ /** * start_checkpoint - start a checkpoint going * * checkpoint done from a child because it takes a while * * @see blcr_checkpoint() - child * @see start_checkpoint() - parent */ int start_checkpoint( job *pjob, int abort, /* I - boolean - 0 or 1 */ struct batch_request *preq) /* may be null */ { pid_t pid; char *id = "start_checkpoint"; int rc = PBSE_NONE; char name_buffer[MAXPATHLEN + 1]; time_t time_now; time_now = time((time_t *)0); switch (checkpoint_system_type) { case CST_MACH_DEP: /* NO-OP */ break; case CST_BLCR: /* Build the name of the checkpoint file before forking to the child because * we want this name to persist and this won't work if we are the child. * Notice that the ATR_VFLAG_SEND bit is not set. We don't want this to go * to the pbs_server until the checkpoint has completed successfully. */ sprintf(name_buffer,"ckpt.%s.%d", pjob->ji_qs.ji_jobid, (int)time_now); decode_str(&pjob->ji_wattr[(int)JOB_ATR_checkpoint_name], NULL, NULL, name_buffer); pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY; /* Set the checkpoint time so can determine if the checkpoint is recent */ pjob->ji_wattr[(int)JOB_ATR_checkpoint_time].at_val.at_long = (long)time_now; pjob->ji_wattr[(int)JOB_ATR_checkpoint_time].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY; /* For BLCR, there must be a directory name in the job attributes. */ if (!(pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_flags & ATR_VFLAG_SET)) { /* No dir specified, use the default job checkpoint directory e.g. /var/spool/torque/checkpoint/42.host.domain.CK */ get_jobs_default_checkpoint_dir(pjob, name_buffer); decode_str(&pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir],NULL,NULL,name_buffer); } break; case CST_NONE: default: return(PBSE_NOSUP); /* no checkpoint, reject request */ /*NOTREACHED*/ break; } /* now set up as child of MOM */ pid = fork_me((preq == NULL) ? -1 : preq->rq_conn); if (pid > 0) { /* parent */ /* MOM_CHECKPOINT_ACTIVE prevents scan_for_exiting from triggering obits while job is checkpointing. */ pjob->ji_flags |= MOM_CHECKPOINT_ACTIVE; pjob->ji_momsubt = pid; /* record pid in job for when child terminates */ /* Set the address of a function to execute in scan_for_terminated */ pjob->ji_mompost = (int (*)())post_checkpoint; if (preq) free_br(preq); /* child will send reply */ } else if (pid < 0) { /* error on fork */ log_err(errno, id, "cannot fork child process for checkpoint"); return(PBSE_SYSTEM); } else { /* child - does the checkpoint */ switch (checkpoint_system_type) { case CST_MACH_DEP: rc = mom_checkpoint_job(pjob,abort); break; case CST_BLCR: /* we don't return from here, so we can do checkpoint in this process id */ rc = blcr_checkpoint_job(pjob,abort,preq); break; } if (rc == PBSE_NONE) { rc = site_mom_postchk(pjob,abort); /* Normally, this is an empty routine and does nothing. */ } if (preq != NULL) { /* rc may be 0, req_reject is used to pass auxcode */ req_reject(rc,PBS_CHECKPOINT_MIGRATE,preq,NULL,NULL); /* BAD reject is used to send OK??? */ } exit(rc); /* zero exit tells main checkpoint ok */ } return(PBSE_NONE); /* parent return */ } /* END start_checkpoint() */ /* ** Restart each task which has exited and has TI_FLAGS_CHECKPOINT turned on. ** If all tasks have been restarted, turn off MOM_CHECKPOINT_POST. */ void checkpoint_partial( job *pjob) { static char id[] = "checkpoint_partial"; char namebuf[MAXPATHLEN]; task *ptask; int texit = 0; assert(pjob != NULL); get_jobs_default_checkpoint_dir(pjob, namebuf); for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { /* ** See if the task was marked as one of those that did ** actually checkpoint. */ if ((ptask->ti_flags & TI_FLAGS_CHECKPOINT) == 0) continue; texit++; /* ** Now see if it was reaped. We don't want to ** fool with it until we see it die. */ if (ptask->ti_qs.ti_status != TI_STATE_EXITED) continue; texit--; if (mach_restart(ptask, namebuf) == -1) { pjob->ji_flags &= ~MOM_CHECKPOINT_POST; kill_job(pjob, SIGKILL, id, "failed to restart"); return; } ptask->ti_qs.ti_status = TI_STATE_RUNNING; ptask->ti_flags &= ~TI_FLAGS_CHECKPOINT; task_save(ptask); } if (texit == 0) { char oldname[MAXPATHLEN]; struct stat statbuf; /* ** All tasks should now be running. ** Turn off MOM_CHECKPOINT_POST flag so job is back to where ** it was before the bad checkpoint attempt. */ pjob->ji_flags &= ~MOM_CHECKPOINT_POST; /* ** Get rid of incomplete checkpoint directory and ** move old checkpoint dir back to regular if it exists. */ remtree(namebuf); strcpy(oldname, namebuf); strcat(oldname, ".old"); if (stat(oldname, &statbuf) == 0) { if (rename(oldname, namebuf) == -1) pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_CHECKPOINT_FILE; } } } /* END checkpoint_partial() */ /* BLCR version of restart */ int blcr_restart_job( job *pjob) { char *id = "blcr_restart_job"; int pid; char sid[20]; char *arg[20]; extern char restart_script_name[MAXPATHLEN + 1]; task *ptask; char buf[1024]; char namebuf[MAXPATHLEN + 1]; char restartfile[MAXPATHLEN + 1]; char script_buf[MAXPATHLEN + 1]; char **ap; #ifdef USEJOBCREATE uint64_t job_id; #endif /* USEJOBCREATE */ /* if a restart script is defined launch it */ if (restart_script_name[0] == '\0') { log_err(PBSE_RMEXIST, id, "No restart script defined"); return(PBSE_RMEXIST); } /* BLCR is not for parallel jobs, there can only be one task in the job. */ ptask = (task *) GET_NEXT(pjob->ji_tasks); if (ptask == NULL) { /* turns out if we are restarting a complete job then ptask will be null and we need to create a task We'll just create one task*/ if ((ptask = pbs_task_create(pjob, TM_NULL_TASK)) == NULL) { log_err(PBSE_RMNOPARAM, id, "Job has no tasks"); return(PBSE_RMNOPARAM); } strcpy(ptask->ti_qs.ti_parentjobid, pjob->ji_qs.ji_jobid); ptask->ti_qs.ti_parentnode = 0; ptask->ti_qs.ti_parenttask = 0; ptask->ti_qs.ti_task = 0; } #ifdef USEJOBCREATE /* * Get a job id from the system */ job_id = get_jobid(pjob->ji_qs.ji_jobid); pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll = job_id; pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY; #endif /* USEJOBCREATE */ /* launch the script and return success */ pid = fork(); if (pid < 0) { /* fork failed */ return(PBSE_RMSYSTEM); } else if (pid > 0) { /* parent */ ptask->ti_qs.ti_sid = pid; /* Apparently torque doesn't do anything with the session ID that we pass back here... */ ptask->ti_qs.ti_status = TI_STATE_RUNNING; task_save(ptask); return(PBSE_NONE); } else if (pid == 0) { /* child: execv the script */ /* if there are missing .OU or .ER files create them, they were probably empty and server didn't send them */ /* TODO: check return value? */ create_missing_files(pjob); if (pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_flags & ATR_VFLAG_SET) { /* The job has a checkpoint directory specified, use it. */ strcpy(namebuf, pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str); } else { get_jobs_default_checkpoint_dir(pjob, namebuf); } /* Change the owner of the .SC to be the user */ strcpy(script_buf, path_jobs); strcat(script_buf, pjob->ji_qs.ji_fileprefix); strcat(script_buf, JOB_SCRIPT_SUFFIX); if (chown(script_buf, pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1) { sprintf(log_buffer,"cannot change owner for file %s", script_buf); log_err(errno, id, log_buffer); } strcpy(restartfile, namebuf); strcat(restartfile, "/"); strcat(restartfile, pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_val.at_str); /* Change the owner of the checkpoint restart file to be the user */ if (chown(restartfile, pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid) == -1) { log_err(errno, id, "cannot change checkpoint restart file owner"); } sprintf(sid, "%ld", pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long); arg[0] = restart_script_name; arg[1] = sid; arg[2] = SET_ARG(pjob->ji_qs.ji_jobid); arg[3] = SET_ARG(pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str); arg[4] = SET_ARG(pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str); arg[5] = SET_ARG(namebuf); arg[6] = SET_ARG(pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_val.at_str); arg[7] = NULL; strcpy(buf, "restart args:"); for (ap = arg;*ap;ap++) { strcat(buf, " "); strcat(buf, *ap); } log_ext(-1, id, buf, LOG_DEBUG); log_close(0); if (lockfds >= 0) { close(lockfds); lockfds = -1; } net_close(-1); /* set us up with a new session */ pid = set_job(pjob, NULL); if (pid < 0) { perror("setsid"); exit(-1); } #ifdef ENABLE_CSA /* * Add a workload management start record */ add_wkm_start(job_id, pjob->ji_qs.ji_jobid); #endif /* ENABLE_CSA */ execv(arg[0], arg); } /* END if (pid == 0) */ return(PBSE_NONE); } /* END blcr_restart_job() */ /* start each task based on task checkpoint records located job-specific checkpoint directory */ int mom_restart_job(job *pjob) { static char id[] = "mom_restart_job"; char path[MAXPATHLEN]; int i; char namebuf[MAXPATHLEN]; char *filnam; DIR *dir; struct dirent *pdir; tm_task_id taskid; task *ptask; int tcount = 0; long mach_restart A_((task *, char *path)); get_jobs_default_checkpoint_dir(pjob, namebuf); if ((dir = opendir(path)) == NULL) { sprintf(log_buffer, "opendir %s", path); log_err(errno, id, log_buffer); return(PBSE_RMEXIST); } strcpy(namebuf, path); strcat(namebuf, "/"); i = strlen(namebuf); filnam = &namebuf[i]; while ((pdir = readdir(dir)) != NULL) { if (strlen(pdir->d_name) <= 2) continue; if ((taskid = (tm_task_id)atoi(pdir->d_name)) == 0) { sprintf(log_buffer, "%s: garbled filename %s", pjob->ji_qs.ji_jobid, pdir->d_name); goto fail; } if ((ptask = task_find(pjob, taskid)) == NULL) { sprintf(log_buffer, "%s: task %d not found", pjob->ji_qs.ji_jobid, (int)taskid); goto fail; } strcpy(filnam, pdir->d_name); if (mach_restart(ptask, namebuf) == -1) { sprintf(log_buffer, "%s: task %d failed from file %s", pjob->ji_qs.ji_jobid, (int)taskid, namebuf); goto fail; } ptask->ti_qs.ti_status = TI_STATE_RUNNING; if (LOGLEVEL >= 6) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "task set to running (mom_restart_job)"); } task_save(ptask); tcount++; } closedir(dir); sprintf(log_buffer, "Restarted %d tasks", tcount); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return(PBSE_NONE); fail: log_err(errno, id, log_buffer); closedir(dir); return(PBSE_RMEXIST); } /* END mom_restart_job() */ /** * mom_checkpoint_init_job_periodic_timer * * The routine is called from TMomFinalizeJob1 in start_exec.c. * This code initializes checkpoint related variables in the job struct. * * @param pjob Pointer to job structure * @see TMomFinalizeJob1 */ void mom_checkpoint_init_job_periodic_timer(job *pjob) { attribute *pattr; char *vp; /* Should we set up the job for periodic checkpoint? */ pattr = &pjob->ji_wattr[(int)JOB_ATR_checkpoint]; if ((pattr->at_flags & ATR_VFLAG_SET) && (csv_find_string(pattr->at_val.at_str, "c") || csv_find_string(pattr->at_val.at_str, "periodic"))) { /* Yes, what is the interval in minutes. */ if ((vp = csv_find_value(pattr->at_val.at_str, "c")) || (vp = csv_find_value(pattr->at_val.at_str, "interval"))) { /* has checkpoint time (in minutes), convert to seconds */ pjob->ji_checkpoint_time = atoi(vp) * 60; pjob->ji_checkpoint_next = pjob->ji_checkpoint_time; } else { /* pick a default number of minutes */ pjob->ji_checkpoint_time = default_checkpoint_interval * 60; pjob->ji_checkpoint_next = pjob->ji_checkpoint_time; } } } /** * mom_checkpoint_job_has_checkpoint * * The routine is called from TMomFinalizeJob1 in start_exec.c. * It checks to see if the job has a checkpoint file to restart from. * * @param pjob Pointer to job structure * @see TMomFinalizeJob1 */ int mom_checkpoint_job_has_checkpoint( job *pjob) { /* Has the job has been checkpointed? */ switch (checkpoint_system_type) { case CST_MACH_DEP: if (pjob->ji_qs.ji_svrflags & (JOB_SVFLG_CHECKPOINT_FILE | JOB_SVFLG_CHECKPOINT_MIGRATEABLE)) { char buf[MAXPATHLEN + 2]; struct stat sb; /* Does the checkpoint directory exist? */ if (pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_flags & ATR_VFLAG_SET) { /* The job has a checkpoint directory specified, use it. */ strcpy(buf, pjob->ji_wattr[(int)JOB_ATR_checkpoint_dir].at_val.at_str); } else { /* Otherwise, use the default job checkpoint directory /var/spool/torque/checkpoint/42.host.domain.CK */ get_jobs_default_checkpoint_dir(pjob, buf); } if (stat(buf, &sb) != 0) /* stat(buf) tests if the checkpoint directory exists */ { /* We thought there was a checkpoint but the directory was not there. */ pjob->ji_qs.ji_svrflags &= ~(JOB_SVFLG_CHECKPOINT_FILE | JOB_SVFLG_CHECKPOINT_MIGRATEABLE); break; } } if (LOGLEVEL >= 7) { log_ext(-1, "mom_checkpoint_job_has_checkpoint", "TRUE", LOG_DEBUG); } return(TRUE); /* Yes, there is a checkpoint. */ break; case CST_BLCR: if (pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_flags & ATR_VFLAG_SET) { if (LOGLEVEL >= 7) { log_ext(-1, "mom_checkpoint_job_has_checkpoint", "TRUE", LOG_DEBUG); } return(TRUE); } break; } if (LOGLEVEL >= 7) { log_ext(-1, "mom_checkpoint_job_has_checkpoint", "FALSE", LOG_DEBUG); } return(FALSE); /* No checkpoint attribute on job. */ } /** * mom_checkpoint_start_restart * * The routine is called from TMomFinalizeJob1 in start_exec.c. * This code initializes checkpoint related variables in the job struct. * If there is a checkpoint file, the job is restarted from this image. * * @param pjob Pointer to job structure * @see TMomFinalizeJob1 */ int mom_checkpoint_start_restart( job *pjob) { /* static char *id = "mom_checkpoint_start_restart"; */ int rc = PBSE_NONE; /* At this point we believe that there is a checkpoint image, try to restart it. */ switch (checkpoint_system_type) { case CST_MACH_DEP: /* perform any site required setup before restart, normally empty and does nothing */ if ((rc = site_mom_prerst(pjob)) != PBSE_NONE) { return(rc); } rc = mom_restart_job(pjob); /* Iterate over files in checkpoint dir, restarting all files found. */ break; case CST_BLCR: /* NOTE: partition creation handled in blcr_restart_job() */ /* perform any site required setup before restart, normally empty and does nothing */ if ((rc = site_mom_prerst(pjob)) != PBSE_NONE) { return(rc); } rc = blcr_restart_job(pjob); break; case CST_NONE: default: return(PBSE_NOSUP); /*NOTREACHED*/ break; } return(rc); } /* END mom_checkpoint_start_restart() */ /* this file creates missing stderr/stdout files before restarting the checkpointed job. This was designed for BLCR checkpointing. empty .OU or .ER files are not retained by the server, so if we are restarting a checkpointed job then they will not get sent back out to use. the blcr restart command will expect these files to exist, even if empty. If any expected files are missing we create them here */ /* TODO: this needs to be modified to work with user .pbs_spool directories */ int create_missing_files(job *pjob) { int should_have_stderr; int should_have_stdout; attribute *pattr; char *pstr; char *namebuf; int bufsize; int files_created = 0; int fd; char *id = "create_missing_files"; should_have_stderr = TRUE; should_have_stdout = TRUE; pattr = &pjob->ji_wattr[(int)JOB_ATR_join]; if (pattr->at_flags & ATR_VFLAG_SET) { pstr = pattr->at_val.at_str; if ((pstr != NULL) && (*pstr != '\0') && (*pstr != 'n')) { /* if not the first letter, and in list - is joined */ if ((*pstr != 'e') && (strchr(pstr + 1, (int)'e'))) { should_have_stderr = FALSE; /* being joined */ } else if ((*pstr != 'o') && (strchr(pstr + 1, (int)'o'))) { should_have_stdout = FALSE; } } } if (should_have_stdout) { bufsize = strlen(pjob->ji_qs.ji_fileprefix) + strlen(path_spool) + strlen(JOB_STDOUT_SUFFIX) + 1; namebuf = malloc(bufsize * sizeof(char)); if (namebuf == NULL) { return -1; } strcpy(namebuf, path_spool); strcat(namebuf, pjob->ji_qs.ji_fileprefix); strcat(namebuf, JOB_STDOUT_SUFFIX); if (access(namebuf, F_OK) != 0) { if ((fd = creat(namebuf, S_IRUSR | S_IWUSR)) > 0) { if (fchown(fd,pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid)) { log_err(errno,id,strerror(errno)); } close(fd); ++files_created; } else { /* couldn't create the file, why could this happen, TODO: what should we do? */ log_err(errno,id,strerror(errno)); } } free(namebuf); } if (should_have_stderr) { bufsize = strlen(pjob->ji_qs.ji_fileprefix) + strlen(path_spool) + strlen(JOB_STDOUT_SUFFIX) + 1; namebuf = malloc(bufsize * sizeof(char)); if (namebuf == NULL) { return -1; } strcpy(namebuf, path_spool); strcat(namebuf, pjob->ji_qs.ji_fileprefix); strcat(namebuf, JOB_STDERR_SUFFIX); if (access(namebuf, F_OK) != 0) { if ((fd = creat(namebuf, S_IRUSR | S_IWUSR)) > 0) { if (fchown(fd,pjob->ji_qs.ji_un.ji_momt.ji_exuid, pjob->ji_qs.ji_un.ji_momt.ji_exgid)) { log_err(errno,id,strerror(errno)); } close(fd); ++files_created; } else { /* couldn't create the file, why could this happen, TODO: what should we do? */ log_err(errno,id,strerror(errno)); } } free(namebuf); } return files_created; } torque-2.4.16/src/resmom/darwin/0000777000113300011330000000000011614035171013472 500000000000000torque-2.4.16/src/resmom/darwin/mom_start.c0000664000113300011330000002475111272401243015567 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for a task whose * session id matched that of a terminated child pid. Mark that * task as Exiting. */ void scan_for_terminated(void) { #ifndef NDEBUG static char id[] = "scan_for_terminated"; #endif int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; ptask = NULL; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code does it the hard way, it searches */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "WINCH", SIGWINCH }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; torque-2.4.16/src/resmom/darwin/mom_mach.h0000664000113300011330000001240411272401243015337 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: darwin */ #ifndef MOM_MACH #define MOM_MACH "darwin" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/darwin/Makefile.in0000664000113300011330000004377211605403745015500 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/darwin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/darwin/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/darwin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/darwin/pe_input.c0000664000113300011330000001053711272401243015402 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For the Sun - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/darwin/mom_mach.c0000664000113300011330000017733511272401243015351 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** System dependent code to gather information for an OS X/Darwin machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** ncpus number of cpus ** nsessions number of sessions in the system ** nusers number of users in the system ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information (sizes in KB) */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "pbs_error.h" #include "log.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "resmon.h" #include "mom_func.h" #include "../rm_dep.h" #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ typedef struct kinfo_proc kinfo_proc; /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern int LOGLEVEL; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; extern char *ret_string; extern char extra_parm[]; extern char no_parm[]; extern char *msg_momsetlim; extern time_t time_now; extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); extern int errno; /* ** local functions */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *netload A_((struct rm_attribute *attrib)); static int get_tinfo_by_pid A_((struct task_basic_info *t_info, unsigned int pid)); static int get_time_info_by_pid A_((struct task_thread_times_info *t_info, unsigned int pid)); static kinfo_proc *get_bsd_process_list A_((int *procCount)); struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "netload", {netload} }, { NULL, {nullproc} } }; struct nlist nl[] = { { "_anoninfo", 0, 0, 0, 0 }, /* 0 */ { "_cnt", 0, 0, 0, 0 }, /* 1 */ { "_averunnable", 0, 0, 0, 0 }, /* 2 */ { "", 0, 0, 0, 0 } }; #define KSYM_ANON 0 #define KSYM_PHYS 1 #define KSYM_LOAD 2 /* * Time decoding macro. Accepts a timeval structure. Returns unsigned long * time in seconds. */ #define tvk(val) ((val).tv_sec+((unsigned long)(val).tv_usec+500000)/1000000) time_t wait_time = 10; struct kinfo_proc *proc_tbl = NULL; pid_t *sess_tbl = NULL; int nproc = 0; char nokernel[] = "kernel not available"; char noproc[] = "process %d does not exist"; static int nncpus = 0; static int gpagesize; void dep_initialize(void) { int mib[2]; size_t len; mib[0] = CTL_HW; /* get number of processors */ mib[1] = HW_NCPU; len = sizeof(nncpus); sysctl(mib, 2, &nncpus, &len, NULL, 0); len = sizeof(gpagesize); if (sysctlbyname("hw.pagesize", &gpagesize, &len, NULL, 0) != 0) { gpagesize = 4096; } return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); return; } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* ** Scan a list of tasks and return true if one of them matches ** the process (sid or pid) represented by *psp. */ static int injob( job *pjob, pid_t sesid) { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) { DBPRT(("ti_sid: %d -- sesid: %d\n", ptask->ti_qs.ti_sid, sesid)); return(TRUE); } } return(FALSE); } #define MINPROC 10 #define MAXPROC 10000 /* * Internal session cpu time decoding routine. * * Accepts a job id. Returns the sum of all cpu time consumed for all * tasks executed by the job, in seconds, adjusted by cputfactor. */ static unsigned long cput_sum( job *pjob) { #ifndef NDEBUG static char id[] = "cput_sum"; #endif int i; u_long cputime; int nps = 0; time_value_t total_time; task_basic_info_data_t mach_task_stats; task_thread_times_info_data_t mach_time_info; int ret; cputime = 0; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; nps++; cputime += tvk(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { ret = get_tinfo_by_pid(&mach_task_stats, pp->kp_proc.p_pid); if (ret != 0) { continue; } total_time = mach_task_stats.user_time; time_value_add(&total_time, &(mach_task_stats.system_time)) ret = get_time_info_by_pid(&mach_time_info, pp->kp_proc.p_pid); if (ret == 0) { time_value_add(&total_time, &(mach_time_info.user_time)); time_value_add(&total_time, &(mach_time_info.system_time)); } cputime += total_time.seconds; } else { cputime += pp->kp_proc.p_ru->ru_utime.tv_sec + pp->kp_proc.p_ru->ru_stime.tv_sec; } DBPRT(("%s: ses %d pid %d cputime %lu\n", id, sess_tbl[i], pp->kp_proc.p_pid, cputime)) } /* END for (i) */ if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return((unsigned long)((double)cputime * cputfactor)); } /* END cput_sum() */ /* * Internal session memory usage function. * * Accepts a job ID. Returns the total number of bytes of address * space consumed by all current tasks within the job. */ static unsigned long mem_sum( job *pjob) /* I */ { #ifndef NDEBUG char *id = "mem_sum"; #endif int i; unsigned long memsize = 0; struct task_basic_info t_info; unsigned int pid; DBPRT(("mem_sum entered.\n")); for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; pid = pp->kp_proc.p_pid; if (get_tinfo_by_pid(&t_info, pid) != 0) continue; /* mach does says virtual_size is number of pages, but after noticing very wrong values, I took a look at the apple header files and they say it is the size in bytes... memsize += ctob(t_info.virtual_size); */ memsize += t_info.virtual_size; DBPRT(("%s: ses %d pid=%d totmem=%lu\n", id, sess_tbl[i], pp->kp_proc.p_pid, memsize)) } /* END for (i) */ return(memsize); } /* END mem_sum */ /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum( job *pjob) { #ifndef NDEBUG char *id = "resi_sum"; #endif int i; unsigned long memsize = 0; struct task_basic_info t_info; unsigned int pid; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; pid = pp->kp_proc.p_pid; if (get_tinfo_by_pid(&t_info, pid) != 0) continue; /* see note in mem_sum memsize += ctob(t_info.resident_size); */ memsize += t_info.resident_size; DBPRT(("%s: pid=%d ses=%d mem=%d totmem=%lu\n", id, pp->kp_proc.p_pid, sess_tbl[i], t_info.resident_size, memsize)) } /* END for (i) */ return(memsize); } /* END resi_sum() */ /* * Return TRUE if any task in the job is over limit for memory usage. */ static int overmem_proc( job *pjob, unsigned long limit) { int i; struct task_basic_info t_info; unsigned int pid; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; pid = pp->kp_proc.p_pid; if (get_tinfo_by_pid(&t_info, pid) != 0) continue; if (t_info.virtual_size > limit) { return(TRUE); } } /* END for (i) */ return(FALSE); } /* * Internal error routine */ int error( char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { #ifndef NDEBUG char *id = "mom_set_limits"; #endif char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately (SET_LIMIT_SET). */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll( job *pjob) { #ifndef NDEBUG char *id = "mom_do_poll"; #endif char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) { return (TRUE); } pres = (resource *)GET_NEXT(pres->rs_link); } return(FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { #ifndef NDEBUG char *id = "mom_open_poll"; #endif DBPRT(("%s: entered\n", id)) return(PBSE_NONE); } int qs_cmp( const void *a, const void *b) { return((int)((struct kinfo_proc *)a)->kp_eproc.e_paddr - (int)((struct kinfo_proc *)b)->kp_eproc.e_paddr); } /* get a list of BSD style processes from the kernel these will be returned as an array of kinfo_proc structures */ static kinfo_proc *get_bsd_process_list( int *procCount) /*O*/ { int err; bool done; static const int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 }; size_t length; kinfo_proc *result; assert(procCount != NULL); *procCount = 0; result = NULL; done = false; do { /* Call sysctl with a NULL buffer to get the size of the buffer we'll need. a NULL buffer results in length being set to indicate the amount of data that could be returned, if buffer is non-NULL then length is set to indicate the amount of data actually returned */ length = 0; err = sysctl( (int *)name, (sizeof(name) / sizeof(*name)) - 1, NULL, &length, NULL, 0); if (err == -1) { err = errno; } /* if success malloc buffer based on the results of previous call */ if (err == 0) { result = malloc(length); if (result == NULL) { err = ENOMEM; } } /* Call sysctl again with the new buffer. If we get an ENOMEM * error, free buffer and try this all again because size changed * between previous sysctl to get size and this one. */ if (err == 0) { err = sysctl((int *) name, (sizeof(name) / sizeof(*name)) - 1, result, &length, NULL, 0); if (err == -1) { err = errno; } if (err == 0) { done = true; } else if (err == ENOMEM) /* buffer not big enough, try again */ { assert(result != NULL); free(result); result = NULL; err = 0; /* clear err so we'll loop again */ } } } while (err == 0 && !done); /* Clean up and establish post conditions. */ if (err != 0 && result != NULL) { free(result); result = NULL; } /* set int pointed to by procCount to the number of kinfo_proc structures that will be returned */ if (err == 0) { *procCount = length / sizeof(kinfo_proc); } else { *procCount = err; /* send err back via procCount */ } /* if our logic is right, if err == 0 then result will never be NULL and vice versa */ assert((err == 0) == (result != NULL)); return(result); } /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { char *id = "mom_get_sample"; int i; struct kinfo_proc *kp; DBPRT(("%s: entered\n", id)) if (sess_tbl != NULL) free(sess_tbl); proc_tbl = get_bsd_process_list(&nproc); /* proc_tbl now contains array of pairs of struct proc followed by * corresponding struct eproc's. * * The entire process table resides in proc_tbl. * nproc = number of processes, unless get_bsd_process_list returns NULL, * in which it will contain an error code. */ if (proc_tbl == NULL) { sprintf(log_buffer, "get_bsd_process_list returned NULL (err = %d)", nproc); log_err(errno, id, log_buffer); return(PBSE_SYSTEM); } sess_tbl = (pid_t *)calloc(nproc, sizeof(pid_t)); /* Create array of size nproc */ if (sess_tbl == NULL) { sprintf(log_buffer, "can't allocate memory for session table"); log_err(errno, id, log_buffer); return(PBSE_SYSTEM); } qsort(proc_tbl, nproc, sizeof(struct kinfo_proc), qs_cmp); for (i = 0, kp = proc_tbl;i < nproc;i++, kp++) { sess_tbl[i] = getsid(kp->kp_proc.p_pid); } return(PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit( job *pjob) { #ifndef NDEBUG char *id = "mom_over_limit"; #endif char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *)GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (;pres != NULL;pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (!strcmp(pname, "cput"))) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return(TRUE); } } else if (!strcmp(pname, "mem")) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((num = resi_sum(pjob)) > value) { sprintf(log_buffer, "mem %lu exceeded limit %lu", num, value); return(TRUE); } } else if (!strcmp(pname, "vmem")) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return(TRUE); } } else if (!strcmp(pname, "pvmem")) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return(TRUE); } } else if (ignwalltime == 0 && !strcmp(pname, "walltime")) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)(wallfactor * (double)(time_now - pjob->ji_qs.ji_stime)); if (num > value) { sprintf(log_buffer, "walltime %lu exceeded limit %lu", num, value); return(TRUE); } } } return(FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use( job *pjob) { resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a job task. * Call with the job and a signal number. */ int kill_task( task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int i, err; int sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) { return(0); } DBPRT(("%s sending %d\n", id, sig)) if ((err = mom_get_sample()) != PBSE_NONE) { return(0); } for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (sesid != sess_tbl[i]) continue; if (sig == SIGKILL) { struct timespec req; int i; req.tv_sec = 0; req.tv_nsec = 250000000; /* give the process some time to quit gracefully first */ if (kill(pp->kp_proc.p_pid, SIGTERM) == -1) break; for (i = 0;i < 20;i++) { if (kill(pp->kp_proc.p_pid, 0) == -1) break; nanosleep(&req, NULL); } /* END for (i = 0) */ } sprintf(log_buffer, "%s: killing pid %d task %d with sig %d", id, pp->kp_proc.p_pid, ptask->ti_qs.ti_task, sig); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); DBPRT(("%s: send signal %d to pid %d\n", id, sig, pp->kp_proc.p_pid)) kill(pp->kp_proc.p_pid, sig); ++ct; } return(ct); } /* END kill_task() */ /* * Clean up everything related to polling. * */ int mom_close_poll(void) { char *id = "mom_close_poll"; if (LOGLEVEL >= 4) { log_record(PBSEVENT_SYSTEM, 0, id, "entered"); } return(PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint( task *ptask, /*I*/ char *file, /*I*/ int abort) /*I*/ { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart( task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char *cput_job( pid_t jobid) { #ifndef NDEBUG char *id = "cput_job"; #endif int i; unsigned long cputime; time_value_t total_time; time_value_t system_time; task_basic_info_data_t mach_task_stats; task_thread_times_info_data_t mach_time_info; int ret; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; cputime += tvk(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { ret = get_tinfo_by_pid(&mach_task_stats, pp->kp_proc.p_pid); if (ret != 0) { continue; } total_time = mach_task_stats.user_time; system_time = mach_task_stats.system_time; time_value_add(&total_time, &system_time) ret = get_time_info_by_pid(&mach_time_info, pp->kp_proc.p_pid); if (ret == 0) { time_value_add(&total_time, &(mach_time_info.user_time)); time_value_add(&total_time, &(mach_time_info.system_time)); } cputime += total_time.seconds; } else { cputime += pp->kp_proc.p_ru->ru_utime.tv_sec + pp->kp_proc.p_ru->ru_stime.tv_sec; } DBPRT(("%s: ses %d pid %d cputime %lu\n", id, jobid, pp->kp_proc.p_pid, cputime)) } sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return(ret_string); } char *cput_proc( pid_t pid) { #ifndef NDEBUG char *id = "cput_proc"; #endif uint cputime; int i; time_value_t total_time; time_value_t system_time; task_basic_info_data_t mach_task_stats; task_thread_times_info_data_t mach_time_info; int ret; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; cputime = tvk(pp->kp_proc.p_rtime); if (pp->kp_proc.p_ru == NULL) { ret = get_tinfo_by_pid(&mach_task_stats, pp->kp_proc.p_pid); if (ret != 0) { continue; } total_time = mach_task_stats.user_time; system_time = mach_task_stats.system_time; time_value_add(&total_time, &system_time) ret = get_time_info_by_pid(&mach_time_info, pp->kp_proc.p_pid); if (ret == 0) { time_value_add(&total_time, &(mach_time_info.user_time)); time_value_add(&total_time, &(mach_time_info.system_time)); } cputime += total_time.seconds; } else { cputime += pp->kp_proc.p_ru->ru_utime.tv_sec + pp->kp_proc.p_ru->ru_stime.tv_sec; } DBPRT(("%s: pid %d cputime %d\n", id, pid, cputime)) sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return(ret_string); } rm_errno = RM_ERR_EXIST; return(NULL); } char *cput( struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char *mem_job( pid_t jobid) { #ifndef NDEBUG char *id = "mem_job"; #endif int i; int memsize, addmem; int found = 0; struct task_basic_info t_info; unsigned int pid; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return(NULL); } memsize = 0; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; pid = pp->kp_proc.p_pid; if (get_tinfo_by_pid(&t_info, pid) != 0) continue; addmem = t_info.virtual_size; memsize += addmem; DBPRT(("%s: ses %d pid=%d totmem=%d\n", id, sess_tbl[i], pp->kp_proc.p_pid, memsize)); } if (found) { sprintf(ret_string, "%ukb", memsize >> 10); /* KB */ return(ret_string); } rm_errno = RM_ERR_EXIST; return(NULL); } char *mem_proc( pid_t pid) { int i; int memsize; struct task_basic_info t_info; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return(NULL); } memsize = 0; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != sess_tbl[i]) continue; pid = pp->kp_proc.p_pid; if (get_tinfo_by_pid(&t_info, pid) != 0) continue; memsize = t_info.virtual_size; sprintf(ret_string, "%ukb", memsize >> 10); /* KB */ return(ret_string); } rm_errno = RM_ERR_EXIST; return(NULL); } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char *resi_job( pid_t jobid) { int i, found; int resisize; struct task_basic_info t_info; unsigned int pid; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return(NULL); } resisize = 0; found = 0; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; pid = pp->kp_proc.p_pid; if (get_tinfo_by_pid(&t_info, pid) != 0) continue; resisize += t_info.resident_size; } if (found) { sprintf(ret_string, "%ukb", resisize >> 10); /* KB */ return(ret_string); } rm_errno = RM_ERR_EXIST; return(NULL); } static char *resi_proc( pid_t pid) { int i; int resisize; struct task_basic_info t_info; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return(NULL); } resisize = 0; for (i = 0;i < nproc;i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->kp_proc.p_pid) continue; if (get_tinfo_by_pid(&t_info, pp->kp_proc.p_pid) != 0) continue; resisize = t_info.resident_size; sprintf(ret_string, "%ukb", resisize >> 10); /* KB */ return(ret_string); } rm_errno = RM_ERR_EXIST; return(NULL); } static char *resi( struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return(NULL); } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (!strcmp(attrib->a_qualifier, "session")) { return(resi_job((pid_t)value)); } else if (!strcmp(attrib->a_qualifier, "proc")) { return(resi_proc((pid_t)value)); } /* FAILURE */ rm_errno = RM_ERR_BADPARAM; return(NULL); } /* END resi() */ char *sessions( struct rm_attribute *attrib) { char *id = "sessions"; int i, j; char *fmt; int njids = 0; pid_t *jids, jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((jids = (pid_t *)calloc(nproc, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for job */ for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pp->kp_eproc.e_pcred.p_ruid == 0) continue; jobid = sess_tbl[i]; DBPRT(("%s: pid %d sid %u\n", id, (int)pp->kp_proc.p_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ jids[njids++] = jobid; /* so add it to list */ } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) { sprintf(fmt, "%d", (int)jids[j]); } else { sprintf(fmt, " %d", (int)jids[j]); } fmt += strlen(fmt); } free(jids); if (njids == 0) { return(NULL); /* by analogy with linux version */ } return(ret_string); } /* END sessions() */ char *nsessions( struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) { sprintf(ret_string, "%d", num); return(ret_string); } for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i; char *fmt; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; DBPRT(("%s[%d]: pid %d sid %u\n", id, num_pids, pp->kp_proc.p_pid, sess_tbl[i])) if (jobid != sess_tbl[i]) continue; checkret(&fmt, 100); sprintf(fmt, " %d", pp->kp_proc.p_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char *nusers( struct rm_attribute *attrib) { char *id = "nusers"; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = (uid_t *)calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if ((uid = pp->kp_eproc.e_pcred.p_ruid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, (int)pp->kp_proc.p_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return(ret_string); } /* END nusers() */ static char *totmem( struct rm_attribute *attrib) { char *id = "totmem"; #ifdef HW_MEMSIZE uint64_t mem = 0; #else int mem = 0; #endif size_t len; #ifdef VM_SWAPUSAGE int mib[2]; struct xsw_usage swap; #endif /* VM_SWAPUSAGE */ if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } /* Get Physical Memory Size * We have to be careful as hw.memsize is not * defined on pre 10.3 */ len = sizeof(mem); #ifdef HW_MEMSIZE if (sysctlbyname("hw.memsize", &mem, &len, NULL, 0) != 0) { sprintf(log_buffer, "sysctl failed with errno %d", errno); log_err(-1, id, log_buffer); return(NULL); } #else /* HW_MEMSIZE */ if (sysctlbyname("hw.physmem", &mem, &len, NULL, 0) != 0) { sprintf(log_buffer, "sysctl failed with errno %d", errno); log_err(-1, id, log_buffer); return(NULL); } #endif /* HW_MEMSIZE */ /* Get Swap Size */ #ifdef VM_SWAPUSAGE mib[0] = CTL_VM; mib[1] = VM_SWAPUSAGE; len = sizeof(struct xsw_usage); if (sysctl(mib, 2, &swap, &len, NULL, 0) != 0) { sprintf(log_buffer, "sysctl failed with errno %d", errno); log_err(-1, id, "log_buffer"); return(NULL); } mem += swap.xsu_total; #else /* VM_SWAPUSAGE */ /* need to load swap info from alternate source */ /* (not implemented) */ #endif /* VM_SWAPUSAGE */ if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: total mem=%lu\n", id, (unsigned long) mem); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } sprintf(ret_string, "%lukb", (unsigned long)(mem / 1024.0)); /* KB */ return(ret_string); } /* END totmem() */ static char *availmem( struct rm_attribute *attrib) { char *id = "availmem"; struct vm_statistics stat; mach_msg_type_number_t count = HOST_VM_INFO_COUNT; uint64_t mem = 0; #ifdef VM_SWAPUSAGE int mib[2]; size_t len; struct xsw_usage swap; #endif /* VM_SWAPUSAGE */ if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } /* Get Swap Info */ #ifdef VM_SWAPUSAGE mib[0] = CTL_VM; mib[1] = VM_SWAPUSAGE; len = sizeof(struct xsw_usage); if (sysctl(mib, 2, &swap, &len, NULL, 0) != 0) { sprintf(log_buffer, "sysctl failed with errno %d", errno); log_err(-1, id, "log_buffer"); return(NULL); } mem += swap.xsu_avail; #else /* VM_SWAPUSAGE */ /* need to load swap info */ /* (not implemented) */ #endif /* VM_SWAPUSAGE */ if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&stat, &count) != KERN_SUCCESS) { log_err(-1, id, "host_statistics failed"); rm_errno = RM_ERR_SYSTEM; return(NULL); } mem += (uint64_t)stat.free_count * gpagesize; if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: free mem=%lu\n", id, (unsigned long)mem); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } sprintf(ret_string, "%lukb", (unsigned long)(mem / 1024)); /* KB */ return(ret_string); } /* END availmem() */ /* * netload. right now this just sums the number of bytes sent/recieved on an * interface this appears to be what netload in linux/res_mom.c does, but * maybe we should be doing something different, I'm not really sure what * netload is supposed to be */ static char *netload( struct rm_attribute *attrib) { char *id = "netload"; struct ifaddrs *ifap, *ifa; struct if_data *ifd; unsigned long bytes = 0; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } if (getifaddrs(&ifap) < 0) { sprintf(log_buffer, "getifaddrs error"); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); return(NULL); } for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { if ((ifa->ifa_flags & IFF_UP) && !(ifa->ifa_flags & IFF_LOOPBACK)) { if (ifa->ifa_addr->sa_family != AF_LINK) continue; ifd = (struct if_data *)ifa->ifa_data; bytes += ifd->ifi_ibytes; bytes += ifd->ifi_obytes; } } /* END for (ifa) */ freeifaddrs(ifap); sprintf(ret_string, "%lu", bytes); return(ret_string); } /* END netload() */ static char *ncpus( struct rm_attribute *attrib) { if (attrib != NULL) { log_err(-1, "ncpus", extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } sprintf(ret_string, "%d", nncpus); system_ncpus = nncpus; return(ret_string); } static char *physmem( struct rm_attribute *attrib) { char *id = "physmem"; if (attrib != NULL) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return(NULL); } #ifdef HW_MEMSIZE { /* NOTE: patch by UMaine */ uint64_t physmem = 0; size_t len = sizeof(physmem); if (sysctlbyname("hw.memsize", &physmem, &len, NULL, 0) < 0) { log_err(errno, id, "sysctl"); rm_errno = RM_ERR_SYSTEM; return(NULL); } sprintf(ret_string, "%ukb", (uint32_t)(physmem >> 10)); } /* END BLOCK */ #else { unsigned int physmem = 0; /* change to unsigned long? (proposed) */ size_t len = sizeof(physmem); int mib[2]; mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; if (sysctl(mib, 2, &physmem, &len, NULL, 0) < 0) { log_err(errno, id, "sysctl"); rm_errno = RM_ERR_SYSTEM; return(NULL); } /* change to "%ulkb" (proposed) */ sprintf(ret_string, "%ukb", physmem >> 10); /* in KB */ } /* END BLOCK */ #endif /* HW_MEMSIZE */ return(ret_string); } /* END physmem() */ char *size_fs( char *param) { char *id = "size_fs"; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bavail) / 1024.0)); return(ret_string); } char *size_file( char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%lldkb", sbuf.st_size >> 10); /* in KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax( char *dev) { struct stat sb; if (stat(dev, &sb) == -1) { return; } if (maxtm < sb.st_atime) { DBPRT(("setmax: dev %s access %ld replaces max %ld\n", dev, (long)sb.st_atime, (long)maxtm)) maxtm = sb.st_atime; } return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ld", (long)MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; pid_t value; int i, job, found = 0; time_t now, start; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (job) { if (value != sess_tbl[i]) continue; } else { if (value != pp->kp_proc.p_pid) continue; } if (pp->kp_proc.p_stat != SIDL || pp->kp_proc.p_stat != SRUN || pp->kp_proc.p_stat != SSLEEP || pp->kp_proc.p_stat != SSTOP || pp->kp_proc.p_stat != SZOMB) { rm_errno = RM_ERR_SYSTEM; return NULL; } found = 1; start = MIN(start, pp->kp_proc.p_un.__p_starttime.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la( double *rv) { char *id = "get_la"; int mib[2]; struct loadavg la; size_t len = sizeof(la); mib[0] = CTL_VM; mib[1] = VM_LOADAVG; if (sysctl(mib, 2, &la, &len, NULL, 0) < 0) { log_err(errno, id, "sysctl(VM_LOADAVG)"); return (rm_errno = RM_ERR_SYSTEM); } *rv = (double)la.ldavg[0] / la.fscale; return (0); } u_long gracetime( u_long secs) { time_t now = time((time_t *)NULL); if (secs > (u_long)now) /* time is in the future */ return (secs - now); else return (0); } static char *quota( struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct fstab *fs; struct dqblk qi; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return (NULL); } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) { /* check to see if command is legal */ sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return (NULL); } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return (NULL); } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] != '/') { /* must be absolute path */ sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return (NULL); } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return (NULL); } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if (setfsent() == 0) { log_err(errno, id, "setfsent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((fs = getfsent()) != NULL) { if (strcmp(fs->fs_type, FSTAB_XX) == 0 || strcmp(fs->fs_type, FSTAB_SW) == 0) continue; if (stat(fs->fs_file, &sb) == -1) { sprintf(log_buffer, "stat: %s", fs->fs_file); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", fs->fs_spec, fs->fs_file, sb.st_dev)) if (sb.st_dev == dirdev) break; } endfsent(); if (fs == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return (NULL); } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return (NULL); } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return (NULL); } uid = pw->pw_uid; } if (quotactl(fs->fs_file, Q_GETQUOTA, uid, (char *)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return (NULL); } /* all sizes in KB */ switch (type) { case harddata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_bhardlimit, 1) >> 10); break; case softdata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_bsoftlimit, 1) >> 10); break; case currdata: sprintf(ret_string, "%ukb", dbtob(qi.dqb_curbytes, 1) >> 10); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_ihardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_isoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curinodes); break; case timedata: sprintf(ret_string, "%lu", gracetime(qi.dqb_btime)); break; case timefile: sprintf(ret_string, "%lu", gracetime(qi.dqb_itime)); break; } return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ /* This is basically a wrapper for the MACH t_info and vm_region calls */ static int get_tinfo_by_pid( struct task_basic_info *t_info, unsigned int pid) { task_t task; mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT; #ifdef VM_REGION_BASIC_INFO_64 mach_msg_type_number_t vm_info_count = VM_REGION_BASIC_INFO_COUNT_64; #else mach_msg_type_number_t vm_info_count = VM_REGION_BASIC_INFO_COUNT; #endif struct vm_region_basic_info_64 vm_info; vm_size_t size; mach_port_t object_name; vm_address_t address = GLOBAL_SHARED_TEXT_SEGMENT; kern_return_t errno; if (task_for_pid(mach_task_self(), pid, &task) != KERN_SUCCESS) { DBPRT(("get_tinfo_by_pid: pid is not a valid process id.\n")); return(-1); } if ((errno = task_info( task, TASK_BASIC_INFO, (task_info_t)t_info, &t_info_count) != KERN_SUCCESS)) { DBPRT(("get_tinfo_by_pid: error(%d) in task_info\n", errno)); return(errno); } #ifdef VM_REGION_BASIC_INFO_COUNT_64; if ((errno = vm_region_64( task, &address, &size, VM_REGION_BASIC_INFO_64, (vm_region_info_t) & vm_info, &vm_info_count, &object_name)) != KERN_SUCCESS) { DBPRT(("get_tinfo_by_pid: error(%d) in vm_region_64\n", errno)); return(errno); } #else if ((errno = vm_region( task, &address, &size, VM_REGION_BASIC_INFO, (vm_region_info_t) & vm_info, &vm_info_count, &object_name)) != KERN_SUCCESS) { DBPRT(("get_tinfo_by_pid: error(%d) in vm_region\n", errno)); return(errno); } #endif /* * From Darwin 'ps' source * "Check for firmware split libraries" * We'll modify t_info inline here. */ if (vm_info.reserved && (size == SHARED_TEXT_REGION_SIZE) && (t_info->virtual_size > (SHARED_DATA_REGION_SIZE + SHARED_TEXT_REGION_SIZE))) { t_info->virtual_size -= (SHARED_DATA_REGION_SIZE + SHARED_TEXT_REGION_SIZE); } return(0); } /* get the system time and user time for live threads for a task by pid */ static int get_time_info_by_pid( struct task_thread_times_info *t_info, unsigned int pid) { task_t task; mach_msg_type_number_t t_info_count = TASK_THREAD_TIMES_INFO_COUNT; kern_return_t errno; if (task_for_pid(mach_task_self(), pid, &task) != KERN_SUCCESS) { DBPRT(("get_time_info_by_pid: pid is not a valid process id.\n")); return(-1); } if ((errno = task_info( task, TASK_THREAD_TIMES_INFO, (task_info_t)t_info, &t_info_count) != KERN_SUCCESS)) { DBPRT(("get_time_info_by_pid: error(%d) in task_info\n", errno)); return(errno); } return(0); } torque-2.4.16/src/resmom/darwin/Makefile.am0000664000113300011330000000030611272401243015440 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/unicosmk2/0000777000113300011330000000000011614035174014123 500000000000000torque-2.4.16/src/resmom/unicosmk2/mom_start.c0000664000113300011330000004374611470340444016227 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 4237 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; extern time_t time_now; #if SRFS char *fast_dir; char *big_dir; char *tmp_dir; #endif /* * tmpdirname - build a temporary directory name */ char * tmpdirname(char *root, char *sequence) { static char tmpdir[MAXPATHLEN+1]; if (root == NULL) return (NULL); sprintf(tmpdir, "%s/pbs.%s", root, sequence); return (tmpdir); } #define DIR_RETRY 10 /* ** Try to make a directory. If it works, return 0. If ** the name exists, return 1. If it fails for any other reason, ** return -1. */ int makedir(name, uid, gid) char *name; uid_t uid; gid_t gid; { static char id[] = "makedir"; int i; for (i = 0; i < DIR_RETRY; i++) { if (mkdir(name, 01777) == -1) { if (errno == EEXIST) { sleep(1); continue; } sprintf(log_buffer, "mkdir: %s", name); log_err(errno, id, log_buffer); return -1; } if (chown(name, uid, gid) == -1) { sprintf(log_buffer, "chown: %s", name); log_err(errno, id, log_buffer); return -1; } return 0; } sprintf(log_buffer, "mkdir retrys exhausted: %s", name); log_err(errno, id, log_buffer); return 1; } /* * mktmpdir - make temporary directory(s) * Temporary directory(s) are created and the name are * placed in environment variables. If a directory can not be made an * error code is returned. */ int mktmpdir( job *pjob, struct var_table *vtab /* pointer to variable table */ ) { uid_t uid; gid_t gid; char *seq; char *tmpdir; char *pdir; int ret; task *ptask; int tasks; uid = pjob->ji_qs.ji_un.ji_momt.ji_exuid; gid = pjob->ji_qs.ji_un.ji_momt.ji_exgid; seq = pjob->ji_qs.ji_jobid; for (ptask = (task *)GET_NEXT(pjob->ji_tasks), tasks = 0; ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask), tasks++); #if SRFS extern char *var_value A_((char *)); tmpdir = tmpdirname(var_value("TMPDIR"), seq); #else tmpdir = tmpdirname(TMP_DIR, seq); #endif /* SRFS */ if (tasks == 1) { if ((ret = makedir(tmpdir, uid, gid)) != 0) return ret; } bld_env_variables(vtab, "TMPDIR", tmpdir); #if SRFS tmp_dir = strdup(tmpdir); if ((pdir = var_value("BIGDIR")) != NULL) { tmpdir = tmpdirname(pdir, seq); if (tasks == 1) { if ((ret = makedir(tmpdir, uid, gid)) != 0) return ret; } bld_env_variables(vtab, "BIGDIR", tmpdir); big_dir = strdup(tmpdir); } if ((pdir = var_value("FASTDIR")) != NULL) { tmpdir = tmpdirname(var_value("FASTDIR"), seq); if (tasks == 1) { if ((ret = makedir(tmpdir, uid, gid)) != 0) return ret; } bld_env_variables(vtab, "FASTDIR", tmpdir); fast_dir = strdup(tmpdir); } #endif /* SRFS */ return 0; } void rmonedir(char *tmpdir) { static char *id = "rmonedir"; struct stat sb; int pid; char *rm = "/bin/rm"; char *rf = "-rf"; /* Hello, is any body there? */ if (stat(tmpdir, &sb) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "Unable to stat %s", tmpdir); log_err(errno, id, log_buffer); } return; } /* fork and exec the cleamtmp process */ pid = fork(); if (pid < 0) { log_err(errno, id, "Unable to fork"); return; } if (pid > 0) return; execl(rm, "pbs_cleandir", rf, tmpdir, 0); log_err(errno, id, "This is really bad"); exit(1); } /* * rmtmpdir - remove the temporary directory * This may take awhile so the task is forked and execed to another * process. */ void rmtmpdir(char *sequence) #if SRFS { static char *id = "rmtmpdir"; char *tmpdir; int pid, pstat; extern char *var_value A_((char *)); pid = fork(); if (pid < 0) { log_err(errno, id, "Unable to fork"); return; } if (pid > 0) /* parent */ return; /* child */ tmpdir = tmpdirname(var_value("TMPDIR"), sequence); rmonedir(tmpdir); wait(&pstat); tmpdir = tmpdirname(var_value("FASTDIR"), sequence); rmonedir(tmpdir); wait(&pstat); tmpdir = tmpdirname(var_value("BIGDIR"), sequence); rmonedir(tmpdir); wait(&pstat); exit(0); } #else { static char *id = "rmtmpdir"; char *tmpdir; /* Get tmpdir name */ tmpdir = tmpdirname(TMP_DIR, sequence); rmonedir(tmpdir); } #endif /* SRFS */ #define J_SETFL 2 /* Set job flags */ #define J_BATCH 000010 /* job is a batch job */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. */ int set_job(job *pjob, struct startjob_rtn *sjr) { uid_t uid = pjob->ji_qs.ji_un.ji_momt.ji_exuid; if ((sjr->sj_session = setjob(uid, WJSIGNAL)) == -1) return (-1); if (sesscntl(sjr->sj_session, J_SETFL, J_BATCH) == -1) return (-1); return (sjr->sj_session); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars(job *pjob, struct var_table *vtab) { int ret; /* Add names of temp directories to environment */ ret = mktmpdir(pjob, vtab); switch (ret) { case 0: return 0; case 1: /* old dirs exist, doing remove */ rmtmpdir(pjob->ji_qs.ji_jobid); return JOB_EXEC_RETRY; default: return JOB_EXEC_FAIL1; } } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; int sid; job *pjob; task *ptask; int statloc; attribute *at; resource_def *rd; resource *pres; long himem, himpp, hisds; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { #ifdef DEBUG sprintf(log_buffer, "Waitpid = %d", pid); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, "PBS_MOM", log_buffer); #endif /* ** see if process was a child doing a special function for MOM */ pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { if (pid == pjob->ji_momsubt) { if (WIFEXITED(statloc)) statloc = WEXITSTATUS(statloc); else statloc = -1; if (pjob->ji_mompost) { pjob->ji_mompost(pjob, statloc); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); break; } pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((sid = wait_job(&himem, &himpp, &hisds)) > 0) { sprintf(log_buffer, "Waitjob = %d", sid); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, "PBS_MOM", log_buffer); pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == sid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (pjob == NULL) { DBPRT(("%s: sid %d not a task\n", id, sid)) continue; } at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; at->at_flags |= (ATR_VFLAG_MODIFY & ATR_VFLAG_SET); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_long = himem << (BPCSHIFT - 10); rd = find_resc_def(svr_resc_def, "mppmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_long = himpp << (BPCSHIFT - 10); rd = find_resc_def(svr_resc_def, "sds", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_size.atsv_shift = 10; /* in KB */ pres->rs_value.at_val.at_long = hisds << (BPCSHIFT - 10); /* ** We found task within the job which has exited. */ if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; DBPRT(("%s: task %d sid %d exit value %d\n", id, ptask->ti_qs.ti_task, sid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } #define PTY_SIZE 12 /* * creat the master pty, this particular * piece of code does it the hard way, it searches */ int open_master( char **rtn_name /* RETURN name of slave pts */ ) { int i = 0; int ptc; /* master file descriptor */ static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ while (1) { (void)sprintf(pty_name, "/dev/pty/%03d", i++); if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; pty_name[6] = 't'; pty_name[7] = 'y'; pty_name[8] = 'p'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "ABRT", SIGABRT }, { "IOT", SIGIOT }, { "HWE", SIGHWE }, { "ERR", SIGERR }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "PRE", SIGPRE }, { "BUS", SIGBUS }, { "ORE", SIGORE }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "IO", SIGIO }, { "URG", SIGURG }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "MT", SIGMT }, { "MTKILL", SIGMTKILL }, { "BUFIO", SIGBUFIO }, { "RECOVERY", SIGRECOVERY }, { "UME", SIGUME }, { "DLK", SIGDLK }, { "CPULIM", SIGCPULIM }, { "SHUTDN", SIGSHUTDN }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "WINCH", SIGWINCH }, { "RPE", SIGRPE }, { "WRBKPT", SIGWRBKPT }, { "NOBDM", SIGNOBDM }, { "CRAY9", SIGCRAY9 }, { "CRAY10", SIGCRAY10 }, { "CRAY11", SIGCRAY11 }, { "CRAY12", SIGCRAY12 }, { "CRAY13", SIGCRAY13 }, { "CRAY14", SIGCRAY14 }, { "INFO", SIGINFO }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; /* * post_suspend - post exit of child for suspending a job */ int post_suspend( job *pjob, int err) { if (err == 0) { pjob->ji_qs.ji_substate = JOB_SUBSTATE_SUSPEND; pjob->ji_qs.ji_svrflags |= JOB_SVFLG_Suspend; } return(0); } /* * post_resume - post exit of child for suspending a job */ int post_resume( job *pjob, int err) { if (err == 0) { /* * adjust walltime for time suspended, ji_momstat contains * time when suspended, ji_stime when job started; adjust * stime to current time minus (back to) amount of time * used before suspended. */ if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) { pjob->ji_qs.ji_stime = time_now - (pjob->ji_momstat - pjob->ji_qs.ji_stime); } pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_Suspend; } return(0); } torque-2.4.16/src/resmom/unicosmk2/mom_mach.h0000664000113300011330000001240211272401244015764 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: c90 */ #ifndef MOM_MACH #define MOM_MACH "unicos8" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/unicosmk2/Makefile.in0000664000113300011330000004415111605403760016113 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/unicosmk2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) wait_job.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c wait_job.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/unicosmk2/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/unicosmk2/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait_job.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/unicosmk2/pe_input.c0000664000113300011330000001065611272401244016033 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For Unicos - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/unicosmk2/wait_job.c0000664000113300011330000001053311272401244016000 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include int wait_job(long *cmdmem, long *mppmem, long *sds) { struct jtab jtab; int ret; ret = waitjob(&jtab); *cmdmem = jtab.j_cmdhimem; *mppmem = jtab.j_mpphimem; *sds = jtab.j_sdshiwat; return ret; } torque-2.4.16/src/resmom/unicosmk2/mom_mach.c0000664000113300011330000014311311272401244015763 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "pbs_error.h" #include "log.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "mom_func.h" #include "resmon.h" #include "../rm_dep.h" static char ident[] = "@(#) unicosmk2/$RCSfile$ $Revision: 3151 $"; #ifndef max #define max(a,b) (a>b ? a : b) #endif #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ /* ** System dependent code to gather information for the resource ** monitor for a Cray T3E machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** totmem total memory size ** availmem available memory size ** ncpus number of cpus ** physmem physical memory size ** size size of a file or filesystem ** idletime seconds of idle time ** quota quota information ** srfs_reserve set srfs reservation */ extern time_t time_now; extern char *path_checkpoint; /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern char *ret_string; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignmem; /* ** local functions and data */ static char *ncpus A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); static char *srfs_reserve A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); extern char extra_parm[]; extern char no_parm[]; char no_srfs[] = "SRFS request not supported"; char procfs[] = "/proc"; struct target tinfo; time_t wait_time; long last_time = 0; /* ** local resource array */ struct config dependent_config[] = { { "ncpus", {ncpus} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "quota", {quota} }, { "srfs_reserve", {srfs_reserve} }, { NULL, {nullproc} }, }; /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } void dep_initialize(void) { char *id = "dep_initialize"; limit(C_PROC, 0, L_CPU, 0); /* set unlimited cpu */ if (target(MC_GET_TARGET, &tinfo) == -1) { log_err(errno, id, "target"); die(0); } DBPRT(("Primary machine type name = %s\n", &tinfo.mc_pmt)) DBPRT(("Number of memory banks = %ld\n", tinfo.mc_bank)) DBPRT(("Number of started processors = %ld\n", tinfo.mc_ncpu)) DBPRT(("Instruction Buffer Size (words) = %ld\n", tinfo.mc_ibsz)) DBPRT(("Main memory size (words) = %ld\n", tinfo.mc_msz)) DBPRT(("Number of clocks for a memory read = %ld\n", tinfo.mc_mspd)) DBPRT(("Clock period in picoseconds = %ld\n", tinfo.mc_clk)) DBPRT(("Number of cluster register sets = %ld\n", tinfo.mc_ncl)) DBPRT(("Memory bank busy time in clocks = %ld\n", tinfo.mc_bbsy)) DBPRT(("Number of clock ticks per second = %ld\n", tinfo.mc_clktck)) DBPRT(("System serial number = %ld\n", tinfo.mc_serial)) DBPRT(("UNICOS release level = %ld\n", tinfo.mc_rls)) dep_main_loop_cycle(); } void dep_cleanup(void) { char *id = "dep_cleanup"; int i; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For Unicos, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in milliseconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Internal long decoding routine. * * Accepts a resource pointer and a pointer to a long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of number in the long integer. */ static int getlong(resource *pres, long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Internal boolean decoding routine. * * Accepts a resource pointer and a pointer to the unsigned integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of true (1) or false (0). */ static int getbool(resource *pres, unsigned int *ret) { unsigned int val; if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); val = pres->rs_value.at_val.at_long; if (val != 0 && val != 1) return (PBSE_BADATVAL); *ret = val; return (PBSE_NONE); } /* * Internal job cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all processes executed by the job, in seconds, * adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { static char *id = "cput_sum"; ulong cputime = 0; int nps = 0; task *ptask; struct resclim rl; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) rl.resc_category = C_JOB; rl.resc_resource = L_CPU; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (getlim(ptask->ti_qs.ti_sid, &rl) == -1) continue; nps++; cputime += rl.resc_used; } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Internal job cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all moo time * consumed for all processes executed by the job, in seconds. */ static unsigned long mppt_sum(job *pjob) { static char *id = "mppt_sum"; ulong cputime = 0; task *ptask; struct resclim rl; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) rl.resc_category = C_JOB; rl.resc_resource = L_MPPT; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (getlim(ptask->ti_qs.ti_sid, &rl) == -1) continue; cputime += rl.resc_used; } return (cputime); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * which_limit - set either user's limit or udb limit: * * If user's limit is a default, then use lesser of it or udb * * Else, use user's limit unless it is greater than the udb and the * the udb limit is not unlimited. This case is an error. */ static int which_limit( long rlimit, /* limit value from resource_limit */ long udblimit, /* limit for that resource from UDB */ int r_flags, /* resource entry flags (ATR_VFLAG_DEFLT) */ int zlimit, /* true if 0 in udb mean real limit of zero */ long *rtn_limit /* RETURN: the limit to set */ ) { if (r_flags & ATR_VFLAG_DEFLT) { /* User's limit is a default value, if default > UDB, use UDB */ if ((udblimit == MAXUE_LONG) || ((udblimit == 0) && (zlimit == 0)) || (rlimit < udblimit)) *rtn_limit = rlimit; else *rtn_limit = udblimit; } else { /* user specified an actual limit */ if (zlimit) { if ((udblimit != MAXUE_LONG) && (rlimit > udblimit)) return (PBSE_EXLIMIT); } else { if (((udblimit != 0) || (udblimit != MAXUE_LONG)) && (rlimit > udblimit)) return (PBSE_EXLIMIT); } *rtn_limit = rlimit; } return (0); } /* * Establish system-enforced limits for the tasks of a job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Unlike bsd based systems that use setrlimit, the * Cray limit() call can set limits for another session. Hence all * limits can be adjusted. */ int mom_set_limits( job *pjob, int set_mode /* unused here */ ) { static char *id = "mom_set_limits"; int acid; int maxcput; int maxpcput; int maxmem; int maxmt[MAXUE_TAPETYPE]; int maxpmem; int maxpf; int maxppf; int maxsds; int maxpsds; int maxnproc; int maxmppe; int maxmppt; int maxpmppt; int niceval; int num; char *pc; char *phost; char *pname; struct udb *pudb; int sessid; int retval; attribute *pat; resource *pres; task *ptask; unsigned long value; /* place in which to build resource value */ log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); /* initialize limits to values from user's UDB */ if (set_mode == SET_LIMIT_SET) { getsysudb(); /* get the priviled (locked) udb */ } pudb = getudbuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid); if (pudb == UDB_NULL) return (PBSE_BADUSER); if (set_mode == SET_LIMIT_SET) { /* can this user run batch jobs */ if (pudb->ue_permbits & PERMBITS_NOBATCH) { endudb(); return (PBSE_QACESS); } /* set Account ID: 1 - if supplied and is valid acid, */ /* or 2 - default acid from UDB */ pat = &pjob->ji_wattr[(int)JOB_ATR_account]; if (pat->at_flags & ATR_VFLAG_SET) { pname = pat->at_val.at_str; if ((acid = nam2acid(pname)) == -1) { for (pc = pname; *pc; ++pc) { if (!isdigit((int)*pc)) return (error(pname, PBSE_BADACCT)); } if (acid2nam(acid = atoi(pname)) == (char *)0) return (error(pname, PBSE_BADACCT)); } for (num = 0; num < MAXVIDS; ++num) { if (pudb->ue_acids[num] == acid) break; } if (num == MAXVIDS) return (error(pname, PBSE_BADACCT)); } else { acid = pudb->ue_acids[0]; } if (acctid(0, acid) == -1) return (error("Account", PBSE_BADACCT)); /* lock and update the UDB with the batch host/time */ if (lockudb() < 0) { log_err(udb_errno, id, "Unable to lock UDB"); } else { pudb->ue_batchtime = time_now; phost = arst_string("PBS_O_HOST", &pjob->ji_wattr[(int)JOB_ATR_variables]); if ((phost == (char *)0) || ((phost = strchr(phost, (int)'=')) == (char *)0)) log_err(-1, id, "PBS_O_HOST not set"); strncpy(pudb->ue_batchhost, phost + 1, MAXUE_HOSTNAME); pudb->ue_batchhost[MAXUE_HOSTNAME] = '\0'; if (rewriteudb(pudb) < 0) log_err(udb_errno, id, "UDB Update failed"); } } endudb(); /* * set basic limits to values from the user's UDB entry; later * we have to check for values == MAXUE_LONG, meaning unlimited, * where in the limit() call it must be changed to 0. * A click is 512 words = 4096 bytes */ maxcput = pudb->ue_jcpulim[UDBRC_BATCH]; /* seconds */ maxpcput = pudb->ue_pcpulim[UDBRC_BATCH]; /* seconds */ maxmem = pudb->ue_jmemlim[UDBRC_BATCH]; /* clicks */ maxpmem = pudb->ue_pmemlim[UDBRC_BATCH]; /* clicks */ maxpf = pudb->ue_jfilelim[UDBRC_BATCH]; /* clicks */ maxppf = pudb->ue_pfilelim[UDBRC_BATCH]; /* clicks */ maxsds = pudb->ue_jsdslim[UDBRC_BATCH]; /* clicks */ maxpsds = pudb->ue_psdslim[UDBRC_BATCH]; /* clicks */ maxnproc = pudb->ue_jproclim[UDBRC_BATCH]; maxmppe = pudb->ue_jpelimit[UDBRC_BATCH]; maxmppt = pudb->ue_jmpptime[UDBRC_BATCH]; maxpmppt = pudb->ue_pmpptime[UDBRC_BATCH]; niceval = pudb->ue_nice[UDBRC_BATCH]; for (num = 0; num < MAXUE_TAPETYPE; ++num) maxmt[num] = pudb->ue_jtapelim[UDBRC_BATCH][num]; pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { retval = gettime(pres, &value); value = (unsigned long)((double)value / cputfactor); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxcput, pres->rs_value.at_flags, 0, &maxcput); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { retval = gettime(pres, &value); value = (unsigned long)((double)value / cputfactor); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxpcput, pres->rs_value.at_flags, 0, &maxpcput); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "mem") == 0) { if (ignmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxmem, pres->rs_value.at_flags, 0, &maxmem); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pmem") == 0) { if (ignmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxpmem, pres->rs_value.at_flags, 0, &maxpmem); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "vmem") == 0) /* ignore */ { } else if (strcmp(pname, "pvmem") == 0) /* ignore */ { } else if (strcmp(pname, "file") == 0) /* ignore */ { } else if ((strcmp(pname, "mta") == 0) || (strcmp(pname, "mtb") == 0) || (strcmp(pname, "mtc") == 0) || (strcmp(pname, "mtd") == 0) || (strcmp(pname, "mte") == 0) || (strcmp(pname, "mtf") == 0) || (strcmp(pname, "mtg") == 0) || (strcmp(pname, "mth") == 0)) { num = (int) * (pname + 2) - (int)'a'; maxmt[num] = pres->rs_value.at_val.at_long; retval = which_limit(pres->rs_value.at_val.at_long, maxmt[num], pres->rs_value.at_flags, 0, &maxmt[num]); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "pf") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxpf, pres->rs_value.at_flags, 0, &maxpf); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "ppf") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxppf, pres->rs_value.at_flags, 0, &maxppf); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "sds") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxsds, pres->rs_value.at_flags, 1, &maxsds); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "psds") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxpsds, pres->rs_value.at_flags, 1, &maxpsds); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "procs") == 0) { retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxnproc, pres->rs_value.at_flags, 0, &maxnproc); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "mppe") == 0) { retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxmppe, pres->rs_value.at_flags, 1, &maxmppe); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "mppt") == 0) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxmppt, pres->rs_value.at_flags, 1, &maxmppt); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "pmppt") == 0) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxpmppt, pres->rs_value.at_flags, 1, &maxpmppt); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "walltime") == 0) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) { if (set_mode == SET_LIMIT_SET) { niceval = (int)pres->rs_value.at_val.at_long; } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and nor marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } /* * Set the limits * * If pcput, pmem, or ppf is unlimited but the corresponding session * limit is not, use the session limit for the process limit. */ for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { sessid = ptask->ti_qs.ti_sid; if (maxcput == MAXUE_LONG) /* if unlimited */ maxcput = 0; if (limit(C_JOB, sessid, L_CPU, maxcput) < 0) return (error("cput", PBSE_SYSTEM)); if ((maxpcput == MAXUE_LONG) || (maxpcput == 0)) /* if unlimited */ { if (maxcput != 0) maxpcput = maxcput; else maxpcput = 0; } else if ((maxpcput > maxcput) && (maxcput != 0)) { maxpcput = maxcput; } if (limit(C_JOBPROCS, sessid, L_CPU, maxpcput) < 0) return (error("pcput", PBSE_SYSTEM)); if (maxmem == MAXUE_LONG) /* if unlimited */ maxmem = 0; if (limit(C_JOB, sessid, L_MEM, maxmem) < 0) return (error("mem", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_MPPM, maxmem) < 0) return (error("mppm", PBSE_SYSTEM)); if ((maxpmem == MAXUE_LONG) || (maxpmem == 0)) /* if unlimited */ { if (maxmem != 0) maxpmem = maxmem; else maxpmem = 0; } else if ((maxpmem > maxmem) && (maxmem != 0)) { maxpmem = maxmem; } if (limit(C_JOBPROCS, sessid, L_MEM, maxpmem) < 0) return (error("pmem", PBSE_SYSTEM)); if (maxpf == MAXUE_LONG) /* if unlimited */ maxpf = 0; if (limit(C_JOB, sessid, L_FSBLK, maxpf) < 0) return (error("pf", PBSE_SYSTEM)); if ((maxppf == MAXUE_LONG) || (maxppf == 0)) /* if unlimited */ { if (maxpf != 0) maxppf = maxpf; else maxppf = 0; } else if ((maxppf > maxpf) && (maxpf != 0)) { maxppf = maxpf; } if (limit(C_JOBPROCS, sessid, L_FSBLK, maxppf) < 0) return (error("ppf", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_SDS, maxsds) < 0) return (error("sds", PBSE_SYSTEM)); if (limit(C_JOBPROCS, sessid, L_SDS, maxpsds) < 0) return (error("psds", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_CPROC, maxnproc) < 0) return (error("procs", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE0, maxmt[0]) < 0) return (error("mta", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE1, maxmt[1]) < 0) return (error("mtb", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE2, maxmt[2]) < 0) return (error("mtc", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE3, maxmt[3]) < 0) return (error("mtd", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE4, maxmt[4]) < 0) return (error("mte", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE5, maxmt[5]) < 0) return (error("mtf", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE6, maxmt[6]) < 0) return (error("mtg", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_TAPE7, maxmt[7]) < 0) return (error("mth", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_MPPE, maxmppe) < 0) return (error("mppe", PBSE_SYSTEM)); if (limit(C_JOB, sessid, L_MPPT, maxmppt) < 0) return (error("mppt", PBSE_SYSTEM)); if (limit(C_JOBPROCS, sessid, L_MPPT, maxpmppt) < 0) return (error("pmppt", PBSE_SYSTEM)); if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice(niceval) == -1) && (errno != 0)) return (error("nice", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { static char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { static char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) return (PBSE_NONE); } /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { static char *id = "mom_over_limit"; char *pname; int retval; unsigned long value; resource *pres; int num; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. */ int mom_set_use(job *pjob) { static char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; long *lp, num; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) != 0) return (PBSE_NONE); /* job suspended, don't track it */ DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mppt", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_long; num = cput_sum(pjob); *lp = max(*lp, num); rd = find_resc_def(svr_resc_def, "mppt", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_long; num = mppt_sum(pjob); *lp = max(*lp, num); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { static char *id = "kill_task"; int ct = 1; int sesid; sesid = ptask->ti_qs.ti_sid; if (sesid > 1) { if (killm(C_JOB, sesid, sig) == -1) { if (errno != ESRCH) { sprintf(log_buffer, "killm: sid=%d sig=%d", sesid, sig); log_err(errno, id, log_buffer); } else { ct = 0; sprintf(log_buffer, "killm: sid=%d sig=%d", sesid, sig); log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } } } return ct; } /* * Clean up everything related to polling. */ int mom_close_poll(void) { return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return (CST_MACH_DEP); } /* * Checkpoint the job. * * If abort is TRUE, kill it too. */ int mach_checkpoint(task *ptask, char *path, int abort) { int cprtn; long flags = 0; if (abort) flags = CHKPNT_KILL; cprtn = checkpoint(C_JOB, ptask->ti_qs.ti_sid, path, flags); return cprtn; } /* * Restart the job from the checkpoint file. * * Return the session/job id */ long mach_restart(task *ptask, char *path) { int sid; sid = restart(path, 0); return sid; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; struct resclim rl; rl.resc_category = C_JOB; rl.resc_resource = L_CPU; if (getlim(jobid, &rl) == -1) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%.2f", cputfactor * rl.resc_used); return ret_string; } char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; struct resclim rl; DBPRT(("%s: entered %d\n", id, pid)) rl.resc_category = C_PROC; rl.resc_resource = L_CPU; if (getlim(pid, &rl) == -1) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%.2f", cputfactor * rl.resc_used); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; rm_errno = RM_ERR_EXIST; return NULL; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } rm_errno = RM_ERR_EXIST; return NULL; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } rm_errno = RM_ERR_EXIST; return NULL; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } rm_errno = RM_ERR_EXIST; return NULL; } static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%d blocks=%d\n", id, fsbuf.f_bsize, fsbuf.f_blocks)) sprintf(ret_string, "%d", fsbuf.f_bsize * fsbuf.f_blocks); return ret_string; } static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%d bfree=%d\n", id, fsbuf.f_bsize, fsbuf.f_bfree)) sprintf(ret_string, "%d", fsbuf.f_bsize * fsbuf.f_bfree); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ld", tinfo.mc_ncpu); system_ncpus = tinfo.mc_ncpu; return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ld", tinfo.mc_msz * sizeof(int)); return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%lukb", (unsigned long)((fsbuf.f_bsize * fsbuf.f_bfree) >> 10)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%d", sbuf.st_size); return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static int quotasize(int blocks) { if (QFV_MINVALUE <= blocks && blocks <= QFV_MAXVALUE) { sprintf(ret_string, "%ld", BSIZE * blocks); return 0; } switch (blocks) { case QFV_DEFAULT: strcpy(ret_string, "default"); return 1; case QFV_NOEVAL: strcpy(ret_string, "infinity"); break; case QFV_PREVENT: strcpy(ret_string, "prevent"); break; default: strcpy(ret_string, "unspecified"); break; } return 0; } typedef int (*ifunc)(); static char * quota(struct rm_attribute *attrib) { char *id = "quota"; time_t now; int ident; char dirname[FILENAME_MAX]; struct q_request qi; struct qf_header header; struct q_entry *qu; static char *bean_type[] = { "account", /* 0 */ "group", /* 1 */ "user" /* 2 */ }; static ifunc bean_func[] = { nam2acid, nam2gid, nam2uid }; enum bean_name { account, group, user, bean_end } bean; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", "snap_avail", /* srfs */ "ares_avail", /* srfs */ "res_total", /* srfs */ "soft_res", /* srfs */ "delta", /* srfs */ "reserve", /* srfs */ }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, snap_avail, ares_avail, res_total, soft_res, delta, reserve, type_end } type; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] == '/') /* must be absolute path */ strcpy(dirname, attrib->a_value); else { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } /* ** See if it's a srfs request. They don't need an id. */ if (type >= snap_avail) { if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } log_err(errno, id, no_srfs); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Check type of id: user, group or acct. */ if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } for (bean = 0; bean < bean_end; bean++) { if (strcmp(attrib->a_qualifier, bean_type[bean]) == 0) break; } if (bean == bean_end) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } ident = atoi(attrib->a_value); if (ident == 0) { ident = bean_func[bean](attrib->a_value); if (ident == -1) { sprintf(log_buffer, "%s not found: %s", bean_type[bean], attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } qi.qf_entry.id = ident; qi.qf_magic = QF_MAGIC; if (quotactl(dirname, Q_GETQUOTA, (caddr_t)&qi) == -1) { log_err(errno, id, "quotactl(Q_GETQUOTA)"); rm_errno = RM_ERR_SYSTEM; return NULL; } qu = NULL; switch (bean) { case account: if (qi.acct) qu = &qi.qf_entry.acct_q; break; case group: if (qi.group) qu = &qi.qf_entry.group_q; break; case user: if (qi.user) qu = &qi.qf_entry.user_q; break; } if (qu == NULL) { sprintf(log_buffer, "%s quota information not returned", bean_type[bean]); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } switch (type) { case harddata: if (quotasize(qu->f_quota)) break; return ret_string; case softdata: if (quotasize(qu->f_warn)) break; return ret_string; case currdata: sprintf(ret_string, "%ld", BSIZE*qu->f_use); return ret_string; case hardfile: if (quotasize(qu->i_quota)) break; return ret_string; case softfile: if (quotasize(qu->i_warn)) break; return ret_string; case currfile: sprintf(ret_string, "%ld", qu->i_use); return ret_string; case timedata: case timefile: now = time((time_t *)NULL); if (qu->f_wtime > now) /* time is in the future */ sprintf(ret_string, "%ld", qu->f_wtime - now); else strcpy(ret_string, "0"); return ret_string; } /* ** If we get here, the default number is needed. */ DBPRT(("%s: getting default info\n", id)) header.qf_magic = QF_MAGIC; if (quotactl(dirname, Q_GETHEADER, (caddr_t)&header) == -1) { log_err(errno, id, "quotactl(Q_GETHEADER)"); rm_errno = RM_ERR_SYSTEM; return NULL; } switch (type) { case harddata: (void)quotasize(header.user_h.def_fq); return ret_string; case softdata: (void)quotasize(header.user_h.warn_fq); return ret_string; case hardfile: sprintf(ret_string, "%ld", header.user_h.def_iq); return ret_string; case softfile: sprintf(ret_string, "%ld", header.user_h.warn_iq); return ret_string; } return ret_string; } static char * srfs_reserve(struct rm_attribute *attrib) { char *id = "srfs_reserve"; log_err(errno, id, no_srfs); rm_errno = RM_ERR_SYSTEM; return NULL; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/unicosmk2/Makefile.am0000664000113300011330000000032111272401244016064 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c wait_job.c torque-2.4.16/src/resmom/catch_child.c0000664000113300011330000014327111527304735014535 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "dis.h" #include "libpbs.h" #include "portability.h" #include #include #include #include #include #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "credential.h" #include "batch_request.h" #include "net_connect.h" #include "svrfunc.h" #include "mom_mach.h" #include "mom_func.h" #include "pbs_error.h" #include "pbs_proto.h" #include "rpp.h" #ifdef ENABLE_CPA #include "pbs_cpa.h" #endif #ifdef PENABLE_LINUX26_CPUSETS #include "pbs_cpuset.h" #endif /* External Functions */ /* External Globals */ extern char *path_epilog; extern char *path_epiloguser; extern char *path_epilogp; extern char *path_epiloguserp; extern char *path_jobs; extern unsigned int default_server_port; extern tlist_head svr_alljobs, mom_polljobs; extern int exiting_tasks; extern char *msg_daemonname; extern int termin_child; extern struct connection svr_conn[]; extern int resc_access_perm; extern char *path_aux; extern int LOGLEVEL; extern char *PJobSubState[]; extern char mom_host[]; extern int PBSNodeCheckProlog; extern int PBSNodeCheckEpilog; /* external prototypes */ u_long resc_used(job *, char *, u_long(*f) A_((resource *))); static void preobit_reply A_((int)); static void obit_reply A_((int)); extern int tm_reply A_((int, int, tm_event_t)); extern u_long addclient A_((char *)); extern void encode_used A_((job *, tlist_head *)); extern void encode_flagged_attrs A_((job *, tlist_head *)); extern void job_nodes A_((job *)); extern int task_recov A_((job *)); extern void mom_server_all_update_stat(void); extern void check_state(int); extern int mom_open_socket_to_jobs_server A_((job *, char *, void (*) A_((int)))); extern int mark_for_resend A_((job *)); extern void checkpoint_partial(job *pjob); extern void mom_checkpoint_recover(job *pjob); extern void clear_down_mom_servers(); extern int is_mom_server_down(pbs_net_t); extern void set_mom_server_down(pbs_net_t); extern int no_mom_servers_down(); extern char *get_local_script_path(job *pjob, char *base); /* END external prototypes */ /* * catch_child() - the signal handler for SIGCHLD. * * To keep the signal handler simple for * SIGCHLD - just indicate there was one. */ void catch_child( int sig) { termin_child = 1; return; } /* END catch_child() */ hnodent *get_node( job *pjob, tm_node_id nodeid) { int i; vnodent *vp = pjob->ji_vnods; for (i = 0;i < pjob->ji_numvnod;i++, vp++) { if (vp->vn_node == nodeid) { return(vp->vn_host); } } return(NULL); } /* END get_node() */ /** * For all jobs in MOM * ignore job if job's pbs_server is down * for all tasks in job * ignore task if task state is not exiting * if task is master, send kill to all sisters * process TM client obits * if I am sister, do sister stuff and continue * kill_job * contact server and register preobit_reply() * set job substate to JOB_SUBSTATE_PREOBIT * * @see main_loop() - parent * @see scan_for_terminated() * @see post_epilog() * @see preobit_reply() - registered to handle response to preobit * @see send_sisters() - child * @see kill_job() - child * * Obit Overview: * - main_loop() * - scan_for_terminated() * uses waitpid() to detect completed children * First Pass: catches SIGCHLD of job executable to identify when job * tasks terminate, issues kill_task(), and marks job task ti_status * as TI_STATE_EXITED which is detected and processed inside of * scan_for_exiting() * Second Pass: catches SIGCHLD for job epilog child and exec's * job's ji_mompost (post_epilog) * * - scan_for_exiting() * called after scan_for_terminated and looks at jobs to identify which * have exiting tasks. Sends kill to all sisters via send_sisters(), * sets job substate to JOB_SUBSTATE_EXITING, issues kill_job, and * then sets job substate to JOB_SUBSTATE_PREOBIT. This routine then * creates the preobit message and sends it to pbs_server. * registers preobit_reply() as socket handler * * - preobit_reply() * o validates server response to preobit message * If the server returns unknown job id (it may have been purged), * then the job is deleted from the mom: mom_deljob -> job_purge, * and that should be it for the job. Otherwise, we fork: * - fork_me() * o parent registers post_epilog in job ji_mompost attribute, sets job * substate to JOB_SUBSTATE_OBIT, and registers post_epilogue handler. * This handler will be invoked when the waitpid in scan_for_terminated * catches a SIGCHLD for the job epilog invoked by the child. * o child runs run_pelog() * * - post_epilog() * sends obit to pbs_server and registers obit_reply() as connection handler * * - obit_reply() * sets job substate to EXITED * END OF JOB LIFECYCLE * * when job completes and process id goes away scan_for_terminated() * * OVERALL FLOW: * - scan_for_terminating() - PHASE I * - KILL TASK * - scan_for_exiting() * - KILL SISTERS * - SEND PREOBIT TO PBS_SERVER * - preobit_reply() - FORK AND EXEC EPILOG * - scan_for_terminating() - PHASE II * - post_epilog() * - SEND OBIT TO PBS_SERVER * - obit_reply() * * STATE TRANSITIONS: * JOB_SUBSTATE_RUNNING (42) * JOB_SUBSTATE_EXITING (50) - scan_for_exiting() * JOB_SUBSTATE_PREOBIT (57) - scan_for_exiting() * JOB_SUBSTATE_OBIT (58) - preobit_reply() */ void scan_for_exiting(void) { char *id = "scan_for_exiting"; int found_one = 0; job *nxjob; job *pjob; task *ptask; obitent *pobit; int sock; char *cookie; u_long gettime A_((resource *)); u_long getsize A_((resource *)); task *task_find A_((job *, tm_task_id)); int im_compose A_((int, char *, char *, int, tm_event_t, tm_task_id)); static int ForceObit = -1; /* boolean - if TRUE, ObitsAllowed will be enforced */ static int ObitsAllowed = 1; int NumSisters; /* ** Look through the jobs. Each one has it's tasks examined ** and if the job is EXITING, it meets it's fate depending ** on whether this is the Mother Superior or not. */ if (LOGLEVEL >= 3) { log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, "searching for exiting jobs"); } if (ForceObit == -1) { /* NOTE: Allow sites to locally specify obit groupings larger than 1. */ /* Remove after 6/1/2008 if no further obit issues are encountered */ char *ptr; if ((ptr = getenv("TORQUEFORCESEND")) != NULL) { int tmpI; tmpI = (int)strtol(ptr, NULL, 10); if (tmpI > 0) ObitsAllowed = tmpI; ForceObit = 1; } else { ForceObit = 1; } } /* END if (ForceObit == -1) */ clear_down_mom_servers(); for (pjob = (job *)GET_NEXT(svr_alljobs);pjob != NULL;pjob = nxjob) { nxjob = (job *)GET_NEXT(pjob->ji_alljobs); /* * Bypass job if it is for a server that we know is down */ if (is_mom_server_down(pjob->ji_qs.ji_un.ji_momt.ji_svraddr)) { if (LOGLEVEL >= 3) { snprintf(log_buffer, 1024, "not checking job %s - server is down", pjob->ji_qs.ji_jobid); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, log_buffer); } continue; } /* ** If a checkpoint with aborts is active, ** skip it. We don't want to report any obits ** until we know that the whole thing worked. */ if (pjob->ji_flags & MOM_CHECKPOINT_ACTIVE) { continue; } /* ** If the job has had an error doing a checkpoint with ** abort, the MOM_CHECKPOINT_POST flag will be on. */ if (pjob->ji_flags & MOM_CHECKPOINT_POST) { checkpoint_partial(pjob); continue; } if (!(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_flags & ATR_VFLAG_SET)) { continue; } cookie = pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str; /* ** Check each EXITED task. They transition to DEAD here. */ for ( ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_status != TI_STATE_EXITED) continue; /* ** Check if it is the top shell. */ if (ptask->ti_qs.ti_parenttask == TM_NULL_TASK) { /* master task is in state TI_STATE_EXITED */ pjob->ji_qs.ji_un.ji_momt.ji_exitstat = ptask->ti_qs.ti_exitstat; LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "job was terminated"); NumSisters = send_sisters(pjob, IM_KILL_JOB); if (NumSisters == 0) { /* no sisters contacted - should be a serial job */ if (LOGLEVEL >= 3) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "no sisters contacted - setting job substate to EXITING"); } pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; job_save(pjob, SAVEJOB_QUICK); } else if (LOGLEVEL >= 3) { snprintf(log_buffer, 1024, "master task has exited - sent kill job request to %d sisters", NumSisters); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } /* END if (ptask->ti_qs.ti_parenttask == TM_NULL_TASK) */ /* ** process any TM client obits waiting. */ pobit = (obitent *)GET_NEXT(ptask->ti_obits); while (pobit != NULL) { hnodent *pnode; pnode = get_node(pjob, pobit->oe_info.fe_node); /* see if this is me or another MOM */ if (pjob->ji_nodeid == pnode->hn_node) { task *tp; /* send event to local child */ tp = task_find(pjob, pobit->oe_info.fe_taskid); assert(tp != NULL); if (tp->ti_fd != -1) { tm_reply(tp->ti_fd, IM_ALL_OKAY, pobit->oe_info.fe_event); diswsi(tp->ti_fd, ptask->ti_qs.ti_exitstat); DIS_tcp_wflush(tp->ti_fd); } } else if (pnode->hn_stream != -1) { /* ** Send a response over to MOM ** whose child sent the request. */ im_compose( pnode->hn_stream, pjob->ji_qs.ji_jobid, cookie, IM_ALL_OKAY, pobit->oe_info.fe_event, pobit->oe_info.fe_taskid); diswsi(pnode->hn_stream, ptask->ti_qs.ti_exitstat); rpp_flush(pnode->hn_stream); } delete_link(&pobit->oe_next); free(pobit); pobit = (obitent *)GET_NEXT(ptask->ti_obits); } /* END while (pobit) */ ptask->ti_fd = -1; ptask->ti_qs.ti_status = TI_STATE_DEAD; if (LOGLEVEL >= 3) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "task is dead"); } task_save(ptask); } /* END for (ptask) */ /* ** Look to see if the job has terminated. If it is ** in any state other than EXITING continue on. */ if ((pjob->ji_qs.ji_substate != JOB_SUBSTATE_EXITING) && (pjob->ji_qs.ji_substate != JOB_SUBSTATE_NOTERM_REQUE)) { if (LOGLEVEL >= 3) { snprintf(log_buffer, 1024, "job is in non-exiting substate %s, no obit sent at this time", PJobSubState[pjob->ji_qs.ji_substate]); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } continue; } /* ** Look to see if I am a regular sister. If so, ** check to see if there is an obit event to ** send back to mother superior. ** Otherwise, I need to wait for her to send a KILL_JOB ** so I can send the obit (unless she died). */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { int stream; stream = (pjob->ji_hosts == NULL) ? -1 : pjob->ji_hosts[0].hn_stream; /* ** Check to see if I'm still in touch with ** the mother superior. If not, I'm just going to ** get rid of this job. */ if (stream == -1) { if (LOGLEVEL >= 3) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "connection to server lost - no obit sent - job will be purged"); } if(pjob->ji_qs.ji_substate != JOB_SUBSTATE_NOTERM_REQUE) { kill_job(pjob, SIGKILL, id, "connection to server lost - no obit sent"); } job_purge(pjob); continue; } /* ** No event waiting for sending info to MS ** so I'll just sit tight. */ if (pjob->ji_obit == TM_NULL_EVENT) { if (LOGLEVEL >= 3) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "obit method not specified for job - no obit sent"); } continue; } /* ** Check to see if any tasks are running. */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask != NULL) { if (ptask->ti_qs.ti_status == TI_STATE_RUNNING) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } /* Still somebody there so don't send it yet. */ if (ptask != NULL) { if (LOGLEVEL >= 3) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "one or more running tasks found - no obit sent"); } continue; } if ((pjob->ji_wattr[(int)JOB_ATR_interactive].at_flags & ATR_VFLAG_SET) && pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long) { if (run_pelog(PE_EPILOGUSER, path_epiloguserp, pjob, PE_IO_TYPE_NULL) != 0) { log_err(-1, id, "user parallel epilog failed"); } if (run_pelog(PE_EPILOG, path_epilogp, pjob, PE_IO_TYPE_NULL) != 0) { log_err(-1, id, "parallel epilog failed"); } } else { if (run_pelog(PE_EPILOGUSER, path_epiloguserp, pjob, PE_IO_TYPE_STD) != 0) { log_err(-1, id, "parallel user epilog failed"); } if (run_pelog(PE_EPILOG, path_epilogp, pjob, PE_IO_TYPE_STD) != 0) { log_err(-1, id, "parallel epilog failed"); } } /* ** No tasks running ... format and send a ** reply to the mother superior and get rid of ** the job. */ im_compose( stream, pjob->ji_qs.ji_jobid, cookie, IM_ALL_OKAY, pjob->ji_obit, TM_NULL_TASK); diswul(stream, resc_used(pjob, "cput", gettime)); diswul(stream, resc_used(pjob, "mem", getsize)); diswul(stream, resc_used(pjob, "vmem", getsize)); rpp_flush(stream); if (LOGLEVEL >= 6) { LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "all tasks complete - purging job as sister"); } DBPRT(("all tasks complete - purging job as sister (%s)\n", pjob->ji_qs.ji_jobid)); job_purge(pjob); continue; } /* END if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) */ /* * At this point, we know we are Mother Superior for this * job which is EXITING. Time for it to die. */ pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_Suspend; if(pjob->ji_qs.ji_substate != JOB_SUBSTATE_NOTERM_REQUE) kill_job(pjob, SIGKILL, id, "local task termination detected"); else { ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask != NULL) { if (ptask->ti_qs.ti_status == TI_STATE_RUNNING) { if (LOGLEVEL >= 4) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "kill_job found a task to kill"); } if (pjob->ji_qs.ji_un.ji_momt.ji_exitstat != 0) ptask->ti_qs.ti_exitstat = pjob->ji_qs.ji_un.ji_momt.ji_exitstat; else ptask->ti_qs.ti_exitstat = 0; /* assume successful completion */ ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); } ptask = (task *)GET_NEXT(ptask->ti_jobtask); } /* END while (ptask != NULL) */ } #ifdef ENABLE_CPA if (CPADestroyPartition(pjob) != 0) continue; #endif delete_link(&pjob->ji_jobque); /* unlink for poll list */ /* * + Open connection to the Server (for the Job Obituary) * + Set the connection to call obit_reply when the reply * arrives. * + fork child process, parent looks for more terminated jobs. * Child: * + Run the epilogue script (if one) * + Send the Job Obit Request (notice). */ sock = mom_open_socket_to_jobs_server(pjob, id, preobit_reply); if (sock < 0) { if ((errno == EINPROGRESS) || (errno == ETIMEDOUT) || (errno == EINTR)) { sprintf(log_buffer, "connect to server unsuccessful after 5 seconds - will retry"); } /* * continue through the jobs loop since we can have jobs for multiple * servers. Keep track that this server is down so we don't try to * process any more jobs for it. We will leave it's exiting_tasks set * so Mom will retry Obit when server is available */ set_mom_server_down(pjob->ji_qs.ji_un.ji_momt.ji_svraddr); continue; } /* END if (sock < 0) */ if (LOGLEVEL >= 2) { log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "sending preobit jobstat"); } pjob->ji_qs.ji_substate = JOB_SUBSTATE_PREOBIT; #ifdef TREMOVEME if (ForceObit == 0) { if (found_one++ >= ObitsAllowed) { /* do not exceed max obits per iteration limit */ break; } } #endif /* TREMOVEME */ /* send the pre-obit job stat request */ DIS_tcp_setup(sock); if (encode_DIS_ReqHdr(sock, PBS_BATCH_StatusJob, pbs_current_user) || encode_DIS_Status(sock, pjob->ji_qs.ji_jobid, NULL) || encode_DIS_ReqExtend(sock, NULL)) { /* FAILURE */ log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "failed creating preobit message"); return; } DIS_tcp_wflush(sock); if (found_one++ >= ObitsAllowed) { /* do not exceed max obits per iteration limit */ break; } } /* END for (pjob) */ if ((pjob == NULL) && (no_mom_servers_down())) { /* search finished */ exiting_tasks = 0; /* went through all jobs */ } return; } /* END scan_for_exiting() */ /** * Send obit to server. * * @see scan_for_terminated() - calls post_epilog() via ji_mompost job attribute * @see mom_open_socket_to_jobs_server() - child * @see obit_reply() - registered handler for obit connection * * @see scan_for_exiting() for Obit overview */ int post_epilogue( job *pjob, /* I */ int ev) /* I exit value (only used to determine if retrying obit) */ { char id[] = "post_epilogue"; int sock; struct batch_request *preq; if (LOGLEVEL >= 2) { sprintf(log_buffer, "preparing obit message for job %s", pjob->ji_qs.ji_jobid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_REQUEST, id, log_buffer); } /* open new connection - register obit_reply as handler */ sock = mom_open_socket_to_jobs_server(pjob, id, obit_reply); if (sock < 0) { /* FAILURE */ if ((errno == EINTR) || (errno == ETIMEDOUT) || (errno == EINPROGRESS)) { /* transient failure - server/network up but busy... retry */ int retrycount; for (retrycount = 0;retrycount < 2;retrycount++) { sock = mom_open_socket_to_jobs_server(pjob, id, obit_reply); if (sock >= 0) break; } /* END for (retrycount) */ } if (sock < 0) { /* We are trying to send obit, but failed - where is this retried? * Answer: In the main_loop examine_all_jobs_to_resend() tries * every so often to send the obit. This would work for recovered * jobs also. */ if (ev != MOM_OBIT_RETRY) { mark_for_resend(pjob); } return(1); } } /* send the job obiturary notice to the server */ preq = alloc_br(PBS_BATCH_JobObit); if (preq == NULL) { /* FAILURE */ sprintf(log_buffer, "cannot allocate memory for obit message"); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_REQUEST, id, log_buffer); return(1); } strcpy(preq->rq_ind.rq_jobobit.rq_jid, pjob->ji_qs.ji_jobid); preq->rq_ind.rq_jobobit.rq_status = pjob->ji_qs.ji_un.ji_momt.ji_exitstat; CLEAR_HEAD(preq->rq_ind.rq_jobobit.rq_attr); resc_access_perm = ATR_DFLAG_RDACC; encode_used(pjob, &preq->rq_ind.rq_jobobit.rq_attr); encode_flagged_attrs(pjob, &preq->rq_ind.rq_jobobit.rq_attr); DIS_tcp_setup(sock); if (encode_DIS_ReqHdr(sock, PBS_BATCH_JobObit, pbs_current_user) || encode_DIS_JobObit(sock, preq) || encode_DIS_ReqExtend(sock, 0)) { /* FAILURE */ sprintf(log_buffer, "cannot create obit message for job %s", pjob->ji_qs.ji_jobid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_REQUEST, id, log_buffer); close(sock); free_br(preq); return(1); } DIS_tcp_wflush(sock); /* does flush close sock? */ free_br(preq); /* SUCCESS */ /* Who closes sock and unsets pjob->ji_momhandle? * Answer: This gets done in the message reply handler, obit_reply. */ log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "obit sent to server"); return(0); } /* END post_epilog() */ /** * preobit_reply * * @see scan_for_exiting() - registers this routine as handler * @see mom_deljob() - child * @see run_pelog() - child * * This function is a message handler that is hooked to a server connection. * The connection is established in scan_for_exiting() where all jobs * are examined. A socket connection to the server is opened, an obit * message is sent to the server, and then at some later time, the server * sends back a reply and we end up here. * * What is the correct response if an EOF is detected? */ static void preobit_reply( int sock) /* I */ { char id[] = "preobit_reply"; pid_t cpid; job *pjob; int irtn; struct batch_request *preq; struct brp_status *pstatus; svrattrl *sattrl; int runepilogue = 0; int deletejob = 0; int jobiscorrupt = 0; char *path_epiloguserjob; resource *presc; /* struct batch_status *bsp = NULL; */ log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, "top of preobit_reply"); /* read and decode the reply */ preq = alloc_br(PBS_BATCH_StatusJob); CLEAR_HEAD(preq->rq_ind.rq_status.rq_attr); while ((irtn = DIS_reply_read(sock, &preq->rq_reply)) && (errno == EINTR)); if (irtn != 0) { sprintf(log_buffer, "DIS_reply_read/decode_DIS_replySvr failed, rc=%d sock=%d", irtn, sock); /* NOTE: irtn=11 indicates EOF */ /* NOTE: errno not set, thus log_err say success in spite of failure */ log_err(errno, id, log_buffer); preq->rq_reply.brp_code = -1; } else { log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, "DIS_reply_read/decode_DIS_replySvr worked, top of while loop"); } /* find the job that triggered this req */ pjob = (job *)GET_NEXT(svr_alljobs); while (pjob != NULL) { if ((pjob->ji_qs.ji_substate == JOB_SUBSTATE_PREOBIT) && (pjob->ji_momhandle == sock)) { /* located job that triggered req from server */ break; } pjob = (job *)GET_NEXT(pjob->ji_alljobs); } /* END while (pjob != NULL) */ if (pjob == NULL) { /* FAILURE - cannot locate job that triggered req */ log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, "cannot locate job that triggered req"); free_br(preq); shutdown(sock, SHUT_RDWR); close_conn(sock); return; } /* END if (pjob != NULL) */ /* we've got a job in PREOBIT and matches the socket, now inspect the results of the job stat */ switch (preq->rq_reply.brp_code) { case PBSE_CLEANEDOUT: case PBSE_UNKJOBID: /* this is the simple case of the job being purged from the server */ sprintf(log_buffer, "preobit_reply, unknown on server, deleting locally"); deletejob = 1; break; /* not reached */ case PBSE_NONE: log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, "in while loop, no error from job stat"); if (preq->rq_reply.brp_choice == BATCH_REPLY_CHOICE_Status) { pstatus = (struct brp_status *)GET_NEXT(preq->rq_reply.brp_un.brp_status); } else { sprintf(log_buffer, "BUG: preq->rq_reply.brp_choice==%d", preq->rq_reply.brp_choice); break; } if (pstatus == NULL) { sprintf(log_buffer, "BUG: pstatus==NULL"); break; } if (strcmp(pstatus->brp_objname, pjob->ji_qs.ji_jobid)) { sprintf(log_buffer, "BUG: mismatched jobid in preobit_reply (%s != %s)", pstatus->brp_objname, pjob->ji_qs.ji_jobid); break; } /* determine if job has exechost set - if set, and task 0 host is X ... */ sattrl = (svrattrl *)GET_NEXT(pstatus->brp_attr); jobiscorrupt = 1; while (sattrl != NULL) { if (!strcmp(sattrl->al_name, ATTR_exechost)) { jobiscorrupt = 0; if (strncmp( sattrl->al_value, pjob->ji_hosts[0].hn_host, strlen(pjob->ji_hosts[0].hn_host))) { /* the job was re-run elsewhere */ sprintf(log_buffer, "first host DOES NOT match me: %s != %s", sattrl->al_value, pjob->ji_hosts[0].hn_host); deletejob = 1; } else { /* job was run locally */ runepilogue = 1; } break; } sattrl = (svrattrl *)GET_NEXT(sattrl->al_link); } /* END while (sattrl != NULL) */ if (jobiscorrupt == 1) { /* runepilogue = 1; */ } break; case - 1: sprintf(log_buffer, "EOF? received attempting to process obit reply"); break; default: /* not sure what happened */ sprintf(log_buffer, "something bad happened: %d", preq->rq_reply.brp_code); break; } /* END switch (preq->rq_reply.brp_code) */ /* we've inspected the server's response and can now act */ free_br(preq); shutdown(sock, SHUT_RDWR); close_conn(sock); if (deletejob == 1) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); if (!(pjob->ji_wattr[(int)JOB_ATR_interactive].at_flags & ATR_VFLAG_SET) || (pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long == 0)) { int x; /* dummy */ /* do this if not interactive */ job_unlink_file(pjob, std_file_name(pjob, StdOut, &x)); job_unlink_file(pjob, std_file_name(pjob, StdErr, &x)); job_unlink_file(pjob, std_file_name(pjob, Checkpoint, &x)); } mom_deljob(pjob); return; } if (!runepilogue) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; pjob->ji_momhandle = -1; exiting_tasks = 1; /* job exit will be picked up again */ return; } /* at this point, server gave us a valid response so we can run epilogue */ if (LOGLEVEL >= 2) { log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "performing job clean-up in preobit_reply()"); } cpid = fork_me(-1); if (cpid < 0) { /* FAILURE */ log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "fork failed in preobit_reply"); return; } if (cpid > 0) { /* parent - mark that job epilog subtask has been launched */ /* NOTE: pjob->ji_mompost will be executed in scan_for_terminated() */ pjob->ji_qs.ji_substate = JOB_SUBSTATE_OBIT; pjob->ji_momsubt = cpid; pjob->ji_mompost = post_epilogue; pjob->ji_momhandle = -1; if (LOGLEVEL >= 2) { snprintf(log_buffer, 1024, "epilog subtask created with pid %d - substate set to JOB_SUBSTATE_OBIT - registered post_epilogue", (int)cpid); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } return; } /* child */ /* check epilog script */ if ((pjob->ji_wattr[(int)JOB_ATR_interactive].at_flags & ATR_VFLAG_SET) && pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long) { /* job is interactive */ presc = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], find_resc_def(svr_resc_def, "epilogue", svr_resc_size)); if((presc != NULL)) if((presc->rs_value.at_flags & ATR_VFLAG_SET) && (presc->rs_value.at_val.at_str != NULL)) { path_epiloguserjob = get_local_script_path(pjob, presc->rs_value.at_val.at_str); if(path_epiloguserjob) { if (run_pelog(PE_EPILOGUSERJOB, path_epiloguserjob, pjob, PE_IO_TYPE_NULL) != 0) { log_err(-1, id, "user local epilog failed"); } free(path_epiloguserjob); } } if (run_pelog(PE_EPILOGUSER, path_epiloguser, pjob, PE_IO_TYPE_NULL) != 0) { log_err(-1, id, "user epilog failed - interactive job"); } if (run_pelog(PE_EPILOG, path_epilog, pjob, PE_IO_TYPE_NULL) != 0) { log_err(-1, id, "system epilog failed - interactive job"); } } else { /* job is not interactive */ int rc; presc = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], find_resc_def(svr_resc_def, "epilogue", svr_resc_size)); if((presc != NULL)) if((presc->rs_value.at_flags & ATR_VFLAG_SET) && (presc->rs_value.at_val.at_str != NULL)) { path_epiloguserjob = get_local_script_path(pjob, presc->rs_value.at_val.at_str); if(path_epiloguserjob) { if (run_pelog(PE_EPILOGUSERJOB, path_epiloguserjob, pjob, PE_IO_TYPE_STD) != 0) { log_err(-1, id, "user local epilog failed"); } free(path_epiloguserjob); } } if (run_pelog(PE_EPILOGUSER, path_epiloguser, pjob, PE_IO_TYPE_STD) != 0) { log_err(-1, id, "user epilog failed"); } if ((rc = run_pelog(PE_EPILOG, path_epilog, pjob, PE_IO_TYPE_STD)) != 0) { sprintf(log_buffer, "system epilog failed w/rc=%d", rc); log_err(-1, id, log_buffer); } } /* END else (jobisinteractive) */ exit(0); } /* END preobit_reply() */ /* * obit_reply * * This function is a message handler that is hooked to a server connection. * The connection is established in post_epilogue(). * * A socket connection to the server is opened, a job obiturary notice * message is sent to the server, and then at some later time, the server * sends back a reply and we end up here. * * On success, this routine sets the job's substate to EXITED * * @see post_epilogue() - registers obit_reply via add_conn() */ static void obit_reply( int sock) /* I */ { int irtn; job *nxjob; job *pjob; attribute *pattr; struct batch_request *preq; int x; /* dummy */ /* read and decode the reply */ preq = alloc_br(PBS_BATCH_JobObit); CLEAR_HEAD(preq->rq_ind.rq_jobobit.rq_attr); while ((irtn = DIS_reply_read(sock, &preq->rq_reply)) && (errno == EINTR)); if (irtn != 0) { /* NOTE: irtn is of type DIS_* in include/dis.h, see dis_emsg[] */ sprintf(log_buffer, "DIS_reply_read failed, rc=%d sock=%d", irtn, sock); log_err(errno, "obit_reply", log_buffer); preq->rq_reply.brp_code = -1; } /* find the job associated with the reply by the socket number */ /* saved in the job structure, ji_momhandle */ pjob = (job *)GET_NEXT(svr_alljobs); while (pjob != NULL) { nxjob = (job *)GET_NEXT(pjob->ji_alljobs); if ((pjob->ji_qs.ji_substate == JOB_SUBSTATE_OBIT) && (pjob->ji_momhandle == sock)) { /* Clear out destination so we know job is not on mom any more */ pjob->ji_qs.ji_destin[0] = '\0'; switch (preq->rq_reply.brp_code) { case PBSE_NONE: /* normal ack, mark job as exited */ pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITED; job_save(pjob, SAVEJOB_QUICK); if (LOGLEVEL >= 4) { LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "job obit acknowledge received - substate set to JOB_SUBSTATE_EXITED"); } break; case PBSE_ALRDYEXIT: /* have already told the server before recovery */ /* the server will contact us to continue */ if (LOGLEVEL >= 7) { log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "setting already exited job substate to EXITED"); } pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITED; job_save(pjob, SAVEJOB_QUICK); break; case PBSE_CLEANEDOUT: /* all jobs discarded by server, discard job */ pattr = &pjob->ji_wattr[(int)JOB_ATR_interactive]; if (((pattr->at_flags & ATR_VFLAG_SET) == 0) || (pattr->at_val.at_long == 0)) { /* do this if not interactive */ job_unlink_file(pjob, std_file_name(pjob, StdOut, &x)); job_unlink_file(pjob, std_file_name(pjob, StdErr, &x)); job_unlink_file(pjob, std_file_name(pjob, Checkpoint, &x)); } mom_deljob(pjob); break; case - 1: /* FIXME - causes epilogue to be run twice! */ pjob->ji_qs.ji_substate = JOB_SUBSTATE_EXITING; exiting_tasks = 1; break; default: { char tmpLine[1024]; switch (preq->rq_reply.brp_code) { case PBSE_BADSTATE: sprintf(tmpLine, "server rejected job obit - unexpected job state"); break; case PBSE_SYSTEM: sprintf(tmpLine, "server rejected job obit - server not ready for job completion"); break; default: sprintf(tmpLine, "server rejected job obit - %d", preq->rq_reply.brp_code); break; } /* END switch (preq->rq_reply.brp_code) */ log_ext(-1,"obit_reply",tmpLine,LOG_ALERT); LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, tmpLine); } /* END BLOCK */ mom_deljob(pjob); break; } /* END switch (preq->rq_reply.brp_code) */ break; } /* END if (...) */ pjob = nxjob; } /* END while (pjob != NULL) */ if (pjob == NULL) { LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_REQUEST, "obit reply", "Job not found for obit reply"); } free_br(preq); shutdown(sock, 2); close_conn(sock); if (PBSNodeCheckEpilog) { check_state(1); mom_server_all_update_stat(); } return; } /* END obit_reply() */ /* * init_abort_jobs - on mom initialization, recover all running jobs. * * Called on initialization * If the -p option was given (default) (recover = JOB_RECOV_RUNNING), Mom will allow the jobs * to continue to run. She depends on detecting when they terminate * via the slow poll method rather than SIGCHLD. * * If the -r option was given (recover = JOB_RECOV_TERM_REQUE), MOM is * recovering on a running system and the session id of the jobs should be valid; * the job processes are killed and the job is re-queued * * If -q was given (recover = JOB_RECOV_RQUE), it is assumed that the whole * system, not just MOM, is coming up, the session ids are not valid; * so no attempt is made to kill the job processes. But the jobs are * terminated and requeued. * * If the -P option was given (recover == JOB_RECOV_DELETE), no attempt is * made to recover the jobs. The jobs are deleted from the queue. */ void init_abort_jobs( int recover) /* I (boolean) */ { char *id = "init_abort_jobs"; DIR *dir; int i; int j; int sisters, rc; struct dirent *pdirent; job *pj; char *job_suffix = JOB_FILE_SUFFIX; int job_suf_len = strlen(job_suffix); char *psuffix; if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: recover=%d", id, recover); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); } dir = opendir(path_jobs); if (dir == NULL) { sprintf(log_buffer, "cannot open job directory '%s'", path_jobs); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); exit(1); } while ((pdirent = readdir(dir)) != NULL) { if ((i = strlen(pdirent->d_name)) <= job_suf_len) continue; psuffix = pdirent->d_name + i - job_suf_len; if (strcmp(psuffix, job_suffix)) continue; pj = job_recov(pdirent->d_name); if (pj == NULL) { sprintf(log_buffer, "%s: NULL job pointer", id); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); continue; } /* PW: mpiexec patch - set the globid so mom does not coredump in response to tm_spawn */ set_globid(pj, NULL); append_link(&svr_alljobs, &pj->ji_alljobs, pj); job_nodes(pj); rc = task_recov(pj); if (LOGLEVEL >= 2) { sprintf(log_buffer, "task recovery %s for job %s, rc=%d", (rc == 0) ? "succeeded" : "failed", pj->ji_qs.ji_jobid, rc); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, id, log_buffer); } mom_checkpoint_recover(pj); /* * make sure we trust connections from sisters in case we get an * IM request before we get the real addr list from server. * Note: this only works after the job_nodes() call above. */ for (j = 0;j < pj->ji_numnodes;j++) { if (LOGLEVEL >= 6) { sprintf(log_buffer, "%s: adding client %s", id, pj->ji_hosts[j].hn_host); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); } addclient(pj->ji_hosts[j].hn_host); } /* END for (j) */ if (LOGLEVEL >= 4) { sprintf(log_buffer, "successfully recovered job %s", pj->ji_qs.ji_jobid); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, id, log_buffer); } if ((recover != JOB_RECOV_RUNNING) && (recover != JOB_RECOV_DELETE) && ((pj->ji_qs.ji_substate == JOB_SUBSTATE_RUNNING) || (pj->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) || (pj->ji_qs.ji_substate == JOB_SUBSTATE_SUSPEND) || (pj->ji_qs.ji_substate == JOB_SUBSTATE_EXITED) || (pj->ji_qs.ji_substate == JOB_SUBSTATE_NOTERM_REQUE) || (pj->ji_qs.ji_substate == JOB_SUBSTATE_EXITING))) { if (LOGLEVEL >= 2) { sprintf(log_buffer, "job %s recovered in active state %s (full recover not enabled)", pj->ji_qs.ji_jobid, PJobSubState[pj->ji_qs.ji_substate]); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, id, log_buffer); } if (recover == JOB_RECOV_TERM_REQUE) /* -r option was used to start mom */ { kill_job(pj, SIGKILL, id, "recover is non-zero"); } /* ** Check to see if I am Mother Superior. The ** JOB_SVFLG_HERE flag is overloaded for MOM ** for this purpose. ** If I'm an ordinary sister, just throw the job ** away. If I am MS, send a KILL_JOB request to ** any sisters that happen to still be alive. */ if ((pj->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) { if (LOGLEVEL >= 2) { sprintf(log_buffer, "local host is not mother-superior, deleting job %s", pj->ji_qs.ji_jobid); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, id, log_buffer); } mom_deljob(pj); continue; } if (LOGLEVEL >= 2) { sprintf(log_buffer, "setting job state to exiting for job %s in state %s", pj->ji_qs.ji_jobid, PJobSubState[pj->ji_qs.ji_substate]); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, id, log_buffer); } /* set exit status to: * JOB_EXEC_INITABT - init abort and no checkpoint * JOB_EXEC_INITRST - init and checkpoint, no mig * JOB_EXEC_INITRMG - init and checkpoint, migrate * to indicate recovery abort */ if (pj->ji_qs.ji_svrflags & (JOB_SVFLG_CHECKPOINT_FILE | JOB_SVFLG_CHECKPOINT_MIGRATEABLE)) { #if PBS_CHKPT_MIGRATE pj->ji_qs.ji_un.ji_momt.ji_exitstat = JOB_EXEC_INITRMG; #else pj->ji_qs.ji_un.ji_momt.ji_exitstat = JOB_EXEC_INITRST; #endif } else { pj->ji_qs.ji_un.ji_momt.ji_exitstat = JOB_EXEC_INITABT; } sisters = pj->ji_numnodes - 1; /* ** A sisterhood exists... send a KILL request. */ if (sisters > 0) { DBPRT(("init_abort_jobs: Sending to sisters\n")) pj->ji_resources = (noderes *)calloc(sisters, sizeof(noderes)); send_sisters(pj, IM_KILL_JOB); continue; } /* If mom was initialized with a -r any running processes have already been killed. We set substate to JOB_SUBSTATE_NOTERM_REQUE so scan_for_exiting will not try to kill the running processes for this job */ pj->ji_qs.ji_substate = JOB_SUBSTATE_NOTERM_REQUE; job_save(pj, SAVEJOB_QUICK); exiting_tasks = 1; } /* END if ((recover != 2) && ...) */ else if (recover == JOB_RECOV_RUNNING || recover == JOB_RECOV_DELETE) { /* * add: 8/11/03 David.Singleton@anu.edu.au * * Lots of job structure components need to be * initialized if we are leaving this job * running, this is just a few. * Modified to accomodate JOB_RECOV_DELETE option * 01/13/2009 Ken Nielson knielson@adaptivecomputing.com */ if (LOGLEVEL >= 2 && recover == JOB_RECOV_RUNNING) { sprintf(log_buffer, "attempting to recover job %s in state %s", pj->ji_qs.ji_jobid, PJobSubState[pj->ji_qs.ji_substate]); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, id, log_buffer); } sisters = pj->ji_numnodes - 1; if (sisters > 0) pj->ji_resources = (noderes *)calloc(sisters, sizeof(noderes)); if (mom_do_poll(pj) && (recover == JOB_RECOV_RUNNING)) append_link(&mom_polljobs, &pj->ji_jobque, pj); if (pj->ji_grpcache == NULL) { DBPRT(("init_abort_jobs: setting grpcache for job %s\n", pj->ji_qs.ji_jobid)); check_pwd(pj); } } } /* while ((pdirent = readdir(dir)) != NULL) */ closedir(dir); #if defined(PENABLE_LINUX26_CPUSETS) /* Create the top level torque cpuset if it doesn't already exist. */ initialize_root_cpuset(); #endif return; } /* END init_abort_jobs() */ /* * mom_deljob - delete the job entry, MOM no longer knows about the job */ void mom_deljob( job *pjob) /* I (modified) */ { #ifdef _CRAY /* remove any temporary directories */ rmtmpdir(pjob->ji_qs.ji_jobid); #endif /* _CRAY */ if (LOGLEVEL >= 3) { sprintf(log_buffer, "deleting job %s in state %s", pjob->ji_qs.ji_jobid, PJobSubState[pjob->ji_qs.ji_substate]); log_record( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } job_purge(pjob); return; } /* END mom_deljob() */ /* END catch_child() */ torque-2.4.16/src/resmom/fujitsu/0000777000113300011330000000000011614035172013700 500000000000000torque-2.4.16/src/resmom/fujitsu/mom_start.c0000664000113300011330000002477511272401243016002 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include #include #include #include #include #include #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; /* Private variables */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for a task whose * session id matched that of a terminated child pid. Mark that * task as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "IOT", SIGIOT }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "WINCH", SIGWINCH }, { "URG", SIGURG }, { "POLL", SIGPOLL }, { "IO", SIGIO }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, {(char *)0, -1} }; torque-2.4.16/src/resmom/fujitsu/mom_mach.h0000664000113300011330000001240411272401243015544 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: fujitsu */ #ifndef MOM_MACH #define MOM_MACH "fujitsu" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/fujitsu/Makefile.in0000664000113300011330000004377511605403750015704 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/fujitsu ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/fujitsu/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/fujitsu/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/fujitsu/pe_input.c0000664000113300011330000001063011272401243015601 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For vpp300 - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/fujitsu/mom_mach.c0000664000113300011330000013451611272401243015550 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "resmon.h" #include "../rm_dep.h" /* ** System dependent code to gather information for the resource ** monitor for a Fujitsu VPP300 machine running UXP/V ** ** Resources known by this code: ** cput cpu time for a pid or job ** mem memory size for a pid or job in KB ** resi resident memory size for a pid or job in KB ** sessions list of sessions in the system ** pids list of pids in a job ** nsessions number of sessions in the system ** nusers number of users in the system ** ncpus number of cpus ** physmem physical memory size in KB ** availmem available memory size in KB ** totmem total memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average */ static char ident[] = "@(#) fujitsu/$RCSfile$ $Revision: 3151 $"; #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* MAX */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions and data */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); char procfs[] = "/proc"; char procfmts[] = "/proc/%s"; char procfmtd[] = "/proc/%05.5d"; DIR *pdir; extern char *ret_string; int kd = -1; time_t wait_time = 10; int nproc = 0; int max_proc = 0; prstatus_t *proc_status = NULL; prpsinfo_t *proc_info = NULL; #define TBL_INC 20 extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char no_count[] = "count not found"; char nokernel[] = "kernel not available"; char nomemory[] = "no memory"; static long page_size; /* ** local resource array */ struct config dependent_config[] = { { "resi", {resi} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; struct nlist nl[] = { { "anoninfo" }, /* 0 */ { "physmem" }, /* 1 */ { "avenrun" }, /* 2 */ { "" } }; #define KSYM_ANON 0 #define KSYM_PHYS 1 #define KSYM_LOAD 2 /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* Don't need any periodic processing. */ } void dep_initialize(void) { int i; static char id[] = "dep_initialize"; char kernel[] = "/unix"; char kmem[] = "/dev/kmem"; page_size = sysconf(_SC_PAGESIZE); if ((pdir = opendir(procfs)) == NULL) { log_err(errno, id, "opendir"); return; } if (kd == -1) { if ((kd = open(kmem, O_RDONLY)) == -1) { log_err(errno, id, kmem); return; } /* insure /dev/kmem closed on exec */ if ((i = fcntl(kd, F_GETFD)) == -1) { log_err(errno, id, "F_GETFD"); } i |= FD_CLOEXEC; if (fcntl(kd, F_SETFD, i) == -1) { log_err(errno, id, "F_SETFD"); } } if (nlist(kernel, nl) == -1) { log_err(errno, id, kernel); } } void dep_cleanup(void) { static char id[] = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (pdir) closedir(pdir); close(kd); kd = -1; } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Time decoding macro. Accepts a timestruc_t pointer. Returns unsigned long * time in seconds. */ #define tv(val) (ulong)((val).tv_sec + ((val).tv_nsec + 500000000)/1000000000) static int injob(pjob, sid) job *pjob; pid_t sid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all tasks executed by the job, in seconds, adjusted * by cputfactor. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_sum"; ulong cputime, addtime; int i; int nps = 0; prstatus_t *ps; prpsinfo_t *pi; cputime = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; nps++; if (pi->pr_state == SZOMB) { cputime += tv(pi->pr_time); DBPRT(("%s: ses %d pid %d (zombie) cputime %d\n", id, pi->pr_sid, pi->pr_pid, cputime)) continue; } ps = &proc_status[i]; addtime = tv(ps->pr_utime) + tv(ps->pr_stime) + tv(ps->pr_cutime) + tv(ps->pr_cstime); cputime += addtime; DBPRT(("%s: ses %d pid %d cputime %d\n", id, pi->pr_sid, ps->pr_pid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Return TRUE if any process in the job is over limit for cputime usage. */ static int overcput_proc(job *pjob, unsigned long limit) { char *id = "overcput_proc"; ulong memsize; ulong cputime; int i; prstatus_t *ps; memsize = 0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (!injob(pjob, ps->pr_sid)) continue; cputime = (ulong)(cputfactor * (double)( tv(ps->pr_utime) + tv(ps->pr_stime) + tv(ps->pr_cutime) + tv(ps->pr_cstime))); if (cputime > limit) return (TRUE); } return (FALSE); } /* * Internal session memory usage function. * * Returns the total number of bytes of address * space consumed by all current tasks within the session. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; ulong memsize; int i; prpsinfo_t *pi; memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; memsize += pi->pr_size * page_size; } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; ulong resisize; int i; prpsinfo_t *pi; resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (!injob(pjob, pi->pr_sid)) continue; resisize += pi->pr_rssize * page_size; } return (resisize); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "mem") == 0) /* check */ { if (ignmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "pmem") == 0) /* ignore */ { } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_VMEM, &reslim) < 0)) return (error("RLIMIT_VMEM", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pcput") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) proc_status = (prstatus_t *)malloc(sizeof(prstatus_t) * TBL_INC); proc_info = (prpsinfo_t *)malloc(sizeof(prpsinfo_t) * TBL_INC); if (proc_status == NULL || proc_info == NULL) { log_err(errno, id, "malloc"); return (PBSE_SYSTEM); } max_proc = TBL_INC; return (PBSE_NONE); } /* * Declare start of polling loop. */ int mom_get_sample(void) { static char id[] = "mom_get_sample"; int fd; struct dirent *dent; char procname[100]; prstatus_t *ps; prpsinfo_t *pi; DBPRT(("%s: entered\n", id)) rewinddir(pdir); ps = proc_status; pi = proc_info; nproc = 0; for (fd = -1; (dent = readdir(pdir)) != NULL; close(fd)) { if (!isdigit(dent->d_name[0])) continue; sprintf(procname, procfmts, dent->d_name); if ((fd = open(procname, O_RDONLY)) == -1) continue; if (ioctl(fd, PIOCPSINFO, pi) == -1) { sprintf(log_buffer, "%s: ioctl(PIOCPSINFO)", procname); log_err(errno, id, log_buffer); continue; } if (ioctl(fd, PIOCSTATUS, ps) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "%s: ioctl(PIOCSTATUS)", procname); log_err(errno, id, log_buffer); } memset(ps, sizeof(prstatus_t), '\0'); } if (++nproc == max_proc) { void *hold; DBPRT(("%s: alloc more table space %d\n", id, nproc)) max_proc += TBL_INC; hold = realloc((void *)proc_status, max_proc * sizeof(prstatus_t)); assert(hold != NULL); proc_status = (prstatus_t *)hold; hold = realloc((void *)proc_info, max_proc * sizeof(prpsinfo_t)); assert(hold != NULL); proc_info = (prpsinfo_t *)hold; } ps = &proc_status[nproc]; pi = &proc_info[nproc]; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if ((igncput == FALSE) && (strcmp(pname, "pcput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if (overcput_proc(pjob, value)) { sprintf(log_buffer, "pcput exceeded limit %lu", value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * cputfactor); if ((time_now - pjob->ji_qs.ji_stime) > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; prpsinfo_t *pi; int i, sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; (void)mom_get_sample(); for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (sesid == pi->pr_sid) { (void)kill(pi->pr_pid, sig); ++ct; } } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) if (proc_status) free(proc_status); if (proc_info) free(proc_info); if (pdir) { if (closedir(pdir) != 0) { log_err(errno, id, "closedir"); return (PBSE_SYSTEM); } } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; static char id[] = "getprocs"; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } double dsecs(t) timestruc_t *t; { DBPRT(("\tsecs: %d\tnsecs: %d\n", t->tv_sec, t->tv_nsec)) return ((double)t->tv_sec + ((double)t->tv_nsec * 1.0e-9)); } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int found = 0; int i; double cputime, addtime; prstatus_t *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (jobid != ps->pr_sid) continue; found = 1; addtime = dsecs(&ps->pr_utime) + dsecs(&ps->pr_stime) + dsecs(&ps->pr_cutime) + dsecs(&ps->pr_cstime); cputime += addtime; DBPRT(("%s: total %.2f pid %d %.2f\n", id, cputime, ps->pr_pid, addtime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; double cputime; int i; prstatus_t *ps; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { ps = &proc_status[i]; if (ps->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } cputime = dsecs(&ps->pr_utime) + dsecs(&ps->pr_stime) + dsecs(&ps->pr_cutime) + dsecs(&ps->pr_cstime); sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int memsize; int i; int found = 0; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; memsize += pi->pr_size; DBPRT(("%s: total %d pid %d %d\n", id, memsize*page_size, pi->pr_pid, pi->pr_size*page_size)) } if (found) { sprintf(ret_string, "%ukb", (memsize*page_size) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; prpsinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } sprintf(ret_string, "%ukb", (pi->pr_size * page_size) >> 10); /* KB */ return ret_string; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int resisize; int i; int found = 0; prpsinfo_t *pi; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (jobid != pi->pr_sid) continue; found = 1; resisize += pi->pr_rssize; } if (found) { /* in KB */ sprintf(ret_string, "%ukb", (resisize * page_size) >> 10); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; prpsinfo_t *pi; int i; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_pid == pid) break; } if (i == nproc) { rm_errno = RM_ERR_EXIST; return NULL; } /* in KB */ sprintf(ret_string, "%ukb", (pi->pr_rssize * page_size) >> 10); return ret_string; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; prpsinfo_t *pi; char *fmt; int njids = 0; pid_t *jids, *hold; static int maxjid = 200; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, nomemory); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of job */ for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (pi->pr_uid == 0) continue; if ((jobid = pi->pr_sid) == 0) continue; DBPRT(("%s[%d]: pid %d sid %d\n", id, njids, pi->pr_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i, j; prpsinfo_t *pi; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; num_pids = 0; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; DBPRT(("%s[%d]: pid: %d sid %d\n", id, num_pids, pi->pr_pid, pi->pr_sid)) if (jobid != pi->pr_sid) continue; sprintf(fmt, "%d ", pi->pr_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; prpsinfo_t *pi; int nuids = 0; uid_t *uids, *hold; static int maxuid = 200; register uid_t uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uids = (uid_t *)calloc(maxuid, sizeof(uid_t))) == NULL) { log_err(errno, id, nomemory); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if ((uid = pi->pr_uid) == 0) continue; DBPRT(("%s[%d]: pid %d uid %d\n", id, nuids, pi->pr_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ { if (nuids == maxuid) /* need more space */ { maxuid += 100; hold = (uid_t *)realloc(uids, maxuid); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(uids); return NULL; } uids = hold; } uids[nuids++] = uid; /* add uid to list */ } } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } /* * The following code provoded by Fujitsu and modified for this fuction. * * Return the number of "running" PEs * * Earl J. Dodd, FAI * 4-Oct-1997 */ static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; unsigned int pmem; int i, npes; int maxlistlen; size_t ppnsize; opr_peid_blk_t *peidlist; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } npes = 0; ppnsize = 0; /* get the PE table size */ ppnsize = syscall(SYS_sysopr, SKAIGETPPN); if (ppnsize <= 0) { log_err(errno, id, "SKAIGETPPN"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* alloc the receiver PE table */ peidlist = (opr_peid_blk_t *)malloc(sizeof(opr_peid_blk_t) * ppnsize); if (peidlist == NULL) { log_err(errno, id, nomemory); rm_errno = RM_ERR_SYSTEM; return NULL; } /* retrieve individual PE information */ maxlistlen = syscall(SYS_sysopr, SKAIGETPEIDL, ppnsize, peidlist); /* ** maxlistlen should = 16 (I think; really don't know what the ** return codes are) */ for (i = 0; i < ppnsize; i++) { if (peidlist[i].ppid >= 0 && peidlist[i].state > 0) npes++; #ifdef DEBUG fprintf(stderr, "peid: %d, ppid = %d\n", i, peidlist[i].ppid); fprintf(stderr, "peid: %d, peid = %d\n", i, peidlist[i].peid); fprintf(stderr, "peid: %d, pp_type = 0x%x\n", i, peidlist[i].pp_type); fprintf(stderr, "peid: %d, state = 0x%x\n", i, peidlist[i].state); #endif } free(peidlist); sprintf(ret_string, "%d", npes); system_ncpus = npes; return ret_string; } int get_la(double *rv) { char *id = "get_la"; long load; if (kd == -1) { log_err(-1, id, nokernel); return (rm_errno = RM_ERR_SYSTEM); } if (nl[KSYM_LOAD].n_type == 0) { log_err(-1, id, "loadaverage count not found"); return (rm_errno = RM_ERR_SYSTEM); } if (lseek(kd, nl[KSYM_LOAD].n_value, SEEK_SET) == -1) { log_err(errno, id, "lseek"); return (rm_errno = RM_ERR_SYSTEM); } if (read(kd, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "read"); return (rm_errno = RM_ERR_SYSTEM); } *rv = (double)load / 256.0; return 0; } struct anoninfo ai; int getanon(char *id) { static unsigned int lastai = 0; if (lastai == reqnum) /* already have anoninfo */ return 0; if (kd == -1) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return 1; } if (nl[KSYM_ANON].n_type == 0) { log_err(-1, id, "anoninfo struct not found"); rm_errno = RM_ERR_SYSTEM; return 1; } if (lseek(kd, nl[KSYM_ANON].n_value, SEEK_SET) == -1) { log_err(errno, id, "lseek"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (read(kd, (char *)&ai, sizeof(struct anoninfo)) != sizeof(struct anoninfo)) { log_err(errno, id, "read"); rm_errno = RM_ERR_SYSTEM; return 1; } lastai = reqnum; return 0; } static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getanon(id)) return NULL; sprintf(ret_string, "%ukb", ctob(ai.ani_max) >> 10); /* KB */ return ret_string; } static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getanon(id)) return NULL; /* in KB */ sprintf(ret_string, "%ukb", ctob(ai.ani_max - ai.ani_resv) >> 10); return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; unsigned int pmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (kd == -1) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return NULL; } if (nl[KSYM_PHYS].n_type == 0) { log_err(-1, id, "physmem count not found"); rm_errno = RM_ERR_SYSTEM; return 0; } if (lseek(kd, nl[KSYM_PHYS].n_value, SEEK_SET) == -1) { log_err(errno, id, "lseek"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (read(kd, (char *)&pmem, sizeof(pmem)) != sizeof(pmem)) { log_err(errno, id, "read"); rm_errno = RM_ERR_SYSTEM; return NULL; } pmem *= getpagesize(); sprintf(ret_string, "%ukb", pmem >> 10); /* in KB */ return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statvfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statvfs(param, &fsbuf) == -1) { log_err(errno, id, "statvfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bfree) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* in KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev/pts")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { char *name = de->d_name; if (maxtm >= curtm) break; if (*name == '.') continue; sprintf(ttyname, "/dev/pts/%s", name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; int value; int job; int found = 0; int i; time_t now, start; prpsinfo_t *pi; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { pi = &proc_info[i]; if (job) { if (value != pi->pr_sid) continue; } else { if ((pid_t)value != pi->pr_pid) continue; } found = 1; start = MIN(start, pi->pr_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor));; return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/fujitsu/Makefile.am0000664000113300011330000000030611272401243015645 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/rm_dep.h0000664000113300011330000001155611272401244013551 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** Common resource names for dependent code. All machines ** supported by the resource monitor should include at least ** these resources. */ char *cput A_((struct rm_attribute *attrib)); char *mem A_((struct rm_attribute *attrib)); char *sessions A_((struct rm_attribute *attrib)); char *pids A_((struct rm_attribute *attrib)); char *nsessions A_((struct rm_attribute *attrib)); char *nusers A_((struct rm_attribute *attrib)); char *size A_((struct rm_attribute *attrib)); char *idletime A_((struct rm_attribute *attrib)); char *nullproc A_((struct rm_attribute *attrib)); struct config standard_config[] = { { "cput", {cput} }, { "mem", {mem} }, { "sessions", {sessions} }, { "pids", {pids} }, { "nsessions", {nsessions} }, { "nusers", {nusers} }, { "size", {size} }, { "idletime", {idletime} }, { NULL, {nullproc} }, }; torque-2.4.16/src/resmom/Makefile.am0000664000113300011330000000325311272401244014161 00000000000000include $(top_srcdir)/buildutils/config.mk SUBDIRS = @PBS_MACH@ DIST_SUBDIRS = aix4 aix5 darwin digitalunix freebsd freebsd5 fujitsu hpux10 hpux11 \ irix5 irix6 irix6array linux netbsd solaris5 solaris7 sunos4 unicos8 unicosmk2 AM_CPPFLAGS += -I$(top_srcdir)/src/resmom/@PBS_MACH@ -DPBS_MOM \ -DDEMUX=\"$(program_prefix)$(DEMUX_PATH)$(program_suffix)\" \ -DRCP_PATH=\"$(program_prefix)$(RCP_PATH)$(program_suffix)\" \ -DRCP_ARGS=\"$(RCP_ARGS)\" \ -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" -DPBS_ENVIRON=\"$(PBS_ENVIRON)\" PBS_LIBS = ../lib/Libattr/libattr.a \ ../lib/Libsite/libsite.a \ ../lib/Libutils/libutils.a \ ../lib/Libpbs/libtorque.la EXTRA_DIST = rm_dep.h sbin_PROGRAMS = pbs_mom pbs_demux LDADD = @PBS_MACH@/libmommach.a $(MOMLIBS) $(PBS_LIBS) pbs_mom_SOURCES = catch_child.c mom_comm.c mom_inter.c mom_main.c \ mom_server.c prolog.c requests.c start_exec.c \ checkpoint.c tmsock_recov.c req_quejob.c job_func.c \ ../server/attr_recov.c ../server/dis_read.c \ ../server/job_attr_def.c \ ../server/job_recov.c \ ../server/process_request.c ../server/reply_send.c \ ../server/resc_def_all.c \ ../server/job_qs_upgrade.c if BUILDCPA pbs_mom_SOURCES += cray_cpa.c endif pbs_demux_SOURCES = pbs_demux.c install-exec-hook: $(PBS_MKDIRS) aux || : $(PBS_MKDIRS) mom rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qnoded$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbs_mom$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(sbindir)/$(program_prefix)qnoded$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(PBS_ENVIRON) rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qnoded$(program_suffix)$(EXEEXT) torque-2.4.16/src/resmom/cray_cpa.c0000664000113300011330000002452611272401244014060 00000000000000#include "pbs_config.h" #include #include #include #include #include #ifdef HAVE_CPALIB_H #include #endif #include "portability.h" #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "pbs_job.h" #include "log.h" #include "mom_func.h" #include "resource.h" extern int LOGLEVEL; extern char mom_host[]; /* NOTE: may use CPA_MAX_NODES at some point */ unsigned int MaxListSize = CPA_MAX_PART; unsigned int MaxNID = CPA_MAX_NID; /* CPACreatePartition - Cray's cpalib support * gets the "size" resource from the job, converts that to a CPA Node Request, * creates a partition, assigns it to JobID string, stores the partid and * cookies in the job, and sets some env vars in vtable */ int CPACreatePartition( job *pjob, /* I */ struct var_table *vtab) /* I */ { char id[] = "CPACreatePartition"; cpa_node_req_t *NodeReq; int rc; char *Value; char *Spec; int PPN; int Flags; int Size = 0; int UID; char *AcctID = NULL; char *JobID; char *HostList = NULL; /* scheduler specified list of hosts to allocate (optional) */ unsigned long ParID; /* O - partition id */ unsigned long long AdminCookie; /* O - admin cookie */ unsigned long long AllocCookie; /* O - alloc cookie */ char longbuf[1024]; resource *presc; /* Requested Resource List */ resource_def *prd; attribute *pattr; int rc; cpa_nid_list_t Wanted = NULL; /* first, get the size, uid, jobid, and subnodelist from the job */ pattr = &pjob->ji_wattr[(int)JOB_ATR_resource]; prd = find_resc_def(svr_resc_def, "size", svr_resc_size); presc = find_resc_entry(pattr, prd); if (presc != NULL) { Size = presc->rs_value.at_val.at_long; } UID = pjob->ji_qs.ji_un.ji_momt.ji_exuid; if ((Size <= 0) || (UID < 0)) { /* FAILURE */ sprintf(log_buffer, "ERROR: invalid parameters: Size: %d UID: %d \n", Size, UID); log_err(-1, id, log_buffer); return(1); } pattr = &pjob->ji_wattr[(int)JOB_ATR_resource]; prd = find_resc_def(svr_resc_def, "subnode_list", svr_resc_size); presc = find_resc_entry(pattr, prd); if (presc != NULL) { HostList = presc->rs_value.at_val.at_string; } if (pjob->ji_wattr[(int)JOB_ATR_account].at_flags & ATR_VFLAG_SET) { AcctID = pjob->ji_wattr[(int)JOB_ATR_account].at_val.at_str; } JobID = pjob->ji_qs.ji_jobid; PPN = 1; /* NOTE: not really supported w/in CPA, always use 1 */ Flags = 0; /* NOTE: only allocate compute hosts, always use 0 */ Spec = NULL; /* NOTE: required node specification, not used */ if (HostList != NULL) { char tmpBuffer[256000]; int index; rc = nid_list_create( 0, MaxListSize, /* max count */ 0, MaxNID, /* max value */ &Wanted); /* O */ if (rc != 0) { /* FAILURE */ printf("nid_list_create: rc=%d (%s)\n", rc, cpa_rc2str(rc)); return(1); } strncpy(tmpBuffer, HostList, sizeof(tmpBuffer)); tmpBuffer[sizeof(tmpBuffer) - 1] = '\0'; for (index = 0;tmpBuffer[index] != '\0';index++) { if (tmpBuffer[index] == ':') tmpBuffer[index] = ','; } rc = nid_list_destringify(tmpBuffer, Wanted); if (rc != 0) { /* FAILURE */ printf("nid_list_destringify: rc=%d (%s)\n", rc, cpa_rc2str(rc)); nid_list_destroy(Wanted); return(1); } if (loglevel >= 3) { char *buf = NULL; int bufsize = 0; rc = nid_list_stringify(Wanted, &buf, &bufsize); if (rc == 0) { snprintf(log_buffer, sizeof(log_buffer), "CPANodeList: %s\n", buf); } else { snprintf(log_buffer, sizeof(log_buffer), "CPA nid_list_stringify: rc=%d\n", rc); } log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); free(buf); } } else { Wanted = NULL; } NodeReq = cpa_new_node_req( Size, /* number of procs/nodes required by job */ PPN, Flags, Spec, Wanted); /* I */ if (NodeReq == NULL) { /* FAILURE: cannot alloc memory for node req */ sprintf(log_buffer, "cpa_new_node_req: NULL\n"); log_err(-1, id, log_buffer); nid_list_destroy(Wanted); return(1); } rc = cpa_create_partition( NodeReq, CPA_BATCH, CPA_NOT_SPECIFIED, UID, (AcctID != NULL) ? AcctID : "DEFAULT", (cpa_partition_id_t *) & ParID, /* O */ (cpa_cookie_t *) & AdminCookie, /* O */ (cpa_cookie_t *) & AllocCookie); /* O */ if (rc != 0) { /* FAILURE */ sprintf(log_buffer, "cpa_create_partition: rc=%d (%s)\n", rc, cpa_rc2str(rc)); log_err(-1, id, log_buffer); nid_list_destroy(Wanted); return(1); } rc = cpa_assign_partition( (cpa_partition_id_t)ParID, (cpa_cookie_t)AdminCookie, JobID, 1); /* NOT CURRENTLY USED - should be set to NID of 'master host' */ /* free memory, nid list no longer required */ nid_list_destroy(Wanted); if (rc != 0) { /* FAILURE */ sprintf(log_buffer, "cpa_assign_partition: rc=%d (%s)\n", rc, cpa_rc2str(rc)); log_err(-1, id, log_buffer); return(1); } /* save the partition and cookies in the job and vtab */ prd = find_resc_def(svr_resc_def, "cpapartition", svr_resc_size); if (prd == NULL) { return(PBSE_SYSTEM); } if ((presc = find_resc_entry(pattr, prd)) == NULL) { if ((presc = add_resource_entry(pattr, prd)) == NULL) { return(PBSE_SYSTEM); } } else { prd->rs_free(&presc->rs_value); } snprintf(longbuf, 1023, "%lu", ParID); prd->rs_decode(&presc->rs_value, NULL, NULL, longbuf); presc->rs_value.at_flags |= ATR_VFLAG_SET; bld_env_variables(vtab, "BATCH_PARTITION_ID", longbuf); prd = find_resc_def(svr_resc_def, "cpaadmincookie", svr_resc_size); if (prd == NULL) { return(PBSE_SYSTEM); } if ((presc = find_resc_entry(pattr, prd)) == NULL) { if ((presc = add_resource_entry(pattr, prd)) == NULL) { return(PBSE_SYSTEM); } } else { prd->rs_free(&presc->rs_value); } snprintf(longbuf, 1023, "%llu", AdminCookie); prd->rs_decode(&presc->rs_value, NULL, NULL, longbuf); presc->rs_value.at_flags |= ATR_VFLAG_SET; /* admincookie doesn't go into job env */ prd = find_resc_def(svr_resc_def, "cpaalloccookie", svr_resc_size); if (prd == NULL) { return(PBSE_SYSTEM); } if ((presc = find_resc_entry(pattr, prd)) == NULL) { if ((presc = add_resource_entry(pattr, prd)) == NULL) { return(PBSE_SYSTEM); } } else { prd->rs_free(&presc->rs_value); } snprintf(longbuf, 1023, "%llu", AllocCookie); prd->rs_decode(&presc->rs_value, NULL, NULL, longbuf); presc->rs_value.at_flags |= ATR_VFLAG_SET; bld_env_variables(vtab, "BATCH_ALLOC_COOKIE", longbuf); bld_env_variables(vtab, "BATCH_JOBID", JobID); return(0); } /* END CPACreatePartition() */ /* NOTE: send SIGTERM, allow 30 seconds, SIGKILL */ /* NOTE: allow configurable delay between term and kill */ int CPADestroyPartition( job *pjob) { char id[] = "CPADestroyPartition"; int rc; int ErrorP; /* O - non-zero if users of partition encountered error */ unsigned long ParID; unsigned long long AdminCookie; resource *presc; /* Requested Resource List */ resource_def *prd; attribute *pattr; pattr = &pjob->ji_wattr[(int)JOB_ATR_resource]; prd = find_resc_def(svr_resc_def, "cpapartition", svr_resc_size); if (prd == NULL) { return(PBSE_SYSTEM); } if ((presc = find_resc_entry(pattr, prd)) == NULL) { return(PBSE_SYSTEM); /* is this a real error? */ } ParID = strTouL(presc->rs_value.at_val.at_str, NULL, 10); prd = find_resc_def(svr_resc_def, "cpaadmincookie", svr_resc_size); if (prd == NULL) { return(PBSE_SYSTEM); } if ((presc = find_resc_entry(pattr, prd)) == NULL) { return(PBSE_SYSTEM); /* is this a real error? */ } AdminCookie = strTouL(presc->rs_value.at_val.at_str, NULL, 10); if (LOGLEVEL >= 2) { printf("INFO: destroying partition %lu with cookie %llu\n", ParID, AdminCookie); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } /* will fail if yod is present */ rc = cpa_destroy_partition( ParID, AdminCookie, &ErrorP); /* O - if set, destroy failed on one or more tasks */ if (rc != 0) { sprintf(log_buffer, "cpa_destroy_partition: rc=%d (%s)\n", rc, cpa_rc2str(rc)); log_err(-1, id, log_buffer); return(1); } return(0); } /* END CPADestroyPartition() */ int CPASetJobEnv( unsigned long ParID, /* I */ unsigned long AllocCookie, /* I */ char *JobID) /* I */ { char *ptr; char tmpNum[64]; const char *ParVar = "BATCH_PARTITION_ID"; const char *AllVar = "BATCH_ALLOC_COOKIE"; const char *JobVar = "BATCH_JOBID"; /* NOTE: add two bytes to malloc for '=' and '\0' */ sprintf(tmpNum, "%ld", ParID); if (tmpNum[0] != '\0') { ptr = (char *)malloc(strlen(tmpNum) + strlen(ParVar) + 2); if (ptr == NULL) { return(1); } sprintf(ptr, "%s=%s", ParVar, tmpNum); putenv(ptr); } sprintf(tmpNum, "%ld", AllocCookie); if (tmpNum[0] != '\0') { ptr = (char *)malloc(strlen(tmpNum) + strlen(AllVar) + 2); if (ptr == NULL) { return(1); } sprintf(ptr, "%s=%s", AllVar, tmpNum); putenv(ptr); } if (JobID != NULL) { ptr = (char *)malloc(strlen(JobID) + strlen(JobVar) + 2); if (ptr == NULL) { return(1); } sprintf(ptr, "%s=%s", JobVar, JobID); putenv(ptr); } return(0); } /* END CPASetJobEnv() */ torque-2.4.16/src/resmom/prolog.c0000664000113300011330000006511611403757171013612 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #define PBS_MOM 1 #include #include #include #include #include #include #include #include #include #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "mom_func.h" #include "resource.h" #include "pbs_proto.h" #include "net_connect.h" #define PBS_PROLOG_TIME 300 extern char PBSNodeMsgBuf[]; extern int MOMPrologTimeoutCount; extern int MOMPrologFailureCount; extern int LOGLEVEL; extern int DEBUGMODE; extern int lockfds; extern char *path_aux; unsigned int pe_alarm_time = PBS_PROLOG_TIME; static pid_t child; static int run_exit; /* external prototypes */ extern int pe_input A_((char *)); extern int TTmpDirName A_((job *, char *)); extern void encode_used A_((job *, tlist_head *)); #ifdef ENABLE_CSA extern void add_wkm_end(uint64_t, int64_t, char *); extern char *path_epiloguser; #endif /* ENABLE_CSA */ /* END extern prototypes */ const char *PPEType[] = { "NONE", "prolog", "epilog", "userprolog", "userepilog", NULL }; /* * resc_to_string - convert resources_[list or used] to a single string */ static char *resc_to_string( job *pjob, /* I (optional - if specified, report total job resources) */ int aindex, /* I which attribute to convert */ char *buf, /* O the buffer into which to convert */ int buflen) /* I the length of the above buffer */ { int need; svrattrl *patlist; tlist_head svlist; attribute *pattr; int isfirst = 1; CLEAR_HEAD(svlist); *buf = '\0'; pattr = &pjob->ji_wattr[aindex]; /* pack the list of resources into svlist */ if (aindex == JOB_ATR_resource) { if (encode_resc(pattr, &svlist, "x", NULL, ATR_ENCODE_CLIENT) <= 0) { return(buf); } } else if (aindex == JOB_ATR_resc_used) { encode_used(pjob, &svlist); } else { return(buf); } /* unpack svlist into a comma-delimited string */ patlist = (svrattrl *)GET_NEXT(svlist); while (patlist != NULL) { need = strlen(patlist->al_resc) + strlen(patlist->al_value) + 3; if (need >= buflen) { patlist = (svrattrl *)GET_NEXT(patlist->al_link); continue; } if (LOGLEVEL >= 7) { fprintf(stderr, "Epilog: %s=%s\n", patlist->al_resc, patlist->al_value); } if (isfirst == 1) { isfirst = 0; } else { strcat(buf, ","); buflen--; } strcat(buf, patlist->al_resc); strcat(buf, "="); strcat(buf, patlist->al_value); buflen -= need; patlist = (svrattrl *)GET_NEXT(patlist->al_link); } /* END while (patlist != NULL) */ free_attrlist(&svlist); return(buf); } /* END resc_to_string() */ /* * pelog_err - record error for run_pelog() * * @see run_pelog() - parent * * @return (parameter 'n') */ static int pelog_err( job *pjob, /* I */ char *file, /* I */ int n, /* I - exit code */ char *text) /* I */ { sprintf(log_buffer,"prolog/epilog failed, file: %s, exit: %d, %s", file, n, text); sprintf(PBSNodeMsgBuf,"ERROR: %s", log_buffer); log_err(-1,"run_pelog",log_buffer); return(n); } /* END pelog_err() */ /* * pelogalm() - alarm handler for run_pelog() */ static void pelogalm( int sig) /* I */ { /* child is global */ errno = 0; kill(child,SIGKILL); run_exit = -4; return; } /* END pelogalm() */ /* * run_pelog() - Run the Prologue/Epilogue script * * Script is run under uid of root, prologue and the epilogue have: * - argv[1] is the jobid * - argv[2] is the user's name * - argv[3] is the user's group name * - argv[4] is the job name * - the input file is an architecture-dependent file * - the output and error are the job's output and error * The epilogue also has: * - argv[5] is the session id * - argv[6] is the list of resource limits specified * - argv[7] is the list of resources used * - argv[8] is the queue in which the job resides * - argv[9] is the account under which the job run * - argv[10] is the job's exit status * The prologue also has: * - argv[5] is the list of resource limits specified * - argv[6] is the queue in which the job resides * - argv[7] is the account under which the job is run * * @see TMomFinalizeChild() - parent * @see pelog_err() - child * * @return = 0 - SUCCESS - file does not exist or execution successful * @return < 0 - FAILURE - general internal failure * -1 file permission issue * -2 no pro/epi input file * -3 child wait interrupted * -4 prolog/epilog timeout occurred, child cleaned up * -5 prolog/epilog timeout occurred, cannot kill child * @return > 0 - FAILURE - system failure (rc = errno) */ int run_pelog( int which, /* I (one of PE_*) */ char *specpelog, /* I - script path */ job *pjob, /* I - associated job */ int pe_io_type) /* I */ { char *id = "run_pelog"; struct sigaction act, oldact; char *arg[12]; int fds1 = 0; int fds2 = 0; int fd_input; char resc_list[2048]; char resc_used[2048]; struct stat sbuf; char sid[20]; char exit_stat[11]; int waitst; int isjoined; /* boolean */ char buf[MAXPATHLEN + 1024]; char pelog[MAXPATHLEN + 1024]; int jobtypespecified = 0; resource *r; char *EmptyString = ""; int LastArg; int aindex; int rc; char *ptr; if ((pjob == NULL) || (specpelog == NULL) || (specpelog[0] == '\0')) { return(0); } ptr = pjob->ji_wattr[(int)JOB_ATR_jobtype].at_val.at_str; if (ptr != NULL) { jobtypespecified = 1; snprintf(pelog,sizeof(pelog),"%s.%s", specpelog, ptr); } else { strncpy(pelog,specpelog,sizeof(pelog)); } rc = stat(pelog,&sbuf); if ((rc == -1) && (jobtypespecified == 1)) { strncpy(pelog,specpelog,sizeof(pelog)); rc = stat(pelog,&sbuf); } if (rc == -1) { if (errno == ENOENT || errno == EBADF) { /* epilog/prolog script does not exist */ if (LOGLEVEL >= 5) { static char tmpBuf[1024]; sprintf(log_buffer, "%s script '%s' for job %s does not exist (cwd: %s,pid: %d)", PPEType[which], (pelog != NULL) ? pelog : "NULL", (pjob != NULL) ? pjob->ji_qs.ji_jobid : "NULL", getcwd(tmpBuf, sizeof(tmpBuf)), (int)getpid()); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } #ifdef ENABLE_CSA if ((which == PE_EPILOGUSER) && (!strcmp(pelog, path_epiloguser))) { /* * Add a workload management end record */ if (LOGLEVEL >= 8) { sprintf(log_buffer, "%s calling add_wkm_end from run_pelog() - no user epilog", pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); } add_wkm_end(pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll, pjob->ji_qs.ji_un.ji_momt.ji_exitstat, pjob->ji_qs.ji_jobid); } #endif /* ENABLE_CSA */ return(0); } return(pelog_err(pjob,pelog,errno,"cannot stat")); } if (LOGLEVEL >= 5) { sprintf(log_buffer,"running %s script '%s' for job %s", PPEType[which], (pelog != NULL) ? pelog : "NULL", pjob->ji_qs.ji_jobid); log_ext(-1,id,log_buffer,LOG_DEBUG); /* not actually an error--but informational */ } /* script must be owned by root, be regular file, read and execute by user * * and not writeable by group or other */ if(which == PE_PROLOGUSERJOB || which == PE_EPILOGUSERJOB) { if ((sbuf.st_uid != pjob->ji_qs.ji_un.ji_momt.ji_exuid) || (!S_ISREG(sbuf.st_mode)) || ((sbuf.st_mode & (S_IRUSR | S_IXUSR)) != (S_IRUSR | S_IXUSR)) || (sbuf.st_mode & (S_IWGRP | S_IWOTH))) { return(pelog_err(pjob,pelog,-1,"permission Error")); } } else if ((sbuf.st_uid != 0) || (!S_ISREG(sbuf.st_mode)) || ((sbuf.st_mode & (S_IRUSR | S_IXUSR)) != (S_IRUSR | S_IXUSR)) || (sbuf.st_mode & (S_IWGRP | S_IWOTH))) { return(pelog_err(pjob,pelog,-1,"permission Error")); } if ((which == PE_PROLOGUSER) || (which == PE_EPILOGUSER)) { /* script must also be read and execute by other */ if ((sbuf.st_mode & (S_IROTH | S_IXOTH)) != (S_IROTH | S_IXOTH)) { return(pelog_err(pjob, pelog, -1, "permission Error")); } } fd_input = pe_input(pjob->ji_qs.ji_jobid); if (fd_input < 0) { return(pelog_err(pjob, pelog, -2, "no pro/epilogue input file")); } run_exit = 0; child = fork(); if (child > 0) { int KillSent = FALSE; /* parent - watch for prolog/epilog to complete */ close(fd_input); act.sa_handler = pelogalm; sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(SIGALRM, &act, &oldact); /* it would be nice if the harvest routine could block for 5 seconds, and if the prolog is not complete in that time, mark job as prolog pending, append prolog child, and continue */ /* main loop should attempt to harvest prolog in non-blocking mode. If unsuccessful after timeout, job should be terminated, and failure reported. If successful, mom should unset prolog pending, and continue with job start sequence. Mom should report job as running while prologpending flag is set. (NOTE: must track per job prolog start time) */ alarm(pe_alarm_time); while (waitpid(child, &waitst, 0) < 0) { if (errno != EINTR) { /* exit loop. non-alarm based failure occurred */ run_exit = -3; MOMPrologFailureCount++; break; } if (run_exit == -4) { if (KillSent == FALSE) { MOMPrologTimeoutCount++; /* timeout occurred */ KillSent = TRUE; /* NOTE: prolog/epilog may be locked in KERNEL space and unkillable */ alarm(5); } else { /* cannot kill prolog/epilog, give up */ run_exit = -5; break; } } } /* END while (wait(&waitst) < 0) */ /* epilog/prolog child completed */ #ifdef ENABLE_CSA if ((which == PE_EPILOGUSER) && (!strcmp(pelog, path_epiloguser))) { /* * Add a workload management end record */ if (LOGLEVEL >= 8) { sprintf(log_buffer, "%s calling add_wkm_end from run_pelog() - after user epilog", pjob->ji_qs.ji_jobid); log_err(-1, id, log_buffer); } add_wkm_end(pjob->ji_wattr[(int)JOB_ATR_pagg_id].at_val.at_ll, pjob->ji_qs.ji_un.ji_momt.ji_exitstat, pjob->ji_qs.ji_jobid); } #endif /* ENABLE_CSA */ alarm(0); /* restore the previous handler */ sigaction(SIGALRM, &oldact, 0); if (run_exit == 0) { if (WIFEXITED(waitst)) { run_exit = WEXITSTATUS(waitst); } } } else { /* child - run script */ log_close(0); if (lockfds >= 0) { close(lockfds); lockfds = -1; } net_close(-1); if ((which == PE_PROLOGUSER) || (which == PE_EPILOGUSER) || (which == PE_PROLOGUSERJOB) || which == PE_EPILOGUSERJOB) { if (setgroups( pjob->ji_grpcache->gc_ngroup, (gid_t *)pjob->ji_grpcache->gc_groups) != 0) { snprintf(log_buffer,sizeof(log_buffer), "setgroups() for UID = %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); log_err(errno, id, log_buffer); exit(255); } if (setgid(pjob->ji_qs.ji_un.ji_momt.ji_exgid) != 0) { snprintf(log_buffer,sizeof(log_buffer), "setgid(%lu) for UID = %lu failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exgid, (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); log_err(errno, id, log_buffer); exit(255); } if (setuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid) != 0) { snprintf(log_buffer,sizeof(log_buffer), "setuid(%lu) failed: %s\n", (unsigned long)pjob->ji_qs.ji_un.ji_momt.ji_exuid, strerror(errno)); log_err(errno, id, log_buffer); exit(255); } } if (fd_input != 0) { close(0); if (dup(fd_input) == -1) {} close(fd_input); } if (pe_io_type == PE_IO_TYPE_NULL) { /* no output, force to /dev/null */ fds1 = open("/dev/null", O_WRONLY, 0600); fds2 = open("/dev/null", O_WRONLY, 0600); } else if (pe_io_type == PE_IO_TYPE_STD) { /* open job standard out/error */ /* * We need to know if files are joined or not. * If they are then open the correct file and duplicate it to the other */ isjoined = is_joined(pjob); switch (isjoined) { case -1: fds2 = open_std_file(pjob, StdErr, O_WRONLY | O_APPEND, pjob->ji_qs.ji_un.ji_momt.ji_exgid); fds1 = dup(fds2); break; case 1: fds1 = open_std_file(pjob, StdOut, O_WRONLY | O_APPEND, pjob->ji_qs.ji_un.ji_momt.ji_exgid); fds2 = dup(fds1); break; default: fds1 = open_std_file(pjob, StdOut, O_WRONLY | O_APPEND, pjob->ji_qs.ji_un.ji_momt.ji_exgid); fds2 = open_std_file(pjob, StdErr, O_WRONLY | O_APPEND, pjob->ji_qs.ji_un.ji_momt.ji_exgid); break; } } if (pe_io_type != PE_IO_TYPE_ASIS) { /* If PE_IO_TYPE_ASIS, leave as is, already open to job */ if (fds1 != 1) { close(1); if (dup(fds1) == -1) {} close(fds1); } if (fds2 != 2) { close(2); if (dup(fds2) == -1) {} close(fds2); } } if ((which == PE_PROLOGUSER) || (which == PE_EPILOGUSER) || (which == PE_PROLOGUSERJOB) || (which == PE_EPILOGUSERJOB)) { if (chdir(pjob->ji_grpcache->gc_homedir) != 0) { /* warn only, no failure */ sprintf(log_buffer, "PBS: chdir to %s failed: %s (running user %s in current directory)", pjob->ji_grpcache->gc_homedir, strerror(errno), which == PE_PROLOGUSER ? "prologue" : "epilogue"); if (write(2, log_buffer, strlen(log_buffer)) == -1) {} fsync(2); } } /* for both prolog and epilog */ if (DEBUGMODE == 1) { fprintf(stderr, "PELOGINFO: script:'%s' jobid:'%s' euser:'%s' egroup:'%s' jobname:'%s' SSID:'%ld' RESC:'%s'\n", pelog, pjob->ji_qs.ji_jobid, pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str, pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str, pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str, pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long, resc_to_string(pjob, (int)JOB_ATR_resource, resc_list, sizeof(resc_list))); } arg[0] = pelog; arg[1] = pjob->ji_qs.ji_jobid; arg[2] = pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str; arg[3] = pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str; arg[4] = pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str; /* NOTE: inside child */ if ( which == PE_EPILOG || which == PE_EPILOGUSER || which == PE_EPILOGUSERJOB ) { /* for epilog only */ sprintf(sid, "%ld", pjob->ji_wattr[(int)JOB_ATR_session_id].at_val.at_long); sprintf(exit_stat,"%d", pjob->ji_qs.ji_un.ji_exect.ji_exitstat); arg[5] = sid; arg[6] = resc_to_string(pjob, (int)JOB_ATR_resource, resc_list, sizeof(resc_list)); arg[7] = resc_to_string(pjob, (int)JOB_ATR_resc_used, resc_used, sizeof(resc_used)); arg[8] = pjob->ji_wattr[(int)JOB_ATR_in_queue].at_val.at_str; arg[9] = pjob->ji_wattr[(int)JOB_ATR_account].at_val.at_str; arg[10] = exit_stat; arg[11] = NULL; LastArg = 11; } else { /* prolog */ arg[5] = resc_to_string(pjob, (int)JOB_ATR_resource, resc_list, sizeof(resc_list)); arg[6] = pjob->ji_wattr[(int)JOB_ATR_in_queue].at_val.at_str; arg[7] = pjob->ji_wattr[(int)JOB_ATR_account].at_val.at_str; arg[8] = NULL; LastArg = 8; } for (aindex = 0;aindex < LastArg;aindex++) { if (arg[aindex] == NULL) arg[aindex] = EmptyString; } /* END for (aindex) */ /* * Pass Resource_List.nodes request in environment * to allow pro/epi-logue setup/teardown of system * settings. --pw, 2 Jan 02 * Fixed to use putenv for sysV compatibility. * --troy, 11 jun 03 * */ r = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], find_resc_def(svr_resc_def, "nodes", svr_resc_size)); if (r != NULL) { /* setenv("PBS_RESOURCE_NODES",r->rs_value.at_val.at_str,1); */ const char *envname = "PBS_RESOURCE_NODES="; char *envstr; envstr = malloc( (strlen(envname) + strlen(r->rs_value.at_val.at_str) + 1) * sizeof(char)); if (envstr != NULL) { strcpy(envstr,envname); strcat(envstr,r->rs_value.at_val.at_str); /* do _not_ free the string when using putenv */ putenv(envstr); } } /* END if (r != NULL) */ r = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], find_resc_def(svr_resc_def, "gres", svr_resc_size)); if (r != NULL) { /* setenv("PBS_RESOURCE_NODES",r->rs_value.at_val.at_str,1); */ const char *envname = "PBS_RESOURCE_GRES="; char *envstr; envstr = malloc( (strlen(envname) + strlen(r->rs_value.at_val.at_str) + 1) * sizeof(char)); if (envstr != NULL) { strcpy(envstr,envname); strcat(envstr,r->rs_value.at_val.at_str); /* do _not_ free the string when using putenv */ putenv(envstr); } } /* END if (r != NULL) */ if (TTmpDirName(pjob, buf)) { const char *envname = "TMPDIR="; char *envstr; envstr = malloc( (strlen(envname) + strlen(buf) + 1) * sizeof(char)); if (envstr != NULL) { strcpy(envstr,envname); strcat(envstr,buf); /* do _not_ free the string when using putenv */ putenv(envstr); } } /* END if (TTmpDirName(pjob,&buf)) */ /* Set PBS_SCHED_HINT */ { char *envname = "PBS_SCHED_HINT"; char *envval; char *envstr; if ((envval = get_job_envvar(pjob, envname)) != NULL) { envstr = malloc((strlen(envname) + strlen(envval) + 2) * sizeof(char)); if (envstr != NULL) { sprintf(envstr,"%s=%s", envname, envval); putenv(envstr); } } } /* Set PBS_NODENUM */ { char *envname = "PBS_NODENUM"; char *envstr; sprintf(buf, "%d", pjob->ji_nodeid); envstr = malloc((strlen(envname) + strlen(buf) + 2) * sizeof(char)); if (envstr != NULL) { sprintf(envstr,"%s=%d", envname, pjob->ji_nodeid); putenv(envstr); } } /* Set PBS_MSHOST */ { char *envname = "PBS_MSHOST"; char *envstr; if ((pjob->ji_vnods[0].vn_host != NULL) && (pjob->ji_vnods[0].vn_host->hn_host != NULL)) { envstr = malloc((strlen(envname) + strlen(pjob->ji_vnods[0].vn_host->hn_host) + 2) * sizeof(char)); if (envstr != NULL) { sprintf(envstr,"%s=%s", envname, pjob->ji_vnods[0].vn_host->hn_host); putenv(envstr); } } } /* Set PBS_NODEFILE */ { char *envname = "PBS_NODEFILE"; char *envstr; if (pjob->ji_flags & MOM_HAS_NODEFILE) { sprintf(buf, "%s/%s", path_aux, pjob->ji_qs.ji_jobid); envstr = malloc((strlen(envname) + strlen(buf) + 2) * sizeof(char)); if (envstr != NULL) { sprintf(envstr,"%s=%s", envname, buf); putenv(envstr); } } } /* Set PBS_O_Workdir */ { char *envname = "PBS_O_WORKDIR"; char *workdir_val; char *envstr; workdir_val = get_job_envvar(pjob,envname); if (workdir_val != NULL) { envstr = malloc((strlen(workdir_val) + strlen(envname) + 2) * sizeof(char)); if (envstr != NULL) { sprintf(envstr,"%s=%s", envname, workdir_val); putenv(envstr); } } } /* SET BEOWULF_JOB_MAP */ { struct array_strings *vstrs; int VarIsSet = 0; int j; vstrs = pjob->ji_wattr[(int)JOB_ATR_variables].at_val.at_arst; for (j = 0;j < vstrs->as_usedptr;++j) { if (!strncmp( vstrs->as_string[j], "BEOWULF_JOB_MAP=", strlen("BEOWULF_JOB_MAP="))) { VarIsSet = 1; break; } } if (VarIsSet == 1) { char *envstr; envstr = malloc((strlen(vstrs->as_string[j])) * sizeof(char)); if (envstr != NULL) { strcpy(envstr,vstrs->as_string[j]); putenv(envstr); } } } execv(pelog,arg); sprintf(log_buffer,"execv of %s failed: %s\n", pelog, strerror(errno)); if (write(2, log_buffer, strlen(log_buffer)) == -1) { /* cannot write message to stderr */ /* NO-OP */ } fsync(2); exit(255); } /* END else () */ switch (run_exit) { case 0: /* SUCCESS */ /* NO-OP */ break; case - 3: pelog_err(pjob, pelog, run_exit, "child wait interrupted"); break; case - 4: pelog_err(pjob, pelog, run_exit, "prolog/epilog timeout occurred, child cleaned up"); break; case - 5: pelog_err(pjob, pelog, run_exit, "prolog/epilog timeout occurred, cannot kill child"); break; default: pelog_err(pjob, pelog, run_exit, "nonzero p/e exit status"); break; } /* END switch (run_exit) */ return(run_exit); } /* END run_pelog() */ torque-2.4.16/src/resmom/aix5/0000777000113300011330000000000011614035171013054 500000000000000torque-2.4.16/src/resmom/aix5/mom_start.c0000664000113300011330000004234011272401243015143 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" #include "resmon.h" #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ #include "pbs_nodes.h" #include #endif /* IBM SP2 */ static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; extern char *path_home; extern void state_to_server A_((int, int)); /* Private variables */ static int job_key; /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { #if IBM_SP2==1 || IBM_SP2==2 /* IBM SP2 with PSSP 2.x or 3.x*/ char buf[256]; int i; sprintf(buf, "%d", pjob->ji_numvnod); bld_env_variables(vtab, "MP_PROCS", buf); for (i = 0; i < vtab->v_used; ++i) { if ((strncmp(vtab->v_envp[i], "PBS_NODEFILE", 12) == 0) && (*(vtab->v_envp[i] + 12) == '=')) { bld_env_variables(vtab, "MP_HOSTFILE", vtab->v_envp[i] + 13); break; } } #endif #if IBM_SP2==2 /* IBM SP2 with PSSP 3.x*/ sprintf(buf, "%d", job_key); bld_env_variables(vtab, "PBS_JOB_KEY", buf); sprintf(buf, "%d", pjob->ji_vnods[0].vn_index); bld_env_variables(vtab, "MP_MPI_NETWORK", buf); #endif /* IBM SP2 */ return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which tasks(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { DBPRT(("%s: pid %d not tracked, exit %d\n", id, pid, exiteval)) continue; } if (pid == pjob->ji_momsubt) { if (pjob->ji_mompost) { pjob->ji_mompost(pjob, exiteval); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } DBPRT(("%s: task %d pid %d exit value %d\n", id, ptask->ti_qs.ti_task, pid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } /* * creat the master pty, this particular * piece of code depends on multiplexor /dev/ptc */ int open_master( char **rtn_name /* RETURN name of slave pts */ ) { int ptc; if ((ptc = open("/dev/ptc", O_RDWR | O_NOCTTY, 0)) < 0) { return (-1); } *rtn_name = ttyname(ptc); /* name of slave side */ return (ptc); } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "MSG", SIGMSG }, { "WINCH", SIGWINCH }, { "PWR", SIGPWR }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, { "PROF", SIGPROF }, { "DANGER", SIGDANGER }, { "VTALRM", SIGVTALRM }, { "MIGRATE", SIGMIGRATE }, { "PRE", SIGPRE }, { "VIRT", SIGVIRT }, { "ALRM1", SIGALRM1 }, { "WAITING", SIGWAITING }, { "KAP", SIGKAP }, { "GRANT", SIGGRANT }, { "RETRACT", SIGRETRACT }, { "SOUND", SIGSOUND }, { "SAK", SIGSAK }, {(char *)0, -1 } }; #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ /* * The following routines are used to load and unload the routing information * for the IBM high speed switch on the SP. Each node must specify the same * connection information. At the end of the job the information is unloaded. */ static int name_to_sw_num(char *nn) { int i; char *pa; char *pb; extern struct swtbl_num swtbl_num[]; extern int ibm_sp2_num_nodes; for (i = 0; i < ibm_sp2_num_nodes; i++) { pa = nn; pb = swtbl_num[i].sw_name; while (*pa && *pb && (*pa == *pb)) { pa++; pb++; } if (((*pa == '\0') && (*pb == '\0')) || ((*pa == '\0') && (*pb == '.')) || ((*pa == '.') && (*pb == '\0'))) return swtbl_num[i].sw_num; } return -1; } static int build_swtbl_array(job *pjob, struct ST_NODE_INFO **psa) { int i; int j; struct ST_NODE_INFO *swtbl; swtbl = (struct ST_NODE_INFO *)calloc(pjob->ji_numvnod, sizeof(struct ST_NODE_INFO)); if (swtbl == NULL) return PBSE_SYSTEM; for (i = 0; i < pjob->ji_numvnod; i++) { /* pull node name out of vnodent/hnodent struct */ (void)strcpy((swtbl + i)->st_node_name, pjob->ji_vnods[i].vn_host->hn_host); /* now find switch node number that matches name */ if ((j = name_to_sw_num((swtbl + i)->st_node_name)) == -1) { (void)free(swtbl); return PBSE_UNKNODE; } (swtbl + i)->st_virtual_task_id = i; (swtbl + i)->st_switch_node_num = j; (swtbl + i)->st_window_id = pjob->ji_vnods[i].vn_index; } *psa = swtbl; return PBSE_NONE; } /* * load_sp_switch - load the IBM SP switch table with the nodes/window_id * to be used by this job. Also write a file into the "aux" directory * with the array of window_ids in task order. This file is used by * pbspd.c to place the correct window_id into the environment based on * the value of MP_CHILD passed by IBM's poe. */ int load_sp_switch(job *pjob) { int i; int rc = 0; struct ST_NODE_INFO *pswa; static char *id = "load_sp_switch"; char buf[MAXPATHLEN+1]; FILE *fwin; extern int internal_state; sscanf(pjob->ji_wattr[(int)JOB_ATR_Cookie].at_val.at_str, "%x", &job_key); if (job_key < 0) job_key = -job_key; if ((rc = build_swtbl_array(pjob, &pswa)) != PBSE_NONE) { sprintf(log_buffer, "build swtbl node array failed %d", rc); log_record(PBSEVENT_DEBUG, 0, id, log_buffer); return -1; } rc = swtbl_load_table(ST_VERSION, pjob->ji_qs.ji_un.ji_momt.ji_exuid, getpid(), job_key, mom_host, pjob->ji_numvnod, pjob->ji_qs.ji_jobid, pswa); if (rc != ST_SUCCESS) { sprintf(log_buffer, "swtbl_load_table failed with %d", rc); log_record(PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); internal_state |= INUSE_DOWN; /* FIXME: need to send state to all servers, not just index 0 */ state_to_server(0, 1); /* tell server we are down */ } else { /* success */ (void)sprintf(buf, "%s/aux/%s.SW", path_home, pjob->ji_qs.ji_jobid); if ((fwin = fopen(buf, "w")) == NULL) { sprintf(log_buffer, "cannot open %s", buf); log_err(errno, id, log_buffer); return -1; } (void)fchmod(fileno(fwin), 0644); for (i = 0; i < pjob->ji_numvnod; i++) fprintf(fwin, "%d\n", pjob->ji_vnods[i].vn_index); (void)fclose(fwin); } (void)free(pswa); return rc; } /* * unload_sp_switch - unload the job/node information from the switch * Also remove the aux *.SW file created when the switch is loaded above. */ void unload_sp_switch(job *pjob) { int i; int rc = 0; char buf[MAXPATHLEN+1]; struct vnodent *pvp; extern int internal_state; for (i = 0; i < pjob->ji_numvnod; ++i) { pvp = &pjob->ji_vnods[i]; if (pvp->vn_host->hn_node == pjob->ji_nodeid) { rc = swtbl_unload_table(ST_VERSION, "css0", pjob->ji_qs.ji_un.ji_momt.ji_exuid, pvp->vn_index); DBPRT(("Unloading switch window %d\n", pvp->vn_index)) if (rc != ST_SUCCESS) { sprintf(log_buffer, "error %d unloading switch table window %d for job %s", rc, pvp->vn_index, pjob->ji_qs.ji_jobid); log_err(PBSE_SYSTEM, "unload_sp_switch", log_buffer); if (rc != ST_SWITCH_NOT_LOADED) { rc = swtbl_clean_table(ST_VERSION, "css0", ST_ALWAYS_KILL, pvp->vn_index); } else if (rc != ST_SUCCESS) { sprintf(log_buffer, "error %d cleaning switch table window %d for job %s", rc, pvp->vn_index, pjob->ji_qs.ji_jobid); log_err(PBSE_SYSTEM, "unload_sp_switch", log_buffer); internal_state |= INUSE_DOWN; /* FIXME: need to send state to all servers, not just index 0 */ state_to_server(0, 1); /* tell server we are down */ } } } } (void)sprintf(buf, "%s/aux/%s.SW", path_home, pjob->ji_qs.ji_jobid); (void)unlink(buf); return; } /* * query_adp - query the SP switch adaptor, are we on line */ void query_adp(void) { int rc; enum ST_ADAPTER_STATUS st; extern int internal_state; static char *id = "query_adp"; if ((rc = swtbl_query_adapter(ST_VERSION, "css0", &st)) != ST_SUCCESS) { if ((internal_state & INUSE_DOWN) == 0) { log_record(PBSEVENT_SYSTEM, rc, id, "cannot query adaptor"); internal_state |= INUSE_DOWN | UPDATE_MOM_STATE; } return; } switch (st) { case ADAPTER_READY: if (internal_state & INUSE_DOWN) { internal_state &= ~INUSE_DOWN; /* we are not down */ internal_state |= UPDATE_MOM_STATE; log_record(PBSEVENT_SYSTEM, 0, id, "adaptor up"); } break; case ADAPTER_NOTREADY: if ((internal_state & INUSE_DOWN) == 0) { /* mark that we are down */ internal_state |= INUSE_DOWN | UPDATE_MOM_STATE; log_record(PBSEVENT_SYSTEM, 0, id, "adaptor down"); } break; } } #endif /* IBM SP */ torque-2.4.16/src/resmom/aix5/mom_mach.h0000664000113300011330000001310411272401243014717 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: aix5 */ #ifndef MOM_MACH #define MOM_MACH "aix5" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #if IBM_SP2==2 /* IBM SP with PSSP 3.1 */ int load_sp_switch A_((job *pjob)); /* load SP2 Switch */ void unload_sp_switch A_((job *pjob)); /* unload SP2 Switch */ #define SWNODEBUFSZ 1024 #define MAX_SW_NODES 1024 struct swtbl_num { char *sw_name; int sw_num; }; extern int ibm_sp2_num_nodes; #endif /* IBM SP */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/aix5/Makefile.in0000664000113300011330000004376411605403745015063 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/aix5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/aix5/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/aix5/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/aix5/pe_input.c0000664000113300011330000001062511272401243014762 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For aix - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/aix5/mom_mach.c0000664000113300011330000016152411272401243014724 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined ( _AIX43 ) #include #include #endif /* AIX43 */ #if IBM_SP2==1 #include #endif #include "pbs_error.h" #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "resmon.h" #include "../rm_dep.h" #include "mom_mach.h" /* ** System dependent code to gather information for the resource ** monitor for an IBM 590 running AIX4. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** ncpus number of cpus ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** */ #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ #if IBM_SP2==1 struct JM_JOB_STATUS *job_tbl = NULL; static int njob = 1; #endif /* IBM_SP2 */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern char *ret_string; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; /* ** local functions */ static char *resi A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); /* ** local resource list storage */ struct config dependent_config[] = { { "resi", {resi} }, { "totmem", {totmem} }, { "physmem", {physmem} }, { "availmem", {availmem} }, { "loadave", {loadave} }, { "ncpus", {ncpus} }, { "walltime", {walltime} }, { NULL, {nullproc} }, }; struct nlist nl[] = { { "avenrun" } }; #define KSYM_LOAD 0 #define ASIZE 10 time_t wait_time = 10; int kd = -1; int proctot = 0; struct procsinfo *proc_tbl = NULL; char **swap_dev = NULL; int nproc = 0; static int nncpus = 0; static uint realmem = 0; static long page_size = 0; extern time_t time_now; extern char extra_parm[]; extern char no_parm[]; char nokernel[] = "kernel not available"; char noproc[] = "process %d does not exist"; #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ struct swtbl_num swtbl_num[MAX_SW_NODES]; int ibm_sp2_num_nodes; static int get_swtbl_num(void) { int i; char buf[SWNODEBUFSZ]; char *lppcmd = "/usr/lpp/ssp/bin/SDRGetObjects Node reliable_hostname switch_node_number"; FILE *pp; char name[SWNODEBUFSZ]; if ((pp = popen(lppcmd, "r")) == 0) return (-1); (void)fgets(buf, SWNODEBUFSZ - 1, pp); /* ignore first line */ for (i = 0; i < MAX_SW_NODES; i++) { if (fgets(buf, SWNODEBUFSZ - 1, pp) == NULL) break; sscanf(buf, "%s %d", name, &swtbl_num[i].sw_num); if (swtbl_num[i].sw_name != NULL) free(swtbl_num[i].sw_name); swtbl_num[i].sw_name = strdup(name); } if (pclose(pp) != 0) return (-1); ibm_sp2_num_nodes = i; return(i); } #endif /* IBM SP2 */ void dep_initialize(void) { char *id = "dep_initialize"; int i, rc, len; char line[200], *dev; char *swapfil = "/etc/swapspaces"; FILE *fil; char *tmpSwapDev; #if defined( _AIX43 ) char *odm_path; struct CuAt *obj; int qty; #else /* AIX43 */ struct nlist ndata; #endif /* AIX43 */ if (swap_dev == NULL) swap_dev = (char **)calloc(10, sizeof(char *)); if (swap_dev == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,id,"cannot alloc memory"); return; } page_size = sysconf(_SC_PAGESIZE); if ((fil = fopen(swapfil, "r")) == NULL) { log_err(errno, id, swapfil); } else { for (i = 0;fgets(line, sizeof(line), fil);) { if (line[0] == '*') continue; len = strlen(line); if (line[len-1] == '\n') line[--len] = '\0'; if ((dev = strstr(line, "/dev/")) == NULL) continue; DBPRT(("%s: swapdev(%d) %s\n", id, i, dev)) tmpSwapDev = realloc(swap_dev,(i + 2) * sizeof(char *)); if (tmpSwapDev == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,id,"cannot alloc memory"); return; } swap_dev = tmpSwapDev; swap_dev[i++] = strdup(dev); } /* END for (i) */ swap_dev[i] = NULL; fclose(fil); } /* END else ((fil = fopen(swapfil,"r")) == NULL) */ if ((kd = open("/dev/kmem", O_RDONLY)) == -1) { log_err(errno, id, "open"); return; } /* ensure /dev/kmem closed on exec */ if ((i = fcntl(kd, F_GETFD)) == -1) { log_err(errno, id, "F_GETFD"); } i |= FD_CLOEXEC; if (fcntl(kd, F_SETFD, i) == -1) { log_err(errno, id, "F_SETFD"); } proc_tbl = malloc(ASIZE * sizeof(struct procsinfo)); proctot = ASIZE; rc = knlist(nl, sizeof(nl) / sizeof(struct nlist), sizeof(struct nlist)); if (rc == -1) { log_err(errno, id, "knlist"); return; } #ifdef DEBUG for (i = 0;i < sizeof(nl) / sizeof(struct nlist);i++) { printf("%s: %s @ %x\n", id, nl[i].n_name, nl[i].n_value); } #endif /* DEBUG */ #if defined(_AIX43) /* The following code works for AIX 4.3 * Supplied by Lloyd Caldwell, U of Utah */ /* changes for AIX 5 (VPAC) */ /* NOTE: was 'odm_initialize() == 0' */ if ((odm_path = odm_set_path("/etc/objrepos")) != (char *) - 1) { /* NOTE: obj is alloc'd */ obj = getattr("sys0", "realmem", 0, &qty); if (obj == NULL) { log_err(odmerrno, id, "odm_set_path"); } else { realmem = atoi(obj->value); /* in KB */ free(obj); } free(odm_path); /* removed with introduction of odm_set_path() (VPAC) */ /* if (odm_terminate()) log_err(odmerrno,id,"odm_terminate for realmem"); */ } else { /* NOTE: should realmem be initialized? */ log_err(odmerrno, id, "odm_set_path for realmem"); } #else /* AIX43 */ /* * This code works for AIX 4.1 and 4.2 * The size of real memory is stored in the 10th location (uint big each) * of undocumented kernel structure "vmker". * * Author: Wendy Lin, PUCC, May 1998 */ ndata.n_name = "vmker"; if ((knlist(&ndata, 1, sizeof(struct nlist)) == -1) || (kvm_read(kd, ndata.n_value + sizeof(uint) * 9, &realmem, sizeof(realmem)) != sizeof(realmem))) { log_err(errno, id, "kvm_read of realmem"); realmem = 0; } else { realmem = realmem * 4; /* now in KB */ } #endif /* AIX43 */ #if IBM_SP2==2 /* IBM SP2 with PSSP 3.1 */ if (get_swtbl_num() < 1) { log_err(PBSE_SYSTEM, id, "Unable to obtain node switch numbers from SDR, exiting"); exit(1); } #endif /* IBM SP2 */ nncpus = sysconf(_SC_NPROCESSORS_ONLN); return; } /* END dep_initialize() */ void dep_cleanup(void) { char *id = "dep_cleanup"; int i; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); close(kd); kd = -1; if (proc_tbl) { free(proc_tbl); proc_tbl = NULL; } if (swap_dev) { for (i = 0; swap_dev[i]; i++) { free(swap_dev[i]); swap_dev[i] = NULL; } } } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { #if IBM_SP2==2 query_adp(); #endif /*IBM_SP2 */ } /* * Time decoding macro. Accepts a timeval structure. Returns unsigned long * time in seconds. */ #define tv(val) (ulong)((val).tv_sec) /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For AIX, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } static int injob(pjob, sesid) job *pjob; pid_t sesid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) return TRUE; } return FALSE; } /* * Internal session cpu time decoding routine. * * Accepts a session id. Returns the sum of all cpu time consumed for all * tasks executed by the job, in seconds, adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { char *id = "cput_ses"; int i; unsigned long cputime; int nps = 0; cputime = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; nps++; DBPRT(("%s: pid=%d", id, pp->pi_pid)) if (pp->pi_state == SZOMB) { DBPRT((" (zombie)")) cputime += (pp->pi_utime + pp->pi_stime); } else { DBPRT((" (active)")) cputime += tv(pp->pi_ru.ru_utime) + tv(pp->pi_ru.ru_stime) + tv(pp->pi_cru.ru_utime) + tv(pp->pi_cru.ru_stime); } DBPRT((" total=%lu\n", cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Internal session memory usage function. * * Accepts a session ID. Returns the total number of bytes of address * space consumed by all current tasks within the job. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_ses"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; memsize += ctob(pp->pi_size); DBPRT(("%s: pid=%d size=%lu\n", id, pp->pi_pid, memsize)) } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_ses"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; if (pp->pi_state == SZOMB) continue; memsize += (pp->pi_drss == -1) ? 0 : ctob(pp->pi_drss); memsize += (pp->pi_trss == -1) ? 0 : ctob(pp->pi_trss); DBPRT(("%s: pid=%d size=%lu\n", id, pp->pi_pid, memsize)) } return (memsize); } /* * Return TRUE if any process in the job is over limit for memory usage. */ static int overmem_proc(job *pjob, unsigned long limit) { int i; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; if (ctob(pp->pi_size) > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((int)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * */ int mom_open_poll(void) { char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) proc_tbl = malloc(ASIZE * sizeof(struct procsinfo)); proctot = ASIZE; return (PBSE_NONE); } #if IBM_SP2==1 #define JMRETRY 2 /* ** Get job manager info. ** Return the number of jobs or -1 on error; */ int getjobstat(void) { char *id = "getjobstat"; int cnt; int sock; if (job_tbl) jmq_jobs_free(&job_tbl, njob); njob = 0; for (cnt = 0; cnt < JMRETRY; cnt++) { if ((sock = jm_connect_ub(NULL)) >= 0) break; switch (errno) { case EINTR: break; default: log_err(errno, id, "jm_connect_ub failed"); return -1; } } if (cnt == JMRETRY) { log_err(errno, id, "jm_connect_ub retry exhausted"); return -1; } for (cnt = 0; cnt < JMRETRY; cnt++) { DBPRT(("%s: jm socket %d cnt %d\n", id, sock, cnt)) if ((njob = jmq_jobs_status(sock, &job_tbl)) >= 0) break; sprintf(log_buffer, "jmq_jobs_status failed %d", njob); log_err(errno, id, log_buffer); log_buffer[0] = '\0'; } jm_disconnect(sock); /* SDRCloseSession(); */ #ifdef DEBUG { int i, j, k; for (i = 0; i < njob; i++) { struct JM_JOB_STATUS *jp = &job_tbl[i]; printf("-------------------------------\n"); printf("name: %s\n", jp->jm_user_name); printf("desc: %s\n", jp->jm_job_description); printf("%s pid=%d id=%d type=%d ncpus=%d\n", jp->jm_time_allocated, jp->jm_client_pid, jp->jm_job_id, jp->jm_adapter_type, jp->jm_num_nodes); for (j = 0; j < jp->jm_num_nodes; j++) { struct JM_NODE_IN_JOB *np = &jp->jm_node_in_job[j]; printf("\t+++++++++++++++++++\n"); printf("\tnode %s\n", np->jm_node_name); printf("\tusage=(%d/%d) tasks=%d\n\t", np->jm_cpu_usage, np->jm_adapter_usage, np->jm_num_virtual_tasks); for (k = 0; k < np->jm_num_virtual_tasks; k++) { int vid = np->jm_virtual_task_ids[k]; printf("(%d) ", vid); } printf("\n"); } } } #endif /* DEBUG */ return njob; } /* * Internal session number of cpu decoding routine. * * Accepts a job pointer. Returns TRUE if the nodes used * by any session fall outside those allowed. */ static unsigned long nodes_ses(job *pjob) { char *id = "nodes_ses"; int i, j, k; resource *pres; char *nodes; char *badnodes = ""; DBPRT(("%s: entered\n", id)) /* ** The variable "nodes" is the string of plus sign separated ** node names specified by the server. ** We want to check the nodes used by any process in the job ** to these and return TRUE if they are not a subset. */ nodes = pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (!injob(pjob, pp->pi_sid)) continue; /* ** found a process in the job ** loop to see if any JM job shows this ** proc as its client pid */ DBPRT(("%s: pid=%d\n", id, pp->pi_pid)) for (j = 0; j < njob; j++) { struct JM_JOB_STATUS *jp = &job_tbl[j]; int len, hit; char *end; if (jp->jm_client_pid != pp->pi_pid) continue; /* ** the plot thickens ** a JM job has been found to be part of this session ** check to see if the nodes associated with ** the job are shown in "nodes" */ DBPRT(("%s: job pid %d nodes %d\n", id, pp->pi_pid, jp->jm_num_nodes)) hit = 0; for (k = 0; k < jp->jm_num_nodes; k++) { struct JM_NODE_IN_JOB *np = &jp->jm_node_in_job[k]; /* ** if we find a match, everything is okay, ** the job is staying within its limits */ if (match(np->jm_node_name, nodes)) continue; /* ** if we get here without a match ** a node being used in the actual job ** was compared to every node this ** job is allowed to use (nodes) ** and it was not in the set */ hit = 1; /* ** see if this node is already listed ** in the "badnodes" list */ if (match(np->jm_node_name, badnodes)) continue; /* ** not in the "badnodes" list so we need ** to add it */ if ((len = strlen(badnodes)) == 0) { badnodes = strdup(np->jm_node_name); continue; } badnodes = realloc(badnodes, len + strlen(np->jm_node_name) + 4); strcat(badnodes, "+"); strcat(badnodes, np->jm_node_name); } if (hit == 0) continue; sprintf(log_buffer, "rouge pid %d using node(s) %s", jp->jm_client_pid, jp->jm_node_in_job[0].jm_node_name); for (k = 1; k < jp->jm_num_nodes; k++) { struct JM_NODE_IN_JOB *np = &jp->jm_node_in_job[k]; int n = strlen(log_buffer); end = &log_buffer[n]; sprintf(end, "+%s", np->jm_node_name); } log_record(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } } if (strlen(badnodes)) { sprintf(log_buffer, "node(s) %.450s outside allowed list %.450s", badnodes, nodes); DBPRT(("%s: %s\n", id, log_buffer)) free(badnodes); return(TRUE); } else return (FALSE); } #endif /* IBM_SP2 */ /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { char *id = "mom_get_sample"; struct procsinfo *pp; int num, addnum; pid_t pid; DBPRT(("%s: entered\n", id)) addnum = proctot; nproc = 0; pid = 0; pp = proc_tbl; while ((num = getprocs(pp, sizeof(struct procsinfo), NULL, sizeof(struct fdsinfo), &pid, addnum)) > 0) { DBPRT(("%s: loop start: got %d\n", id, num)) nproc += num; if (num < addnum) break; proctot += ASIZE; addnum = ASIZE; proc_tbl = realloc(proc_tbl, proctot * sizeof(struct procsinfo)); pp = &proc_tbl[nproc]; } if (num == -1) { log_err(errno, id, "getprocs"); return PBSE_SYSTEM; } DBPRT(("%s: nproc = %d\n", id, nproc)) #if IBM_SP2==1 if (getjobstat() == -1) return PBSE_SYSTEM; #endif /* IBM_SP2 */ return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); DBPRT(("%s: entered\n", id)) #if IBM_SP2==1 if (nodes_ses(pjob)) return (TRUE); #endif /* IBM_SP2 */ pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "vmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && ((num = mem_sum(pjob)) > value)) { sprintf(log_buffer, "vmem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* as KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* as KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a task session. * Call with the job pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { int ct = 0; int i, err; int sesid; sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) return 0; if ((err = mom_get_sample()) != PBSE_NONE) return 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (sesid != pp->pi_sid) continue; DBPRT(("kill_task: send signal %d to pid %d\n", sig, pp->pi_pid)) (void)kill(pp->pi_pid, sig); ++ct; } return ct; } /* * Clean up everything related to polling. * */ int mom_close_poll(void) { DBPRT(("mom_close_poll entered\n")) if (proc_tbl) { free(proc_tbl); proc_tbl = NULL; } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return a -1 on error or sid. */ long mach_restart(task *ptask, char *file) { return (-1); } int kvm_read(int fd, long addr, char *buf, int size) { int ret; if (lseek(fd, addr, SEEK_SET) != addr) return -1; if ((ret = read(fd, buf, size)) == -1) return -1; return ret; } int getproctab(void) { static uint lastproc = 0; char *id = "getproctab"; if (lastproc == reqnum) /* don't need new proc table */ return nproc; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return(nproc); } double dsecs(struct timeval *val) { return ((double)val->tv_sec + (double)val->tv_usec*1e-6); } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int i, nproc; int found = 0; double cputime, addtime; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; found = 1; DBPRT(("%s: pid=%d", id, pp->pi_pid)) if (pp->pi_state == SZOMB) { DBPRT((" (zombie)")) addtime = dsecs(&pp->pi_utime) + dsecs(&pp->pi_stime); } else { DBPRT((" (active)")) addtime = dsecs(&pp->pi_ru.ru_utime) + dsecs(&pp->pi_ru.ru_stime) + dsecs(&pp->pi_cru.ru_utime) + dsecs(&pp->pi_cru.ru_stime); } cputime += addtime; DBPRT((" %.2f total=%.2f\n", addtime, cputime)) } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_proc"; int i, nproc; int found = 0; double cputime; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pid != pp->pi_pid) continue; DBPRT(("%s: pid=%d", id, pp->pi_pid)) if (pp->pi_state == SZOMB) { DBPRT((" (zombie)")) cputime = dsecs(&pp->pi_utime) + dsecs(&pp->pi_stime); } else { DBPRT((" (active)")) cputime = dsecs(&pp->pi_ru.ru_utime) + dsecs(&pp->pi_ru.ru_stime) + dsecs(&pp->pi_cru.ru_utime) + dsecs(&pp->pi_cru.ru_stime); } DBPRT((" %.2f\n", cputime)) found = 1; break; } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int i, nproc; int memsize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; found = 1; memsize += pp->pi_size; DBPRT(("%s: pid %d memsize %d pi_size %d\n", id, pp->pi_pid, memsize, pp->pi_size)) } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; int i, nproc; int memsize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pid != pp->pi_pid) continue; found = 1; memsize = pp->pi_size; break; } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * ncpus(struct rm_attribute *attrib) { if (attrib) { log_err(-1, "ncpus", extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%d", nncpus); system_ncpus = nncpus; return ret_string; } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int i, nproc; int resisize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; found = 1; if (pp->pi_state == SZOMB) continue; resisize += pp->pi_drss + pp->pi_trss; DBPRT(("%s: pid=%d size=%d\n", id, pp->pi_pid, resisize)) } if (found) { sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { char *id = "resi_proc"; int i, nproc; int resisize; int found = 0; if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pid != pp->pi_pid) continue; found = 1; if (pp->pi_state == SZOMB) break; resisize = pp->pi_drss + pp->pi_trss; DBPRT(("%s: pid=%d size=%d\n", id, pp->pi_pid, resisize)) break; } if (found) { sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int nproc; int i, j; char *fmt; int njids = 0; pid_t *jids, jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((jids = calloc(nproc, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for session */ for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (pp->pi_suid == 0) continue; jobid = pp->pi_sid; if (jobid == 0) continue; DBPRT(("%s: pid %d sid %u\n", id, pp->pi_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ jids[njids++] = jobid; /* so add it to list */ } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", jids[j]); else sprintf(fmt, " %d", jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int nproc; int i; char *fmt; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (jobid != pp->pi_sid) continue; checkret(&fmt, 100); sprintf(fmt, " %d", pp->pi_pid); fmt += strlen(fmt); num_pids++; DBPRT(("%s[%d]: pid %d sid %u\n", id, num_pids, pp->pi_pid, pp->pi_sid)) } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int nproc; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if ((uid = pp->pi_suid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, pp->pi_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } uint swap_free; uint swap_size; int getswap(char *id) { static unsigned int lastai = 0; int i; struct pginfo pginfo; if (lastai == reqnum) /* already have anoninfo */ return 0; swap_free = swap_size = 0; for (i = 0; swap_dev[i]; i++) { if (swapqry(swap_dev[i], &pginfo) == -1) { log_err(errno, id, swap_dev[i]); continue; } swap_free += pginfo.free; swap_size += pginfo.size; } lastai = reqnum; return 0; } static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; ulong tmem; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getswap(id)) return NULL; sprintf(ret_string, "%lukb", (swap_size * page_size) >> 10); /* KB */ return ret_string; } static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getswap(id)) return NULL; sprintf(ret_string, "%lukb", (swap_free * page_size) >> 10); /* KB */ return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bavail) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) { DBPRT(("%s: prev %d curr %d\n", dev, maxtm, sb.st_atime)) maxtm = sb.st_atime; } return; } int interesting(char *name) { static char *list[] = { "kbd", "mouse", "pty", "tty", NULL }; char **el; if (name == NULL || *name == '.') return 0; for (el = list; *el; el++) { if (strncmp(name, *el, strlen(*el)) == 0) return 1; } return 0; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (!interesting(de->d_name)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); if ((maxtm < curtm) && ((dp = opendir("/dev/pts")) != NULL)) { while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (de->d_name[0] == '.') continue; sprintf(ttyname, "/dev/pts/%s", de->d_name); setmax(ttyname); } closedir(dp); } sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; pid_t value; int i, nproc, job, found = 0; time_t now, start; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getproctab()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { struct procsinfo *pp = &proc_tbl[i]; if (pp->pi_state == SNONE) continue; if (job) { if (value != pp->pi_sid) continue; } else { if (value != pp->pi_pid) continue; } found = 1; DBPRT(("%s: pid %d start %d\n", id, pp->pi_pid, pp->pi_start)) start = MIN(start, pp->pi_start); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * physmem(struct rm_attribute *attrib) { if (attrib) { log_err(-1, "physmem", extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%lukb", realmem); return (ret_string); } #define FSCALE (1<<16) int get_la( double *rv) { char *id = "get_la"; long load[3]; if (kd == NULL) { log_err(-1, id, nokernel); return (rm_errno = RM_ERR_SYSTEM); } if (kvm_read( kd, nl[KSYM_LOAD].n_value, (char *)&load, sizeof(load)) != sizeof(load)) { log_err(errno, id, "kvm_read"); return (rm_errno = RM_ERR_SYSTEM); } if (load[0] != 0) *rv = (double)load[0] / FSCALE; else *rv = (double)load[1] / FSCALE; return 0; } /* END get_la() */ #if IBM_SP2==1 /* * dummy synbol for unknown IBM job manager routine, * wish IBM would give out some information about it... */ void ppslog(void) { } /* ** Check that node_name matches one of the names in node_list ** separated by '+'s. The match is only done up to the first ** '.' character. ** Return 1 for a match and 0 for no match. */ int match(char *node_name, char *node_list) { char *cp, *name; /* ** start a loop through "node_list" ** making one pass only */ name = node_name; cp = node_list; while (*cp) { /* ** step through both name and ** nodes matching each char */ for (; *name; name++, cp++) { if (*name != *cp) break; } /* ** once we are done with the ** test loop above, check ** to see if a match is found ** by having gotten to the ** end of name and the end ** of one node name in "node_list" */ if ((*name == '\0' || *name == '.') && (*cp == '+' || *cp == '\0' || *cp == '.')) return 1; /* ** if we get here, there was no match ** skip the rest of the node name ** (and plus sign) and reset name to ** the one we are looking for */ while (*cp != '+' && *cp != '\0') cp++; if (*cp == '+') cp++; name = node_name; } return 0; } #endif /* IBM_SP2 */ void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/aix5/Makefile.am0000664000113300011330000000030611272401243015022 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/freebsd5/0000777000113300011330000000000011614035172013706 500000000000000torque-2.4.16/src/resmom/freebsd5/mom_start.c0000664000113300011330000003036511272401243016000 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" #if 0 static char ident[] = "@(#) $RCSfile$ $Revision: 524 $"; #endif /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; extern int LOGLEVEL; /* Private variables */ #define TMAX_TJCACHESIZE 128 job *TJCache[TMAX_TJCACHESIZE]; /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. * * Return: session/job id or if error: * -1 - if setsid() fails * -2 - if other, message in log_buffer */ int set_job(job *pjob, struct startjob_rtn *sjr) { return (sjr->sj_session = setsid()); } /* ** set_globid - set the global id for a machine type. */ void set_globid(job *pjob, struct startjob_rtn *sjr) { extern char noglobid[]; if (pjob->ji_globid == NULL) pjob->ji_globid = strdup(noglobid); } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars( job *pjob, /* pointer to the job */ struct var_table *vtab /* pointer to variable table */ ) { return 0; } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for a task whose * session id matched that of a terminated child pid. Mark that * task as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval = 0; pid_t pid; job *pjob; task *ptask = 0; int statloc; if (LOGLEVEL >= 7) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, "entered"); } /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_PRIOR(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_PRIOR(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { pjob = (job *)GET_PRIOR(svr_alljobs); while (pjob) { if (LOGLEVEL >= 7) { snprintf(log_buffer, 1024, "checking job w/subtask pid=%d (child pid=%d)", pjob->ji_momsubt, pid); LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } /* ** see if process was a child doing a special ** function for MOM */ if (pid == pjob->ji_momsubt) break; /* ** look for task */ ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == pid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_PRIOR(pjob->ji_alljobs); } if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; if (pjob == NULL) { if (LOGLEVEL >= 1) { sprintf(log_buffer, "pid %d not tracked, exitcode=%d", pid, exiteval); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, log_buffer); } continue; } if (pid == pjob->ji_momsubt) { /* PID matches job mom subtask */ log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "checking job post-processing routine"); if (pjob->ji_mompost) { if (pjob->ji_mompost(pjob, exiteval) == 0) { /* success */ pjob->ji_mompost = 0; } } else { if (LOGLEVEL >= 7) { LOG_EVENT( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "No post processing routine for job"); } } /* clear mom sub-task */ pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); continue; } /* END if (pid == pjob->ji_momsubt) */ if (LOGLEVEL >= 2) { sprintf(log_buffer, "for job %s, task %d, pid=%d, exitcode=%d", pjob->ji_qs.ji_jobid, ptask->ti_qs.ti_task, pid, exiteval); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, id, log_buffer); } kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; pjob->ji_qs.ji_un.ji_momt.ji_exitstat = exiteval; task_save(ptask); sprintf(log_buffer, "%s: job %s task %d terminated, sid=%d", id, pjob->ji_qs.ji_jobid, ptask->ti_qs.ti_task, ptask->ti_qs.ti_sid); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } /* END while ((pid = waitpid(-1,&statloc,WNOHANG)) > 0) */ return; } /* END scan_for_terminated() */ /* * creat the master pty, this particular * piece of code does it the hard way, it searches */ #define PTY_SIZE 12 int open_master( char **rtn_name /* RETURN name of slave pts */ ) { char *pc1; char *pc2; int ptc; /* master file descriptor */ static char ptcchar1[] = "pqrs"; static char ptcchar2[] = "0123456789abcdef"; static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ (void)strncpy(pty_name, "/dev/ptyXY", PTY_SIZE); for (pc1 = ptcchar1; *pc1 != '\0'; ++pc1) { pty_name[8] = *pc1; for (pc2 = ptcchar2; *pc2 != '\0'; ++pc2) { pty_name[9] = *pc2; if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } return (-1); /* tried all entries, give up */ } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "ABRT", SIGABRT }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "BUS", SIGBUS }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "URG", SIGURG }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "CHLD", SIGCHLD }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "IO", SIGIO }, { "XCPU", SIGXCPU }, { "XFSZ", SIGXFSZ }, { "VTALRM", SIGVTALRM }, { "PROF", SIGPROF }, { "WINCH", SIGWINCH }, { "INFO", SIGINFO }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; torque-2.4.16/src/resmom/freebsd5/mom_mach.h0000664000113300011330000001241011272401243015547 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: freebsd5 */ #ifndef MOM_MACH #define MOM_MACH "freebsd5" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/freebsd5/Makefile.in0000664000113300011330000004400011605403747015676 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/freebsd5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/freebsd5/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/freebsd5/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/freebsd5/pe_input.c0000664000113300011330000001065011272401243015611 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #if 0 static char ident[] = "@(#) $RCSfile$ $Revision: 5 $"; #endif /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For the FreeBSD - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/freebsd5/mom_mach.c0000664000113300011330000014117611413217001015550 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** System dependent code to gather information for a FreeBSD machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** resi resident memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** ncpus number of cpus ** nsessions number of sessions in the system ** nusers number of users in the system ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** walltime wall clock time for a pid ** loadave current load average ** quota quota information (sizes in KB) */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "pbs_error.h" #include "log.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" #include "resmon.h" #include "../rm_dep.h" #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; extern int ignvmem; extern int ignmem; extern int LOGLEVEL; extern void checkret(char **, int); /* ** local functions */ static char *resi A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *walltime A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); static char *ncpus A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); struct config dependent_config[] = { { "resi", {resi} }, { "physmem", {physmem} }, { "ncpus", {ncpus} }, { "loadave", {loadave} }, { "walltime", {walltime} }, { "quota", {quota} }, { NULL, {nullproc} }, }; struct nlist nl[] = { { {"_anoninfo"}, 0, 0, 0, 0 }, /* 0 */ { {"_cnt"}, 0, 0, 0, 0 }, /* 1 */ { {"_averunnable"}, 0, 0, 0, 0 }, /* 2 */ { {""}, 0, 0, 0, 0 } }; #define KSYM_ANON 0 #define KSYM_PHYS 1 #define KSYM_LOAD 2 time_t wait_time = 10; kvm_t *kd = NULL; struct kinfo_proc *proc_tbl = NULL; pid_t *sess_tbl = NULL; int nproc = 0; extern char *ret_string; extern char extra_parm[]; extern char no_parm[]; char nokernel[] = "kernel not available"; char noproc[] = "process %d does not exist"; static int nncpus = 0; void dep_initialize(void) { char *id = "dep_initialize"; int mib[2]; size_t len; if (kd == NULL) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "resmom"); if (kd == NULL) { log_err(errno, id, "kvm_open"); return; } } if (kvm_nlist(kd, nl) == -1) { log_err(errno, id, "kvm_nlist"); return; } mib[0] = CTL_HW; /* get number of processors */ mib[1] = HW_NCPU; len = sizeof(nncpus); (void)sysctl(mib, 2, &nncpus, &len, NULL, 0); return; } void dep_cleanup(void) { char *id = "dep_cleanup"; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); if (kd) kvm_close(kd); kd = NULL; } /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { /* No periodic functions. */ } extern time_t time_now; /* * Time decoding macro. Accepts a timeval structure. Returns unsigned long * time in seconds. */ #define tv(val) ((val).tv_sec+((unsigned long)(val).tv_usec+500000)/1000000) #if __FreeBSD_version >= 300000 /* a u_int64_t in micro-seconds */ #define tvk(val) ((unsigned long)(val)/1000000) #define p_rtime p_runtime #else #define tvk tv #endif /* __FreeBSD_version */ /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For FreeBSD, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* ** Scan a list of tasks and return true if one of them matches ** the process (sid or pid) represented by *psp. */ static int injob(pjob, sesid) job *pjob; pid_t sesid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) return TRUE; } return FALSE; } #define MINPROC 10 #define MAXPROC 10000 /* * Internal session cpu time decoding routine. * * Accepts a job id. Returns the sum of all cpu time consumed for all * tasks executed by the job, in seconds, adjusted by cputfactor. */ static unsigned long cput_sum(job *pjob) { static char id[] = "cput_sum"; int i; u_long cputime; int nps = 0; cputime = 0; if (LOGLEVEL >= 7) { sprintf(log_buffer,"proc_array loop start - jobid = %s", pjob->ji_qs.ji_jobid); log_record(PBSEVENT_DEBUG,0,id,log_buffer); } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; nps++; cputime += pp->ki_runtime / 1000000; if (LOGLEVEL >= 7) { sprintf(log_buffer,"%s: session=%d pid=%d cputime=%llu", id, sess_tbl[i], pp->ki_pid, (long long unsigned)pp->ki_runtime / 1000000); log_record(PBSEVENT_SYSTEM,0,id,log_buffer); } DBPRT(("%s: ses %d pid %d cputime %llu\n", id, sess_tbl[i], pp->ki_pid, (long long unsigned)pp->ki_runtime / 1000000)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } /* * Internal session memory usage function. * * Accepts a job ID. Returns the total number of bytes of address * space consumed by all current tasks within the job. */ static unsigned long mem_sum(job *pjob) { char *id = "mem_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; memsize += pp->ki_size; DBPRT(("%s: ses %d pid=%d totmem=%lu\n", id, sess_tbl[i], pp->ki_pid, (long unsigned)pp->ki_size)) } return (memsize); } /* * Internal session mem (workingset) size function. */ static unsigned long resi_sum(job *pjob) { char *id = "resi_sum"; int i; unsigned long memsize; memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; memsize += pp->ki_rssize * PAGE_SIZE; DBPRT(("%s: pid=%d ses=%d mem=%lu totmem=%lu\n", id, pp->ki_pid, sess_tbl[i], (long unsigned)pp->ki_rssize * PAGE_SIZE, memsize)) } return (memsize); } /* * Return TRUE if any task in the job is over limit for memory usage. */ static int overmem_proc(job *pjob, unsigned long limit) { int i; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (!injob(pjob, sess_tbl[i])) continue; if (pp->ki_size > limit) return (TRUE); } return (FALSE); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * Establish system-enforced limits for the job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Cannot alter those set by setrlimit (kernel) * because we are the wrong process. */ int mom_set_limits( job *pjob, int set_mode /* SET_LIMIT_SET or SET_LIMIT_ALTER */ ) { char *id = "mom_set_limits"; char *pname; int retval; unsigned long value; /* place in which to build resource value */ resource *pres; struct rlimit reslim; unsigned long mem_limit = 0; log_buffer[0] = '\0'; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately (SET_LIMIT_SET). */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { /* cpu time - check, if less than pcput use it */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { /* process cpu time - set */ retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = (unsigned long)((double)value / cputfactor); if (setrlimit(RLIMIT_CPU, &reslim) < 0) return (error("RLIMIT_CPU", PBSE_SYSTEM)); } } else if (strcmp(pname, "file") == 0) /* set */ { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_FSIZE, &reslim) < 0) return (error(pname, PBSE_SYSTEM)); } } else if (strcmp(pname, "vmem") == 0) /* check */ { if (ignvmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } else if (strcmp(pname, "pvmem") == 0) /* set */ { if (ignvmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > ULONG_MAX) return (error(pname, PBSE_BADATVAL)); if ((mem_limit == 0) || (value < mem_limit)) mem_limit = value; } } } else if (strcmp(pname, "mem") == 0) /* ignore */ { } else if (strcmp(pname, "pmem") == 0) /* set */ { if (ignmem == FALSE) { if (set_mode == SET_LIMIT_SET) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); reslim.rlim_cur = reslim.rlim_max = value; if (setrlimit(RLIMIT_RSS, &reslim) < 0) return (error("RLIMIT_RSS", PBSE_SYSTEM)); } } } else if (strcmp(pname, "walltime") == 0) /* Check */ { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "nice") == 0) /* set nice */ { if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice((time_t)pres->rs_value.at_val.at_long) == -1) && (errno != 0)) return (error(pname, PBSE_BADATVAL)); } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and not marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } if (set_mode == SET_LIMIT_SET) { /* if either of vmem or pvmem was given, set sys limit to lesser */ if (mem_limit != 0) { reslim.rlim_cur = reslim.rlim_max = mem_limit; if ((ignvmem == 0) && (setrlimit(RLIMIT_DATA, &reslim) < 0)) return (error("RLIMIT_DATA", PBSE_SYSTEM)); if ((ignvmem == 0) && (setrlimit(RLIMIT_STACK, &reslim) < 0)) return (error("RLIMIT_STACK", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "walltime") == 0 || strcmp(pname, "cput") == 0 || strcmp(pname, "pvmem") == 0 || strcmp(pname, "vmem") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { char *id = "mom_open_poll"; log_record(PBSEVENT_SYSTEM, 0, id, "entered"); if (kd == NULL) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "mom"); if (kd == NULL) { log_err(errno, id, "kvm_open"); return (PBSE_SYSTEM); } } if (kvm_nlist(kd, nl) == -1) { log_err(errno, id, "kvm_nlist"); return (PBSE_SYSTEM); } return (PBSE_NONE); } int qs_cmp( const void *a, const void *b) { return((int)(((struct kinfo_proc *)a)->ki_paddr - ((struct kinfo_proc *)b)->ki_paddr)); } /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { char *id = "mom_get_sample"; int i; DBPRT(("%s: entered\n", id)) if (sess_tbl) free(sess_tbl); if (kd == NULL) return (PBSE_INTERNAL); proc_tbl = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); if (proc_tbl == NULL) { sprintf(log_buffer, "kvm_getprocs: %s", kvm_geterr(kd)); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } sess_tbl = (pid_t *)calloc(nproc, sizeof(pid_t)); if (sess_tbl == NULL) { sprintf(log_buffer, "can't allocate memory for session table"); log_err(errno, id, log_buffer); return (PBSE_SYSTEM); } qsort(proc_tbl, nproc, sizeof(struct kinfo_proc), qs_cmp); for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; sess_tbl[i] = pp->ki_sid; } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { char *id = "mom_over_limit"; char *pname; int retval; unsigned long value, num; resource *pres; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered\n", id)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((igncput == FALSE) && (strcmp(pname, "cput") == 0)) { retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cput_sum(pjob)) > value) { sprintf(log_buffer, "cput %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "mem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((num = mem_sum(pjob)) > value) { sprintf(log_buffer, "mem %lu exceeded limit %lu", num, value); return (TRUE); } } else if (strcmp(pname, "pvmem") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) continue; if ((ignvmem == 0) && (overmem_proc(pjob, value))) { sprintf(log_buffer, "pvmem exceeded limit %lu", value); return (TRUE); } } else if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)(wallfactor * (double)(time_now - pjob->ji_qs.ji_stime)); if (num > value) { sprintf(log_buffer, "walltime %lu exceeded limit %lu", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. * * Assumes that the session ID attribute has already been set. */ int mom_set_use(job *pjob) { resource *pres; attribute *at; resource_def *rd; unsigned long *lp, lnum; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; pres->rs_value.at_val.at_long = 0; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); assert(pres != NULL); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; pres->rs_value.at_val.at_size.atsv_num = 0; } rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (unsigned long *) & pres->rs_value.at_val.at_long; lnum = cput_sum(pjob); *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "vmem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (mem_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_size.atsv_num; lnum = (resi_sum(pjob) + 1023) >> 10; /* in KB */ *lp = MAX(*lp, lnum); return (PBSE_NONE); } /* * Kill a job task. * Call with the job and a signal number. */ int kill_task(task *ptask, int sig, int pg) { char *id = "kill_task"; int ct = 0; int i, err; int sesid; DBPRT(("%s entered\n", id)) sesid = ptask->ti_qs.ti_sid; if (sesid <= 1) { if (LOGLEVEL >= 3) { sprintf(log_buffer,"cannot send signal %d to task (no session id)", sig); log_record( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } /* FAILURE */ return(0); } if (LOGLEVEL >= 5) { sprintf(log_buffer,"sending signal %d to task", sig); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } if ((err = mom_get_sample()) != PBSE_NONE) return 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (sesid != sess_tbl[i]) continue; if (LOGLEVEL >= 5) { sprintf(log_buffer,"%s: killing pid %d task %d with sig %d", id, pp->ki_pid, ptask->ti_qs.ti_task, sig); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } (void)kill(pp->ki_pid, sig); ++ct; } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { char *id = "mom_close_poll"; if (LOGLEVEL >= 6) { log_record( PBSEVENT_SYSTEM, 0, id, "entered"); } if (kd) { if (kvm_close(kd) != 0) { log_err(errno, "mom_close_poll", "kvm_close"); return (PBSE_SYSTEM); } kd = NULL; } return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return(CST_NONE); } /* * Checkpoint the job. * * If abort is true, kill it too. */ int mach_checkpoint(task *ptask, char *file, int abort) { return (-1); } /* * Restart the job from the checkpoint file. * * Return -1 on error or sid if okay. */ long mach_restart(task *ptask, char *file) { return (-1); } /* ** Return 1 if proc table can be read, 0 otherwise. */ int getprocs(void) { static unsigned int lastproc = 0; if (lastproc == reqnum) /* don't need new proc table */ return 1; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return 1; } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int i; unsigned long cputime; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer,"proc_array loop start - jobid = %d", jobid); log_record(PBSEVENT_DEBUG,0,id,log_buffer); } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; cputime += pp->ki_runtime / 1000000; DBPRT(("%s: ses %d pid %d cputime %lu\n", id, jobid, pp->ki_pid, cputime)) } sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } char * cput_proc(pid) pid_t pid; { char *id = "cput_proc"; uint cputime; int i; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->ki_pid) continue; cputime = pp->ki_runtime / 1000000; DBPRT(("%s: pid %d cputime %d\n", id, pid, cputime)) sprintf(ret_string, "%.2f", (double)cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { int i; int memsize, addmem; int found = 0; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; addmem = pp->ki_size; memsize += addmem; } if (found) { sprintf(ret_string, "%ukb", memsize / 1024); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { int i, memsize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->ki_pid) continue; memsize = pp->ki_size; sprintf(ret_string, "%ukb", memsize / 1024); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } static char * resi_job(jobid) pid_t jobid; { char *id = "resi_job"; int i, found; int resisize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; found = 0; if (LOGLEVEL >= 6) { sprintf(log_buffer,"proc_array loop start - jobid = %d", jobid); log_record(PBSEVENT_DEBUG,0,id,log_buffer); } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (jobid != sess_tbl[i]) continue; found = 1; resisize += pp->ki_rssize * PAGE_SIZE; } if (found) { sprintf(ret_string, "%ukb", resisize / 1024); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi_proc(pid) pid_t pid; { int i; int resisize; if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } resisize = 0; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pid != pp->ki_pid) continue; resisize = pp->ki_rssize * PAGE_SIZE; sprintf(ret_string, "%ukb", resisize / 1024); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } static char * resi(struct rm_attribute *attrib) { char *id = "resi"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (resi_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (resi_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; int i, j; char *fmt; int njids = 0; pid_t *jids, jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((jids = (pid_t *)calloc(nproc, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for job */ for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (pp->ki_ruid == 0) continue; jobid = sess_tbl[i]; DBPRT(("%s: pid %d sid %u\n", id, (int)pp->ki_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ jids[njids++] = jobid; /* so add it to list */ } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 0; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; int i; char *fmt; int num_pids = 0; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; DBPRT(("%s[%d]: pid %d sid %u\n", id, num_pids, pp->ki_pid, sess_tbl[i])) if (jobid != sess_tbl[i]) continue; checkret(&fmt, 100); sprintf(fmt, " %d", pp->ki_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = (uid_t *)calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if ((uid = pp->ki_ruid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, (int)pp->ki_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { if (attrib) { log_err(-1, "ncpus", extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%d", nncpus); system_ncpus = nncpus; return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; struct vmmeter sum; u_int val; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (kd == NULL) { log_err(-1, id, nokernel); rm_errno = RM_ERR_SYSTEM; return NULL; } if (nl[KSYM_PHYS].n_type == 0) { log_err(-1, id, "vmmeter not found"); rm_errno = RM_ERR_SYSTEM; return 0; } if (kvm_read(kd, nl[KSYM_PHYS].n_value, (char *)&sum, sizeof(sum)) != sizeof(sum)) { log_err(errno, id, "kvm_read"); rm_errno = RM_ERR_SYSTEM; return NULL; } if (sum.v_page_size < 1024) { val = 1024 / sum.v_page_size; val = sum.v_page_count / val; } else { val = sum.v_page_size / 1024; val *= sum.v_page_count; } sprintf(ret_string, "%ukb", val); return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)(((double)fsbuf.f_bsize * (double)fsbuf.f_bavail) / 1024.0)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%llukb", (long long unsigned)sbuf.st_size >> 10); /* in KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax( char *dev) { struct stat sb; char *id = "setmax"; if (stat(dev, &sb) == -1) { return; } if (maxtm < sb.st_atime) { if (LOGLEVEL >= 2) { sprintf(log_buffer, "setmax: dev %s access %ld replaces max %ld\n", dev, (long)sb.st_atime, (long)maxtm); log_record(PBSEVENT_SYSTEM, 0, id, log_buffer); } maxtm = sb.st_atime; } return; } char *idletime( struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); setmax("/dev/mouse"); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%ld", (long)MAX(0, curtm - maxtm)); return ret_string; } static char * walltime(struct rm_attribute *attrib) { char *id = "walltime"; pid_t value; int i, job, found = 0; time_t now, start; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "proc") == 0) job = 0; else if (strcmp(attrib->a_qualifier, "session") == 0) job = 1; else { rm_errno = RM_ERR_BADPARAM; return NULL; } if (getprocs() == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((now = time(NULL)) <= 0) { log_err(errno, id, "time"); rm_errno = RM_ERR_SYSTEM; return NULL; } start = now; for (i = 0; i < nproc; i++) { struct kinfo_proc *pp = &proc_tbl[i]; if (job) { if (value != sess_tbl[i]) continue; } else { if (value != pp->ki_pid) continue; } found = 1; start = MIN(start, pp->ki_start.tv_sec); } if (found) { sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } int get_la(double *rv) { char *id = "get_la"; if (kd == NULL) { log_err(-1, id, nokernel); return (rm_errno = RM_ERR_SYSTEM); } if (kvm_getloadavg(kd, rv, 1) != 1) { log_err(errno, id, "kvm_getloadavg"); return (rm_errno = RM_ERR_SYSTEM); } return 0; } u_long gracetime(u_long secs) { time_t now = time((time_t *)NULL); if ((time_t)secs > now) /* time is in the future */ return (secs - now); else return 0; } static char * quota(struct rm_attribute *attrib) { char *id = "quota"; int type; dev_t dirdev; uid_t uid; struct stat sb; struct fstab *fs; struct dqblk qi; struct passwd *pw; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, type_end }; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] != '/') /* must be absolute path */ { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(attrib->a_value, &sb) == -1) { sprintf(log_buffer, "stat: %s", attrib->a_value); log_err(errno, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } dirdev = sb.st_dev; DBPRT(("dir has devnum %d\n", dirdev)) if (setfsent() == 0) { log_err(errno, id, "setfsent"); rm_errno = RM_ERR_SYSTEM; return NULL; } while ((fs = getfsent()) != NULL) { if (strcmp(fs->fs_type, FSTAB_XX) == 0 || strcmp(fs->fs_type, FSTAB_SW) == 0) continue; if (stat(fs->fs_file, &sb) == -1) { sprintf(log_buffer, "stat: %s", fs->fs_file); log_err(errno, id, log_buffer); continue; } DBPRT(("%s\t%s\t%d\n", fs->fs_spec, fs->fs_file, sb.st_dev)) if (sb.st_dev == dirdev) break; } endfsent(); if (fs == NULL) { sprintf(log_buffer, "filesystem %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "user") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((uid = (uid_t)atoi(attrib->a_value)) == 0) { if ((pw = getpwnam(attrib->a_value)) == NULL) { sprintf(log_buffer, "user not found: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } uid = pw->pw_uid; } if (quotactl(fs->fs_file, Q_GETQUOTA, uid, (char *)&qi) == -1) { log_err(errno, id, "quotactl"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* all sizes in KB */ switch (type) { case harddata: sprintf(ret_string, "%llukb", (long long unsigned)dbtob(qi.dqb_bhardlimit) >> 10); break; case softdata: sprintf(ret_string, "%llukb", (long long unsigned)dbtob(qi.dqb_bsoftlimit) >> 10); break; case currdata: sprintf(ret_string, "%llukb", (long long unsigned)dbtob(qi.dqb_curblocks) >> 10); break; case hardfile: sprintf(ret_string, "%u", qi.dqb_ihardlimit); break; case softfile: sprintf(ret_string, "%u", qi.dqb_isoftlimit); break; case currfile: sprintf(ret_string, "%u", qi.dqb_curinodes); break; case timedata: sprintf(ret_string, "%lu", (long unsigned)gracetime(qi.dqb_btime)); break; case timefile: sprintf(ret_string, "%lu", (long unsigned)gracetime(qi.dqb_itime)); break; } return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/freebsd5/Makefile.am0000664000113300011330000000030611272401243015653 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/resmom/unicos8/0000777000113300011330000000000011614035173013600 500000000000000torque-2.4.16/src/resmom/unicos8/mom_start.c0000664000113300011330000004266411470340444015703 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include "libpbs.h" #include "list_link.h" #include "log.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "mom_mach.h" #include "mom_func.h" static char ident[] = "@(#) $RCSfile$ $Revision: 4237 $"; /* Global Variables */ extern int exiting_tasks; extern char mom_host[]; extern tlist_head svr_alljobs; extern int termin_child; extern time_t time_now; #if SRFS char *fast_dir; char *big_dir; char *tmp_dir; #endif /* * tmpdirname - build a temporary directory name */ char * tmpdirname(char *root, char *sequence) { static char tmpdir[MAXPATHLEN+1]; if (root == NULL) return (NULL); sprintf(tmpdir, "%s/pbs.%s", root, sequence); return (tmpdir); } #define DIR_RETRY 10 /* ** Try to make a directory. If it works, return 0. If ** the name exists, return 1. If it fails for any other reason, ** return -1. */ int makedir(name, uid, gid) char *name; uid_t uid; gid_t gid; { static char id[] = "makedir"; int i; for (i = 0; i < DIR_RETRY; i++) { if (mkdir(name, 01777) == -1) { if (errno == EEXIST) { sleep(1); continue; } sprintf(log_buffer, "mkdir: %s", name); log_err(errno, id, log_buffer); return -1; } if (chown(name, uid, gid) == -1) { sprintf(log_buffer, "chown: %s", name); log_err(errno, id, log_buffer); return -1; } return 0; } sprintf(log_buffer, "mkdir retrys exhausted: %s", name); log_err(errno, id, log_buffer); return 1; } /* * mktmpdir - make temporary directory(s) * Temporary directory(s) are created and the name are * placed in environment variables. If a directory can not be made an * error code is returned. */ int mktmpdir( job *pjob, struct var_table *vtab /* pointer to variable table */ ) { uid_t uid; gid_t gid; char *seq; char *tmpdir; char *pdir; int ret; task *ptask; int tasks; #if SRFS extern char *var_value A_((char *)); #endif uid = pjob->ji_qs.ji_un.ji_momt.ji_exuid; gid = pjob->ji_qs.ji_un.ji_momt.ji_exgid; seq = pjob->ji_qs.ji_jobid; for (ptask = (task *)GET_NEXT(pjob->ji_tasks), tasks = 0; ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask), tasks++); #if SRFS tmpdir = tmpdirname(var_value("TMPDIR"), seq); #else tmpdir = tmpdirname(TMP_DIR, seq); #endif /* SRFS */ if (tasks == 1) { if ((ret = makedir(tmpdir, uid, gid)) != 0) return ret; } bld_env_variables(vtab, "TMPDIR", tmpdir); #if SRFS tmp_dir = strdup(tmpdir); if ((pdir = var_value("BIGDIR")) != NULL) { tmpdir = tmpdirname(pdir, seq); if (tasks == 1) { if ((ret = makedir(tmpdir, uid, gid)) != 0) return ret; } bld_env_variables(vtab, "BIGDIR", tmpdir); big_dir = strdup(tmpdir); } if ((pdir = var_value("FASTDIR")) != NULL) { tmpdir = tmpdirname(var_value("FASTDIR"), seq); if (tasks == 1) { if ((ret = makedir(tmpdir, uid, gid)) != 0) return ret; } bld_env_variables(vtab, "FASTDIR", tmpdir); fast_dir = strdup(tmpdir); } #endif /* SRFS */ return 0; } void rmonedir(char *tmpdir) { static char *id = "rmonedir"; struct stat sb; int pid; char *rm = "/bin/rm"; char *rf = "-rf"; /* Hello, is any body there? */ if (stat(tmpdir, &sb) == -1) { if (errno != ENOENT) { sprintf(log_buffer, "Unable to stat %s", tmpdir); log_err(errno, id, log_buffer); } return; } /* fork and exec the cleamtmp process */ pid = fork(); if (pid < 0) { log_err(errno, id, "Unable to fork"); return; } if (pid > 0) return; execl(rm, "pbs_cleandir", rf, tmpdir, 0); log_err(errno, id, "This is really bad"); exit(1); } /* * rmtmpdir - remove the temporary directory * This may take awhile so the task is forked and execed to another * process. */ void rmtmpdir(char *sequence) #if SRFS { static char *id = "rmtmpdir"; char *tmpdir; int pid, pstat; extern char *var_value A_((char *)); pid = fork(); if (pid < 0) { log_err(errno, id, "Unable to fork"); return; } if (pid > 0) /* parent */ return; /* child */ tmpdir = tmpdirname(var_value("TMPDIR"), sequence); rmonedir(tmpdir); wait(&pstat); tmpdir = tmpdirname(var_value("FASTDIR"), sequence); rmonedir(tmpdir); wait(&pstat); tmpdir = tmpdirname(var_value("BIGDIR"), sequence); rmonedir(tmpdir); wait(&pstat); exit(0); } #else { static char *id = "rmtmpdir"; char *tmpdir; /* Get tmpdir name */ tmpdir = tmpdirname(TMP_DIR, sequence); rmonedir(tmpdir); } #endif /* SRFS */ /* * set_job - set up a new job session * Set session id and whatever else is required on this machine * to create a new job. */ int set_job(job *pjob, struct startjob_rtn *sjr) { uid_t uid = pjob->ji_qs.ji_un.ji_momt.ji_exuid; if ((sjr->sj_session = setjob(uid, WJSIGNAL)) == -1) return (-1); if (sesscntl(sjr->sj_session, S_SETFL, S_BATCH) == -1) return (-1); sjr->sj_pid = getpid(); return (sjr->sj_session); } /* ** set_globid - set the global id for a machine type. */ void set_globid( job *pjob, /* I (modified) */ struct startjob_rtn *sjr) /* I (optional) */ { char cvtbuf[20]; if (sjr != NULL) { sprintf(cvtbuf, "%ld", (long)sjr->sj_pid); } else { cvtbuf[0] = '\0'; } if (pjob->ji_globid) free(pjob->ji_globid); pjob->ji_globid = strdup(cvtbuf); decode_str( &pjob->ji_wattr[JOB_ATR_altid], ATTR_altid, NULL, cvtbuf); pjob->ji_wattr[(int)JOB_ATR_altid].at_flags |= ATR_VFLAG_SEND; return; } /* * set_mach_vars - setup machine dependent environment variables */ int set_mach_vars(job *pjob, struct var_table *vtab) { int ret; /* Add names of temp directories to environment */ ret = mktmpdir(pjob, vtab); switch (ret) { case 0: return 0; case 1: /* old dirs exist, doing remove */ rmtmpdir(pjob->ji_qs.ji_jobid); return JOB_EXEC_RETRY; default: return JOB_EXEC_FAIL1; } } char * set_shell(job *pjob, struct passwd *pwdp) { char *cp; int i; char *shell; struct array_strings *vstrs; /* * find which shell to use, one specified or the login shell */ shell = pwdp->pw_shell; if ((pjob->ji_wattr[(int)JOB_ATR_shell].at_flags & ATR_VFLAG_SET) && (vstrs = pjob->ji_wattr[(int)JOB_ATR_shell].at_val.at_arst)) { for (i = 0; i < vstrs->as_usedptr; ++i) { cp = strchr(vstrs->as_string[i], '@'); if (cp) { if (!strncmp(mom_host, cp + 1, strlen(cp + 1))) { *cp = '\0'; /* host name matches */ shell = vstrs->as_string[i]; break; } } else { shell = vstrs->as_string[i]; /* wildcard */ } } } return (shell); } /* * scan_for_terminated - scan the list of runnings jobs for one whose * session id matched that of a terminated child pid. Mark that * job as Exiting. */ void scan_for_terminated(void) { static char id[] = "scan_for_terminated"; int exiteval; pid_t pid; int sid; job *pjob; task *ptask; int statloc; /* update the latest intelligence about the running jobs; */ /* must be done before we reap the zombies, else we lose the info */ termin_child = 0; if (mom_get_sample() == PBSE_NONE) { pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { mom_set_use(pjob); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } while ((pid = waitpid(-1, &statloc, WNOHANG)) > 0) { #ifdef DEBUG sprintf(log_buffer, "Waitpid = %d", pid); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, "PBS_MOM", log_buffer); #endif /* ** see if process was a child doing a special function for MOM */ pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { if (pid == pjob->ji_momsubt) { if (WIFEXITED(statloc)) statloc = WEXITSTATUS(statloc); else statloc = -1; if (pjob->ji_mompost) { pjob->ji_mompost(pjob, statloc); pjob->ji_mompost = 0; } pjob->ji_momsubt = 0; (void)job_save(pjob, SAVEJOB_QUICK); break; } pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* Now figure out which task(s) have terminated (are zombies) */ while ((sid = waitjob(NULL)) > 0) { sprintf(log_buffer, "Waitjob = %d", sid); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, "PBS_MOM", log_buffer); pjob = (job *)GET_NEXT(svr_alljobs); while (pjob) { ptask = (task *)GET_NEXT(pjob->ji_tasks); while (ptask) { if (ptask->ti_qs.ti_sid == sid) break; ptask = (task *)GET_NEXT(ptask->ti_jobtask); } if (ptask != NULL) break; pjob = (job *)GET_NEXT(pjob->ji_alljobs); } if (pjob == NULL) { DBPRT(("%s: sid %d not a task\n", id, sid)) continue; } /* ** We found task within the job which has exited. */ if (WIFEXITED(statloc)) exiteval = WEXITSTATUS(statloc); else if (WIFSIGNALED(statloc)) exiteval = WTERMSIG(statloc) + 10000; else exiteval = 1; DBPRT(("%s: task %d sid %d exit value %d\n", id, ptask->ti_qs.ti_task, sid, exiteval)) kill_task(ptask, SIGKILL, 0); ptask->ti_qs.ti_exitstat = exiteval; ptask->ti_qs.ti_status = TI_STATE_EXITED; task_save(ptask); sprintf(log_buffer, "task %d terminated", ptask->ti_qs.ti_task); LOG_EVENT(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); exiting_tasks = 1; } } #define PTY_SIZE 12 /* * creat the master pty, this particular * piece of code does it the hard way, it searches */ int open_master( char **rtn_name /* RETURN name of slave pts */ ) { int i = 0; int ptc; /* master file descriptor */ static char pty_name[PTY_SIZE+1]; /* "/dev/[pt]tyXY" */ while (1) { (void)sprintf(pty_name, "/dev/pty/%03d", i++); if ((ptc = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { /* Got a master, fix name to matching slave */ pty_name[5] = 't'; pty_name[6] = 't'; pty_name[7] = 'y'; pty_name[8] = 'p'; *rtn_name = pty_name; return (ptc); } else if (errno == ENOENT) return (-1); /* tried all entries, give up */ } } /* * struct sig_tbl = map of signal names to numbers, * see req_signal() in ../requests.c */ struct sig_tbl sig_tbl[] = { { "NULL", 0 }, { "HUP", SIGHUP }, { "INT", SIGINT }, { "QUIT", SIGQUIT }, { "ILL", SIGILL }, { "TRAP", SIGTRAP }, { "ABRT", SIGABRT }, { "IOT", SIGIOT }, { "HWE", SIGHWE }, { "ERR", SIGERR }, { "EMT", SIGEMT }, { "FPE", SIGFPE }, { "KILL", SIGKILL }, { "PRE", SIGPRE }, { "BUS", SIGBUS }, { "ORE", SIGORE }, { "SEGV", SIGSEGV }, { "SYS", SIGSYS }, { "PIPE", SIGPIPE }, { "ALRM", SIGALRM }, { "TERM", SIGTERM }, { "IO", SIGIO }, { "URG", SIGURG }, { "CHLD", SIGCHLD }, { "PWR", SIGPWR }, { "MT", SIGMT }, { "MTKILL", SIGMTKILL }, { "BUFIO", SIGBUFIO }, { "RECOVERY", SIGRECOVERY }, { "UME", SIGUME }, { "DLK", SIGDLK }, { "CPULIM", SIGCPULIM }, { "SHUTDN", SIGSHUTDN }, { "STOP", SIGSTOP }, { "suspend", SIGSTOP }, { "TSTP", SIGTSTP }, { "CONT", SIGCONT }, { "resume", SIGCONT }, { "TTIN", SIGTTIN }, { "TTOU", SIGTTOU }, { "WINCH", SIGWINCH }, { "RPE", SIGRPE }, { "WRBKPT", SIGWRBKPT }, { "NOBDM", SIGNOBDM }, /* On older Unicoses (before 10.x) SIGAPTEAM was CRI reserved SIGCRAY6 */ #if defined(SIGAPTEAM) { "APTEAM", SIGAPTEAM }, #else { "CRAY6", SIGCRAY6 }, #endif /* SIGAPTEAM */ /* On older Unicoses (before 10.x) SIGCANCEL was CRI reserved SIGCRAY7 */ #if defined(SIGCANCEL) { "CANCEL", SIGCANCEL }, #else { "CRAY7", SIGCRAY7 }, #endif /* SIGCANCEL */ { "CRAY8", SIGCRAY8 }, { "CRAY9", SIGCRAY9 }, { "CRAY10", SIGCRAY10 }, { "CRAY11", SIGCRAY11 }, { "CRAY12", SIGCRAY12 }, { "CRAY13", SIGCRAY13 }, { "CRAY14", SIGCRAY14 }, { "INFO", SIGINFO }, { "USR1", SIGUSR1 }, { "USR2", SIGUSR2 }, {(char *)0, -1 } }; /* * post_suspend - post exit of child for suspending a job */ int post_suspend( job *pjob, int err) { if (err == 0) { pjob->ji_qs.ji_substate = JOB_SUBSTATE_SUSPEND; pjob->ji_qs.ji_svrflags |= JOB_SVFLG_Suspend; } return(0); } /* * post_resume - post exit of child for suspending a job */ int post_resume( job *pjob, int err) { if (err == 0) { /* * adjust walltime for time suspended, ji_momstat contains * time when suspended, ji_stime when job started; adjust * stime to current time minus (back to) amount of time * used before suspended. */ if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) { pjob->ji_qs.ji_stime = time_now - (pjob->ji_momstat - pjob->ji_qs.ji_stime); } pjob->ji_qs.ji_substate = JOB_SUBSTATE_RUNNING; pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_Suspend; } return(0); } torque-2.4.16/src/resmom/unicos8/mom_mach.h0000664000113300011330000001245611272401242015451 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Machine-dependent definitions for the Machine Oriented Miniserver * * Target System: c90 */ #ifndef MOM_MACH #define MOM_MACH "unicos8" #define SET_LIMIT_SET 1 #define SET_LIMIT_ALTER 0 #define PBS_CHECKPOINT_MIGRATE 0 /* struct startjob_rtn = used to pass error/session/other info */ /* child back to parent */ struct startjob_rtn { int sj_code; /* error code */ pid_t sj_session; /* session */ pid_t sj_pid; /* pid of session leader */ }; extern int mom_set_limits A_((job *pjob, int)); /* Set job's limits */ extern int mom_do_poll A_((job *pjob)); /* Should limits be polled? */ extern int mom_does_checkpoint(); /* see if mom does checkpoint */ extern int mom_open_poll A_(()); /* Initialize poll ability */ extern int mom_get_sample A_(()); /* Sample kernel poll data */ extern int mom_over_limit A_((job *pjob)); /* Is polled job over limit? */ extern int mom_set_use A_((job *pjob)); /* Set resource_used list */ extern int mom_kill A_((int sid, int sig)); /* Kill a session */ extern int mom_close_poll A_(()); /* Terminate poll ability */ extern int mach_checkpoint A_((struct task *, char *path, int abt)); /* do the checkpoint */ extern long mach_restart A_((struct task *, char *path)); /* Restart checkpointed task */ #endif /* MOM_MACH */ torque-2.4.16/src/resmom/unicos8/Makefile.in0000664000113300011330000004377511605403757015612 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libmommach_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/resmom/unicos8 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libmommach_a_AR = $(AR) $(ARFLAGS) libmommach_a_LIBADD = am_libmommach_a_OBJECTS = mom_mach.$(OBJEXT) mom_start.$(OBJEXT) \ pe_input.$(OBJEXT) libmommach_a_OBJECTS = $(am_libmommach_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmommach_a_SOURCES) DIST_SOURCES = $(libmommach_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -DPBS_MOM \ -DDEMUX=\"$(DEMUX_PATH)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/resmom/unicos8/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/resmom/unicos8/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmommach.a: $(libmommach_a_OBJECTS) $(libmommach_a_DEPENDENCIES) -rm -f libmommach.a $(libmommach_a_AR) libmommach.a $(libmommach_a_OBJECTS) $(libmommach_a_LIBADD) $(RANLIB) libmommach.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_mach.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mom_start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe_input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/resmom/unicos8/pe_input.c0000664000113300011330000001065511272401242015506 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" static char ident[] = "@(#) $RCSfile$ $Revision: 2367 $"; /* * pe_input() - open architecture dependent input file for prologue * and epilogue scripts. See ../prolog.c * For Unicos - /dev/null */ int pe_input(char *jobid) { return (open("/dev/null", O_RDONLY, 0)); } torque-2.4.16/src/resmom/unicos8/mom_mach.c0000664000113300011330000025164311272401242015447 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "pbs_error.h" #include "log.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "resource.h" #include "pbs_job.h" #include "log.h" #include "mom_mach.h" #include "mom_func.h" #include "resmon.h" #include "../rm_dep.h" static char ident[] = "@(#) c90/$RCSfile$ $Revision: 3151 $"; #ifndef max #define max(a,b) (a>b ? a : b) #endif #ifndef TRUE #define FALSE 0 #define TRUE 1 #endif /* TRUE */ /* ** System dependent code to gather information for the resource ** monitor for a Cray c90 machine. ** ** Resources known by this code: ** cput cpu time for a pid or session ** mem memory size for a pid or session in KB ** sessions list of sessions in the system ** pids list of pids in a session ** nsessions number of sessions in the system ** nusers number of users in the system ** totmem total memory size in KB ** availmem available memory size in KB ** ncpus number of cpus ** physmem physical memory size in KB ** size size of a file or filesystem in KB ** idletime seconds of idle time ** quota quota information ** srfs_reserve set srfs reservation ** loadave current load average ** swaprate swap activity in chars / sec ** swapinrate swapin activity in chars / sec ** swapoutrate swapout activity in chars / sec ** swapused chars swapped out in KB ** swapavail KB available in swap area ** swaptotal total KB in swap area ** cpusysw percent cpu system wait ** cpuunix percent cpu unicos ** cpuuser percent cpu user ** cpuidle percent cpu idle ** cpuguest percent cpu guest */ #if SRFS #include dev_t srfs_tmp_dev = -1; dev_t srfs_big_dev = -1; dev_t srfs_fast_dev = -1; extern int ignmem; extern int ignvmem; extern int igncput; static char **v_name = NULL; static char **v_value = NULL; void var_init(void) { char *id = "var_init"; char *var_conf = "/etc/tmpdir.conf"; char line[200], *cp; int len, i; FILE *fil; if (v_name == NULL) { v_name = (char **)calloc(10, sizeof(char *)); v_value = (char **)calloc(10, sizeof(char *)); } if ((fil = fopen(var_conf, "r")) == NULL) { log_err(errno, id, var_conf); return; } for (i = 0; fgets(line, sizeof(line), fil);) { if (line[0] == '#') continue; len = strlen(line); if (line[len-1] == '\n') line[--len] = '\0'; for (cp = line; *cp; cp++) { if (isspace(*cp)) break; } if (*cp) *cp++ = '\0'; for (; *cp; cp++) { if (!isspace(*cp)) break; } if (*cp == '\0') cp = JTMPDIR; DBPRT(("%s: var(%d) $%s = %s\n", id, i, line, cp)) v_name = realloc(v_name, (i + 2) * sizeof(char *)); v_value = realloc(v_value, (i + 2) * sizeof(char *)); v_name[i] = strdup(line); v_value[i++] = strdup(cp); } v_name[i] = NULL; v_value[i] = NULL; fclose(fil); return; } void var_cleanup(void) { register i; if (v_name == NULL) return; for (i = 0; v_name[i]; i++) { free(v_name[i]); free(v_value[i]); } return; } char * var_value(char *name) { register i; for (i = 0; v_name[i]; i++) { if (strcmp(v_name[i], name) == 0) break; } return v_value[i]; } #endif /* SRFS */ static struct sess *session_table; static long session_table_size; static struct proc *process_table; static long process_table_size; extern time_t time_now; extern char *path_checkpoint; /* ** external functions and data */ extern struct config *search A_((struct config *, char *)); extern struct rm_attribute *momgetattr A_((char *)); extern int rm_errno; extern unsigned int reqnum; extern char *ret_string; extern double cputfactor; extern double wallfactor; extern long system_ncpus; extern int ignwalltime; extern int igncput; /* ** local functions and data */ static char *ncpus A_((struct rm_attribute *attrib)); static char *totmem A_((struct rm_attribute *attrib)); static char *availmem A_((struct rm_attribute *attrib)); static char *physmem A_((struct rm_attribute *attrib)); static char *quota A_((struct rm_attribute *attrib)); static char *srfs_reserve A_((struct rm_attribute *attrib)); static char *swaprate A_((struct rm_attribute *attrib)); static char *swapinrate A_((struct rm_attribute *attrib)); static char *swapoutrate A_((struct rm_attribute *attrib)); static char *swapused A_((struct rm_attribute *attrib)); static char *swapavail A_((struct rm_attribute *attrib)); static char *swaptotal A_((struct rm_attribute *attrib)); static char *cpuidle A_((struct rm_attribute *attrib)); static char *cpuguest A_((struct rm_attribute *attrib)); static char *cpuuser A_((struct rm_attribute *attrib)); static char *cpuunix A_((struct rm_attribute *attrib)); static char *cpusysw A_((struct rm_attribute *attrib)); extern char *loadave A_((struct rm_attribute *attrib)); extern char *nullproc A_((struct rm_attribute *attrib)); extern char extra_parm[]; extern char no_parm[]; char no_srfs[] = "SRFS request not supported"; char procfs[] = "/proc"; #define FILTER 0.75 #define SAMPLE_DELTA 10 struct target tinfo; struct sysinfo sysinfo; double swap_rate; double swapin_rate; double swapout_rate; double cpu_sysw; double cpu_unix; double cpu_user; double cpu_idle; double cpu_guest; time_t wait_time; long last_time = 0; /* ** local resource array */ struct config dependent_config[] = { { "ncpus", {ncpus} }, { "totmem", {totmem} }, { "availmem", {availmem} }, { "physmem", {physmem} }, { "loadave", {loadave} }, { "quota", {quota} }, { "srfs_reserve", {srfs_reserve} }, { "swaprate", {swaprate} }, { "swapinrate", {swapinrate} }, { "swapoutrate", {swapoutrate} }, { "swapused", {swapused} }, { "swapavail", {swapavail} }, { "swaptotal", {swaptotal} }, { "cpuidle", {cpuidle} }, { "cpuguest", {cpuguest} }, { "cpuuser", {cpuuser} }, { "cpuunix", {cpuunix} }, { "cpusysw", {cpusysw} }, { NULL, {nullproc} }, }; /* * This routine is called on each cycle of the main loop. */ void dep_main_loop_cycle(void) { char *id = "dep_main_loop_cycle"; long now, delta; struct tbs info; struct pw pw; int nidlt, nuset, nunit, nguet, nsyst, i, newsios; double idlt, uset, unit, guet, syst, timec, srate; static int oidlt = 0; static int ouset = 0; static int ounit = 0; static int oguet = 0; static int osyst = 0; static int oldsios = 0; static int oldswapin = 0; static int oldswapout = 0; now = rtclock(); delta = now - last_time; if (delta <= SAMPLE_DELTA*tinfo.mc_clktck) { wait_time = (int)((SAMPLE_DELTA * tinfo.mc_clktck - delta) / tinfo.mc_clktck); return; } DBPRT(("%s: delta is %.3f\n", id, (double)delta / (double)tinfo.mc_clktck)) wait_time = SAMPLE_DELTA; if (tabinfo(PWS, &info) == -1) { log_err(errno, id, "tabinfo(PWS)"); return; } if (tabread(PWS, (char *)&pw, info.ent * info.len, info.head) == -1) { log_err(errno, id, "tabread(PWS)"); return; } if (tabinfo(SINFO, &info) == -1) { log_err(errno, id, "tabinfo(SINFO)"); return; } if (tabread(SINFO, (char *)&sysinfo, info.ent * info.len, info.head) == -1) { log_err(errno, id, "tabread(SINFO)"); return; } last_time = now; /* User, sys and idle time calc */ nidlt = 0; nuset = 0; nunit = 0; nguet = 0; nsyst = 0; for (i = 0; i < MAXCPUS; i++) { nidlt += pw.pws[i].pw_idlec; nuset += pw.pws[i].pw_userc; nunit += pw.pws[i].pw_unixc; nguet += pw.pws[i].pw_guestc; nsyst += pw.pws[i].pw_syswc; } idlt = (double)(nidlt - oidlt); uset = (double)(nuset - ouset); unit = (double)(nunit - ounit); guet = (double)(nguet - oguet); syst = (double)(nsyst - osyst); timec = idlt + uset + unit + guet + syst; if (timec <= 0.0) { sprintf(log_buffer, "bad time counter %.2f", timec); log_err(-1, id, log_buffer); return; } idlt = (idlt * 100.0) / timec; uset = (uset * 100.0) / timec; unit = (unit * 100.0) / timec; guet = (guet * 100.0) / timec; syst = (syst * 100.0) / timec; oidlt = nidlt; ouset = nuset; ounit = nunit; oguet = nguet; osyst = nsyst; cpu_sysw = FILTER * syst + (1 - FILTER) * cpu_sysw; DBPRT(("%s: syst %.2f cpu_sysw %.2f\n", id, syst, cpu_sysw)) cpu_unix = FILTER * unit + (1 - FILTER) * cpu_unix; DBPRT(("%s: unit %.2f cpu_unix %.2f\n", id, unit, cpu_unix)) cpu_user = FILTER * uset + (1 - FILTER) * cpu_user; DBPRT(("%s: uset %.2f cpu_user %.2f\n", id, uset, cpu_user)) cpu_idle = FILTER * idlt + (1 - FILTER) * cpu_idle; DBPRT(("%s: idlt %.2f cpu_idle %.2f\n", id, idlt, cpu_idle)) cpu_guest = FILTER * guet + (1 - FILTER) * cpu_guest; DBPRT(("%s: guet %.2f cpu_guest %.2f\n", id, guet, cpu_guest)) srate = (double)((sysinfo.bswapin - oldswapin) * tinfo.mc_clktck) / (double)delta; srate *= (double)BSIZE; swapin_rate = FILTER * srate + (1 - FILTER) * swapin_rate; DBPRT(("%s: swapin %d srate %.2f swapin_rate %.2f\n", id, sysinfo.bswapin - oldswapin, srate, swapin_rate)) oldswapin = sysinfo.bswapin; srate = (double)((sysinfo.bswapout - oldswapout) * tinfo.mc_clktck) / (double)delta; srate *= (double)BSIZE; swapout_rate = FILTER * srate + (1 - FILTER) * swapout_rate; DBPRT(("%s: swapout %d srate %.2f swapout_rate %.2f\n", id, sysinfo.bswapout - oldswapout, srate, swapout_rate)) oldswapout = sysinfo.bswapout; newsios = sysinfo.bswapin + sysinfo.bswapout; srate = (double)((newsios - oldsios) * tinfo.mc_clktck) / (double)delta; srate *= (double)BSIZE; swap_rate = FILTER * srate + (1 - FILTER) * swap_rate; DBPRT(("%s: sios %d srate %.2f swap_rate %.2f\n", id, newsios - oldsios, srate, swap_rate)) oldsios = newsios; } void dep_initialize(void) { char *id = "dep_initialize"; limit(C_PROC, 0, L_CPU, 0); /* set unlimited cpu */ if (target(MC_GET_TARGET, &tinfo) == -1) { log_err(errno, id, "target"); die(0); } DBPRT(("Primary machine type name = %s\n", &tinfo.mc_pmt)) DBPRT(("Number of memory banks = %ld\n", tinfo.mc_bank)) DBPRT(("Number of started processors = %ld\n", tinfo.mc_ncpu)) DBPRT(("Instruction Buffer Size (words) = %ld\n", tinfo.mc_ibsz)) DBPRT(("Main memory size (words) = %ld\n", tinfo.mc_msz)) DBPRT(("Number of clocks for a memory read = %ld\n", tinfo.mc_mspd)) DBPRT(("Clock period in picoseconds = %ld\n", tinfo.mc_clk)) DBPRT(("Number of cluster register sets = %ld\n", tinfo.mc_ncl)) DBPRT(("Memory bank busy time in clocks = %ld\n", tinfo.mc_bbsy)) DBPRT(("Number of clock ticks per second = %ld\n", tinfo.mc_clktck)) DBPRT(("System serial number = %ld\n", tinfo.mc_serial)) DBPRT(("UNICOS release level = %ld\n", tinfo.mc_rls)) #if SRFS var_init(); #endif dep_main_loop_cycle(); } void dep_cleanup(void) { char *id = "dep_cleanup"; int i; log_record(PBSEVENT_SYSTEM, 0, id, "dependent cleanup"); #if SRFS var_cleanup(); #endif } /* * Internal size decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value in the unsigned long integer. * * For Unicos, * * sizeof(word) = sizeof(int) */ static int getsize(resource *pres, unsigned long *ret) { unsigned long value; if (pres->rs_value.at_type != ATR_TYPE_SIZE) return (PBSE_ATTRTYPE); value = pres->rs_value.at_val.at_size.atsv_num; if (pres->rs_value.at_val.at_size.atsv_units == ATR_SV_WORDSZ) { if (value > ULONG_MAX / sizeof(int)) return (PBSE_BADATVAL); value *= sizeof(int); } if (value > ULONG_MAX >> pres->rs_value.at_val.at_size.atsv_shift) return (PBSE_BADATVAL); *ret = value << pres->rs_value.at_val.at_size.atsv_shift; return (PBSE_NONE); } /* * Internal time decoding routine. * * Accepts a resource pointer and a pointer to the unsigned long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of time in seconds in the unsigned long integer. */ static int gettime(resource *pres, unsigned long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Internal long decoding routine. * * Accepts a resource pointer and a pointer to a long integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of number in the long integer. */ static int getlong(resource *pres, long *ret) { if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); if (pres->rs_value.at_val.at_long < 0) return (PBSE_BADATVAL); *ret = pres->rs_value.at_val.at_long; return (PBSE_NONE); } /* * Internal boolean decoding routine. * * Accepts a resource pointer and a pointer to the unsigned integer * to receive the decoded value. It returns a PBS error code, and the * decoded value of true (1) or false (0). */ static int getbool(resource *pres, unsigned int *ret) { unsigned int val; if (pres->rs_value.at_type != ATR_TYPE_LONG) return (PBSE_ATTRTYPE); val = pres->rs_value.at_val.at_long; if (val != 0 && val != 1) return (PBSE_BADATVAL); *ret = val; return (PBSE_NONE); } static int injob(pjob, sesid) job *pjob; pid_t sesid; { task *ptask; for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { if (ptask->ti_qs.ti_sid <= 1) continue; if (ptask->ti_qs.ti_sid == sesid) return TRUE; } return FALSE; } /* * Internal job cpu count decoding routine. * * Accepts a job pointer. Returns the sum of all "multi-task" * procs in a job. */ static unsigned long cpus_sum(job *pjob) { static char *id = "cpus_sum"; struct proc *pproc; int i; ulong cpus; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) cpus = 0; pproc = process_table; for (i = 0; i < process_table_size; i++, pproc++) { if (pproc->p_stat == 0) continue; if (!injob(pjob, pproc->p_pcomm.pc_sid)) continue; if (pproc->p_pcomm.pc_maxcnt <= 1) continue; cpus += pproc->p_pcomm.pc_maxcnt; DBPRT(("Session: %d, maxcnt = %d, tot = %d\n", pproc->p_pcomm.pc_sid, pproc->p_pcomm.pc_maxcnt, cpus)) } return (cpus); } /* * Internal job cpu time decoding routine. * * Accepts a job pointer. Returns the sum of all cpu time * consumed for all processes executed by the job, in seconds. */ static unsigned long cput_sum(job *pjob) { static char *id = "cput_sum"; struct sess *psess; int i; ulong cputime = 0; int nps = 0; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) psess = session_table; for (i = 0; i < session_table_size; i++, psess++) { if (!injob(pjob, psess->s_sid)) continue; nps++; cputime += (psess->s_ucputime + psess->s_scputime) / CLK_TCK; DBPRT(("Session: %d, cput = %d\n", psess->s_sid, cputime)) } if (nps == 0) pjob->ji_flags |= MOM_NO_PROC; else pjob->ji_flags &= ~MOM_NO_PROC; return ((unsigned long)((double)cputime * cputfactor)); } #define CLICKS 4096 /* * Internal job memory decoding routine. * * Accepts a job pointer. Returns the sum of all memory * consumed for all processes executed by the job, in bytes. */ static unsigned long mem_sum(job *pjob) { static char *id = "mem_sum"; struct sess *psess; int i; ulong memsize = 0; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) psess = session_table; for (i = 0; i < session_table_size; psess++, i++) { if (!injob(pjob, psess->s_sid)) continue; memsize += ((psess->s_memhiwat) * CLICKS); DBPRT(("Session: %d, mem = %d\n", psess->s_sid, memsize)) } return (memsize); } #define BLOCKS 4096 /* * Internal job file space decoding routine. * * Accepts a job pointer. Returns the sum of all file space * consumed for all processes executed by the job, in bytes. */ static long pf_sum(job *pjob) { static char *id = "pf_sum"; struct sess *psess; int i; long fsize = 0; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) psess = session_table; for (i = 0; i < session_table_size; psess++, i++) { if (!injob(pjob, psess->s_sid)) continue; fsize += ((psess->s_fsblkused) * BLOCKS); DBPRT(("Session: %d, pf = %d\n", psess->s_sid, fsize)) } return (fsize); } /* * Internal session SDS decoding routine. * * Accepts a job pointer. Returns the sum of all SDS * consumed for all processes executed by the job, in bytes. */ static unsigned long sds_sum(job *pjob) { static char *id = "sds_sum"; struct sess *psess; int i; ulong sdssize = 0; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) psess = session_table; for (i = 0; i < session_table_size; psess++, i++) { if (!injob(pjob, psess->s_sid)) continue; sdssize += ((psess->s_sdsuse) * CLICKS); DBPRT(("Session: %d, sds = %d\n", psess->s_sid, sdssize)) } return (sdssize); } #if SRFS /* * Internal session SRFS decoding routine. * * Accepts a job pointer and device num. Returns the max of all SRFS * consumed for the device for all processes executed by the session, * in bytes. */ static unsigned long srfs_sum(pjob, dev) job *pjob; dev_t dev; { static char *id = "srfs_sum"; struct sess *psess; int i; ulong srfssize; DBPRT(("%s: entered dev %d %s\n", id, dev, pjob->ji_qs.ji_jobid)) if (dev == -1) return 0; srfssize = 0; psess = session_table; for (i = 0; i < session_table_size; psess++, i++) { if (!injob(pjob, psess->s_sid)) continue; srfssize += ((psess->s_srfs[dev].hiwater) * BLOCKS); DBPRT(("Session: %d, sds = %d\n", psess->s_sid, srfssize)) } return (srfssize); } static int srfs_error(char *mes1, char *mes2) { char buf[512]; sprintf(buf, "%s (%s) errno=%d", mes1, mes2, errno); log_err(errno, mes1, mes2); return (error(buf, PBSE_RESCUNAV)); } #endif /* SRFS */ /* * Internal session procs decoding routine. * * Accepts a job pointer id. Returns the number of processes * active for the job. */ static unsigned long proc_cnt(job *pjob) { static char *id = "proc_cnt"; struct sess *psess; int i; ulong nprocs = 0; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) psess = session_table; for (i = 0; i < session_table_size; psess++, i++) { if (!injob(pjob, psess->s_sid)) continue; nprocs += psess->s_nprocs; DBPRT(("Session: %d, nprocs = %d\n", psess->s_sid, nprocs)) } return (nprocs); } /* * Internal session mpp time decoding routine. * * Accepts a session id. Returns the sum of all moo time * consumed for all processes executed by the session, in seconds. */ static unsigned long mppt_sum(job *pjob) { static char *id = "mppt_ses"; struct sess *psess; int i; ulong mpptime = 0; DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) psess = session_table; for (i = 0; i < session_table_size; psess++, i++) { if (!injob(pjob, psess->s_sid)) continue; mpptime += psess->s_mpptimeused; DBPRT(("Session: %d, mppt = %d\n", psess->s_sid, mpptime)) } return (mpptime); } extern char *msg_momsetlim; /* * Internal error routine */ int error(char *string, int value) { char *message; assert(string != NULL); assert(*string != '\0'); message = pbse_to_txt(value); assert(message != NULL); assert(*message != '\0'); (void)fprintf(stderr, msg_momsetlim, string, message); (void)fflush(stderr); return (value); } /* * which_limit - set either user's limit or udb limit: * * If user's limit is a default, then use lesser of it or udb * * Else, use user's limit unless it is greater than the udb and the * the udb limit is not unlimited. This case is an error. */ static int which_limit( long rlimit, /* limit value from resource_limit */ long udblimit, /* limit for that resource from UDB */ int r_flags, /* resource entry flags (ATR_VFLAG_DEFLT) */ int zlimit, /* true if 0 in udb mean real limit of zero */ long *rtn_limit /* RETURN: the limit to set */ ) { if (r_flags & ATR_VFLAG_DEFLT) { /* User's limit is a default value, if default > UDB, use UDB */ if ((udblimit == MAXUE_LONG) || ((udblimit == 0) && (zlimit == 0)) || (rlimit < udblimit)) *rtn_limit = rlimit; else *rtn_limit = udblimit; } else { /* user specified an actual limit */ if (zlimit) { if ((udblimit != MAXUE_LONG) && (rlimit > udblimit)) return (PBSE_EXLIMIT); } else { if (((udblimit != 0) || (udblimit != MAXUE_LONG)) && (rlimit > udblimit)) return (PBSE_EXLIMIT); } *rtn_limit = rlimit; } return (0); } /* * Establish system-enforced limits for the tasks of a job. * * Run through the resource list, checking the values for all items * we recognize. * * If set_mode is SET_LIMIT_SET, then also set hard limits for the * system enforced limits (not-polled). * If anything goes wrong with the process, return a PBS error code * and print a message on standard error. A zero-length resource list * is not an error. * * If set_mode is SET_LIMIT_SET the entry conditions are: * 1. MOM has already forked, and we are called from the child. * 2. The child is still running as root. * 3. Standard error is open to the user's file. * * If set_mode is SET_LIMIT_ALTER, we are beening called to modify * existing limits. Unlike bsd based systems that use setrlimit, the * Cray limit() call can set limits for another session. Hence all * limits can be adjusted. */ int mom_set_limits( job *pjob, int set_mode /* unused here */ ) { static char *id = "mom_set_limits"; int acid; int maxcore; int maxcput; int maxfdm; int maxpcput; int maxmem; int maxmt[MAXUE_TAPETYPE]; int maxpmem; int maxpf; int maxppf; int maxsds; int maxpsds; int maxnproc; int maxmppe; int maxmppt; int maxpmppt; int maxsockbf; int niceval; int num; char *pc; char *phost; char *pname; struct udb *pudb; int sessid; int retval; attribute *pat; resource *pres; task *ptask; unsigned long value; /* place in which to build resource value */ #if SRFS int srfs_tmp = -1; int srfs_big = -1; int srfs_fast = -1; int srfs_assist = 0; extern char *fast_dir; extern char *big_dir; extern char *tmp_dir; struct srfs_req_s srfs_brk; struct fsres_s srfsinfo; log_buffer[0] = '\0'; #define SRFS_SET(fs, val) \ if (val > 0) { \ DBPRT(("%s: going to set %s to %d\n", id, fs, val)) \ if (srfs_assist) { \ if (quotactl(fs, SRFS_INFO, (caddr_t)&srfsinfo) == -1) \ return (srfs_error(fs, "SRFS_INFO")); \ num = srfsinfo.reserve + val; \ if (quotactl(fs, SRFS_RESERVE, (caddr_t)&num) == -1) \ return (srfs_error(fs, "SRFS_RESERVE")); \ } \ srfs_brk.count = val; \ if (quotactl(fs, SRFS_SBRK, (char *)&srfs_brk) == -1) \ return (srfs_error(fs, "SRFS_SBRK")); \ } #endif /* SRFS */ DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); /* initialize limits to values from user's UDB */ if (set_mode == SET_LIMIT_SET) { getsysudb(); /* get the priviled (locked) udb */ } pudb = getudbuid(pjob->ji_qs.ji_un.ji_momt.ji_exuid); if (pudb == UDB_NULL) return (PBSE_BADUSER); if (set_mode == SET_LIMIT_SET) { /* can this user run batch jobs */ if (pudb->ue_permbits & PERMBITS_NOBATCH) { endudb(); return (PBSE_QACESS); } /* set Account ID: 1 - if supplied and is valid acid, */ /* or 2 - default acid from UDB */ pat = &pjob->ji_wattr[(int)JOB_ATR_account]; if (pat->at_flags & ATR_VFLAG_SET) { pname = pat->at_val.at_str; if ((acid = nam2acid(pname)) == -1) { for (pc = pname; *pc; ++pc) { if (!isdigit((int)*pc)) return (error(pname, PBSE_BADACCT)); } if (acid2nam(acid = atoi(pname)) == (char *)0) return (error(pname, PBSE_BADACCT)); } for (num = 0; num < MAXVIDS; ++num) { if (pudb->ue_acids[num] == acid) break; } if (num == MAXVIDS) return (error(pname, PBSE_BADACCT)); } else { acid = pudb->ue_acids[0]; } if (acctid(0, acid) == -1) return (error("Account", PBSE_BADACCT)); /* lock and update the UDB with the batch host/time */ if (lockudb() < 0) { log_err(udb_errno, id, "Unable to lock UDB"); } else { pudb->ue_batchtime = time_now; phost = arst_string("PBS_O_HOST", &pjob->ji_wattr[(int)JOB_ATR_variables]); if ((phost == (char *)0) || ((phost = strchr(phost, (int)'=')) == (char *)0)) log_err(-1, id, "PBS_O_HOST not set"); strncpy(pudb->ue_batchhost, phost + 1, MAXUE_HOSTNAME); pudb->ue_batchhost[MAXUE_HOSTNAME] = '\0'; if (rewriteudb(pudb) < 0) log_err(udb_errno, id, "UDB Update failed"); } } endudb(); /* * set basic limits to values from the user's UDB entry; later * we have to check for values == MAXUE_LONG, meaning unlimited, * where in the limit() call it must be changed to 0. * A click is 512 words = 4096 bytes */ maxcput = pudb->ue_jcpulim[UDBRC_BATCH]; /* seconds */ maxpcput = pudb->ue_pcpulim[UDBRC_BATCH]; /* seconds */ maxmem = pudb->ue_jmemlim[UDBRC_BATCH]; /* clicks */ maxpmem = pudb->ue_pmemlim[UDBRC_BATCH]; /* clicks */ maxpf = pudb->ue_jfilelim[UDBRC_BATCH]; /* clicks */ maxppf = pudb->ue_pfilelim[UDBRC_BATCH]; /* clicks */ maxsds = pudb->ue_jsdslim[UDBRC_BATCH]; /* clicks */ maxpsds = pudb->ue_psdslim[UDBRC_BATCH]; /* clicks */ maxnproc = pudb->ue_jproclim[UDBRC_BATCH]; maxmppe = pudb->ue_jpelimit[UDBRC_BATCH]; maxmppt = pudb->ue_jmpptime[UDBRC_BATCH]; maxpmppt = pudb->ue_pmpptime[UDBRC_BATCH]; niceval = pudb->ue_nice[UDBRC_BATCH]; maxcore = pudb->ue_pcorelim[UDBRC_BATCH]; /* clicks */ maxfdm = pudb->ue_pfdlimit[UDBRC_BATCH]; maxsockbf = pudb->ue_jsocbflim[UDBRC_BATCH]; for (num = 0; num < MAXUE_TAPETYPE; ++num) maxmt[num] = pudb->ue_jtapelim[UDBRC_BATCH][num]; pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); /* * Cycle through all the resource specifications, * setting limits appropriately. */ while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "cput") == 0) { if (igncput == FALSE) { retval = gettime(pres, &value); value = (unsigned long)((double)value / cputfactor); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxcput, pres->rs_value.at_flags, 0, &maxcput); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pcput") == 0) { if (igncput == FALSE) { retval = gettime(pres, &value); value = (unsigned long)((double)value / cputfactor); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxpcput, pres->rs_value.at_flags, 0, &maxpcput); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "mem") == 0) { if (ignmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxmem, pres->rs_value.at_flags, 0, &maxmem); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "pmem") == 0) { if (ignmem == FALSE) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxpmem, pres->rs_value.at_flags, 0, &maxpmem); if (retval != PBSE_NONE) return (error(pname, retval)); } } else if (strcmp(pname, "vmem") == 0) /* ignore */ { } else if (strcmp(pname, "pvmem") == 0) /* ignore */ { } else if (strcmp(pname, "file") == 0) /* ignore */ { } else if ((strcmp(pname, "mta") == 0) || (strcmp(pname, "mtb") == 0) || (strcmp(pname, "mtc") == 0) || (strcmp(pname, "mtd") == 0) || (strcmp(pname, "mte") == 0) || (strcmp(pname, "mtf") == 0) || (strcmp(pname, "mtg") == 0) || (strcmp(pname, "mth") == 0)) { num = (int) * (pname + 2) - (int)'a'; maxmt[num] = pres->rs_value.at_val.at_long; retval = which_limit(pres->rs_value.at_val.at_long, maxmt[num], pres->rs_value.at_flags, 0, &maxmt[num]); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "pf") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxpf, pres->rs_value.at_flags, 0, &maxpf); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "ppf") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxppf, pres->rs_value.at_flags, 0, &maxppf); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "sds") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxsds, pres->rs_value.at_flags, 1, &maxsds); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "psds") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit((value + 4095) / 4096, maxpsds, pres->rs_value.at_flags, 1, &maxpsds); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "procs") == 0) { retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxnproc, pres->rs_value.at_flags, 0, &maxnproc); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "mppe") == 0) { retval = getlong(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxmppe, pres->rs_value.at_flags, 1, &maxmppe); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "mppt") == 0) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxmppt, pres->rs_value.at_flags, 1, &maxmppt); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "pmppt") == 0) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); retval = which_limit(value, maxpmppt, pres->rs_value.at_flags, 1, &maxpmppt); if (retval != PBSE_NONE) return (error(pname, retval)); #if SRFS } else if (strcmp(pname, "srfs_tmp") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); value = (value + 4095) / 4096; srfs_tmp = value; } else if (strcmp(pname, "srfs_big") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); value = (value + 4095) / 4096; srfs_big = value; } else if (strcmp(pname, "srfs_fast") == 0) { retval = getsize(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); if (value > INT_MAX) return (error(pname, PBSE_BADATVAL)); value = (value + 4095) / 4096; srfs_fast = value; } else if (strcmp(pname, "srfs_assist") == 0) { retval = getbool(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); srfs_assist = value; #endif /* SRFS */ } else if (strcmp(pname, "walltime") == 0) { retval = gettime(pres, &value); if (retval != PBSE_NONE) return (error(pname, retval)); } else if (strcmp(pname, "ncpus") == 0) { char hold[16]; extern struct var_table vtable; if ((int)pres->rs_value.at_val.at_long < 0) return (error(pname, PBSE_BADATVAL)); sprintf(hold, "%d", (int)pres->rs_value.at_val.at_long); bld_env_variables(&vtable, "NCPUS", hold); } else if (strcmp(pname, "nice") == 0) { if (set_mode == SET_LIMIT_SET) { niceval = (int)pres->rs_value.at_val.at_long; } } else if ((pres->rs_defin->rs_flags & ATR_DFLAG_RMOMIG) == 0) /* don't recognize and nor marked as ignore by mom */ return (error(pname, PBSE_UNKRESC)); pres = (resource *)GET_NEXT(pres->rs_link); } /* * Set the limits * * If pcput, pmem, or ppf is unlimited but the corresponding session * limit is not, use the session limit for the process limit. */ for (ptask = (task *)GET_NEXT(pjob->ji_tasks); ptask != NULL; ptask = (task *)GET_NEXT(ptask->ti_jobtask)) { sessid = ptask->ti_qs.ti_sid; if (maxcput == MAXUE_LONG) /* if unlimited */ maxcput = 0; if (limit(C_SESS, sessid, L_CPU, maxcput * CLK_TCK) < 0) return (error("cput", PBSE_SYSTEM)); if ((maxpcput == MAXUE_LONG) || (maxpcput == 0)) /* if unlimited */ { if (maxcput != 0) maxpcput = maxcput; else maxpcput = 0; } else if ((maxpcput > maxcput) && (maxcput != 0)) { maxpcput = maxcput; } if (limit(C_SESSPROCS, sessid, L_CPU, maxpcput * CLK_TCK) < 0) return (error("pcput", PBSE_SYSTEM)); if (maxmem == MAXUE_LONG) /* if unlimited */ maxmem = 0; if (limit(C_SESS, sessid, L_MEM, maxmem) < 0) return (error("mem", PBSE_SYSTEM)); if ((maxpmem == MAXUE_LONG) || (maxpmem == 0)) /* if unlimited */ { if (maxmem != 0) maxpmem = maxmem; else maxpmem = 0; } else if ((maxpmem > maxmem) && (maxmem != 0)) { maxpmem = maxmem; } if (limit(C_SESSPROCS, sessid, L_MEM, maxpmem) < 0) return (error("pmem", PBSE_SYSTEM)); if (maxpf == MAXUE_LONG) /* if unlimited */ maxpf = 0; if (limit(C_SESS, sessid, L_FSBLK, maxpf) < 0) return (error("pf", PBSE_SYSTEM)); if ((maxppf == MAXUE_LONG) || (maxppf == 0)) /* if unlimited */ { if (maxpf != 0) maxppf = maxpf; else maxppf = 0; } else if ((maxppf > maxpf) && (maxpf != 0)) { maxppf = maxpf; } if (limit(C_SESSPROCS, sessid, L_FSBLK, maxppf) < 0) return (error("ppf", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_SDS, maxsds) < 0) return (error("sds", PBSE_SYSTEM)); if (limit(C_SESSPROCS, sessid, L_SDS, maxpsds) < 0) return (error("psds", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_CPROC, maxnproc) < 0) return (error("procs", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE0, maxmt[0]) < 0) return (error("mta", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE1, maxmt[1]) < 0) return (error("mtb", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE2, maxmt[2]) < 0) return (error("mtc", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE3, maxmt[3]) < 0) return (error("mtd", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE4, maxmt[4]) < 0) return (error("mte", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE5, maxmt[5]) < 0) return (error("mtf", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE6, maxmt[6]) < 0) return (error("mtg", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_TAPE7, maxmt[7]) < 0) return (error("mth", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_MPPE, maxmppe) < 0) return (error("mppe", PBSE_SYSTEM)); if (limit(C_SESS, sessid, L_MPPT, maxmppt) < 0) return (error("mppt", PBSE_SYSTEM)); if (limit(C_SESSPROCS, sessid, L_MPPT, maxpmppt) < 0) return (error("pmppt", PBSE_SYSTEM)); if (maxcore == MAXUE_LONG) /* if unlimited */ maxcore = 0; if (limit(C_SESSPROCS, sessid, L_CORE, maxcore) < 0) return (error("core", PBSE_SYSTEM)); if (maxfdm == MAXUE_LONG) /* if unlimited */ maxfdm = 0; if (limit(C_SESSPROCS, sessid, L_FDM, maxfdm) < 0) return (error("fdm", PBSE_SYSTEM)); if (maxsockbf == MAXUE_LONG) /* if unlimited */ maxsockbf = 0; if (limit(C_SESS, sessid, L_SOCKBF, maxsockbf) < 0) return (error("sockbuf", PBSE_SYSTEM)); #if SRFS srfs_brk.id = 0; /* current job */ SRFS_SET(tmp_dir, srfs_tmp) SRFS_SET(big_dir, srfs_big) SRFS_SET(fast_dir, srfs_fast) #endif /* SRFS */ if (set_mode == SET_LIMIT_SET) { errno = 0; if ((nice(niceval) == -1) && (errno != 0)) return (error("nice", PBSE_SYSTEM)); } } return (PBSE_NONE); } /* * State whether MOM main loop has to poll this job to determine if some * limits are being exceeded. * * Sets flag TRUE if polling is necessary, FALSE otherwise. Actual * polling is done using the mom_over_limit machine-dependent function. */ int mom_do_poll(job *pjob) { static char *id = "mom_do_poll"; char *pname; resource *pres; DBPRT(("%s: entered\n", id)) assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); while (pres != NULL) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if (strcmp(pname, "ncpus") == 0) return (TRUE); if (strcmp(pname, "walltime") == 0) return (TRUE); pres = (resource *)GET_NEXT(pres->rs_link); } return (FALSE); } /* * Setup for polling. * * Open kernel device and get namelist info. */ int mom_open_poll(void) { static char *id = "mom_open_poll"; DBPRT(("%s: entered\n", id)) #if SRFS #define SETDEV(name, var) \ if ((dir = var_value(name)) != NULL) { \ i |= chk_file_sec(dir, 1, 1, S_IWGRP|S_IWOTH, 1, NULL); \ if (quotactl(dir, SRFS_INFO, (caddr_t)&srfsinfo) == -1) \ log_err(errno, id, dir); \ else { \ var = srfsinfo.index; \ DBPRT(("%s: got %d for %s %s\n", id, var, name, dir)) \ } \ } { int i; struct fsres_s srfsinfo; char *dir, *var_value(); var_init(); i = 0; SETDEV("TMPDIR", srfs_tmp_dev) SETDEV("BIGDIR", srfs_big_dev) SETDEV("FASTDIR", srfs_fast_dev) #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) if (i) return (PBSE_PERM); #endif /* NO_SECURITY_CHECK */ } #else #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) if (chk_file_sec(TMP_DIR, 1, 1, S_IWGRP | S_IWOTH, 1, NULL)) return (PBSE_PERM); #endif /* NO_SECURITY_CHECK */ #endif /* SRFS */ return (PBSE_NONE); } /* * Declare start of polling loop. * * Until the next call to mom_get_sample, all mom_over_limit calls will * use the same data. Returns a PBS error code. */ int mom_get_sample(void) { static char *id = "mom_get_sample"; struct tbs info; struct proc *pp; struct pcomm *pc; int i, pbase; DBPRT(("%s: entered\n", id)) if (session_table != NULL) free(session_table); if (tabinfo(SESS, &info) == -1) return (PBSE_SYSTEM); session_table_size = info.ent * info.len; session_table = (struct sess*)malloc(session_table_size); if (session_table == NULL) return (PBSE_SYSTEM); if (tabread(SESS, (char *) session_table, session_table_size, info.head) == -1) return (PBSE_SYSTEM); session_table_size = info.ent; if (process_table != NULL) free(process_table); if (tabinfo(PROCTAB, &info) == -1) return (PBSE_SYSTEM); process_table_size = info.ent * info.len; process_table = (struct proc*)malloc(process_table_size); if (process_table == NULL) return (PBSE_SYSTEM); if (tabread(PROCTAB, (char *) process_table, process_table_size, info.head) == -1) return (PBSE_SYSTEM); process_table_size = info.ent; pbase = (int)info.addr; for (pp = process_table, i = 0; i < process_table_size; pp++, i++) { if (pp->p_stat == 0) continue; if ((pc = pp->p_pc) != NULL) { pp->p_pc = (struct pcomm *)((int)pc - pbase + (int)process_table); } } return (PBSE_NONE); } /* * Measure job resource usage and compare with its limits. * * If it has exceeded any well-formed polled limit return TRUE. * Otherwise, return FALSE. */ int mom_over_limit(job *pjob) { static char *id = "mom_over_limit"; char *pname; int retval; unsigned long value; resource *pres; int num; assert(pjob != NULL); assert(pjob->ji_wattr[(int)JOB_ATR_resource].at_type == ATR_TYPE_RESC); pres = (resource *) GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_resource].at_val.at_list); DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) for (; pres != NULL; pres = (resource *)GET_NEXT(pres->rs_link)) { assert(pres->rs_defin != NULL); pname = pres->rs_defin->rs_name; assert(pname != NULL); assert(*pname != '\0'); if ((strcmp(pname, "ncpus") == 0) && (igncput == FALSE)) { retval = getlong(pres, &value); if (retval != PBSE_NONE) continue; if ((num = cpus_sum(pjob)) > value) { sprintf(log_buffer, "ncpus %d exceeded limit %d", num, value); return (TRUE); } } if (ignwalltime == 0 && strcmp(pname, "walltime") == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) == 0) continue; retval = gettime(pres, &value); if (retval != PBSE_NONE) continue; num = (unsigned long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); if (num > value) { sprintf(log_buffer, "walltime %d exceeded limit %d", num, value); return (TRUE); } } } return (FALSE); } /* * Update the job attribute for resources used. * * The first time this is called for a job, set up resource entries for * each resource that can be reported for this machine. Fill in the * correct values. Return an error code. */ int mom_set_use(job *pjob) { static char *id = "mom_set_use"; resource *pres; attribute *at; resource_def *rd; unsigned long *ulp, unum; long *lp, num; assert(pjob != NULL); at = &pjob->ji_wattr[(int)JOB_ATR_resc_used]; assert(at->at_type == ATR_TYPE_RESC); if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) != 0) return (PBSE_NONE); /* job suspended, don't track it */ DBPRT(("%s: entered %s\n", id, pjob->ji_qs.ji_jobid)) at->at_flags |= ATR_VFLAG_MODIFY; if ((at->at_flags & ATR_VFLAG_SET) == 0) { at->at_flags |= ATR_VFLAG_SET; #if SRFS rd = find_resc_def(svr_resc_def, "srfs_tmp", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "srfs_big", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "srfs_fast", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; #endif /* SRFS */ rd = find_resc_def(svr_resc_def, "ncpus", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "pf", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "sds", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_SIZE; pres->rs_value.at_val.at_size.atsv_shift = 10; /* KB */ pres->rs_value.at_val.at_size.atsv_units = ATR_SV_BYTESZ; rd = find_resc_def(svr_resc_def, "procs", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "mppt", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = add_resource_entry(at, rd); pres->rs_value.at_flags |= ATR_VFLAG_SET; pres->rs_value.at_type = ATR_TYPE_LONG; } rd = find_resc_def(svr_resc_def, "ncpus", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_long; num = cpus_sum(pjob); *lp = max(*lp, num); rd = find_resc_def(svr_resc_def, "cput", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_long; num = cput_sum(pjob); *lp = max(*lp, num); rd = find_resc_def(svr_resc_def, "mem", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); ulp = &pres->rs_value.at_val.at_size.atsv_num; unum = (mem_sum(pjob) + 1023) >> 10; /* KB */ *ulp = max(*ulp, unum); rd = find_resc_def(svr_resc_def, "pf", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = (long *) & pres->rs_value.at_val.at_size.atsv_num; num = (pf_sum(pjob) + 1023) >> 10; /* KB */ *lp = max(*lp, num); rd = find_resc_def(svr_resc_def, "sds", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); ulp = &pres->rs_value.at_val.at_size.atsv_num; unum = (sds_sum(pjob) + 1023) >> 10; /* KB */ *ulp = max(*ulp, unum); #if SRFS rd = find_resc_def(svr_resc_def, "srfs_tmp", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); ulp = &pres->rs_value.at_val.at_size.atsv_num; unum = (srfs_sum(pjob, srfs_tmp_dev) + 1023) >> 10; /* KB */ *ulp = max(*ulp, unum); rd = find_resc_def(svr_resc_def, "srfs_big", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); ulp = &pres->rs_value.at_val.at_size.atsv_num; unum = (srfs_sum(pjob, srfs_big_dev) + 1023) >> 10; /* KB */ *ulp = max(*ulp, unum); rd = find_resc_def(svr_resc_def, "srfs_fast", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); ulp = &pres->rs_value.at_val.at_size.atsv_num; unum = (srfs_sum(pjob, srfs_fast_dev) + 1023) >> 10; /* KB */ *ulp = max(*ulp, unum); #endif /* SRFS */ rd = find_resc_def(svr_resc_def, "procs", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_long; num = proc_cnt(pjob); *lp = max(*lp, num); rd = find_resc_def(svr_resc_def, "mppt", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); lp = &pres->rs_value.at_val.at_long; num = mppt_sum(pjob); *lp = max(*lp, num); rd = find_resc_def(svr_resc_def, "walltime", svr_resc_size); assert(rd != NULL); pres = find_resc_entry(at, rd); assert(pres != NULL); pres->rs_value.at_val.at_long = (long)((double)(time_now - pjob->ji_qs.ji_stime) * wallfactor); return (PBSE_NONE); } /* * Kill a task session. * Call with the task pointer and a signal number. */ int kill_task(task *ptask, int sig, int pg) { static char *id = "kill_task"; int ct = 1; int sesid; sesid = ptask->ti_qs.ti_sid; if (sesid > 1) { if (killm(C_JOB, sesid, sig) == -1) { if (errno != ESRCH) { sprintf(log_buffer, "killm: sid=%d sig=%d", sesid, sig); log_err(errno, id, log_buffer); } else { ct = 0; sprintf(log_buffer, "killm: sid=%d sig=%d", sesid, sig); log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, ptask->ti_job->ji_qs.ji_jobid, log_buffer); } } } return ct; } /* * Clean up everything related to polling. * * In the case of the sun, close the kernal if it is open. */ int mom_close_poll(void) { static char *id = "mom_close_poll"; DBPRT(("%s: entered\n", id)) return (PBSE_NONE); } /* * mom_does_checkpoint */ int mom_does_checkpoint(void) { return (CST_MACH_DEP); } /* * Checkpoint the job. * * If abort is TRUE, kill it too. */ int mach_checkpoint(task *ptask, char *path, int abort) { int cprtn; long flags = 0; if (abort) flags = CHKPNT_KILL; cprtn = checkpoint(C_SESS, ptask->ti_qs.ti_sid, path, flags); return cprtn; } /* * Restart the job from the checkpoint file. * * Return the session/job id */ long mach_restart(task *ptask, char *path) { int sid; sid = restart(path, 0); return sid; } int getprocs(void) { static unsigned int lastproc = 0; if (lastproc == reqnum) /* don't need new proc table */ return process_table_size; if (mom_get_sample() != PBSE_NONE) return 0; lastproc = reqnum; return(process_table_size); } char * cput_job(jobid) pid_t jobid; { char *id = "cput_job"; int i, nproc; int found = 0; time_t addtime; double cputime; if ((nproc = getprocs()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } cputime = 0.0; for (i = 0; i < nproc; i++) { register struct proc *pp = &process_table[i]; register struct pcomm *pc; if (pp->p_stat == 0) continue; if ((pc = pp->p_pc) == NULL) continue; if (jobid != pc->pc_sid) continue; found = 1; addtime = pp->p_utime + pp->p_stime + pp->p_sctime + pc->pc_cutime + pc->pc_cstime; DBPRT(("%s: pid %d time=%d (%d + %d + %d + %d + %d)\n", id, pp->p_pid, addtime, pp->p_utime, pp->p_stime, pp->p_sctime, pc->pc_cutime, pc->pc_cstime)) cputime += (double)addtime / (double)CLK_TCK; } if (found) { sprintf(ret_string, "%.2f", cputime * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput_proc(pid) pid_t pid; { char *id = "cput_pid"; int i, nproc; time_t addtime; if ((nproc = getprocs()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct proc *pp = &process_table[i]; register struct pcomm *pc; if (pp->p_stat == 0) continue; if (pid != pp->p_pid) continue; if ((pc = pp->p_pc) == NULL) addtime = 0; else { addtime = pp->p_utime + pp->p_stime + pp->p_sctime + pc->pc_cutime + pc->pc_cstime; DBPRT(("%s: pid %d time=%d (%d + %d + %d + %d + %d)\n", id, pid, addtime, pp->p_utime, pp->p_stime, pp->p_sctime, pc->pc_cutime, pc->pc_cstime)) } sprintf(ret_string, "%.2f", ((double)addtime / (double)CLK_TCK) * cputfactor); return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * cput(struct rm_attribute *attrib) { char *id = "cput"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (cput_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (cput_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * mem_job(jobid) pid_t jobid; { char *id = "mem_job"; int memsize; int i, nproc; int found = 0; if ((nproc = getprocs()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } memsize = 0; for (i = 0; i < nproc; i++) { register struct proc *pp = &process_table[i]; register struct pcomm *pc; if (pp->p_stat == 0) continue; if ((pc = pp->p_pc) == NULL) continue; if (jobid != pc->pc_sid) continue; found = 1; memsize += pc->pc_size; DBPRT(("%s: found pid %d size=%d total=%d\n", id, pp->p_pid, ctob(pc->pc_size), ctob(memsize))) } if (found) { sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem_proc(pid) pid_t pid; { char *id = "mem_proc"; int i, nproc; if ((nproc = getprocs()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct proc *pp = &process_table[i]; register struct pcomm *pc; if (pp->p_stat == 0) continue; if (pid != pp->p_pid) continue; if ((pc = pp->p_pc) == NULL) break; sprintf(ret_string, "%ukb", ctob(pc->pc_size) >> 10); /* KB */ return ret_string; } rm_errno = RM_ERR_EXIST; return NULL; } char * mem(struct rm_attribute *attrib) { char *id = "mem"; int value; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((value = atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") == 0) return (mem_job((pid_t)value)); else if (strcmp(attrib->a_qualifier, "proc") == 0) return (mem_proc((pid_t)value)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } char * sessions(struct rm_attribute *attrib) { char *id = "sessions"; char *fmt; int i, j, nproc, njids = 0; pid_t *jids, *hold; static int maxjid = 300; register pid_t jobid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getprocs()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((jids = (pid_t *)calloc(maxjid, sizeof(pid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ for (i = 0; i < nproc; i++) { register struct proc *pp = &process_table[i]; if (pp->p_stat == 0) continue; if (pp->p_pc == NULL) continue; if (pp->p_pc->pc_suid == 0) continue; jobid = pp->p_pc->pc_sid; DBPRT(("%s[%d]: pid: %d sid %d\n", id, njids, pp->p_pid, jobid)) for (j = 0; j < njids; j++) { if (jids[j] == jobid) break; } if (j == njids) /* not found */ { if (njids == maxjid) /* need more space */ { maxjid += 100; hold = (pid_t *)realloc(jids, maxjid * sizeof(pid_t)); if (hold == NULL) { log_err(errno, id, "realloc"); rm_errno = RM_ERR_SYSTEM; free(jids); return NULL; } jids = hold; } jids[njids++] = jobid; /* add jobid to list */ } } fmt = ret_string; for (j = 0; j < njids; j++) { checkret(&fmt, 100); if (j == 0) sprintf(fmt, "%d", (int)jids[j]); else sprintf(fmt, " %d", (int)jids[j]); fmt += strlen(fmt); } free(jids); return ret_string; } char * nsessions(struct rm_attribute *attrib) { char *result, *ch; int num = 1; if ((result = sessions(attrib)) == NULL) return result; for (ch = result; *ch; ch++) { if (*ch == ' ') /* count blanks */ num++; } sprintf(ret_string, "%d", num); return ret_string; } char * nusers(struct rm_attribute *attrib) { char *id = "nusers"; int nproc; int i, j; int nuids = 0; uid_t *uids, uid; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getprocs()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } if ((uids = calloc(nproc, sizeof(uid_t))) == NULL) { log_err(errno, id, "no memory"); rm_errno = RM_ERR_SYSTEM; return NULL; } for (i = 0; i < nproc; i++) { register struct proc *pp = &process_table[i]; if (pp->p_stat == 0) continue; if (pp->p_pc == NULL) continue; if ((uid = pp->p_pc->pc_suid) == 0) continue; DBPRT(("%s: pid %d uid %u\n", id, (int)pp->p_pid, uid)) for (j = 0; j < nuids; j++) { if (uids[j] == uid) break; } if (j == nuids) /* not found */ uids[nuids++] = uid; /* so add it to list */ } sprintf(ret_string, "%d", nuids); free(uids); return ret_string; } char * pids(struct rm_attribute *attrib) { char *id = "pids"; pid_t jobid; struct pcomm *pc; int i, nproc; char *fmt; int num_pids; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if ((jobid = (pid_t)atoi(attrib->a_value)) == 0) { sprintf(log_buffer, "bad param: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "session") != 0) { rm_errno = RM_ERR_BADPARAM; return NULL; } if ((nproc = getprocs()) == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } /* ** Search for members of session */ fmt = ret_string; for (i = 0; i < nproc; i++) { register struct proc *pp = &process_table[i]; if (pp->p_stat == 0) continue; if ((pc = pp->p_pc) == NULL) continue; if (jobid != pc->pc_sid) continue; sprintf(fmt, " %d", pp->p_pid); fmt += strlen(fmt); num_pids++; } if (num_pids == 0) { rm_errno = RM_ERR_EXIST; return NULL; } return ret_string; } static char * totmem(struct rm_attribute *attrib) { char *id = "totmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%d blocks=%d\n", id, fsbuf.f_bsize, fsbuf.f_blocks)) /* in KB */ sprintf(ret_string, "%ukb", (fsbuf.f_bsize * fsbuf.f_blocks) >> 10); return ret_string; } static char * availmem(struct rm_attribute *attrib) { char *id = "availmem"; struct statfs fsbuf; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(procfs, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_SYSTEM; return NULL; } DBPRT(("%s: bsize=%d bfree=%d\n", id, fsbuf.f_bsize, fsbuf.f_bfree)) /* in KB */ sprintf(ret_string, "%ukb", (fsbuf.f_bsize * fsbuf.f_bfree) >> 10); return ret_string; } static char * ncpus(struct rm_attribute *attrib) { char *id = "ncpus"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ld", tinfo.mc_ncpu); system_ncpus = tinfo.mc_ncpu; return ret_string; } static char * physmem(struct rm_attribute *attrib) { char *id = "physmem"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (tinfo.mc_msz * sizeof(int)) >> 10); return ret_string; } char * size_fs(char *param) { char *id = "size_fs"; FILE *mf; struct mntent *mp; struct statfs fsbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (statfs(param, &fsbuf, sizeof(struct statfs), 0) == -1) { log_err(errno, id, "statfs"); rm_errno = RM_ERR_BADPARAM; return NULL; } /* in KB */ sprintf(ret_string, "%lukb", (unsigned long)((fsbuf.f_bsize * fsbuf.f_bfree) >> 10)); return ret_string; } char * size_file(char *param) { char *id = "size_file"; struct stat sbuf; if (param[0] != '/') { sprintf(log_buffer, "%s: not full path filesystem name: %s\n", id, param); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (stat(param, &sbuf) == -1) { log_err(errno, id, "stat"); rm_errno = RM_ERR_BADPARAM; return NULL; } sprintf(ret_string, "%ukb", sbuf.st_size >> 10); /* KB */ return ret_string; } char * size(struct rm_attribute *attrib) { char *id = "size"; char *param; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } param = attrib->a_value; if (strcmp(attrib->a_qualifier, "file") == 0) return (size_file(param)); else if (strcmp(attrib->a_qualifier, "fs") == 0) return (size_fs(param)); else { rm_errno = RM_ERR_BADPARAM; return NULL; } } time_t maxtm; void setmax(char *dev) { struct stat sb; if (stat(dev, &sb) == -1) return; if (maxtm < sb.st_atime) maxtm = sb.st_atime; return; } char * idletime(struct rm_attribute *attrib) { char *id = "idletime"; DIR *dp; struct dirent *de; char ttyname[50]; time_t curtm; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((dp = opendir("/dev")) == NULL) { log_err(errno, id, "opendir /dev"); rm_errno = RM_ERR_SYSTEM; return NULL; } maxtm = 0; curtm = time(NULL); while ((de = readdir(dp)) != NULL) { if (maxtm >= curtm) break; if (strncmp(de->d_name, "tty", 3)) continue; sprintf(ttyname, "/dev/%s", de->d_name); setmax(ttyname); } closedir(dp); sprintf(ret_string, "%d", MAX(0, curtm - maxtm)); return ret_string; } int quotasize(int blocks) { if (QFV_MINVALUE <= blocks && blocks <= QFV_MAXVALUE) { sprintf(ret_string, "%lukb", (BSIZE * blocks) >> 10); /* KB */ return 0; } switch (blocks) { case QFV_DEFAULT: strcpy(ret_string, "default"); return 1; case QFV_NOEVAL: strcpy(ret_string, "infinity"); break; case QFV_PREVENT: strcpy(ret_string, "prevent"); break; default: strcpy(ret_string, "unspecified"); break; } return 0; } typedef int (*ifunc)(); static char * quota(struct rm_attribute *attrib) { char *id = "quota"; time_t now; int ident; char dirname[FILENAME_MAX]; struct q_request qi; struct qf_header header; struct q_entry *qu; #if SRFS struct fsres_s srfsinfo; static unsigned int lastproc = 0; static char srfsdir[FILENAME_MAX]; #endif static char *bean_type[] = { "account", /* 0 */ "group", /* 1 */ "user" /* 2 */ }; static ifunc bean_func[] = { nam2acid, nam2gid, nam2uid }; enum bean_name { account, group, user, bean_end } bean; static char *type_array[] = { "harddata", "softdata", "currdata", "hardfile", "softfile", "currfile", "timedata", "timefile", "snap_avail", /* srfs */ "ares_avail", /* srfs */ "res_total", /* srfs */ "soft_res", /* srfs */ "delta", /* srfs */ "reserve", /* srfs */ }; enum type_name { harddata, softdata, currdata, hardfile, softfile, currfile, timedata, timefile, snap_avail, ares_avail, res_total, soft_res, delta, reserve, type_end } type; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "type")) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } for (type = 0; type < type_end; type++) { if (strcmp(attrib->a_value, type_array[type]) == 0) break; } if (type == type_end) /* check to see if command is legal */ { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } if (strcmp(attrib->a_qualifier, "dir") != 0) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } if (attrib->a_value[0] == '/') /* must be absolute path */ strcpy(dirname, attrib->a_value); #if SRFS else if (attrib->a_value[0] == '$') /* variable location */ { char *var = &attrib->a_value[1]; char *val; if ((val = (char *)var_value(var)) == NULL) { sprintf(log_buffer, "variable %s not found", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } strcpy(dirname, val); } #endif /* SRFS */ else { sprintf(log_buffer, "not an absolute path: %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } /* ** See if it's a srfs request. They don't need an id. */ if (type >= snap_avail) { if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } #if SRFS /* check to see if we need to call quotactl() */ if (lastproc == reqnum && strcmp(dirname, srfsdir) == 0) { DBPRT(("%s: already got srfsinfo\n", id)) } else { if (quotactl(dirname, SRFS_INFO, (caddr_t)&srfsinfo) == -1) { log_err(errno, id, "quotactl(SRFS_INFO)"); rm_errno = RM_ERR_SYSTEM; return NULL; } strcpy(srfsdir, dirname); lastproc = reqnum; } /* all sizes in KB */ switch (type) { case snap_avail: sprintf(ret_string, "%ukb", (BSIZE * srfsinfo.snap_avail) >> 10); break; case ares_avail: sprintf(ret_string, "%ukb", (BSIZE * srfsinfo.ares_avail) >> 10); break; case res_total: sprintf(ret_string, "%d", (BSIZE * srfsinfo.res_total) >> 10); break; case soft_res: sprintf(ret_string, "%s", srfsinfo.soft_res ? "true" : "false"); break; case delta: sprintf(ret_string, "%lukb", (BSIZE * srfsinfo.delta) >> 10); break; case reserve: sprintf(ret_string, "%ld", (-BSIZE * srfsinfo.reserve) >> 10); break; } return ret_string; #else log_err(errno, id, no_srfs); rm_errno = RM_ERR_SYSTEM; return NULL; #endif } /* ** Check type of id: user, group or acct. */ if ((attrib = momgetattr(NULL)) == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } for (bean = 0; bean < bean_end; bean++) { if (strcmp(attrib->a_qualifier, bean_type[bean]) == 0) break; } if (bean == bean_end) { sprintf(log_buffer, "bad param: %s=%s", attrib->a_qualifier, attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } ident = atoi(attrib->a_value); if (ident == 0) { ident = bean_func[bean](attrib->a_value); if (ident == -1) { sprintf(log_buffer, "%s not found: %s", bean_type[bean], attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } } if (momgetattr(NULL)) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } qi.qf_entry.id = ident; qi.qf_magic = QF_MAGIC; if (quotactl(dirname, Q_GETQUOTA, (caddr_t)&qi) == -1) { log_err(errno, id, "quotactl(Q_GETQUOTA)"); rm_errno = RM_ERR_SYSTEM; return NULL; } qu = NULL; switch (bean) { case account: if (qi.acct) qu = &qi.qf_entry.acct_q; break; case group: if (qi.group) qu = &qi.qf_entry.group_q; break; case user: if (qi.user) qu = &qi.qf_entry.user_q; break; } if (qu == NULL) { sprintf(log_buffer, "%s quota information not returned", bean_type[bean]); log_err(-1, id, log_buffer); rm_errno = RM_ERR_EXIST; return NULL; } switch (type) { case harddata: if (quotasize(qu->f_quota)) break; return ret_string; case softdata: if (quotasize(qu->f_warn)) break; return ret_string; case currdata: sprintf(ret_string, "%ld", BSIZE*qu->f_use); return ret_string; case hardfile: if (quotasize(qu->i_quota)) break; return ret_string; case softfile: if (quotasize(qu->i_warn)) break; return ret_string; case currfile: sprintf(ret_string, "%ld", qu->i_use); return ret_string; case timedata: case timefile: now = time((time_t *)NULL); if (qu->f_wtime > now) /* time is in the future */ sprintf(ret_string, "%ld", qu->f_wtime - now); else strcpy(ret_string, "0"); return ret_string; } /* ** If we get here, the default number is needed. */ DBPRT(("%s: getting default info\n", id)) header.qf_magic = QF_MAGIC; if (quotactl(dirname, Q_GETHEADER, (caddr_t)&header) == -1) { log_err(errno, id, "quotactl(Q_GETHEADER)"); rm_errno = RM_ERR_SYSTEM; return NULL; } switch (type) { case harddata: (void)quotasize(header.user_h.def_fq); return ret_string; case softdata: (void)quotasize(header.user_h.warn_fq); return ret_string; case hardfile: sprintf(ret_string, "%ld", header.user_h.def_iq); return ret_string; case softfile: sprintf(ret_string, "%ld", header.user_h.warn_iq); return ret_string; } return ret_string; } static char * srfs_reserve(struct rm_attribute *attrib) { char *id = "srfs_reserve"; #if SRFS char *dir, *end, *name; long num; if (attrib == NULL) { log_err(-1, id, no_parm); rm_errno = RM_ERR_NOPARAM; return NULL; } for (;;) { if ((name = (char *)var_value(attrib->a_qualifier)) == NULL) { sprintf(log_buffer, "unknown qualifier %s", attrib->a_qualifier); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } num = strtol(attrib->a_value, &end, 10); if (end == attrib->a_value) { sprintf(log_buffer, "bad number %s", attrib->a_value); log_err(-1, id, log_buffer); rm_errno = RM_ERR_BADPARAM; return NULL; } num = -(num + BSIZE - 1) / BSIZE; /* convert to blks */ if (quotactl(name, SRFS_RESERVE, (caddr_t)&num) == -1) { log_err(errno, id, "quotactl(SRFS_RESERVE)"); rm_errno = RM_ERR_SYSTEM; return NULL; } if ((attrib = momgetattr(NULL)) == NULL) break; } return "okay"; #else log_err(errno, id, no_srfs); rm_errno = RM_ERR_SYSTEM; return NULL; #endif } int get_la(double *rv) { char *id = "get_la"; *rv = (double)sysinfo.avenrun[0]; return 0; } static char * swaprate(struct rm_attribute *attrib) { char *id = "swaprate"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", swap_rate); return ret_string; } static char * swapinrate(struct rm_attribute *attrib) { char *id = "swapinrate"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", swapin_rate); return ret_string; } static char * swapoutrate(struct rm_attribute *attrib) { char *id = "swapoutrate"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", swapout_rate); return ret_string; } static struct swapper swapper; int getswap(void) { static unsigned int lastproc = 0; char *id = "getswap"; struct tbs info; if (lastproc == reqnum) /* don't need new swap info */ return 0; if (tabinfo(SWAPTAB, &info) == -1) { log_err(errno, id, "tabinfo(SWAPTAB)"); return 1; } if (tabread(SWAPTAB, (char *)&swapper, info.ent * info.len, info.head) == -1) { log_err(errno, id, "tabread(SWAPTAB)"); return 1; } DBPRT(("Total swap space: %8d\tAvailable swap space: %8d\n", swapper.swp_map.bmp_total * SWP_WGHT, swapper.swp_map.bmp_avail * SWP_WGHT)) lastproc = reqnum; return 0; } static char * swapused(struct rm_attribute *attrib) { char *id = "swapused"; int sout; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getswap()) return NULL; sout = swapper.swp_map.bmp_total - swapper.swp_map.bmp_avail; /* in KB */ sprintf(ret_string, "%ukb", (ctob(swutoc(sout)) + 1023) >> 10); return ret_string; } static char * swapavail(struct rm_attribute *attrib) { char *id = "swapused"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getswap()) return NULL; /* in KB */ sprintf(ret_string, "%ukb", (ctob(swutoc(swapper.swp_map.bmp_avail)) + 1023) >> 10); return ret_string; } static char * swaptotal(struct rm_attribute *attrib) { char *id = "swapused"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (getswap()) return NULL; /* in KB */ sprintf(ret_string, "%ukb", (ctob(swutoc(swapper.swp_map.bmp_total)) + 1023) >> 10); return ret_string; } static char * cpuidle(struct rm_attribute *attrib) { char *id = "cpuidle"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", cpu_idle); return ret_string; } static char * cpusysw(struct rm_attribute *attrib) { char *id = "cpusysw"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", cpu_sysw); return ret_string; } static char * cpuguest(struct rm_attribute *attrib) { char *id = "cpuguest"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", cpu_guest); return ret_string; } static char * cpuuser(struct rm_attribute *attrib) { char *id = "cpuuser"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", cpu_user); return ret_string; } static char * cpuunix(struct rm_attribute *attrib) { char *id = "cpuunix"; if (attrib) { log_err(-1, id, extra_parm); rm_errno = RM_ERR_BADPARAM; return NULL; } if (last_time == 0) { rm_errno = RM_ERR_SYSTEM; return NULL; } sprintf(ret_string, "%.2f", cpu_unix); return ret_string; } void scan_non_child_tasks(void) { /* NYI */ return; } /* END scan_non_child_tasks() */ torque-2.4.16/src/resmom/unicos8/Makefile.am0000664000113300011330000000030611272401242015543 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" noinst_LIBRARIES = libmommach.a libmommach_a_SOURCES = mom_mach.c mom_mach.h mom_start.c pe_input.c torque-2.4.16/src/scheduler.tcl/0000777000113300011330000000000011614035203013437 500000000000000torque-2.4.16/src/scheduler.tcl/site_tclWrap.c0000664000113300011330000001067211272401237016173 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include "portability.h" #include "pbs_error.h" #include "log.h" /* ** This is a site dependent routine provided as a place holder ** for whatever C code which may be required for your scheduler. */ void site_cmds(interp) Tcl_Interp *interp; { #ifndef NDEBUG char *id = "site_cmds"; #endif DBPRT(("%s: entered\n", id)) return; } torque-2.4.16/src/scheduler.tcl/sample_scripts/0000777000113300011330000000000011614035203016467 500000000000000torque-2.4.16/src/scheduler.tcl/sample_scripts/loadave0000664000113300011330000001117311272401237017752 00000000000000# # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # A simple TCL scheduler script to run the first job found if the # load average is less than or equal to 2. # # Author: Tom Proett # # connect to resource monitor and get load average set host_con [openrm localhost] puts "got $host_con for host_con" if {$host_con < 0} { puts "bad return from openrm" return } addreq $host_con "loadave" set la [getreq $host_con] closerm $host_con puts "load average is $la" # if {$la > 2.0} { puts "system load is $la which is above the PBS limit" return } # set jobs [pbsselstat] foreach job $jobs { set jid [lindex $job 0] pbsrunjob $jid return } torque-2.4.16/src/scheduler.tcl/sample_scripts/README0000664000113300011330000000304011272401237017266 00000000000000Samples of PBS Scheduler Scripts Written in TCL. The sample Tcl based scheduler, loadavg, included in this directory is provided solely as an example of how a scheduler can be implemented in the Tcl framework. This is a simple script that checks the system load average and starts the first job if the average is under two. ========== Other sites have developed Tcl based schedulers. Purdue University "NCSS" Fair Share Scheduler Wendy Lin of Purdue University has written a "Fair Share" Scheduler for Purdue's SP-2. It is available via anonymous FTP from Purdue. Please see the file "./Purdue_NCSS.ReadMe". ---------- PBS at the University of Missouri-Columbia supports an eight processor SGI Power Challenge L. If you wish to control jobs on a SMP, you may find his scheduler of interest. The scheduling policy is described by http://www.cclabs.missouri.edu/things/shiva/pbs/#policy The scheduler was developed by Hossein Tahani at University of Missouri-Columbia ---------- PBS at the University of New Hampshire supports a cluster of Sun Workstations running Solaris. If you wish to distribute jobs across a cluster, you may find this scheduler of interest. Contact: Thomas E. Milliman Space Science Center University of New Hampshire --------- PBS at the University of Texas at Dallas supports a Sun Ultra Enterprise 6000 running Solaris. A brief reference can be found at http://www.utdallas.edu/utdgeneral/ir/unix/6000/ You may find this scheduler of interest. Contact: Amos Gouaux University of Texas at Dallas torque-2.4.16/src/scheduler.tcl/Makefile.in0000664000113300011330000005365611605403767015457 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(pbs_sched_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk sbin_PROGRAMS = pbs_sched$(EXEEXT) subdir = src/scheduler.tcl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_pbs_sched_OBJECTS = pbs_sched.$(OBJEXT) pbs_tclWrap.$(OBJEXT) \ site_tclWrap.$(OBJEXT) get_4byte.$(OBJEXT) pbs_sched_OBJECTS = $(am_pbs_sched_OBJECTS) am__DEPENDENCIES_1 = ../lib/Libpbs/libtorque.la am__DEPENDENCIES_2 = pbs_sched_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pbs_sched_SOURCES) DIST_SOURCES = $(pbs_sched_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter PBS_LIBS = ../lib/Libpbs/libtorque.la AM_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" -DPBS_ENVIRON=\"$(PBS_ENVIRON)\" $(MY_TCL_INCS) pbs_sched_LDADD = $(PBS_LIBS) $(MY_TCL_LIBS) pbs_sched_SOURCES = pbs_sched.c pbs_tclWrap.c site_tclWrap.c \ ../scheduler.cc/get_4byte.c EXTRA_DIST = sample_scripts/README sample_scripts/loadave all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scheduler.tcl/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scheduler.tcl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done pbs_sched$(EXEEXT): $(pbs_sched_OBJECTS) $(pbs_sched_DEPENDENCIES) @rm -f pbs_sched$(EXEEXT) $(LINK) $(pbs_sched_LDFLAGS) $(pbs_sched_OBJECTS) $(pbs_sched_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_4byte.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_sched.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_tclWrap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_tclWrap.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< get_4byte.o: ../scheduler.cc/get_4byte.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT get_4byte.o -MD -MP -MF "$(DEPDIR)/get_4byte.Tpo" -c -o get_4byte.o `test -f '../scheduler.cc/get_4byte.c' || echo '$(srcdir)/'`../scheduler.cc/get_4byte.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/get_4byte.Tpo" "$(DEPDIR)/get_4byte.Po"; else rm -f "$(DEPDIR)/get_4byte.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.cc/get_4byte.c' object='get_4byte.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o get_4byte.o `test -f '../scheduler.cc/get_4byte.c' || echo '$(srcdir)/'`../scheduler.cc/get_4byte.c get_4byte.obj: ../scheduler.cc/get_4byte.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT get_4byte.obj -MD -MP -MF "$(DEPDIR)/get_4byte.Tpo" -c -o get_4byte.obj `if test -f '../scheduler.cc/get_4byte.c'; then $(CYGPATH_W) '../scheduler.cc/get_4byte.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.cc/get_4byte.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/get_4byte.Tpo" "$(DEPDIR)/get_4byte.Po"; else rm -f "$(DEPDIR)/get_4byte.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.cc/get_4byte.c' object='get_4byte.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o get_4byte.obj `if test -f '../scheduler.cc/get_4byte.c'; then $(CYGPATH_W) '../scheduler.cc/get_4byte.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.cc/get_4byte.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils $(distdir)/sample_scripts @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-exec-hook install-info install-info-am \ install-man install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-hook uninstall-info-am \ uninstall-sbinPROGRAMS install-exec-hook: rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbs_sched$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/scheduler.tcl/pbs_tclWrap.c0000664000113300011330000011262511272401237016014 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "resmon.h" #include "cmds.h" #include "rm.h" extern void site_cmds(Tcl_Interp *); char badparm[] = "%s: bad parameter"; char missingfd[] = "%s: missing file descriptor"; char not_connected[] = "not connected"; char fail[] = "failed"; Tcl_Obj *pbserr; int connector = -1; #define SET_PBSERR(value) \ (void)Tcl_ObjSetVar2(interp, pbserr, NULL, \ Tcl_NewIntObj((value)), TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) int OpenRM(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int port = 0; int fd; char *host; if (objc == 3) { if (Tcl_GetIntFromObj(interp, objv[2], &port) != TCL_OK) return TCL_ERROR; } else if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "host ?port?"); return TCL_ERROR; } host = Tcl_GetStringFromObj(objv[1], NULL); if ((fd = openrm(host, port)) < 0) { Tcl_PosixError(interp); log_err(pbs_errno, Tcl_GetStringFromObj(objv[0], NULL), host); } SET_PBSERR(pbs_errno); Tcl_SetObjResult(interp, Tcl_NewIntObj(fd)); return TCL_OK; } int CloseRM(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int fd, ret; char *cmd; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (objc != 2) { sprintf(log_buffer, missingfd, cmd); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &fd) != TCL_OK) return TCL_ERROR; if ((ret = closerm(fd)) == -1) { Tcl_PosixError(interp); log_err(pbs_errno, cmd, Tcl_GetStringFromObj(objv[1], NULL)); } SET_PBSERR(pbs_errno); Tcl_SetObjResult(interp, Tcl_NewIntObj(ret)); return TCL_OK; } int DownRM(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int fd, ret; char *cmd; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (objc != 2) { sprintf(log_buffer, missingfd, cmd); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &fd) != TCL_OK) return TCL_ERROR; if ((ret = downrm(fd)) == -1) { Tcl_PosixError(interp); log_err(pbs_errno, cmd, Tcl_GetStringFromObj(objv[1], NULL)); } SET_PBSERR(pbs_errno); Tcl_SetObjResult(interp, Tcl_NewIntObj(ret)); return TCL_OK; } int ConfigRM(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int fd, ret; char *cmd, *filename; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (objc != 3) { sprintf(log_buffer, "%s: missing file descriptor or filename", cmd); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &fd) != TCL_OK) return TCL_ERROR; filename = Tcl_GetStringFromObj(objv[2], NULL); ret = configrm(fd, filename); if (ret == -1) { Tcl_PosixError(interp); log_err(pbs_errno, cmd, filename); } SET_PBSERR(pbs_errno); Tcl_SetObjResult(interp, Tcl_NewIntObj(ret)); return TCL_OK; } int AddREQ(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int fd, ret; char *cmd, *request; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (objc != 3) { sprintf(log_buffer, "%s: missing file descriptor or request", cmd); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &fd) != TCL_OK) return TCL_ERROR; request = Tcl_GetStringFromObj(objv[2], NULL); ret = addreq(fd, request); if (ret == -1) { Tcl_PosixError(interp); log_err(pbs_errno, cmd, request); } SET_PBSERR(pbs_errno); Tcl_SetObjResult(interp, Tcl_NewIntObj(ret)); return TCL_OK; } int AllREQ(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { int ret; if (argc != 2) { sprintf(log_buffer, "%s: missing request", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } ret = allreq(argv[1]); SET_PBSERR(pbs_errno); Tcl_SetObjResult(interp, Tcl_NewIntObj(ret)); return TCL_OK; } int GetREQ(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { int fd; char *ret, *getreq(); char *cmd; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (objc != 2) { sprintf(log_buffer, missingfd, cmd); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &fd) != TCL_OK) return TCL_ERROR; if ((ret = getreq(fd)) == NULL) { if (pbs_errno) { Tcl_PosixError(interp); log_err(pbs_errno, cmd, Tcl_GetStringFromObj(objv[1], NULL)); } SET_PBSERR(pbs_errno); } else { int err = 0; Tcl_SetResult(interp, ret, (Tcl_FreeProc *)free); if (*ret == '?') { if (strlen(ret) > (size_t)2 && /* look for err num */ Tcl_GetInt(interp, &ret[2], &err) != TCL_OK) return TCL_ERROR; } SET_PBSERR(err); } return TCL_OK; } int FlushREQ(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { if (argc != 1) { sprintf(log_buffer, badparm, argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } flushreq(); SET_PBSERR(pbs_errno); return TCL_OK; } int ActiveREQ(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { int ret; if (argc != 1) { sprintf(log_buffer, badparm, argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } ret = activereq(); if (ret == -1) { Tcl_PosixError(interp); sprintf(log_buffer, "result %d", ret); log_err(pbs_errno, argv[0], log_buffer); } SET_PBSERR(pbs_errno); Tcl_SetObjResult(interp, Tcl_NewIntObj(ret)); return TCL_OK; } int FullResp(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { int flag; if (argc != 2) { sprintf(log_buffer, "%s: missing flag", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (Tcl_GetBoolean(interp, argv[1], &flag) != TCL_OK) return TCL_ERROR; fullresp(flag); SET_PBSERR(0); return TCL_OK; } int PBS_Connect(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *server = NULL; if (argc == 2) server = argv[1]; else if (argc != 1) { sprintf(log_buffer, "%s: wrong # args: ?server?", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector >= 0) pbs_disconnect(connector); pbs_errno = PBSE_NONE; if ((connector = pbs_connect(server)) < 0) { Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); sprintf(log_buffer, "%s (%d)", server ? server : "DefaultServer", pbs_errno); log_err(-1, argv[0], log_buffer); } else Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_Disconnect(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; if (argc != 1) { sprintf(log_buffer, badparm, argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } pbs_errno = PBSE_NONE; if (connector >= 0 && pbs_disconnect(connector)) { Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); } else { Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); connector = -1; } SET_PBSERR(pbs_errno); return TCL_OK; } Tcl_Obj * attrlist(interp, ap) Tcl_Interp *interp; struct attrl *ap; { Tcl_Obj *ret; ret = Tcl_NewListObj(0, NULL); /* null list */ while (ap) { Tcl_Obj *twol[2]; twol[0] = Tcl_NewStringObj(ap->name, -1); if (ap->resource) { Tcl_AppendStringsToObj(twol[0], TCL_ATRSEP, ap->resource, NULL); } twol[1] = Tcl_NewStringObj(ap->value, -1); Tcl_ListObjAppendElement(interp, ret, Tcl_NewListObj(2, twol)); ap = ap->next; } return (ret); } void batresult(interp, bs) Tcl_Interp *interp; struct batch_status *bs; { Tcl_Obj *batchl; struct batch_status *bp; batchl = Tcl_NewObj(); /* empty list */ for (bp = bs; bp; bp = bp->next) { Tcl_Obj *threel[3]; threel[0] = Tcl_NewStringObj(bp->name, -1); threel[1] = attrlist(interp, bp->attribs); threel[2] = Tcl_NewStringObj(bp->text, -1); Tcl_ListObjAppendElement(interp, batchl, Tcl_NewListObj(3, threel)); } Tcl_SetObjResult(interp, batchl); pbs_statfree(bs); } int PBS_StatServ(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; struct batch_status *bs; Tcl_Obj *threel[3]; if (argc != 1) { sprintf(log_buffer, badparm, argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if ((bs = pbs_statserver(connector, NULL, NULL)) == NULL) { if (pbs_errno != PBSE_NONE) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); } } else { threel[0] = Tcl_NewStringObj(bs->name, -1); threel[1] = attrlist(interp, bs->attribs); threel[2] = Tcl_NewStringObj(bs->text, -1); Tcl_SetObjResult(interp, Tcl_NewListObj(3, threel)); pbs_statfree(bs); } SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_StatJob(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; struct batch_status *bs; if (argc != 1) { sprintf(log_buffer, badparm, argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if ((bs = pbs_statjob(connector, NULL, NULL, NULL)) == NULL) { if (pbs_errno != PBSE_NONE) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); } } else batresult(interp, bs); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_SelStat(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; struct batch_status *bs; static struct attropl att1 = { NULL, "queue_type", NULL, "E", EQ }; static struct attropl att2 = { &att1, "job_state", NULL, "Q", EQ }; if (argc != 1) { sprintf(log_buffer, badparm, argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if ((bs = pbs_selstat(connector, &att2, NULL)) == NULL) { if (pbs_errno != PBSE_NONE) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); } } else batresult(interp, bs); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_StatQue(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; struct batch_status *bs; if (argc != 1) { sprintf(log_buffer, badparm, argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if ((bs = pbs_statque(connector, NULL, NULL, NULL)) == NULL) { if (pbs_errno != PBSE_NONE) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); } } else batresult(interp, bs); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_StatNode(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *msg, *cmd; char *node = NULL; struct batch_status *bs; if (objc == 2) node = Tcl_GetStringFromObj(objv[1], NULL); else if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, "?node?"); return TCL_ERROR; } cmd = Tcl_GetStringFromObj(objv[0], NULL); if (connector < 0) { log_err(-1, cmd, not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if ((bs = pbs_statnode(connector, node, NULL, NULL)) == NULL) { if (pbs_errno != PBSE_NONE) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, cmd, log_buffer); } } else batresult(interp, bs); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_AsyRunJob(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; char *location = NULL; if (argc == 3) location = argv[2]; else if (argc != 2) { sprintf(log_buffer, "%s: wrong # args: job_id ?location?", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); if (pbs_asyrunjob(connector, argv[1], location, NULL)) { Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); } SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_RunJob(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; char *location = NULL; if (argc == 3) location = argv[2]; else if (argc != 2) { sprintf(log_buffer, "%s: wrong # args: job_id ?location?", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if (pbs_runjob(connector, argv[1], location, NULL)) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); } else Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_ReRun(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; char *extend = "0"; if (argc != 2) { sprintf(interp->result, "%s: wrong # args: job_id", argv[0]); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } interp->result = "0"; if (pbs_rerunjob(connector, argv[1], extend)) { interp->result = "-1"; msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); } else { Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); } sprintf(log_buffer, "%d", pbs_errno); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_MoveJob(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; char *location = NULL; char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; if (argc == 3) location = argv[2]; else if (argc != 2) { sprintf(log_buffer, "%s: wrong # args: job_id ?location?", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if (get_server(argv[1], job_id_out, server_out)) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (pbs_movejob(connector, job_id_out, location, NULL)) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); } else Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_DelJob(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; char *message = NULL; if (argc == 3) message = argv[2]; else if (argc != 2) { sprintf(log_buffer, "%s: wrong # args: job_id ?message?", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if (pbs_deljob(connector, argv[1], message)) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); } else Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_HoldJob(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { char *msg; if (argc != 2) { sprintf(log_buffer, "%s: wrong # args: job_id", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if (pbs_holdjob(connector, argv[1], SYSTEM_HOLD, NULL)) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, argv[0], log_buffer); Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); } else Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_QueueOp(clientData, interp, argc, argv, attr) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; struct attropl *attr; { int merr; if (argc != 2) { sprintf(log_buffer, "%s: wrong # args: queue", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (connector < 0) { log_err(-1, argv[0], not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } merr = pbs_manager(connector, MGR_CMD_SET, MGR_OBJ_QUEUE, argv[1], attr, NULL); if (merr != 0) { sprintf(log_buffer, "%s: %s", argv[0], pbs_geterrmsg(connector)); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_EnableQueue(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { static struct attropl attr = { NULL, "enabled", NULL, "TRUE", SET }; return PBS_QueueOp(clientData, interp, argc, argv, &attr); } int PBS_DisableQueue(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { static struct attropl attr = { NULL, "enabled", NULL, "FALSE", SET }; return PBS_QueueOp(clientData, interp, argc, argv, &attr); } int PBS_StartQueue(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { static struct attropl attr = { NULL, "started", NULL, "TRUE", SET }; return PBS_QueueOp(clientData, interp, argc, argv, &attr); } int PBS_StopQueue(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { static struct attropl attr = { NULL, "started", NULL, "FALSE", SET }; return PBS_QueueOp(clientData, interp, argc, argv, &attr); } int PBS_AlterJob(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *msg; int i, num, tre, ret; Tcl_Obj **listp, **indp; struct attrl *attrs, *atp = NULL; char *cmd; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "job_id attribute(s)"); return TCL_ERROR; } if ((ret = Tcl_ListObjGetElements(interp, objv[2], &num, &listp)) != TCL_OK) return ret; cmd = Tcl_GetStringFromObj(objv[0], NULL); attrs = NULL; for (i = 0; i < num; i++) { if ((ret = Tcl_ListObjGetElements(interp, listp[i], &tre, &indp)) != TCL_OK) goto done; if (tre != 3) { sprintf(log_buffer, "%s: bad attribute format: %s", cmd, Tcl_GetStringFromObj(listp[i], NULL)); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); ret = TCL_ERROR; goto done; } atp = (struct attrl *)malloc(sizeof(struct attrl)); atp->name = strdup(Tcl_GetStringFromObj(indp[0], NULL)); atp->resource = strdup(Tcl_GetStringFromObj(indp[1], NULL)); atp->value = strdup(Tcl_GetStringFromObj(indp[2], NULL)); atp->next = attrs; attrs = atp; } if (connector < 0) { log_err(-1, cmd, not_connected); SET_PBSERR(PBSE_NOSERVER); goto done; } if (pbs_alterjob(connector, Tcl_GetStringFromObj(objv[1], NULL), atp, NULL)) { Tcl_SetObjResult(interp, Tcl_NewIntObj(-1)); msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, cmd, log_buffer); } else Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); done: for (atp = attrs; attrs; atp = attrs) { attrs = atp->next; free(atp->name); free(atp->resource); free(atp->value); free(atp); } SET_PBSERR(pbs_errno); return ret; } int PBS_RescQuery(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *msg; int i, num, ret; Tcl_Obj **listp, *fourl[4], *retl; char *cmd; char **res_array; int *avail_array, *alloc_array, *reser_array, *down_array; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "{resource1 resource2 ...}"); return TCL_ERROR; } if ((ret = Tcl_ListObjGetElements(interp, objv[1], &num, &listp)) != TCL_OK) return ret; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (connector < 0) { log_err(-1, cmd, not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } res_array = (char **)malloc(sizeof(char *) * num); avail_array = (int *)malloc(sizeof(int) * num); alloc_array = (int *)malloc(sizeof(int) * num); reser_array = (int *)malloc(sizeof(int) * num); down_array = (int *)malloc(sizeof(int) * num); for (i = 0; i < num; i++) res_array[i] = Tcl_GetStringFromObj(listp[i], NULL); retl = Tcl_NewObj(); /* empty list */ if (pbs_rescquery(connector, res_array, num, avail_array, alloc_array, reser_array, down_array)) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, cmd, log_buffer); } else { for (i = 0; i < num; i++) { fourl[0] = Tcl_NewIntObj(avail_array[i]); fourl[1] = Tcl_NewIntObj(alloc_array[i]); fourl[2] = Tcl_NewIntObj(reser_array[i]); fourl[3] = Tcl_NewIntObj(down_array[i]); Tcl_ListObjAppendElement(interp, retl, Tcl_NewListObj(4, fourl)); } } Tcl_SetObjResult(interp, retl); free(res_array); free(avail_array); free(alloc_array); free(reser_array); free(down_array); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_RescReserve(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *msg; int i, num, ret; Tcl_Obj **listp; char *cmd; char **res_array; resource_t resid; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "resource_id {resource1 resource2 ...}"); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &resid) != TCL_OK) return TCL_ERROR; if ((ret = Tcl_ListObjGetElements(interp, objv[2], &num, &listp)) != TCL_OK) return ret; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (connector < 0) { log_err(-1, cmd, not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } res_array = (char **)malloc(sizeof(char *) * num); for (i = 0; i < num; i++) res_array[i] = Tcl_GetStringFromObj(listp[i], NULL); if (pbs_rescreserve(connector, res_array, num, &resid)) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, cmd, log_buffer); } Tcl_SetObjResult(interp, Tcl_NewIntObj(resid)); SET_PBSERR(pbs_errno); return TCL_OK; } int PBS_RescRelease(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { char *msg; int ret; char *cmd; resource_t resid; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "resource_id"); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &resid) != TCL_OK) return TCL_ERROR; cmd = Tcl_GetStringFromObj(objv[0], NULL); if (connector < 0) { log_err(-1, cmd, not_connected); SET_PBSERR(PBSE_NOSERVER); return TCL_OK; } if ((ret = pbs_rescrelease(connector, resid)) != 0) { msg = pbs_geterrmsg(connector); sprintf(log_buffer, "%s (%d)", msg ? msg : fail, pbs_errno); log_err(-1, cmd, log_buffer); } Tcl_SetObjResult(interp, Tcl_NewIntObj(ret)); SET_PBSERR(pbs_errno); return TCL_OK; } int DateTime(clientData, interp, argc, argv) ClientData clientData; Tcl_Interp *interp; int argc; char *argv[]; { time_t when; struct tm tm, *t = NULL; int i, yyy, len; char rtime[64], hold[8]; static char *wkday[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL }; switch (argc) { case 1: /* current date/time */ when = time((time_t *)NULL); sprintf(log_buffer, "%ld", (long)when); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_OK; case 2: strncpy(rtime, argv[1], sizeof(rtime)); len = strlen(rtime); when = 0; if (len < 12) break; /* absolute date/time */ for (i = 0; i < len; i++) { if (!isdigit(rtime[i])) break; } if (i != len || len > 14) { sprintf(log_buffer, "%s: bad absolute date format: %s", argv[0], rtime); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } yyy = len - 10; for (i = 0; i < yyy; i++) hold[i] = rtime[i]; hold[i] = '\0'; tm.tm_year = atoi(hold); hold[0] = rtime[i++]; hold[1] = rtime[i++]; hold[2] = '\0'; tm.tm_mon = atoi(hold) - 1; hold[0] = rtime[i++]; hold[1] = rtime[i++]; tm.tm_mday = atoi(hold); hold[0] = rtime[i++]; hold[1] = rtime[i++]; tm.tm_hour = atoi(hold); hold[0] = rtime[i++]; hold[1] = rtime[i++]; tm.tm_min = atoi(hold); hold[0] = rtime[i++]; hold[1] = rtime[i]; tm.tm_sec = atoi(hold); tm.tm_isdst = -1; when = mktime(&tm); if (when == -1) { sprintf(log_buffer, "%s: could not convert date: %s", argv[0], rtime); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewLongObj((long)when)); return TCL_OK; case 3: /* relative weekday */ for (i = 0; wkday[i]; i++) { if (strcmp(argv[1], wkday[i]) == 0) break; } if (wkday[i] == NULL) { sprintf(log_buffer, "%s: unrecognized weekday: %s", argv[0], argv[1]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } when = time((time_t *)NULL); t = localtime(&when); t->tm_mday += (i - t->tm_wday + 7) % 7; t->tm_hour = 0; t->tm_min = 0; t->tm_sec = 0; t->tm_isdst = -1; when = mktime(t); strncpy(rtime, argv[2], sizeof(rtime)); len = strlen(rtime); break; default: sprintf(log_buffer, "%s: wrong # args: ?day? ?time?", argv[0]); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (len != 8 || rtime[2] != ':' || rtime[5] != ':' || !isdigit(rtime[0]) || !isdigit(rtime[1]) || !isdigit(rtime[3]) || !isdigit(rtime[4]) || !isdigit(rtime[6]) || !isdigit(rtime[7])) { sprintf(log_buffer, "%s: bad relative time format: %s", argv[0], rtime); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } rtime[2] = rtime[5] = '\0'; when += atoi(&rtime[0]) * 3600 + atoi(&rtime[3]) * 60 + atoi(&rtime[6]); Tcl_SetObjResult(interp, Tcl_NewLongObj((long)when)); return TCL_OK; } int StrFtime(clientData, interp, objc, objv) ClientData clientData; Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { struct tm *t; long hold; time_t when; if (objc != 3) { sprintf(log_buffer, "%s: wrong # args: format time", Tcl_GetStringFromObj(objv[0], NULL)); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_ERROR; } if (Tcl_GetLongFromObj(interp, objv[2], &hold) != TCL_OK) return TCL_ERROR; when = (time_t)hold; t = localtime(&when); (void)strftime(log_buffer, LOG_BUF_SIZE, Tcl_GetStringFromObj(objv[1], NULL), t); Tcl_SetResult(interp, log_buffer, TCL_VOLATILE); return TCL_OK; } void add_cmds(interp) Tcl_Interp *interp; { Tcl_CreateObjCommand(interp, "openrm", OpenRM, NULL, NULL); Tcl_CreateObjCommand(interp, "closerm", CloseRM, NULL, NULL); Tcl_CreateObjCommand(interp, "downrm", DownRM, NULL, NULL); Tcl_CreateObjCommand(interp, "configrm", ConfigRM, NULL, NULL); Tcl_CreateObjCommand(interp, "getreq", GetREQ, NULL, NULL); Tcl_CreateObjCommand(interp, "addreq", AddREQ, NULL, NULL); Tcl_CreateCommand(interp, "allreq", AllREQ, NULL, NULL); Tcl_CreateCommand(interp, "flushreq", FlushREQ, NULL, NULL); Tcl_CreateCommand(interp, "activereq", ActiveREQ, NULL, NULL); Tcl_CreateCommand(interp, "fullresp", FullResp, NULL, NULL); Tcl_CreateCommand(interp, "pbsconnect", PBS_Connect, NULL, NULL); Tcl_CreateCommand(interp, "pbsdisconnect", PBS_Disconnect, NULL, NULL); Tcl_CreateCommand(interp, "pbsstatserv", PBS_StatServ, NULL, NULL); Tcl_CreateCommand(interp, "pbsstatjob", PBS_StatJob, NULL, NULL); Tcl_CreateCommand(interp, "pbsstatque", PBS_StatQue, NULL, NULL); Tcl_CreateObjCommand(interp, "pbsstatnode", PBS_StatNode, NULL, NULL); Tcl_CreateCommand(interp, "pbsselstat", PBS_SelStat, NULL, NULL); Tcl_CreateCommand(interp, "pbsrunjob", PBS_RunJob, NULL, NULL); Tcl_CreateCommand(interp, "pbsmovejob", PBS_MoveJob, NULL, NULL); Tcl_CreateCommand(interp, "pbsqenable", PBS_EnableQueue, NULL, NULL); Tcl_CreateCommand(interp, "pbsqdisable", PBS_DisableQueue, NULL, NULL); Tcl_CreateCommand(interp, "pbsqstart", PBS_StartQueue, NULL, NULL); Tcl_CreateCommand(interp, "pbsqstop", PBS_StopQueue, NULL, NULL); Tcl_CreateCommand(interp, "pbsasyrunjob", PBS_AsyRunJob, NULL, NULL); Tcl_CreateCommand(interp, "pbsdeljob", PBS_DelJob, NULL, NULL); Tcl_CreateCommand(interp, "pbsholdjob", PBS_HoldJob, NULL, NULL); Tcl_CreateObjCommand(interp, "pbsalterjob", PBS_AlterJob, NULL, NULL); Tcl_CreateObjCommand(interp, "pbsrescquery", PBS_RescQuery, NULL, NULL); Tcl_CreateObjCommand(interp, "pbsrescreserve", PBS_RescReserve, NULL, NULL); Tcl_CreateObjCommand(interp, "pbsrescrelease", PBS_RescRelease, NULL, NULL); Tcl_CreateCommand(interp, "datetime", DateTime, NULL, NULL); Tcl_CreateObjCommand(interp, "strftime", StrFtime, NULL, NULL); /* * Extended scheduler commands from Univ. of Colorado */ Tcl_CreateCommand(interp, "pbsrerunjob", PBS_ReRun, NULL, NULL); pbserr = Tcl_NewStringObj("pbs_errno", -1); Tcl_ObjSetVar2(interp, pbserr, NULL, \ Tcl_NewIntObj((0)), TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG); site_cmds(interp); } torque-2.4.16/src/scheduler.tcl/pbs_sched.c0000664000113300011330000007166711272401237015500 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #if !defined(_BSD) && defined(_AIX) /* this is needed by AIX */ #define _BSD 1 #endif #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if (PLOCK_DAEMONS & 2) #include #endif /* PLOCK_DAEMONS */ #include #include #include #include #ifdef _CRAY #include #endif /* _CRAY */ #include #include #include #include #include #include "libpbs.h" #include "portability.h" #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "resmon.h" #include "sched_cmds.h" #include "net_connect.h" #include "rpp.h" #include "rm.h" extern int pbs_errno; extern int connector; int server_sock; Tcl_Interp *interp; int verbose = 0; char *oldpath; char *initfil = NULL; char *bodyfil = "sched_tcl"; char *termfil = NULL; char *body = NULL; extern char *msg_daemonname; char **glob_argv = NULL; struct sockaddr_in saddr; #if TCL_MAJOR_VERSION >= 8 Tcl_Obj *body_obj = NULL; /* allow compiled body code for TCL-8 */ #endif #define START_CLIENTS 2 /* minimum number of clients */ pbs_net_t *okclients = NULL; /* accept connections from */ int numclients = 0; /* the number of clients */ char *configfile = NULL; /* name of config file */ sigset_t allsigs; sigset_t oldsigs; static char *logfile = NULL; static char path_log[_POSIX_PATH_MAX]; extern void add_cmds(Tcl_Interp *); extern int get_4byte(int, unsigned int *); #ifndef OPEN_MAX #ifdef _POSIX_OPEN_MAX #define OPEN_MAX _POSIX_OPEN_MAX #else #define OPEN_MAX 40 #endif /* _POSIX_OPEN_MAX */ #endif /* OPEN_MAX */ /* ** Clean up after a signal. */ void die(int sig) { char *id = "die"; if (sig > 0) { sprintf(log_buffer, "caught signal %d", sig); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "abnormal termination"); } if (interp) Tcl_DeleteInterp(interp); log_close(1); exit(1); } static int server_disconnect(int connect) { /* send close-connection message */ close(connection[connect].ch_socket); if (connection[connect].ch_errtxt != (char *)NULL) free(connection[connect].ch_errtxt); connection[connect].ch_errno = 0; connection[connect].ch_inuse = 0; return 0; } /* ** Got an alarm call. */ void toolong(int sig) { char *id = "toolong"; struct stat sb; pid_t cpid; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "alarm call"); DBPRT(("alarm call\n")) if (connector >= 0 && server_disconnect(connector)) log_err(errno, id, "server_disconnect"); if (close(server_sock)) log_err(errno, id, "close"); if ((cpid = fork()) > 0) /* parent re-execs itself */ { rpp_terminate(); #ifndef linux sleep(5); #endif /* hopefully, that gave the child enough */ /* time to do its business. anyhow: */ (void)waitpid(cpid, NULL, 0); if (chdir(oldpath) == -1) { sprintf(log_buffer, "chdir to %s", oldpath); log_err(errno, id, log_buffer); } sprintf(log_buffer, "restart dir %s object %s", oldpath, glob_argv[0]); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); execv(glob_argv[0], glob_argv); log_err(errno, id, "execv"); exit(3); } /* ** Child (or error on fork) gets here and tried ** to dump core. */ if (stat("core", &sb) == -1) { if (errno == ENOENT) { log_close(1); abort(); rpp_terminate(); exit(2); /* not reached (hopefully) */ } log_err(errno, id, "stat"); } log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "exiting without core dump"); log_close(1); rpp_terminate(); exit(0); } int socket_to_conn( int sock /* opened socket */ ) { int i; for (i = 0; i < NCONNECTS; i++) { if (connection[i].ch_inuse == 0) { connection[i].ch_inuse = 1; connection[i].ch_errno = 0; connection[i].ch_socket = sock; connection[i].ch_errtxt = NULL; return (i); } } pbs_errno = PBSE_NOCONNECTS; return (-1); } void start_tcl(void) { char *id = "start_tcl"; char buf[BUFSIZ]; int fd; int tot, len; interp = Tcl_CreateInterp(); if (Tcl_Init(interp) == TCL_ERROR) { sprintf(log_buffer, "Tcl_Init error: %s", Tcl_GetStringResult(interp)); log_err(-1, id, log_buffer); die(0); } #if TCLX #if TCL_MINOR_VERSION < 5 && TCL_MAJOR_VERSION < 8 if (TclX_Init(interp) == TCL_ERROR) { #else if (Tclx_Init(interp) == TCL_ERROR) { #endif sprintf(log_buffer, "Tclx_Init error: %s", Tcl_GetStringResult(interp)); log_err(-1, id, log_buffer); die(0); } #endif add_cmds(interp); if (initfil) { int code; code = Tcl_EvalFile(interp, initfil); if (code != TCL_OK) { char *trace; trace = (char *)Tcl_GetVar(interp, "errorInfo", 0); if (trace == NULL) trace = (char *)Tcl_GetStringResult(interp); fprintf(stderr, "%s: TCL error @ line %d: %s\n", initfil, interp->errorLine, trace); sprintf(log_buffer, "%s: TCL error @ line %d: %s", initfil, interp->errorLine, Tcl_GetStringResult(interp)); log_err(-1, id, log_buffer); die(0); } sprintf(log_buffer, "init file %s", initfil); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if ((fd = open(bodyfil, O_RDONLY)) == -1) { log_err(errno, id, bodyfil); die(0); } sprintf(log_buffer, "body file: %s", bodyfil); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); if (body) free(body); if ((body = malloc(BUFSIZ)) == NULL) { log_err(errno, id, "malloc"); die(0); } for (tot = 0; (len = read(fd, buf, sizeof(buf))) > 0; tot += len) { if ((body = realloc(body, tot + len + 1)) == NULL) { log_err(errno, id, "realloc"); die(0); } memcpy(&body[tot], buf, len); } if (len == -1) { log_err(errno, id, bodyfil); die(0); } body[tot] = '\0'; close(fd); #if TCL_MAJOR_VERSION >= 8 if (body_obj == NULL) { body_obj = Tcl_NewStringObj(body, tot); Tcl_IncrRefCount(body_obj); } else { Tcl_SetStringObj(body_obj, body, tot); } #endif } int addclient(name) char *name; { static char id[] = "addclient"; struct hostent *host, *gethostbyname(); struct in_addr saddr; if ((host = gethostbyname(name)) == NULL) { sprintf(log_buffer, "host %s not found", name); log_err(-1, id, log_buffer); return -1; } if (numclients >= START_CLIENTS) { pbs_net_t *newclients; newclients = realloc(okclients, sizeof(pbs_net_t) * (numclients + 1)); if (newclients == NULL) return -1; okclients = newclients; } memcpy((char *)&saddr, host->h_addr, host->h_length); okclients[numclients++] = saddr.s_addr; return 0; } /* * read_config - read and process the configuration file (see -c option) * * Currently, the only statement is $clienthost to specify which systems * can contact the scheduler. */ #define CONF_LINE_LEN 120 static int read_config(file) char *file; { static char *id = "read_config"; FILE *conf; int i; char line[CONF_LINE_LEN]; char *token; struct specialconfig { char *name; int (*handler)(); } special[] = { {"clienthost", addclient }, { NULL, NULL } }; #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) if (chk_file_sec(file, 0, 0, S_IWGRP | S_IWOTH, 1, 0)) return (-1); #endif if ((conf = fopen(file, "r")) == NULL) { log_err(errno, id, "cannot open config file"); return (-1); } while (fgets(line, CONF_LINE_LEN, conf)) { if ((line[0] == '#') || (line[0] == '\n')) continue; /* ignore comment & null line */ else if (line[0] == '$') /* special */ { if ((token = strtok(line, " \t")) == NULL) token = ""; for (i = 0; special[i].name; i++) { if (strcmp(token + 1, special[i].name) == 0) break; } if (special[i].name == NULL) { sprintf(log_buffer, "config name %s not known", token); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); return (-1); } token = strtok(NULL, " \t"); if (*(token + strlen(token) - 1) == '\n') *(token + strlen(token) - 1) = '\0'; if (special[i].handler(token)) { fclose(conf); return (-1); } } else { log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, "invalid line in config file"); fclose(conf); return (-1); } } fclose(conf); return (0); } void restart(sig) int sig; { char *id = "restart"; if (sig) { sprintf(log_buffer, "restart on signal %d", sig); log_close(1); log_open(logfile, path_log); } else { sprintf(log_buffer, "restart command"); } log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); Tcl_DeleteInterp(interp); if (configfile) { if (read_config(configfile) != 0) die(0); } start_tcl(); } void badconn(msg) char *msg; { static char id[] = "badconn"; struct in_addr addr; char buf[5*sizeof(addr) + 100]; struct hostent *phe; addr = saddr.sin_addr; phe = gethostbyaddr((void *) & addr, sizeof(addr), AF_INET); if (phe == NULL) { char hold[6]; int i; union { struct in_addr aa; u_char bb[sizeof(addr)]; } uu; uu.aa = addr; sprintf(buf, "%u", uu.bb[0]); for (i = 1; i < (int)sizeof(addr); i++) { sprintf(hold, ".%u", uu.bb[i]); strcat(buf, hold); } } else { strncpy(buf, phe->h_name, sizeof(buf)); buf[sizeof(buf)-1] = '\0'; } sprintf(log_buffer, "%s on port %u %s", buf, ntohs(saddr.sin_port), msg); log_err(-1, id, log_buffer); return; } unsigned int server_command() { static char id[] = "server_command"; int new_socket; int i; torque_socklen_t slen; unsigned int cmd; pbs_net_t addr; slen = sizeof(saddr); new_socket = accept(server_sock, (struct sockaddr *) & saddr, &slen); if (new_socket == -1) { log_err(errno, id, "accept"); return SCH_ERROR; } if (ntohs(saddr.sin_port) >= IPPORT_RESERVED) { badconn("non-reserved port"); close(new_socket); return SCH_ERROR; } addr = (pbs_net_t)saddr.sin_addr.s_addr; for (i = 0; i < numclients; i++) { if (addr == okclients[i]) break; } if (i == numclients) { badconn("unauthorized host"); close(new_socket); return SCH_ERROR; } if ((connector = socket_to_conn(new_socket)) < 0) { log_err(errno, id, "socket_to_conn"); return SCH_ERROR; } if (get_4byte(new_socket, &cmd) != 1) { log_err(errno, id, "get4bytes"); return SCH_ERROR; } return cmd; } /* * lock_out - lock out other daemons from this directory. */ static void lock_out(fds, op) int fds; int op; /* F_WRLCK or F_UNLCK */ { struct flock flock; flock.l_type = op; flock.l_whence = SEEK_SET; flock.l_start = 0; flock.l_len = 0; /* whole file */ if (fcntl(fds, F_SETLK, &flock) < 0) { (void)strcpy(log_buffer, "pbs_sched: another scheduler running\n"); log_err(errno, msg_daemonname, log_buffer); fprintf(stderr, log_buffer); exit(1); } } int main(argc, argv) int argc; char *argv[]; { char *id = "main"; int code; struct hostent *hp; int go, c, errflg = 0; int lockfds; int t = 1; char *ptr; pid_t pid; char *cp, host[100]; char *homedir = PBS_SERVER_HOME; unsigned int port; char path_priv[_POSIX_PATH_MAX]; char *dbfile = "sched_out"; int alarm_time = 180; struct sigaction act; caddr_t curr_brk = 0, next_brk; extern char *optarg; extern int optind, opterr; extern int rpp_fd; fd_set fdset; #ifndef DEBUG if ((geteuid() != 0) || (getuid() != 0)) { fprintf(stderr, "%s: Must be run by root\n", argv[0]); return (1); } #endif /* DEBUG */ glob_argv = argv; if ((cp = strrchr(argv[0], '/')) == NULL) cp = argv[0]; else cp++; msg_daemonname = strdup(cp); port = get_svrport(PBS_SCHEDULER_SERVICE_NAME, "tcp", PBS_SCHEDULER_SERVICE_PORT); while ((c = getopt(argc, argv, "L:S:d:i:b:t:p:a:vc:")) != EOF) { switch (c) { case 'L': logfile = optarg; break; case 'S': port = (unsigned int)atoi(optarg); if (port == 0) { fprintf(stderr, "%s: illegal port\n", optarg); errflg = 1; } break; case 'd': homedir = optarg; break; case 'i': /* initialize */ initfil = optarg; break; case 'b': bodyfil = optarg; break; case 't': termfil = optarg; break; case 'p': dbfile = optarg; break; case 'a': alarm_time = strtol(optarg, &ptr, 10); if (alarm_time <= 0 || *ptr != '\0') { fprintf(stderr, "%s: bad alarm time\n", optarg); errflg = 1; } break; case 'c': configfile = optarg; break; case 'v': verbose = 1; break; case '?': errflg = 1; break; } } if (errflg || optind != argc) { static char *options[] = { "[-L logfile]", "[-S port]", "[-d home]", "[-i init]", "[-b body]", "[-t term]", "[-p output]", "[-a alarm]", "[-c configfile]", "[-v]", NULL }; int i; fprintf(stderr, "usage: %s\n", argv[0]); for (i = 0; options[i]; i++) fprintf(stderr, "\t%s\n", options[i]); exit(1); } /* Save the original working directory for "restart" */ if ((oldpath = getcwd((char *)NULL, MAXPATHLEN)) == NULL) { fprintf(stderr, "cannot get current working directory\n"); exit(1); } (void)sprintf(path_priv, "%s/sched_priv", homedir); #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) c = chk_file_sec(path_priv, 1, 0, S_IWGRP | S_IWOTH, 1, 0); c |= chk_file_sec(PBS_ENVIRON, 0, 0, S_IWGRP | S_IWOTH, 0, 0); if (c != 0) exit(1); #endif /* not DEBUG and not NO_SECURITY_CHECK */ if (chdir(path_priv) == -1) { perror(path_priv); exit(1); } (void)sprintf(path_log, "%s/sched_logs", homedir); (void)strcpy(pbs_current_user, "Scheduler"); /* The following is code to reduce security risks */ /* start out with standard umask, system resource limit infinite */ umask(022); if (setup_env(PBS_ENVIRON) == -1) exit(1); c = getgid(); (void)setgroups(1, (gid_t *)&c); /* secure suppl. group ids */ c = sysconf(_SC_OPEN_MAX); while (--c > 2) (void)close(c); /* close any file desc left open by parent */ #ifndef DEBUG #ifdef _CRAY (void)limit(C_JOB, 0, L_CPROC, 0); (void)limit(C_JOB, 0, L_CPU, 0); (void)limit(C_JOBPROCS, 0, L_CPU, 0); (void)limit(C_PROC, 0, L_FD, 255); (void)limit(C_JOB, 0, L_FSBLK, 0); (void)limit(C_JOBPROCS, 0, L_FSBLK, 0); (void)limit(C_JOB, 0, L_MEM , 0); (void)limit(C_JOBPROCS, 0, L_MEM , 0); #else /* not _CRAY */ { struct rlimit rlimit; rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; (void)setrlimit(RLIMIT_CPU, &rlimit); (void)setrlimit(RLIMIT_FSIZE, &rlimit); (void)setrlimit(RLIMIT_DATA, &rlimit); (void)setrlimit(RLIMIT_STACK, &rlimit); #ifdef RLIMIT_RSS (void)setrlimit(RLIMIT_RSS , &rlimit); #endif /* RLIMIT_RSS */ #ifdef RLIMIT_VMEM (void)setrlimit(RLIMIT_VMEM , &rlimit); #endif /* RLIMIT_VMEM */ } #endif /* not _CRAY */ #if !defined(NO_SECURITY_CHECK) c = 0; if (initfil) { if (*initfil != '/') { (void)sprintf(log_buffer, "%s/%s", path_priv, initfil); c |= chk_file_sec(log_buffer, 0, 0, S_IWGRP | S_IWOTH, 1, 0); } else { c |= chk_file_sec(initfil, 0, 0, S_IWGRP | S_IWOTH, 1, 0); } } if (bodyfil) { if (*bodyfil != '/') { (void)sprintf(log_buffer, "%s/%s", path_priv, bodyfil); c |= chk_file_sec(log_buffer, 0, 0, S_IWGRP | S_IWOTH, 1, 0); } else { c |= chk_file_sec(bodyfil, 0, 0, S_IWGRP | S_IWOTH, 1, 0); } } if (termfil) { if (*termfil != '/') { (void)sprintf(log_buffer, "%s/%s", path_priv, termfil); c |= chk_file_sec(log_buffer, 0, 0, S_IWGRP | S_IWOTH, 1, 0); } else { c |= chk_file_sec(termfil, 0, 0, S_IWGRP | S_IWOTH, 1, 0); } } if (c) exit(1); #endif /* not NO_SECURITY_CHECK */ #endif /* not DEBUG */ if (log_open(logfile, path_log) == -1) { fprintf(stderr, "%s: logfile could not be opened\n", argv[0]); exit(1); } if (gethostname(host, sizeof(host)) == -1) { char *prob = "gethostname"; log_err(errno, id, prob); perror(prob); die(0); } if ((hp = gethostbyname(host)) == NULL) { char *prob = "gethostbyname"; log_err(errno, id, prob); perror(prob); die(0); } if ((server_sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { char *prob = "socket"; log_err(errno, id, prob); perror(prob); die(0); } if (setsockopt(server_sock, SOL_SOCKET, SO_REUSEADDR, (char *)&t, sizeof(t)) == -1) { char *prob = "setsockopt"; log_err(errno, id, prob); perror(prob); die(0); } saddr.sin_family = AF_INET; saddr.sin_port = htons((unsigned short)port); memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); if (bind(server_sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) { char *prob = "bind"; log_err(errno, id, prob); perror(prob); die(0); } if (listen(server_sock, 5) < 0) { char *prob = "listen"; log_err(errno, id, prob); perror(prob); die(0); } okclients = (pbs_net_t *)calloc(START_CLIENTS, sizeof(pbs_net_t)); addclient("localhost"); /* who has permission to call MOM */ addclient(host); if (configfile) { if (read_config(configfile) != 0) die(0); } lockfds = open("sched.lock", O_CREAT | O_TRUNC | O_WRONLY, 0644); if (lockfds < 0) { char *prob = "lock file"; log_err(errno, id, prob); perror(prob); die(0); } lock_out(lockfds, F_WRLCK); #ifndef DEBUG lock_out(lockfds, F_UNLCK); if ((pid = fork()) == -1) /* error on fork */ { char *prob = "fork"; log_err(errno, id, prob); perror(prob); die(0); } else if (pid > 0) /* parent exits */ exit(0); if ((pid = setsid()) == -1) { log_err(errno, id, "setsid"); die(0); } lock_out(lockfds, F_WRLCK); freopen(dbfile, "a", stdout); setvbuf(stdout, NULL, _IOLBF, 0); dup2(fileno(stdout), fileno(stderr)); #else pid = getpid(); setvbuf(stdout, NULL, _IOLBF, 0); setvbuf(stderr, NULL, _IOLBF, 0); #endif freopen("/dev/null", "r", stdin); /* write schedulers pid into lockfile */ (void)sprintf(log_buffer, "%d\n", pid); (void)write(lockfds, log_buffer, strlen(log_buffer) + 1); #if (PLOCK_DAEMONS & 2) (void)plock(PROCLOCK); /* lock daemon into memory */ #endif sprintf(log_buffer, "%s startup pid %d", argv[0], pid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); sprintf(log_buffer, "%s using TCL %s (%s)", argv[0], TCL_VERSION, TCL_PATCH_LEVEL); fprintf(stderr, "%s\n", log_buffer); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); fullresp(0); sigemptyset(&allsigs); act.sa_flags = 0; sigaddset(&allsigs, SIGHUP); /* remember to block these */ sigaddset(&allsigs, SIGINT); /* during critical sections */ sigaddset(&allsigs, SIGTERM); /* so we don't get confused */ act.sa_mask = allsigs; act.sa_handler = restart; /* do a restart on SIGHUP */ sigaction(SIGHUP, &act, NULL); act.sa_handler = toolong; /* handle an alarm call */ sigaction(SIGALRM, &act, NULL); act.sa_handler = die; /* bite the biscuit for all following */ sigaction(SIGINT, &act, NULL); sigaction(SIGTERM, &act, NULL); start_tcl(); FD_ZERO(&fdset); for (go = 1; go;) { unsigned int cmd; if (rpp_fd != -1) FD_SET(rpp_fd, &fdset); FD_SET(server_sock, &fdset); if (select(FD_SETSIZE, &fdset, NULL, NULL, NULL) == -1) { if (errno != EINTR) log_err(errno, id, "select"); continue; } if (rpp_fd != -1 && FD_ISSET(rpp_fd, &fdset)) { if (rpp_io() == -1) log_err(errno, id, "rpp_io"); } if (!FD_ISSET(server_sock, &fdset)) continue; cmd = server_command(); if (cmd == (unsigned)SCH_ERROR || cmd == (unsigned)SCH_SCHEDULE_NULL) continue; if (sigprocmask(SIG_BLOCK, &allsigs, &oldsigs) == -1) log_err(errno, id, "sigprocmaskSIG_BLOCK)"); if (verbose) { sprintf(log_buffer, "command %d", cmd); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } switch (cmd) { case SCH_SCHEDULE_NEW: case SCH_SCHEDULE_TERM: case SCH_SCHEDULE_TIME: case SCH_SCHEDULE_RECYC: case SCH_SCHEDULE_CMD: case SCH_SCHEDULE_FIRST: alarm(alarm_time); #if TCL_MAJOR_VERSION >= 8 /* execute compiled body code for TCL-8 */ code = Tcl_EvalObj(interp, body_obj); #else code = Tcl_Eval(interp, body); #endif alarm(0); switch (code) { case TCL_OK: case TCL_RETURN: break; default: { char *trace; char codename[20]; switch (code) { case TCL_BREAK: strcpy(codename, "break"); break; case TCL_CONTINUE: strcpy(codename, "continue"); break; default: strcpy(codename, ""); break; } trace = (char *)Tcl_GetVar(interp, "errorInfo", 0); if (trace == NULL) trace = (char *)Tcl_GetStringResult(interp); fprintf(stderr, "%s: TCL interpreter return code %d (%s) @ line %d: %s\n", bodyfil, code, codename, interp->errorLine, trace); sprintf(log_buffer, "%s: TCL error @ line %d: %s", bodyfil, interp->errorLine, Tcl_GetStringResult(interp)); log_err(-1, id, log_buffer); die(0); } } break; case SCH_CONFIGURE: case SCH_RULESET: restart(0); break; case SCH_QUIT: go = 0; break; default: log_err(-1, id, "unknown command"); break; } if (connector >= 0 && server_disconnect(connector)) { log_err(errno, id, "server_disconnect"); die(0); } connector = -1; if (verbose) { next_brk = (caddr_t)sbrk(0); if (next_brk > curr_brk) { sprintf(log_buffer, "brk point %p", next_brk); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); curr_brk = next_brk; } } if (sigprocmask(SIG_SETMASK, &oldsigs, NULL) == -1) log_err(errno, id, "sigprocmask(SIG_SETMASK)"); } if (termfil) { code = Tcl_EvalFile(interp, termfil); if (code != TCL_OK) { char *trace; trace = (char *)Tcl_GetVar(interp, "errorInfo", 0); if (trace == NULL) trace = (char *)Tcl_GetStringResult(interp); fprintf(stderr, "%s: TCL error @ line %d: %s\n", termfil, interp->errorLine, trace); sprintf(log_buffer, "%s: TCL error @ line %d: %s", termfil, interp->errorLine, Tcl_GetStringResult(interp)); log_err(-1, id, log_buffer); die(0); } sprintf(log_buffer, "term file: %s", termfil); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } sprintf(log_buffer, "%s normal finish pid %d", argv[0], pid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)close(server_sock); exit(0); } torque-2.4.16/src/scheduler.tcl/Makefile.am0000664000113300011330000000135111272401237015415 00000000000000include $(top_srcdir)/buildutils/config.mk PBS_LIBS = ../lib/Libpbs/libtorque.la sbin_PROGRAMS = pbs_sched AM_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" -DPBS_ENVIRON=\"$(PBS_ENVIRON)\" $(MY_TCL_INCS) pbs_sched_LDADD = $(PBS_LIBS) $(MY_TCL_LIBS) pbs_sched_SOURCES = pbs_sched.c pbs_tclWrap.c site_tclWrap.c \ ../scheduler.cc/get_4byte.c EXTRA_DIST = sample_scripts/README sample_scripts/loadave install-exec-hook: rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbs_sched$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) torque-2.4.16/src/tools/0000777000113300011330000000000011614035203012040 500000000000000torque-2.4.16/src/tools/pbsTkInit.c0000664000113300011330000001222111272401240014025 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** All the pbs specific code needed to make pbswish ** work is here. The routine pbsTk_Init() is to be called ** in place of Tk_Init(). */ #include #include "libpbs.h" #include "log.h" #include "tk.h" #include #if TCLX #include #endif extern void fullresp(int); extern void add_cmds(Tcl_Interp *); int pbsTcl_Init(interp) Tcl_Interp *interp; /* Interpreter for application. */ { if (Tcl_Init(interp) == TCL_ERROR) return TCL_ERROR; if (Tk_Init(interp) == TCL_ERROR) return TCL_ERROR; Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); #if TCLX #if TCL_MINOR_VERSION < 5 && TCL_MAJOR_VERSION < 8 if (TclX_Init(interp) == TCL_ERROR) { #else if (Tclx_Init(interp) == TCL_ERROR) { #endif return TCL_ERROR; } #if TKX if (Tkx_Init(interp) == TCL_ERROR) return TCL_ERROR; #endif #endif fullresp(0); add_cmds(interp); Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY); return TCL_OK; } int main(argc, argv) int argc; char *argv[]; { chk_file_sec_stderr = 1; Tk_Main(argc, argv, pbsTcl_Init); return 0; } torque-2.4.16/src/tools/chk_tree.c0000664000113300011330000001273511272401240013714 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Check permissions on the PBS Tree Built * * Files should be owned by root, and not world writable. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include "portability.h" #include "log.h" int main( int argc, char *argv[]) { int err = 0; int i; int j; int dir = 0; int no_err = 0; int sticky = 0; int umask = S_IWGRP | S_IWOTH; extern int optind; chk_file_sec_stderr = 1; while ((i = getopt(argc, argv, "dnsu")) != EOF) { switch (i) { case 'd': dir = 1; break; case 'n': no_err = 1; break; case 's': sticky = 1; break; case 'u': umask = strtol(optarg, NULL, 8); break; default: err = 1; } } if (err || (optind == argc)) { fprintf(stderr, "Usage %s -d -s -n [-u mask] path ...\n\twhere:\t-d indicates directory (file otherwise)\n\t\t-s indicates world write allowed if sticky set\n\t\t-n indicates do not return the error status, exit with 0\n\t\t-u mask overrides the default umask (022)\n", argv[0]); return 1; } for (i = optind; i < argc; ++i) if ((j = chk_file_sec(argv[i], dir, sticky, umask, 1, NULL))) { err = 1; } if (no_err) return 0; else return (err); } torque-2.4.16/src/tools/printjob.c0000664000113300011330000002522211272401240013752 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "portability.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "pbs_job.h" #include "tm.h" void prt_job_struct( job *pjob) { printf("---------------------------------------------------\n"); printf("jobid:\t%s\n", pjob->ji_qs.ji_jobid); printf("---------------------------------------------------\n"); printf("ji_qs version:\t%#010x\n", pjob->ji_qs.qs_version); printf("state:\t\t0x%x\n", pjob->ji_qs.ji_state); printf("substate:\t0x%x (%d)\n", pjob->ji_qs.ji_substate, pjob->ji_qs.ji_substate); printf("svrflgs:\t0x%x (%d)\n", pjob->ji_qs.ji_svrflags, pjob->ji_qs.ji_svrflags); printf("ordering:\t%d\n", pjob->ji_qs.ji_ordering); printf("inter prior:\t%d\n", pjob->ji_qs.ji_priority); printf("stime:\t\t%d\n", (int)pjob->ji_qs.ji_stime); printf("file base:\t%s\n", pjob->ji_qs.ji_fileprefix); printf("queue:\t\t%s\n", pjob->ji_qs.ji_queue); printf("destin:\t\t%s\n", pjob->ji_qs.ji_destin); switch (pjob->ji_qs.ji_un_type) { case JOB_UNION_TYPE_NEW: printf("union type new:\n"); printf("\tsocket\t%d\n", pjob->ji_qs.ji_un.ji_newt.ji_fromsock); printf("\taddr\t%lu\n", pjob->ji_qs.ji_un.ji_newt.ji_fromaddr); printf("\tscript\t%d\n", pjob->ji_qs.ji_un.ji_newt.ji_scriptsz); break; case JOB_UNION_TYPE_EXEC: printf("union type exec:\n"); printf("\tmomaddr\t%lu\n", pjob->ji_qs.ji_un.ji_exect.ji_momaddr); printf("\texits\t%d\n", pjob->ji_qs.ji_un.ji_exect.ji_exitstat); break; case JOB_UNION_TYPE_ROUTE: printf("union type route:\n"); printf("\tquetime\t%d\n", (int)pjob->ji_qs.ji_un.ji_routet.ji_quetime); printf("\tretry\t%d\n", (int)pjob->ji_qs.ji_un.ji_routet.ji_rteretry); break; case JOB_UNION_TYPE_MOM: printf("union type mom:\n"); printf("\tsvraddr\t%lu\n", pjob->ji_qs.ji_un.ji_momt.ji_svraddr); printf("\texitst\t%d\n", pjob->ji_qs.ji_un.ji_momt.ji_exitstat); printf("\tuid\t%ld\n", (long)pjob->ji_qs.ji_un.ji_momt.ji_exuid); printf("\tgid\t%ld\n", (long)pjob->ji_qs.ji_un.ji_momt.ji_exgid); break; default: printf("--bad union type %d\n", pjob->ji_qs.ji_un_type); break; } /* END switch (pjob->ji_qs.ji_un_type) */ return; } /* END prt_job_struct() */ #define ENDATTRIBUTES -711 int read_attr( int fd) { int amt; int i; svrattrl *pal; svrattrl tempal; i = read(fd, (char *) & tempal, sizeof(tempal)); if (i != sizeof(tempal)) { fprintf(stderr, "bad read of attribute\n"); /* FAILURE */ return(0); } if (tempal.al_tsize == ENDATTRIBUTES) { /* FAILURE */ return(0); } pal = (svrattrl *)malloc(tempal.al_tsize); if (pal == NULL) { fprintf(stderr, "malloc failed\n"); exit(1); } *pal = tempal; /* read in the actual attribute data */ amt = pal->al_tsize - sizeof(svrattrl); i = read(fd, (char *)pal + sizeof(svrattrl), amt); if (i != amt) { fprintf(stderr, "short read of attribute\n"); exit(2); } pal->al_name = (char *)pal + sizeof(svrattrl); if (pal->al_rescln != 0) pal->al_resc = pal->al_name + pal->al_nameln; else pal->al_resc = NULL; if (pal->al_valln != 0) pal->al_value = pal->al_name + pal->al_nameln + pal->al_rescln; else pal->al_value = NULL; printf("%s", pal->al_name); if (pal->al_resc != NULL) { printf(".%s", pal->al_resc); } printf(" = "); if (pal->al_value != NULL) { printf("%s", pal->al_value); } printf("\n"); free(pal); return(1); } int read_tm_info( int fds) { int outport, errport; tm_task_id taskid; tm_task_id nodeid; if (read(fds, (char *)&outport, sizeof(int)) != sizeof(int)) { fprintf(stderr, "short read of TM output info\n"); exit(2); } if (read(fds, (char *)&errport, sizeof(int)) != sizeof(int)) { fprintf(stderr, "short read of TM error info\n"); exit(2); } if (read(fds, (char *)&taskid, sizeof(tm_task_id)) != sizeof(tm_task_id)) { fprintf(stderr, "short read of TM task info\n"); exit(2); } if (read(fds, (char *)&nodeid, sizeof(tm_node_id)) != sizeof(tm_node_id)) { fprintf(stderr, "short read of TM nodeid info\n"); exit(2); } printf("stdout port = %d\nstderr port = %d\ntaskid = %d\nnodeid = %d\n", outport, errport, taskid, nodeid); return(0); } int main( int argc, char *argv[]) { int amt; int err = 0; int f; int fp; int no_attributes = 0; job xjob; extern int optind; while ((f = getopt(argc, argv, "a")) != EOF) { switch (f) { case 'a': no_attributes = 1; break; default: err = 1; break; } } if (err || (argc - optind < 1)) { fprintf(stderr, "usage: %s [-a] file[ file]...}\n", argv[0]); return(1); } for (f = optind;f < argc;++f) { fp = open(argv[f], O_RDONLY, 0); if (fp < 0) { perror("open failed"); fprintf(stderr, "unable to open file %s\n", argv[f]); exit(1); } amt = read(fp, &xjob.ji_qs, sizeof(xjob.ji_qs)); if (amt != sizeof(xjob.ji_qs)) { fprintf(stderr, "Short read of %d bytes, file %s\n", amt, argv[f]); } if (xjob.ji_qs.qs_version != PBS_QS_VERSION) { printf("%s contains an old version of the ji_qs structure.\n" " expecting version %#010x, read %#010x\n" " Skipping prt_job_struct()\n" " pbs_server may be able to upgrade job automatically\n", argv[f], PBS_QS_VERSION, xjob.ji_qs.qs_version); close(fp); continue; } /* print out job structure */ prt_job_struct(&xjob); /* now do attributes, one at a time */ if (no_attributes == 0) { printf("--attributes--\n"); while (read_attr(fp)); } if (xjob.ji_qs.ji_un_type == JOB_UNION_TYPE_MOM) { printf("--TM info--\n"); read_tm_info(fp); } close(fp); printf("\n"); } /* END for (f) */ return(0); } /* END main() */ /* END printjob.c */ torque-2.4.16/src/tools/Makefile.in0000664000113300011330000012755711605403771014055 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(chk_tree_SOURCES) $(hostn_SOURCES) $(pbs_tclsh_SOURCES) $(pbs_wish_SOURCES) $(printjob_SOURCES) $(printserverdb_SOURCES) $(printtracking_SOURCES) $(tracejob_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk bin_PROGRAMS = chk_tree$(EXEEXT) hostn$(EXEEXT) printjob$(EXEEXT) \ printtracking$(EXEEXT) printserverdb$(EXEEXT) \ tracejob$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) subdir = src/tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = @USING_TCL_TRUE@am__EXEEXT_1 = pbs_tclsh$(EXEEXT) @INCLUDE_GUI_TRUE@@USING_TK_TRUE@am__EXEEXT_2 = pbs_wish$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_chk_tree_OBJECTS = chk_tree.$(OBJEXT) chk_tree_OBJECTS = $(am_chk_tree_OBJECTS) chk_tree_LDADD = $(LDADD) am__DEPENDENCIES_1 = ../lib/Libpbs/libtorque.la chk_tree_DEPENDENCIES = $(am__DEPENDENCIES_1) am_hostn_OBJECTS = hostn.$(OBJEXT) hostn_OBJECTS = $(am_hostn_OBJECTS) hostn_LDADD = $(LDADD) hostn_DEPENDENCIES = $(am__DEPENDENCIES_1) am_pbs_tclsh_OBJECTS = pbs_tclsh-pbsTclInit.$(OBJEXT) \ pbs_tclsh-pbs_tclWrap.$(OBJEXT) \ pbs_tclsh-site_tclWrap.$(OBJEXT) pbs_tclsh_OBJECTS = $(am_pbs_tclsh_OBJECTS) am__DEPENDENCIES_2 = pbs_tclsh_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) am_pbs_wish_OBJECTS = pbs_wish-pbsTkInit.$(OBJEXT) \ pbs_wish-pbs_tclWrap.$(OBJEXT) pbs_wish-site_tclWrap.$(OBJEXT) pbs_wish_OBJECTS = $(am_pbs_wish_OBJECTS) pbs_wish_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) am_printjob_OBJECTS = printjob.$(OBJEXT) printjob_OBJECTS = $(am_printjob_OBJECTS) printjob_LDADD = $(LDADD) printjob_DEPENDENCIES = $(am__DEPENDENCIES_1) am_printserverdb_OBJECTS = printserverdb-printserverdb.$(OBJEXT) printserverdb_OBJECTS = $(am_printserverdb_OBJECTS) printserverdb_LDADD = $(LDADD) printserverdb_DEPENDENCIES = $(am__DEPENDENCIES_1) am_printtracking_OBJECTS = printtracking.$(OBJEXT) printtracking_OBJECTS = $(am_printtracking_OBJECTS) printtracking_LDADD = $(LDADD) printtracking_DEPENDENCIES = $(am__DEPENDENCIES_1) am_tracejob_OBJECTS = tracejob-tracejob.$(OBJEXT) tracejob_OBJECTS = $(am_tracejob_OBJECTS) tracejob_LDADD = $(LDADD) tracejob_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(chk_tree_SOURCES) $(hostn_SOURCES) $(pbs_tclsh_SOURCES) \ $(pbs_wish_SOURCES) $(printjob_SOURCES) \ $(printserverdb_SOURCES) $(printtracking_SOURCES) \ $(tracejob_SOURCES) DIST_SOURCES = $(chk_tree_SOURCES) $(hostn_SOURCES) \ $(pbs_tclsh_SOURCES) $(pbs_wish_SOURCES) $(printjob_SOURCES) \ $(printserverdb_SOURCES) $(printtracking_SOURCES) \ $(tracejob_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter @INCLUDE_GUI_TRUE@@USING_TK_TRUE@XPBSMON = xpbsmon SUBDIRS = . $(XPBSMON) DIST_SUBDIRS = . xpbsmon EXTRA_DIST = tracejob.h init.d/pbs PBS_LIBS = ../lib/Libpbs/libtorque.la @USING_TCL_TRUE@PROGRAMS_TCL = pbs_tclsh @INCLUDE_GUI_TRUE@@USING_TK_TRUE@PROGRAMS_TK = pbs_wish LDADD = $(PBS_LIBS) tracejob_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" printserverdb_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" chk_tree_SOURCES = chk_tree.c hostn_SOURCES = hostn.c printjob_SOURCES = printjob.c printtracking_SOURCES = printtracking.c printserverdb_SOURCES = printserverdb.c tracejob_SOURCES = tracejob.c pbs_tclsh_LDADD = $(PBS_LIBS) $(MY_TCL_LIBS) pbs_tclsh_CFLAGS = $(MY_TCL_INCS) pbs_tclsh_SOURCES = pbsTclInit.c ../scheduler.tcl/pbs_tclWrap.c \ ../scheduler.tcl/site_tclWrap.c pbs_wish_LDADD = $(PBS_LIBS) $(MY_TCLTK_LIBS) pbs_wish_CFLAGS = $(MY_TCLTK_INCS) pbs_wish_SOURCES = pbsTkInit.c ../scheduler.tcl/pbs_tclWrap.c \ ../scheduler.tcl/site_tclWrap.c all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tools/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done chk_tree$(EXEEXT): $(chk_tree_OBJECTS) $(chk_tree_DEPENDENCIES) @rm -f chk_tree$(EXEEXT) $(LINK) $(chk_tree_LDFLAGS) $(chk_tree_OBJECTS) $(chk_tree_LDADD) $(LIBS) hostn$(EXEEXT): $(hostn_OBJECTS) $(hostn_DEPENDENCIES) @rm -f hostn$(EXEEXT) $(LINK) $(hostn_LDFLAGS) $(hostn_OBJECTS) $(hostn_LDADD) $(LIBS) pbs_tclsh$(EXEEXT): $(pbs_tclsh_OBJECTS) $(pbs_tclsh_DEPENDENCIES) @rm -f pbs_tclsh$(EXEEXT) $(LINK) $(pbs_tclsh_LDFLAGS) $(pbs_tclsh_OBJECTS) $(pbs_tclsh_LDADD) $(LIBS) pbs_wish$(EXEEXT): $(pbs_wish_OBJECTS) $(pbs_wish_DEPENDENCIES) @rm -f pbs_wish$(EXEEXT) $(LINK) $(pbs_wish_LDFLAGS) $(pbs_wish_OBJECTS) $(pbs_wish_LDADD) $(LIBS) printjob$(EXEEXT): $(printjob_OBJECTS) $(printjob_DEPENDENCIES) @rm -f printjob$(EXEEXT) $(LINK) $(printjob_LDFLAGS) $(printjob_OBJECTS) $(printjob_LDADD) $(LIBS) printserverdb$(EXEEXT): $(printserverdb_OBJECTS) $(printserverdb_DEPENDENCIES) @rm -f printserverdb$(EXEEXT) $(LINK) $(printserverdb_LDFLAGS) $(printserverdb_OBJECTS) $(printserverdb_LDADD) $(LIBS) printtracking$(EXEEXT): $(printtracking_OBJECTS) $(printtracking_DEPENDENCIES) @rm -f printtracking$(EXEEXT) $(LINK) $(printtracking_LDFLAGS) $(printtracking_OBJECTS) $(printtracking_LDADD) $(LIBS) tracejob$(EXEEXT): $(tracejob_OBJECTS) $(tracejob_DEPENDENCIES) @rm -f tracejob$(EXEEXT) $(LINK) $(tracejob_LDFLAGS) $(tracejob_OBJECTS) $(tracejob_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chk_tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_tclsh-pbsTclInit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_tclsh-site_tclWrap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_wish-pbsTkInit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_wish-pbs_tclWrap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_wish-site_tclWrap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printjob.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printserverdb-printserverdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printtracking.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tracejob-tracejob.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< pbs_tclsh-pbsTclInit.o: pbsTclInit.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -MT pbs_tclsh-pbsTclInit.o -MD -MP -MF "$(DEPDIR)/pbs_tclsh-pbsTclInit.Tpo" -c -o pbs_tclsh-pbsTclInit.o `test -f 'pbsTclInit.c' || echo '$(srcdir)/'`pbsTclInit.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_tclsh-pbsTclInit.Tpo" "$(DEPDIR)/pbs_tclsh-pbsTclInit.Po"; else rm -f "$(DEPDIR)/pbs_tclsh-pbsTclInit.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pbsTclInit.c' object='pbs_tclsh-pbsTclInit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -c -o pbs_tclsh-pbsTclInit.o `test -f 'pbsTclInit.c' || echo '$(srcdir)/'`pbsTclInit.c pbs_tclsh-pbsTclInit.obj: pbsTclInit.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -MT pbs_tclsh-pbsTclInit.obj -MD -MP -MF "$(DEPDIR)/pbs_tclsh-pbsTclInit.Tpo" -c -o pbs_tclsh-pbsTclInit.obj `if test -f 'pbsTclInit.c'; then $(CYGPATH_W) 'pbsTclInit.c'; else $(CYGPATH_W) '$(srcdir)/pbsTclInit.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_tclsh-pbsTclInit.Tpo" "$(DEPDIR)/pbs_tclsh-pbsTclInit.Po"; else rm -f "$(DEPDIR)/pbs_tclsh-pbsTclInit.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pbsTclInit.c' object='pbs_tclsh-pbsTclInit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -c -o pbs_tclsh-pbsTclInit.obj `if test -f 'pbsTclInit.c'; then $(CYGPATH_W) 'pbsTclInit.c'; else $(CYGPATH_W) '$(srcdir)/pbsTclInit.c'; fi` pbs_tclsh-pbs_tclWrap.o: ../scheduler.tcl/pbs_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -MT pbs_tclsh-pbs_tclWrap.o -MD -MP -MF "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Tpo" -c -o pbs_tclsh-pbs_tclWrap.o `test -f '../scheduler.tcl/pbs_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/pbs_tclWrap.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Tpo" "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/pbs_tclWrap.c' object='pbs_tclsh-pbs_tclWrap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -c -o pbs_tclsh-pbs_tclWrap.o `test -f '../scheduler.tcl/pbs_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/pbs_tclWrap.c pbs_tclsh-pbs_tclWrap.obj: ../scheduler.tcl/pbs_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -MT pbs_tclsh-pbs_tclWrap.obj -MD -MP -MF "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Tpo" -c -o pbs_tclsh-pbs_tclWrap.obj `if test -f '../scheduler.tcl/pbs_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/pbs_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/pbs_tclWrap.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Tpo" "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_tclsh-pbs_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/pbs_tclWrap.c' object='pbs_tclsh-pbs_tclWrap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -c -o pbs_tclsh-pbs_tclWrap.obj `if test -f '../scheduler.tcl/pbs_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/pbs_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/pbs_tclWrap.c'; fi` pbs_tclsh-site_tclWrap.o: ../scheduler.tcl/site_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -MT pbs_tclsh-site_tclWrap.o -MD -MP -MF "$(DEPDIR)/pbs_tclsh-site_tclWrap.Tpo" -c -o pbs_tclsh-site_tclWrap.o `test -f '../scheduler.tcl/site_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/site_tclWrap.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_tclsh-site_tclWrap.Tpo" "$(DEPDIR)/pbs_tclsh-site_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_tclsh-site_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/site_tclWrap.c' object='pbs_tclsh-site_tclWrap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -c -o pbs_tclsh-site_tclWrap.o `test -f '../scheduler.tcl/site_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/site_tclWrap.c pbs_tclsh-site_tclWrap.obj: ../scheduler.tcl/site_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -MT pbs_tclsh-site_tclWrap.obj -MD -MP -MF "$(DEPDIR)/pbs_tclsh-site_tclWrap.Tpo" -c -o pbs_tclsh-site_tclWrap.obj `if test -f '../scheduler.tcl/site_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/site_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/site_tclWrap.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_tclsh-site_tclWrap.Tpo" "$(DEPDIR)/pbs_tclsh-site_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_tclsh-site_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/site_tclWrap.c' object='pbs_tclsh-site_tclWrap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_tclsh_CFLAGS) $(CFLAGS) -c -o pbs_tclsh-site_tclWrap.obj `if test -f '../scheduler.tcl/site_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/site_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/site_tclWrap.c'; fi` pbs_wish-pbsTkInit.o: pbsTkInit.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -MT pbs_wish-pbsTkInit.o -MD -MP -MF "$(DEPDIR)/pbs_wish-pbsTkInit.Tpo" -c -o pbs_wish-pbsTkInit.o `test -f 'pbsTkInit.c' || echo '$(srcdir)/'`pbsTkInit.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_wish-pbsTkInit.Tpo" "$(DEPDIR)/pbs_wish-pbsTkInit.Po"; else rm -f "$(DEPDIR)/pbs_wish-pbsTkInit.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pbsTkInit.c' object='pbs_wish-pbsTkInit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -c -o pbs_wish-pbsTkInit.o `test -f 'pbsTkInit.c' || echo '$(srcdir)/'`pbsTkInit.c pbs_wish-pbsTkInit.obj: pbsTkInit.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -MT pbs_wish-pbsTkInit.obj -MD -MP -MF "$(DEPDIR)/pbs_wish-pbsTkInit.Tpo" -c -o pbs_wish-pbsTkInit.obj `if test -f 'pbsTkInit.c'; then $(CYGPATH_W) 'pbsTkInit.c'; else $(CYGPATH_W) '$(srcdir)/pbsTkInit.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_wish-pbsTkInit.Tpo" "$(DEPDIR)/pbs_wish-pbsTkInit.Po"; else rm -f "$(DEPDIR)/pbs_wish-pbsTkInit.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pbsTkInit.c' object='pbs_wish-pbsTkInit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -c -o pbs_wish-pbsTkInit.obj `if test -f 'pbsTkInit.c'; then $(CYGPATH_W) 'pbsTkInit.c'; else $(CYGPATH_W) '$(srcdir)/pbsTkInit.c'; fi` pbs_wish-pbs_tclWrap.o: ../scheduler.tcl/pbs_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -MT pbs_wish-pbs_tclWrap.o -MD -MP -MF "$(DEPDIR)/pbs_wish-pbs_tclWrap.Tpo" -c -o pbs_wish-pbs_tclWrap.o `test -f '../scheduler.tcl/pbs_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/pbs_tclWrap.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_wish-pbs_tclWrap.Tpo" "$(DEPDIR)/pbs_wish-pbs_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_wish-pbs_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/pbs_tclWrap.c' object='pbs_wish-pbs_tclWrap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -c -o pbs_wish-pbs_tclWrap.o `test -f '../scheduler.tcl/pbs_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/pbs_tclWrap.c pbs_wish-pbs_tclWrap.obj: ../scheduler.tcl/pbs_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -MT pbs_wish-pbs_tclWrap.obj -MD -MP -MF "$(DEPDIR)/pbs_wish-pbs_tclWrap.Tpo" -c -o pbs_wish-pbs_tclWrap.obj `if test -f '../scheduler.tcl/pbs_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/pbs_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/pbs_tclWrap.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_wish-pbs_tclWrap.Tpo" "$(DEPDIR)/pbs_wish-pbs_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_wish-pbs_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/pbs_tclWrap.c' object='pbs_wish-pbs_tclWrap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -c -o pbs_wish-pbs_tclWrap.obj `if test -f '../scheduler.tcl/pbs_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/pbs_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/pbs_tclWrap.c'; fi` pbs_wish-site_tclWrap.o: ../scheduler.tcl/site_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -MT pbs_wish-site_tclWrap.o -MD -MP -MF "$(DEPDIR)/pbs_wish-site_tclWrap.Tpo" -c -o pbs_wish-site_tclWrap.o `test -f '../scheduler.tcl/site_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/site_tclWrap.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_wish-site_tclWrap.Tpo" "$(DEPDIR)/pbs_wish-site_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_wish-site_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/site_tclWrap.c' object='pbs_wish-site_tclWrap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -c -o pbs_wish-site_tclWrap.o `test -f '../scheduler.tcl/site_tclWrap.c' || echo '$(srcdir)/'`../scheduler.tcl/site_tclWrap.c pbs_wish-site_tclWrap.obj: ../scheduler.tcl/site_tclWrap.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -MT pbs_wish-site_tclWrap.obj -MD -MP -MF "$(DEPDIR)/pbs_wish-site_tclWrap.Tpo" -c -o pbs_wish-site_tclWrap.obj `if test -f '../scheduler.tcl/site_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/site_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/site_tclWrap.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_wish-site_tclWrap.Tpo" "$(DEPDIR)/pbs_wish-site_tclWrap.Po"; else rm -f "$(DEPDIR)/pbs_wish-site_tclWrap.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../scheduler.tcl/site_tclWrap.c' object='pbs_wish-site_tclWrap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbs_wish_CFLAGS) $(CFLAGS) -c -o pbs_wish-site_tclWrap.obj `if test -f '../scheduler.tcl/site_tclWrap.c'; then $(CYGPATH_W) '../scheduler.tcl/site_tclWrap.c'; else $(CYGPATH_W) '$(srcdir)/../scheduler.tcl/site_tclWrap.c'; fi` printserverdb-printserverdb.o: printserverdb.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(printserverdb_CFLAGS) $(CFLAGS) -MT printserverdb-printserverdb.o -MD -MP -MF "$(DEPDIR)/printserverdb-printserverdb.Tpo" -c -o printserverdb-printserverdb.o `test -f 'printserverdb.c' || echo '$(srcdir)/'`printserverdb.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/printserverdb-printserverdb.Tpo" "$(DEPDIR)/printserverdb-printserverdb.Po"; else rm -f "$(DEPDIR)/printserverdb-printserverdb.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printserverdb.c' object='printserverdb-printserverdb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(printserverdb_CFLAGS) $(CFLAGS) -c -o printserverdb-printserverdb.o `test -f 'printserverdb.c' || echo '$(srcdir)/'`printserverdb.c printserverdb-printserverdb.obj: printserverdb.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(printserverdb_CFLAGS) $(CFLAGS) -MT printserverdb-printserverdb.obj -MD -MP -MF "$(DEPDIR)/printserverdb-printserverdb.Tpo" -c -o printserverdb-printserverdb.obj `if test -f 'printserverdb.c'; then $(CYGPATH_W) 'printserverdb.c'; else $(CYGPATH_W) '$(srcdir)/printserverdb.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/printserverdb-printserverdb.Tpo" "$(DEPDIR)/printserverdb-printserverdb.Po"; else rm -f "$(DEPDIR)/printserverdb-printserverdb.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printserverdb.c' object='printserverdb-printserverdb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(printserverdb_CFLAGS) $(CFLAGS) -c -o printserverdb-printserverdb.obj `if test -f 'printserverdb.c'; then $(CYGPATH_W) 'printserverdb.c'; else $(CYGPATH_W) '$(srcdir)/printserverdb.c'; fi` tracejob-tracejob.o: tracejob.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tracejob_CFLAGS) $(CFLAGS) -MT tracejob-tracejob.o -MD -MP -MF "$(DEPDIR)/tracejob-tracejob.Tpo" -c -o tracejob-tracejob.o `test -f 'tracejob.c' || echo '$(srcdir)/'`tracejob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tracejob-tracejob.Tpo" "$(DEPDIR)/tracejob-tracejob.Po"; else rm -f "$(DEPDIR)/tracejob-tracejob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tracejob.c' object='tracejob-tracejob.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tracejob_CFLAGS) $(CFLAGS) -c -o tracejob-tracejob.o `test -f 'tracejob.c' || echo '$(srcdir)/'`tracejob.c tracejob-tracejob.obj: tracejob.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tracejob_CFLAGS) $(CFLAGS) -MT tracejob-tracejob.obj -MD -MP -MF "$(DEPDIR)/tracejob-tracejob.Tpo" -c -o tracejob-tracejob.obj `if test -f 'tracejob.c'; then $(CYGPATH_W) 'tracejob.c'; else $(CYGPATH_W) '$(srcdir)/tracejob.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tracejob-tracejob.Tpo" "$(DEPDIR)/tracejob-tracejob.Po"; else rm -f "$(DEPDIR)/tracejob-tracejob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tracejob.c' object='tracejob-tracejob.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tracejob_CFLAGS) $(CFLAGS) -c -o tracejob-tracejob.obj `if test -f 'tracejob.c'; then $(CYGPATH_W) 'tracejob.c'; else $(CYGPATH_W) '$(srcdir)/tracejob.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils $(distdir)/init.d @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-binPROGRAMS clean-generic clean-libtool \ clean-recursive ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am install_gui: for dir in $(XPBSMON) ;do (cd $$dir && $(MAKE) install);done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/tools/hostn.c0000664000113300011330000001635411272401240013264 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #if !defined(H_ERRNO_DECLARED) && !defined(_AIX) extern int h_errno; #endif void usage(char *name) { fprintf(stderr, "Usage: %s [-v] hostname\n", name); fprintf(stderr, "\t -v turns on verbose output\n"); } int main(int argc, char *argv[], char *env[]) { int i; struct hostent *host; struct hostent *hosta; struct in_addr *ina; int naddr; int vflag = 0; void prt_herrno(); extern int optind; while ((i = getopt(argc, argv, "v")) != EOF) { switch (i) { case 'v': vflag = 1; break; default: usage(argv[0]); return (1); } } if (optind != argc - 1) { usage(argv[0]); return (1); } h_errno = 0; i = 0; while (env[i]) { if (!strncmp(env[i], "LOCALDOMAIN", 11)) { printf("%s\n", env[i]); env[i] = ""; break; } ++i; } host = gethostbyname(argv[optind]); if (host) { printf("primary name: %s", host->h_name); if (vflag) printf(" (from gethostbyname())"); printf("\n"); if (host->h_aliases && *host->h_aliases) { for (i = 0; host->h_aliases[i]; ++i) printf("aliases: %s\n", host->h_aliases[i]); } else if (vflag) { printf("aliases: -none-\n"); } if (vflag) printf(" address length: %d bytes\n", host->h_length); /* need to save address because they will be over writen on */ /* next call to gethostby*() */ naddr = 0; for (i = 0; host->h_addr_list[i]; ++i) { ++naddr; } ina = (struct in_addr *)malloc(sizeof(struct in_addr) * naddr); if (ina == NULL) { fprintf(stderr,"ERROR: no memory\n"); return(1); } for (i = 0; i < naddr; ++i) { (void)memcpy( (char *)(ina + i), host->h_addr_list[i], host->h_length); } for (i = 0; i < naddr; ++i) { printf(" address: %15.15s ", inet_ntoa(*(ina + i))); if (vflag) printf(" (%u dec) ", (int)(ina + i)->s_addr); h_errno = 0; hosta = gethostbyaddr((char *)(ina + i), host->h_length, host->h_addrtype); if (hosta) { printf("name: %s", host->h_name); } else { printf("name: -null-"); prt_herrno(); } printf("\n"); } } else { printf("no name entry found for %s\n", argv[optind]); prt_herrno(); } return 0; } void prt_herrno(void) { char *txt; switch (h_errno) { case 0: return; case HOST_NOT_FOUND: txt = "Answer Host Not Found"; break; case TRY_AGAIN: txt = "Try Again"; break; case NO_RECOVERY: txt = "No Recovery"; break; case NO_DATA: txt = "No Data"; break; default: txt = "unknown error"; break; } printf(" ** h_errno is %d %s\n", h_errno, txt); } torque-2.4.16/src/tools/tracejob.c0000664000113300011330000005170311442504364013731 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #if defined(HAVE_SYS_IOCTL_H) #include #endif #include "pbs_ifl.h" #include "log.h" #include "tracejob.h" /* path from pbs home to the log files */ const char *mid_path[] = { "server_priv/accounting", "server_logs", "mom_logs", "sched_logs" }; struct log_entry *log_lines; int ll_cur_amm; int ll_max_amm; int main( int argc, char *argv[]) { /* Array for the log entries for the specified job */ FILE *fp; int i, j; int file_count; char *filenames[MAX_LOG_FILES_PER_DAY]; /* full path of logfiles to read */ struct tm *tm_ptr; time_t t, t_save; signed char c; char *prefix_path = NULL; int number_of_days = 1; char *endp; short error = 0; int opt; char no_acct = 0, no_svr = 0, no_mom = 0, no_schd = 0; char verbosity = 1; int wrap = -1; int log_filter = 0; int event_type; char filter_excessive = 0; int excessive_count; #if defined(FILTER_EXCESSIVE) filter_excessive = 1; #endif #if defined(EXCESSIVE_COUNT) excessive_count = EXCESSIVE_COUNT; #endif while ((c = getopt(argc, argv, "qzvamslw:p:n:f:c:")) != EOF) { switch (c) { case 'q': verbosity = 0; break; case 'v': verbosity = 2; break; case 'a': no_acct = 1; break; case 's': no_svr = 1; break; case 'm': no_mom = 1; break; case 'l': no_schd = 1; break; case 'z': filter_excessive = filter_excessive ? 0 : 1; break; case 'c': excessive_count = strtol(optarg, &endp, 10); if (*endp != '\0') error = 1; break; case 'w': wrap = strtol(optarg, &endp, 10); if (*endp != '\0') error = 1; break; case 'p': prefix_path = optarg; break; case 'n': number_of_days = strtol(optarg, &endp, 10); if (*endp != '\0') error = 1; break; case 'f': if (!strcmp(optarg, "error")) log_filter |= PBSEVENT_ERROR; else if (!strcmp(optarg, "system")) log_filter |= PBSEVENT_SYSTEM; else if (!strcmp(optarg, "admin")) log_filter |= PBSEVENT_ADMIN; else if (!strcmp(optarg, "job")) log_filter |= PBSEVENT_JOB; else if (!strcmp(optarg, "job_usage")) log_filter |= PBSEVENT_JOB_USAGE; else if (!strcmp(optarg, "security")) log_filter |= PBSEVENT_SECURITY; else if (!strcmp(optarg, "sched")) log_filter |= PBSEVENT_SCHED; else if (!strcmp(optarg, "debug")) log_filter |= PBSEVENT_DEBUG; else if (!strcmp(optarg, "debug2")) log_filter |= PBSEVENT_DEBUG2; else if (isdigit(optarg[0])) { log_filter = strtol(optarg, &endp, 16); if (*endp != '\0') error = 1; } else error = 1; break; default: error = 1; break; } } /* END while ((c = getopt(argc,argv,"zvamslw:p:n:f:c:")) != EOF) */ /* no jobs */ if ((error != 0) || (argc == optind)) { printf("USAGE: %s [-a|s|l|m|q|v|z] [-c count] [-w size] [-p path] [-n days] [-f filter_type] \n", strip_path(argv[0])); printf( " -p : path to PBS_SERVER_HOME\n" " -w : number of columns of your terminal\n" " -n : number of days in the past to look for job(s) [default 1]\n" " -f : filter out types of log entries, multiple -f's can be specified\n" " error, system, admin, job, job_usage, security, sched, debug, \n" " debug2, or absolute numeric hex equivalent\n" " -z : toggle filtering excessive messages\n"); printf( " -c : what message count is considered excessive\n" " -a : don't use accounting log files\n" " -s : don't use server log files\n" " -l : don't use scheduler log files\n" " -m : don't use mom log files\n" " -q : quiet mode - hide all error messages\n" " -v : verbose mode - show more error messages\n"); printf("default prefix path = %s\n", PBS_SERVER_HOME); #if defined(FILTER_EXCESSIVE) printf("filter_excessive: ON\n"); #else printf("filter_excessive: OFF\n"); #endif return(1); } /* END if ((error != 0) || (argc == optind)) */ if (wrap == -1) wrap = get_cols(); time(&t); t_save = t; for (opt = optind;opt < argc;opt++) { for (i = 0, t = t_save;i < number_of_days;i++, t -= SECONDS_IN_DAY) { tm_ptr = localtime(&t); for (j = 0;j < 4;j++) { if ((j == IND_ACCT && no_acct) || (j == IND_SERVER && no_svr) || (j == IND_MOM && no_mom) || (j == IND_SCHED && no_schd)) continue; file_count = log_path(prefix_path, j, tm_ptr, filenames); /* there can be multiple server and mom log files per day */ /* traverse filenames until we have got them all */ if (file_count < 0) { printf("Error getting file names\n"); continue; } for (; file_count > 0; file_count--) { if ((fp = fopen(filenames[file_count-1], "r")) == NULL) { if (verbosity >= 1) perror(filenames[file_count-1]); continue; } if (parse_log(fp, argv[opt], j) < 0) { /* no valid entries located in file */ if (verbosity >= 1) { fprintf(stderr, "%s: No matching job records located\n", filenames[file_count-1]); } } else if (verbosity >= 2) { fprintf(stderr, "%s: Successfully located matching job records\n", filenames[file_count-1]); } fclose(fp); free(filenames[file_count-1]); } /* end of for file_count */ } } /* END for (i) */ if (filter_excessive) filter_excess(excessive_count); qsort(log_lines, ll_cur_amm, sizeof(struct log_entry), sort_by_date); if (ll_cur_amm != 0) { printf("\nJob: %s\n\n", log_lines[0].name); } for (i = 0;i < ll_cur_amm;i++) { if (log_lines[i].log_file == 'A') event_type = 0; else event_type = strtol(log_lines[i].event, &endp, 16); if (!(log_filter & event_type) && !(log_lines[i].no_print)) { printf("%-20s %-5c", log_lines[i].date, log_lines[i].log_file); line_wrap(log_lines[i].msg, 26, wrap); } } } /* END for (opt) */ return(0); } /* END main() */ /* * * parse_log - parse out entires of a log file for a specific job * and return them in log_entry structures * * fp - the log file * job - the name of the job * ind - which log file - index in enum index * * returns nothing * modifies global variables: loglines, ll_cur_amm, ll_max_amm * */ int parse_log( FILE *fp, /* I */ char *job, /* I */ int ind) /* I */ { struct log_entry tmp; /* temporary log entry */ char buf[32768]; /* buffer to read in from file */ char *p; /* pointer to use for strtok */ int field_count; /* which field in log entry */ int j = 0; struct tm tms; /* used to convert date to unix date */ static char none[1] = { '\0' }; int lineno = 0; int logcount = 0; tms.tm_isdst = -1; /* mktime() will attempt to figure it out */ while (fgets(buf, sizeof(buf), fp) != NULL) { lineno++; j++; buf[strlen(buf) - 1] = '\0'; p = strtok(buf, ";"); field_count = 0; memset(&tmp, 0, sizeof(struct log_entry)); for (field_count = 0;(field_count < 6) && (p != NULL);field_count++) { switch (field_count) { case FLD_DATE: tmp.date = p; if (ind == IND_ACCT) field_count = 2; break; case FLD_EVENT: tmp.event = p; break; case FLD_OBJ: tmp.obj = p; break; case FLD_TYPE: tmp.type = p; break; case FLD_NAME: tmp.name = p; break; case FLD_MSG: tmp.msg = p; break; default: printf("Field count too big!\n"); printf("%s\n", p); break; } p = strtok(NULL, ";"); } /* END for (field_count) */ if ((tmp.name != NULL) && !strncmp(job, tmp.name, strlen(job)) && !isdigit(tmp.name[strlen(job)])) { if (ll_cur_amm >= ll_max_amm) alloc_more_space(); free_log_entry(&log_lines[ll_cur_amm]); if (tmp.date != NULL) { log_lines[ll_cur_amm].date = strdup(tmp.date); if (sscanf(tmp.date, "%d/%d/%d %d:%d:%d", &tms.tm_mon, &tms.tm_mday, &tms.tm_year, &tms.tm_hour, &tms.tm_min, &tms.tm_sec) != 6) log_lines[ll_cur_amm].date_time = -1; /* error in date field */ else { if (tms.tm_year > 1900) tms.tm_year -= 1900; log_lines[ll_cur_amm].date_time = mktime(&tms); } } if (tmp.event != NULL) log_lines[ll_cur_amm].event = strdup(tmp.event); else log_lines[ll_cur_amm].event = none; if (tmp.obj != NULL) log_lines[ll_cur_amm].obj = strdup(tmp.obj); else log_lines[ll_cur_amm].obj = none; if (tmp.type != NULL) log_lines[ll_cur_amm].type = strdup(tmp.type); else log_lines[ll_cur_amm].type = none; if (tmp.name != NULL) log_lines[ll_cur_amm].name = strdup(tmp.name); else log_lines[ll_cur_amm].name = none; if (tmp.msg != NULL) log_lines[ll_cur_amm].msg = strdup(tmp.msg); else log_lines[ll_cur_amm].msg = none; switch (ind) { case IND_SERVER: log_lines[ll_cur_amm].log_file = 'S'; break; case IND_SCHED: log_lines[ll_cur_amm].log_file = 'L'; break; case IND_ACCT: log_lines[ll_cur_amm].log_file = 'A'; break; case IND_MOM: log_lines[ll_cur_amm].log_file = 'M'; break; default: log_lines[ll_cur_amm].log_file = 'U'; /* undefined */ } log_lines[ll_cur_amm].lineno = lineno; ll_cur_amm++; logcount++; } } /* END while (fgets(buf,sizeof(buf),fp) != NULL) */ if (logcount == 0) { /* FAILURE */ return(-1); } /* SUCCESS */ return(0); } /* END parse_log() */ /* * * sort_by_date - compare function for qsort. It compares two time_t * variables * */ int sort_by_date( const void *v1, /* I */ const void *v2) /* I */ { struct log_entry *l1, *l2; l1 = (struct log_entry*) v1; l2 = (struct log_entry*) v2; if (l1->date_time < l2->date_time) { return(-1); } else if (l1->date_time > l2->date_time) { return(1); } if (l1->log_file == l2->log_file) { if (l1->lineno < l2->lineno) { return(-1); } else if (l1->lineno > l2->lineno) { return(1); } } return(0); } /* * * sort_by_message - compare function used by qsort. Compares the message * */ int sort_by_message(const void *v1, const void *v2) { return strcmp(((struct log_entry*) v1) -> msg, ((struct log_entry*) v2) -> msg); } /* * * strip_path - strips all leading path and returns the command name * i.e. /usr/bin/vi => vi * * path - the path to strip * * returns striped path * */ char *strip_path(char *path) { char *p; p = path + strlen(path); while (p != path && *p != '/') p--; if (*p == '/') p++; return p; } /* * * free_log_entry - free the interal data used by a log entry * * lg - log entry to free * * returns nothing * */ void free_log_entry(struct log_entry *lg) { if (lg -> date != NULL) free(lg -> date); lg -> date = NULL; if (lg -> event != NULL) free(lg -> event); lg -> event = NULL; if (lg -> obj != NULL) free(lg -> obj); lg -> obj = NULL; if (lg -> type != NULL) free(lg -> type); lg -> type = NULL; if (lg -> name != NULL) free(lg -> name); lg -> name = NULL; if (lg -> msg != NULL) free(lg -> msg); lg -> msg = NULL; lg -> log_file = '\0'; } /* * * line_wrap - wrap lines at word margen and print * The first line will be printed. The rest will be indented * by start and will not go over a max line length of end chars * * * line - the line to wrap * start - ammount of whitespace to indent subsquent lines * end - number of columns in the terminal * * returns nothing * */ void line_wrap(char *line, int start, int end) { int wrap_at; int total_size; int start_index; char *cur_ptr; char *start_ptr; start_ptr = line; total_size = strlen(line); wrap_at = end - start; start_index = 0; if (end == 0) printf("%s\n", line); else { while (start_index < total_size) { if (start_index + wrap_at < total_size) { cur_ptr = start_ptr + wrap_at; while (cur_ptr > start_ptr && *cur_ptr != ' ') cur_ptr--; if (cur_ptr == start_ptr) { cur_ptr = start_ptr + wrap_at; while (*cur_ptr != ' ' && *cur_ptr != '\0') cur_ptr++; } *cur_ptr = '\0'; } else cur_ptr = line + total_size; /* first line, don't indent */ if (start_ptr == line) printf("%s\n", start_ptr); else printf("%*s%s\n", start, " ", start_ptr); start_ptr = cur_ptr + 1; start_index = cur_ptr - line; } } } /* * * log_path - create the path to a log file * * path - prefix path * index - index into the prefix_path array * tm_ptr - time pointer to create filename from * filenames - returned filenames * * returns -1 if unsuccessful otherwise the number of filenames found * */ int log_path( char *path, int index, struct tm *tm_ptr, char *filenames[]) { static char buf[512]; static char cmd[512 + 20]; char pbuf[512 + 10]; int filecount = 0; FILE *fp; sprintf(buf, "%s/%s/%04d%02d%02d", (path != NULL) ? path : PBS_SERVER_HOME, mid_path[index], tm_ptr->tm_year + 1900, tm_ptr->tm_mon + 1, tm_ptr->tm_mday); filenames[filecount] = malloc(strlen(buf)+1); if(!filenames[filecount]) { perror("malloc failed in log_path"); return(-1); } strcpy(filenames[filecount],buf); filecount++; sprintf(cmd, "ls -1t %s.* 2> /dev/null", buf); if ((fp = popen(cmd, "r")) != NULL) { while (fgets(pbuf, 512, fp) != NULL) { filenames[filecount] = malloc(strlen(pbuf)+1); if (filenames[filecount] == NULL) { perror("malloc failed in log_path"); return(-1); } if (isspace(pbuf[strlen(pbuf)-1])) { pbuf[strlen(pbuf)-1] = '\0'; } strcpy(filenames[filecount],pbuf); filecount++; } pclose(fp); } return(filecount); } int get_cols(void) { struct winsize ws; ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws); return ws.ws_col; } /* * * alloc_space - double the allocation of current log entires * */ void alloc_more_space(void) { int old_amm = ll_max_amm; if (ll_max_amm == 0) ll_max_amm = DEFAULT_LOG_LINES; else ll_max_amm *= 2; if ((log_lines = realloc(log_lines, ll_max_amm * sizeof(struct log_entry))) == NULL) { perror("Error allocating memory"); exit(1); } memset(&log_lines[old_amm], 0, (ll_max_amm - old_amm) * sizeof(struct log_entry)); } /* * * filter_excess - count and set the no_print flags if the count goes over * the message threshold * * threshold - if the number of messages exceeds this, don't print them * * returns nothing * * NOTE: log_lines array will be sorted in place */ void filter_excess(int threshold) { int cur_count = 1; char *msg; int i; int j = 0; if (ll_cur_amm) { qsort(log_lines, ll_cur_amm, sizeof(struct log_entry), sort_by_message); msg = log_lines[0].msg; for (i = 1; i < ll_cur_amm; i++) { if (strcmp(log_lines[i].msg, msg) == 0) cur_count++; else { if (cur_count >= threshold) { /* we want to print 1 of the many messages */ j++; for (; j < i; j++) log_lines[j].no_print = 1; } j = i; cur_count = 1; msg = log_lines[i].msg; } } if (cur_count >= threshold) { j++; for (; j < i; j++) log_lines[j].no_print = 1; } } } torque-2.4.16/src/tools/xpbsmon/0000777000113300011330000000000011614035204013527 500000000000000torque-2.4.16/src/tools/xpbsmon/pbs.tk0000664000113300011330000002332411272401240014572 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc about {} { global bitmap_dir canvas dialog XPBSMON_VERSION set dialog(aboutDialogBox) ".about" set dbox [popupDialogBox $dialog(aboutDialogBox) "About..."] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] label $dbox_top.l -bitmap @$bitmap_dir/logo.bmp message $dbox_top.m -font $canvas(bigLabelFont) -justify center \ -aspect 1000 -text " XPBSMON $XPBSMON_VERSION written by Albeaus Bayucan The GUI toolkit used is Tcl/Tk. For more information about PBS, please visit us at: http://www.openpbs.org" set buttons [buildCmdButtons $dbox_bottom {{{ok ok} {notes "release notes"}}}\ x 20m 14 3] set ok_button [lindex $buttons 1] set notes_button [lindex $buttons 2] $ok_button configure -command [list destroy $dialog(aboutDialogBox)] $notes_button configure -command {xpbs_help notes $dialog(aboutDialogBox)} register_default_action $dialog(aboutDialogBox) $ok_button pack $dbox_top.l $dbox_top.m -side left -anchor nw catch {tkwait window $dialog(aboutDialogBox)} } proc getNodesList {sitename host nodes} { set nodeslist "" catch {openrm $host} fd InfoBox_sendmsg "getNodesList: openrm($host): $fd" end if {$fd >= 0} { catch {addreq $fd $nodes} ret InfoBox_sendmsg "getNodesList: addreq($host,$nodes): $ret" end if {$ret >= 0} { catch {getreq $fd} res InfoBox_sendmsg "getNodesList: getreq($host,$nodes): $res" end if { [string compare $res ""] != 0 && \ [string compare [string index $res 0] "?"] != 0 } { set nodeslist $res } } catch {closerm $fd} InfoBox_sendmsg "getNodesList: closerm($host)" end } return $nodeslist } proc TSgetStatus {fd sysframe nodename {update 1}} { catch {addreq $fd arch} ret InfoBox_sendmsg "TSgetStatus: addreq($nodename,arch): $ret" end if {$ret < 0} { if {$update} { nodeUpdateStat $sysframe $nodename DOWN } return DOWN } else { catch {getreq $fd} res InfoBox_sendmsg "TSgetStatus: getreq($nodename,arch): $res" end if { [string compare $res ""] == 0 } { if {$update} { nodeUpdateStat $sysframe $nodename DOWN } return DOWN } if { [string compare [string index $res 0] "?"] == 0 } { if {$update} { nodeUpdateStat $sysframe $nodename NOINFO } return NOINFO } if {$update} { nodeUpdateStat $sysframe $nodename FREE } return FREE } } proc sendTSQueries {fd sitename nodename} { global queryTable if { ![info exists queryTable($sitename,$nodename)] } { return "" } set queryIdxList "" set row 0 foreach queryInfo $queryTable($sitename,$nodename) { set col 0 set qexpr [lindex $queryInfo 0] set type [lindex $queryInfo 2] foreach operand $qexpr { if { ([string compare $type TEXT] == 0 || \ [string compare $type SCALE] == 0 ) && \ [isQueryString $operand] } { if [addLlist queryIdxList $operand $row $col] { catch {addreq $fd $operand} InfoBox_sendmsg "sendTSQueries: addreq($nodename,$operand)" end } } incr col } incr row } return $queryIdxList } proc recvResponses {fd sitename nodename querylist} { global queryTable if { ![info exists queryTable($sitename,$nodename)] } { return "" } set qtable $queryTable($sitename,$nodename) set qtable "" foreach qe $queryTable($sitename,$nodename) { set type [lindex $qe 2] lappend qtable $qe } set tlen [llength $querylist] for {set i 0} {$i < $tlen} {incr i} { catch {getreq $fd} res InfoBox_sendmsg "recvResponses: getreq($nodename): $res" end if { [string compare [string index $res 0] "?"] == 0 } { set res "" } set qindices [lrange [lindex $querylist $i] 1 end] set llen [llength $qindices] for {set j 0; set k 1} { $k < $llen} {incr j 2; incr k 2} { set row [lindex $qindices $j] set col [lindex $qindices $k] set queryInfo [lindex $qtable $row] set qexpr [lindex $queryInfo 0] set hdr [lindex $queryInfo 1] set typ [lindex $queryInfo 2] set nqexpr [lreplace $qexpr $col $col $res] set new_entry [list $nqexpr $hdr $typ] set qtable [lreplace $qtable $row $row $new_entry] } } return $qtable } # xpbs_help: brings up an help information box displaying things related to # 'help_category'. proc xpbs_help {help_category callerDialogBox} { global helpdir if { [string compare $callerDialogBox ""] != 0 } { win_cmdExec $callerDialogBox "cat $helpdir/${help_category}.hlp" } else { win_cmdExec "" "cat $helpdir/${help_category}.hlp" } } torque-2.4.16/src/tools/xpbsmon/listbox.tk0000664000113300011330000003402511272401240015472 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains all procedures related to listboxes. # In PBS's GUI: # a listbox can have # one or more entries, # and each entry is made up of a # number of field values separated by one or more white spaces. # A field is referred to as # the index # representing the corresponding field value. # The terms "entry", "field", "fieldval" will be used to represent listbox # elements. # ################################################################################ # buildFullListbox: a procedure that automates the creation of a complete # listbox using the "listbox" widet command. # INPUT: frame_name - the name of the frame widget where to place the # complete listbox. # ColxRow - # of columns (characters) and # of rows # lines on the the listbox. Must have the # format, x # header_str - the header string of the listbox. # scrollbarType - specifies the orientation of the listbox's # scrollbar. Can only have the values: # xscroll, yscroll, xyscroll, noscroll. # IF header_str is the empty "" string, then the listbox will have no header # meaning, even the select all/deselect all button will not be placed. # # OPTIONS: # all_button - if you want the "Select All/Deselect All" to # be included. # header_at_left - if you want the header string to be at the # left side of the listbox. proc buildFullListbox {frame_name ColxRow header_str scrollbarType \ {all_button 1} {header_at_left 0} {expand_label 1}} { global BADPARAM errmsg tk_version canvas set procname "buildFull_FullListbox" set scrollbars "" ## Let's be defensive about the input if { ![regexp "\\." $frame_name] || \ ![regexp "(\[0-9]+)x(\[0-9]+)" $ColxRow match Col Row] || \ ([string compare $scrollbarType "xscroll"] != 0 && \ [string compare $scrollbarType "yscroll"] != 0 && \ [string compare $scrollbarType "xyscroll"] != 0 && \ [string compare $scrollbarType "noscroll"] != 0) } { puts "Error $BADPARAM in $procname: $errmsg(BADPARAM)" exit $BADPARAM } if { [string compare $frame_name "." ] == 0 } { set frame_name "" } if { [string compare $header_str ""] != 0 } { frame $frame_name.header -borderwidth 1 pack $frame_name.header -side top -expand 1 label $frame_name.header.label -text $header_str -anchor nw \ -padx 1 -pady 1 set labelwidth \ [expr $canvas(bigLabelFontWidth)*[string length header_str]] set listboxwidth [expr $canvas(bigLabelFontWidth)*$Col] set padx [expr round($listboxwidth*0.4)] if {[expr $padx + $labelwidth] > $listboxwidth} { set padx 0 } if {$all_button} { set selMode "Select All" button $frame_name.header.select \ -padx 2m \ -anchor c -width 12 -text "Select All" -pady 1 if {$expand_label} { pack $frame_name.header.label -side left -anchor nw -expand 1 \ -padx $padx } else { pack $frame_name.header.label -side left -anchor nw } pack $frame_name.header.select -side left -anchor se } else { if {$expand_label} { pack $frame_name.header.label -side left -anchor nw -expand 1 \ -padx $padx } else { pack $frame_name.header.label -side left -anchor nw } } if {$header_at_left && [string compare $header_str ""] != 0} { $frame_name.header.label configure \ -width [string length $header_str] \ -padx $padx pack forget $frame_name.header $frame_name.header.label pack $frame_name.header $frame_name.header.label -expand 0 -side left \ -anchor nw } } listbox $frame_name.box -borderwidth 1 \ -setgrid 0 \ -exportselection false \ -relief sunken if { $tk_version < 4.0 } { $frame_name.box configure -geometry $ColxRow } else { $frame_name.box configure -width $Col -height $Row -selectmode extended } pack $frame_name.box -anchor se -side left -expand 1 -fill x if { [string compare $scrollbarType "yscroll"] == 0 || \ [string compare $scrollbarType "xyscroll"] == 0 } { scrollbar $frame_name.vscroll -command "$frame_name.box yview" \ -borderwidth 2 \ -orient vertical \ -relief groove $frame_name.box configure -yscrollcommand "$frame_name.vscroll set" pack $frame_name.vscroll -anchor w -fill y -expand 1 -side right \ -before $frame_name.box append scrollbars " $frame_name.vscroll" } if { [string compare $scrollbarType "xscroll"] == 0 || \ [string compare $scrollbarType "xyscroll"] == 0 } { scrollbar $frame_name.hscroll -command "$frame_name.box xview" \ -borderwidth 2 \ -orient horizontal \ -relief groove $frame_name.box configure -xscrollcommand "$frame_name.hscroll set" pack $frame_name.hscroll -fill x -expand 1 -side bottom \ -before $frame_name.box -anchor nw append scrollbars " $frame_name.hscroll" } return [concat $frame_name $frame_name.header.label \ $frame_name.header.select $frame_name.box $scrollbars] } # get_keyvals: Procedure that returns a formatted string containing field # values (indexes specified in 'key_list') of a listbox, 'lbox'. The format of # string puts 'inner_sep' within key values of an entry, and 'outer_sep' # between entries of the listbox. The entries of the listbox that will be # checked can be either "all" or "select". # # Ex. suppose you have a listbox, lbox1, whose key is a pair: # {column_0 column_6}. The idea is to return the string: # # "entry0_key0val@entry0_key6val|entry1_key0val@entry1_key6val}|.." # Do this by calling the procedure as follows: # get_keyvals lbox1 {0 6} "@" "|" "all" # # CAUTION: This procedure returns a list of elements ACCORDING to its # increasing entry position in the list box. # So returning "elem1 elem2 elem3" means 'elem1' appears in the listbox before # 'elem2', and 'elem2' appears before 'elem3', and so on. proc get_keyvals {lbox key_list inner_sep outer_sep {type "all"}} { # Get the indices to the entries if { [string compare $type "select"] == 0 } { set indices [$lbox curselection] } else { set num_els [$lbox size] set indices "" for {set i 0} {$i < $num_els} {incr i} { append indices " $i" } } if {[string compare $indices ""] == 0} { return "" ;# No need to proceed if there are no entries ;# in lbox1 selected. } set elems "" foreach entry [lsort -integer -increasing $indices] { set key_elems "" set lbox_entry [$lbox get $entry] foreach field [lrange $key_list 0 end] { append key_elems "[lindex $lbox_entry $field]$inner_sep" } if { [string compare $key_elems $outer_sep] == 0 } { InfoBox_sendmsg "Found \"$lbox_entry\" entry to have incomplete information" append elems "$key_elems$outer_sep" } else { append elems "[string trim $key_elems $inner_sep]$outer_sep" } } return "[string trim $elems $outer_sep]" } # strget_keyvals: similar to get_keyvals except instead of a listbox, the # source is a string. proc strget_keyvals {str key_list sep} { if {[string compare $str ""] == 0} { return "" ;# No need to proceed if there are no entries ;# in lbox1 selected. } set key_elems "" foreach field [lrange $key_list 0 end] { if {[string compare $key_elems ""] != 0} { append key_elems "$sep[lindex $str $field]" } else { set key_elems [lindex $str $field] } } return $key_elems } proc disable_listbox { box headerLabel selButton scrollbar} { global sysinfo canvas if { [string compare $headerLabel ""] != 0 } { disable_label $headerLabel $canvas(disabledColor) } if { [string compare $selButton ""] != 0 } { disable_button $selButton } if { [string compare $scrollbar ""] != 0 } { disable_scrollbar $scrollbar $canvas(disabledColor) } bind_listbox_readonly $box set fgColor [lindex [$box configure -foreground] 4] set selBgColor [lindex [$box configure -selectbackground] 4] set selFgColor [lindex [$box configure -selectforeground] 4] if { [string compare $canvas(disabledColor) $fgColor] == 0 && \ [string compare $canvas(disabledColor) $selFgColor] == 0 && \ [string compare $canvas(disabledColor) $selBgColor] == 0} { return } set sysinfo((selfgColor$box) $fgColor set sysinfo(selFgColor$box) $selFgColor set sysinfo(selBgColor$box) $selBgColor $box configure -foreground $canvas(disabledColor) \ -selectforeground $canvas(disabledColor) \ -selectbackground $canvas(disabledColor) } proc enable_listbox { box headerLabel selButton scrollbar enaBox_proc } { global sysinfo if { ![info exists sysinfo(selfgColor$box)] && \ ![info exists sysinfo(selFgColor$box)] && \ ![info exists sysinfo(selBgColor$box)]} { return } if { [string compare $headerLabel ""] != 0 } { enable_label $headerLabel } if { [string compare $selButton ""] != 0 } { enable_button $selButton } if { [string compare $scrollbar ""] != 0 } { enable_scrollbar $scrollbar } eval $enaBox_proc $box $box configure -foreground $sysinfo(selfgColor$box) \ -selectforeground $sysinfo(selFgColor$box) \ -selectbackground $sysinfo(selBgColor$box) } proc lboxvalue_isUnique {listbox value} { for {set k 0} {$k < [$listbox size]} {incr k} { set lboxval [$listbox get $k] if {[string compare $lboxval $value] == 0} { return 0 } } return 1 } # lcomp: compares 2 listboxes: returns 0 if the same; 1 otherwise proc lcomp {lbox1 lbox2} { set llen1 [llength $lbox1] set llen2 [llength $lbox2] if {$llen1 != $llen2} { return 1 } for {set i 0} {$i < $llen1} {incr i} { set elem1 [lindex $lbox1 $i] set elem2 [lindex $lbox2 $i] if {[string compare $elem1 $elem2] != 0} { return 1 } } return 0 } torque-2.4.16/src/tools/xpbsmon/cluster.tk0000664000113300011330000013574111272401240015476 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc clusterAddWidth {clusterf incr} { global canvas if {[string compare $clusterf ""] == 0 || ![regexp {[0-9]+} $incr]} { return } set sysframe [clusterSystemFrameGet $clusterf] set newCanvWidth [expr [clusterCanvasWidthGet $clusterf] + $incr] set newDispWidth [expr [clusterDisplayWidthGet $clusterf] + $incr] if {$newDispWidth < $canvas(clusterMaxWidth)} { clusterCanvasWidthPut $clusterf $newCanvWidth clusterDisplayWidthPut $clusterf $newDispWidth set endpt [expr [clusterXposGet $clusterf] + $newCanvWidth] if {$endpt > [systemCanvasWidthGet $sysframe]} { systemAddWidth $sysframe $incr } } clusterScrollRegionWidthPut $clusterf \ [expr [clusterScrollRegionWidthGet $clusterf] + $incr] } proc clusterPropagateOffset {clusterf diff} { if {[string compare $clusterf ""] == 0 || ![regexp {[0-9]+} $diff]} { return } set nextCluster [clusterNextGet $clusterf] while {[string compare $nextCluster ""] != 0} { set clusterOffset [clusterOffsetWidthGet $nextCluster] clusterOffsetWidthPut $nextCluster \ [expr $clusterOffset + $diff] set nextCluster [clusterNextGet $nextCluster] } } proc clusterDelete clusterframe { set array [string trimleft $clusterframe .] global $array if { [string compare $clusterframe ""] == 0 } { return } catch {pack forget $clusterframe} set cname [clusterNameGet $clusterframe] set sysframe [clusterSystemFrameGet $clusterframe] systemClusterFrameUnset $sysframe $cname unset $array } proc clusterNamePut {clusterframe name} { set array [string trimleft $clusterframe .] global $array set ${array}(name) $name } proc clusterNameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(name)]} { return "" } return [set ${array}(name)] } proc clusterCanvasFramePut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(canvasFrame) $frame } proc clusterCanvasFrameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(canvasFrame)]} { return "" } return [set ${array}(canvasFrame)] } proc clusterCanvasPut {clusterframe canvas} { set array [string trimleft $clusterframe .] global $array set ${array}(canvas) $canvas } proc clusterCanvasGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(canvas)]} { return "" } return [set ${array}(canvas)] } proc clusterRefreshPut {clusterframe flag} { set array [string trimleft $clusterframe .] global $array set ${array}(refresh) $flag } proc clusterRefreshGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(refresh)]} { return 0 } return [set ${array}(refresh)] } proc clusterLabelFramePut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(labelFrame) $frame } proc clusterLabelFrameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(labelFrame)]} { return "" } return [set ${array}(labelFrame)] } proc clusterLabelPut {clusterframe label} { set array [string trimleft $clusterframe .] global $array set ${array}(label) $label } proc clusterLabelGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(label)]} { return "" } return [set ${array}(label)] } proc clusterLabelTextPut {clusterframe text} { set array [string trimleft $clusterframe .] global $array set ${array}(labelText) $text } proc clusterLabelTextGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(labelText)]} { return "" } return [set ${array}(labelText)] } proc clusterFooterHeaderPut {clusterframe label} { set array [string trimleft $clusterframe .] global $array set ${array}(footerHeader) $label } proc clusterFooterHeaderGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(footerHeader)]} { return "" } return [set ${array}(footerHeader)] } proc clusterStatusBarPut {clusterframe statusBar} { set array [string trimleft $clusterframe .] global $array set ${array}(statusBar) $statusBar } proc clusterStatusBarFramePut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(statusBarFrame) $frame } proc clusterStatusBarFrameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(statusBarFrame)]} { return "" } return [set ${array}(statusBarFrame)] } proc clusterStatusBarGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(statusBar)]} { return "" } return [set ${array}(statusBar)] } proc clusterXscrollFramePut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(xscrollFrame) $frame } proc clusterXscrollFrameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(xscrollFrame)]} { return "" } return [set ${array}(xscrollFrame)] } proc clusterXscrollPut {clusterframe xscroll} { set array [string trimleft $clusterframe .] global $array set ${array}(Xscroll) $xscroll } proc clusterXscrollGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(Xscroll)]} { return "" } return [set ${array}(Xscroll)] } proc clusterYscrollFramePut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(yscrollFrame) $frame } proc clusterYscrollFrameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(yscrollFrame)]} { return "" } return [set ${array}(yscrollFrame)] } proc clusterYscrollPut {clusterframe yscroll} { set array [string trimleft $clusterframe .] global $array set ${array}(Yscroll) $yscroll } proc clusterYscrollGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(Yscroll)]} { return "" } return [set ${array}(Yscroll)] } proc clusterDisplayWidthPut {clusterframe width} { set array [string trimleft $clusterframe .] global $array set ${array}(displayWidth) $width } proc clusterDisplayWidthGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(displayWidth)]} { return "" } return [set ${array}(displayWidth)] } proc clusterDisplayHeightPut {clusterframe height} { set array [string trimleft $clusterframe .] global $array set ${array}(displayHeight) $height } proc clusterDisplayHeightGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(displayHeight)]} { return "" } return [set ${array}(displayHeight)] } proc clusterCanvasWidthPut {clusterframe width} { set array [string trimleft $clusterframe .] global $array set ${array}(canvasWidth) $width } proc clusterCanvasWidthGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(canvasWidth)]} { return "" } return [set ${array}(canvasWidth)] } proc clusterCanvasHeightPut {clusterframe height} { set array [string trimleft $clusterframe .] global $array set ${array}(canvasHeight) $height } proc clusterCanvasHeightGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(canvasHeight)]} { return "" } return [set ${array}(canvasHeight)] } proc clusterScrollRegionWidthPut {clusterframe width} { set array [string trimleft $clusterframe .] global $array set ${array}(scrollRegionWidth) $width } proc clusterScrollRegionWidthGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(scrollRegionWidth)]} { return "" } return [set ${array}(scrollRegionWidth)] } proc clusterScrollRegionHeightPut {clusterframe height} { set array [string trimleft $clusterframe .] global $array set ${array}(scrollRegionHeight) $height } proc clusterScrollRegionHeightGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(scrollRegionHeight)]} { return "" } return [set ${array}(scrollRegionHeight)] } proc clusterXposPut {clusterframe pos} { set array [string trimleft $clusterframe .] global $array set ${array}(Xpos) $pos } proc clusterXposGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(Xpos)]} { return "" } return [set ${array}(Xpos)] } proc clusterYposPut {clusterframe pos} { set array [string trimleft $clusterframe .] global $array set ${array}(Ypos) $pos } proc clusterYposGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(Ypos)]} { return "" } return [set ${array}(Ypos)] } proc clusterNextPut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(next) $frame } proc clusterNextGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(next)]} { return "" } return [set ${array}(next)] } proc clusterOffsetWidthPut {clusterframe incr} { set array [string trimleft $clusterframe .] global $array set ${array}(offsetWidth) $incr } proc clusterOffsetWidthGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(offsetWidth)]} { return "" } return [set ${array}(offsetWidth)] } proc clusterMainFramePut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(mainFrame) $frame } proc clusterMainFrameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(mainFrame)]} { return "" } return [set ${array}(mainFrame)] } proc clusterSystemFramePut {clusterframe frame} { set array [string trimleft $clusterframe .] global $array set ${array}(systemFrame) $frame } proc clusterSystemFrameGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(systemFrame)]} { return "" } return [set ${array}(systemFrame)] } proc clusterNodesListPut {clusterframe nlist} { set array [string trimleft $clusterframe .] global $array set ${array}(nodeslist) $nlist } proc clusterNodesListGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(nodeslist)]} { return "" } return [set ${array}(nodeslist)] } proc clusterTotPoolPut {clusterframe totpool} { set array [string trimleft $clusterframe .] global $array set ${array}(totpool) $totpool } proc clusterTotPoolGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(totpool)]} { return "" } return [set ${array}(totpool)] } proc clusterUsePoolPut {clusterframe usepool} { set array [string trimleft $clusterframe .] global $array set ${array}(usepool) $usepool } proc clusterUsePoolGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(usepool)]} { return "" } return [set ${array}(usepool)] } proc clusterAvailPoolPut {clusterframe availpool} { set array [string trimleft $clusterframe .] global $array set ${array}(availpool) $availpool } proc clusterAvailPoolGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(availpool)]} { return "" } return [set ${array}(availpool)] } proc clusterOfflinePoolPut {clusterframe offlpool} { set array [string trimleft $clusterframe .] global $array set ${array}(offlpool) $offlpool } proc clusterOfflinePoolGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(offlpool)]} { return "" } return [set ${array}(offlpool)] } proc clusterDownPoolPut {clusterframe downpool} { set array [string trimleft $clusterframe .] global $array set ${array}(downpool) $downpool } proc clusterDownPoolGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(downpool)]} { return "" } return [set ${array}(downpool)] } proc clusterReservedPoolPut {clusterframe rsrvpool} { set array [string trimleft $clusterframe .] global $array set ${array}(rsrvpool) $rsrvpool } proc clusterReservedPoolGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(rsrvpool)]} { return "" } return [set ${array}(rsrvpool)] } proc clusterUnkPoolPut {clusterframe unkpool} { set array [string trimleft $clusterframe .] global $array set ${array}(unkpool) $unkpool } proc clusterUnkPoolGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(unkpool)]} { return "" } return [set ${array}(unkpool)] } proc clusterCpusAssnPut {clusterframe cpus_assn} { set array [string trimleft $clusterframe .] global $array set ${array}(cpus_assn) $cpus_assn } proc clusterCpusAssnGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(cpus_assn)]} { return "" } return [set ${array}(cpus_assn)] } proc clusterVprocsAssnPut {clusterframe vprocs_assn} { set array [string trimleft $clusterframe .] global $array set ${array}(vprocs_assn) $vprocs_assn } proc clusterVprocsAssnGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(vprocs_assn)]} { return "" } return [set ${array}(vprocs_assn)] } proc clusterCpusMaxPut {clusterframe cpus_max} { set array [string trimleft $clusterframe .] global $array set ${array}(cpus_max) $cpus_max } proc clusterCpusMaxGet {clusterframe} { set array [string trimleft $clusterframe .] global $array if {![info exists ${array}(cpus_max)]} { return "" } return [set ${array}(cpus_max)] } proc clusterPrint clusterframe { if {[string compare $clusterframe ""] == 0} { return } puts "cluster frame: $clusterframe===================================>" puts "Name: [clusterNameGet $clusterframe]" puts "Canvas: [clusterCanvasGet $clusterframe]" puts "Canvas Frame: [clusterCanvasFrameGet $clusterframe]" puts "Refresh Flag: [clusterRefreshGet $clusterframe]" puts "Label Frame: [clusterLabelFrameGet $clusterframe]" puts "Label: [clusterLabelGet $clusterframe]" puts "Label Text: [clusterLabelTextGet $clusterframe]" puts "FooterHeader: [clusterFooterHeaderGet $clusterframe]" puts "StatusBar: [clusterStatusBarGet $clusterframe]" puts "StatusBar Frame: [clusterStatusBarFrameGet $clusterframe]" puts "Xscroll: [clusterXscrollGet $clusterframe]" puts "Xscroll Frame: [clusterXscrollFrameGet $clusterframe]" puts "Yscroll: [clusterYscrollGet $clusterframe]" puts "Yscroll Frame: [clusterYscrollFrameGet $clusterframe]" puts "Display Width: [clusterDisplayWidthGet $clusterframe]" puts "Display Height: [clusterDisplayHeightGet $clusterframe]" puts "Canvas Width: [clusterCanvasWidthGet $clusterframe]" puts "Canvas Height: [clusterCanvasHeightGet $clusterframe]" puts "ScrollRegion's Width: [clusterScrollRegionWidthGet $clusterframe]" puts "ScrollRegion's Height: [clusterScrollRegionHeightGet $clusterframe]" puts "Xpos: [clusterXposGet $clusterframe]" puts "Ypos: [clusterYposGet $clusterframe]" puts "Next Frame: [clusterNextGet $clusterframe]" puts "Offset Width: [clusterOffsetWidthGet $clusterframe]" puts "Main Frame: [clusterMainFrameGet $clusterframe]" puts "System Frame: [clusterSystemFrameGet $clusterframe]" puts "Nodes List: [clusterNodesListGet $clusterframe]" puts "Total Pool: [clusterTotPoolGet $clusterframe]" puts "Use Pool: [clusterUsePoolGet $clusterframe]" puts "Avail Pool: [clusterAvailPoolGet $clusterframe]" puts "Offline Pool: [clusterOfflinePoolGet $clusterframe]" puts "Down Pool: [clusterDownPoolGet $clusterframe]" puts "Reserved Pool: [clusterReservedPoolGet $clusterframe]" puts "Unknown Pool: [clusterUnkPoolGet $clusterframe]" puts "Cpus Assn: [clusterCpusAssnGet $clusterframe]" puts "Virtual Processors Assn: [clusterVprocsAssnGet $clusterframe]" puts "Cpus Max: [clusterCpusMaxGet $clusterframe]" } proc clusterCreate {frame clusterName clusterLabel nlist footerHeader viewType} { global canvas set retwidth 0 set retheight 0 clusterNamePut $frame $clusterName frame $frame -class Medium frame $frame.l -class MediumLabel -borderwidth 0 -relief flat frame $frame.m -class MediumCanvas -borderwidth 0 -relief flat frame $frame.m.c -borderwidth 0 frame $frame.m.y -borderwidth 0 frame $frame.m.x -borderwidth 0 frame $frame.s -class MediumLabel -borderwidth 0 -relief flat label $frame.l.label -text $clusterLabel \ -justify center set labelWidth [expr \ 2*$canvas(medBd) + 2*$canvas(medLabelBd) + \ $canvas(medLabelFontWidth)*[string length $clusterLabel]] set labelHeight [expr $canvas(medBd) + 2*$canvas(medLabelBd) \ + $canvas(medLabelFontHeight)] clusterLabelTextPut $frame $clusterLabel label $frame.s.label -font $canvas(medLabelFont) \ -text $footerHeader \ -justify center set footerWidth [expr \ 2*$canvas(medBd) + \ 2*$canvas(medLabelBd) + \ $canvas(medLabelFontWidth)*[string length $footerHeader]] set footerHeight [expr 2*$canvas(medLabelBd) + \ $canvas(medBd) + \ 2*$canvas(medLabelFontHeight)] canvas $frame.m.c.canvas -confine 1 set canvasFrameWidth [expr $canvas(medBd) + \ 2*$canvas(medCanvasBd)] set canvasFrameHeight [expr 2*$canvas(medCanvasBd)] set totwidth 0 set totheight 0 set x1 0 set y1 0 set pw 0 set ph 0 if {$footerWidth > $labelWidth} { set maxWidth $footerWidth } else { set maxWidth $labelWidth } clusterNodesListPut $frame $nlist set llen [llength $nlist] set prevNode "" set rowNodes "" clusterTotPoolPut $frame $llen clusterUsePoolPut $frame 0 clusterAvailPoolPut $frame 0 clusterOfflinePoolPut $frame 0 clusterDownPoolPut $frame 0 clusterReservedPoolPut $frame 0 clusterUnkPoolPut $frame 0 clusterCpusAssnPut $frame 0 clusterVprocsAssnPut $frame 0 clusterCpusMaxPut $frame 0 set sysframe [clusterSystemFrameGet $frame] set j 0 for {set i 0} {$i < $llen} {incr i} { set nodeinfo [lindex $nlist $i] set nodename [lindex $nodeinfo 0] set nodelabel $nodename set nodetype [lindex $nodeinfo 1] clusterStatsUpdate $frame \ [systemNodeStatusGet $sysframe $nodename] + set pos [nodeCreate $frame.m.c.$i $nodename $nodelabel \ $frame $nodetype $viewType] set w [lindex $pos 0] set h [lindex $pos 1] if { $i == 0 } { set rowNodes $frame.m.c.$i incr totwidth $w incr totheight $h } elseif { [expr $j % $canvas(clusterNumBoxesPerRow)] == 0 || \ [expr $totwidth + $w] > $canvas(clusterMaxWidth) } { set rowOffset [expr ($maxWidth - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowNodes { nodeOffsetWidthPut $fr $rowOffset } } set rowNodes $frame.m.c.$i set x1 0 incr y1 $ph incr totheight $h if {$totwidth > $maxWidth} { set maxWidth $totwidth } set totwidth $w set j 0 } else { lappend rowNodes $frame.m.c.$i # same row incr x1 $pw incr totwidth $w if {[string compare $prevNode ""] != 0} { nodeNextPut $prevNode $frame.m.c.$i } } pack forget $frame.m.c.$i set wid [$frame.m.c.canvas create window $x1 $y1 \ -window $frame.m.c.$i -anchor nw \ -tags $frame.m.c.$i -width $w -height $h] nodeXposPut $frame.m.c.$i $x1 nodeYposPut $frame.m.c.$i $y1 set pw $w set ph $h set prevNode $frame.m.c.$i incr j } if {[string compare $rowNodes ""] != 0} { set rowOffset [expr ($maxWidth - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowNodes { nodeOffsetWidthPut $fr $rowOffset } } } if {$maxWidth > $totwidth} { set totwidth $maxWidth } scrollbar $frame.m.x.xscroll -orient horizontal \ -width $canvas(medLabelFontHeight) \ -background $canvas(medScrollBg) \ -relief $canvas(medScrollRelief) \ -borderwidth $canvas(medScrollBd) \ -command [list $frame.m.c.canvas xview] set scrollHeight [expr \ 2*[lindex [$frame.m.x.xscroll configure -borderwidth] end] \ + [lindex [$frame.m.x.xscroll configure -width] end]] $frame.m.x configure -height $scrollHeight scrollbar $frame.m.y.yscroll -orient vertical \ -width $canvas(medLabelFontHeight) \ -background $canvas(medScrollBg) \ -relief $canvas(medScrollRelief) \ -borderwidth $canvas(medScrollBd) \ -command [list $frame.m.c.canvas yview] set scrollWidth [expr \ $canvas(medBd) + \ 2*[lindex [$frame.m.y.yscroll configure -borderwidth] end] \ + [lindex [$frame.m.y.yscroll configure -width] end]] $frame.m.y configure -width $scrollWidth clusterFooterHeaderPut $frame $footerHeader clusterLabelPut $frame $frame.l.label clusterLabelFramePut $frame $frame.l clusterCanvasPut $frame $frame.m.c.canvas clusterCanvasFramePut $frame $frame.m.c clusterXscrollPut $frame $frame.m.x.xscroll clusterXscrollFramePut $frame $frame.m.x clusterYscrollPut $frame $frame.m.y.yscroll clusterYscrollFramePut $frame $frame.m.y clusterStatusBarPut $frame $frame.s.label clusterStatusBarFramePut $frame $frame.s clusterMainFramePut $frame $frame.m clusterScrollRegionWidthPut $frame $totwidth set scrollRegionWidth $totwidth clusterScrollRegionHeightPut $frame $totheight set scrollRegionHeight $totheight clusterXposPut $frame 0 clusterYposPut $frame 0 clusterNextPut $frame "" clusterOffsetWidthPut $frame 0 clusterRefreshPut $frame 0 set retwidth [expr $canvasFrameWidth + $totwidth + $scrollWidth] if {$labelWidth > $retwidth && \ $labelWidth > $footerWidth} { set retwidth $labelWidth } elseif {$footerWidth > $retwidth && \ $footerWidth > $labelWidth} { set retwidth $footerWidth } clusterCanvasWidthPut $frame $totwidth clusterDisplayWidthPut $frame $retwidth set canvWidth $totwidth if { $retwidth > $canvas(clusterMaxWidth) } { set canvWidth [expr $canvas(clusterMaxWidth) - \ $canvasFrameWidth - $scrollWidth] if {$canvWidth > 0} { clusterDisplayWidthPut $frame $canvas(clusterMaxWidth) clusterCanvasWidthPut $frame $canvWidth set retwidth $canvas(clusterMaxWidth) } } set retheight [expr $labelHeight + $canvasFrameHeight + $totheight + \ $scrollHeight + $footerHeight] clusterCanvasHeightPut $frame $totheight clusterDisplayHeightPut $frame $retheight set canvHeight $totheight if { $retheight > $canvas(clusterMaxHeight) } { set canvHeight [expr $canvas(clusterMaxHeight) - \ $labelHeight - $canvasFrameHeight - \ $scrollHeight - $footerHeight] if {$canvHeight > 0} { clusterDisplayHeightPut $frame $canvas(clusterMaxHeight) clusterCanvasHeightPut $frame $canvHeight set retheight $canvas(clusterMaxHeight) } } set canvWidth [clusterCanvasWidthGet $frame] set canvHeight [clusterCanvasHeightGet $frame] $frame.m.c.canvas configure -width $canvWidth -height $canvHeight \ -xscrollcommand [list $frame.m.x.xscroll set] \ -yscrollcommand [list $frame.m.y.yscroll set] \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] if {$canvWidth > 0 && $scrollRegionWidth > $canvWidth} { pack $frame.m.x.xscroll -side bottom -fill x -padx 0 -pady 0 \ -ipadx 0 -ipady 0 } if {$canvHeight > 0 && $scrollRegionHeight > $canvHeight} { pack $frame.m.y.yscroll -side right -fill y -padx 0 -pady 0 \ -ipadx 0 -ipady 0 -anchor nw } pack $frame.l.label -fill both -expand true -padx 0 -pady 0 \ -ipadx 0 -ipady 0 pack $frame.m.c.canvas -fill both -expand true -padx 0 -pady 0 \ -ipadx 0 -ipady 0 pack $frame.m.x -side bottom -fill x -padx 0 -pady 0 \ -ipadx 0 -ipady 0 pack $frame.m.y -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $frame.m.c -expand true -fill both -padx 0 -pady 0 -ipadx 0 \ -ipady 0 pack $frame.s.label -fill both -expand true -padx 0 -pady 0 -ipadx 0 \ -ipady 0 pack $frame.l $frame.m $frame.s -side top -fill both -anchor nw \ -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $frame -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 return [list $retwidth $retheight] } proc clusterReCreate { frame } { global canvas sysview set retwidth 0 set retheight 0 set sitename [systemNameGet [clusterSystemFrameGet $frame]] set clusterLabel [clusterLabelTextGet $frame] $frame.l.label configure -text $clusterLabel set labelWidth [expr \ 2*$canvas(medBd) + 2*$canvas(medLabelBd) + \ $canvas(medLabelFontWidth)*[string length $clusterLabel]] set labelHeight [expr $canvas(medBd) + 2*$canvas(medLabelBd) \ + $canvas(medLabelFontHeight)] set footerHeader [clusterFooterHeaderGet $frame] $frame.s.label configure -text $footerHeader set footerWidth [expr \ 2*$canvas(medBd) + \ 2*$canvas(medLabelBd) + \ $canvas(medLabelFontWidth)*[string length $footerHeader]] set footerHeight [expr 2*$canvas(medLabelBd) + \ $canvas(medBd) + \ 2*$canvas(medLabelFontHeight)] set canvasFrameWidth [expr $canvas(medBd) + \ 2*$canvas(medCanvasBd)] set canvasFrameHeight [expr 2*$canvas(medCanvasBd)] set totwidth 0 set totheight 0 set x1 0 set y1 0 set pw 0 set ph 0 if {$footerWidth > $labelWidth} { set maxWidth $footerWidth } else { set maxWidth $labelWidth } set nlist [clusterNodesListGet $frame] set llen [llength $nlist] set prevNode "" set rowNodes "" set j 0 for {set i 0} {$i < $llen} {incr i} { set nodeinfo [lindex $nlist $i] set nodename [lindex $nodeinfo 0] set nodelabel $nodename set nodetype [lindex $nodeinfo 1] catch {frame $frame.m.c.$i -borderwidth 0} nodeNamePut $frame.m.c.$i $nodename nodeLabelPut $frame.m.c.$i $nodelabel nodeViewTypePut $frame.m.c.$i $sysview($sitename) nodeTypePut $frame.m.c.$i $nodetype $frame.m.c.canvas delete $frame.m.c.$i set pos [nodeReCreate $frame.m.c.$i] set w [lindex $pos 0] set h [lindex $pos 1] if { $i == 0 } { set rowNodes $frame.m.c.$i incr totwidth $w incr totheight $h } elseif { [expr $j % $canvas(clusterNumBoxesPerRow)] == 0 || \ [expr $totwidth + $w] > $canvas(clusterMaxWidth) } { set rowOffset [expr ($maxWidth - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowNodes { nodeOffsetWidthPut $fr $rowOffset } } set rowNodes $frame.m.c.$i set x1 0 incr y1 $ph incr totheight $h if {$totwidth > $maxWidth} { set maxWidth $totwidth } set totwidth $w set j 0 } else { lappend rowNodes $frame.m.c.$i # same row incr x1 $pw incr totwidth $w if {[string compare $prevNode ""] != 0} { nodeNextPut $prevNode $frame.m.c.$i } } pack forget $frame.m.c.$i set wid [$frame.m.c.canvas create window $x1 $y1 \ -window $frame.m.c.$i -anchor nw \ -tags $frame.m.c.$i -width $w -height $h] nodeXposPut $frame.m.c.$i $x1 nodeYposPut $frame.m.c.$i $y1 set pw $w set ph $h set prevNode $frame.m.c.$i incr j } if {[string compare $rowNodes ""] != 0} { set rowOffset [expr ($maxWidth - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowNodes { nodeOffsetWidthPut $fr $rowOffset } } } if {$maxWidth > $totwidth} { set totwidth $maxWidth } $frame.m.x.xscroll configure -orient horizontal \ -width $canvas(medLabelFontHeight) \ -command [list $frame.m.c.canvas xview] set scrollHeight [expr \ 2*[lindex [$frame.m.x.xscroll configure -borderwidth] end] \ + [lindex [$frame.m.x.xscroll configure -width] end]] $frame.m.x configure -height $scrollHeight $frame.m.y.yscroll configure -orient vertical \ -width $canvas(medLabelFontHeight) \ -command [list $frame.m.c.canvas yview] set scrollWidth [expr $canvas(medBd) + \ 2*[lindex [$frame.m.y.yscroll configure -borderwidth] end] \ + [lindex [$frame.m.y.yscroll configure -width] end]] $frame.m.y configure -width $scrollWidth clusterScrollRegionWidthPut $frame $totwidth clusterScrollRegionHeightPut $frame $totheight set scrollRegionWidth [clusterScrollRegionWidthGet $frame] set scrollRegionHeight [clusterScrollRegionHeightGet $frame] set retwidth [expr $canvasFrameWidth + $totwidth + $scrollWidth] if {$labelWidth > $retwidth && \ $labelWidth > $footerWidth} { set retwidth $labelWidth } elseif {$footerWidth > $retwidth && \ $footerWidth > $labelWidth} { set retwidth $footerWidth } clusterCanvasWidthPut $frame $totwidth clusterDisplayWidthPut $frame $retwidth set canvWidth $totwidth if { $retwidth > $canvas(clusterMaxWidth) } { set canvWidth [expr $canvas(clusterMaxWidth) - \ $canvasFrameWidth - $scrollWidth] if {$canvWidth > 0} { clusterDisplayWidthPut $frame $canvas(clusterMaxWidth) clusterCanvasWidthPut $frame $canvWidth set retwidth $canvas(clusterMaxWidth) } } set retheight [expr $labelHeight + $canvasFrameHeight + $totheight + \ $scrollHeight + $footerHeight] clusterCanvasHeightPut $frame $totheight clusterDisplayHeightPut $frame $retheight set canvHeight $totheight if { $retheight > $canvas(clusterMaxHeight) } { set canvHeight [expr $canvas(clusterMaxHeight) - \ $labelHeight - $canvasFrameHeight - \ $scrollHeight - $footerHeight] if {$canvHeight > 0} { clusterDisplayHeightPut $frame $canvas(clusterMaxHeight) clusterCanvasHeightPut $frame $canvHeight set retheight $canvas(clusterMaxHeight) } } set canvWidth [clusterCanvasWidthGet $frame] set canvHeight [clusterCanvasHeightGet $frame] $frame.m.c.canvas configure -width $canvWidth -height $canvHeight \ -xscrollcommand [list $frame.m.x.xscroll set] \ -yscrollcommand [list $frame.m.y.yscroll set] \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] catch {pack forget $frame.m.x.xscroll} if {$canvWidth > 0 && $scrollRegionWidth > $canvWidth} { catch {pack $frame.m.x.xscroll -side bottom -fill x -padx 0 \ -pady 0 -ipadx 0 -ipady 0} } catch {pack forget $frame.m.y.yscroll} if {$canvHeight > 0 && $scrollRegionHeight > $canvHeight} { catch {pack $frame.m.y.yscroll -side right -fill y -padx 0 \ -pady 0 -ipadx 0 -ipady 0 -anchor nw} } return [list $retwidth $retheight] } proc clusterRepack {clusterframe} { global canvas if {[string compare $clusterframe ""] == 0} { return } set systemc [systemCanvasGet [clusterSystemFrameGet $clusterframe]] if {[string compare $systemc ""] == 0} { return } set label [clusterLabelGet $clusterframe] set labelf [clusterLabelFrameGet $clusterframe] set canv [clusterCanvasGet $clusterframe] set canvf [clusterCanvasFrameGet $clusterframe] set xscroll [clusterXscrollGet $clusterframe] set xscrollf [clusterXscrollFrameGet $clusterframe] set yscroll [clusterYscrollGet $clusterframe] set yscrollf [clusterYscrollFrameGet $clusterframe] set sbar [clusterStatusBarGet $clusterframe] set sbarf [clusterStatusBarFrameGet $clusterframe] set mframe [clusterMainFrameGet $clusterframe] set footerHeader [lindex [$sbar configure -text] end] set footerWidth [expr 2*$canvas(medBd) + \ 2*$canvas(medLabelBd) + \ $canvas(medLabelFontWidth)*[string length $footerHeader]] set dispWidth [clusterDisplayWidthGet $clusterframe] if {$footerWidth > $dispWidth} { set diff [expr ($footerWidth - $dispWidth) * $canvas(nodeScaleFactor)] clusterPropagateOffset $clusterframe $diff clusterAddWidth $clusterframe $diff set dispWidth $footerWidth } set dispHeight [clusterDisplayHeightGet $clusterframe] set canvWidth [clusterCanvasWidthGet $clusterframe] set canvHeight [clusterCanvasHeightGet $clusterframe] set scrollRegionWidth [clusterScrollRegionWidthGet $clusterframe] set scrollRegionHeight [clusterScrollRegionHeightGet $clusterframe] $systemc delete $clusterframe catch {pack forget $label $sbar $labelf $mframe $sbarf $xscrollf $yscrollf $canvf} if {$canvWidth > 0 && $scrollRegionWidth > $canvWidth} { catch {pack $xscroll -side bottom -fill x -padx 0 -pady 0 -ipadx 0 -ipady 0} } else { catch {pack forget $xscroll} } if {$canvHeight > 0 && $scrollRegionHeight > $canvHeight} { catch {pack $yscroll -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 -anchor nw} } else { catch {pack forget $yscroll} } $canv configure -width $canvWidth -height $canvHeight \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] pack $label -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $canv -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $xscrollf -side bottom -fill x -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $yscrollf -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $canvf -expand true -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $sbar -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $labelf $mframe $sbarf -side top -anchor nw -fill both \ -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 set dispWidth [clusterDisplayWidthGet $clusterframe] set dispHeight [clusterDisplayHeightGet $clusterframe] $systemc create window [clusterXposGet $clusterframe] \ [clusterYposGet $clusterframe] \ -window $clusterframe -anchor nw \ -tags $clusterframe \ -width [expr $dispWidth + 2*$canvas(medBd)] \ -height $dispHeight } proc clusterStatsUpdate {clusterf status oper} { switch -exact -- $status { OFFLINE { clusterOfflinePoolPut $clusterf \ [expr [clusterOfflinePoolGet $clusterf] $oper 1] } DOWN { clusterDownPoolPut $clusterf \ [expr [clusterDownPoolGet $clusterf] $oper 1] } FREE { clusterAvailPoolPut $clusterf \ [expr [clusterAvailPoolGet $clusterf] $oper 1] } INUSE-SHARED - INUSE-EXCLUSIVE { clusterUsePoolPut $clusterf \ [expr [clusterUsePoolGet $clusterf] $oper 1] } RESERVED { clusterReservedPoolPut $clusterf \ [expr [clusterReservedPoolGet $clusterf] $oper 1] } NOINFO { clusterUnkPoolPut $clusterf \ [expr [clusterUnkPoolGet $clusterf] $oper 1] } } } torque-2.4.16/src/tools/xpbsmon/xpbsmonrc.src0000664000113300011330000001534611272401240016177 00000000000000! OpenPBS (Portable Batch System) v2.3 Software License ! ! Copyright (c) 1999-2000 Veridian Information Solutions, Inc. ! All rights reserved. ! ! --------------------------------------------------------------------------- ! For a license to use or redistribute the OpenPBS software under conditions ! other than those described below, or to purchase support for this software, ! please contact Veridian Systems, PBS Products Department ("Licensor") at: ! ! www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org ! 877 902-4PBS (US toll-free) ! --------------------------------------------------------------------------- ! ! This license covers use of the OpenPBS v2.3 software (the "Software") at ! your site or location, and, for certain users, redistribution of the ! Software to other sites and locations. Use and redistribution of ! OpenPBS v2.3 in source and binary forms, with or without modification, ! are permitted provided that all of the following conditions are met. ! After December 31, 2001, only conditions 3-6 must be met: ! ! 1. Commercial and/or non-commercial use of the Software is permitted ! provided a current software registration is on file at www.OpenPBS.org. ! If use of this software contributes to a publication, product, or ! service, proper attribution must be given; see www.OpenPBS.org/credit.html ! ! 2. Redistribution in any form is only permitted for non-commercial, ! non-profit purposes. There can be no charge for the Software or any ! software incorporating the Software. Further, there can be no ! expectation of revenue generated as a consequence of redistributing ! the Software. ! ! 3. Any Redistribution of source code must retain the above copyright notice ! and the acknowledgment contained in paragraph 6, this list of conditions ! and the disclaimer contained in paragraph 7. ! ! 4. Any Redistribution in binary form must reproduce the above copyright ! notice and the acknowledgment contained in paragraph 6, this list of ! conditions and the disclaimer contained in paragraph 7 in the ! documentation and/or other materials provided with the distribution. ! ! 5. Redistributions in any form must be accompanied by information on how to ! obtain complete source code for the OpenPBS software and any ! modifications and/or additions to the OpenPBS software. The source code ! must either be included in the distribution or be available for no more ! than the cost of distribution plus a nominal fee, and all modifications ! and additions to the Software must be freely redistributable by any party ! (including Licensor) without restriction. ! ! 6. All advertising materials mentioning features or use of the Software must ! display the following acknowledgment: ! ! "This product includes software developed by NASA Ames Research Center, ! Lawrence Livermore National Laboratory, and Veridian Information ! Solutions, Inc. ! Visit www.OpenPBS.org for OpenPBS software support, ! products, and information." ! ! 7. DISCLAIMER OF WARRANTY ! ! THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS ! OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ! ARE EXPRESSLY DISCLAIMED. ! ! IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE ! U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, ! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ! LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ! OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! ! This license will be governed by the laws of the Commonwealth of Virginia, ! without reference to its choice of law rules. !!! Lines below here are automatically added !!! Thu Feb 26 10:46:11 PST 1998 *smallForeground: #150567 *smallBackground: #ffefdb *smallBorderWidth: 2 *smallRelief: raised *smallScrollBorderWidth: 2 *smallScrollBackground: #ffefdb *smallScrollRelief: sunken *smallCanvasBackground: #ffefdb *smallCanvasBorderWidth: 1 *smallCanvasRelief: flat *smallLabelBorderWidth: 0 *smallLabelBackground: #ffefdb *smallLabelRelief: flat *smallLabelForeground: #150567 *smallLabelFont: -misc-fixed-bold-r-normal--13-100-100-100-c-70-iso8859-1 *smallLabelFontWidth: 7 *smallLabelFontHeight: 13 *smallTextFont: -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-1 *smallTextFontWidth: 6 *smallTextFontHeight: 9 *nodeColorNOINFO: black *nodeColorFREE: green *nodeColorINUSEshared: #98f5ff *nodeColorINUSEexclusive: #a0522d #1e90ff #a9a9a9 #8470ff #a020f0 *nodeColorDOWN: red *nodeColorRSVD: yellow *nodeColorOFFL: orange *nodeColorTrough: white *nodeColorSlider: red *nodeColorExtendedTrough: blue *nodeScaleFactor: 1 *nodeBoxFullMaxWidth: 350 *nodeBoxFullMaxHeight: 100 *nodeBoxIconMaxWidth: 56 *nodeBoxIconMaxHeight: 56 *nodeBoxMirrorMaxWidth: 700 *nodeBoxMirrorMaxHeight: 400 *nodeBoxMirrorScaleFactor: 3 *mediumLabelForeground: #150567 *mediumLabelBackground: #cdc0b0 *mediumLabelBorderWidth: 4 *mediumLabelRelief: ridge *mediumLabelFont: -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1 *mediumLabelFontWidth: 8 *mediumLabelFontHeight: 13 *mediumCanvasBorderWidth: 1 *mediumCanvasBackground: #cdc0b0 *mediumCanvasRelief: flat *mediumScrollBorderWidth: 2 *mediumScrollBackground: #eedfcc *mediumScrollRelief: sunken *mediumForeground: #150567 *mediumBackground: #cdc0b0 *mediumBorderWidth: 10 *mediumRelief: ridge *mediumTextFont: -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1 *mediumTextFontWidth: 8 *mediumTextFontHeight: 13 *serverBoxMaxWidth: 710 *serverBoxMaxHeight: 600 *serverBoxMaxNumNodeBoxesPerRow: 17 *bigBackground: #c8b9a6 *bigForeground: #150567 *bigBorderWidth: 2 *bigRelief: raised *bigActiveColor: #9db2ff *bigShadingColor: #c7af92 *bigSelectorColor: #980517 *bigDisabledColor: #8f8e8d *bigLabelBackground: #c8b9a6 *bigLabelBorderWidth: 1 *bigLabelRelief: raised *bigLabelFont: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1 *bigLabelFontWidth: 9 *bigLabelFontHeight: 15 *bigLabelForeground: #150567 *bigCanvasBackground: #c8b9a6 *bigCanvasRelief: flat *bigCanvasBorderWidth: 1 *bigScrollBorderWidth: 2 *bigScrollBackground: #c8b9a6 *bigScrollRelief: sunken *bigTextFont: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1 *bigTextFontWidth: 9 *bigTextFontHeight: 15 *siteBoxMaxWidth: 710 *siteBoxMaxHeight: 500 *siteBoxMaxNumServerBoxesPerRow: 10 *autoUpdateMins: 1 *autoUpdate: true *siteInView: *rcSiteInfoDelimeterChar: ; *sitesInfo: torque-2.4.16/src/tools/xpbsmon/button.tk0000664000113300011330000002577411272401240015334 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ############################################################################### # buildCmdButtons: creates a row or column of command buttons on 'frame_name' # following the arrangement specified in 'cmdbutton_list'. # # INPUT FORMATS: # 'cmdbutton_list' - # { {group1_button1_name group1_button1_label group1_button1_assoc} # {group1_button2_name group1_button2_label group1_button1_assoc} # . . . } # { {group2_button1_name group2_button1_label group2_button1_assoc} # {group2_button2_name group2_button2_label group2_button1_assoc} # . . . } # } # # 'orient' - how the group of cmd buttons are to be arranged: x (lie in # a horizontal line), y (line in a vertical line), xy (row of columned # buttons). # 'spacing' - amount of spacing between groups of checkbuttons (in Get_Pixels # format). # 'button_width' - the width of a command button (in Get_Pixels format) # 'button_height' - the height of a command button(in Get_Pixels format) # OPTIONS: # 'first_group_spacing' - an optional boolean value that says to put # a button spacing before the 1st group of buttons # 'spread_out_buttons' - if 1 (true), then the buttons will be spread out # in the frame # 'group_spacing' - spacing between groups of cmd buttons. # 'cmdbutton_labelstr' - if the entire groups of cmdbuttons are to be given one # label string. ############################################################################### proc buildCmdButtons {frame_name cmdbutton_list orient spacing button_width\ button_height {first_group_spacing 0} \ {spread_out_buttons 1} {group_spacing "10m"} \ {cmdButton_labelstr ""} {place_buttonAssoc_right 1} \ {place_labelstr_top 0} {button_assoc_groove_relief 0} } { global canvas set procname "buildCmdboxes" ## Let's be defensive about the input if { ![regexp "\\." $frame_name] || \ ([string compare $orient "x"] != 0 && \ [string compare $orient "y"] != 0 && \ [string compare $orient "xy"] != 0) || \ ![regexp "\[0-9]+" $button_width] || \ ![regexp "\[0-9]+" $button_height] } { puts "Error $BADPARAM in \{$procname $frame_name\}: $errmsg(BADPARAM)" exit $BADPARAM } if { [string compare $frame_name "."] == 0 } { set frame_name "" } if { [string compare $cmdButton_labelstr ""] != 0 } { message $frame_name.clabel -text $cmdButton_labelstr \ -aspect 1000 pack $frame_name.clabel -side top -anchor nw } if {$spread_out_buttons} { pack forget $frame_name pack $frame_name -fill both -expand 1 -ipadx 5m -ipady 5m } set i 1 set allButtonsList "" foreach group [lrange $cmdbutton_list 0 end] { frame $frame_name.$i -class Plain set buttonList "" foreach button_entry $group { set buttonName [lindex $button_entry 0] set buttonLabel [lindex $button_entry 1] set buttonAssoc [lindex $button_entry 2] if {[string compare $buttonAssoc ""] != 0} { if {$button_assoc_groove_relief} { frame $frame_name.$i.f$buttonName -relief groove -borderwidth 2 -bg blue } else { frame $frame_name.$i.f$buttonName -class Plain } button $frame_name.$i.f$buttonName.$buttonName -anchor nw \ -text $buttonLabel -width $button_width \ -relief raised -borderwidth 2 \ -height $button_height -padx 1 -pady 1 if {$place_buttonAssoc_right} { pack $frame_name.$i.f$buttonName.$buttonName -side left -anchor nw \ -side left -anchor nw -fill x } else { pack $frame_name.$i.f$buttonName.$buttonName -side top -anchor nw \ -side top -anchor nw -fill y } pack forget $buttonAssoc if { $place_buttonAssoc_right } { pack $buttonAssoc -in $frame_name.$i.f$buttonName -side right \ -anchor nw -fill x } else { pack $buttonAssoc -in $frame_name.$i.f$buttonName -side bottom \ -anchor nw -fill y } raise $buttonAssoc $frame_name.$i.f$buttonName append buttonList " " $frame_name.$i.f$buttonName append allButtonsList " " $frame_name.$i.f$buttonName.$buttonName } else { button $frame_name.$i.$buttonName -anchor c \ -text $buttonLabel -width $button_width \ -relief raised -borderwidth 2 \ -height $button_height -padx 1 -pady 1 append buttonList " " $frame_name.$i.$buttonName append allButtonsList " " $frame_name.$i.$buttonName } } if { [string compare $orient "y"] == 0 } { eval pack "$buttonList" -side top -anchor nw -pady $spacing } else { eval pack "$buttonList" -side left -anchor c -padx $spacing -expand 1 } if {$i == 1 && $first_group_spacing} { ;# put an extra spacing before 1st label $frame_name.empty$i -width $button_width -height $button_height \ -padx 1 -pady 1 if { [string compare $orient "x"] == 0 } { if {$spread_out_buttons} { eval pack "$frame_name.empty$i $frame_name.$i" -anchor c \ -expand 1 -fill both } else { eval pack "$frame_name.empty$i $frame_name.$i" -anchor c } } else { if {$spread_out_buttons} { eval pack "$frame_name.empty$i $frame_name.$i" -side top -anchor c \ -fill both -expand 1 } else { eval pack "$frame_name.empty$i $frame_name.$i" -side top -anchor c } } } elseif { [expr $i % 2] == 0 } { ;# space even number buttons if { [string compare $orient "x"] == 0 } { if {$spread_out_buttons} { eval pack "$frame_name.$i" -padx $group_spacing -side left -anchor c \ -fill both -expand 1 } else { eval pack "$frame_name.$i" -padx $group_spacing -side left -anchor c } } else { if {$spread_out_buttons} { eval pack "$frame_name.$i" -pady $group_spacing -side top -anchor c \ -fill both -expand 1 } else { eval pack "$frame_name.$i" -pady $group_spacing -side top -anchor c } } } else { if { [string compare $orient "x"] == 0 } { if {$spread_out_buttons} { eval pack "$frame_name.$i" -side left -anchor c -fill both -expand 1 } else { eval pack "$frame_name.$i" -side left -anchor c } } else { if {$spread_out_buttons} { eval pack "$frame_name.$i" -side top -anchor c -fill both -expand 1 } else { eval pack "$frame_name.$i" -side top -anchor c } } } incr i } if {[string compare $cmdButton_labelstr ""] != 0} { return [concat $frame_name $allButtonsList $frame_name.clabel] } else { return [concat $frame_name $allButtonsList] } } # disable_button: disables a command button. proc disable_button button_name { global sysinfo set state [lindex [$button_name configure -state] 4] if {[string compare $state "disabled"] == 0} { return ;# ignore if already disabled } $button_name configure -state disabled } # enable_button: enables a command button. proc enable_button button_name { $button_name configure -state normal } torque-2.4.16/src/tools/xpbsmon/system.tk0000664000113300011330000014360411272401240015336 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc systemAddWidth {systemf incr} { global canvas if {[string compare $systemf ""] == 0 || ![regexp {[0-9]+} $incr]} { return } set newCanvWidth [expr [systemCanvasWidthGet $systemf] + $incr] set newDispWidth [expr [systemDisplayWidthGet $systemf] + $incr] if {$newDispWidth < $canvas(systemMaxWidth)} { systemCanvasWidthPut $systemf $newCanvWidth systemDisplayWidthPut $systemf $newDispWidth } systemScrollRegionWidthPut $systemf \ [expr [systemScrollRegionWidthGet $systemf] + $incr] } proc systemRefreshPut {systemframe flag} { set array [string trimleft $systemframe .] global $array set ${array}(refresh) $flag } proc systemRefreshGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(refresh)]} { return 0 } return [set ${array}(refresh)] } proc systemNamePut {systemframe name} { set array [string trimleft $systemframe .] global $array set ${array}(name) $name } proc systemNameGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(name)]} { return "" } return [set ${array}(name)] } proc systemNodeFramePut {systemframe nodename frame frametype} { set array [string trimleft $systemframe .] global $array if {[string compare $frametype ICON] == 0} { set frametype FULL } set ${array}(nodeframe,$nodename,$frametype) $frame } proc systemNodeFrameGet {systemframe nodename frametype} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(nodeframe,$nodename,$frametype)]} { return "" } return [set ${array}(nodeframe,$nodename,$frametype)] } proc systemNodeFrameUnset {systemframe nodename frametype} { set array [string trimleft $systemframe .] global $array if {[info exists ${array}(nodeframe,$nodename,$frametype)]} { unset ${array}(nodeframe,$nodename,$frametype) } } proc systemNodeStatusPut {systemframe nodename stat} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array set ${array}(nodestat,$nodename) $stat } } proc systemNodeStatusGet {systemframe nodename} { if { [string compare $systemframe ""] == 0 } { return "" } set array [string trimleft $systemframe .] global $array if {![info exists ${array}(nodestat,$nodename)]} { return "" } return [set ${array}(nodestat,$nodename)] } proc systemNodeStatusUnset {systemframe nodename} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array if {[info exists ${array}(nodestat,$nodename)]} { unset ${array}(nodestat,$nodename) } } } proc systemNodeNamesGet {systemframe} { if { [string compare $systemframe ""] == 0 } { return "" } set array [string trimleft $systemframe .] global $array set nodeslist "" foreach n [array names $array] { set nl [split $n ,] set f1 [lindex $nl 0] set f2 [lrange $nl 1 end] if {[string compare $f1 "nodestat"] == 0} { lappend nodeslist [join $f2 ,] } } return $nodeslist } proc systemNodeInfoPut {systemframe nodename info} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array set ${array}(nodeinfo,$nodename) $info } } proc systemNodeInfoAppend {systemframe nodename info} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array lappend ${array}(nodeinfo,$nodename) $info } } proc systemNodeInfoGet {systemframe nodename} { if { [string compare $systemframe ""] == 0 } { return "" } set array [string trimleft $systemframe .] global $array if {![info exists ${array}(nodeinfo,$nodename)]} { return "" } return [set ${array}(nodeinfo,$nodename)] } proc systemNodeInfoUnset {systemframe nodename} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array if {[info exists ${array}(nodeinfo,$nodename)]} { unset ${array}(nodeinfo,$nodename) } } } proc systemNodeInfo2Put {systemframe nodename info} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array set ${array}(nodeinfo2,$nodename) $info } } proc systemNodeInfo2Append {systemframe nodename info} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array lappend ${array}(nodeinfo2,$nodename) $info } } proc systemNodeInfo2Get {systemframe nodename} { if { [string compare $systemframe ""] == 0 } { return "" } set array [string trimleft $systemframe .] global $array if {![info exists ${array}(nodeinfo2,$nodename)]} { return "" } return [set ${array}(nodeinfo2,$nodename)] } proc systemNodeInfo2Unset {systemframe nodename} { if { [string compare $systemframe ""] != 0 } { set array [string trimleft $systemframe .] global $array if {[info exists ${array}(nodeinfo2,$nodename)]} { unset ${array}(nodeinfo2,$nodename) } } } proc systemNodeTypePut {systemframe hostname type} { set array [string trimleft $systemframe .] global $array set ${array}(nodetype,$hostname) $type } proc systemNodeTypeGet {systemframe hostname} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(nodetype,$hostname)]} { return "" } return [set ${array}(nodetype,$hostname)] } proc systemClusterFramePut {systemframe name frame} { set array [string trimleft $systemframe .] global $array set ${array}(clusterframe,$name) $frame } proc systemClusterFrameGet {systemframe name} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(clusterframe,$name)]} { return "" } return [set ${array}(clusterframe,$name)] } proc systemClusterFrameUnset {systemframe name} { set array [string trimleft $systemframe .] global $array if {[info exists ${array}(clusterframe,$name)]} { unset ${array}(clusterframe,$name) } } proc systemClusterNamesGet {systemframe} { if { [string compare $systemframe ""] == 0 } { return "" } set array [string trimleft $systemframe .] global $array set clustlist "" foreach n [array names $array] { set nl [split $n ,] set f1 [lindex $nl 0] set f2 [lrange $nl 1 end] if {[string compare $f1 "clusterframe"] == 0} { lappend clustlist [join $f2 ,] } } return $clustlist } proc systemCanvasPut {systemframe frame} { set array [string trimleft $systemframe .] global $array set ${array}(canvas) $frame } proc systemCanvasGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(canvas)]} { return "" } return [set ${array}(canvas)] } proc systemDisplayWidthPut {systemframe width} { set array [string trimleft $systemframe .] global $array set ${array}(displayWidth) $width } proc systemDisplayWidthGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(displayWidth)]} { return "" } return [set ${array}(displayWidth)] } proc systemDisplayHeightPut {systemframe height} { set array [string trimleft $systemframe .] global $array set ${array}(displayHeight) $height } proc systemDisplayHeightGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(displayHeight)]} { return "" } return [set ${array}(displayHeight)] } proc systemScrollRegionWidthPut {systemframe width} { set array [string trimleft $systemframe .] global $array set ${array}(scrollRegionWidth) $width } proc systemScrollRegionWidthGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(scrollRegionWidth)]} { return "" } return [set ${array}(scrollRegionWidth)] } proc systemScrollRegionHeightPut {systemframe height} { set array [string trimleft $systemframe .] global $array set ${array}(scrollRegionHeight) $height } proc systemScrollRegionHeightGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(scrollRegionHeight)]} { return "" } return [set ${array}(scrollRegionHeight)] } proc systemXscrollPut {systemframe xscroll} { set array [string trimleft $systemframe .] global $array set ${array}(Xscroll) $xscroll } proc systemXscrollGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(Xscroll)]} { return "" } return [set ${array}(Xscroll)] } proc systemYscrollPut {systemframe yscroll} { set array [string trimleft $systemframe .] global $array set ${array}(Yscroll) $yscroll } proc systemYscrollGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(Yscroll)]} { return "" } return [set ${array}(Yscroll)] } proc systemCanvasFrameWidthPut {systemframe width} { set array [string trimleft $systemframe .] global $array set ${array}(canvasFrameWidth) $width } proc systemCanvasFrameWidthGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(canvasFrameWidth)]} { return "" } return [set ${array}(canvasFrameWidth)] } proc systemCanvasFrameHeightPut {systemframe height} { set array [string trimleft $systemframe .] global $array set ${array}(canvasFrameHeight) $height } proc systemCanvasFrameHeightGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(canvasFrameHeight)]} { return "" } return [set ${array}(canvasFrameHeight)] } proc systemScrollWidthPut {systemframe width} { set array [string trimleft $systemframe .] global $array set ${array}(scrollWidth) $width } proc systemScrollWidthGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(scrollWidth)]} { return "" } return [set ${array}(scrollWidth)] } proc systemScrollHeightPut {systemframe height} { set array [string trimleft $systemframe .] global $array set ${array}(scrollHeight) $height } proc systemScrollHeightGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(scrollHeight)]} { return "" } return [set ${array}(scrollHeight)] } proc systemLabelHeightPut {systemframe height} { set array [string trimleft $systemframe .] global $array set ${array}(labelHeight) $height } proc systemLabelHeightGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(labelHeight)]} { return "" } return [set ${array}(labelHeight)] } proc systemLabelWidthPut {systemframe width} { set array [string trimleft $systemframe .] global $array set ${array}(labelWidth) $width } proc systemLabelWidthGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(labelWidth)]} { return "" } return [set ${array}(labelWidth)] } proc systemFooterHeightPut {systemframe height} { set array [string trimleft $systemframe .] global $array set ${array}(footerHeight) $height } proc systemFooterHeightGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(footerHeight)]} { return "" } return [set ${array}(footerHeight)] } proc systemFooterWidthPut {systemframe width} { set array [string trimleft $systemframe .] global $array set ${array}(footerWidth) $width } proc systemFooterWidthGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(footerWidth)]} { return "" } return [set ${array}(footerWidth)] } proc systemCanvasHeightPut {systemframe height} { set array [string trimleft $systemframe .] global $array set ${array}(canvasHeight) $height } proc systemCanvasHeightGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(canvasHeight)]} { return "" } return [set ${array}(canvasHeight)] } proc systemCanvasWidthPut {systemframe width} { set array [string trimleft $systemframe .] global $array set ${array}(canvasWidth) $width } proc systemCanvasWidthGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(canvasWidth)]} { return "" } return [set ${array}(canvasWidth)] } proc systemServerNamesPut {systemframe serverl} { set array [string trimleft $systemframe .] global $array set ${array}(servers) $serverl } proc systemServerNamesGet {systemframe} { set array [string trimleft $systemframe .] global $array if {![info exists ${array}(servers)]} { return "" } return [set ${array}(servers)] } proc systemPrint systemframe { puts "Refresh Flag: [systemRefreshGet $systemframe]" puts "Name: [systemNameGet $systemframe]" puts "Canvas: [systemCanvasGet $systemframe]" puts "Display Width: [systemDisplayWidthGet $systemframe]" puts "Display Height: [systemDisplayHeightGet $systemframe]" puts "Scroll Region Width: [systemScrollRegionWidthGet $systemframe]" puts "Scroll Region Height: [systemScrollRegionHeightGet $systemframe]" puts "Canvas Frame Width: [systemCanvasFrameWidthGet $systemframe]" puts "Canvas Frame Height: [systemCanvasFrameHeightGet $systemframe]" puts "Canvas Width: [systemCanvasWidthGet $systemframe]" puts "Canvas Height: [systemCanvasHeightGet $systemframe]" puts "Scroll Width: [systemScrollWidthGet $systemframe]" puts "Scroll Height: [systemScrollHeightGet $systemframe]" puts "Label Width: [systemLabelWidthGet $systemframe]" puts "Label Height: [systemLabelHeightGet $systemframe]" puts "Footer Width: [systemFooterWidthGet $systemframe]" puts "Footer Height: [systemFooterHeightGet $systemframe]" puts "X scroll: [systemXscrollGet $systemframe]" puts "Y scroll: [systemYscrollGet $systemframe]" foreach n [systemNodeNamesGet $systemframe] { puts "systemNodeFrameGet( $systemframe $n FULL ): \ [systemNodeFrameGet $systemframe $n FULL ]" puts "systemNodeStatusGet( $systemframe $n ): \ [systemNodeStatusGet $systemframe $n]" puts "systemNodeInfoGet( $systemframe $n ): \ [systemNodeInfoGet $systemframe $n]" puts "systemNodeTypeGet( $systemframe $n ): \ [systemNodeTypeGet $systemframe $n]" } foreach c [systemClusterNamesGet $systemframe] { puts "systemClusterFrameGet( $systemframe $c ): \ [systemClusterFrameGet $systemframe $c]" } puts "Server Names: [systemServerNamesGet $systemframe]" } proc systemNodesCreate {frame systemName} { global canvas sysnodes sysview systemNamePut $frame $systemName frame $frame -class Big frame $frame.l -class BigLabel frame $frame.m -borderwidth 0 frame $frame.m.c -class BigCanvas frame $frame.m.y -borderwidth 0 frame $frame.m.x -borderwidth 0 frame $frame.s -class BigLabel label $frame.l.label -text $systemName -justify center set labelWidth [expr \ 2*$canvas(bigBd) + 2*$canvas(bigLabelBd) + \ $canvas(bigLabelFontWidth)*[string length $systemName]] systemLabelWidthPut $frame $labelWidth set labelHeight [expr $canvas(bigBd) + 2*$canvas(bigLabelBd) \ + $canvas(bigLabelFontHeight)] systemLabelHeightPut $frame $labelHeight canvas $frame.m.c.canvas -confine 1 -width $canvas(systemMaxWidth) \ -height $canvas(systemMaxHeight) systemCanvasPut $frame $frame.m.c.canvas set canvasFrameWidth [expr $canvas(bigBd) + \ 2*$canvas(bigCanvasBd)] systemCanvasFrameWidthPut $frame $canvasFrameWidth set canvasFrameHeight [expr 2*$canvas(bigCanvasBd)] systemCanvasFrameHeightPut $frame $canvasFrameHeight systemRefreshPut $frame 0 set x1 0 set y1 0 set totwidth 0 set totheight 0 set pw 0 set ph 0 set maxWidth 0 set prevCluster "" set rowClusters "" set i 0 set j 0 set serverl [serverNamesSorted $systemName \ [serverNamesGet $systemName] nodeslist $frame] set servers "" foreach a $serverl { set clusterLabel [lindex $sysnodes($systemName,$a) 0] set nlist [lrange $sysnodes($systemName,$a) 1 end] if {[string compare $nodeslist($a) ""] == 0} { continue } lappend servers $a clusterSystemFramePut $frame.m.c.$i $frame systemClusterFramePut $frame $a $frame.m.c.$i set pos [clusterCreate $frame.m.c.$i $a $clusterLabel \ $nodeslist($a) "" $sysview($systemName)] set numNodes [llength $nodeslist($a)] set w [expr [lindex $pos 0] + 2*$canvas(medBd)] set h [lindex $pos 1] if { $i == 0 } { set rowClusters $frame.m.c.$i incr totwidth $w } elseif { [expr $j % $canvas(systemNumBoxesPerRow)] == 0 || \ [expr $totwidth + $w] > $canvas(systemMaxWidth) } { set rowOffset [expr \ ($canvas(systemMaxWidth) - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowClusters { clusterOffsetWidthPut $fr $rowOffset } } set rowClusters $frame.m.c.$i set x1 0 incr y1 $ph incr totheight $ph if {$totwidth > $maxWidth} { set maxWidth $totwidth } set totwidth $w set j 0 set ph 0 } else { lappend rowClusters $frame.m.c.$i incr x1 $pw incr totwidth $w if {[string compare $prevCluster ""] != 0} { clusterNextPut $prevCluster $frame.m.c.$i } } pack forget $frame.m.c.$i $frame.m.c.canvas create window $x1 $y1 -window $frame.m.c.$i \ -anchor nw -width $w -height $h -tags $frame.m.c.$i clusterXposPut $frame.m.c.$i $x1 clusterYposPut $frame.m.c.$i $y1 # save current width set pw $w if {$h > $ph} { set ph $h } set prevCluster $frame.m.c.$i incr i incr j } systemServerNamesPut $frame $servers if {[string compare $rowClusters ""] != 0} { set rowOffset [expr ($canvas(systemMaxWidth) - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowClusters { clusterOffsetWidthPut $fr $rowOffset } } } if {$maxWidth > $totwidth } { set totwidth $maxWidth } incr totheight $ph systemScrollRegionWidthPut $frame $totwidth systemScrollRegionHeightPut $frame $totheight set scrollRegionWidth $totwidth set scrollRegionHeight $totheight scrollbar $frame.m.x.xscroll -orient horizontal \ -width $canvas(bigLabelFontHeight) \ -background $canvas(bigScrollBg) \ -borderwidth $canvas(bigScrollBd) \ -relief $canvas(bigScrollRelief) \ -command [list $frame.m.c.canvas xview] systemXscrollPut $frame $frame.m.x.xscroll set scrollHeight [expr \ 2*[lindex [$frame.m.x.xscroll configure -borderwidth] end] \ + [lindex [$frame.m.x.xscroll configure -width] end]] $frame.m.x configure -height $scrollHeight scrollbar $frame.m.y.yscroll -orient vertical \ -width $canvas(bigLabelFontHeight) \ -background $canvas(bigScrollBg) \ -borderwidth $canvas(bigScrollBd) \ -relief $canvas(bigScrollRelief) \ -command [list $frame.m.c.canvas yview] systemYscrollPut $frame $frame.m.y.yscroll set scrollWidth [expr \ $canvas(bigBd) + \ 2*[lindex [$frame.m.y.yscroll configure -borderwidth] end] \ + [lindex [$frame.m.y.yscroll configure -width] end]] $frame.m.y configure -width $scrollWidth colorBarCreate $frame.s set footerWidth [expr 2*$canvas(bigBd) + 2*$canvas(bigLabelBd)] systemFooterWidthPut $frame $footerWidth set footerHeight [expr 2*$canvas(bigLabelBd) + \ $canvas(bigBd) + \ 2*$canvas(smallLabelFontHeight)] systemFooterHeightPut $frame $footerHeight set retwidth [expr $canvasFrameWidth + $totwidth + $scrollWidth] if {$labelWidth > $retwidth && $labelWidth > $footerWidth} { set retwidth $labelWidth } elseif {$footerWidth > $retwidth && $footerWidth > $labelWidth} { set retwidth $footerWidth } systemDisplayWidthPut $frame $retwidth set canvWidth $totwidth systemCanvasWidthPut $frame $canvWidth systemScrollWidthPut $frame $scrollWidth if { $retwidth > $canvas(systemMaxWidth) } { set canvWidth [expr $canvas(systemMaxWidth) - \ $canvasFrameWidth - $scrollWidth] if {$canvWidth > 0} { systemCanvasWidthPut $frame $canvWidth systemDisplayWidthPut $frame $canvas(systemMaxWidth) set retwidth $canvas(systemMaxWidth) } } set retheight [expr $labelHeight + $canvasFrameHeight + $totheight + \ $scrollHeight + $footerHeight] systemDisplayHeightPut $frame $retheight set canvHeight $totheight systemCanvasHeightPut $frame $canvHeight systemScrollHeightPut $frame $scrollHeight if { $retheight > $canvas(systemMaxHeight) } { set canvHeight [expr $canvas(systemMaxHeight) - \ $labelHeight - $canvasFrameHeight - \ $scrollHeight - $footerHeight] if {$canvHeight > 0} { systemCanvasHeightPut $frame $canvHeight systemDisplayHeightPut $frame $canvas(systemMaxHeight) set retheight $canvas(systemMaxHeight) } } set canvWidth [systemCanvasWidthGet $frame] set canvHeight [systemCanvasHeightGet $frame] $frame.m.c.canvas configure \ -width $canvWidth \ -height $canvHeight \ -xscrollcommand [list $frame.m.x.xscroll set] \ -yscrollcommand [list $frame.m.y.yscroll set] \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] if {$canvWidth > 0 && $scrollRegionWidth > $canvWidth} { pack $frame.m.x.xscroll -side bottom -fill x -padx 0 -pady 0 \ -ipadx 0 -ipady 0 } if {$canvHeight > 0 && $scrollRegionHeight > $canvHeight} { pack $frame.m.y.yscroll -side right -fill y -padx 0 -pady 0 \ -ipadx 0 -ipady 0 -anchor nw } pack $frame.l.label -fill both -expand true -padx 0 -pady 0 -ipadx 0 \ -ipady 0 pack $frame.m.c.canvas -expand true -fill both -padx 0 -pady 0 \ -ipadx 0 -ipady 0 pack $frame.m.x -side bottom -fill x -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $frame.m.y -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $frame.m.c -expand true -fill both -padx 0 -pady 0 -ipadx 0 \ -ipady 0 pack $frame.l $frame.m $frame.s -side top -anchor nw -fill both \ -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $frame -anchor c -expand true -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 systemAdjustNodesDistances $frame } proc systemNodesReCreate {frame } { global canvas sysnodes set systemName [systemNameGet $frame] $frame.l.label configure -text $systemName set labelWidth [expr \ 2*$canvas(bigBd) + 2*$canvas(bigLabelBd) + \ $canvas(bigLabelFontWidth)*[string length $systemName]] systemLabelWidthPut $frame $labelWidth set labelHeight [expr $canvas(bigBd) + 2*$canvas(bigLabelBd) \ + $canvas(bigLabelFontHeight)] systemLabelHeightPut $frame $labelHeight set canvasFrameWidth [expr $canvas(bigBd) + 2*$canvas(bigCanvasBd)] systemCanvasFrameWidthPut $frame $canvasFrameWidth set canvasFrameHeight [expr 2*$canvas(bigCanvasBd)] systemCanvasFrameHeightPut $frame $canvasFrameHeight set x1 0 set y1 0 set totwidth 0 set totheight 0 set pw 0 set ph 0 set maxWidth 0 set prevCluster "" set rowClusters "" set i 0 set j 0 foreach a [systemServerNamesGet $frame] { set clusterLabel [lindex $sysnodes($systemName,$a) 0] clusterNamePut $frame.m.c.$i $a clusterLabelTextPut $frame.m.c.$i $clusterLabel $frame.m.c.canvas delete $frame.m.c.$i systemClusterFramePut $frame $a $frame.m.c.$i set pos [clusterReCreate $frame.m.c.$i] set w [expr [lindex $pos 0] + 2*$canvas(medBd)] set h [lindex $pos 1] if { $i == 0 } { set rowClusters $frame.m.c.$i incr totwidth $w } elseif { [expr $j % $canvas(systemNumBoxesPerRow)] == 0 || \ [expr $totwidth + $w] > $canvas(systemMaxWidth) } { set rowOffset [expr \ ($canvas(systemMaxWidth) - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowClusters { clusterOffsetWidthPut $fr $rowOffset } } set rowClusters $frame.m.c.$i set x1 0 incr y1 $ph incr totheight $ph if {$totwidth > $maxWidth} { set maxWidth $totwidth } set totwidth $w set j 0 set ph 0 } else { lappend rowClusters $frame.m.c.$i incr x1 $pw incr totwidth $w if {[string compare $prevCluster ""] != 0} { clusterNextPut $prevCluster $frame.m.c.$i } } pack forget $frame.m.c.$i $frame.m.c.canvas create window $x1 $y1 -window $frame.m.c.$i \ -anchor nw -width $w -height $h -tags $frame.m.c.$i clusterXposPut $frame.m.c.$i $x1 clusterYposPut $frame.m.c.$i $y1 # save current width set pw $w if {$h > $ph} { set ph $h } set prevCluster $frame.m.c.$i incr i incr j } if {[string compare $rowClusters ""] != 0} { set rowOffset [expr ($canvas(systemMaxWidth) - $totwidth) / 2] if {$rowOffset > 0} { foreach fr $rowClusters { clusterOffsetWidthPut $fr $rowOffset } } } if {$maxWidth > $totwidth} { set totwidth $maxWidth } incr totheight $ph systemScrollRegionWidthPut $frame $totwidth systemScrollRegionHeightPut $frame $totheight set scrollRegionWidth $totwidth set scrollRegionHeight $totheight $frame.m.x.xscroll configure -orient horizontal \ -width $canvas(bigLabelFontHeight) \ -command [list $frame.m.c.canvas xview] set scrollHeight [expr \ 2*[lindex [$frame.m.x.xscroll configure -borderwidth] end] \ + [lindex [$frame.m.x.xscroll configure -width] end]] $frame.m.y.yscroll configure -orient vertical \ -width $canvas(bigLabelFontHeight) \ -command [list $frame.m.c.canvas yview] set scrollWidth [expr \ $canvas(bigBd) + \ 2*[lindex [$frame.m.y.yscroll configure -borderwidth] end] \ + [lindex [$frame.m.y.yscroll configure -width] end]] set footerWidth [expr 2*$canvas(bigBd) + 2*$canvas(bigLabelBd)] set footerHeight [expr 2*$canvas(bigLabelBd) + \ $canvas(bigBd) + \ 2*$canvas(smallLabelFontHeight)] systemFooterHeightPut $frame $footerHeight set retwidth [expr $canvasFrameWidth + $totwidth + $scrollWidth] if {$labelWidth > $retwidth && $labelWidth > $footerWidth} { set retwidth $labelWidth } elseif {$footerWidth > $retwidth && $footerWidth > $labelWidth} { set retwidth $footerWidth } systemDisplayWidthPut $frame $retwidth set canvWidth $totwidth systemCanvasWidthPut $frame $canvWidth systemScrollWidthPut $frame $scrollWidth if { $retwidth > $canvas(systemMaxWidth) } { set canvWidth [expr $canvas(systemMaxWidth) - \ $canvasFrameWidth - $scrollWidth] if {$canvWidth > 0} { systemCanvasWidthPut $frame $canvWidth systemDisplayWidthPut $frame $canvas(systemMaxWidth) set retwidth $canvas(systemMaxWidth) } } set retheight [expr $labelHeight + $canvasFrameHeight + $totheight + \ $scrollHeight + $footerHeight] systemDisplayHeightPut $frame $retheight set canvHeight $totheight systemCanvasHeightPut $frame $canvHeight systemScrollHeightPut $frame $scrollHeight if { $retheight > $canvas(systemMaxHeight) } { set canvHeight [expr $canvas(systemMaxHeight) - \ $labelHeight - $canvasFrameHeight - \ $scrollHeight - $footerHeight] if {$canvHeight > 0} { systemCanvasHeightPut $frame $canvHeight systemDisplayHeightPut $frame $canvas(systemMaxHeight) set retheight $canvas(systemMaxHeight) } } set canvWidth [systemCanvasWidthGet $frame] set canvHeight [systemCanvasHeightGet $frame] $frame.m.c.canvas configure -width $canvWidth -height $canvHeight \ -xscrollcommand [list $frame.m.x.xscroll set] \ -yscrollcommand [list $frame.m.y.yscroll set] \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] catch {pack forget $frame.m.x.xscroll} if {$canvWidth > 0 && $scrollRegionWidth > $canvWidth} { pack $frame.m.x.xscroll -side bottom -fill x -padx 0 -pady 0 \ -ipadx 0 -ipady 0 } catch {pack forget $frame.m.y.yscroll} if {$canvHeight > 0 && $scrollRegionHeight > $canvHeight} { pack $frame.m.y.yscroll -side right -fill y -padx 0 -pady 0 \ -ipadx 0 -ipady 0 -anchor nw } pack $frame -anchor c -expand true -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 systemAdjustNodesDistances $frame } proc systemRepack {systemframe} { global canvas if {[string compare $systemframe ""] == 0} { return } set canv [systemCanvasGet $systemframe] set xscroll [systemXscrollGet $systemframe] set yscroll [systemYscrollGet $systemframe] set labelWidth [systemLabelWidthGet $systemframe] set footerWidth [systemFooterWidthGet $systemframe] set canvasFrameWidth [systemCanvasFrameWidthGet $systemframe] set scrollWidth [systemScrollWidthGet $systemframe] set labelHeight [systemLabelHeightGet $systemframe] set canvasFrameHeight [systemCanvasFrameHeightGet $systemframe] set scrollHeight [systemScrollHeightGet $systemframe] set footerHeight [systemFooterHeightGet $systemframe] set scrollRegionWidth [systemScrollRegionWidthGet $systemframe] set scrollRegionHeight [systemScrollRegionHeightGet $systemframe] set canvWidth [systemCanvasWidthGet $systemframe] set canvHeight [systemCanvasHeightGet $systemframe] set dispWidth [systemDisplayWidthGet $systemframe] set dispHeight [systemDisplayHeightGet $systemframe] set retwidth [expr $canvasFrameWidth + $canvWidth + $scrollWidth] set footerWidth [expr $retwidth + 1] if {$labelWidth > $retwidth && $labelWidth > $footerWidth} { set retwidth $labelWidth } elseif {$footerWidth > $retwidth && $footerWidth > $labelWidth} { set retwidth $footerWidth } systemDisplayWidthPut $systemframe $retwidth if { $retwidth > $canvas(systemMaxWidth) } { set canvWidth [expr $canvas(systemMaxWidth) - \ $canvasFrameWidth - $scrollWidth] if {$canvWidth > 0} { systemCanvasWidthPut $systemframe $canvWidth systemDisplayWidthPut $systemframe \ $canvas(systemMaxWidth) set retwidth $canvas(systemMaxWidth) } } set retheight [expr $labelHeight + $canvasFrameHeight + $canvHeight + \ $scrollHeight + $footerHeight] systemDisplayHeightPut $systemframe $retheight if { $retheight > $canvas(systemMaxHeight) } { set canvHeight [expr $canvas(systemMaxHeight) - \ $labelHeight - $canvasFrameHeight - \ $scrollHeight - $footerHeight] if {$canvHeight > 0} { systemCanvasHeightPut $systemframe $canvHeight systemDisplayHeightPut $systemframe \ $canvas(systemMaxHeight) set retheight $canvas(systemMaxHeight) } } set canvWidth [systemCanvasWidthGet $systemframe] set canvHeight [systemCanvasHeightGet $systemframe] $canv configure -width $canvWidth -height $canvHeight \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] if {$canvWidth > 0 && $scrollRegionWidth > $canvWidth} { catch {pack $xscroll -side bottom -fill x -padx 0 -pady 0 \ -ipadx 0 -ipady 0} } else { catch {pack forget $xscroll} } if {$canvHeight > 0 && $scrollRegionHeight > $canvHeight} { pack $yscroll -side right -fill y -padx 0 -pady 0 -ipadx 0 \ -ipady 0 -anchor nw } else { catch {pack forget $yscroll} } } proc systemDelete {sysframe} { if {![winfo exists $sysframe]} { return } set sysname [systemNameGet $sysframe] foreach n [systemNodeNamesGet $sysframe] { set nframe [systemNodeFrameGet $sysframe $n FULL] nodeDelete $nframe } foreach c [systemClusterNamesGet $sysframe] { set cframe [systemClusterFrameGet $sysframe $c] clusterDelete $cframe } set array [string trimleft $sysframe .] global $array unset $array destroy $sysframe } proc systemRefreshDisplay {sysframe} { global canvas systemRefreshPut $sysframe 0 foreach nn [systemNodeNamesGet $sysframe] { set nf [systemNodeFrameGet $sysframe $nn FULL] if [nodeRefreshGet $nf] { update idletasks clusterRefreshPut [nodeClusterFrameGet $nf] 1 systemRefreshPut $sysframe 1 nodeRefreshPut $nf 0 } } foreach cn [systemClusterNamesGet $sysframe] { set cf [systemClusterFrameGet $sysframe $cn] if [clusterRefreshGet $cf] { update idletasks systemRefreshPut $sysframe 1 clusterRefreshPut $cf 0 } } if [systemRefreshGet $sysframe] { systemNodesReCreate $sysframe update idletasks } } proc systemDisplayClusterStatus {sysframe cname} { global canvas set cf [systemClusterFrameGet $sysframe $cname] set usepool [clusterUsePoolGet $cf] set availpool [clusterAvailPoolGet $cf] set totpool [clusterTotPoolGet $cf] set statusLine "" if {$totpool > 1} { set statusLine \ "Nodes:: $statusLine Total:$totpool Used:$usepool Avail:$availpool" } set offpool [clusterOfflinePoolGet $cf] if {$offpool != 0} { set statusLine "$statusLine Offl:$offpool" } set dwnpool [clusterDownPoolGet $cf] if {$dwnpool != 0} { set statusLine "$statusLine Down:$dwnpool" } set rsvpool [clusterReservedPoolGet $cf] if {$rsvpool != 0} { set statusLine "$statusLine Rsvd:$rsvpool" } set unkpool [clusterUnkPoolGet $cf] if {$unkpool != 0} { set statusLine "$statusLine Unk:$unkpool" } set cpu_assn [clusterCpusAssnGet $cf] if {$cpu_assn != 0} { set statusLine "$statusLine CpusAssn:$cpu_assn" set cpu_max [clusterCpusMaxGet $cf] if {$cpu_max != 0} { set statusLine "$statusLine/$cpu_max" } } set vprocs_assn [clusterVprocsAssnGet $cf] if {$vprocs_assn != 0} { set statusLine "$statusLine VPROCsUsed:$vprocs_assn" } set sbar [clusterStatusBarGet $cf] $sbar configure -text $statusLine set statusLineWidth \ [expr [string length $statusLine] * $canvas(medLabelFontWidth)] if {$statusLineWidth > [clusterDisplayWidthGet $cf]} { clusterRefreshPut $cf 1 } clusterFooterHeaderPut $cf $statusLine } # BUG: if a node was in the OFFLINE, and then on the next iteration # becomes FREE (no job on it), its color never gets updated to OFFLINE . proc systemPopulateNodesWithInfo {sysframe {create 0}} { global sysnodes canvas sysinfo if {[string compare $sysframe ""] == 0} { return } if {$sysinfo(LCK) || $sysinfo(PREFLCK)} { InfoBox_sendmsg "systemPopulateNodesWithInfo: intentionally not updating since either another one is running, or pref dialog active." 1 return } set sysinfo(LCK) 1 set systemName [systemNameGet $sysframe] busy_cursor InfoBox_flush 1 InfoBox_sendmsg "populatesNodesWithInfo: updating" 0 update idletasks unsetNodeColorInUseMapping foreach n [systemNodeNamesGet $sysframe] { systemNodeInfoUnset $sysframe $n systemNodeInfo2Unset $sysframe $n } set serverl [serverNamesSorted $systemName \ [serverNamesGet $systemName] nodeslist $sysframe] foreach server_name $serverl { if {[string compare $nodeslist($server_name) ""] != 0} { systemGetJobsInfo $sysframe $server_name } } set donehosts "" foreach n [systemNodeNamesGet $sysframe] { InfoBox_sendmsg "." 0 1 set fullnodeFrame [systemNodeFrameGet $sysframe $n FULL] set mirrornodeFrame [systemNodeFrameGet $sysframe $n MIRROR] set nodejob [systemNodeInfoGet $sysframe $n] set nodestat [systemNodeStatusGet $sysframe $n] set nodetype [systemNodeTypeGet $sysframe $n] set nodeinfo2 [systemNodeInfo2Get $sysframe $n] switch -exact -- $nodetype { NOMOM { if {[string compare $nodejob ""] == 0 && \ ([string compare $nodestat INUSE-EXCLUSIVE] == 0 \ || [string compare $nodestat INUSE-SHARED] == 0)} { nodeUpdateStat $sysframe $n FREE } systemNodeInfoPut $sysframe $n \ [concat $nodeinfo2 $nodejob] } NOMOM_SNODE { systemNodeInfoPut $sysframe $n \ [concat $nodeinfo2 $nodejob] } MOM { if {[string compare $nodejob ""] == 0 && \ ([string compare $nodestat INUSE-EXCLUSIVE] == 0 \ || [string compare $nodestat INUSE-SHARED] == 0)} { nodeUpdateStat $sysframe $n NOINFO } catch {openrm $n} fd InfoBox_sendmsg "systemPopulateNodesWithInfo: openrm($n): $fd" end if {$fd < 0} { nodeUpdateStat $sysframe $n DOWN } else { set status [TSgetStatus $fd $sysframe $n 1] switch -exact -- $status { FREE { set qlist [sendTSQueries $fd \ $systemName $n] set qexpr [recvResponses $fd \ $systemName $n $qlist] set qexpr [concat $qexpr $nodejob] systemNodeInfoPut $sysframe $n $qexpr systemUpdateInUse $sysframe $n $nodejob } NOINFO { systemUpdateInUse $sysframe $n $nodejob } } catch {closerm $fd} InfoBox_sendmsg "systemPopulateNodesWithInfo: closerm($n)" end } } MOM_SNODE { set qexpr "" catch {openrm $n} fd InfoBox_sendmsg "systemPopulateNodesWithInfo: openrm($n): $fd" end if {$fd >= 0} { set status [TSgetStatus $fd $sysframe $n 0] if {[string compare $status FREE] == 0} { set qlist [sendTSQueries $fd \ $systemName $n] set qexpr [recvResponses $fd \ $systemName $n $qlist] } catch {closerm $fd} InfoBox_sendmsg "systemPopulateNodesWithInfo: closerm($n)" end } set qexpr [concat $nodeinfo2 $qexpr $nodejob] systemNodeInfoPut $sysframe $n $qexpr } } set nodeinfo [systemNodeInfoGet $sysframe $n] if { [string compare $nodeinfo ""] != 0 } { nodeDisplayInfo $fullnodeFrame $nodeinfo $create nodeDisplayInfo $mirrornodeFrame $nodeinfo $create } else { nodeRemLines $fullnodeFrame 0 nodeRemLines $mirrornodeFrame 0 nodeColorIt $fullnodeFrame $n nodeColorIt $mirrornodeFrame $n } } foreach f [systemClusterNamesGet $sysframe] { systemDisplayClusterStatus $sysframe $f } systemRefreshDisplay $sysframe colorBarUpdate InfoBox_sendmsg "done." 0 1 5 remove_busy_cursor set sysinfo(LCK) 0 } proc systemUpdateInUse {sysframe n jobslist} { set len [lindex [lindex [lindex $jobslist 0] 1] 3] if {[string compare $len ""] == 0} { set len 0 } if {$len == 1} { nodeUpdateStat $sysframe $n INUSE-EXCLUSIVE } elseif {$len > 1} { nodeUpdateStat $sysframe $n INUSE-SHARED } } proc systemGetJobsInfo {sysframe server_name} { if {[string compare $sysframe ""] == 0 || \ [string compare $server_name ""] == 0} { return } foreach nname [systemNodeNamesGet $sysframe] { set name [split $nname ,] set superhost [lindex $name 0] set fullhost [lindex $name 1] if {[string compare $fullhost ""] == 0} { set node $superhost } else { set node $fullhost } set chophost [lindex [split $node .] 0] set nodeMatch($node) $nname set nodeMatch($chophost) $nname } catch {unset jobs} catch {unset vp_used} set cpus_assn 0 catch {pbsconnect $server_name} fd InfoBox_sendmsg "systemGetJobsInfo: pbsconnect($server_name): $fd" end set cframe [systemClusterFrameGet $sysframe $server_name] if { $fd >= 0 } { catch {pbsstatserv} sinfo set attribl [lindex $sinfo 1] foreach a $attribl { set res [lindex $a 0] set val [lindex $a 1] if {[string compare $res "resources_max.ncpus"] == 0} { if {[string compare $cframe ""] != 0} { clusterCpusMaxPut $cframe $val } } elseif {[string compare $res \ "resources_assigned.nodect"] == 0} { clusterVprocsAssnPut $cframe $val } } catch {pbsstatjob} jinfo InfoBox_sendmsg "systemGetJobsInfo: pbsstatjob($server_name): " end foreach j $jinfo { set jobid [lindex $j 0] set attribl [lindex $j 1] set user "" set state "" set hostlist {} set nodeslist {} set ncpus 0 foreach a $attribl { set res [lindex $a 0] set val [lindex $a 1] if { [string compare $res "Job_Owner"] == 0 } { set user [lindex [split $val @] 0] } elseif {[string compare $res \ "job_state"] == 0} { set state $val } elseif {[string compare $res \ "exec_host"] == 0} { set hostlist [split $val +] } elseif {[string compare $res \ "resources_used.nodes"] == 0} { set nodeslist [split $val +] } elseif {[string compare $res \ "Resource_List.ncpus"] == 0} { set ncpus $val } elseif {[string compare $state ""] != 0 && \ [string compare $state R] != 0} { break } } if {[string compare $state R] == 0} { incr cpus_assn $ncpus if {[string compare $nodeslist ""] != 0} { set hlist $nodeslist } else { set hlist $hostlist } catch {unset ujobinfo} foreach h1 $hlist { set h1_list [split $h1 /] set h [lindex $h1_list 0] set p [lindex $h1_list 1] if {[string compare $p ""] != 0} { if {![info exists ujobinfo($h)]} { set ujobinfo($h) " on vprocs $p" set vp_used($h,$p) 1 } else { append ujobinfo($h) ":$p" } } else { set ujobinfo($h) "" } } foreach h [array names ujobinfo] { if [info exists nodeMatch($h)] { if {$ncpus != 0} { lappend jobs($nodeMatch($h)@$user) \ "$jobid$ujobinfo($h) (cpus=$ncpus)" } else { lappend jobs($nodeMatch($h)@$user) \ "$jobid$ujobinfo($h)" } } } } } catch {pbsdisconnect} InfoBox_sendmsg "pbsdisconnect($server_name)" end } foreach j [array names jobs] { set jinfo [split $j @] set nodename [lindex $jinfo 0] set user [lindex $jinfo 1] set numj [llength $jobs($j)] lappend nodejobs($nodename) "$user [join $jobs($j) ,]" if {![info exists njobs($nodename)]} { set njobs($nodename) $numj } else { incr njobs($nodename) $numj } if {![info exists nusers($nodename)]} { set nusers($nodename) 1 } else { incr nusers($nodename) } } foreach n [array names nodejobs] { set header "Jobs: " if {$nusers($n) <= 1} { lappend header " $nusers($n) " "USER: " } else { lappend header " $nusers($n) " "USERs: " } if {$njobs($n) <= 1} { lappend header " $njobs($n) " "JID: " } else { lappend header " $njobs($n) " "JIDs: " } systemNodeInfoAppend $sysframe $n \ [list $nodejobs($n) $header NODEJOB] set nodetype [systemNodeTypeGet $sysframe $n] systemUpdateInUse $sysframe $n [systemNodeInfoGet $sysframe $n] } if [info exists cframe] { clusterCpusAssnPut $cframe $cpus_assn } if {[info exists vp_used]} { set accum 0 foreach pro [array names vp_used] { incr accum $vp_used($pro) } clusterVprocsAssnPut $cframe $accum } } proc systemAdjustNodesDistances {sysframe} { global canvas foreach n [systemNodeNamesGet $sysframe] { set nframe [systemNodeFrameGet $sysframe $n FULL] set ccanv [clusterCanvasGet [nodeClusterFrameGet $nframe]] set offset [nodeOffsetWidthGet $nframe] if { [string compare $offset ""] != 0 && $offset != 0 } { $ccanv move $nframe $offset 0 nodeXposPut $nframe [expr [nodeXposGet $nframe] + \ $offset] nodeOffsetWidthPut $nframe 0 } } foreach c [systemClusterNamesGet $sysframe] { set cframe [systemClusterFrameGet $sysframe $c] set systemc [systemCanvasGet [clusterSystemFrameGet $cframe]] set offset [clusterOffsetWidthGet $cframe] if { [string compare $offset ""] != 0 && $offset != 0 } { $systemc move $cframe $offset 0 clusterXposPut $cframe [expr [clusterXposGet $cframe] \ + $offset] clusterOffsetWidthPut $cframe 0 } } } torque-2.4.16/src/tools/xpbsmon/bitmaps/0000777000113300011330000000000011614035203015165 500000000000000torque-2.4.16/src/tools/xpbsmon/bitmaps/cyclist-only.xbm0000664000113300011330000000466511272401237020263 00000000000000#define cyclist-only_width 55 #define cyclist-only_height 55 static unsigned char cyclist-only_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x28, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x80, 0x0d, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x78, 0x3e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0xca, 0x1f, 0x00, 0x00, 0x00, 0x38, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x03, 0x00, 0x78, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0xc8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xc0, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x38, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x91, 0x9f, 0x07, 0x1f, 0x00, 0x00, 0x00, 0x8a, 0x90, 0x08, 0x00, 0x76, 0x9e, 0x0b, 0x84, 0x8f, 0x03, 0x00, 0x5e, 0x92, 0x0e, 0x8c, 0x00, 0x04, 0x00, 0x5a, 0x92, 0x0c, 0x92, 0x80, 0x07, 0x00, 0x4a, 0x9e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; torque-2.4.16/src/tools/xpbsmon/bitmaps/maximize.bmp0000664000113300011330000000043711272401237017436 00000000000000#define maximize_width 16 #define maximize_height 16 static char maximize_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00}; torque-2.4.16/src/tools/xpbsmon/bitmaps/iconize.bmp0000664000113300011330000000043711272401237017253 00000000000000#define compress_width 16 #define compress_height 16 static char compress_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0xf0, 0x07, 0xf8, 0x0f, 0xf0, 0x07, 0xf0, 0x07, 0xe0, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; torque-2.4.16/src/tools/xpbsmon/bitmaps/hourglass.bmp0000664000113300011330000000105511272401237017617 00000000000000#define hourglass.bmp_width 19 #define hourglass.bmp_height 21 #define hourglass.bmp_x_hot 8 #define hourglass.bmp_y_hot 0 static char hourglass.bmp_bits[] = { 0xff, 0xfc, 0x07, 0x55, 0x55, 0x05, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xc2, 0x0a, 0x03, 0x46, 0x05, 0x01, 0x82, 0x0a, 0x03, 0x06, 0x05, 0x01, 0x02, 0x03, 0x03, 0x86, 0x05, 0x01, 0xc2, 0x0a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2b, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0xff, 0xff, 0x07, 0xab, 0xaa, 0x02}; torque-2.4.16/src/tools/xpbsmon/bitmaps/logo.bmp0000664000113300011330000020325311272401237016554 00000000000000#define logo_width 260 #define logo_height 330 static unsigned char logo_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x07, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x1c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x07, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x83, 0x3f, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdf, 0x07, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x8f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x40, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0d, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xff, 0x02, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xa0, 0xff, 0x5b, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xeb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xbd, 0xfe, 0x7f, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xbf, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xe0, 0xd7, 0xd6, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xed, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xfe, 0xfb, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfd, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x6f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdd, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xab, 0xaa, 0x22, 0x00, 0xec, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x40, 0x55, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6d, 0xdb, 0xde, 0xff, 0xfb, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7b, 0xdb, 0xae, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xef, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xba, 0xd5, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb6, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xf6, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0xa8, 0xdf, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0xe0, 0x7d, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0xd7, 0xfb, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0xfc, 0x6e, 0x7b, 0xfb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0xc0, 0xff, 0xed, 0x7f, 0xff, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0xac, 0xbf, 0xed, 0xbd, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0xe0, 0xf6, 0xbf, 0xf7, 0xbf, 0xfb, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x81, 0x00, 0xbc, 0xf5, 0xde, 0xee, 0xee, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x01, 0x40, 0xbf, 0xf7, 0xfb, 0xbf, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xbe, 0x5f, 0xeb, 0xee, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x10, 0x00, 0x00, 0x00, 0xe8, 0xff, 0xbb, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x18, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xee, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x5b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x40, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xc0, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xed, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x60, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x6f, 0xbf, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x03, 0x00, 0x00, 0x80, 0xbf, 0xfd, 0xfb, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x70, 0x03, 0x00, 0x00, 0x78, 0xed, 0xb7, 0xaf, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x01, 0x00, 0x00, 0xed, 0xbf, 0xfd, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x58, 0x01, 0x00, 0xc0, 0xbf, 0xed, 0xef, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf8, 0x01, 0x00, 0x70, 0xeb, 0x7f, 0xbb, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x6c, 0x01, 0x00, 0xfc, 0x7f, 0xdb, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xfc, 0x00, 0x00, 0xdf, 0xf6, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xd6, 0x00, 0xc0, 0xfb, 0xdb, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x7e, 0x00, 0xf0, 0x5e, 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x77, 0x00, 0xec, 0xf7, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x5d, 0x00, 0xbe, 0x7d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80, 0x3f, 0x80, 0xeb, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80, 0x2d, 0xe0, 0x7f, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0x1f, 0xb8, 0xdd, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x40, 0x1b, 0xf6, 0xf7, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xe0, 0x0f, 0x5f, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x60, 0xcb, 0xf5, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xf0, 0xef, 0x7f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xd0, 0x7a, 0xdb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x78, 0x70, 0xdf, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x38, 0xd0, 0xf7, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x38, 0xf0, 0xbd, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x30, 0x78, 0xef, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x78, 0xdc, 0x7b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0xf7, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xf0, 0xde, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xf0, 0x7b, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x70, 0xef, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdf, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x47, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x43, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x43, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x43, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xbf, 0xc3, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xc3, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xdf, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x81, 0x3b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0xae, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xc0, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x60, 0x1b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xe0, 0x8f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xb0, 0x0d, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x8b, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xb8, 0x06, 0x01, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xe8, 0x87, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xaa, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xfc, 0x81, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xe0, 0x1f, 0xb4, 0x83, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xf0, 0x3f, 0xfc, 0x82, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xf0, 0xfd, 0xef, 0x81, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xf0, 0xf1, 0xbf, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xf0, 0xc1, 0xef, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x7f, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf0, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xfe, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xf0, 0x01, 0x08, 0x60, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xf0, 0x01, 0x00, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x01, 0x00, 0xe0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf0, 0x03, 0x00, 0xc0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x70, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0x07, 0x00, 0x40, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xc0, 0x07, 0x00, 0x20, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0x0f, 0x00, 0x60, 0x00, 0x0c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x20, 0x00, 0x18, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x70, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x30, 0x00, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x38, 0x00, 0x60, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x3c, 0x00, 0xe0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x06, 0x00, 0x7e, 0x00, 0x1c, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x75, 0x03, 0x00, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x71, 0x03, 0x00, 0xfc, 0x00, 0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x02, 0x00, 0xf8, 0x01, 0x0f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb1, 0x02, 0x00, 0xf8, 0x83, 0x0f, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb1, 0x02, 0x00, 0xf0, 0x83, 0x0f, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x31, 0x02, 0x00, 0xe0, 0xc7, 0x0f, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3b, 0x06, 0x00, 0xe0, 0xcf, 0x07, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0xe8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; torque-2.4.16/src/tools/xpbsmon/patch_scripts0000664000113300011330000001467111272401240016244 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # # this script will patch the resource file xpbsmonrc to have # the appropriate paths # PBS_MACH="$1" PBS_DEFAULT_SERVER="$2" xpbsmonrc_in="$3" xpbsmonrc_out="$4" case "$PBS_MACH" in unicos8) sed -e 's,\*sitesInfo:.*$,\*sitesInfo: {Local;ICON;'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';MOM;{{( ( totmem - availmem ) / totmem ) * 100} {Memory Usage:} SCALE} {cpuuser {% Cpu User Time:} SCALE} {cpuidle {% Cpu Idle Time:} SCALE} {{( swapused / swaptotal ) * 100} {Swap Usage:} SCALE} {nusers {Number of Users:} TEXT}},;' \ -e 's,\*siteInView:.*$,\*siteInView: Local,' \ $xpbsmonrc_in > $xpbsmonrc_out ;; sunos4) sed -e 's,\*sitesInfo:.*$,\*sitesInfo: {Local;ICON;'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';MOM;{{( ( totmem - availmem ) / totmem ) * 100} {Memory Usage:} SCALE} {loadave {Load Avg:} TEXT} {nusers {Number of Users:} TEXT}},' \ -e 's,\*siteInView:.*$,\*siteInView: Local,' \ $xpbsmonrc_in > $xpbsmonrc_out ;; unicosmk2) sed -e 's,\*sitesInfo:.*$,\*sitesInfo: {Local;ICON;'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';MOM;{{( ( totmem - availmem ) / totmem ) * 100} {Memory Usage:} SCALE} },' \ -e 's,\*siteInView:.*$,\*siteInView: Local,' \ $xpbsmonrc_in > $xpbsmonrc_out ;; linux|*bsd*|irix*|fujitsu|aix[45]|darwin) sed -e 's,\*sitesInfo:.*$,\*sitesInfo: {Local;ICON;'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';MOM;{{( ( totmem - availmem ) / totmem ) * 100} {Memory Usage:} SCALE} {{( loadave / ncpus ) * 100} {Cpu Usage:} SCALE} {nusers {Number of Users:} TEXT}},;' \ -e 's,\*siteInView:.*$,\*siteInView: Local,' \ $xpbsmonrc_in > $xpbsmonrc_out ;; solaris[57]|hpux10|hpux11) sed -e 's,\*sitesInfo:.*$,\*sitesInfo: {Local;ICON;'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';MOM;{{( loadave / ncpus ) * 100} {Cpu Usage:} SCALE} {nusers {Number of Users:} TEXT}},;' \ -e 's,\*siteInView:.*$,\*siteInView: Local,' \ $xpbsmonrc_in > $xpbsmonrc_out ;; sp2|digitalunix) sed -e 's,\*sitesInfo:.*$,\*sitesInfo: {Local;ICON;'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';'$PBS_DEFAULT_SERVER';MOM;{loadave {Load Avg:} TEXT} {nusers {Number of Users:} TEXT}},;' \ -e 's,\*siteInView:.*$,\*siteInView: Local,' \ $xpbsmonrc_in > $xpbsmonrc_out ;; *) exit 1 ;; esac torque-2.4.16/src/tools/xpbsmon/common.tk0000664000113300011330000002233111272401240015273 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # listcomp: Returns 0 if the 2 lists are the same (order of elements will not # matter); otherwise 1. proc listcomp {list1 list2} { if {[llength $list1] != [llength $list2]} { return 1 } foreach e1 $list1 { set j 0 foreach e2 $list2 { if {[string compare $e1 $e2] == 0} { set list2 [lreplace $list2 $j $j] break } incr j } } if {[llength $list2] != 0} { return 1 } return 0 } # busy_cursor: displays a busy cursor under the mouse pointer position over a # "registered" active window. proc busy_cursor {} { global activeWindow bitmap_dir foreach win [array names activeWindow] { if {$activeWindow($win)} { $win configure -cursor "@$bitmap_dir/hourglass.bmp black" } } } # remove_busy_cursor: removes the busy cursor set up by busy_cursor. proc remove_busy_cursor {} { global activeWindow foreach win [array names activeWindow] { if {$activeWindow($win)} { $win configure -cursor {} } } } # InfoBox_sendmsg: The following procedure sends the specified 'message' to # Info Box. # OPTIONS: # 'line_number' - the position on the InfoBox where the message will be # placed. # 'append' - to append messages to an existing entry. # 'xview_increment' - how much to right shift the horizontal display of # the InfoBox. proc InfoBox_sendmsg { message {line_number 1} {append 0} \ {xview_increment 1} } { global sysinfo tk_version if {![info exists sysinfo(infoBox)]} { return } if {[string compare $line_number "end"] == 0} { set line_number [$sysinfo(infoBox) size] } catch {exec date "+%D %T"} datestr if {!$append} { set msg "\[$datestr\] $message" set sysinfo(infoBoxCounter) \ [expr [string length $msg] - $sysinfo(infoListBoxWidth)] catch {$sysinfo(infoBox) insert $line_number $msg} set lsize [$sysinfo(infoBox) size] set line_to_delete [expr $line_number + 1] if { $lsize > 1 && $line_to_delete < $lsize } { catch {$sysinfo(infoBox) delete $line_to_delete} } } else { set cval [$sysinfo(infoBox) get $line_number] incr sysinfo(infoBoxCounter) $xview_increment catch {$sysinfo(infoBox) insert $line_number "$cval$message"} out set lsize [$sysinfo(infoBox) size] set line_to_delete [expr $line_number + 1] if { $lsize > 1 && $line_to_delete < $lsize } { catch {$sysinfo(infoBox) delete $line_to_delete} } } if {$tk_version >= 4.0} { if {$sysinfo(infoBoxCounter) > 0} { $sysinfo(infoBox) xview moveto 1 } else { $sysinfo(infoBox) xview 0 } } else { $sysinfo(infoBox) xview $sysinfo(infoBoxCounter) } update idletasks } proc InfoBox_flush {start_line} { global sysinfo $sysinfo(infoBox) delete $start_line end } # digit: returns the integer given some number string (like atoi). Tcl seems to # be having problems converting from 08/09 to 8/9 so this procedure is # needed. proc digit {number_str} { switch -regexp -- $number_str { "^(00|01|02|03|04|05|06|07|08|09)$" {return [string index $number_str 1]} default {return $number_str} } } proc stackPush {element} { global sysinfo if [info exists sysinfo(stack)] { set newstack [linsert $sysinfo(stack) 0 $element] set sysinfo(stack) $newstack } else { set sysinfo(stack) $element } } proc stackPop {} { global sysinfo set sysinfo(stack) [lrange $sysinfo(stack) 1 end] } proc isStackEmpty {} { global sysinfo if { ![info exists sysinfo(stack)] || \ [llength $sysinfo(stack)] == 0 } { return 1 } return 0 } proc stackClear {} { global sysinfo set sysinfo(stack) {} } proc stackPrint {} { global sysinfo if [info exists sysinfo(stack)] { puts "STACK entries: $sysinfo(stack)" } else { puts "STACK entries: " } } proc addLlist {llist key row col} { upvar $llist ll set append 1 set newll "" foreach elem $ll { set mid [lsearch -exact $elem $key] if {$mid != -1} { # found a match set newelem [concat $elem $row $col] lappend newll $newelem set append 0 } else { lappend newll $elem } } if {$append} { lappend newll "$key $row $col" } set ll $newll return $append } proc cleanstr {str} { global sysinfo set newstr "" for {set i 0} {$i < [string length $str]} {incr i} { set c [string index $str $i] if { [string compare $c \ $sysinfo(rcSiteInfoDelimeterChar)] != 0 && \ [string compare $c "\["] != 0 && \ [string compare $c "\]"] != 0 } { set newstr "$newstr$c" } } return $newstr } torque-2.4.16/src/tools/xpbsmon/color.tk0000664000113300011330000002213511272401240015123 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc getNextNodeColorInUse {} { global canvas if {![info exists canvas(nodeColorINUSE_index)]} { set canvas(nodeColorINUSE_index) -1 } set newindex [expr ($canvas(nodeColorINUSE_index)+1) % \ [llength $canvas(nodeColorINUSEexclusive)]] set canvas(nodeColorINUSE_index) $newindex set retcolor [lindex $canvas(nodeColorINUSEexclusive) $newindex] if {[string compare $retcolor ""] == 0} { set retcolor white } return $retcolor } proc assignNodeColorInUse {job {defcolor ""}} { global sysinfo set retcolor "" if [info exists sysinfo(color,$job)] { set retcolor $sysinfo(color,$job) } else { if {[string compare $defcolor ""] == 0} { set retcolor [getNextNodeColorInUse] } else { set retcolor $defcolor } set sysinfo(color,$job) $retcolor } if [info exists sysinfo(colorCnt,$job)] { set sysinfo(colorCnt,$job) [expr $sysinfo(colorCnt,$job) + 1] } else { set sysinfo(colorCnt,$job) 1 } return $retcolor } proc unsetNodeColorInUseMapping {} { global sysinfo canvas foreach s [array names sysinfo] { set s_list [split $s ","] set head [lindex $s_list 0] if {[string compare $head "color"] == 0 || \ [string compare $head "colorCnt"] == 0 } { unset sysinfo($s) } } set canvas(nodeColorINUSE_index) -1 } proc colorBarPopulate {startx starty maplist tag} { global canvas set i 0 foreach stat $maplist { set color [lindex $stat 0] set label [lindex $stat 1] if {$i == 0} { set x1 $startx } else { set pos [$canvas(colorBarCanvas) bbox $previd] set x1 [expr [lindex $pos 2] + $canvas(smallLabelFontWidth)] } set y1 $starty set x2 [expr $x1 + $canvas(smallTextFontWidth)] set y2 [expr $y1 + $canvas(smallTextFontHeight)] set rid [$canvas(colorBarCanvas) create rect $x1 $y1 $x2 $y2 \ -fill $color -tags [list $tag all]] set pos [$canvas(colorBarCanvas) bbox $rid] set x1 [expr [lindex $pos 2] + 2] set y1 [lindex $pos 1] set previd [$canvas(colorBarCanvas) create text $x1 $y1 \ -anchor nw -text "$label" \ -font $canvas(smallLabelFont) \ -tags [list $tag all]] incr i } } proc colorBarCreate {frame_name} { global sysinfo canvas canvas $frame_name.c -confine 1 \ -height [expr 2*$canvas(smallLabelFontHeight)] \ -borderwidth 2 \ -relief ridge \ -width $canvas(systemMaxWidth) \ -xscrollcommand [list $frame_name.xscroll set] \ -scrollregion [list 0 0 $canvas(systemMaxWidth) \ $canvas(bigTextFontHeight)] set canvas(colorBarCanvas) $frame_name.c lappend nodestatus "$canvas(nodeColorFREE) FREE" \ "$canvas(nodeColorDOWN) DOWN" \ "$canvas(nodeColorOFFL) OFFL" \ "$canvas(nodeColorRSVD) RSVD" \ "$canvas(nodeColorNOINFO) NOINFO" \ "$canvas(nodeColorINUSEshared) INUSE/SHARED" colorBarPopulate [expr 2*$canvas(smallLabelFontWidth)] $canvas(bigBd) \ $nodestatus fixed scrollbar $frame_name.xscroll -orient horizontal \ -relief flat \ -borderwidth $canvas(bigBd) \ -background $canvas(bigScrollBg) \ -width $canvas(smallLabelFontHeight) \ -command [list $frame_name.c xview] set canvas(colorBarScroll) $frame_name.xscroll pack $frame_name.c -side left -anchor nw -fill x -expand true \ -padx 1m -pady 1m set pos [$canvas(colorBarCanvas) bbox all] set x1 [lindex $pos 0] set y1 [lindex $pos 1] set x2 [lindex $pos 2] set y2 [lindex $pos 3] set width [expr ($x2 - $x1) + 2*$canvas(smallLabelFontWidth)] set height [expr ($y2 - $y1) + 2*$canvas(smallLabelFontHeight)] $canvas(colorBarCanvas) configure -scrollregion "0 0 $width $height" if {$width > $canvas(systemMaxWidth)} { catch {pack $canvas(colorBarScroll) -side right -anchor se \ -expand true -pady [expr $canvas(smallLabelFontHeight)/2]} } } proc colorBarUpdate {} { global sysinfo canvas foreach s [array names sysinfo] { set s_list [split $s ","] set head [lindex $s_list 0] if {[string compare $head "color"] == 0} { set job [lindex $s_list 1] if {[string compare $job TIMESHARED] != 0} { lappend color($sysinfo($s)) \ $job.$sysinfo(colorCnt,$job)nodes } } } set inuse "" if {[string compare $canvas(nodeColorINUSEshared) \ $canvas(nodeColorINUSEexclusive)] != 0 } { foreach c [array names color] { set jobs [join $color($c) ","] lappend inuse "$c {INUSE($jobs)}" } } set pos [$canvas(colorBarCanvas) bbox fixed] set x [lindex $pos 0] set y [lindex $pos 3] catch {$canvas(colorBarCanvas) delete variable} colorBarPopulate $x [expr $y + $canvas(bigBd)] $inuse variable set pos [$canvas(colorBarCanvas) bbox all] set x1 [lindex $pos 0] set y1 [lindex $pos 1] set x2 [lindex $pos 2] set y2 [lindex $pos 3] set width [expr ($x2 - $x1) + 2*$canvas(smallLabelFontWidth)] set height [expr ($y2 - $y1) + 2*$canvas(smallLabelFontHeight)] $canvas(colorBarCanvas) configure -scrollregion "0 0 $width $height" if {$width > $canvas(systemMaxWidth)} { catch {pack $canvas(colorBarScroll) -side right -anchor se \ -expand true -pady [expr $canvas(smallLabelFontHeight)/2]} } else { catch {pack forget $canvas(colorBarScroll)} } } torque-2.4.16/src/tools/xpbsmon/xpbsmon.src0000775000113300011330000004151611272401240015653 00000000000000#!/usr/local/bin/pbs_wish -f ############################################################################### # xpbsmon-gui: The GUI front end to the PBS user and operator commands. # # Written by Albeaus Bayucan # History # Initial Date: 2/26/98 ############################################################################### # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ global env if { ![info exists env(DISPLAY)] } { puts "DISPLAY variable not set." exit 1 } set XPBSMON_VERSION 2.3 set libdir /usr/local/lib/xpbsmon set appdefdir /usr/local/lib/xpbsmon set bitmap_dir $libdir/bitmaps set helpdir $libdir/help set bindir $libdir/bin set auto_path [linsert $auto_path 0 $libdir] set auto_path [linsert $auto_path 0 .] set appDefaultsFile $appdefdir/xpbsmonrc set appname1 "xpbsmon" set appname "${appname1}${XPBSMON_VERSION}" if { [string compare $env(HOME) "/"] == 0 } { set sysinfo(rcFile) "/.${appname1}rc" } else { set sysinfo(rcFile) "$env(HOME)/.${appname1}rc" } set sysinfo(appname) $appname set BADPARAM 7000 set errmsg(BADPARAM) "A procedure has encountered a bad parameter." set sysinfo(infoListBoxWidth) 73 set sysinfo(infoListBoxHeight) 3 set sysinfo(DATA_UPDATE_SEQ) 0 set sysinfo(systemFrame) "" set sysinfo(LCK) 0 set sysinfo(PREFLCK) 0 set canvas(nodeColorINUSE_index) -1 Pref_Init $sysinfo(rcFile) $appDefaultsFile ## For items that are configurable, please add an entry on this array set preferences { \ {canvas(smallFg) smallForeground #150567} {canvas(smallBg) smallBackground #ffefdb} {canvas(smallBd) smallBorderWidth 2} {canvas(smallRelief) smallRelief raised} {canvas(smallScrollBd) smallScrollBorderWidth 2} {canvas(smallScrollBg) smallScrollBackground #ffefdb} {canvas(smallScrollRelief) smallScrollRelief sunken} {canvas(smallCanvasBg) smallCanvasBackground #ffefdb} {canvas(smallCanvasBd) smallCanvasBorderWidth 1} {canvas(smallCanvasRelief) smallCanvasRelief flat} {canvas(smallLabelBd) smallLabelBorderWidth 0} {canvas(smallLabelBg) smallLabelBackground #ffefdb} {canvas(smallLabelRelief) smallLabelRelief flat} {canvas(smallLabelFg) smallLabelForeground #150567} {canvas(smallLabelFont) smallLabelFont "-misc-fixed-bold-r-normal--13-100-100-100-c-70-iso8859-1"} {canvas(smallLabelFontWidth) smallLabelFontWidth 7} {canvas(smallLabelFontHeight) smallLabelFontHeight 13} {canvas(smallTextFont) smallTextFont "-misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-1"} {canvas(smallTextFontWidth) smallTextFontWidth 6} {canvas(smallTextFontHeight) smallTextFontHeight 9} {canvas(nodeColorNOINFO) nodeColorNOINFO black} {canvas(nodeColorFREE) nodeColorFREE green} {canvas(nodeColorINUSEshared) nodeColorINUSEshared "#98f5ff"} {canvas(nodeColorINUSEexclusive) nodeColorINUSEexclusive "#a0522d #1e90ff #a9a9a9 #8470ff #a020f0"} {canvas(nodeColorDOWN) nodeColorDOWN red} {canvas(nodeColorRSVD) nodeColorRSVD yellow} {canvas(nodeColorOFFL) nodeColorOFFL orange} {canvas(nodeColorTrough) nodeColorTrough white} {canvas(nodeColorSlider) nodeColorSlider red} {canvas(nodeColorExtendedTrough) nodeColorExtendedTrough blue} {canvas(nodeScaleFactor) nodeScaleFactor 1} {canvas(nodeMaxWidth) nodeBoxFullMaxWidth 350} {canvas(nodeMaxHeight) nodeBoxFullMaxHeight 100} {canvas(iconMaxWidth) nodeBoxIconMaxWidth 56} {canvas(iconMaxHeight) nodeBoxIconMaxHeight 56} {canvas(mirrorMaxWidth) nodeBoxMirrorMaxWidth 700} {canvas(mirrorMaxHeight) nodeBoxMirrorMaxHeight 400} {canvas(mirrorScaleFactor) nodeBoxMirrorScaleFactor 3} {canvas(medLabelFg) mediumLabelForeground #150567} {canvas(medLabelBg) mediumLabelBackground #cdc0b0} {canvas(medLabelBd) mediumLabelBorderWidth 4 } {canvas(medLabelRelief) mediumLabelRelief ridge} {canvas(medLabelFont) mediumLabelFont "-misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1"} {canvas(medLabelFontWidth) mediumLabelFontWidth 8} {canvas(medLabelFontHeight) mediumLabelFontHeight 13} {canvas(medCanvasBd) mediumCanvasBorderWidth 1} {canvas(medCanvasBg) mediumCanvasBackground #cdc0b0} {canvas(medCanvasRelief) mediumCanvasRelief flat} {canvas(medScrollBd) mediumScrollBorderWidth 2} {canvas(medScrollBg) mediumScrollBackground #eedfcc} {canvas(medScrollRelief) mediumScrollRelief sunken} {canvas(medFg) mediumForeground #150567} {canvas(medBg) mediumBackground #cdc0b0} {canvas(medBd) mediumBorderWidth 10} {canvas(medRelief) mediumRelief ridge} {canvas(medTextFont) mediumTextFont "-misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1"} {canvas(medTextFontWidth) mediumTextFontWidth 8} {canvas(medTextFontHeight) mediumTextFontHeight 13} {canvas(clusterMaxWidth) serverBoxMaxWidth 710} {canvas(clusterMaxHeight) serverBoxMaxHeight 600} {canvas(clusterNumBoxesPerRow) serverBoxMaxNumNodeBoxesPerRow 17} {canvas(bigBg) bigBackground #c8b9a6} {canvas(bigFg) bigForeground #150567} {canvas(bigBd) bigBorderWidth 2} {canvas(bigRelief) bigRelief raised} {canvas(bigActiveColor) bigActiveColor #9db2ff} {canvas(bigShadingColor) bigShadingColor #c7af92} {canvas(bigSelectorColor) bigSelectorColor #980517} {canvas(bigDisabledColor) bigDisabledColor #8f8e8d} {canvas(bigLabelBg) bigLabelBackground #c8b9a6} {canvas(bigLabelBd) bigLabelBorderWidth 1} {canvas(bigLabelRelief) bigLabelRelief raised} {canvas(bigLabelFont) bigLabelFont "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"} {canvas(bigLabelFontWidth) bigLabelFontWidth 9} {canvas(bigLabelFontHeight) bigLabelFontHeight 15} {canvas(bigLabelFg) bigLabelForeground #150567} {canvas(bigCanvasBg) bigCanvasBackground #c8b9a6} {canvas(bigCanvasRelief) bigCanvasRelief flat} {canvas(bigCanvasBd) bigCanvasBorderWidth 1} {canvas(bigScrollBd) bigScrollBorderWidth 2} {canvas(bigScrollBg) bigScrollBackground #c8b9a6} {canvas(bigScrollRelief) bigScrollRelief sunken} {canvas(bigTextFont) bigTextFont "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"} {canvas(bigTextFontWidth) bigTextFontWidth 9} {canvas(bigTextFontHeight) bigTextFontHeight 15} {canvas(systemMaxWidth) siteBoxMaxWidth 710} {canvas(systemMaxHeight) siteBoxMaxHeight 500} {canvas(systemNumBoxesPerRow) siteBoxMaxNumServerBoxesPerRow 10} {sysinfo(autoUpdateMins) autoUpdateMins 1} {sysinfo(autoUpdate) autoUpdate {CHOICE true false}} {sysinfo(systemName) siteInView ""} {sysinfo(rcSiteInfoDelimeterChar) rcSiteInfoDelimeterChar ";"} {sitesinfo sitesInfo ""} } Pref_Add $preferences prefLoadSitesInfo option add *Plain*foreground $canvas(bigFg) option add *Plain*background $canvas(bigBg) option add *Plain*borderWidth 0 option add *Plain*relief flat #option add *Plain*troughColor $canvas(bigBg) option add *Plain*troughColor $canvas(bigShadingColor) option add *Plain*activeForeground $canvas(bigFg) option add *Plain*insertBackground $canvas(bigFg) option add *Plain*selectForeground $canvas(bigFg) option add *Plain*selectBackground $canvas(bigActiveColor) option add *Plain*activeBackground $canvas(bigActiveColor) option add *Plain*selector $canvas(bigSelectorColor) option add *Plain*selectColor $canvas(bigSelectorColor) ;# for 4.0 option add *Plain*disabledForeground $canvas(bigDisabledColor) #option add *Plain*Scrollbar*troughColor $canvas(bigBg) option add *Plain*Scrollbar*troughColor $canvas(bigShadingColor) option add *Plain*Scrollbar*foreground $canvas(bigScrollBg) option add *Plain*Scrollbar*background $canvas(bigScrollBg) ;# 4.0 option add *Plain*Scrollbar*activeForeground $canvas(bigActiveColor) option add *Plain*Scrollbar*activeBackground $canvas(bigActiveColor) ;# 4.0 option add *Plain*highlightColor $canvas(bigBg) option add *Plain*highlightThickness 0 option add *Plain*font $canvas(bigTextFont) option add *BigLabel*foreground $canvas(bigLabelFg) option add *Big*foreground $canvas(bigFg) option add *Big*background $canvas(bigBg) option add *Big*borderWidth $canvas(bigBd) option add *Big*relief $canvas(bigRelief) option add *Big*troughColor $canvas(bigBg) option add *Big*activeForeground $canvas(bigFg) option add *Big*insertBackground $canvas(bigFg) option add *Big*selectForeground $canvas(bigFg) option add *Big*selectBackground $canvas(bigActiveColor) option add *Big*activeBackground $canvas(bigActiveColor) option add *Big*selector $canvas(bigSelectorColor) option add *Big*selectColor $canvas(bigSelectorColor) ;# for 4.0 option add *Big*disabledForeground $canvas(bigDisabledColor) option add *Big*Scrollbar*troughColor $canvas(bigBg) option add *Big*Scrollbar*foreground $canvas(bigScrollBg) option add *Big*Scrollbar*background $canvas(bigScrollBg) ;# 4.0 option add *Big*Scrollbar*activeForeground $canvas(bigActiveColor) option add *Big*Scrollbar*activeBackground $canvas(bigActiveColor) ;# 4.0 option add *Big*highlightColor $canvas(bigBg) option add *Big*highlightThickness 0 option add *BigLabel*foreground $canvas(bigLabelFg) option add *BigLabel*background $canvas(bigLabelBg) option add *BigLabel*borderWidth $canvas(bigLabelBd) option add *BigLabel*relief $canvas(bigLabelRelief) option add *BigLabel*font $canvas(bigLabelFont) option add *BigLabel*background $canvas(bigShadingColor) option add *BigCanvas*background $canvas(bigCanvasBg) option add *BigCanvas*borderWidth $canvas(bigCanvasBd) option add *BigCanvas*relief $canvas(bigCanvasRelief) option add *BigScrollbar*borderWidth $canvas(bigScrollBd) option add *BigScrollbar*background $canvas(bigScrollBg) option add *BigScrollbar*relief $canvas(bigScrollRelief) option add *Big*Scrollbar*troughColor $canvas(bigBg) option add *Big*Scrollbar*foreground $canvas(bigScrollBg) option add *Big*Scrollbar*activeForeground $canvas(bigActiveColor) option add *Big*Scrollbar*activeBackground $canvas(bigActiveColor) ;# 4.0 option add *Big*font $canvas(bigTextFont) option add *Medium*foreground $canvas(medFg) option add *Medium*background $canvas(medBg) option add *Medium*borderWidth $canvas(medBd) option add *Medium*relief $canvas(medRelief) option add *Medium*font $canvas(medTextFont) option add *MediumLabel*foreground $canvas(medLabelFg) option add *MediumLabel*background $canvas(medLabelBg) option add *MediumLabel*borderWidth $canvas(medLabelBd) option add *MediumLabel*relief $canvas(medLabelRelief) option add *MediumLabel*font $canvas(medLabelFont) option add *MediumCanvas*background $canvas(medCanvasBg) option add *MediumCanvas*borderWidth $canvas(medCanvasBd) option add *MediumCanvas*relief $canvas(medCanvasRelief) option add *MediumScrollbar*borderWidth $canvas(medScrollBd) option add *MediumScrollbar*background $canvas(medScrollBg) option add *MediumScrollbar*relief $canvas(medScrollRelief) option add *Medium*Scrollbar*troughColor $canvas(medBg) option add *Medium*Scrollbar*foreground $canvas(medScrollBg) option add *Medium*Scrollbar*activeForeground $canvas(bigActiveColor) option add *Medium*Scrollbar*activeBackground $canvas(bigActiveColor) ;# 4.0 option add *Small*foreground $canvas(smallFg) option add *Small*background $canvas(smallBg) option add *Small*borderWidth $canvas(smallBd) option add *Small*relief $canvas(smallRelief) option add *Small*font $canvas(smallTextFont) option add *SmallLabel*foreground $canvas(smallLabelFg) option add *SmallLabel*background $canvas(smallLabelBg) option add *SmallLabel*borderWidth $canvas(smallLabelBd) option add *SmallLabel*relief $canvas(smallLabelRelief) option add *SmallLabel*font $canvas(smallLabelFont) option add *SmallCanvas*background $canvas(smallCanvasBg) option add *SmallCanvas*borderWidth $canvas(smallCanvasBd) option add *SmallCanvas*relief $canvas(smallCanvasRelief) option add *SmallScrollbar*borderWidth $canvas(smallScrollBd) option add *SmallScrollbar*background $canvas(smallScrollBg) option add *SmallScrollbar*relief $canvas(smallScrollRelief) #option add *Small*Scrollbar*troughColor $canvas(smallBg) option add *Small*Scrollbar*troughColor $canvas(medBg) option add *Small*Scrollbar*foreground $canvas(smallScrollBg) option add *Small*Scrollbar*activeForeground $canvas(bigActiveColor) option add *Small*Scrollbar*activeBackground $canvas(bigActiveColor) ;# 4.0 option add *CmdFrame*background $canvas(bigShadingColor) option add *CmdFrame*Button.foreground $canvas(bigFg) option add *CmdFrame*Button.background $canvas(bigBg) set dialog(mainWindow) ".main" set activeWindow($dialog(mainWindow)) 1 if {[string compare $dialog(mainWindow) "."] != 0} { toplevel $dialog(mainWindow) -class Plain wm withdraw . } else { set dialog(mainWindow) "" } # Close the stderr channel so transient messages are not printed out terminal close stderr build_main_window $dialog(mainWindow) set_wmgr $dialog(mainWindow) if {$sysinfo(autoUpdate)} { incr sysinfo(DATA_UPDATE_SEQ) if { [string compare $sysinfo(cmdButtonUpdAuto) ""] != 0 } { $sysinfo(cmdButtonUpdAuto) configure \ -background $canvas(bigActiveColor) } after [expr round($sysinfo(autoUpdateMins) * 60000)] data_auto_update \ $sysinfo(DATA_UPDATE_SEQ) } torque-2.4.16/src/tools/xpbsmon/expr.tk0000664000113300011330000002323011272401240014760 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc isNumber {str number} { upvar $number num set retval [regexp {^[+-]?[0-9]+[.]?[0-9]*[kmgtpKMGTP]?[bwBW]?$} $str] if {$retval} { regsub -all {[kmgtpKMGTP]?[bwBW]?} $str "" num } return $retval } proc isFloat {str} { return [regexp {^[+-]?[0-9]+[.][0-9]*[kmgtpKMGTP]?[bwBW]?$} $str] } proc isSingleOp {str} { switch -exact -- $str { - - ~ - * - / - % - + - ^ - ( - ) { return 1 } < - > - ! - & - = - | { return 2 } default { return 0 } } } proc isDoubleOp {str} { switch -exact -- $str { << - <= - >> - >= - == - != - && - || { return 1 } default { return 0 } } } # isQueryString: returns 1 if the string contains at least one alphabetic # character; 0, otherwise. proc isQueryString {str} { set isOp \ [regexp {^([-~!*/%+<>&^\|\(\)]|<<|>>|<=|>=|==|!=|&&|\|\|)$} $str] set isConstant [regexp {^[+-]?[0-9]+[.]?[0-9]*$} $str] if {!$isOp && !$isConstant} { return 1 } return 0 } proc queryExprCreate {str} { set val "" set hval "" set sval "" set expr "" for {set i 0} {$i < [string length $str]} {incr i} { set c [string index $str $i] if {[string compare $c " "] == 0} { if {[string compare $hval ""] != 0} { lappend expr $hval set hval "" } continue } set val "$val$c" set singleOp [isSingleOp $val] if {$singleOp == 1} { if {[string compare $hval ""] != 0} { lappend expr $hval set hval "" } lappend expr $val set val "" } elseif {$singleOp == 2} { if {[string compare $hval ""] != 0} { lappend expr $hval set hval "" } set sval $val } elseif [isDoubleOp $val] { lappend expr $val set hval "" set val "" set sval "" } else { if {[string compare $sval ""] != 0} { lappend expr $sval set sval "" set hval [string index $val 1] } else { set hval "$hval$val" } set val "" } } if {[string compare $hval ""] != 0} { lappend expr $hval } return $expr } proc fltround {val {precision 2}} { set lenval [string length $val] set inFraction 0 set retval "" for {set i 0} {$i < $lenval} {incr i} { set c [string index $val $i] if {$inFraction} { incr j if {$j > $precision} { break } } if { [string compare $c "."] == 0 } { set inFraction 1 set j 0 } set retval "$retval$c" } return $retval } proc evaluateExpr {expr} { if {[llength $expr] <= 1} { return [join $expr " "] } set newexpr $expr set hasFloat 0 set i 0 set operand [lindex $newexpr 0] while {[string compare $operand ""] != 0} { if {[string compare $operand "/"] == 0} { set k [expr $i + 1] set newexpr [linsert $newexpr $k double (] incr k 2 if { [string compare [lindex $newexpr $k] "("] == 0 } { stackClear foreach o [lrange $newexpr $k end] { if { [string compare $o "("] == 0 } { stackPush "(" } elseif { [string compare $o ")"] == 0 } { stackPop } if {[isStackEmpty]} { break } incr k } } incr k set newexpr [linsert $newexpr $k )] } elseif {[isNumber $operand val]} { set newexpr [lreplace $newexpr $i $i $val] if [isFloat $val] { set hasFloat 1 } } incr i set operand [lindex $newexpr $i] } if {[catch {expr [join $newexpr ""]} val] == 0} { if {$hasFloat} { return [fltround $val] } return [expr round(ceil($val))] } return "" } torque-2.4.16/src/tools/xpbsmon/main.tk0000664000113300011330000002435511272401240014737 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ############################################################################## # # # Main.tk: Contains a series of procedures for building the main application # # window. # # # ############################################################################## proc build_main_window {mainWindow} { global sysinfo frame $mainWindow.menubar -class Plain frame $mainWindow.main -class Plain set sysinfo(main_frame) $mainWindow.main frame $mainWindow.statusbar -class Plain # pack the rest of the frames: hosts, queues, and jobs. pack $mainWindow.menubar $mainWindow.main $mainWindow.statusbar -pady 1 \ -side top -expand 1 -fill both set sysinfo(statusbar_frame) $mainWindow.statusbar fillMenubarFrame $mainWindow.menubar fillStatusbarFrame $mainWindow.statusbar fillMainFrame $mainWindow.main } proc fillMainFrame widget_name { global sysinfo sysnodes displayView $widget_name $sysinfo(systemName) 1 } proc fillStatusbarFrame widget_name { global sysinfo canvas frame $widget_name.header -borderwidth 2 -height 10m -relief raised frame $widget_name.list -borderwidth 3 label $widget_name.header.label -anchor nw \ -text "INFO:" -padx 1 -pady 1 pack $widget_name.header.label -fill both -expand true set sysinfo(infoBox) [lindex [buildFullListbox $widget_name.list \ $sysinfo(infoListBoxWidth)x$sysinfo(infoListBoxHeight) "" xyscroll] 3] pack $widget_name.header $widget_name.list -side left -fill both -expand 1 -padx 0 -pady 0 } proc displayView {frame sitename {init 0}} { global sysinfo sysview if {[string compare $sitename ""] == 0} { return } # if { !$init && [info exists sysinfo(systemName)] && \ # [string compare $sysinfo(systemName) $sitename] == 0} { # return # } systemDelete $sysinfo(systemFrame) set sysinfo(systemFrame) $frame.c_$sitename set sysinfo(systemName) $sitename if { [string compare $sysview($sitename) ICON] == 0 } { iconView 1 } elseif { [string compare $sysview($sitename) FULL] == 0 } { fullView 1 } else { InfoBox_sendmsg "displayView: view type: $sysview($sitename) unknown!" 1 } } ############################################################################### ### MENU BAR Frame procedures # ############################################################################### ### MENU BAR Frame procedures # ############################################################################### proc fillMenubarFrame {widget_name} { global sysinfo canvas bitmap_dir tk_version dialog frame $widget_name.menu -class Plain frame $widget_name.buttons -class Plain menubutton $widget_name.menu.sys -menu $widget_name.menu.sys.m \ -anchor w -text "Site.." -borderwidth 2 -relief raised set sysinfo(sysMenuButton) $widget_name.menu.sys.m menu $sysinfo(sysMenuButton) -borderwidth 2 -relief raised foreach sitename [siteNamesGet] { $sysinfo(sysMenuButton) add radio -label $sitename \ -variable sysinfo(systemName) \ -value $sitename \ -command "displayView $sysinfo(main_frame) $sitename" } if {$tk_version >= 4.0} { $sysinfo(sysMenuButton) configure -tearoff 0 } # pack $widget_name.menu.sys -side left -anchor nw -expand 1 -fill both pack $widget_name.menu.sys -side left -anchor nw -expand 1 -fill both pack $widget_name.menu $widget_name.buttons -side left set cmdButtons [buildCmdButtons $widget_name.buttons \ { { {prefer "Pref.."} } \ { {update_auto "AutoUpdate.."} } \ { {help "Help"} \ {about "About.."} } \ { {close "Close"} } { {iconify ""} \ {maximize ""} } } x 1 10 1 0 0 20] set cmdButtonFrame [lindex $cmdButtons 0] set cmdButtonPref [lindex $cmdButtons 1] set cmdButtonUpdAuto [lindex $cmdButtons 2] set cmdButtonHelp [lindex $cmdButtons 3] set cmdButtonAbout [lindex $cmdButtons 4] set cmdButtonClose [lindex $cmdButtons 5] set cmdButtonIconify [lindex $cmdButtons 6] set cmdButtonMaximize [lindex $cmdButtons 7] $cmdButtonPref configure -width 10 -command {pref $dialog(mainWindow) $dialog(mainWindow)} $cmdButtonUpdAuto configure -width 14 -command {auto_upd} set sysinfo(cmdButtonUpdAuto) $cmdButtonUpdAuto $cmdButtonIconify configure -bitmap @$bitmap_dir/iconize.bmp -padx 1 -pady 1 \ -anchor c -width 14 -height $canvas(bigLabelFontHeight) \ -command {iconView} $cmdButtonMaximize configure -bitmap @$bitmap_dir/maximize.bmp -padx 1 \ -pady 1 -anchor c -width 14 -height $canvas(bigLabelFontHeight) \ -command {fullView} $cmdButtonHelp configure -command { xpbs_help main ""} $cmdButtonAbout configure -command { about } $cmdButtonClose configure -command { prefSaveSitesInfo if [prefDoIt] { prefsave } exit } } proc iconView {{force 0}} { global canvas sysinfo sysview if {[string compare $sysinfo(systemFrame) ""] == 0 || \ [string compare $sysinfo(systemName) ""] == 0} { return } if {!$force && \ [string compare $sysview($sysinfo(systemName)) ICON] == 0} { return } set sysview($sysinfo(systemName)) ICON if [winfo exists $sysinfo(systemFrame)] { systemNodesReCreate $sysinfo(systemFrame) } else { systemNodesCreate $sysinfo(systemFrame) $sysinfo(systemName) after 1000 systemPopulateNodesWithInfo $sysinfo(systemFrame) 1 } } proc fullView {{force 0}} { global canvas sysinfo sysview if {[string compare $sysinfo(systemFrame) ""] == 0 || \ [string compare $sysinfo(systemName) ""] == 0} { return } if {!$force && \ [string compare $sysview($sysinfo(systemName)) FULL] == 0} { return } set sysview($sysinfo(systemName)) FULL if [winfo exists $sysinfo(systemFrame)] { systemNodesReCreate $sysinfo(systemFrame) } else { systemNodesCreate $sysinfo(systemFrame) $sysinfo(systemName) after 1000 systemPopulateNodesWithInfo $sysinfo(systemFrame) 1 } } torque-2.4.16/src/tools/xpbsmon/wmgr.tk0000664000113300011330000001137111272401240014761 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains window manager settings for manipulating the # top-level windows. # # Info: # Relative position of pixels on the display screen # # (+x,+y) o-----------o (-x,+y) # | | # | | # (+x,-y) o-----------o (-x,-y) # ################################################################################ proc set_wmgr {top_level_win} { global appname ;# the name of the application global bitmap_dir wm title $top_level_win $appname wm iconbitmap $top_level_win @$bitmap_dir/cyclist-only.xbm wm protocol $top_level_win WM_DELETE_WINDOW { if [prefDoIt] { prefsave } exit } } torque-2.4.16/src/tools/xpbsmon/Makefile.in0000664000113300011330000005047111605403772015532 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(dist_xpbsmon_DATA) $(dist_xpbsmonbitmap_DATA) \ $(dist_xpbsmonhelp_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/buildutils/config.mk subdir = src/tools/xpbsmon ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(xpbsmondir)" \ "$(DESTDIR)$(xpbsmonbitmapdir)" "$(DESTDIR)$(xpbsmonhelpdir)" \ "$(DESTDIR)$(xpbsmondir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; dist_xpbsmonDATA_INSTALL = $(INSTALL_DATA) dist_xpbsmonbitmapDATA_INSTALL = $(INSTALL_DATA) dist_xpbsmonhelpDATA_INSTALL = $(INSTALL_DATA) nodist_xpbsmonDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_xpbsmon_DATA) $(dist_xpbsmonbitmap_DATA) \ $(dist_xpbsmonhelp_DATA) $(nodist_xpbsmon_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter xpbsmondir = $(XPBSMON_DIR) xpbsmonbitmapdir = $(xpbsmondir)/bitmaps xpbsmonhelpdir = $(xpbsmondir)/help SUFFIXES = .src bin_SCRIPTS = xpbsmon nodist_xpbsmon_DATA = xpbsmonrc tclIndex CLEANFILES = xpbsmon xpbsmonrc tclIndex buildindex EXTRA_DIST = xpbsmon.src xpbsmonrc.src patch_scripts buildindex.src dist_xpbsmon_DATA = preferences.tcl auto_upd.tk bindings.tk box.tk button.tk \ cluster.tk color.tk common.tk dialog.tk entry.tk expr.tk \ listbox.tk main.tk node.tk pbs.tk prefsave.tk pref.tk \ spinbox.tk system.tk wmgr.tk dist_xpbsmonbitmap_DATA = bitmaps/cyclist-only.xbm bitmaps/hourglass.bmp \ bitmaps/iconize.bmp bitmaps/logo.bmp \ bitmaps/maximize.bmp dist_xpbsmonhelp_DATA = help/auto_update.hlp help/main.hlp help/notes.hlp \ help/pref.hlp help/prefQuery.hlp help/prefServer.hlp all: all-am .SUFFIXES: .SUFFIXES: .src $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tools/xpbsmon/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/tools/xpbsmon/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-dist_xpbsmonDATA: $(dist_xpbsmon_DATA) @$(NORMAL_INSTALL) test -z "$(xpbsmondir)" || $(mkdir_p) "$(DESTDIR)$(xpbsmondir)" @list='$(dist_xpbsmon_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_xpbsmonDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbsmondir)/$$f'"; \ $(dist_xpbsmonDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbsmondir)/$$f"; \ done uninstall-dist_xpbsmonDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xpbsmon_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbsmondir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsmondir)/$$f"; \ done install-dist_xpbsmonbitmapDATA: $(dist_xpbsmonbitmap_DATA) @$(NORMAL_INSTALL) test -z "$(xpbsmonbitmapdir)" || $(mkdir_p) "$(DESTDIR)$(xpbsmonbitmapdir)" @list='$(dist_xpbsmonbitmap_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_xpbsmonbitmapDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbsmonbitmapdir)/$$f'"; \ $(dist_xpbsmonbitmapDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbsmonbitmapdir)/$$f"; \ done uninstall-dist_xpbsmonbitmapDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xpbsmonbitmap_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbsmonbitmapdir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsmonbitmapdir)/$$f"; \ done install-dist_xpbsmonhelpDATA: $(dist_xpbsmonhelp_DATA) @$(NORMAL_INSTALL) test -z "$(xpbsmonhelpdir)" || $(mkdir_p) "$(DESTDIR)$(xpbsmonhelpdir)" @list='$(dist_xpbsmonhelp_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_xpbsmonhelpDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbsmonhelpdir)/$$f'"; \ $(dist_xpbsmonhelpDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbsmonhelpdir)/$$f"; \ done uninstall-dist_xpbsmonhelpDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xpbsmonhelp_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbsmonhelpdir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsmonhelpdir)/$$f"; \ done install-nodist_xpbsmonDATA: $(nodist_xpbsmon_DATA) @$(NORMAL_INSTALL) test -z "$(xpbsmondir)" || $(mkdir_p) "$(DESTDIR)$(xpbsmondir)" @list='$(nodist_xpbsmon_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(nodist_xpbsmonDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbsmondir)/$$f'"; \ $(nodist_xpbsmonDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbsmondir)/$$f"; \ done uninstall-nodist_xpbsmonDATA: @$(NORMAL_UNINSTALL) @list='$(nodist_xpbsmon_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbsmondir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsmondir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils $(distdir)/bitmaps $(distdir)/help @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(xpbsmondir)" "$(DESTDIR)$(xpbsmonbitmapdir)" "$(DESTDIR)$(xpbsmonhelpdir)" "$(DESTDIR)$(xpbsmondir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dist_xpbsmonDATA \ install-dist_xpbsmonbitmapDATA install-dist_xpbsmonhelpDATA \ install-nodist_xpbsmonDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-binSCRIPTS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-dist_xpbsmonDATA \ uninstall-dist_xpbsmonbitmapDATA \ uninstall-dist_xpbsmonhelpDATA uninstall-info-am \ uninstall-nodist_xpbsmonDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am \ install-data-hook install-dist_xpbsmonDATA \ install-dist_xpbsmonbitmapDATA install-dist_xpbsmonhelpDATA \ install-exec install-exec-am install-info install-info-am \ install-man install-nodist_xpbsmonDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-binSCRIPTS uninstall-dist_xpbsmonDATA \ uninstall-dist_xpbsmonbitmapDATA \ uninstall-dist_xpbsmonhelpDATA uninstall-hook \ uninstall-info-am uninstall-nodist_xpbsmonDATA xpbsmon: $(srcdir)/xpbsmon.src sed -e 's,#\!.*pbs_wish.*$$,#\!$(bindir)/$(program_prefix)pbs_wish$(program_suffix) -f,' \ -e 's,set *libdir.*$$,set libdir $(xpbsmondir),' \ -e 's,set *appdefdir.*$$,set appdefdir $(xpbsmondir),' \ $? > $@ xpbsmonrc: $(srcdir)/xpbsmonrc.src $(SHELL) $(srcdir)/patch_scripts "$(PBS_MACH)" "$(PBS_DEFAULT_SERVER)" "$?" "$@" buildindex: $(srcdir)/buildindex.src @echo Processing buildindex @sed -e 's,#\!.*tclsh.*$$,#\!@TCLSH_PROG@,' $? > $@ @chmod +x $@ tclIndex: $(dist_xpbs_DATA) buildindex @echo Running buildindex \(locally\) @./buildindex $(srcdir) . install-data-hook: $(INSTALL_SCRIPT) buildindex $(DESTDIR)$(XPBSMON_DIR)/buildindex rm -f $(DESTDIR)$(XPBSMON_DIR)/tclIndex cd $(DESTDIR)$(XPBSMON_DIR) && ./buildindex $(DESTDIR)$(XPBSMON_DIR) . $(DESTDIR) chmod 644 tclIndex uninstall-hook: rm -f $(DESTDIR)$(XPBS_DIR)/buildindex # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/tools/xpbsmon/box.tk0000664000113300011330000004557411272401240014611 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # NOTE: we restrict to one element keys only for efficiency! proc box {frame_name {args}} { set boxName [string trim $frame_name "."] global $boxName canvas sysinfo set configure 0 set argc [llength $args] for {set i 0} {$i < $argc} {incr i} { switch -exact -- [lindex $args $i] { configure { set configure 1 } -title { set [set boxName](title) [lindex $args [incr i]] } title { if { ![info exists [set boxName](title)]} { return "" } return [set [set boxName](title)] } -class { set [set boxName](class) [lindex $args [incr i]] } class { if { ![info exists [set boxName](class)]} { return Plain } return [set [set boxName](class)] } titlelabel { if { ![info exists [set boxName](titlelabel)]} { return "" } return [set [set boxName](titlelabel)] } -key { set [set boxName](key) [lindex $args [incr i]] } key { if { ![info exists [set boxName](key)]} { return 0 } return [set [set boxName](key)] } -entrylabels { set [set boxName](entrylabels) [lindex $args [incr i]] } entrylabels { if { ![info exists [set boxName](entrylabels)]} { return "" } return [set [set boxName](entrylabels)] } -lboxlabels { set [set boxName](lboxlabels) [lindex $args [incr i]] } lboxlabels { if { ![info exists [set boxName](lboxlabels)]} { return "" } return [set [set boxName](lboxlabels)] } -lboxwidths { set [set boxName](lboxwidths) [lindex $args [incr i]] } lboxwidths { if { ![info exists [set boxName](lboxwidths)]} { return 0 } return [set [set boxName](lboxwidths)] } -lboxheights { set [set boxName](lboxheights) [lindex $args [incr i]] } lboxheights { if { ![info exists [set boxName](lboxheights)]} { return 0 } return [set [set boxName](lboxheights)] } -orient { set [set boxName](orient) [lindex $args [incr i]] } orient { if { ![info exists [set boxName](orient)]} { return "x" } return [set [set boxName](orient)] } -grabBox { set [set boxName](grabBox) [lindex $args [incr i]] } grabBox { if { ![info exists [set boxName](grabBox)]} { return "" } return [set [set boxName](grabBox)] } -selindex { set [set boxName](selindex) [lindex $args [incr i]] } selindex { if { ![info exists [set boxName](selindex)]} { return -1 } return [set [set boxName](selindex)] } vscroll { if { ![info exists [set boxName](vscroll)]} { return "" } return [set [set boxName](vscroll)] } ncols { if { ![info exists [set boxName](ncols)]} { return 1 } return [set [set boxName](ncols)] } -nrows { set lbox [box $frame_name lbox 0] if { [string compare $lbox ""] != 0 } { set [set boxName](nrows) [$lbox size] } incr [set boxName](nrows) [lindex $args [incr i]] return [set [set boxName](nrows)] } nrows { set lbox [box $frame_name lbox 0] if { [string compare $lbox ""] == 0 } { return 0 } set [set boxName](nrows) [$lbox size] return [set [set boxName](nrows)] } lbox { set index [lindex $args [incr i]] if {![info exists [set boxName](lbox,$index)]} { return "" } return [set [set boxName](lbox,$index)] } entry { set index [lindex $args [incr i]] if {![info exists [set boxName](entry,$index)]} { return "" } return [set [set boxName](entry,$index)] } -entryval { set index [lindex $args [incr i]] set eval [lindex $args [incr i]] set [set boxName](entryval,$index) $eval return [set [set boxName](entryval,$index)] } entryval { set index [lindex $args [incr i]] if {![info exists [set boxName](entryval,$index)]} { return "" } return [set [set boxName](entryval,$index)] } -entryvalDeleted { set [set boxName](entryvalDeleted) [lindex $args [incr i]] return } entryvalDeleted { if { ![info exists [set boxName](entryvalDeleted)]} { return "" } return [set [set boxName](entryvalDeleted)] } -noUpdateButton { set [set boxName](noUpdateButton) [lindex $args [incr i]] } noUpdateButton { if { ![info exists [set boxName](noUpdateButton)]} { return 0 } return [set [set boxName](noUpdateButton)] } -addCmd { set [set boxName](addCmd) [lindex $args [incr i]] } addCmd { if { ![info exists [set boxName](addCmd)]} { return "" } return [set [set boxName](addCmd)] } -remCmd { set [set boxName](remCmd) [lindex $args [incr i]] } remCmd { if { ![info exists [set boxName](remCmd)]} { return "" } return [set [set boxName](remCmd)] } updateButton { if { ![info exists [set boxName](updateButton)]} { return "" } return [set [set boxName](updateButton)] } create { catch {unset $boxName} } unset { catch {unset $boxName} return } getBoxArray { return "[set boxName]" } } } # create one frame to hold everything set f [frame $frame_name -class [box $frame_name class]] if { ![info exists sysinfo(boxes)] || \ [lsearch -exact $sysinfo(boxes) $f] == -1 } { lappend sysinfo(boxes) $f } $f configure -relief ridge -borderwidth 2 frame $f.t -class CmdFrame -relief raised -borderwidth 2 frame $f.b -relief flat frame $f.b.e -relief flat frame $f.b.l -relief ridge -bd 4 frame $f.b.b -relief flat label $f.t.label -text [box $f title] -justify center pack $f.t.label -anchor nw -side left -expand 1 -fill both set [set boxName](titlelabel) $f.t.label ## build the entry widget ## build the add button button $f.b.e.add -text add -height 2 \ -command "boxAdd $f \"[box $f addCmd]\"" if {[string compare [box $f orient] x] == 0} { pack $f.b.e.add -side right -anchor c -pady 1m } else { pack $f.b.e.add -side bottom -anchor c -pady 1m } set k 0 set packlist "" set entrylabels [box $f entrylabels] set lboxwidths [box $f lboxwidths] set lboxheights [box $f lboxheights] foreach labelinfo $entrylabels { set elabel [lindex $labelinfo 0] set type [lindex $labelinfo 1] set args [lrange $labelinfo 2 end] frame $f.b.e.$k switch -exact -- $type { MENU_ENTRY { menuEntry $f.b.e.$k create -menuvalues $args -title $elabel \ -textvariable [set boxName](entryval,$k) set [set boxName](entry,$k) "" } default { set lboxwidth [lindex $lboxwidths $k] set einfo [buildFullEntrybox $f.b.e.$k [string length $elabel] \ $elabel $lboxwidth "" bottom 0 top right 0 c] set eframew [lindex $einfo 0] set elabelw [lindex $einfo 1] set eentryw [lindex $einfo 2] global sel$eentryw set sel$eentryw 0 $eentryw configure -textvariable [set boxName](entryval,$k) $elabelw configure -anchor nw set [set boxName](entry,$k) $eentryw bind_entry_overselect $eentryw register_default_action $eentryw $f.b.e.add } } set packlist "$packlist $f.b.e.$k" incr k } set [set boxName](ncols) $k set [set boxName](nrows) 0 if {[string compare packlist ""] != 0} { eval pack [string trim $packlist] -side left -anchor nw } boxSetTabbing $f # build the listbox set packlist "" set k 0 set lboxlabels [box $f lboxlabels] set llen [llength $lboxlabels] foreach llabel $lboxlabels { frame $f.b.l.$k set lboxwidth [lindex $lboxwidths $k] set lboxheight [lindex $lboxheights $k] if {[expr $k + 1] != $llen} { set listBoxInfo [buildFullListbox $f.b.l.$k \ ${lboxwidth}x${lboxheight} $llabel xscroll 0 0 0] } else { set listBoxInfo [buildFullListbox $f.b.l.$k \ ${lboxwidth}x${lboxheight} $llabel xyscroll 0 0 0] set [set boxName](vscroll) [lindex $listBoxInfo 4] } set hostsListbox [lindex $listBoxInfo 3] set hostsListboxSelButton [lindex $listBoxInfo 2] set hostsListboxLabel [lindex $listBoxInfo 1] bind_listbox_single_select $hostsListbox bind_listbox_select $hostsListbox $f set [set boxName](lbox,$k) $hostsListbox set packlist "$packlist $f.b.l.$k" incr k } if {[string compare packlist ""] != 0} { eval pack [string trim $packlist] -side left -anchor nw } boxSetScroll $f ## build the buttons set noUpdateButton [box $f noUpdateButton] if {$noUpdateButton} { set buttonList [list {delete "delete"}] } else { set buttonList [list {delete "delete"} {info "update"}] } set cmdButtons [buildCmdButtons $f.b.b [list $buttonList] y 0 11 1 1 0 0] set cmdButtonFrame [lindex $cmdButtons 0] set cmdButtonDelete [lindex $cmdButtons 1] if {!$noUpdateButton} { set cmdButtonUpd [lindex $cmdButtons 2] set [set boxName](updateButton) $cmdButtonUpd } $cmdButtonDelete configure -command "boxDelete $f \"[box $f remCmd]\"" set fwidth [expr [lindex [$hostsListbox configure -height] end]*$canvas(bigLabelFontHeight)] if {[string compare [box $f orient] x] == 0} { pack $f.b.e -pady [expr $fwidth/2] -padx 0 -side left -anchor nw pack $f.b.l $f.b.b -side left -anchor nw \ -padx $canvas(bigLabelFontWidth) } else { pack $f.b.e -side top -anchor nw -pady 0 -padx 0 pack $f.b.l $f.b.b -side left -after $f.b.e -pady 3m -anchor nw -padx 0 } pack $f.t -anchor nw -side top -fill both -expand 1 pack $f.b -anchor nw -side top -fill none -expand 0 } proc boxesUnset {} { global sysinfo if [info exists sysinfo(boxes)] { foreach b $sysinfo(boxes) { box $b unset } } set sysinfo(boxes) "" } proc boxAdd {frame_name {addfunc ""}} { global tk_version dialog set entrylabels [box $frame_name entrylabels] set keylist [box $frame_name key] set ncols [box $frame_name ncols] set keyval "" set keys "" for {set i 0} {$i < $ncols} {incr i} { box $frame_name -entryval $i \ [cleanstr [box $frame_name entryval $i]] set kindex [lsearch -regexp $keylist "(^| )$i"] if {$kindex != -1} { set entryval [box $frame_name entryval $i] if {[string compare $entryval ""] == 0} { set entrylab [lindex $entrylabels $i] set entryw [box $frame_name entry $i] popupInfoBox [box $frame_name grabBox] \ "Can't have an empty \"$entrylab\" entry!!!" \ 500 $entryw return } set klist [split [lindex $keylist $kindex] ":"] set k [lindex $klist 0] lappend keys $k set kmatchval [lindex $klist 1] lappend keyval $entryval if {[string compare $kmatchval ""] != 0 && \ [regexp "^($kmatchval)$" $entryval]} { set kunique($k) 1 } else { set kunique($k) 0 } } } set nrows [box $frame_name nrows] for {set i 0} {$i < $nrows} {incr i} { set boxval "" for {set j 0} {$j < $ncols} {incr j} { if {[lsearch -exact $keys $j] != -1} { set entryv [box $frame_name entryval $j] set entryw [box $frame_name entryval $j] set lbox [box $frame_name lbox $j] if {$kunique($j)} { if {![lboxvalue_isUnique $lbox $entryv]} { popupInfoBox [box $frame_name grabBox] \ "\"$entryv\" already specified in one of the fields!" 500 $entryw return } } lappend boxval [$lbox get $i] } } if {[lcomp $keyval $boxval] == 0} { popupInfoBox [box $frame_name grabBox] \ "Unable to add entry: key \"[concat $keyval]\" was duplicated!" 500 [box $frame_name entry 0] return } } for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] set entry [box $frame_name entry $i] global sel$entry $lbox insert end [box $frame_name entryval $i] set sel$entry 1 } box $frame_name -nrows +1 boxSelect $frame_name end if {[string compare $addfunc ""] != 0} { eval $addfunc } } proc boxDelete {frame_name {remfunc ""}} { for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] set selindex [$lbox curselection] if {[string compare $selindex ""] != 0} { box $frame_name -entryvalDeleted [$lbox get $selindex] $lbox delete $selindex boxSelect $frame_name $selindex } } box $frame_name -nrows -1 if {[string compare $remfunc ""] != 0} { eval $remfunc } } proc boxGetCurselect {frame_name index} { set selindex [box $frame_name selindex] if {$selindex == -1} { return } set lbox [box $frame_name lbox $index] catch {$lbox get $selindex} value return $value } proc boxSelect {frame_name index} { global tk_version set nrows [box $frame_name nrows] if { $index == -1 } { set lbox [box $frame_name lbox 0] global cmd$lbox if [info exists cmd$lbox] { eval [set cmd$lbox] } return } set boxName [box $frame_name getBoxArray] global $boxName set [set boxName](selindex) $index set selindex $index for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] set entry [box $frame_name entry $i] if { $tk_version < 4.0 } { $lbox select from $selindex } else { catch {$lbox selection clear [$lbox curselection]} $lbox select set $selindex $selindex } set boxval [$lbox get $selindex] if {[string compare $boxval ""] != 0} { box $frame_name -entryval $i $boxval } if {$i == 0 && [string compare $entry ""] != 0} { focus $entry $entry select from 0 $entry select to end if {$tk_version >= 4.0} { $entry xview moveto 1 } } global cmd$lbox if [info exists cmd$lbox] { eval [set cmd$lbox] } } } proc boxSetScroll {frame_name} { global tk_version set vscroll [box $frame_name vscroll] if {[string compare $vscroll ""] == 0} { return } set lboxes "" for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] $lbox configure -yscrollcommand "$vscroll set" lappend lboxes $lbox } $vscroll configure -command "boxAdjScrollView [list $lboxes]" } proc boxSetTabbing {f} { for {set i 0} {$i < [box $f ncols]} {incr i} { set entry [box $f entry $i] if {[string compare $entry ""] == 0} { continue } set nentry [box $f entry [expr $i+1]] if {[string compare $nentry ""] == 0} { set nentry $entry } set pentry [box $f entry [expr $i-1]] if {[string compare $pentry ""] == 0} { set pentry $entry } bind_entry_tab $entry $nentry $pentry } } proc boxAdjScrollView {args} { set lboxes [lindex $args 0] set params [lrange $args 1 end] foreach b $lboxes { eval $b yview $params } } torque-2.4.16/src/tools/xpbsmon/buildindex.src0000775000113300011330000001345111272401240016311 00000000000000#!/usr/bin/pbs_tclsh # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # # this builds an index for a Tcl/Tk directory after checking the age # of files. The first argument is the directory where the Tcl/Tk files # are found and the second optional argument is where the tclIndex # file should end up. Normally the second arg defaults to be the same # as the first. This is to support separate src and build trees. # # an optional 3rd arg has been added to be the destdir # set libdir [lindex $argv 0] if {$argc == 3} { set tclIndex_dir [lindex $argv 1] set destdir [lindex $argv 2] set havedestdir 1 } else { set havedestdir 0 if {$argc == 2} { set tclIndex_dir [lindex $argv 1] } else { if {$argc == 1} { set tclIndex_dir $libdir } else { puts "$argv0 libpath [tclIndex_dir]" exit 1 } } } if { ![file exists $tclIndex_dir/tclIndex] } { set doit 1 } else { set age [file mtime $tclIndex_dir/tclIndex] set doit 0 if {[file mtime $libdir] > $age} { set doit 1 } else { foreach file [glob $libdir/*.tcl $libdir/*.tk] { if {[file mtime $file] > $age} { set doit 1 break } } } } if { $doit } { puts -nonewline "Running auto_mkindex..." auto_mkindex $tclIndex_dir $libdir/*.{tk,tcl} set f [open tclIndex] while {[gets $f line] >= 0} { set res [regsub {\$dir//} $line {/} match] append entry "$match\n" } close $f set f [open tclIndex w] puts $f $entry close $f puts "done" if { $havedestdir } { regsub -all {/} $libdir { } libdir_ regsub -all {/} $destdir { } destdir_ set f [open tclIndex] while {[gets $f line] >= 0} { set res [regsub $destdir_ $line {} match] append entry_ "$match\n" } close $f set f [open tclIndex w] puts $f $entry_ close $f } } exit 0 torque-2.4.16/src/tools/xpbsmon/entry.tk0000664000113300011330000003411611272401240015150 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains procedures related to entry widgets used in xpbs. ################################################################################ # buildFullEntrybox: builds one of the following entry boxes and display it on # the 'frame_name' specified. # ----------- # (1) label | | <|=|> mode: right horizontal scrollbar # ----------- no all button # # ----------- # (2) label [all] | | <|=|> mode: right horizontal scrollbar # ----------- all button # # # ----------- # (3) label | | mode: bottom horiz. scrollbar # ----------- no all button # <|=======|> # # # ----------- # (4) label [all] | | mode: bottom horiz. scrollbar # ----------- all button # <|=======|> # OPTION: # The 'label_placement' allows for the label to be set "left", "right", # "top", and "bottom". # RETURNS: a list containing the frame holding the full entry box, # all_button (if any) label, entry, scrollbar widget names. proc buildFullEntrybox {frame_name label_width label entry_width \ default_entryval scrollbar_placement all_button \ {label_placement "left"} {all_button_placement "left"} \ {ipadx 1m} {anchor nw}} { global canvas tk_version frame $frame_name.l -relief flat frame $frame_name.e -relief flat if {$all_button} { button $frame_name.e.all -width 4 -text "all" -padx 1 -pady 1 -justify left } label $frame_name.l.label -width $label_width -text $label -padx 1 -pady 1 \ -justify left entry $frame_name.e.entry -relief sunken \ -borderwidth 2 \ -width $entry_width if { $tk_version < 4.0 } { $frame_name.e.entry configure -scrollcommand "$frame_name.e.hscroll set" } else { $frame_name.e.entry configure -xscrollcommand "$frame_name.e.hscroll set" } $frame_name.e.entry insert 0 $default_entryval bind_entry_overselect $frame_name.e.entry if { [string compare $scrollbar_placement ""] != 0 } { scrollbar $frame_name.e.hscroll -orient horizontal \ -borderwidth 2 \ -relief groove if { $tk_version < 4.0 } { $frame_name.e.hscroll configure -command "$frame_name.e.entry view" } else { $frame_name.e.hscroll configure -command "$frame_name.e.entry xview" } } if {$all_button && [string compare $all_button_placement "left"] == 0 && \ [string compare $scrollbar_placement "right"] == 0} { pack $frame_name.e.all $frame_name.e.entry \ $frame_name.e.hscroll -side left -anchor nw -ipadx $ipadx -fill x } elseif {$all_button && \ [string compare $all_button_placement "right"] == 0 && \ [string compare $scrollbar_placement "right"] == 0} { pack $frame_name.e.entry $frame_name.e.hscroll $frame_name.e.all \ -side left -anchor nw -ipadx $ipadx -fill x } elseif {$all_button && \ [string compare $all_button_placement "bottom"] == 0 && \ [string compare $scrollbar_placement "right"] == 0} { pack $frame_name.e.all -side bottom -anchor nw pack $frame_name.e.entry $frame_name.e.hscroll -side left -anchor nw } elseif {$all_button && \ [string compare $all_button_placement "left"] == 0 && \ [string compare $scrollbar_placement "bottom"] == 0} { pack $frame_name.e.all $frame_name.e.entry -side left -anchor nw -fill x pack $frame_name.e.hscroll -side bottom -fill x -expand 1 } elseif {$all_button && \ [string compare $all_button_placement "right"] == 0 && \ [string compare $scrollbar_placement "bottom"] == 0} { pack $frame_name.e.hscroll -side bottom -fill x -expand 1 pack $frame_name.e.entry $frame_name.e.all -side left -anchor nw -fill x } elseif {!$all_button && \ [string compare $scrollbar_placement "right"] == 0} { pack $frame_name.e.entry $frame_name.e.hscroll \ -side left -anchor nw -ipadx $ipadx -fill x } elseif {!$all_button && \ [string compare $scrollbar_placement "bottom"] == 0} { pack $frame_name.e.entry -side left -anchor nw -fill x -expand 1 pack $frame_name.e.hscroll -before $frame_name.e.entry -side bottom \ -fill x -expand 1 -anchor nw } elseif {!$all_button && \ [string compare $scrollbar_placement "left"] == 0} { pack $frame_name.e.hscroll $frame_name.e.entry -side left -anchor nw \ -ipadx $ipadx -fill x } elseif {$all_button && \ [string compare $all_button_placement "left"] == 0 && \ [string compare $scrollbar_placement "left"] == 0} { pack $frame_name.e.all $frame_name.e.hscroll $frame_name.e.entry \ -side left -anchor nw -ipadx $ipadx -fill x } elseif {$all_button && \ [string compare $all_button_placement "right"] == 0 && \ [string compare $scrollbar_placement "left"] == 0} { pack $frame_name.e.hscroll $frame_name.e.entry $frame_name.e.all \ -side left -anchor nw -ipadx $ipadx -fill x } else { pack $frame_name.e.entry -side left -anchor nw -fill x if {$tk_version < 4.0} { $frame_name.e.entry configure -scrollcommand "" } else { $frame_name.e.entry configure -xscrollcommand "" } } if {$label_width > 0} { if {[string compare $label_placement "left"] == 0} { pack $frame_name.l.label -anchor $anchor -side left pack $frame_name.l $frame_name.e -side left -anchor $anchor } elseif {[string compare $label_placement "right"] == 0} { pack $frame_name.l.label -anchor $anchor -side left pack $frame_name.e $frame_name.l -side left -anchor $anchor } elseif {[string compare $label_placement "top"] == 0} { pack $frame_name.l.label -anchor $anchor -side left pack $frame_name.l $frame_name.e -side top -anchor $anchor } elseif {[string compare $label_placement "bottom"] == 0} { pack $frame_name.l.fill $frame_name.l.label -anchor $anchor -side left pack $frame_name.e $frame_name.l -side top -anchor $anchor } } else { pack $frame_name.e } if {$all_button} { return [list $frame_name $frame_name.l.label $frame_name.e.all \ $frame_name.e.entry $frame_name.e.hscroll $frame_name.e] } else { return [list $frame_name $frame_name.l.label $frame_name.e.entry \ $frame_name.e.hscroll $frame_name.e] } } # disable_fullentry: disables all components of an entry box. proc disable_fullentry {entryLabel entry entryScroll {allButton ""}} { global sysinfo canvas if {[string compare $entryLabel ""] != 0} { disable_label $entryLabel $canvas(disabledColor) } if {[string compare $entryScroll ""] != 0} { disable_scrollbar $entryScroll $canvas(disabledColor) } if {[string compare $allButton ""] != 0} { disable_button $allButton } set state [lindex [$entry configure -state] 4] if {[string compare $state "disabled"] != 0} { set sysinfo(selColor$entry) [lindex [$entry configure -foreground] 4] $entry configure -state disabled -foreground $canvas(disabledColor) } } # enable_fullentry: enables all components of an entry box. proc enable_fullentry {entryLabel entry entryScroll {allButton ""}} { global syinfo if {[string compare $entryLabel ""] != 0} { enable_label $entryLabel } if {[string compare $entryScroll ""] != 0} { enable_scrollbar $entryScroll } if {[string compare $allButton ""] != 0} { enable_button $allButton } if [info exists sysinfo(selColor$entry)] { $entry configure -state normal -foreground $sysinfo(selColor$entry) } else { $entry configure -state normal } focus $entry } proc menuEntry {frame_name {args}} { set menuName [string trim $frame_name "."] global $menuName canvas tk_version set configure 0 set argc [llength $args] for {set i 0} {$i < $argc} {incr i} { switch -exact -- [lindex $args $i] { configure { set configure 1 } menubutton { if { ![info exists [set menuName](menubutton)]} { return "" } return [set [set menuName](menubutton)] } -menuvalues { set [set menuName](menuvalues) [lindex $args [incr i]] } menuvalues { if { ![info exists [set menuName](menuvalues)]} { return "" } return [set [set menuName](menuvalues)] } -title { set [set menuName](title) [lindex $args [incr i]] } title { if { ![info exists [set menuName](title)]} { return "" } return [set [set menuName](title)] } -textvariable { set [set menuName](textvariable) [lindex $args [incr i]] } create { catch {unset $menuName} } getMenuArray { return "[set menuName]" } } } global [set [set menuName](textvariable)] set [set [set menuName](textvariable)] " " set f $frame_name set label [menuEntry $f title] label $frame_name.l -width [string length $label] -text $label -padx 1 \ -pady 1 -justify left menubutton $f.m -relief raised -bd 2 -anchor w -menu $f.m.menu \ -textvariable [set [set menuName](textvariable)] set [set menuName](menubutton) $f.m menu $f.m.menu -borderwidth 2 -relief raised if {$tk_version >= 4.0} { $f.m configure -indicatoron 1 $f.m.menu configure -tearoff 0 } bind_button1 $f.m.menu set maxwidth 0 set k 0 foreach v [menuEntry $f menuvalues] { set width [string length $v] if {$width > $maxwidth} { set maxwidth $width } $f.m.menu add command -label $v \ -command "set [set [set menuName](textvariable)] $v" incr k } $f.m.menu invoke 0 $f.m configure -width $maxwidth pack $f.l $f.m -side top -anchor nw } torque-2.4.16/src/tools/xpbsmon/dialog.tk0000664000113300011330000002746711272401240015261 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # popupDialogBox: A popupDialogBox creates the standard dialog box used by the GUI on # the toplevel named 'dialog_top' to be named 'title'. It # creates 2 frames: top frame (to be populated by widgets) and # bottom frame (to be populated by command buttons). # RETURNS: a list with 2 items: top_frame_name and bottom_frame_name. # OPTIONS: 'grab_window' says to set a grab on 'dialog_top'. # 'class' is the class name to associate 'dialog_top'. # 'master' specifies that the dialog box is working on behalf of # some 'master' window. proc popupDialogBox {dialog_top title {grab_window 1} {class Plain} {master ""} {precisePlace 0} } { global activeWindow bitmap_dir dialog coordX coordY if {[string compare $class ""] == 0} { toplevel $dialog_top } else { toplevel $dialog_top -class $class } wm title $dialog_top $title if {$precisePlace} { if { [info exists coordX] && [info exists coordY] } { wm geometry $dialog_top "+$coordX+$coordY" } } if {$grab_window} { catch {grab $dialog_top} grab_msg if { [string compare $grab_msg ""] != 0 } { tkwait visibility $dialog_top catch {grab $dialog_top} grab_msg if { [string compare $grab_msg ""] != 0 } { InfoBox_sendmsg "Grabbing $dialog_top got: $grab_msg" 2 } } } focus $dialog_top frame $dialog_top.top -borderwidth 4 -relief ridge frame $dialog_top.bottom -borderwidth 2 -relief raised -class CmdFrame pack $dialog_top.top $dialog_top.bottom -side top -fill both -expand 1 if { [string compare $master ""] != 0 } { wm transient $dialog_top $master } else { wm transient $dialog_top $dialog(mainWindow) } return [list $dialog_top.top $dialog_top.bottom] } # popupInfoBox: pops up a dialog box informing the user of some 'msg'. # 'callerDialogBox' is for returning the the input focus to the calling dialog # box. # OPTIONS: # 'width_pixels' is the size of the info box. proc popupNodeInfoBox {callerDialogBox nodeframe nodename nodeType clusterSrc \ {focusBox ""} } { global dialog canvas nodeStatus activeWindow \ nodeMirrorFrame set dialog(nodeInfoBox) ".nodeinfo" set activeWindow($dialog(nodeInfoBox)) 1 if [winfo exists $dialog(nodeInfoBox)] { return } set dbox [popupDialogBox $dialog(nodeInfoBox) "Node Info Dialog" 1 Plain] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] set delim [string last "," $nodename] if {$delim == -1} { set nodelabel $nodename } else { incr delim set nodelabel [string range $nodename $delim end] } nodeCreate $dbox_top.n $nodename $nodelabel $clusterSrc $nodeType MIRROR set sysframe [clusterSystemFrameGet [nodeClusterFrameGet $nodeframe]] set nodeinfo [systemNodeInfoGet $sysframe $nodename] if {[string compare $nodeinfo ""] != 0} { nodeDisplayInfo $dbox_top.n $nodeinfo 1 } else { nodeColorIt $dbox_top.n $nodename } set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $dialog(nodeInfoBox)] register_default_action $dialog(nodeInfoBox) $ok_button tkwait window $dialog(nodeInfoBox) set activeWindow($dialog(nodeInfoBox)) 0 catch {focus $focusBox} catch {grab $callerDialogBox} nodeDelete $dbox_top.n } # popupInfoBox: pops up a dialog box informing the user of some 'msg'. # 'callerDialogBox' is for returning the the input focus to the calling # dialog box. # OPTIONS: # 'width_pixels' is the size of the info box. proc popupInfoBox {callerDialogBox msg {width_pixels 500} {focusBox ""}} { global canvas dialog activeWindow set dialog(infoBox) ".info" set activeWindow($dialog(infoBox)) 1 if [winfo exists $dialog(infoBox)] { return } set dbox [popupDialogBox $dialog(infoBox) "Info Dialog" 1 Plain \ $callerDialogBox] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -justify left \ -width $width_pixels \ -text "\n\n\n\t$msg\n" pack $dbox_top.msg -padx 3m -pady 3m set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $dialog(infoBox)] register_default_action $dialog(infoBox) $ok_button tkwait window $dialog(infoBox) set activeWindow($dialog(infoBox)) 0 catch {grab $callerDialogBox} catch {focus $focusBox} } proc popupErrorBox {retcode command_list errmsg {width_pixels 500} \ {callerDialogBox ""} } { global dialog set dialog(errDialogBox) ".error" set dbox [popupDialogBox $dialog(errDialogBox) "Error Dialog" 1 Plain \ $callerDialogBox] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left \ -width $width_pixels \ -text "FAILED (return code=$retcode)\ to execute the following\ command:\n\n\n\t$command_list\n\n\nThe\ error message was\n\n\n\t$errmsg\n" pack $dbox_top.msg -padx 3m -pady 3m set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $dialog(errDialogBox)] register_default_action $dialog(errDialogBox) $ok_button catch {tkwait window $dialog(errDialogBox)} if { [string compare $callerDialogBox ""] != 0 } { focus $callerDialogBox grab $callerDialogBox } } proc popupOutputBox {output {callerDialogBox ""} } { set dialog(outDialogBox) ".output" set dbox [popupDialogBox $dialog(outDialogBox) "Output Dialog" 1 Plain $callerDialogBox] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] text $dbox_top.textbox -borderwidth 2 -setgrid 1 \ -exportselection true \ -width 80 -height 30 -relief flat bind_text_readonly $dbox_top.textbox pack $dbox_top.textbox -expand 1 -fill both -side left -padx 3m -pady 3m scrollbar $dbox_top.vscroll \ -command "$dbox_top.textbox yview" \ -borderwidth 2 \ -orient vertical \ -relief groove $dbox_top.textbox configure -yscrollcommand "$dbox_top.vscroll set" pack $dbox_top.vscroll -fill y -expand 1 -after $dbox_top.textbox set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $dialog(outDialogBox)] $dbox_top.textbox insert 1.0 $output register_default_action $dialog(outDialogBox) $ok_button catch {tkwait window $dialog(outDialogBox)} } proc win_cmdExec {callerDialogBox command_list} { busy_cursor InfoBox_sendmsg "'$command_list'..." set retcode [catch {eval exec $command_list} output] if {$retcode != 0} { if { [string compare $callerDialogBox ""] != 0 } { popupErrorBox $retcode $command_list $output 500 $callerDialogBox } else { popupErrorBox $retcode $command_list $output 500 "" } InfoBox_sendmsg "failed!" 1 1 } else { if { [string compare $output ""] != 0 } { popupOutputBox $output $callerDialogBox } InfoBox_sendmsg "done." 1 1 5 } remove_busy_cursor if { [string compare $callerDialogBox ""] != 0 } { focus $callerDialogBox grab $callerDialogBox } return $retcode } torque-2.4.16/src/tools/xpbsmon/pref.tk0000664000113300011330000005261611272401240014750 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # pref: defines the layout and functions of the user preferences # dialog box. proc pref {callerDialogBox focusBox} { global prefDialogBox activeWindow dialog sysinfo set sysinfo(PREFLCK) 1 busy_cursor ## Bring up the standard Dialog box ## set dialog(prefDialogBox) ".pref" set dbox [popupDialogBox $dialog(prefDialogBox) "User Preferences Dialog"] set activeWindow($dialog(prefDialogBox)) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## box $dbox_top.box1 -title "Sites Preference" \ -entrylabels \ [list [list "Site Name" "" ""] [list "View" MENU_ENTRY "ICON" "FULL"]] \ -lboxlabels [list "Sites" "View"] -lboxwidths [list 19 4] \ -lboxheights [list 10 10] \ -remCmd "siteDelete \[boxGetCurselect $dbox_top.box1 0\]" \ -addCmd "siteAdd \[cleanstr \[box $dbox_top.box1 entryval 0\]\] $dbox_top.box1" \ -grabBox $dialog(prefDialogBox) -noUpdateButton 1 box $dbox_top.box2 -title "" \ -entrylabels [list "Server_Host" "DisplayLabel"] \ -lboxlabels [list "Servers" "DisplayLabel"] -lboxwidths [list 15 10] \ -lboxheights [list 10 10] -orient x -key 0 \ -addCmd "serversPut $dbox_top.box2 \[boxGetCurselect $dbox_top.box1 0\]" \ -remCmd "serverDelete \[boxGetCurselect $dbox_top.box1 0\],\[boxGetCurselect $dbox_top.box2 0\]" \ -grabBox $dialog(prefDialogBox) set lbox1 [box $dbox_top.box1 lbox 0] set_listbox_cmd [box $dbox_top.box1 lbox 0] \ "serversGet $dbox_top.box2 \[boxGetCurselect $dbox_top.box1 0\]" set updButton [box $dbox_top.box2 updateButton] $updButton configure -text "nodes.." -command \ "prefServer \[boxGetCurselect $dbox_top.box1 0\] \[boxGetCurselect $dbox_top.box2 0\] $dialog(prefDialogBox) \[box $dbox_top.box2 entry 0\]" ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok1 "done\nredisplay view"} {ok2 "done\ndon't redisplay view"} {help help}}} x 2m 21 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk1 [lindex $cmdButtons 1] set cmdOk2 [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdOk1 configure -command "sitesPut $dbox_top.box1; prefComplete1 $dialog(prefDialogBox)" $cmdOk2 configure -command "sitesPut $dbox_top.box1; prefComplete2 $dialog(prefDialogBox)" $cmdHelp configure -command {xpbs_help pref $dialog(prefDialogBox)} pack $dbox_top.box1 $dbox_top.box2 -side top -anchor nw -fill both -expand 1 tkwait visibility $dialog(prefDialogBox) sitesGet $dbox_top.box1 remove_busy_cursor catch {tkwait window $dialog(prefDialogBox)} boxesUnset set activeWindow($dialog(prefDialogBox)) 0 catch {grab $callerDialogBox} catch {focus $focusBox} set sysinfo(PREFLCK) 0 } proc prefComplete1 {callerDialogBox} { global sysinfo destroy $callerDialogBox catch {$sysinfo(sysMenuButton) invoke $sysinfo(systemName)} } proc prefComplete2 {callerDialogBox} { global sysinfo destroy $callerDialogBox } proc siteNamesGet {} { global sysview set sites "" foreach s [array names sysview] { if {[lsearch -exact $sites $s] == -1} { lappend sites $s } } return $sites } proc siteNamesPrint {} { puts "Site Names:==================" foreach s [siteNamesGet] { puts $s } } proc siteAdd {siteName boxframe} { global sysview set sysview($siteName) [box $boxframe entryval 1] } proc siteDelete {{siteName ""}} { global sysinfo sysview if { [string compare $siteName ""] == 0 } { return } catch {unset sysview($siteName)} catch {$sysinfo(sysMenuButton) delete $siteName} if {[string compare $sysinfo(systemName) $siteName] == 0} { systemDelete $sysinfo(systemFrame) set sysinfo(systemName) "" set sysinfo(systemFrame) "" } } proc serverDelete {serverid} { global sysnodes catch {unset sysnodes($serverid)} } # queryTableGet: get the query string for nodename of given 'type'. proc queryTableGet {sitename nodename type} { global queryTable if { ![info exists queryTable($sitename,$nodename)] } { return "" } foreach q $queryTable($sitename,$nodename) { set query [lindex $q 0] set t [lindex $q 2] if {[string compare $t $type] == 0} { return $query } } return "" } proc queryTableDelete {nodeid} { global queryTable catch {unset queryTable($nodeid)} } proc queryTableSave {sitename boxframe} { global queryTable set host [box $boxframe title] set nrows [box $boxframe nrows] set qexprBox [box $boxframe lbox 0] set labelBox [box $boxframe lbox 1] set typeBox [box $boxframe lbox 2] catch {unset queryTable($sitename,$host)} for {set i 0} {$i < $nrows} {incr i} { set line "" lappend line [queryExprCreate "[$qexprBox get $i]"] lappend line [$labelBox get $i] lappend line [$typeBox get $i] lappend queryTable($sitename,$host) $line } } proc queryTableLoad {sitename boxframe} { global queryTable set host [box $boxframe title] if {![info exists queryTable($sitename,$host)]} { return } set qexprBox [box $boxframe lbox 0] set labelBox [box $boxframe lbox 1] set typeBox [box $boxframe lbox 2] $qexprBox delete 0 end $labelBox delete 0 end $typeBox delete 0 end foreach line $queryTable($sitename,$host) { set qexpr [lindex $line 0] set label [lindex $line 1] set type [lindex $line 2] $qexprBox insert end $qexpr $labelBox insert end $label $typeBox insert end $type box $boxframe -nrows +1 } boxSelect $boxframe 0 } proc queryTablePrint {sitename} { global queryTable foreach h [array names queryTable] { set h_list [split $h ","] set sname [lindex $h_list 0] if {[string compare $sname $sitename] == 0} { puts "queryTable($h):=================================" puts "=============== $queryTable($h)" } } } proc sitesGet {boxframe} { global sysview set box [box $boxframe entry 0] $box delete 0 end foreach s [siteNamesGet] { box $boxframe -entryval 0 $s box $boxframe -entryval 1 $sysview($s) boxAdd $boxframe } } proc sitesPut {boxframe} { global sysinfo canvas sysview set nrows [box $boxframe nrows] set siteBox [box $boxframe lbox 0] for {set i 0} {$i < $nrows} {incr i} { set sitename [$siteBox get $i] if [catch {$sysinfo(sysMenuButton) index $sitename}] { $sysinfo(sysMenuButton) add radio -label $sitename \ -variable sysinfo(systemName) \ -value $sitename \ -command "displayView $sysinfo(main_frame) $sitename" } } } proc serverNamesGet {siteName} { global sysnodes set servers "" foreach s [array names sysnodes] { set s_list [split $s ","] set sname [lindex $s_list 0] set hname [lindex $s_list 1] if {[string compare $sname $siteName] == 0} { lappend servers $hname } } return $servers } proc statNodes {server_name sysframe} { set nlist "" catch {pbsconnect $server_name} fd InfoBox_sendmsg "statNodes: pbsconnect($server_name): $fd" end if { $fd >= 0 } { catch {pbsstatnode} ninfo InfoBox_sendmsg "statNodes: pbsstatnode($server_name): " end foreach n $ninfo { set nname [lindex $n 0] set attribl [lindex $n 1] foreach na $attribl { set attn [lindex $na 0] set attv [lindex $na 1] switch -exact -- $attn { state { nodeUpdateStat $sysframe $nname $attv } properties { set props "" lappend props $attv set line [list "$props" "Properties: " \ TEXT] systemNodeInfo2Append $sysframe $nname \ $line } np { set props "" lappend props $attv set line [list $props "Virtual PROCessors: " \ TEXT] systemNodeInfo2Append $sysframe $nname \ $line } ntype { set props "" lappend props $attv set line [list $props "NType: " \ TEXT] systemNodeInfo2Append $sysframe $nname \ $line } status { set props "" lappend props $attv set line [list $props "Status: " \ TEXT] systemNodeInfo2Append $sysframe $nname \ $line } } } lappend nlist "$nname NOMOM_SNODE" systemNodeTypePut $sysframe $nname NOMOM_SNODE } catch {pbsdisconnect} InfoBox_sendmsg "pbsdisconnect($server_name)" end } return $nlist } proc statNodesStateMap {state} { set stat [lindex [split $state ,] 0] switch -exact -- $stat { FREE - free { return FREE } OFFLINE - offline { return OFFLINE } DOWN - down { return DOWN } RESERVED - reserve { return RESERVED } INUSE-EXCLUSIVE - job-exclusive { return INUSE-EXCLUSIVE } INUSE-SHARED - job-sharing { return INUSE-SHARED } NOINFO { return NOINFO } default { return "" } } } proc nodesListMerge {nlist1 nlist2 frame} { set newlist "" set k 0 foreach n1 $nlist1 { set nname [lindex $n1 0] set nodes($nname) [lrange $n1 1 end] set order($k) $nname incr k } foreach n2 $nlist2 { set nname [lindex $n2 0] set ntype [lindex $n2 1] if [info exists nodes($nname)] { set oldattr "$nodes($nname)" for {set i 1} {$i < [llength $n2]} {incr i} { set attr [lindex $n2 $i] if {$i == 1 && \ [string compare $attr MOM] == 0} { set attr MOM_SNODE set ntype MOM_SNODE } if { $attr != {} } { set j [expr $i-1] if { $j < [llength $oldattr] } { set oldattr [lreplace $oldattr $j $j $attr] } else { lappend oldattr $attr } } } set nodes($nname) $oldattr } else { set nodes($nname) [lrange $n2 1 end] set order($k) $nname incr k } systemNodeTypePut $frame $nname $ntype } if [info exists order] { for {set k 0} {$k < [array size order]} {incr k} { set n $order($k) lappend newlist "$n $nodes($n)" } } return $newlist } proc serverNamesSorted {systemName servers nodesp frame} { global sysnodes upvar $nodesp nodeslist set newservers "" foreach s $servers { set nlist1 [statNodes $s $frame] set nlist2 [lrange $sysnodes($systemName,$s) 1 end] set nodeslist($s) [nodesListMerge $nlist1 $nlist2 $frame] set slen($s) [llength $nodeslist($s)] set i 0 foreach os $newservers { if {$slen($s) < $slen($os)} { break } incr i } set newservers [linsert $newservers $i $s] } return $newservers } proc siteHasServers {siteName} { set sites [siteNamesGet] if {[lsearch -exact $sites $siteName] == -1} { return 0 } return 1 } proc serversPut {boxframe {siteName ""}} { global sysnodes if {[string compare $siteName ""] == 0} { return } set nrows [box $boxframe nrows] set svrBox [box $boxframe lbox 0] set labBox [box $boxframe lbox 1] for {set i 0} {$i < $nrows} {incr i} { set svrname [$svrBox get $i] set svrlabel [$labBox get $i] if [info exists sysnodes($siteName,$svrname)] { set sysnodes($siteName,$svrname) \ [lreplace $sysnodes($siteName,$svrname) 0 0 $svrlabel] } else { set sysnodes($siteName,$svrname) $svrlabel } } } proc serversGet {boxframe siteName} { global sysnodes set srvBox [box $boxframe lbox 0] $srvBox delete 0 end set srvlBox [box $boxframe lbox 1] $srvlBox delete 0 end box $boxframe -nrows "-[box $boxframe nrows]" set entBox [box $boxframe entry 0] $entBox delete 0 end set labBox [box $boxframe entry 1] $labBox delete 0 end [box $boxframe titlelabel] configure -text "Servers@$siteName" foreach s [array names sysnodes] { set s_list [split $s ","] set sname [lindex $s_list 0] set hname [lindex $s_list 1] if {[string compare $sname $siteName] == 0} { set hlabel [lindex $sysnodes($sname,$hname) 0] $srvBox insert end $hname $srvlBox insert end $hlabel box $boxframe -nrows +1 } } boxSelect $boxframe 0 } proc sysnodesGet {sitename boxframe} { global sysnodes set host [box $boxframe title] if {![info exists sysnodes($sitename,$host)]} { return } set nodeBox [box $boxframe lbox 0] set typeBox [box $boxframe lbox 1] $nodeBox delete 0 end set nnodes 0 foreach line [lrange $sysnodes($sitename,$host) 1 end] { set node [lindex $line 0] set type [lindex $line 1] $nodeBox insert end $node $typeBox insert end $type box $boxframe -nrows +1 incr nnodes } if {$nnodes > 0} { boxSelect $boxframe 0 } } proc sysnodesPut {sitename serverName box} { global sysnodes if [info exists sysnodes($sitename,$serverName)] { set sysnodes($sitename,$serverName) \ [lindex $sysnodes($sitename,$serverName) 0] } else { set sysnodes($sitename,$serverName) "" } set nrows [box $box nrows] set ncols [box $box ncols] for {set i 0} {$i < $nrows} {incr i} { set val "" for {set j 0} {$j < $ncols} {incr j} { set lbox [box $box lbox $j] lappend val [$lbox get $i] } lappend sysnodes($sitename,$serverName) $val } } proc sysnodesPrint {sitename} { global sysnodes foreach s [array names sysnodes] { set s_list [split $s ","] set sname [lindex $s_list 0] if {[string compare $sname $sitename] == 0} { puts "sysnodes($s): $sysnodes($s)" } } } proc prefServerComplete {boxframe callerDialogBox} { set title [box $boxframe title] set nrows [box $boxframe nrows] if {$nrows == 0} { popupInfoBox $callerDialogBox \ "Server $title does not have any nodes. Please complete info!" 700 $callerDialogBox return } destroy $callerDialogBox } proc prefServer {siteName serverName callerDialogBox focusBox} { global activeWindow dialog sysnodes if {[string compare $serverName ""] == 0} { popupInfoBox $callerDialogBox "Server name not selected!!" 500 \ $callerDialogBox return } busy_cursor ## Bring up the standard Dialog box ## set dialog(prefServerDialogBox) ".prefServer" set dbox [popupDialogBox $dialog(prefServerDialogBox) "Server Preference Dialog"] set activeWindow($dialog(prefServerDialogBox)) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## box $dbox_top.box -entrylabels \ [list "Node_Name" [list "type" MENU_ENTRY "MOM" "NOMOM"]] \ -title "$serverName" \ -remCmd "queryTableDelete $siteName,\[boxGetCurselect $dbox_top.box 0\]" \ -lboxlabels [list "Nodes" "Type"] -orient x \ -lboxwidths [list 17 5] -lboxheights [list 10 10] \ -grabBox $dialog(prefServerDialogBox) \ -key [list 0 1] box $dbox_top.box -entryval 1 MOM set updButton [box $dbox_top.box updateButton] $updButton configure -text "query.." -command \ "prefQuery $siteName \[boxGetCurselect $dbox_top.box 0\] \[boxGetCurselect $dbox_top.box 1\] $dialog(prefServerDialogBox) \[box $dbox_top.box entry 0\]" ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdOk configure \ -command "sysnodesPut $siteName $serverName $dbox_top.box; destroy $dialog(prefServerDialogBox)" $cmdHelp configure -command {xpbs_help prefServer $dialog(prefServerDialogBox)} pack $dbox_top.box -side bottom -fill both -expand 1 tkwait visibility $dialog(prefServerDialogBox) sysnodesGet $siteName $dbox_top.box remove_busy_cursor catch {tkwait window $dialog(prefServerDialogBox)} set activeWindow($dialog(prefServerDialogBox)) 0 catch {grab $callerDialogBox} catch {focus $focusBox} } proc prefQuery {siteName nodeName nodeType callerDialogBox focusBox} { global prefQueryDialogBox activeWindow dialog queryTable if {[string compare $nodeName ""] == 0} { popupInfoBox $callerDialogBox "Node name not selected!!" 500 \ $callerDialogBox return } if {[string compare $nodeType NOMOM] == 0} { popupInfoBox $callerDialogBox "Can't specify queries to send to a node not running MOM!!" 500 $callerDialogBox return } busy_cursor ## Bring up the standard Dialog box ## set dialog(prefQueryDialogBox) ".prefQuery" set dbox [popupDialogBox $dialog(prefQueryDialogBox) "Query Table Dialog"] set activeWindow($dialog(prefQueryDialogBox)) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## box $dbox_top.box -title "$nodeName" \ -entrylabels [list "Query_Expr" "Display_Info" \ [list "Display_Type" MENU_ENTRY TEXT SCALE]] \ -lboxlabels [list "Queries" " " " "] -lboxwidths [list 20 20 20] \ -lboxheights [list 10 10 10] -orient y \ -key {0} -noUpdateButton 1 \ -grabBox $dialog(prefQueryDialogBox) queryTableLoad $siteName $dbox_top.box ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdOk configure -command \ "queryTableSave $siteName $dbox_top.box; destroy $dialog(prefQueryDialogBox)" $cmdHelp configure -command {xpbs_help prefQuery $dialog(prefQueryDialogBox)} pack $dbox_top.box -anchor nw -side left -padx 0 -pady 0 tkwait visibility $dialog(prefQueryDialogBox) remove_busy_cursor catch {tkwait window $dialog(prefQueryDialogBox)} set activeWindow($dialog(prefQueryDialogBox)) 0 catch {grab $callerDialogBox} catch {focus $focusBox} } torque-2.4.16/src/tools/xpbsmon/help/0000777000113300011330000000000011614035203014456 500000000000000torque-2.4.16/src/tools/xpbsmon/help/pref.hlp0000664000113300011330000000326011272401237016042 00000000000000This dialog box is for specifying the list of sites that that you are interested on, and the list of PBS server hosts that are running on each site. A site is a place that runs various networked, multi-platform UNIX environments, including heterogeneous clusters of workstations, supercomputers, and massively parallel systems. A server host manages user jobs that run on one or more execution hosts (nodes). On this dialog box, you have a view of the list of sites, and the list of servers that are running on each site. Create the list of sites by specifying each site name on the "Site Name" entry box, its display view (ICON or FULL), and then click the "add" button. The newly-added site will be shown on the "Sites" listbox as highlighted. You may delete any of the items on the listbox by highlighting the item via pointing and clicking using the left mouse button, and clicking "delete" button. Whatever is selected on the "Sites" listbox, the list of servers that run on that site will be displayed on the "Servers" listbox. Specify on the "Server_Host" entry the server name, the server label (as it would appear on the server box) on the DisplayLabel entry box, and click the "add" button next to it. The "Servers" listbox also has an accompanying "delete" button for deleting items from the listbox, and "nodes.." button for bringing up another dialog box that allows you to specify the list of nodes that are known to the selected server host. Click "done redisplay view" command button after making necessary changes that will affect the current view. This will redraw and get new data for it. Select "done don't redisplay view" if you've made changes that will not affect the current view. torque-2.4.16/src/tools/xpbsmon/help/auto_update.hlp0000664000113300011330000000116011272401237017415 00000000000000The Automatic Update dialog box is for specifying the interval number of minutes for periodically taking updates of nodes data. Either type in the minutes value on the spinbox entry, or click on the scrollbar arrows of the spinbox to display valid values (> 0). Click on the "start updating" command button to signal automatic updating of data. Click on the "stop updating" command button to signal an end to automatic updates of data. Click on the "close window" command button to close the dialog box. This is also the default action (as indicated by a sunken look of the button) when the key is pressed. torque-2.4.16/src/tools/xpbsmon/help/notes.hlp0000664000113300011330000000022511272401237016234 00000000000000xpbsmon-1.11b (beta release 2/98): ================================== xpbsmon-1.1.11a (alpha release 11/97): ====================================== torque-2.4.16/src/tools/xpbsmon/help/prefQuery.hlp0000664000113300011330000001104211272401237017065 00000000000000This dialog box is for specifying the list of resource queries to be sent to the node's MOM daemon. This query can be anything from a simple expression involving only MOM query keywords (ex. loadave), or to complex expressions made up of numerical constants, arithmetic/logical/bitwise operators, and MOM keywords (ex. "(loadave/ncpus)*100)"). The valid operators are: -,~,*,/,%,+,^,(,),<,>,|,&,=,!, <<, <=, >>, >=, ==, !=, &&, ||. Some possible query keywords are given in the following, listing also the architecture of the host (that is running MOM) where the keyword is valid: Query Keyword MOM-host Architecture -------------- ----------------------------------------------- sessions unicos8, sunos4, solaris5, sp2, linux, fujitsu irix6array, irix6,irix5, hpux10, digitalunix pids unicos8, sunos4, solaris5, sp2, linux, irix6array, irix6, irix5, digitalunix nsessions unicos8, sunos4, solaris5, sp2, linux, irix6array, irix6, irix5, hpux10, fujitsu, digitalunix nusers unicos8, sunos4, solaris5, sp2, linux, irix6array, irix6, irix5, hpux10, fujitsu, digitalunix totmem unicos8, sunos4, linux, irix6array, irix6, irix5, fujitsu availmem unicos8, sunos4, linux, irix6array, irix6, irix5, fujitsu ncpus unicos8, solaris5, linux, irix6array, irix6, irix5, hpux10, fujitsu physmem unicos8, sunos4, solaris5, linux, irix6array, irix6, irix5, hpux10, fujitsu, digitalunix idletime unicos8, sunos4, solaris5, linux, irix6array, irix6, irix5, hpux10, fujitsu, digitalunix loadave unicos8, sunos4, solaris5, sp2, linux, irix6array, irix6, irix5, hpux10, fujitsu, digitalunix swaprate unicos8 swapinrate unicos8 swapoutrate unicos8 swapused unicos8 swapavail unicos8 swaptotal unicos8 cpusysw unicos8 cpuunix unicos8 cpuuser unicos8 cpuidle unicos8 cpuguest unicos8 cpuspeed hpux10 cputype hpux10,digitalunix platform hpux10,digitalunix cpuclock digitalunix A description of each keyword is given below: sessions - list of sessions in the system pids - list of pids in a session nsessions - number of sessions in the system nusers - number of users in the system totmem - total memory size availmem - available memory size ncpus - number of cpus physmem - physical memory size idletime - seconds of idle time loadave - current load average swaprate - swap activity in chars / sec swapinrate - swapin activity in chars / sec swapoutrate - swapout activity in chars / sec swapused - chars swapped out swapavail - chars available in swap area swaptotal - total chars in swap area cpusysw - percent cpu system wait cpuunix - percent cpu unicos cpuuser - percent cpu user cpuidle - percent cpu idle cpuguest - percent cpu guest The result of the query (Query_Expr) will be displayed on the node's canvas with an accompanying text label (Display_Info) and the output format (Display_Type) can be in one of 2 ways: TEXT, SCALE. TEXT means that the result will be displayed as is, while SCALE will show an actual scale item/widget calibrated over 100. For the latter, be sure the result value of your query is numeric and that a value of 100 is considered "optimal". So specify the query expression in the Query_Expr entry box, the accompanying text label on the Display_Info entry box, and drag the mouse over the Display_Type CHOICE entry box and click the left button to display the choices: {TEXT, SCALE} for the output format of the result. Then click "add" (or simply hit ) and watch as your input gets added to the Queries listbox. For example, if you specified: Query_Expr Display_Info Display_Type --------- ------------ ------------- loadave Load Ave: TEXT then if the result of the query is "0.22", the node's canvas will display: Load Ave: 0.22 After putting in all the necessary parameters, then simply click the "ok" button found at the bottom of the dialog box. torque-2.4.16/src/tools/xpbsmon/help/prefServer.hlp0000664000113300011330000000260111272401237017227 00000000000000This dialog box is for specifying the list of nodes that are known to the current server (whose name is displayed near the top of box). On the "Node_Name" entry box, type the name of the node, and drag the mouse to the "type" choice entry and hold/click the left mouse button to display/ select one of 2 options: {MOM, NOMOM}. A MOM type means that the node/execution host that you're currently adding is running a PBS MOM daemon; otherwise, it is not running it. After setting the node's name and type, then click the "add" button (or simply hit ) and watch as your input gets added to the "Nodes" listbox. The newly-added item will be shown highlighted. The highlighted item can serve as input when the "delete" and "query.." buttons are manipulated. The former will remove the item from the listbox while the latter is for specifying the list of resource status queries to send to node' MOM. NOTE: For "Node Name", be sure to enter the name exactly as how it would appear in the "exec_host" attribute or "resources_used.nodes" attribute of each job as displayed by the server host when you do a "qstat". xpbsmon determines what jobs are running on what nodes by looking up the "exec_host" or "resources_used.nodes" value of the job and matching it up with the known node names. Once you've added the nodes to the list, and also specified any queries to send to the MOM nodes, then click "ok". torque-2.4.16/src/tools/xpbsmon/help/main.hlp0000664000113300011330000003643011272401237016037 00000000000000xpbsmon is the node monitoring GUI for PBS. It is used for displaying graphically information about nodes, execution hosts in a PBS environment. In a PBS environment, you have a list of sites managed by PBS, and each site runs server, and each server runs jobs on one or more execution hosts (nodes). On each node, the list of jobs that are running on it will be displayed as well as any system parameters that are specified by the administrator to monitor. Some attributes like state, properties, and the list of running jobs on each node are obtained through the PBS server, while system parameters are obtained in terms of queries that are communicated to the MOM daemon running on a node. Therefore, for the latter to work, the GUI must be run as root and the host where xpbsmon is running has been given explicit permission by the MOM daemon to post queries to it (done via the $clienthost keyword on its config file). The topmost window of xpbsmon can be viewed as consisting of 3 parts: menu, main, info regions. ============ Menu Region ============ The menu region displays a row of command buttons (Site, Pref, AutoUpdate, Help, About, Close) that signal some action with the left click of the mouse over a button. Site - displays the list of sites that have been added using the "Pref.." button. Dragging the mouse and releasing it over the site name will display the nodes view for that site on the main region. Pref - brings up a dialog box that will allow you to add sites, servers to each site, as well as a window to other dialog boxes for specifying list of nodes known to a server, as well as any system parameters to monitor for each node. AutoUpdate - brings up a dialog box for enabling/disabling auto updates of data. If updating is currently enabled, then this button will appear in a different color. Help - contains this help page. About - tells about who the author is and where to send comments, bugs, and suggestions. Close - for exiting xpbsmon plus saving current setup information in the user's $HOME/.xpbsmonrc file. Information saved include any of the data specified in the preferences dialog box. View Types - these are represented by the minimize, maximize buttons located at the rightmost edge of the menu region. The minimize button will display the current site in ICON mode were each node is represented as small boxes that are colored depending on status but various information about node is not shown. The maximize button will show the current site in FULL mode where each node is shown in bigger colored boxes and various information about node is in view. =========== Main Region =========== This area (site box) shows nodes information for the site selected through the "Site.." button. Thus, only one site at a time can be displayed from this area. The site box displays the name of the site at the top, the server/nodes info at the middle, and the color information at the bottom. Each server specified is represented graphically by a box (called a server box) containing the server display label, the list of nodes (in even smaller boxes called node boxes) known to the server, and various collective status information like # of nodes used, available, reserved, offline, down, or of unknown status. The node box can be clicked with the left mouse button to display more information about the node (or get a bigger view). Information include what jobs are running on it, and values to certain system parameters specified by the administrator to monitor. =========== Info Region =========== This area will show the progress of some actions of xpbsmon like updating data for the current view. Look into the info box for errors. ================ User Preferences ================ A global xpbsmon resources file (set by the administrator) is read first and then the user's preference file, $HOME/.xpbsmonrc is loaded. Keep in mind that within an Xresources file (Tk only), later entries take precedence. For example, suppose in your .xpbsmonrc file, the following entries appear in order: xpbsmonrc*backgroundColor: blue *backgroundColor: green The later entry "green" will take precedence even though the first one is more precise and longer matching. Some of the things that can be set in the personal preferences file are fonts, colors, and site information. In fact, a complete listing is described in the following: Node Box Colors --------------- You can easily change the colors assigned to node boxes by modifying the following resources: *nodeColorNOINFO: black - color when information for the node it represents could not be obtained. *nodeColorFREE: green - color of canvas when node it represents is up. *nodeColorINUSEshared: #98f5ff - color when node it represents has more than 1 job running on it, or when node has been marked by the server that manages it as "job-sharing". *nodeColorINUSEexclusive: #87ceff #a0522d #1e90ff #a9a9a9 #8470ff #a020f0 - list of colors to assign to a node box when host it represents is running only 1 job, or when node has been marked by the server that manages it as "time- sharing". xpbsmon will use this list to assign 1 distinct color per job unless all the colors have been exhausted, in which case, colors will start getting assigned more than once in a round-robin fashion. *nodeColorDOWN: red - color when node it represents is down. *nodeColorRSVD: yellow - color when node it represents is reserved. *nodeColorOFFL: orange - color when node it represents is offline. Node Box Properties ------------------- Resource names beginning with "*small" or "*node" apply to the properties of the node boxes. A node box is made of an outer frame where the node label sits on top, the canvas (smaller box) is on the middle, and possibly some horizontal/ vertical scrollbars. *smallForeground: #150567 - applies to the color of text inside the canvas. *smallBackground: #ffefdb - applies to the color of the frame. *smallBorderWidth: 2 - distance (in pixels) from other node boxes. *smallRelief: raised - how node box will visually appear (style). *smallScrollBorderWidth: 2 - significant only in FULL mode, this is the distance of the horizontal/vertical scrollbars from the canvas and lower edge of the frame. *smallScrollBackground: #ffefdb - background color of the scrollbars *smallScrollRelief: sunken - how scrollbars would visually appear (style). *smallCanvasBackground: #ffefdb - color of the canvas (later overridden depending on status of the node it represents) *smallCanvasBorderWidth: 1 - distance of the canvas from the frame and possibly the scrollbars. *smallCanvasRelief: flat - how the canvas is visually represented (style). *smallLabelBorderWidth: 0 - the distance of the node label from the canvas and the topmost edge of the frame. *smallLabelBackground: #ffefdb - the background of the area of the node label that is not filled. *smallLabelRelief: flat - how the label would appear visually (style). *smallLabelForeground: #150567 - the color of node label text. *smallLabelFont: -misc-fixed-bold-r-normal--13-100-100-100-c-70-iso8859-1 - the font to use for the node label text. *smallLabelFontWidth: 7 - font width (in pixels) of *smallLabelFont *smallLabelFontHeight: 13 - font height (in pixels) of *smallLabelFont *smallTextFont: -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-1 - font to use for the text that appear inside a canvas. *smallTextFontWidth: 6 - font width (in pixels) of *smallTextFont. *smallTextFontHeight: 9 - font height (in pixels) of *smallTextFont. *nodeColorTrough: white - color of trough part (the /100 portion) of a canvas scale item. *nodeColorSlider: red - color of slider part (value portion) of a canvas scale item. *nodeColorExtendedTrough: blue - color of extended trough (over 100 portion when value exceeds max) of a canvas scale item. *nodeScaleFactor: 1 - tells how much bigger you want the scale item on the canvas to appear. (1 means to keep size as is) *nodeBoxFullMaxWidth: 300 *nodeBoxFullMaxHeight: 100 - maximum width and height (in pixels) of a node box in FULL mode. *nodeBoxIconMaxWidth: 56 *nodeBoxIconMaxHeight: 56 - maximum width and height (in pixels) of a node box in ICON mode. *nodeBoxMirrorMaxWidth: 700 *nodeBoxMirrorMaxHeight: 400 - maximum width and height (in pixels) of a node box displayed on a separate window (after it has been clicked with the mouse to obtain a bigger view) *nodeBoxMirrorScaleFactor: 3 - tells how much bigger you want the scale item on the canvas to appear while the node box is displayed on a separate window (1 means to keep size as is) Server Box Properties --------------------- Resource names beginning with "*medium" apply to the properties of the server boxes. A server box is made of an outer frame where the server display label sits on top, a canvas filled with node boxes is on the middle, possibly some horizontal/vertical scrollbars, and a status label at the bottom. *mediumLabelForeground: #150567 - color of text applied to the server display label and status label. *mediumLabelBackground: #cdc0b0 - background color of the unfilled portions of the server display label and status label. *mediumLabelBorderWidth: 4 - distance of the server display label and status label from other parts of the server box. *mediumLabelRelief: ridge - how the server display label and status label appear visually (style). *mediumLabelFont: -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1 - font used for the text of the server display label and status label. *mediumLabelFontWidth: 8 - font width (in pixels) of *mediumLabelFont. *mediumLabelFontHeight: 13 - font height (in pixels) of *mediumLabelFont. *mediumCanvasBorderWidth: 1 - the distance of the server box's canvas from the label widgets. *mediumCanvasBackground: #cdc0b0 - the background color of the canvas. *mediumCanvasRelief: flat - how the canvas appear visually (style). *mediumScrollBorderWidth: 2 - distance of the scrollbars from the other parts of the server box. *mediumScrollBackground: #eedfcc - the background color of the scrollbars *mediumScrollRelief: sunken - how the scrollbars appear visually. *mediumBackground: #cdc0b0 - the color of the server box frame. *mediumBorderWidth: 10 - the distance of the server box from other boxes. *mediumRelief: ridge - how the server box appears visually (style). *serverBoxMaxWidth: 700 *serverBoxMaxHeight: 600 - maximum width and height (in pixels) of a server box. *serverBoxMaxNumNodeBoxesPerRow: 17 - maximum # of node boxes to appear in a row within a canvas. Miscellaneous Properties ------------------------ Resource names beginning with "*big" apply to the properties of a site box, as well as to widgets found outside of the server box and node box. This includes the dialog boxes that appear when the menu buttons of the main window are manipulated. The site box is the one that appears on the main region of xpbsmon. *bigBackground: #c8b9a6 - background color of the outer layer of the main window. *bigForeground: #150567 - color applied to regular text that appear outside of the node box and server box. *bigBorderWidth: 2 - distance of the site box from the menu area and the color information area. *bigRelief: raised - how the site box is visually represented (style) *bigActiveColor: #9db2ff - the color applied to the background of a selection, a selected command button, or a selected scroll bar handle. *bigShadingColor: #c7af92 - a color shading applied to some of the frames to emphasize focus as well as decoration. *bigSelectorColor: #980517 - the color applied to the selector box of a radiobutton or checkbutton. *bigDisabledColor: #8f8e8d - color applied to a disabled widget. *bigLabelBackground: #c8b9a6 - color applied to the unfilled portions of label widgets. *bigLabelBorderWidth: 1 - distance from other widgets of a label widget. *bigLabelRelief: raised - how label widgets appear visually (style) *bigLabelFont: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1 - font to use for labels. *bigLabelFontWidth: 9 - font width (in pixels) of *bigLabelFont. *bigLabelFontHeight: 15 - font height (in pixels) of *bigLabelFont. *bigLabelForeground: #150567 - color applied to text that function as labels. *bigCanvasBackground: #c8b9a6 - the color of the main region. *bigCanvasRelief: flat - how the main region looks like visually (style) *bigCanvasBorderWidth: 1 - distance of the main region from the menu and info regions. *bigScrollBorderWidth: 2 - if the main region has a scrollbar, this is its distance from other widgets appearing on the the region. *bigScrollBackground: #c8b9a6 - background color of the scrollbar appearing outside a server box and node box. *bigScrollRelief: sunken - how the scrollbar that appears outside a server box and node box looks like visually (style) *bigTextFont: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1 - the font to use for the text that appears outside any server box or node box. *bigTextFontWidth: 9 - the font width (in pixels) of *bigTextFont *bigTextFontHeight: 15 - the font height (in pixels) of *bigTextFont *siteBoxMaxWidth: 700 - maximum width (in pixels) of the site box. *siteBoxMaxHeight: 500 - maximum height (in pixels) of the site box. *siteBoxMaxNumServerBoxesPerRow: 10 - maximum number of server boxes to appear in a row inside the site box. *autoUpdate: true - if set to true, then information about nodes is periodically gathered. *autoUpdateMins: 1 - the # of minutes between polling for data regarding nodes when *autoUpdate is set. *siteInView: Mars - the name of the site that should be in view *rcSiteInfoDelimeterChar: ; - the separator character for each input within a curly-bracketed line of input of *siteInfo. *sitesInfo: {;;;;;;} ...{;;;;;;} - information about a site where can be either {FULL,ICON}, nodetype can be {MOM, NOMOM}, and has the format: { {} {expr-label} } where could be {TEXT, SCALE}. It's probably a lot easier to use the "Pref.." dialog boxes in order to update values for this. Ex. *sitesInfo: {MARS;ICON;newton;Newton;newton3;NOMOM;} {Jupiter;FULL;db;DB;db.OpenPBS.org;MOM;{{ ( availmem / totmem ) * 100} {Memory Usage:} SCALE} {{ ( loadave / ncpus ) * 100} {Cpu Usage:} SCALE} {ncpus {Number of Cpus:} TEXT} {physmem {Physical Memory:} TEXT} {idletime {Idle Time (s):} TEXT} {loadave {Load Avg:} TEXT}} {Mars;ICON;newton;Newton;newton4;NOMOM;} {Mars;ICON;newton;Newton;newton1;NOMOM;} {Mars;ICON;newton;Newton;newton2;NOMOM;} {Mars;ICON;b0101;DB;aspasia.OpenPBS.org;MOM;{{ ( availmem / totmem ) * 100} {Memory Usage:} SCALE} {{ ( loadave / ncpus ) * 100} {Cpu Usage:} SCALE} {ncpus {Number of Cpus:} TEXT} {physmem {Physical Memory:} TEXT} {idletime {Idle Time (s):} TEXT} {loadave {Load Avg:} TEXT}} {Mars;ICON;newton;Newton;newton7;NOMOM;} torque-2.4.16/src/tools/xpbsmon/auto_upd.tk0000664000113300011330000001552611272401240015633 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc auto_upd {} { global canvas dialog sysinfo busy_cursor ## Bring up the standard Dialog box ## set dialog(autoUpdate) ".auto_upd" set dbox [popupDialogBox $dialog(autoUpdate) "Automatic Update of Data"] set activeWindow($dialog(autoUpdate) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{ {stop "stop updating"} {rstart "start updating"} {cont "close window"} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdStop [lindex $cmdButtons 1] set cmdRstart [lindex $cmdButtons 2] set cmdCont [lindex $cmdButtons 3] set cmdHelp [lindex $cmdButtons 4] $cmdRstart configure -command { if { [string compare $sysinfo(autoUpdateMins) ""] == 0 } { popupInfoBox $dialog(autoUpdate) "Please specify the minutes interval" return } incr sysinfo(DATA_UPDATE_SEQ) after [expr round($sysinfo(autoUpdateMins) * 60000)] data_auto_update \ $sysinfo(DATA_UPDATE_SEQ) popupInfoBox $dialog(autoUpdate) \ "Data auto updating will start in $sysinfo(autoUpdateMins) mins." if { [string compare $sysinfo(cmdButtonUpdAuto) ""] != 0 } { $sysinfo(cmdButtonUpdAuto) configure \ -background $canvas(bigActiveColor) } set sysinfo(autoUpdate) 1 } $cmdStop configure -command { incr sysinfo(DATA_UPDATE_SEQ) popupInfoBox $dialog(autoUpdate) "Data auto updating stopped." if { [string compare $sysinfo(cmdButtonUpdAuto) ""] != 0 } { $sysinfo(cmdButtonUpdAuto) configure -background $canvas(bigBg) } set sysinfo(autoUpdate) 0 } $cmdCont configure -command { destroy $dialog(autoUpdate) } $cmdHelp configure -command {xpbs_help auto_update $dialog(autoUpdate)} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.u frame $dbox_top.u.mins label $dbox_top.u.l -text "mins" set spinBox [buildSpinbox $dbox_top.u.mins 4 1-9999 sysinfo(autoUpdateMins) \ "" "Update Data every" left $sysinfo(autoUpdateMins)] set minsFrame [lindex $spinBox 0] set minsEntry [lindex $spinBox 1] register_default_action $minsEntry $cmdCont pack $dbox_top.u.mins $dbox_top.u.l -anchor nw -side left pack $dbox_top.header $dbox_top.u $dbox_top.footer -padx 5m register_default_action $dialog(autoUpdate) $cmdCont tkwait visibility $dialog(autoUpdate) remove_busy_cursor catch {tkwait window $dialog(autoUpdate)} set activeWindow($dialog(autoUpdate) 0 } proc data_auto_update {update_seq} { global sysinfo if { $update_seq != $sysinfo(DATA_UPDATE_SEQ) } { InfoBox_sendmsg "data_auto_update: updating stopped." 1 return } after [expr round($sysinfo(autoUpdateMins) * 60000)] \ [list data_auto_update $update_seq] systemPopulateNodesWithInfo $sysinfo(systemFrame) } torque-2.4.16/src/tools/xpbsmon/preferences.tcl0000664000113300011330000002704611272401240016460 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains a set of procedures for defining and manipulating # X resources for xpbs. This is a piece code taken from Brent B. Welch's, # "Practical Programming in Tcl and Tk", Prentice Hall, 1995, pp. 329-338. proc Pref_Init { userDefaults appDefaults } { global pref set pref(uid) 0; # for a unique identifier for widgets set pref(userDefaults) $userDefaults set pref(appDefaults) $appDefaults PrefReadFile $appDefaults startup if [file exists $userDefaults] { PrefReadFile $userDefaults user } } proc PrefReadFile {basename level} { if [catch {option readfile $basename $level} err] { InfoBox_sendmsg "Error in $basename: $err" 1 } if { [catch {tk colormodel .}] == 0 } { if { [string compare [tk colormodel .] "color"] == 0 } { if [file exists $basename-color] { if [catch {option $basename-color $level} err] { InfoBox_sendmsg "Error in $basename-color: $err" 1 } } } else { if [file exists $basename-mono] { if [catch {option readfile $basename-mono $level} err] { InfoBox_sendmsg "Error in $basename-mono: $err" 1 } } } } } proc PrefVar { item } { lindex $item 0 } proc PrefXres { item } { lindex $item 1 } proc PrefDefault { item } { lindex $item 2 } proc PrefComment { item } { lindex $item 3 } proc PrefHelp { item } { lindex $item 4 } proc Pref_Add { prefs } { global pref init append pref(items) $prefs foreach item $prefs { set varName [PrefVar $item] set xresName [PrefXres $item] set value [PrefValue $varName $xresName] if {$value == {}} { set default [PrefDefault $item] if {[llength $default] > 1} { if { [string compare [lindex $default 0] "CHOICE"] == 0 } { PrefValueSet $varName [lindex $default 1] } else { PrefValueSet $varName $default } } else { if {[string compare $default "OFF"] == 0} { PrefValueSet $varName 0 } elseif {[string compare $default "ON"] == 0} { PrefValueSet $varName 1 } else { PrefValueSet $varName $default } } } set init($xresName) [PrefValue $varName $xresName] } } # PrefValue returns the X resource database value. proc PrefValue { varName xres } { upvar #0 $varName var if [info exists var] { return $var } set var [option get . $xres {}] } # PrefValueSet defines a variable in the global scope. proc PrefValueSet { varName value } { upvar #0 $varName var set var $value } proc PrefSave {} { global pref preferences if [catch { set old [open $pref(userDefaults) r] set oldValues [split [read $old] \n] close $old }] { set oldValues {} } if [catch {open $pref(userDefaults).new w} out] { InfoBox_sendmsg "Cannot save in $pref(userDefaults).new: $out" 1 return } foreach line $oldValues { if {[string compare $line \ "!!! Lines below here are automatically added"] == 0} { break } else { puts $out $line } } puts $out "!!! Lines below here are automatically added" puts $out "!!! [exec date]" foreach item $preferences { set varName [PrefVar $item] set xresName [PrefXres $item] set value [PrefValue $varName $xresName] puts $out [format "%s\t%s" *${xresName}: $value] } close $out set new [glob $pref(userDefaults).new] set old [file root $new] if [catch {exec mv $new $old} err] { InfoBox_sendmsg "Cannot install $new: $err" } } # prefDoIt: returns 1 if a change in the list of preference parameters is # detected and thus, necessitating saving current settings in # some preferences file. proc prefDoIt {} { global init preferences foreach pref $preferences { set varName [PrefVar $pref] set resName [PrefXres $pref] upvar #0 $varName var if {[string compare $resName "sitesInfo"] == 0} { if {[listcomp $var $init($resName)] != 0} { flush stdout return 1 } } else { if {[string compare $var $init($resName)] != 0} { flush stdout return 1 } } } return 0 } # prefLoadSitesInfo: any badly formed sites info is automatically ignored. proc prefLoadSitesInfo {} { global sitesinfo sysview sysnodes queryTable sysinfo foreach s $sitesinfo { set s_list [split $s $sysinfo(rcSiteInfoDelimeterChar)] if {[llength $s_list] != 7} { continue ;# badly-formed lines } set sitename [lindex $s_list 0] set sitevtype [lindex $s_list 1] if {[string compare $sitevtype "ICON"] != 0 && \ [string compare $sitevtype "FULL"] != 0} { continue } set servername [lindex $s_list 2] set serverlabel [lindex $s_list 3] set nodename [lindex $s_list 4] if {[string compare $nodename ""] == 0} { set sysview($sitename) $sitevtype set sysnodes($sitename,$servername) $serverlabel continue } set nodetype [lindex $s_list 5] if {[string compare $nodetype "MOM"] != 0 && \ [string compare $nodetype "NOMOM"] != 0} { continue } set querylist [lindex $s_list 6] set sysview($sitename) $sitevtype if {![info exists sysnodes($sitename,$servername)]} { lappend sysnodes($sitename,$servername) \ $serverlabel "$nodename $nodetype" } else { set newval [lreplace $sysnodes($sitename,$servername) \ 0 0 $serverlabel] set foundMatch 0 foreach v [lrange $newval 1 end] { set ninfo [join $v " "] set newninfo "$nodename $nodetype" if {[string compare $ninfo $newninfo] == 0} { set foundMatch 1 break } } if {!$foundMatch} { lappend newval "$nodename $nodetype" } set sysnodes($sitename,$servername) $newval } foreach qi $querylist { set queryexpr [list [lindex $qi 0]] set querylabel [list [lindex $qi 1]] set querytype [list [lindex $qi 2]] if {[string compare $querytype "SCALE"] != 0 && \ [string compare $querytype "TEXT"] != 0 } { continue } if {![info exists queryTable($sitename,$nodename)]} { lappend queryTable($sitename,$nodename) \ "$queryexpr $querylabel $querytype" } else { set foundMatch 0 foreach q $queryTable($sitename,$nodename) { set qexpr [lindex $q 0] set qtype [lindex $q 2] set qinfo "$qexpr $qtype" set newqinfo "$queryexpr $querytype" if {[string compare $qinfo $newqinfo] \ == 0} { set foundMatch 1 break } } if {!$foundMatch} { lappend queryTable($sitename,$nodename) \ "$queryexpr $querylabel $querytype" } } } } } proc prefSaveSitesInfo {} { global sysview sysnodes queryTable sitesinfo sysinfo set SEP $sysinfo(rcSiteInfoDelimeterChar) set i 0 foreach s [array names sysview] { foreach srv [array names sysnodes] { set srv_list [split $srv ","] set sitename [lindex $srv_list 0] set srvname [lindex $srv_list 1] set srvlabel [lindex $sysnodes($srv) 0] set srvnodes [lrange $sysnodes($srv) 1 end] if {[string compare $s $sitename] == 0} { foreach ninfo $srvnodes { set nname [lindex $ninfo 0] set ntype [lindex $ninfo 1] if [info exists queryTable($s,$nname)] { set line($i) "$s$SEP$sysview($s)$SEP$srvname$SEP$srvlabel$SEP$nname$SEP$ntype$SEP$queryTable($s,$nname)" } else { set line($i) "$s$SEP$sysview($s)$SEP$srvname$SEP$srvlabel$SEP$nname$SEP$ntype$SEP" } incr i } if {[llength $srvnodes] == 0} { set line($i) "$s$SEP$sysview($s)$SEP$srvname$SEP$srvlabel$SEP$SEP$SEP" incr i } } } } set sitesinfo "" for {set i 0} {$i < [array size line]} {incr i} { lappend sitesinfo $line($i) } } torque-2.4.16/src/tools/xpbsmon/bindings.tk0000664000113300011330000003131511272401240015602 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # register_default_action: specify the default action (a 'button' activation) when # the key is pressed in a dialog box given by 'toplevel'. proc register_default_action {toplevel button} { global tk_version $button configure -relief ridge -borderwidth 3 bind $toplevel "catch {$button flash; $button invoke}" } proc bind_button1 win { global coordX coordY bind $win <1> { set coordX %X set coordY %Y } } proc bind_canvas {canvasw} { global tk_version coordX coordY sysinfo if {$tk_version >= 4.0} { bindtags $canvasw [list $canvasw] } bind $canvasw <1> { set coordX %X set coordY %Y popupNodeInfoBox . $sysinfo(nodeframe,%W) \ [nodeNameGet $sysinfo(nodeframe,%W)] \ [nodeTypeGet $sysinfo(nodeframe,%W)] \ [nodeClusterFrameGet $sysinfo(nodeframe,%W)] } } # bind_entry_readonly: binds an entry to be read only. proc bind_entry_readonly widget_name { $widget_name configure -state disabled } # bind_entry_tab: procedure that causes the 'entry_name' widget to pass the input # focus to the 'next_entry_name' widget when the key is hit on the # former, or to 'prev_entry_name' when is pressed. proc bind_entry_tab {entry_name next_entry_name prev_entry_name} { global next$entry_name global prev$entry_name global sel$entry_name global tk_version if {$tk_version >= 4.0} { bindtags $entry_name [list all Entry $entry_name] } set next$entry_name $next_entry_name set prev$entry_name $prev_entry_name bind $entry_name { focus ${next%W} if {$tk_version >= 4.0} { ${next%W} xview moveto 1 } if [set sel${next%W}] { ${next%W} select from 0 ${next%W} select to end } } bind $entry_name { focus ${next%W} if {$tk_version >= 4.0} { ${next%W} xview moveto 1 } if [set sel${next%W}] { ${next%W} select from 0 ${next%W} select to end } } bind $entry_name { focus ${prev%W} if {$tk_version >= 4.0} { ${prev%W} xview moveto 1 } if [set sel${prev%W}] { ${prev%W} select from 0 ${prev%W} select to end } } } # bind_entry_overselect: creates a set of bindings for a user-friendly entry widget. # This includes features such as overwriting selected text, copying and pasting # text solely using mouse buttons, use of basic editing keys: left and right # arrow keys. proc bind_entry_overselect {entry_name} { global tk_version if {$tk_version >= 4.0} { return } bind $entry_name <1> { %W icursor @%x %W select clear %W select from @%x if {[lindex [%W config -state] 4] == "normal"} { focus %W } } bind $entry_name { ## Overwrite the selected region - the selected text is treated as a unit. ## catch {%W delete sel.first sel.last} if {[string compare %A ""] != 0} { %W insert insert %A tk_entrySeeCaret %W } } bind $entry_name <2> { catch {%W insert insert [selection get]} selection clear %W tk_entrySeeCaret %W } bind $entry_name {%W scan dragto %y} bind $entry_name { ## Delete selection if any. if [catch {%W delete sel.first sel.last}] { tk_entryBackspace %W } tk_entrySeeCaret %W } bind $entry_name { ## Delete selection if any. if [catch {%W delete sel.first sel.last}] { tk_entryBackspace %W } tk_entrySeeCaret %W } bind $entry_name { ## Delete selection if any. if [catch {%W delete sel.first sel.last}] { tk_entryBackspace %W } tk_entrySeeCaret %W } bind $entry_name { %W delete sel.first sel.last tk_entrySeeCaret %W } bind $entry_name {%W delete 0 end} bind $entry_name { %W insert insert [selection get] tk_entrySeeCaret %W } bind $entry_name { tk_entryBackword %W tk_entrySeeCaret %W } bind $entry_name { set c [ expr [%W index insert] + 1] %W icursor $c %W select from $c tk_entrySeeCaret %W } bind $entry_name { set c [ expr [%W index insert] - 1] %W icursor $c %W select from $c tk_entrySeeCaret %W } } proc bind_entry_return {entry_name cmdButton} { global tk_version global button$entry_name set button$entry_name $cmdButton bind $entry_name { ${button%W} invoke } } # bind_entry_shared_scrollbar: a special procedure that binds a "reserved" scrollbar # to 'entry_name. proc bind_entry_shared_scrollbar {entry_name shared_scrollbar} { global tk_version scroll$entry_name set scroll$entry_name $shared_scrollbar bind $entry_name <1> { %W icursor @%x %W select clear %W select from @%x if {[lindex [%W config -state] 4] == "normal"} { focus %W if {$tk_version < 4.0} { if {[lindex [%W configure -scrollcommand] 4] == ""} { %W configure -scrollcommand "${scroll%W} set" } ${scroll%W} configure -command "%W view" } else { if {[lindex [%W configure -xscrollcommand] 4] == ""} { %W configure -xscrollcommand "${scroll%W} set" } ${scroll%W} configure -command "%W xview" } } } } # register_spinbox: place an appropriate binding to 'entry_name' so that it # behaves like a spinbox entry. proc register_spinbox entry { global tk_version vlist.$entry if {$tk_version >= 4.0} { bindtags $entry [list all Entry $entry] } bind $entry { if {$tk_version < 4.0} { catch {%W delete sel.first sel.last} if {[string compare %A ""] != 0} { %W insert insert %A tk_entrySeeCaret %W } } set valueList ${vlist.%W} set sbox_var [%W get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if { $min >= 0 } { if { ![regexp "^(\[0-9]+)$" $sbox_var match] || \ $sbox_var < $min || $sbox_var > $max } { %W delete 0 end } } else { set firstChar [string index $sbox_var 0] set restOfChar [string range $sbox_var 1 end] if { ![regexp "^(\[-0-9]+)$" $firstChar match] } { %W delete 0 end } elseif {[string compare $restOfChar ""] != 0} { if { ![regexp "^(\[0-9]+)$" $restOfChar match] || \ $sbox_var < $min || $sbox_var > $max } { %W delete 0 end } } } } elseif { ([lsearch -exact ". ^ $ \[ ] ( ) * + ? |" $sbox_var] != -1 && \ [lsearch -exact $valueList $sbox_var] == -1) || \ [lsearch -regexp $valueList "^${sbox_var}"] == -1 } { %W delete 0 end } } bind $entry { check_spinbox_value %W } } proc register_entry_fixsize {entry size} { global tk_version size.$entry set size.$entry $size if {$tk_version >= 4.0} { bindtags $entry [list all Entry $entry] } bind $entry { set size ${size.%W} set sbox_var [%W get] if {[string length $sbox_var] < $size} { if {$tk_version < 4.0} { catch {%W delete sel.first sel.last} if {[string compare %A ""] != 0} { %W insert insert %A tk_entrySeeCaret %W } } } else { if {$tk_version >= 4.0} { %W delete 0 end %W insert 0 [string range $sbox_var 0 [expr $size - 1]] } } } } # bind_listbox_single_select: binds a listbox to allow only one item selection at a # time. proc bind_listbox_single_select widget_name { global tk_version if {$tk_version < 4.0} { bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name <2> {;} bind $widget_name {;} } else { $widget_name configure -selectmode single } } proc bind_listbox_select {listbox boxframe} { global tk_version box$listbox set box$listbox $boxframe if { $tk_version >= 4.0 } { bindtags $listbox [list all Listbox $listbox] } bind $listbox <1> { if { $tk_version < 4.0 } { %W select from [%W nearest %y] boxSelect ${box%W} [%W index @%x,%y] } boxSelect ${box%W} [%W index @%x,%y] } } proc set_listbox_cmd {lbox cmdexpr} { global cmd$lbox set cmd$lbox $cmdexpr } proc bind_text_readonly widget_name { global tk_version if {$tk_version >= 4.0} { bindtags $widget_name [list $widget_name] } bind $widget_name <1> {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} } torque-2.4.16/src/tools/xpbsmon/Makefile.am0000664000113300011330000000335511272401240015504 00000000000000include $(top_srcdir)/buildutils/config.mk xpbsmondir = $(XPBSMON_DIR) xpbsmonbitmapdir = $(xpbsmondir)/bitmaps xpbsmonhelpdir = $(xpbsmondir)/help SUFFIXES = .src bin_SCRIPTS = xpbsmon nodist_xpbsmon_DATA = xpbsmonrc tclIndex CLEANFILES = xpbsmon xpbsmonrc tclIndex buildindex EXTRA_DIST = xpbsmon.src xpbsmonrc.src patch_scripts buildindex.src dist_xpbsmon_DATA = preferences.tcl auto_upd.tk bindings.tk box.tk button.tk \ cluster.tk color.tk common.tk dialog.tk entry.tk expr.tk \ listbox.tk main.tk node.tk pbs.tk prefsave.tk pref.tk \ spinbox.tk system.tk wmgr.tk dist_xpbsmonbitmap_DATA = bitmaps/cyclist-only.xbm bitmaps/hourglass.bmp \ bitmaps/iconize.bmp bitmaps/logo.bmp \ bitmaps/maximize.bmp dist_xpbsmonhelp_DATA = help/auto_update.hlp help/main.hlp help/notes.hlp \ help/pref.hlp help/prefQuery.hlp help/prefServer.hlp xpbsmon: $(srcdir)/xpbsmon.src sed -e 's,#\!.*pbs_wish.*$$,#\!$(bindir)/$(program_prefix)pbs_wish$(program_suffix) -f,' \ -e 's,set *libdir.*$$,set libdir $(xpbsmondir),' \ -e 's,set *appdefdir.*$$,set appdefdir $(xpbsmondir),' \ $? > $@ xpbsmonrc: $(srcdir)/xpbsmonrc.src $(SHELL) $(srcdir)/patch_scripts "$(PBS_MACH)" "$(PBS_DEFAULT_SERVER)" "$?" "$@" buildindex: $(srcdir)/buildindex.src @echo Processing buildindex @sed -e 's,#\!.*tclsh.*$$,#\!@TCLSH_PROG@,' $? > $@ @chmod +x $@ tclIndex: $(dist_xpbs_DATA) buildindex @echo Running buildindex \(locally\) @./buildindex $(srcdir) . install-data-hook: $(INSTALL_SCRIPT) buildindex $(DESTDIR)$(XPBSMON_DIR)/buildindex rm -f $(DESTDIR)$(XPBSMON_DIR)/tclIndex cd $(DESTDIR)$(XPBSMON_DIR) && ./buildindex $(DESTDIR)$(XPBSMON_DIR) . $(DESTDIR) chmod 644 tclIndex uninstall-hook: rm -f $(DESTDIR)$(XPBS_DIR)/buildindex torque-2.4.16/src/tools/xpbsmon/node.tk0000664000113300011330000017505711272401240014746 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc nodeCreate { nodeframe nodename nodelabel clusterframe {nodeType NOMOM_SNODE} {viewType "FULL"} } { global canvas sysinfo if {[string compare $nodeframe ""] == 0 || \ [string compare $nodename ""] == 0} { return } set sysframe "" if {[string compare $clusterframe ""] != 0} { set sysframe [clusterSystemFrameGet $clusterframe] systemNodeFramePut $sysframe $nodename $nodeframe $viewType } nodeNamePut $nodeframe $nodename nodeViewTypePut $nodeframe $viewType nodeTypePut $nodeframe $nodeType nodeClusterFramePut $nodeframe $clusterframe switch -exact -- $viewType { MIRROR { set label_font $canvas(bigLabelFont) set label_font_width $canvas(bigLabelFontWidth) set label_font_height $canvas(bigLabelFontHeight) set text_width $canvas(bigTextFontWidth) set text_height $canvas(bigTextFontHeight) set maxWidth $canvas(mirrorMaxWidth) set maxHeight $canvas(mirrorMaxHeight) } FULL { set label_font $canvas(smallLabelFont) set label_font_width $canvas(smallLabelFontWidth) set label_font_height $canvas(smallLabelFontHeight) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) set maxWidth $canvas(nodeMaxWidth) set maxHeight $canvas(nodeMaxHeight) } ICON { set label_font $canvas(smallLabelFont) set label_font_width $canvas(smallLabelFontWidth) set label_font_height $canvas(smallLabelFontHeight) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) set maxWidth $canvas(iconMaxWidth) set maxHeight $canvas(iconMaxHeight) } default { return } } set basicWidth $maxWidth set basicHeight $maxHeight frame $nodeframe -class Small frame $nodeframe.cf -borderwidth 0 frame $nodeframe.cf.c -class SmallCanvas frame $nodeframe.cf.y -borderwidth 0 frame $nodeframe.cf.x -borderwidth 0 frame $nodeframe.lf -class SmallLabel -borderwidth 0 -relief flat set nodelabel2 $nodelabel if { [string compare $viewType "ICON"] == 0 } { set nodelabel2 [lindex [split $nodelabel .] 0] label $nodeframe.lf.label -text $nodelabel2 -justify left \ -font $label_font -anchor nw } else { label $nodeframe.lf.label -text $nodelabel2 -justify center \ -font $label_font -anchor c } set labelWidth [expr 2*$canvas(smallBd) + 2*$canvas(smallLabelBd) + \ $label_font_width*[string length $nodelabel2]] set labelHeight [expr $canvas(smallBd) + 2*$canvas(smallLabelBd) + \ + $label_font_height] canvas $nodeframe.cf.c.canvas -width $basicWidth -height $basicHeight \ -xscrollcommand [list $nodeframe.cf.x.xscroll set] \ -yscrollcommand [list $nodeframe.cf.y.yscroll set] \ -confine 1 nodeCanvasPut $nodeframe $nodeframe.cf.c.canvas set sysinfo(nodeframe,$nodeframe.cf.c.canvas) $nodeframe bind_canvas $nodeframe.cf.c.canvas set nodestat [systemNodeStatusGet $sysframe $nodename] if { [string compare $nodeType MOM] == 0 || \ [string compare $nodeType MOM_SNODE] == 0} { if {[string compare $viewType MIRROR] != 0 } { nodeUpdateStat $sysframe $nodename $nodestat NOINFO } else { nodeNoInfo $nodeframe } } else { if {[string compare $viewType MIRROR] != 0} { nodeUpdateStat $sysframe $nodename $nodestat FREE } else { nodeUp $nodeframe } } set canvasFrameWidth [expr $canvas(smallBd) + \ 2*$canvas(smallCanvasBd)] set canvasFrameHeight [expr 2*$canvas(smallCanvasBd)] scrollbar $nodeframe.cf.x.xscroll -orient horizontal \ -relief $canvas(smallScrollRelief) \ -borderwidth $canvas(smallScrollBd) \ -background $canvas(smallScrollBg) \ -width $text_height \ -command [list $nodeframe.cf.c.canvas xview] set scrollHeight [expr $canvas(smallBd) + \ 2*[lindex [$nodeframe.cf.x.xscroll configure -borderwidth] end] \ + [lindex [$nodeframe.cf.x.xscroll configure -width] end]] $nodeframe.cf.x configure -height $scrollHeight scrollbar $nodeframe.cf.y.yscroll -orient vertical \ -relief $canvas(smallScrollRelief) \ -borderwidth $canvas(smallScrollBd) \ -background $canvas(smallScrollBg) \ -width $text_height \ -command [list $nodeframe.cf.c.canvas yview] set scrollWidth [expr $canvas(smallBd) + \ 2*[lindex [$nodeframe.cf.y.yscroll configure -borderwidth] end] \ + [lindex [$nodeframe.cf.y.yscroll configure -width] end]] $nodeframe.cf.y configure -width $scrollWidth nodeLabelPut $nodeframe $nodeframe.lf.label nodeLabelFramePut $nodeframe $nodeframe.lf nodeCanvasFramePut $nodeframe $nodeframe.cf.c nodeMainFramePut $nodeframe $nodeframe.cf nodeXscrollPut $nodeframe $nodeframe.cf.x.xscroll nodeXscrollFramePut $nodeframe $nodeframe.cf.x nodeYscrollPut $nodeframe $nodeframe.cf.y.yscroll nodeYscrollFramePut $nodeframe $nodeframe.cf.y nodeXposPut $nodeframe 0 nodeYposPut $nodeframe 0 nodeScrollRegionWidthPut $nodeframe 0 nodeScrollRegionHeightPut $nodeframe 0 nodeOffsetWidthPut $nodeframe 0 nodeNextPut $nodeframe "" nodeRefreshPut $nodeframe 0 pack $nodeframe.lf.label -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 -anchor nw pack $nodeframe.cf.c.canvas -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $nodeframe.cf.y -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $nodeframe.cf.x -side bottom -fill x -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $nodeframe.cf.c -expand true -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $nodeframe.lf $nodeframe.cf -side top -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $nodeframe -expand true -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 set width [expr $canvasFrameWidth + $basicWidth + $scrollWidth] if {$labelWidth > $width} { set width $labelWidth } nodeCanvasWidthPut $nodeframe $basicWidth nodeDisplayWidthPut $nodeframe $width if {$width > $maxWidth} { set canvWidth [expr $maxWidth - \ $canvasFrameWidth - $scrollWidth] if {$canvWidth > 0} { nodeCanvasWidthPut $nodeframe $canvWidth nodeDisplayWidthPut $nodeframe $maxWidth $nodeframe.cf.c.canvas configure -width $canvWidth set width $maxWidth } } set height [expr $labelHeight + $canvasFrameHeight + $basicHeight + \ $scrollHeight] nodeCanvasHeightPut $nodeframe $basicHeight nodeDisplayHeightPut $nodeframe $height if {$height > $maxHeight} { set canvHeight [expr $maxHeight - \ $labelHeight - $canvasFrameHeight - $scrollHeight] if {$canvHeight > 0} { nodeCanvasHeightPut $nodeframe $canvHeight nodeDisplayHeightPut $nodeframe $maxHeight $nodeframe.cf.c.canvas configure -height $canvHeight set height $maxHeight } } if {[string compare $viewType ICON] == 0} { nodeCoverCanvas $nodeframe } else { nodeUnCoverCanvas $nodeframe } return [list $width $height] } proc nodeAddWidth {nodeframe incr} { global canvas if {[string compare $nodeframe ""] == 0 || \ ![regexp {[0-9]+} $incr]} { return } set vtype [nodeViewTypeGet $nodeframe] switch -exact -- $vtype { MIRROR { set maxWidth $canvas(mirrorMaxWidth) } FULL { set maxWidth $canvas(nodeMaxWidth) } ICON { set maxWidth $canvas(iconMaxWidth) } default { return } } set newDispWidth [expr [nodeDisplayWidthGet $nodeframe] + $incr] if {$newDispWidth < $maxWidth } { nodeCanvasWidthPut $nodeframe \ [expr [nodeCanvasWidthGet $nodeframe] + $incr] nodeDisplayWidthPut $nodeframe $newDispWidth clusterAddWidth [nodeClusterFrameGet $nodeframe] $incr } } proc nodeRepack {nodeframe} { global canvas if {[string compare $nodeframe ""] == 0} { return } set vtype [nodeViewTypeGet $nodeframe] switch -exact -- $vtype { MIRROR { set maxWidth $canvas(mirrorMaxWidth) } FULL { set maxWidth $canvas(nodeMaxWidth) } ICON { set maxWidth $canvas(iconMaxWidth) } default { return } } set label [nodeLabelGet $nodeframe] set labelFrame [nodeLabelFrameGet $nodeframe] set c [nodeCanvasGet $nodeframe] set canvasFrame [nodeCanvasFrameGet $nodeframe] set mainFrame [nodeMainFrameGet $nodeframe] set xscroll [nodeXscrollGet $nodeframe] set xscrollf [nodeXscrollFrameGet $nodeframe] set yscroll [nodeYscrollGet $nodeframe] set yscrollf [nodeYscrollFrameGet $nodeframe] set clusterf [nodeClusterFrameGet $nodeframe] set clusterc [clusterCanvasGet $clusterf] if {[string compare $clusterc ""] != 0} { catch {pack forget $labelFrame $mainFrame $canvasFrame $xscrollf} $clusterc delete $nodeframe } set canvWidth [nodeCanvasWidthGet $nodeframe] set scrollRegionWidth [nodeScrollRegionWidthGet $nodeframe] set scrollRegionHeight [nodeScrollRegionHeightGet $nodeframe] set canvWidth [nodeCanvasWidthGet $nodeframe] set canvHeight [nodeCanvasHeightGet $nodeframe] if {$scrollRegionWidth > $canvWidth} { catch {pack $xscroll -side bottom -fill x -padx 0 -pady 0 -ipadx 0 -ipady 0} } else { catch {pack forget $xscroll} } if {$scrollRegionHeight > $canvHeight} { catch {pack $yscroll -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 -anchor nw} } else { catch {pack forget $yscroll} } if {[string compare $clusterc ""] == 0} { return } pack $label -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $c -fill both -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $yscrollf -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $xscrollf -side bottom -fill x -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $canvasFrame -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 pack $labelFrame $mainFrame -side top -fill both -expand true -padx 0 -pady 0 -ipadx 0 -ipady 0 $c configure -width $canvWidth -height $canvHeight \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] $clusterc create window \ [nodeXposGet $nodeframe] \ [nodeYposGet $nodeframe] \ -window $nodeframe -anchor nw \ -tags $nodeframe \ -width [nodeDisplayWidthGet $nodeframe] \ -height [nodeDisplayHeightGet $nodeframe] } proc nodeReCreate { nodeframe } { global canvas sysview if {[string compare $nodeframe ""] == 0} { return } set nodename [nodeNameGet $nodeframe] set cframe [nodeClusterFrameGet $nodeframe] set viewType [nodeViewTypeGet $nodeframe] if {[string compare $cframe ""] != 0} { set sysframe [clusterSystemFrameGet $cframe] set sitename [systemNameGet $sysframe] nodeViewTypePut $nodeframe $sysview($sitename) systemNodeFramePut $sysframe $nodename $nodeframe $viewType } switch -exact -- $viewType { MIRROR { set label_font $canvas(bigLabelFont) set label_font_width $canvas(bigLabelFontWidth) set label_font_height $canvas(bigLabelFontHeight) set maxWidth $canvas(mirrorMaxWidth) set maxHeight $canvas(mirrorMaxHeight) set text_width $canvas(bigTextFontWidth) set text_height $canvas(bigTextFontHeight) } FULL { set label_font $canvas(smallLabelFont) set label_font_width $canvas(smallLabelFontWidth) set label_font_height $canvas(smallLabelFontHeight) set maxWidth $canvas(nodeMaxWidth) set maxHeight $canvas(nodeMaxHeight) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) } ICON { set label_font $canvas(smallLabelFont) set label_font_width $canvas(smallLabelFontWidth) set label_font_height $canvas(smallLabelFontHeight) set maxWidth $canvas(iconMaxWidth) set maxHeight $canvas(iconMaxHeight) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) } default { set label_font $canvas(smallLabelFont) set label_font_width $canvas(smallLabelFontWidth) set label_font_height $canvas(smallLabelFontHeight) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) set maxWidth 0 set maxHeight 0 } } set basicWidth $maxWidth set basicHeight $maxHeight set nodelabel [nodeLabelGet $nodeframe] if { [string compare $viewType "ICON"] == 0 } { set nodelabel [lindex [split $nodelabel .] 0] $nodeframe.lf.label configure -text $nodelabel -justify left \ -font $label_font -anchor nw } else { set nodelabel [lindex [split $nodelabel .] 0] $nodeframe.lf.label configure -text $nodelabel -justify center \ -font $label_font -anchor c } set clusterframe [nodeClusterFrameGet $nodeframe] bind_canvas $nodeframe.cf.c.canvas set labelWidth \ [expr 2*$canvas(smallBd) + 2*$canvas(smallLabelBd) + \ $label_font_width*[string length $nodelabel]] set labelHeight [expr $canvas(smallBd) + 2*$canvas(smallLabelBd) + \ + $label_font_height] $nodeframe.cf.c.canvas configure -width $basicWidth \ -height $basicHeight \ -xscrollcommand [list $nodeframe.cf.x.xscroll set] \ -yscrollcommand [list $nodeframe.cf.y.yscroll set] \ -confine 1 set nodestat [systemNodeStatusGet $sysframe $nodename] set nodetype [nodeTypeGet $nodeframe] if { [string compare $nodetype MOM] == 0 || \ [string compare $nodetype MOM_SNODE] == 0 } { if {[string compare $viewType MIRROR] != 0 } { nodeUpdateStat $sysframe $nodename $nodestat NOINFO } else { nodeNoInfo $nodeframe } } else { if {[string compare $viewType MIRROR] != 0} { nodeUpdateStat $sysframe $nodename $nodestat FREE } else { nodeUp $nodeframe } } set canvasFrameWidth [expr $canvas(smallBd) + \ 2*$canvas(smallCanvasBd)] set canvasFrameHeight [expr 2*$canvas(smallCanvasBd)] $nodeframe.cf.x.xscroll configure \ -width $text_height \ -command [list $nodeframe.cf.c.canvas xview] set xscroll $nodeframe.cf.x.xscroll set scrollHeight [expr $canvas(smallBd) + \ 2*[lindex [$nodeframe.cf.x.xscroll configure -borderwidth] end] \ + [lindex [$nodeframe.cf.x.xscroll configure -width] end]] $nodeframe.cf.x configure -height $scrollHeight $nodeframe.cf.y.yscroll configure \ -width $text_height \ -command [list $nodeframe.cf.c.canvas yview] set yscroll $nodeframe.cf.y.yscroll set scrollWidth [expr $canvas(smallBd) + \ 2*[lindex [$nodeframe.cf.y.yscroll configure -borderwidth] end] \ + [lindex [$nodeframe.cf.y.yscroll configure -width] end]] $nodeframe.cf.y configure -width $scrollWidth set width [expr $canvasFrameWidth + $basicWidth + $scrollWidth] if {$labelWidth > $width} { set width $labelWidth } nodeCanvasWidthPut $nodeframe $basicWidth nodeDisplayWidthPut $nodeframe $width if {$width > $maxWidth} { set canvWidth [expr $maxWidth - \ $canvasFrameWidth - $scrollWidth] if {$canvWidth > 0} { nodeCanvasWidthPut $nodeframe $canvWidth nodeDisplayWidthPut $nodeframe $maxWidth $nodeframe.cf.c.canvas configure -width $canvWidth set width $maxWidth } } set height [expr $labelHeight + $canvasFrameHeight + $basicHeight + \ $scrollHeight] nodeCanvasHeightPut $nodeframe $basicHeight nodeDisplayHeightPut $nodeframe $height if {$height > $maxHeight} { set canvHeight [expr $maxHeight - \ $labelHeight - $canvasFrameHeight - $scrollHeight] if {$canvHeight > 0} { nodeCanvasHeightPut $nodeframe $canvHeight nodeDisplayHeightPut $nodeframe $maxHeight $nodeframe.cf.c.canvas configure -height $canvHeight set height $maxHeight } } set scrollRegionWidth [nodeScrollRegionWidthGet $nodeframe] set scrollRegionHeight [nodeScrollRegionHeightGet $nodeframe] set canvWidth [nodeCanvasWidthGet $nodeframe] catch {pack forget $xscroll} if {[string compare $viewType ICON] != 0 && \ $scrollRegionWidth > $canvWidth} { catch {pack $xscroll -side bottom -fill x -padx 0 -pady 0 \ -ipadx 0 -ipady 0} } set canvHeight [nodeCanvasHeightGet $nodeframe] catch {pack forget $yscroll} if {[string compare $viewType ICON] != 0 && \ $scrollRegionHeight > $canvHeight} { catch {pack $yscroll -side right -fill y -padx 0 -pady 0 -ipadx 0 -ipady 0 -anchor nw} } if {[string compare $viewType ICON] == 0} { nodeCoverCanvas $nodeframe } else { nodeUnCoverCanvas $nodeframe } return [list $width $height] } proc nodeCoverCanvas {nodeframe} { if {[string compare $nodeframe ""] == 0} { return } set canv [nodeCanvasGet $nodeframe] set width [nodeScrollRegionWidthGet $nodeframe] set height [nodeScrollRegionHeightGet $nodeframe] if {[string compare $canv ""] == 0 || \ [string compare $width ""] == 0 || \ [string compare $height ""] == 0} { return } catch {$canv delete $nodeframe.cover} $canv create rect -1 -1 $width $height \ -fill [lindex [$canv configure -bg] end] \ -tag $nodeframe.cover } proc nodeUnCoverCanvas {nodeframe} { if {[string compare $nodeframe ""] == 0} { return } set canv [nodeCanvasGet $nodeframe] if {[string compare $canv ""] == 0} { return } catch {$canv delete $nodeframe.cover} } proc nodeReCoverCanvas {nodeframe} { if {[string compare $nodeframe ""] == 0} { return } set canv [nodeCanvasGet $nodeframe] if {[string compare $canv ""] == 0} { return } catch {$canv delete $nodeframe.cover} $canv itemconfigure $nodeframe.cover \ -fill [lindex [$canv configure -bg] end] \ -tag $nodeframe.cover } proc nodeRefreshGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(refresh)]} { return 0 } return [set ${array}(refresh)] } proc nodeRefreshPut {nodeframe flag} { set array [string trimleft $nodeframe .] global $array set ${array}(refresh) $flag } proc nodeNameGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(name)]} { return "" } return [set ${array}(name)] } proc nodeNamePut {nodeframe name} { set array [string trimleft $nodeframe .] global $array set ${array}(name) $name } proc nodeLabelFramePut {nodeframe frame} { set array [string trimleft $nodeframe .] global $array set ${array}(labelFrame) $frame } proc nodeLabelFrameGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(labelFrame)]} { return "" } return [set ${array}(labelFrame)] } proc nodeLabelGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(label)]} { return "" } return [set ${array}(label)] } proc nodeLabelPut {nodeframe label} { set array [string trimleft $nodeframe .] global $array set ${array}(label) $label } proc nodeTypeGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(type)]} { return "" } return [set ${array}(type)] } proc nodeTypePut {nodeframe type} { set array [string trimleft $nodeframe .] global $array set ${array}(type) $type } proc nodeViewTypeGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(viewType)]} { return "" } return [set ${array}(viewType)] } proc nodeViewTypePut {nodeframe type} { set array [string trimleft $nodeframe .] global $array set ${array}(viewType) $type } proc nodeCanvasFrameGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(canvasFrame)]} { return "" } return [set ${array}(canvasFrame)] } proc nodeCanvasFramePut {nodeframe frame} { set array [string trimleft $nodeframe .] global $array set ${array}(canvasFrame) $frame } proc nodeCanvasGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(canvas)]} { return "" } return [set ${array}(canvas)] } proc nodeCanvasPut {nodeframe canvas} { set array [string trimleft $nodeframe .] global $array set ${array}(canvas) $canvas } proc nodeXscrollFrameGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(XscrollFrame)]} { return "" } return [set ${array}(XscrollFrame)] } proc nodeXscrollFramePut {nodeframe frame} { set array [string trimleft $nodeframe .] global $array set ${array}(XscrollFrame) $frame } proc nodeYscrollFrameGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(YscrollFrame)]} { return "" } return [set ${array}(YscrollFrame)] } proc nodeYscrollFramePut {nodeframe frame} { set array [string trimleft $nodeframe .] global $array set ${array}(YscrollFrame) $frame } proc nodeXscrollGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(xscroll)]} { return "" } return [set ${array}(xscroll)] } proc nodeXscrollPut {nodeframe xscroll} { set array [string trimleft $nodeframe .] global $array set ${array}(xscroll) $xscroll } proc nodeYscrollGet nodeframe { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(yscroll)]} { return "" } return [set ${array}(yscroll)] } proc nodeYscrollPut {nodeframe yscroll} { set array [string trimleft $nodeframe .] global $array set ${array}(yscroll) $yscroll } proc nodeScrollRegionWidthGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(scrollRegionWidth)]} { return "" } return [set ${array}(scrollRegionWidth)] } proc nodeScrollRegionWidthPut {nodeframe width} { set array [string trimleft $nodeframe .] global $array set ${array}(scrollRegionWidth) $width } proc nodeScrollRegionHeightGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(scrollRegionHeight)]} { return "" } return [set ${array}(scrollRegionHeight)] } proc nodeScrollRegionHeightPut {nodeframe height} { set array [string trimleft $nodeframe .] global $array set ${array}(scrollRegionHeight) $height } proc nodeDisplayWidthGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(displayWidth)]} { return "" } return [set ${array}(displayWidth)] } proc nodeDisplayWidthPut {nodeframe width} { set array [string trimleft $nodeframe .] global $array set ${array}(displayWidth) $width } proc nodeDisplayHeightGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(displayHeight)]} { return "" } return [set ${array}(displayHeight)] } proc nodeDisplayHeightPut {nodeframe height} { set array [string trimleft $nodeframe .] global $array set ${array}(displayHeight) $height } proc nodeCanvasWidthGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(canvasWidth)]} { return "" } return [set ${array}(canvasWidth)] } proc nodeCanvasWidthPut {nodeframe width} { set array [string trimleft $nodeframe .] global $array set ${array}(canvasWidth) $width } proc nodeCanvasHeightGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(canvasHeight)]} { return "" } return [set ${array}(canvasHeight)] } proc nodeCanvasHeightPut {nodeframe height} { set array [string trimleft $nodeframe .] global $array set ${array}(canvasHeight) $height } proc nodeClusterFrameGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(clusterFrame)]} { return "" } return [set ${array}(clusterFrame)] } proc nodeClusterFramePut {nodeframe frame} { set array [string trimleft $nodeframe .] global $array set ${array}(clusterFrame) $frame } proc nodeXposGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(Xpos)]} { return "" } return [set ${array}(Xpos)] } proc nodeXposPut {nodeframe pt} { set array [string trimleft $nodeframe .] global $array set ${array}(Xpos) $pt } proc nodeYposGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(Ypos)]} { return "" } return [set ${array}(Ypos)] } proc nodeYposPut {nodeframe pt} { set array [string trimleft $nodeframe .] global $array set ${array}(Ypos) $pt } proc nodeOffsetWidthGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(offsetWidth)]} { return "" } return [set ${array}(offsetWidth)] } proc nodeOffsetWidthPut {nodeframe width} { set array [string trimleft $nodeframe .] global $array set ${array}(offsetWidth) $width } proc nodeNextGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(next)]} { return "" } return [set ${array}(next)] } proc nodeNextPut {nodeframe frame} { set array [string trimleft $nodeframe .] global $array set ${array}(next) $frame } proc nodeMainFrameGet {nodeframe} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(mainFrame)]} { return "" } return [set ${array}(mainFrame)] } proc nodeMainFramePut {nodeframe frame} { set array [string trimleft $nodeframe .] global $array set ${array}(mainFrame) $frame } proc nodeGroupXCGet {nodeframe group} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(groupXC,$group)]} { return "" } return [set ${array}(groupXC,$group)] } proc nodeGroupXCPut {nodeframe group xc} { set array [string trimleft $nodeframe .] global $array set ${array}(groupXC,$group) $xc } proc nodePrint {nodeframe} { if {[string compare $nodeframe ""] == 0} { return } puts "Node: $nodeframe=======================================>" puts "Refresh Flag: [nodeRefreshGet $nodeframe]" puts "Name: [nodeNameGet $nodeframe]" puts "LabelFrame: [nodeLabelFrameGet $nodeframe]" puts "Label: [nodeLabelGet $nodeframe]" puts "Type: [nodeTypeGet $nodeframe]" puts "ViewType: [nodeViewTypeGet $nodeframe]" puts "CanvasFrame: [nodeCanvasFrameGet $nodeframe]" puts "Canvas: [nodeCanvasGet $nodeframe]" puts "XscrollFrame: [nodeXscrollFrameGet $nodeframe]" puts "Xscroll: [nodeXscrollGet $nodeframe]" puts "YscrollFrame: [nodeYscrollFrameGet $nodeframe]" puts "Yscroll: [nodeYscrollGet $nodeframe]" puts "ScrollRegion's Width: [nodeScrollRegionWidthGet $nodeframe]" puts "ScrollRegion's Height: [nodeScrollRegionHeightGet $nodeframe]" puts "Display Width: [nodeDisplayWidthGet $nodeframe]" puts "Display Height: [nodeDisplayHeightGet $nodeframe]" puts "Canvas Width: [nodeCanvasWidthGet $nodeframe]" puts "Canvas Height: [nodeCanvasHeightGet $nodeframe]" puts "Cluster Frame: [nodeClusterFrameGet $nodeframe]" puts "Xpos: [nodeXposGet $nodeframe]" puts "Ypos: [nodeYposGet $nodeframe]" puts "OffsetWidth: [nodeOffsetWidthGet $nodeframe]" puts "NodeNext: [nodeNextGet $nodeframe]" puts "Main Frame: [nodeMainFrameGet $nodeframe]" } proc nodeDelete nodeframe { set array [string trimleft $nodeframe .] global $array catch {pack forget $nodeframe} set nname [nodeNameGet $nodeframe] set vtype [nodeViewTypeGet $nodeframe] set cframe [nodeClusterFrameGet $nodeframe] if {[string compare $cframe ""] != 0} { set sysframe [clusterSystemFrameGet $cframe] systemNodeFrameUnset $sysframe $nname $vtype } unset $array } proc nodeLineGet {nodeframe lineno group} { set array [string trimleft $nodeframe .] global $array if {![info exists ${array}(line,$lineno,$group)]} { return "" } return [set ${array}(line,$lineno,$group)] } proc nodeLinePut {nodeframe lineno group tagOrId} { set array [string trimleft $nodeframe .] global $array set ${array}(line,$lineno,$group) $tagOrId } proc nodeAddText { nodeframe lineno groupno text} { global canvas if {[string compare $nodeframe ""] == 0} { return } set vtype [nodeViewTypeGet $nodeframe] switch -exact -- $vtype { MIRROR { set text_font $canvas(bigTextFont) set text_width $canvas(bigTextFontWidth) set text_height $canvas(bigTextFontHeight) } default { set text_font $canvas(smallTextFont) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) } } set ncanv [nodeCanvasGet $nodeframe] if {$groupno == 0} { set xpos $text_width set ypos $text_height if {$lineno > 0} { set previd [nodeLineGet $nodeframe \ [expr $lineno - 1] 0] set pos [$ncanv bbox $previd] set xpos [lindex $pos 0] set ypos [lindex $pos 3] } } else { set previd [nodeLineGet $nodeframe $lineno [expr $groupno - 1]] set pos [$ncanv bbox $previd] set xpos [lindex $pos 2] set ypos [lindex $pos 1] } set textid [$ncanv create text $xpos $ypos -anchor nw \ -text $text -tags "text $nodeframe" \ -font $text_font \ -fill $canvas(bigFg) -justify left] nodeLinePut $nodeframe $lineno $groupno $textid } proc nodeAddLineText { nodeframe lineno listOfText } { if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set g 0 foreach text $listOfText { nodeAddText $nodeframe $lineno $g $text incr g } } proc nodeMatchItemTag {nodeframe itemid tag} { if {[string compare $nodeframe ""] == 0 || \ [string compare $itemid ""] == 0} { return 0 } set canv [nodeCanvasGet $nodeframe] set tags [lindex [$canv itemconfigure $itemid -tags] end] if {[lsearch -exact $tags $tag] != -1} { return 1 } return 0 } proc nodeModText { nodeframe lineno groupno text } { if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set textid [nodeLineGet $nodeframe $lineno $groupno] if [nodeMatchItemTag $nodeframe $textid text] { set oldtext [lindex [$ncanv itemconfigure $textid -text] end] if {[string compare $text $oldtext] != 0} { $ncanv itemconfigure $textid -text $text return 1 } } else { catch {$ncanv delete $textid} nodeAddText $nodeframe $lineno $groupno $text return 1 } return 0 } proc nodeRemLineEntry { nodeframe lineno groupno } { global canvas if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set array [string trimleft $nodeframe .] global $array set j $groupno set item [nodeLineGet $nodeframe $lineno $j] while {[string compare $item ""] != 0} { $ncanv delete $item catch {unset ${array}(line,$lineno,$j)} incr j set item [nodeLineGet $nodeframe $lineno $j] } } proc nodeModLineText { nodeframe lineno listOfText } { if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set g 0 foreach text $listOfText { nodeModText $nodeframe $lineno $g $text incr g } nodeRemLineEntry $nodeframe $lineno $g } proc nodeRemLines { nodeframe lineno } { global canvas if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set array [string trimleft $nodeframe .] global $array set i $lineno set item [nodeLineGet $nodeframe $i 0] while {[string compare $item ""] != 0} { nodeRemLineEntry $nodeframe $i 0 incr i set item [nodeLineGet $nodeframe $i 0] } } proc nodeScaleCreate {nodeframe lineno groupno value} { global canvas if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set vtype [nodeViewTypeGet $nodeframe] switch -exact -- $vtype { MIRROR { set scale_factor $canvas(mirrorScaleFactor) set text_font $canvas(bigTextFont) set text_width $canvas(bigTextFontWidth) set text_height $canvas(bigTextFontHeight) } default { set scale_factor $canvas(nodeScaleFactor) set text_font $canvas(smallTextFont) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) } } if {$groupno == 0} { set xpos $text_width set ypos $text_height if {$lineno > 0} { set previd [nodeLineGet $nodeframe \ [expr $lineno - 1] 0] set pos [$ncanv bbox $previd] set xpos [lindex $pos 0] set ypos [lindex $pos 3] } } else { set previd [nodeLineGet $nodeframe $lineno [expr $groupno - 1]] set pos [$ncanv bbox $previd] set xpos [lindex $pos 2] set ypos [lindex $pos 1] } set valabel "$value%" set vlen [string length $valabel] for {set i [string length $valabel]} {$i < 10} {incr i} { set valabel "$valabel " } if [catch {expr $value * $scale_factor} val] { InfoBox_sendmsg "nodeScaleCreate: Received val: $val" 2 return "" } set textid [$ncanv create text $xpos $ypos -anchor nw \ -text "$valabel" -tags [list scale \ $lineno$groupno$nodeframe \ text.$lineno$groupno$nodeframe] \ -fill $canvas(smallFg) -justify left \ -font $text_font -justify right] if [catch {expr 101 * $scale_factor} width] { InfoBox_sendmsg "nodeScaleCreate: Received width: $width" 2 return "" } set pos [$ncanv bbox $textid] set x1pos [lindex $pos 2] set y1pos [lindex $pos 1] set y2pos [expr ($y1pos + $text_height) - 3] set x2pos [expr $x1pos + $width] set trid [$ncanv create rect $x1pos $y1pos $x2pos $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorTrough)] if {$val > $width} { set diff [expr ($val - $width) + 1] set slid [$ncanv create rect $x1pos $y1pos $x2pos $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorSlider)] set textd [$ncanv create rect $x2pos $y1pos \ [expr $x2pos + $diff] $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorExtendedTrough)] } else { set slid [$ncanv create rect $x1pos $y1pos \ [expr $x1pos + $val] $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorSlider)] } nodeLinePut $nodeframe $lineno $groupno $lineno$groupno$nodeframe } proc nodeScaleReCreate {nodeframe lineno groupno newvalue} { global canvas if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set vtype [nodeViewTypeGet $nodeframe] switch -exact -- $vtype { MIRROR { set scale_factor $canvas(mirrorScaleFactor) set text_font $canvas(bigTextFont) set text_width $canvas(bigTextFontWidth) set text_height $canvas(bigTextFontHeight) } default { set scale_factor $canvas(nodeScaleFactor) set text_font $canvas(smallTextFont) set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) } } set valabel "$newvalue%" set vlen [string length $valabel] for {set i [string length $valabel]} {$i < 10} {incr i} { set valabel "$valabel " } set oldlabel \ [lindex [$ncanv itemconfigure text.$lineno$groupno$nodeframe -text] end] if {[string compare $valabel $oldlabel] != 0} { if [catch {expr $newvalue * $scale_factor} val] { InfoBox_sendmsg "nodeScaleReCreate: Received val: $val" 2 return "" } catch {$ncanv delete scale.$lineno$groupno$nodeframe} if [catch {expr 101 * $scale_factor} width] { InfoBox_sendmsg "nodeScaleReCreate: Received width: $width" 2 return "" } $ncanv itemconfigure text.$lineno$groupno$nodeframe \ -text $valabel set pos [$ncanv bbox text.$lineno$groupno$nodeframe] set x1pos [lindex $pos 2] set y1pos [lindex $pos 1] set y2pos [expr ($y1pos + $text_height) - 3] set x2pos [expr $x1pos + $width] set trid [$ncanv create rect $x1pos $y1pos $x2pos $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorTrough)] if {$val > $width} { set diff [expr ($val - $width) + 1] set slid [$ncanv create rect $x1pos $y1pos \ $x2pos $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorSlider)] set textd [$ncanv create rect $x2pos $y1pos \ [expr $x2pos + $diff] $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorExtendedTrough)] } else { set slid [$ncanv create rect $x1pos $y1pos \ [expr $x1pos + $val] $y2pos \ -tags [list scale \ $lineno$groupno$nodeframe \ scale.$lineno$groupno$nodeframe] \ -fill $canvas(nodeColorSlider)] } } } proc nodeAddLineScale { nodeframe lineno param } { if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set label [lindex $param 0] set valabel [lindex $param 1] nodeAddText $nodeframe $lineno 0 $label if {[string compare $valabel ""] != 0} { nodeScaleCreate $nodeframe $lineno 1 $valabel } } proc nodeModLineScale { nodeframe lineno newContent } { if {[string compare $nodeframe ""] == 0} { return } set ncanv [nodeCanvasGet $nodeframe] set label [lindex $newContent 0] set valabel [lindex $newContent 1] nodeModText $nodeframe $lineno 0 $label if {[string compare $valabel ""] != 0} { if { [string compare [nodeLineGet $nodeframe $lineno 1] \ ${lineno}1${nodeframe}] == 0 } { nodeScaleReCreate $nodeframe $lineno 1 $valabel nodeRemLineEntry $nodeframe $lineno 2 } else { nodeRemLineEntry $nodeframe $lineno 1 nodeScaleCreate $nodeframe $lineno 1 $valabel } } else { nodeRemLineEntry $nodeframe $lineno 1 } } proc nodeFindXCs {nodeframe startl endl} { if {[string compare $nodeframe ""] == 0} { return } set canv [nodeCanvasGet $nodeframe] set i $startl set j 0 set item [nodeLineGet $nodeframe $i $j] while {[string compare $item ""] != 0} { while {[string compare $item ""] != 0} { set coords [$canv bbox $item] set x1 [lindex $coords 0] set x2 [lindex $coords 2] set w [expr $x2 - $x1] set aScale [nodeMatchItemTag $nodeframe $item scale] if {![info exists max($j)]} { set max($j) 0 } else { if {!$aScale && $x1 > $max($j)} { set max($j) $x1 } } if { ![info exists maxw($j)] || $w > $maxw($j) } { set maxw($j) $w } incr j set item [nodeLineGet $nodeframe $i $j] } incr i if { [string compare $endl "end"] != 0 && $i > $endl} { break } set j 0 set item [nodeLineGet $nodeframe $i $j] } set glen [array size max] for {set g 0} {$g < $glen} {incr g} { set newval [expr $max($g) + $maxw($g)] set k [expr $g + 1] if {[info exists max($k)] && $newval > $max($k)} { set max($k) $newval } nodeGroupXCPut $nodeframe $g $max($g) } } proc nodeAdjustDisplay {nodeframe splitl} { global canvas if {[string compare $nodeframe ""] == 0} { return } set viewtype [nodeViewTypeGet $nodeframe] switch -exact -- $viewtype { MIRROR { set text_width $canvas(bigTextFontWidth) set text_height $canvas(bigTextFontHeight) } default { set text_width $canvas(smallTextFontWidth) set text_height $canvas(smallTextFontHeight) } } if {$splitl < 0} { nodeFindXCs $nodeframe 0 end } else { nodeFindXCs $nodeframe 0 [expr $splitl - 1] } set canv [nodeCanvasGet $nodeframe] set maxw 0 set maxs 0 set totheight $text_height set i 0 set j 0 set xgsave 0 set item [nodeLineGet $nodeframe $i $j] while {[string compare $item ""] != 0} { set maxh 0 set hasScale 0 while {[string compare $item ""] != 0} { set xg [nodeGroupXCGet $nodeframe $j] if {$j == 0} { set xgsave $xg } set x1 [lindex [$canv bbox $item] 0] set xoffset [expr $xg - $x1] $canv move $item $xoffset 0 set coords [$canv bbox $item] set x1 [lindex $coords 0] set x2 [lindex $coords 2] set y1 [lindex $coords 1] set y2 [lindex $coords 3] set h [expr ($y2 - $y1) + 1] if {$h > $maxh} { set maxh $h } incr j set item [nodeLineGet $nodeframe $i $j] } if {$x2 > $maxw} { set maxw $x2 } if {$hasScale && $x2 > $maxs} { set maxs $x2 } incr totheight $maxh incr i if {$i == $splitl} { nodeFindXCs $nodeframe $splitl end nodeGroupXCPut $nodeframe 0 $xgsave } set j 0 set item [nodeLineGet $nodeframe $i $j] } incr maxw if {$maxw != [nodeScrollRegionWidthGet $nodeframe]} { nodeScrollRegionWidthPut $nodeframe $maxw set xscroll [nodeXscrollGet $nodeframe] if {[string compare $viewtype ICON] != 0} { if {$maxw > [nodeCanvasWidthGet $nodeframe]} { catch {pack $xscroll -side bottom -fill x -padx 0 \ -pady 0 -ipadx 0 -ipady 0} } } else { catch {pack forget $xscroll} } } set scrollheight [nodeScrollRegionHeightGet $nodeframe] if {$totheight != [nodeScrollRegionHeightGet $nodeframe]} { nodeScrollRegionHeightPut $nodeframe $totheight set yscroll [nodeYscrollGet $nodeframe] if {[string compare $viewtype ICON] != 0} { if {$totheight > [nodeCanvasHeightGet $nodeframe]} { catch {pack $yscroll -side right -fill y -padx 0 \ -pady 0 -ipadx 0 -ipady 0 -anchor nw} } } else { catch {pack forget $yscroll} } } set scrollRegionWidth [nodeScrollRegionWidthGet $nodeframe] set scrollRegionHeight [nodeScrollRegionHeightGet $nodeframe] $canv configure \ -scrollregion [list 0 0 $scrollRegionWidth $scrollRegionHeight] } proc nodeDown nodeframe { global canvas if {[string compare $nodeframe ""] == 0} { return } [nodeCanvasGet $nodeframe] configure -background $canvas(nodeColorDOWN) } proc nodeUp nodeframe { global canvas if {[string compare $nodeframe ""] == 0} { return } [nodeCanvasGet $nodeframe] configure -background $canvas(nodeColorFREE) } proc nodeOffline nodeframe { global canvas if {[string compare $nodeframe ""] == 0} { return } [nodeCanvasGet $nodeframe] configure -background $canvas(nodeColorOFFL) } proc nodeReserved nodeframe { global canvas if {[string compare $nodeframe ""] == 0} { return } [nodeCanvasGet $nodeframe] configure -background $canvas(nodeColorRSVD) } proc nodeNoInfo nodeframe { global canvas if {[string compare $nodeframe ""] == 0} { return } [nodeCanvasGet $nodeframe] configure -background $canvas(nodeColorNOINFO) } proc nodeInUse nodeframe { global canvas if {[string compare $nodeframe ""] == 0} { return } set nodename [nodeNameGet $nodeframe] set sysframe [clusterSystemFrameGet [nodeClusterFrameGet $nodeframe]] set color "" set nodestat [systemNodeStatusGet $sysframe $nodename] set nodeinfo [systemNodeInfoGet $sysframe $nodename] set k [expr [llength $nodeinfo] - 1] while {$k >= 0} { set info [lindex $nodeinfo $k] set type [lindex $info end] if {[string compare $type NODEJOB] == 0} { set userinfo [lindex $info 0] set jobs "" foreach u $userinfo { set uname [lindex $u 0] set jids [lindex $u 1] foreach j [split $jids ","] { set jstr [lindex [split $j "."] 0] lappend jobs "$jstr.$uname" } } set jobslen [llength $jobs] if { [string compare $nodestat INUSE-EXCLUSIVE] == 0 \ && $jobslen <= 1} { set color [assignNodeColorInUse $jobs] } else { set color [assignNodeColorInUse TIMESHARED \ $canvas(nodeColorINUSEshared)] } break } incr k -1 } if {[string compare $color ""] != 0} { [nodeCanvasGet $nodeframe] configure -background $color } } proc nodeUpdateStat {sysframe nodeid status2 {defstat NOINFO}} { if {[string compare $sysframe ""] == 0} { return } set status [statNodesStateMap $status2] set nodeframe [systemNodeFrameGet $sysframe $nodeid FULL] set nodestat [systemNodeStatusGet $sysframe $nodeid] set oldstatus $nodestat if {[string compare $status ""] == 0} { set status [statNodesStateMap $defstat] } systemNodeStatusPut $sysframe $nodeid $status set clusterf [nodeClusterFrameGet $nodeframe] if {[string compare $clusterf ""] != 0} { clusterStatsUpdate $clusterf $status + clusterStatsUpdate $clusterf $oldstatus - } } proc nodeColorIt {nodeframe nodeid} { if {[string compare $nodeframe ""] == 0} { return } set cframe [nodeClusterFrameGet $nodeframe] set sysframe [clusterSystemFrameGet $cframe] set status [systemNodeStatusGet $sysframe $nodeid] switch -exact -- $status { OFFLINE { nodeOffline $nodeframe } DOWN { nodeDown $nodeframe } FREE { nodeUp $nodeframe } INUSE-SHARED - INUSE-EXCLUSIVE { nodeInUse $nodeframe } RESERVED { nodeReserved $nodeframe } default { nodeNoInfo $nodeframe } } set viewtype [nodeViewTypeGet $nodeframe] if {[string compare $viewtype ICON] == 0} { nodeReCoverCanvas $nodeframe } } proc nodeDisplayInfo {nodeframe queryInfo {create 0}} { if {[string compare $nodeframe ""] == 0} { return } set nodename [nodeNameGet $nodeframe] nodeColorIt $nodeframe $nodename set llen [llength $queryInfo] set jobline -1 for {set i 0} {$i < $llen} {incr i} { set queryinfo [lindex $queryInfo $i] set expr [lindex $queryinfo 0] set hdr [lindex $queryinfo 1] set typ [lindex $queryinfo 2] set res [evaluateExpr $expr] if {[string compare $typ TEXT] == 0} { if {$create} { nodeAddLineText $nodeframe $i [list $hdr $res] } else { nodeModLineText $nodeframe $i [list $hdr $res] } } elseif {[string compare $typ SCALE] == 0} { if {$create} { nodeAddLineScale $nodeframe $i [list $hdr $res] } else { nodeModLineScale $nodeframe $i [list $hdr $res] } } elseif {[string compare $typ NODEJOB] == 0} { set jobline $i if {[string compare \ [nodeLineGet $nodeframe $i 0] ""] == 0} { nodeAddLineText $nodeframe $i $hdr } else { nodeModLineText $nodeframe $i $hdr } set k [expr $i+1] foreach e $expr { set user [lindex $e 0] set ljobs [lrange $e 1 end] set arglist [list " " " " $user " " $ljobs] if {[string compare \ [nodeLineGet $nodeframe $k 0] ""] == 0} { nodeAddLineText $nodeframe $k $arglist } else { nodeModLineText $nodeframe $k $arglist } incr k } } } if {![info exists k]} { set k $i } # Remove extra lines that are not found in queryInfo nodeRemLines $nodeframe $k nodeAdjustDisplay $nodeframe $jobline set viewtype [nodeViewTypeGet $nodeframe] if {[string compare $viewtype ICON] == 0} { nodeCoverCanvas $nodeframe } else { nodeUnCoverCanvas $nodeframe } update idletasks } torque-2.4.16/src/tools/xpbsmon/prefsave.tk0000664000113300011330000001211711272401240015617 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # prefsave: pops up a dialog box asking confirmation from user about saving # current setup in xpbs. proc prefsave {} { global dialog activeWindow sysinfo set dialog(prefSaveBox) ".prefsave" set activeWindow($dialog(prefSaveBox)) 1 set dbox [popupDialogBox $dialog(prefSaveBox) "Save Preference Settings"] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left \ -aspect 2000 -text \ "Save current $sysinfo(appname) settings to $sysinfo(rcFile) file?" pack $dbox_top.msg -padx 3m -pady 3m set buttons [buildCmdButtons $dbox_bottom {{{yes yes} {no no}}} x 0 10 3] set yes_button [lindex $buttons 1] set no_button [lindex $buttons 2] $yes_button configure -command {PrefSave; destroy $dialog(prefSaveBox)} $no_button configure -command [list destroy $dialog(prefSaveBox)] register_default_action $dialog(prefSaveBox) $yes_button tkwait window $dialog(prefSaveBox) set activeWindow($dialog(prefSaveBox)) 0 } torque-2.4.16/src/tools/xpbsmon/spinbox.tk0000664000113300011330000002517711272401240015500 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains procedures related to spinbox widgets. ################################################################################ # buildSpinbox: builds a spinbox widget to be filled with 'list_discrete_values'. If # 'list_discrete_values' is of the form "-", then it will assume # that the values are integers starting from numX up to numY. 'assocVarName' and # 'assocVarElem' are the associated variable name and element (if variable is # an array) for the spinbox entry widget. # OPTIONS: # 'label_text' - the text string to label the spinbox. # 'label_placement' - where to place 'label_text': right, left, top, bottom. # 'default_val' - default value for the spin box entry. # 'dateFormat' - a boolean for declaring entry to be of date type: meaning # numbers from 0 to 9 are to be given a 0 prefix. proc buildSpinbox {frame_name cols list_discrete_values assocVarName \ assocVarElem \ {label_text ""} {label_placement "right"} {default_val ""} \ {dateFormat 0} } { global canvas if {$dateFormat && [string length $default_val] < 2 && \ $default_val >= 0 && $default_val <= 9 } { set lboxinfo [buildFullEntrybox $frame_name 0 \ "" $cols "0$default_val" "" 0] } else { set lboxinfo [buildFullEntrybox $frame_name 0 \ "" $cols $default_val "" 0] } set sbox [lindex $lboxinfo 2] set sboxf [lindex $lboxinfo end] bind_entry_overselect $sbox pack forget $sboxf scrollbar $frame_name.spinscroll -orient vertical -relief flat \ -borderwidth 2 -command [list spincmd $sbox $dateFormat] label $frame_name.splabel -text $label_text -padx 1 -pady 1 switch -exact -- $label_placement { right { pack $sboxf $frame_name.spinscroll $frame_name.splabel -side left \ -anchor nw } left { pack $frame_name.splabel $sboxf $frame_name.spinscroll -side left \ -anchor nw } top { pack $frame_name.splabel -side top -anchor nw pack $sboxf $frame_name.spinscroll -side left -after $frame_name.splabel \ -anchor nw } bottom { pack $sboxf $frame_name.spinscroll -side left -anchor nw pack $frame_name.splabel -side bottom -anchor nw -before $sboxf } default { pack $sboxf -side left -anchor c -pady 2 pack $frame_name.spinscroll -side right -anchor nw -pady 2 } } # Initialize some special global variables if [regexp "(.+)\\((.+)\\)" $assocVarElem match elem1 elem2] { set assocVarElem "${elem1}_${elem2}" } global vlist.$sbox ;# vlist.? holds the list of ;# valid values for the ;# spin box. set vlist.$sbox $list_discrete_values if { [string compare $assocVarElem ""] != 0 } { set value.$sbox $assocVarName\($assocVarElem\) } else { set value.$sbox $assocVarName } $sbox configure -textvariable [set value.$sbox] -relief groove register_spinbox $sbox return [concat $frame_name $sbox $frame_name.spinscroll $frame_name.splabel] } # spincmd: the associated command when the spinbox widget's scrollbar is manipulated. proc spincmd { sbox dateFormat view_idx } { ## It appears that since we have a one entry listbox, then pushing the up ## arrow returns an index of -1, and pushing down return an index of 1. if {$view_idx == -1} { incr_spinbox $sbox $dateFormat } else { decr_spinbox $sbox $dateFormat } } # disable_spinbox: disables all the components of a spinbox. proc disable_spinbox {spinEntry spinScroll {spinLabel ""}} { global sysinfo canvas disable_fullentry "" $spinEntry "" if {[string compare $spinScroll ""] != 0} { disable_scrollbar $spinScroll $canvas(disabledColor) } if {[string compare $spinLabel ""] != 0} { disable_label $spinLabel $canvas(disabledColor) } } # enable_spinbox: enables all the components of a spinbox. proc enable_spinbox {spinEntry spinScroll {spinLabel ""}} { enable_fullentry "" $spinEntry "" if {[string compare $spinScroll ""] != 0} { enable_scrollbar $spinScroll } if {[string compare $spinLabel ""] != 0} { enable_label $spinLabel } } # incr_spinbox: procedure that brings into view the "next" element in the # spin box. # OPTION: # The option 'dateFormat' means to construct the numeric entry as a date # format, meaning, add leading 0 for numbers between 0 to 9. # proc incr_spinbox {spbox {dateFormat 0} } { global vlist.$spbox set valueList [set vlist.$spbox] set newval -1 set cval [$spbox get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if {[string compare $cval ""] == 0} { set cval [expr [digit $min] - 1] } if { [digit $cval] < [digit $max] } { set newval [expr [digit $cval] + 1] $spbox delete 0 end if {$dateFormat && $newval >= 0 && $newval <= 9 } { $spbox insert 0 "0$newval" } else { $spbox insert 0 $newval } } } else { if { [string compare $cval ""] == 0 } { set idx -1 } else { set idx [lsearch $valueList $cval] } if { [expr $idx + 1] < [llength $valueList]} { set newval [lindex $valueList [incr idx]] $spbox delete 0 end $spbox insert 0 $newval } } return $newval } # decr_spinbox: similar to incr_spinbox except in reverse. # proc decr_spinbox {spbox {dateFormat 0} } { global vlist.$spbox set valueList [set vlist.$spbox] set newval -1 set cval [$spbox get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if {[string compare $cval ""] == 0} { set cval [expr [digit $max] + 1] } if { [digit $cval] > [digit $min] } { set newval [expr [digit $cval] - 1] $spbox delete 0 end if {$dateFormat && $newval >= 0 && $newval <= 9 } { $spbox insert 0 "0$newval" } else { $spbox insert 0 $newval } } } else { if {[string compare $cval ""] == 0} { set idx [llength $valueList] } else { set idx [lsearch $valueList $cval] } if { [expr $idx - 1] >= 0 } { set newval [lindex $valueList [incr idx -1]] $spbox delete 0 end $spbox insert 0 $newval } } return $newval } proc check_spinbox_value {spin_entry} { global vlist.$spin_entry set valueList [set vlist.$spin_entry] set sbox_var [$spin_entry get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if { ![regexp "^(\[-0-9]+)$" $sbox_var match] || \ ([digit $sbox_var] < $min || [digit $sbox_var] > $max) } { $spin_entry delete 0 end } } elseif { [lsearch -exact $valueList $sbox_var] == -1 } { $spin_entry delete 0 end } } torque-2.4.16/src/tools/pbsTclInit.c0000664000113300011330000001175011272401240014177 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** All the pbs specific code needed to make pbstclsh ** work is here. The routine pbsTcl_Init() is to be called ** in place of Tcl_Init(). */ #include "pbs_config.h" #include #include "tcl.h" #include "libpbs.h" #include "log.h" #if TCLX #include #endif extern void add_cmds(Tcl_Interp *); extern void fullresp(int); int pbsTcl_Init(interp) Tcl_Interp *interp; /* Interpreter for application. */ { if (Tcl_Init(interp) == TCL_ERROR) return TCL_ERROR; #if TCLX #if TCL_MINOR_VERSION < 5 && TCL_MAJOR_VERSION < 8 if (TclX_Init(interp) == TCL_ERROR) { #else if (Tclx_Init(interp) == TCL_ERROR) { #endif return TCL_ERROR; } #endif /* TCLX */ fullresp(0); add_cmds(interp); Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); return TCL_OK; } int main(argc, argv) int argc; char *argv[]; { chk_file_sec_stderr = 1; Tcl_Main(argc, argv, pbsTcl_Init); return 0; } torque-2.4.16/src/tools/tracejob.h0000664000113300011330000001412611272401240013722 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #ifndef TRACEJOB_H #define TRACEJOB_H /* Symbolic constants */ /* default number of columns on a terminal */ #ifndef DEFAULT_WRAP #define DEFAULT_WRAP 80 #endif /* * filter excessive log entires */ #ifndef FILTER_EXCESSIVE #define FILTER_EXCESSIVE #endif /* if filter excessive if turned on and there are at least this many * log entires, its considered is considered excessive */ #ifndef EXCESSIVE_COUNT #define EXCESSIVE_COUNT 15 #endif /* number of entries to start */ #ifndef DEFAULT_LOG_LINES #define DEFAULT_LOG_LINES 1024 #endif /* Maximum number of log files to check per day */ #ifndef MAX_LOG_FILES_PER_DAY #define MAX_LOG_FILES_PER_DAY 1024 #endif #define SECONDS_IN_DAY 86400 /* indicies into the mid_path array */ enum index { IND_ACCT = 0, IND_SERVER = 1, IND_MOM = 2, IND_SCHED = 3 }; /* fields of a log entry */ enum field { FLD_DATE = 0, FLD_EVENT = 1, FLD_OBJ = 2, FLD_TYPE = 3, FLD_NAME = 4, FLD_MSG = 5 }; /* A PBS log entry */ struct log_entry { char *date; /* date of log entry */ time_t date_time; /* number of seconds from the epoch to date */ char *event; /* event type */ char *obj; /* what entity is writing the log */ char *type; /* type of object Job/Svr/etc */ char *name; /* name of object */ char *msg; /* log message */ char log_file; /* What log file */ int lineno; /* what line in the file. used to stabilize the sort */ unsigned no_print: 1; /* whether or not to print the message */ /* A=accounting S=server M=Mom L=Scheduler */ }; /* prototypes */ int sort_by_date(const void *v1, const void *v2); int parse_log(FILE *, char *, int); char *strip_path(char *path); void free_log_entry(struct log_entry *lg); void line_wrap(char *line, int start, int end); int log_path(char *path, int index, struct tm *tm_ptr, char *filenames[]); void alloc_more_space(); void filter_excess(int threshold); int sort_by_message(const void *v1, const void *v2); int get_cols(void); /* used by getopt(3) */ extern char *optarg; extern int optind; #endif torque-2.4.16/src/tools/Makefile.am0000664000113300011330000000231211272401240014006 00000000000000include $(top_srcdir)/buildutils/config.mk if INCLUDE_GUI if USING_TK XPBSMON = xpbsmon endif endif SUBDIRS = . $(XPBSMON) DIST_SUBDIRS = . xpbsmon EXTRA_DIST = tracejob.h init.d/pbs PBS_LIBS = ../lib/Libpbs/libtorque.la if USING_TCL PROGRAMS_TCL = pbs_tclsh endif if INCLUDE_GUI if USING_TK PROGRAMS_TK = pbs_wish endif endif bin_PROGRAMS = chk_tree hostn printjob printtracking printserverdb tracejob $(PROGRAMS_TCL) $(PROGRAMS_TK) LDADD = $(PBS_LIBS) tracejob_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" printserverdb_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" chk_tree_SOURCES = chk_tree.c hostn_SOURCES = hostn.c printjob_SOURCES = printjob.c printtracking_SOURCES = printtracking.c printserverdb_SOURCES = printserverdb.c tracejob_SOURCES = tracejob.c pbs_tclsh_LDADD = $(PBS_LIBS) $(MY_TCL_LIBS) pbs_tclsh_CFLAGS = $(MY_TCL_INCS) pbs_tclsh_SOURCES = pbsTclInit.c ../scheduler.tcl/pbs_tclWrap.c \ ../scheduler.tcl/site_tclWrap.c pbs_wish_LDADD = $(PBS_LIBS) $(MY_TCLTK_LIBS) pbs_wish_CFLAGS = $(MY_TCLTK_INCS) pbs_wish_SOURCES = pbsTkInit.c ../scheduler.tcl/pbs_tclWrap.c \ ../scheduler.tcl/site_tclWrap.c install_gui: for dir in $(XPBSMON) ;do (cd $$dir && $(MAKE) install);done torque-2.4.16/src/tools/printserverdb.c0000664000113300011330000000700311432602263015017 00000000000000/* print the contents of serverdb */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "portability.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "server.h" int no_attributes = 0; void prt_server_struct( struct server *pserver) { printf("---------------------------------------------------\n"); printf("numjobs:\t\t%d\n", pserver->sv_qs.sv_numjobs); printf("numque:\t\t%d\n", pserver->sv_qs.sv_numque); printf("jobidnumber:\t\t%d\n", pserver->sv_qs.sv_jobidnumber); printf("savetm:\t\t%ld\n", (long)pserver->sv_qs.sv_savetm); return; } /* END prt_job_struct() */ #define ENDATTRIBUTES -711 int read_attr( int fd) { int amt; int i; svrattrl *pal; svrattrl tempal; i = read(fd, (char *) & tempal, sizeof(tempal)); if (i != sizeof(tempal)) { fprintf(stderr, "bad read of attribute\n"); /* FAILURE */ return(0); } if (tempal.al_tsize == ENDATTRIBUTES) { /* FAILURE */ return(0); } pal = (svrattrl *)malloc(tempal.al_tsize); if (pal == NULL) { fprintf(stderr, "malloc failed\n"); exit(1); } *pal = tempal; /* read in the actual attribute data */ amt = pal->al_tsize - sizeof(svrattrl); i = read(fd, (char *)pal + sizeof(svrattrl), amt); if (i != amt) { fprintf(stderr, "short read of attribute\n"); exit(2); } pal->al_name = (char *)pal + sizeof(svrattrl); if (pal->al_rescln != 0) pal->al_resc = pal->al_name + pal->al_nameln; else pal->al_resc = NULL; if (pal->al_valln != 0) pal->al_value = pal->al_name + pal->al_nameln + pal->al_rescln; else pal->al_value = NULL; printf("%s", pal->al_name); if (pal->al_resc != NULL) { printf(".%s", pal->al_resc); } printf(" = "); if (pal->al_value != NULL) { printf("%s", pal->al_value); } printf("\n"); free(pal); return(1); } void dumpdb(char *file) { int fp; int amt; struct server xserver; fp = open(file, O_RDONLY, 0); if (fp < 0) { perror("open failed"); fprintf(stderr, "unable to open file %s\n", file); exit(1); } amt = read(fp, &xserver.sv_qs, sizeof(xserver.sv_qs)); if (amt != sizeof(xserver.sv_qs)) { fprintf(stderr, "Short read of %d bytes, file %s\n", amt, file); } /* print out job structure */ prt_server_struct(&xserver); /* now do attributes, one at a time */ if (no_attributes == 0) { printf("--attributes--\n"); while (read_attr(fp)); } close(fp); printf("\n"); } /* END dumpdb */ int main( int argc, char *argv[]) { int err = 0; int f; char defdb[1024]; extern int optind; sprintf(defdb, "%s/%s/%s", PBS_SERVER_HOME, PBS_SVR_PRIVATE, PBS_SERVERDB); while ((f = getopt(argc, argv, "a")) != EOF) { switch (f) { case 'a': no_attributes = 1; break; default: err = 1; break; } } if (err) { fprintf(stderr, "usage: %s [-a] [file]...}\n", argv[0]); return(1); } if (optind == argc) { dumpdb(defdb); } else { for (f = optind;f < argc;++f) { dumpdb(argv[f]); } } return(0); } /* END main() */ /* END printserverdb.c */ torque-2.4.16/src/tools/printtracking.c0000664000113300011330000001276311272401240015010 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "work_task.h" #include "tracking.h" /* struct tracking { time_t tk_mtime; int tk_hopcount; char tk_jobid[PBS_MAXSVRJOBID+1]; char tk_location[PBS_MAXDEST+1]; char tk_state; }; */ void prt_track_struct(struct tracking *ptrack) { if (ptrack->tk_jobid[0] == '\0') return; printf("---------------------------------------------------\n"); printf("jobid:\t%s\n", ptrack->tk_jobid); printf("mtime:\t\t%lu\n", (unsigned long int)ptrack->tk_mtime); printf("hopcount:\t%d\n", ptrack->tk_hopcount); printf("location:\t%s\n", ptrack->tk_location); printf("state:\t\t%c\n", ptrack->tk_state); } int main(int argc, char *argv[]) { int amt; int f; int fp; struct tracking track; if (argc < 1) { fprintf(stderr, "usage: %s file [file ...]\n", argv[0]); return 1; } for (f = 1; f < argc; ++f) { fp = open(argv[f], O_RDONLY, 0); if (fp < 0) { perror("open failed"); fprintf(stderr, "unable to open file %s\n", argv[f]); exit(1); } while ((amt = read(fp, &track, sizeof(track))) == sizeof(track)) { prt_track_struct(&track); } (void)close(fp); printf("\n"); } return (0); } torque-2.4.16/src/tools/init.d/0000777000113300011330000000000011614035203013225 500000000000000torque-2.4.16/src/tools/init.d/pbs0000775000113300011330000001037711272401237013671 00000000000000#!/bin/sh # # PBS init script # # $1 can be: # start - start PBS # stop - terminate PBS # restart - terminate and start PBS # status - report PBS deamon pids # # # chkconfig: 2345 90 10 # description: The Portable Batch System (PBS) is a flexible batch software # processing system developed at NASA Ames Research Center. It operates on # networked, ulti-platform UNIX environments, including heterogeneous clusters # of workstations, supercomputers, and massively parallel systems. # if [ -f /etc/pbs.conf ] ; then . /etc/pbs.conf else echo "***" echo "*** Can not find /etc/pbs.conf" echo "***" exit 1 fi update_pids() { if [ -f ${pbs_home}/server_priv/server.lock ] ; then pbs_server_pid=`cat ${pbs_home}/server_priv/server.lock` else pbs_server_pid=-1 fi if [ -f ${pbs_home}/mom_priv/mom.lock ] ; then pbs_mom_pid=`cat ${pbs_home}/mom_priv/mom.lock` else pbs_mom_pid=-1 fi if [ -f ${pbs_home}/sched_priv/sched.lock ] ; then pbs_sched_pid=`cat ${pbs_home}/sched_priv/sched.lock` else pbs_sched_pid=-1 fi } # check_started - check if a particular pid is the program which is expected. # pbs stores the pid of the currently running incarnation of # itself. This function is used to see if that pid is correct # program. # $1 - the pid # $2 - the program name (pbs_server pbs_mom pbs_sched) # # return value: 0 - program is already running # 1 - program is not running # : check_started check_started() { ps_out=`ps -p $1 -o args | tail +2` if [ -z "${ps_out}" ] ; then return 1; fi # strip out everything except executable name prog_name=`echo ${ps_out} | awk '{print $1}' | awk -F/ '{print $NF}'` if [ ${prog_name} = $2 ] ; then return 0; fi return 1; } # check_prog - this function checks to see if a prog is still running. It will # get the pid out of the prog.lock file and run check_started # on that pid. # # $1 is either "server" "mom" or "sched" # # return value: 0 - program is still running # 1 - program is not running # : check_prog check_prog() { pid_file=${pbs_home}/${1}_priv/${1}.lock if [ -f ${pid_file} ] ; then pid=`cat ${pid_file}` if [ -n "${pid}" ] ; then if check_started "${pid}" "pbs_${1}" ; then return 0 else return 1 fi else return 1 fi fi # Since the pid file does not exist, PBS has never been run return 1 } : main code # lets see how we were called case "$1" in start) echo "Starting PBS" if [ "${start_server}" -gt 0 ] ; then if check_prog "server" ; then echo "PBS Server already running." else ${pbs_exec}/sbin/pbs_server echo "PBS server" fi fi if [ "${start_mom}" -gt 0 ] ; then if check_prog "mom" ; then echo "PBS mom already running." else ${pbs_exec}/sbin/pbs_mom echo "PBS mom" fi fi if [ "${start_sched}" -gt 0 ] ; then if check_prog "sched" ; then echo "PBS schedular already running." else ${pbs_exec}/sbin/pbs_sched echo "PBS sched" fi fi ;; stop) update_pids echo "Stopping PBS" if [ "${start_server}" -gt 0 ] ; then if check_prog "server" ; then ${pbs_exec}/bin/qterm echo "PBS server - was pid: ${pbs_server_pid}" fi fi if [ "${start_mom}" -gt 0 ] ; then if check_prog "mom" ; then kill ${pbs_mom_pid} echo "PBS mom - was pid: ${pbs_mom_pid}" fi fi if [ "${start_sched}" -gt 0 ] ; then if check_prog "sched" ; then kill ${pbs_sched_pid} echo "PBS sched - was pid: ${pbs_sched_pid}" fi fi ;; restart) echo "Restarting PBS" $0 stop $0 start ;; status) update_pids if [ "${start_server}" -gt 0 ] ; then if check_prog "server" ; then echo "pbs_server is pid ${pbs_server_pid}" else echo "pbs server is not running." fi fi if [ "${start_mom}" -gt 0 ] ; then if check_prog "mom" ; then echo "pbs_mom is pid ${pbs_mom_pid}" else echo "pbs_mom is not running" fi fi if [ "${start_sched}" -gt 0 ] ; then if check_prog "sched" ; then echo "pbs_sched is pid ${pbs_sched_pid}" else echo "pbs_sched is not running" fi fi ;; *) echo "Usage: pbs {start|stop|restart|status}" exit 1 esac torque-2.4.16/src/gui/0000777000113300011330000000000011614035201011462 500000000000000torque-2.4.16/src/gui/pbs.tcl0000664000113300011330000015235211272401236012705 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ###################################################################################### # This file contains PBS dependent commands. ###################################################################################### # getdata: Get data from a list of servers and load the widgets: jobsListbox, # hostsListbox, and queuesListbox. proc getdata {server_names {jobs_info_only 0}} { global HOSTS_COLUMN_LABEL QUEUES_COLUMN_LABEL JOBS_COLUMN_LABEL \ HOSTS_COLUMN_HEADER QUEUES_COLUMN_HEADER JOBS_COLUMN_HEADER \ LINES_TO_IGNORE HOSTS_LISTBOX_KEY QUEUES_LISTBOX_KEY \ JOBS_LISTBOX_KEY HOSTS_LISTBOX_FKEY QUEUES_LISTBOX_FKEY \ JOBS_LISTBOX_FKEY PBS_QSTATDUMP_CMD \ hostsListbox queuesListbox jobsListbox \ hostsSelected queuesSelected jobsSelected \ hostinfo jobinfo qinfo tk_version timeout_secs busy_cursor if {$jobs_info_only} { set cmd_pipeline "$PBS_QSTATDUMP_CMD -t $timeout_secs -J [build_sel_options] $server_names" catch {unset jobinfo} $jobsListbox delete 0 end } else { set cmd_pipeline "$PBS_QSTATDUMP_CMD -t $timeout_secs [build_sel_options] $server_names" catch {unset hostinfo qinfo jobinfo} $hostsListbox delete 0 end $queuesListbox delete 0 end $jobsListbox delete 0 end } set f [cmdExec_bg $cmd_pipeline] if { $f == -1 } { remove_busy_cursor return } set where "" set cnt 0 while {[gets $f line] >= 0} { update idletasks if {[string compare $HOSTS_COLUMN_HEADER ""] != 0 && \ [regexp "^:($HOSTS_COLUMN_HEADER)" $line m item]} { set where "hosts" set HOSTS_COLUMN_LABEL [string trimleft $line ":"] } elseif {[string compare $QUEUES_COLUMN_HEADER ""] != 0 && \ [regexp "^:($QUEUES_COLUMN_HEADER)" $line m item]} { set where "queues" set QUEUES_COLUMN_LABEL [string trimleft $line ":"] } elseif {[string compare $JOBS_COLUMN_HEADER ""] != 0 && \ [regexp "^:($JOBS_COLUMN_HEADER)" $line m item]} { set where "jobs" set JOBS_COLUMN_LABEL [string trimleft $line ":"] } elseif {[string compare $LINES_TO_IGNORE ""] != "" && \ [regexp "($LINES_TO_IGNORE)" $line m item]} { continue } else { set fkey "" switch -exact -- $where { "hosts" { set fkey $HOSTS_LISTBOX_FKEY } "queues" { set fkey $QUEUES_LISTBOX_FKEY } "jobs" { set fkey $JOBS_LISTBOX_FKEY } } set fkeyval "" foreach i $fkey { if {[string compare $fkeyval ""] == 0} { set fkeyval [lindex $line $i] } else { set fkeyval "$fkeyval@[lindex $line $i]" } } switch -exact -- $where { "hosts" { if [info exists hostinfo($fkeyval)] { set hostinfo($fkeyval) "$hostinfo($fkeyval) \"$line\"" } else { set hostinfo($fkeyval) \"$line\" } $hostsListbox insert end $line set do_select "[lsearch -exact $hostsSelected $fkeyval]" if {$do_select != -1} { if {$tk_version < 4.0} { listbox_non_contiguous_selection $hostsListbox \ [$hostsListbox curselect] end } else { $hostsListbox selection anchor end $hostsListbox selection set anchor end $hostsListbox see end } } } "queues" { if [info exists qinfo($fkeyval)] { set qinfo($fkeyval) "$qinfo($fkeyval) \"$line\"" } else { set qinfo($fkeyval) "\"$line\"" } set do_add "[lsearch -exact $hostsSelected $fkeyval]" if {$do_add != -1} { $queuesListbox insert end $line set do_select "[lsearch -exact $queuesSelected \ [strget_keyvals $line $QUEUES_LISTBOX_KEY "@"]]" if {$do_select != -1} { if {$tk_version < 4.0} { listbox_non_contiguous_selection $queuesListbox \ [$queuesListbox curselect] end } else { $queuesListbox selection anchor end $queuesListbox selection set anchor end $queuesListbox see end } } } } "jobs" { if [info exists jobinfo($fkeyval)] { set jobinfo($fkeyval) "$jobinfo($fkeyval) \"$line\"" } else { set jobinfo($fkeyval) "\"$line\"" } set do_add "[lsearch -exact $queuesSelected $fkeyval]" if {$do_add != -1} { $jobsListbox insert end $line incr cnt set do_select "[lsearch -exact $jobsSelected \ [strget_keyvals $line $JOBS_LISTBOX_KEY "@"]]" if {$do_select != -1} { if {$tk_version < 4.0} { listbox_non_contiguous_selection $jobsListbox \ [$jobsListbox curselect] end } else { $jobsListbox selection anchor end $jobsListbox selection set anchor end $jobsListbox see end } } } } } } InfoBox_sendmsg "." 0 1 } if [catch {close $f} errmesg] { InfoBox_sendmsg "done: $errmesg" 0 1 5 } else { InfoBox_sendmsg "done." 0 1 5 } remove_busy_cursor } # loadJobs: loads the jobs listbox with appropriate entries. proc loadJobs {} { global QUEUES_LISTBOX_KEY queuesListbox jobsListbox jobinfo q_selection \ queuesSelected jobsSelMode $jobsListbox delete 0 end set jobsSelMode "Select All" set jobsSelected "" foreach el $queuesSelected { catch { eval $jobsListbox insert end $jobinfo($el) } } update idletasks } # loadQueues: loads the queues listbox with appropriate entries. proc loadQueues {} { global HOSTS_LISTBOX_KEY queuesListbox hostsListbox jobsListbox qinfo \ h_selection hostsSelected queuesSelected queuesSelMode jobsSelected \ jobsSelMode $queuesListbox delete 0 end set queuesSelMode "Select All" set queuesSelected "" $jobsListbox delete 0 end set jobsSelMode "Select All" set jobsSelected "" foreach el $hostsSelected { catch { eval $queuesListbox insert end $qinfo($el) } } update idletasks } # Obtain detailed information about the selected host server in the HOSTS # list box. proc getHostsDetail {} { global hostsSelected PBS_HOSTS_DETAIL_CMD if {[string compare $hostsSelected ""] == 0} { popupInfoBox "" "Please select a server host(s) to query." return } win_cmdExec "" "$PBS_HOSTS_DETAIL_CMD $hostsSelected" update idletasks } # Obtain detailed information about the selected queue or queues in the QUEUES # list box. proc getQueuesDetail {} { global queuesSelected PBS_QUEUES_DETAIL_CMD if {[string compare $queuesSelected ""] == 0} { popupInfoBox "" "Please select a queue(s) to query." return } win_cmdExec "" "$PBS_QUEUES_DETAIL_CMD $queuesSelected" update idletasks } # Obtain detailed information about the selected job or jobs in the JOBS # list box. proc getJobsDetail {} { global jobsSelected PBS_JOBS_DETAIL_CMD jobsListbox JOBS_LISTBOX_KEY if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to query." return } win_cmdExec "" "$PBS_JOBS_DETAIL_CMD $jobsSelected" update idletasks } proc runDelete {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to delete." return } qdel } proc runHold {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to hold." return } qhold } proc runRelease {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to release." return } qrls } proc runRerun {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected cmdpath SERVER_HOSTS if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to requeue/rerun." return } set exitcode [win_cmdExec "" "$cmdpath(QRERUN) $jobsSelected"] if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] } } proc runRun {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected cmdpath SERVER_HOSTS if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to run." return } set exitcode [win_cmdExec "" "$cmdpath(QRUN) $jobsSelected"] if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] } } proc runQsig {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to signal." return } qsig } proc runQmsg {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to send message to." return } qmsg } proc runQmove {} { global jobsListbox queuesListbox JOBS_LISTBOX_KEY QUEUES_LISTBOX_KEY global jobsSelected if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to move into another queue." return } qmove } proc runQstop {} { global queuesSelected cmdpath SERVER_HOSTS if {[string compare $queuesSelected ""] == 0} { popupInfoBox "" "Please select a queue(s) to stop." return } set exitcode [win_cmdExec "" "$cmdpath(QSTOP) $queuesSelected"] update idletasks if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS] } } proc runQstart {} { global queuesSelected cmdpath SERVER_HOSTS if {[string compare $queuesSelected ""] == 0} { popupInfoBox "" "Please select a queue(s) to start." return } set exitcode [win_cmdExec "" "$cmdpath(QSTART) $queuesSelected"] update idletasks if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS] } } proc runQenable {} { global queuesSelected cmdpath SERVER_HOSTS if {[string compare $queuesSelected ""] == 0} { popupInfoBox "" "Please select a queue(s) to enable." return } set exitcode [win_cmdExec "" "$cmdpath(QENABLE) $queuesSelected"] if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS] } } proc runQdisable {} { global queuesSelected cmdpath SERVER_HOSTS if {[string compare $queuesSelected ""] == 0} { popupInfoBox "" "Please select a queue(s) to disable." return } set exitcode [win_cmdExec "" "$cmdpath(QDISABLE) $queuesSelected"] if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS] } } proc runQalter {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected if {[string compare $jobsSelected ""] == 0} { popupInfoBox "" "Please select a job(s) to modify." return } qalter } proc runQorder {} { global jobsListbox JOBS_LISTBOX_KEY jobsSelected cmdpath SERVER_HOSTS if {[llength $jobsSelected] != 2} { popupInfoBox "" "Please select 2 jobs to exchange positions first" return } set exitcode [win_cmdExec "" "$cmdpath(QORDER) $jobsSelected"] if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] } } proc runQterm {} { global hostsListbox HOSTS_LISTBOX_KEY hostsSelected if { [string compare $hostsSelected ""] == 0 } { popupInfoBox "" "Please select a server host(s) to shutdown." return } qterm } proc runQsub {} { global hostsListbox HOSTS_LISTBOX_KEY hostsSelected submitHost if { [string compare $hostsSelected ""] == 0 } { popupInfoBox "" "Please select the server host to submit job(s) to." } elseif { [llength $hostsSelected] != 1 } { serverSelect update idletasks after 250 qsub } else { set submitHost $hostsSelected qsub } } # build_opt: procedure that builds the options list for submitting a PBS # job. The argument 'cmdline' says that if set to 1, then command line options # will be created; otherwise, PBS directive lines will be created using # 'pbsdir'. # OPTIONS: # pbsdir - the PBS directive line parse string. # do_qalter - if options are built for qalter (boolean). proc build_opt {cmdline {pbsdir "#PBS"} {do_qalter 0}} { global options if {$do_qalter} { global qalterv def_qalter set matchDbox ".qalter" set ARR qalterv set default def_qalter } else { global qsubv def_qsub set matchDbox ".qsub" set ARR qsubv set default def_qsub } foreach el [array names options] { set dbox [lindex $options($el) 0] set optLetter [lindex $options($el) 1] set opt_spec [lindex $options($el) 2] if { [lsearch -exact $dbox $matchDbox] != -1 && \ [info exists ${ARR}($el)] && \ [string compare [set ${ARR}($el)] ""] != 0 && \ ( ![info exists ${default}($el)] || \ [string compare [set ${ARR}($el)] [set ${default}($el)]] != 0 ) } { if {![info exists opt($optLetter)]} { if { [string compare $opt_spec "toggle"] == 0 } { append opt($optLetter) "" } else { append opt($optLetter) "[set ${ARR}($el)]" } } else { append opt($optLetter) "," "[set ${ARR}($el)]" } } } set opts "" if [info exists opt] { foreach el [array names opt] { if {$cmdline} { append opts "$el $opt($el) " } else { append opts "$pbsdir $el $opt($el)\n" } } } return $opts } # set_opt_default: set qsub/qalter widget default options. proc set_opt_default {array {do_main 1} {do_depend 0} {do_staging 0} \ {do_misc 0} {do_qalter 0} {do_email 0} } { upvar $array ARR global default if {!$do_qalter} { set def_idx 0 } else { set def_idx 1 } foreach el [array names default] { set defval [lindex $default($el) $def_idx] set dbox [lindex $default($el) 2] if { ( $do_main && \ [lsearch -regexp $dbox ".qsub|.qalter|.dateTime"] != -1) || \ ( $do_depend && [lsearch -exact $dbox ".depend"] != -1 ) || \ ( $do_staging && [lsearch -exact $dbox ".staging"] != -1 ) || \ ( $do_misc && [lsearch -exact $dbox ".misc"] != -1 ) || \ ( $do_email && [lsearch -exact $dbox ".email"] != -1 ) } { set ARR($el) $defval } } } # load_qsub_input: Load the widget values with input as obtained from the string # 'parseList'. # RETURNS 0 if successful; 1 otherwise. proc load_qsub_input {fd} { global qsubv default tk_version qsubDialogBox \ qsubv_res qsubv_val qsubv_evar qsubv_eval qsubv_notify_addr \ qsubv_after_parent_id qsubv_afterok_parent_id \ qsubv_afternotok_parent_id qsubv_afterany_parent_id \ qsubv_before_parent_id qsubv_beforeok_parent_id \ qsubv_beforenotok_parent_id qsubv_beforeany_parent_id \ qsubv_stagein_host qsubv_stagein_input qsubv_stagein_local \ qsubv_stageout_local qsubv_stageout_host qsubv_stageout_output \ qsubv_shellp qsubv_shellh qsubv_groupg qsubv_grouph \ qsubv_useru qsubv_userh set attrlist "" set stageinList "" set stageoutList "" set userList "" set shellList "" set groupList "" set dependList "" set emailList "" set queueName "" set serverName "" while {[gets $fd data] >= 0} { if {[regexp "^$" $data]} { continue } if {[regexp "(\[^ ]+) = (.+)$" $data line attribute value]} { switch -regexp -- $attribute { "Execution_Time" { set qsubv(qtime) "later" set_dateTime qsubv(qtimeMon) qsubv(qtimeDay) qsubv(qtimeYear) \ qsubv(qtimeHH) qsubv(qtimeMM) qsubv(qtimeSS) 0 \ $value } "Job_Name" { set qsubv(jobName) $value } "Priority" { set qsubv(priority) [string trim $value "+"] } "Checkpoint" { if {[string compare $value "u"] != 0} { set qsubv(checkpoint_job) 1 if [regexp "^c=(\[^ ]+)" $value match cpu_min] { set qsubv(checkpoint_option) "c=" set qsubv(checkpoint_min) $cpu_min } else { set qsubv(checkpoint_option) $value } } } "queue" { set queueName $value } "server" { set serverName $value } "Resource_List" { if {[string compare $attrlist ""] == 0} { ;# If first one set attrlist $value } else { append attrlist ",$value" } } "Hold_Types" { if [string match $value "u"] { set qsubv(holdjob) 1 } else { set qsubv(holdjob) 0 } } "Rerunable" { if {[string compare $value ""] != 0 && \ [string compare $value "True"] == 0} { set qsubv(rerun) 1 set qsubv(rerunnable) y } elseif {[string compare $value ""] != 0} { set qsubv(rerun) 1 set qsubv(rerunnable) n } } "Join_Path" { set qsubv(merge) $value } "Keep_Files" { if [regexp "o" $value] { set qsubv(stdoutRet) o } if [regexp "e" $value] { set qsubv(stderrRet) e } if [regexp "n" $value] { set qsubv(stdoutRet) "" set qsubv(stderrRet) "" } } "Output_Path" { regexp "(\[^:]+):(\[^ ]+)" $value match host file set qsubv(stdoutHost) $host set qsubv(stdoutFile) $file } "Error_Path" { regexp "(\[^:]+):(\[^ ]+)" $value match host file set qsubv(stderrHost) $host set qsubv(stderrFile) $file } "Export_Current_Env" { set qsubv(export_current_var) $value } "Variable_List" { set qsubv(exportVar) 1 load_argstr $value , {qsubv_evar qsubv_eval} {=} } "depend" { if {[string compare $dependList ""] == 0} { ;# If first one set dependList $value } else { append dependList ",$value" } } "stagein" { if {[string compare $stageinList ""] == 0} { ;# If first one set stageinList $value } else { append stageinList ",$value" } } "stageout" { if {[string compare $stageoutList ""] == 0} { ;# If first one set stageoutList $value } else { append stageoutList ",$value" } } "Mail_Points" { if [regexp "a" $value] { set qsubv(notify_opt(abort)) "a" } else { set qsubv(notify_opt(abort)) "" } if [regexp "b" $value] { set qsubv(notify_opt(begin)) "b" } else { set qsubv(notify_opt(begin)) "" } if [regexp "e" $value] { set qsubv(notify_opt(end)) "e" } else { set qsubv(notify_opt(end)) "" } if [regexp "n" $value] { set qsubv(notify_opt(abort)) "" set qsubv(notify_opt(begin)) "" set qsubv(notify_opt(end)) "" } } "Mail_Users" { if {[string compare $emailList ""] == 0} { ;# If first one set emailList $value } else { append emailList ",$value" } } "Shell_Path_List" { if {[string compare $shellList ""] == 0} { ;# If first one set shellList $value } else { append shellList ",$value" } } "User_List" { if {[string compare $userList ""] == 0} { ;# If first one set userList $value } else { append userList ",$value" } } "group_list" { if {[string compare $groupList ""] == 0} { ;# If first one set groupList $value } else { append groupList ",$value" } } "Account_Name" { set qsubv(acctName) $value } "Buffer_File" { ########## Load the contents set qsubv(bufferFile) $value } } ;# switch } ;# if } ;# while if {[string compare $attrlist ""] != 0} { load_argstr $attrlist , {qsubv_res qsubv_val} {=} } if {[string compare $stageinList ""] != 0} { load_argstr $stageinList , \ {qsubv_stagein_local qsubv_stagein_host qsubv_stagein_input} {@ :} } if {[string compare $stageoutList ""] != 0} { load_argstr $stageoutList , \ {qsubv_stageout_local qsubv_stageout_host qsubv_stageout_output} \ {@ :} } if {[string compare $userList ""] != 0} { load_argstr $userList , {qsubv_useru qsubv_userh} {@} } if {[string compare $shellList ""] != 0} { load_argstr $shellList , {qsubv_shellp qsubv_shellh} {@} } if {[string compare $groupList ""] != 0} { load_argstr $groupList , {qsubv_groupg qsubv_grouph} {@} } if {[string compare $emailList ""] != 0} { load_argstr $emailList , {qsubv_notify_addr} {} } if { [string compare $dependList ""] != 0 } { deconstruct_array_args $dependList dependency_list "," foreach i [array names dependency_list] { if [regexp "after:(.+)" $dependency_list($i) match joblist] { if { [string compare $qsubv(afterJobs) ""] == 0 } { set qsubv(afterJobs) $joblist } else { append qsubv(afterJobs) ":$joblist" } } elseif [regexp "afterok:(.+)" $dependency_list($i) match \ joblist] { if { [string compare $qsubv(afterokJobs) ""] == 0 } { set qsubv(afterokJobs) $joblist } else { append qsubv(afterokJobs) ":$joblist" } } elseif [regexp "afternotok:(.+)" $dependency_list($i) match \ joblist] { if { [string compare $qsubv(afternotokJobs) ""] == 0 } { set qsubv(afternotokJobs) $joblist } else { append qsubv(afternotokJobs) ":$joblist" } } elseif [regexp "afterany:(.+)" $dependency_list($i) match \ joblist] { if { [string compare $qsubv(afteranyJobs) ""] == 0 } { set qsubv(afteranyJobs) $joblist } else { append qsubv(afteranyJobs) ":$joblist" } } elseif [regexp "before:(.+)" $dependency_list($i) match \ joblist] { if { [string compare $qsubv(beforeJobs) ""] == 0 } { set qsubv(beforeJobs) $joblist } else { append qsubv(beforeJobs) ":$joblist" } } elseif [regexp "beforeok:(.+)" $dependency_list($i) match \ joblist] { if { [string compare $qsubv(beforeokJobs) ""] == 0 } { set qsubv(beforeokJobs) $joblist } else { append qsubv(beforeokJobs) ":$joblist" } } elseif [regexp "beforenotok:(.+)" $dependency_list($i) match \ joblist] { if { [string compare $qsubv(beforenotokJobs) ""] == 0 } { set qsubv(beforenotokJobs) $joblist } else { append qsubv(beforenotokJobs) ":$joblist" } } elseif [regexp "beforeany:(.+)" $dependency_list($i) match \ joblist] { if { [string compare $qsubv(beforeanyJobs) ""] == 0 } { set qsubv(beforeanyJobs) $joblist } else { append qsubv(beforeanyJobs) ":$joblist" } } elseif [regexp "on:(.+)" $dependency_list($i) match count] { set qsubv(oncount) $count } elseif [regexp "synccount:(.+)" $dependency_list($i) match \ count] { set qsubv(concur) "synccount" set qsubv(synccountCnt) $count } elseif [regexp "syncwith:(.+)" $dependency_list($i) match \ jobid] { set qsubv(concur) "syncwith" set qsubv(syncwithJob) $jobid } } } if {[string compare $queueName ""] != 0} { set quelist [get_keyvals $qsubv(destLbox) 0 "" " " "all"] if { [string compare [string index $queueName 0] "@"] != 0 } { set dest_idx [lsearch -regexp $quelist "^($queueName)$|^($queueName)@"] } else { set dest_idx [lsearch -regexp $quelist "^$queueName"] } if {[string compare $quelist ""] == 0 || $dest_idx == -1} { if { [string compare $serverName ""] != 0 } { $qsubv(destLbox) insert 0 $queueName@$serverName } else { $qsubv(destLbox) insert 0 $queueName } if { $tk_version < 4.0 } { $qsubv(destLbox) select from 0 } else { $qsubv(destLbox) select clear 0 end ;# since it is a single ;# single selection listbox $qsubv(destLbox) select anchor 0 $qsubv(destLbox) select set anchor 0 } $qsubv(destLbox) yview 0 } else { if { $tk_version < 4.0 } { $qsubv(destLbox) select from $dest_idx } else { $qsubv(destLbox) select clear 0 end ;# since it is a single ;# single selection listbox $qsubv(destLbox) select anchor $dest_idx $qsubv(destLbox) select set anchor $dest_idx } $qsubv(destLbox) yview $dest_idx } } if [catch {close $fd} errmesg] { popupInfoBox $qsubDialogBox "Loading of script failed: $errmesg" return 1 } return 0 } # oper: retains the appropriate comparison operator. proc oper {operator} { switch -exact -- $operator { "=" {return ".eq."} "!=" {return ".ne."} ">=" {return ".ge."} ">" {return ".gt."} "<=" {return ".le."} "<" {return ".lt."} default {return ""} } } # oper_invert: the inverse of the 'oper'. proc oper_invert {str} { switch -exact -- $str { "eq" {return "="} "ne" {return "!="} "ge" {return ">="} "gt" {return ">"} "le" {return "<="} "lt" {return "<"} default {return ""} } } # cvtdatetime_arg: converts to datetime argument suitable for PBS commands execution, # given the month (mon), day (day), year (year), hour (hh), minute (mm), and # seconds (ss) . proc cvtdatetime_arg {mon day year hh mm ss} { switch -exact -- $mon { "Jan" {set cmon 01} "Feb" {set cmon 02} "Mar" {set cmon 03} "Apr" {set cmon 04} "May" {set cmon 05} "Jun" {set cmon 06} "Jul" {set cmon 07} "Aug" {set cmon 08} "Sep" {set cmon 09} "Oct" {set cmon 10} "Nov" {set cmon 11} "Dec" {set cmon 12} default {set cmon ""} } if {[string length $day] < 2 && $day >= 0 && $day <= 9} { set cday "0$day" } else { set cday "$day" } set cyear $year if {[string length $hh] < 2 && $hh >= 0 && $hh <= 9} { set chh "0$hh" } else { set chh "$hh" } if {[string length $mm] < 2 && $mm >= 0 && $mm <= 9} { set cmm "0$mm" } else { set cmm "$mm" } if {[string length $ss] < 2 && $ss >= 0 && $ss <= 9} { set css "0$ss" } else { set css "$ss" } return "${cyear}${cmon}${cday}${chh}${cmm}.${css}" } # build_sel_options: builds the options to be used for running PBS comand qselect. proc build_sel_options {} { global selv select_opt set options "" foreach el [array names select_opt] { set val [lindex $selv($el) 1] if {[string compare $val ""] != 0 && \ [string compare $val "-ANY-"] != 0} { append options "$select_opt($el) $val " } } return $options } # xpbs_help: brings up an help information box displaying things related to # 'help_category'. proc xpbs_help {help_category callerDialogBox} { global helpdir if { [string compare $callerDialogBox ""] != 0 } { win_cmdExec $callerDialogBox "cat $helpdir/${help_category}.hlp" } else { win_cmdExec "" "cat $helpdir/${help_category}.hlp" } } # resources_help: brings up an help information box displaying things related # to PBS resources. proc resources_help {callerDialogBox suffix} { if { [string compare $callerDialogBox ""] != 0 } { win_cmdExec2 $callerDialogBox "man pbs_resources_$suffix | col -b" } else { win_cmdExec2 "" "man pbs_resources_$suffix | col -b" } } # set_default_qsub_main: set the default widget values for qsub main window proc set_default_qsub_main {} { global qsubv env qsubv_res qsubv_val qsubv_evar qsubv_eval tk_version \ def_qsub if {$tk_version < 4.0} { $qsubv(destLbox) select from 0 } else { $qsubv(destLbox) select clear 0 end ;# since it is a single ;# single selection listbox $qsubv(destLbox) select anchor 0 $qsubv(destLbox) select anchor 0 $qsubv(destLbox) select set anchor 0 } $qsubv(destLbox) yview 0 set qsubv(script_name) $def_qsub(script_name) set qsubv(jobName) $def_qsub(jobName) set qsubv(acctName) $def_qsub(acctName) set qsubv(destination) $def_qsub(destination) set qsubv(notify_opt(begin)) $def_qsub(notify_opt\(begin\)) set qsubv(notify_opt(end)) $def_qsub(notify_opt\(end\)) clear_array qsubv_res clear_array qsubv_val clear_array qsubv_evar clear_array qsubv_eval set qsubv(pbs_prefix) $def_qsub(pbs_prefix) set qsubv(priority) $def_qsub(priority) set qsubv(qtime) $def_qsub(qtime) set qsubv(notify_opt(abort)) $def_qsub(notify_opt\(abort\)) set qsubv(holdjob) 0 set qsubv(export_current_var) $def_qsub(export_current_var) set qsubv(exportVar) $def_qsub(exportVar) set qsubv(merge) $def_qsub(merge) set qsubv(stdoutRet) $def_qsub(stdoutRet) set qsubv(stderrRet) $def_qsub(stderrRet) set qsubv(stdoutFile) $def_qsub(stdoutFile) set qsubv(stdoutHost) $def_qsub(stdoutHost) set qsubv(stderrFile) $def_qsub(stderrFile) set qsubv(stderrHost) $def_qsub(stderrHost) init_qsub_main_argstr } proc init_qsub_main_argstr {} { global def_qsub qsubv set qsubv(res_args) $def_qsub(res_args) set qsubv(env_args) $def_qsub(env_args) set qsubv(keep_args) $def_qsub(keep_args) set qsubv(stdoutPath) $def_qsub(stdoutPath) set qsubv(stderrPath) $def_qsub(stderrPath) set qsubv(mail_option) $def_qsub(mail_option) } proc set_default_qsub_concur {} { global qsubv def_qsub concurJob set qsubv(concur) $def_qsub(concur) set qsubv(synccountCnt) $def_qsub(synccountCnt) set qsubv(syncwithJob) $def_qsub(syncwithJob) set concurJob $qsubv(syncwithJob) } proc set_default_qsub_after {} { global qsubv def_qsub afterJob set qsubv(afterJobs) $def_qsub(afterJobs) set qsubv(afterokJobs) $def_qsub(afterokJobs) set qsubv(afternotokJobs) $def_qsub(afternotokJobs) set qsubv(afteranyJobs) $def_qsub(afteranyJobs) set qsubv(oncount) $def_qsub(oncount) set afterJob "" } proc set_default_qsub_before {} { global qsubv def_qsub beforeJob set qsubv(beforeJobs) $def_qsub(beforeJobs) set qsubv(beforeokJobs) $def_qsub(beforeokJobs) set qsubv(beforenotokJobs) $def_qsub(beforenotokJobs) set qsubv(beforeanyJobs) $def_qsub(beforeanyJobs) set beforeJob "" } proc init_qsub_depend_argstr {} { global qsubv def_qsub set qsubv(depend) $def_qsub(depend) } # set_default_qsub_staging: set the default widget values for the qsub staging # window proc set_default_qsub_staging {} { global qsubv qsubv_stagein_host qsubv_stagein_input qsubv_stagein_local \ qsubv_stageout_local qsubv_stageout_host qsubv_stageout_output \ def_qsub clear_array qsubv_stagein_host clear_array qsubv_stagein_input clear_array qsubv_stagein_local clear_array qsubv_stageout_local clear_array qsubv_stageout_host clear_array qsubv_stageout_output init_qsub_staging_argstr } proc init_qsub_staging_argstr {} { global qsubv def_qsub set qsubv(stagein_filelist) $def_qsub(stagein_filelist) set qsubv(stageout_filelist) $def_qsub(stageout_filelist) } # set_default_qsub_misc: set the default widget values for the qsub misc # window proc set_default_qsub_misc {} { global qsubv qsubv_shellp qsubv_shellh qsubv_groupg qsubv_grouph \ qsubv_useru qsubv_userh def_qsub set qsubv(checkpoint_job) $def_qsub(checkpoint_job) set qsubv(checkpoint_option) $def_qsub(checkpoint_option) set qsubv(rerun) $def_qsub(rerun) set qsubv(rerunnable) $def_qsub(rerunnable) set qsubv(checkpoint_min) $def_qsub(checkpoint_min) clear_array qsubv_shellp clear_array qsubv_shellh clear_array qsubv_groupg clear_array qsubv_grouph clear_array qsubv_useru clear_array qsubv_userh init_qsub_misc_argstr } proc init_qsub_misc_argstr {} { global qsubv def_qsub set qsubv(checkpoint_arg) $def_qsub(checkpoint_arg) set qsubv(rerun_args) $def_qsub(rerun_args) set qsubv(group_args) $def_qsub(group_args) set qsubv(shell_args) $def_qsub(shell_args) set qsubv(user_args) $def_qsub(user_args) } # set_default_qsub_datetime: set the default widget values for the qsub # datetime window proc set_default_qsub_datetime {} { global qsubv def_qsub set qsubv(qtimeMon) $def_qsub(qtimeMon) set qsubv(qtimeDay) $def_qsub(qtimeDay) set qsubv(qtimeYear) $def_qsub(qtimeYear) set qsubv(qtimeHH) $def_qsub(qtimeHH) set qsubv(qtimeMM) $def_qsub(qtimeMM) set qsubv(qtimeSS) $def_qsub(qtimeSS) init_qsub_datetime_argstr } proc init_qsub_datetime_argstr {} { global qsubv def_qsub set qsubv(exec_time) $def_qsub(exec_time) } # set_default_qsub_email: set the default widget values for the qsub email # window proc set_default_qsub_email {} { global qsubv qsubv_notify_addr def_qsub clear_array qsubv_notify_addr init_qsub_email_argstr load_argstr $qsubv(email_args) , {qsubv_notify_addr} {} } proc init_qsub_email_argstr {} { global qsubv def_qsub qsubv_notify_addr set qsubv(email_args) $def_qsub(email_args) } # set_default_qalter_main: set the default widget values for the qalter main # window proc set_default_qalter_main {} { global qalterv qalterv_res qalterv_val def_qalter set qalterv(jobName) $def_qalter(jobName) set qalterv(priority) $def_qalter(priority) set qalterv(acctName) $def_qalter(acctName) set qalterv(destination) $def_qalter(destination) set qalterv(priority) $def_qalter(priority) set qalterv(qtime) $def_qalter(qtime) set qalterv(notify_opt(abort)) $def_qalter(notify_opt\(abort\)) set qalterv(notify_opt(begin)) $def_qalter(notify_opt\(begin\)) set qalterv(notify_opt(end)) $def_qalter(notify_opt\(end\)) set qalterv(notify) $def_qalter(notify) set qalterv(hold_action) $def_qalter(hold_action) set qalterv(merge) $def_qalter(merge) set qalterv(retain) $def_qalter(retain) set qalterv(qhold(user)) $def_qalter(qhold\(user\)) set qalterv(qhold(other)) $def_qalter(qhold\(other\)) set qalterv(qhold(system)) $def_qalter(qhold\(system\)) set qalterv(stdoutRet) $def_qalter(stdoutRet) set qalterv(stderrRet) $def_qalter(stderrRet) set qalterv(stdoutFile) $def_qalter(stdoutFile) set qalterv(stdoutHost) $def_qalter(stdoutHost) set qalterv(stderrFile) $def_qalter(stderrFile) set qalterv(stderrHost) $def_qalter(stderrHost) clear_array qalterv_res clear_array qalterv_val init_qalter_main_argstr } proc init_qalter_main_argstr {} { global qalterv def_qalter set qalterv(res_args) $def_qalter(res_args) set qalterv(keep_args) $def_qalter(keep_args) set qalterv(stdoutPath) $def_qalter(stdoutPath) set qalterv(stderrPath) $def_qalter(stderrPath) set qalterv(hold_args) $def_qalter(hold_args) set qalterv(mail_option) $def_qalter(mail_option) } # set_default_qalter_concur: set the default widget values for the qalter # Concur window proc set_default_qalter_concur {} { global qalterv def_qalter concurJob set qalterv(concur) $def_qalter(concur) set qalterv(synccountCnt) $def_qalter(synccountCnt) set qalterv(syncwithJob) $def_qalter(syncwithJob) set qalterv(oncount) $def_qalter(oncount) set concurJob $qalterv(syncwithJob) } # set_default_qalter_after: set the default widget values for the qalter # After Depend window proc set_default_qalter_after {} { global qalterv def_qalter afterJob set qalterv(afterJobs) $def_qalter(afterJobs) set qalterv(afterokJobs) $def_qalter(afterokJobs) set qalterv(afternotokJobs) $def_qalter(afternotokJobs) set qalterv(afteranyJobs) $def_qalter(afteranyJobs) set qalterv(oncount) $def_qalter(oncount) set afterJob "" } # set_default_qalter_before: set the default widget values for the qalter # Before Depend window proc set_default_qalter_before {} { global qalterv def_qalter beforeJob set qalterv(beforeJobs) $def_qalter(beforeJobs) set qalterv(beforeokJobs) $def_qalter(beforeokJobs) set qalterv(beforenotokJobs) $def_qalter(beforenotokJobs) set qalterv(beforeanyJobs) $def_qalter(beforeanyJobs) set beforeJob "" } proc init_qalter_depend_argstr {} { global qalterv def_qalter set qalterv(depend) $def_qalter(depend) } # set_default_qalter_staging: set the default widget values for the qalter # staging window proc set_default_qalter_staging {} { global qalterv qalterv_stagein_host qalterv_stagein_input \ qalterv_stagein_local qalterv_stageout_local qalterv_stageout_host \ qalterv_stageout_output def_qalter clear_array qalterv_stagein_host clear_array qalterv_stagein_input clear_array qalterv_stagein_local clear_array qalterv_stageout_local clear_array qalterv_stageout_host clear_array qalterv_stageout_output init_qalter_staging_argstr } proc init_qalter_staging_argstr {} { global qalterv def_qalter set qalterv(stagein_filelist) $def_qalter(stagein_filelist) set qalterv(stageout_filelist) $def_qalter(stageout_filelist) } # set_default_qalter_misc: set the default widget values for the qalter misc # window proc set_default_qalter_misc {} { global qalterv qalterv_shellp qalterv_shellh qalterv_groupg qalterv_grouph \ qalterv_useru qalterv_userh def_qalter set qalterv(checkpoint_job) $def_qalter(checkpoint_job) set qalterv(checkpoint_option) $def_qalter(checkpoint_option) set qalterv(rerun) $def_qalter(rerun) set qalterv(rerunnable) $def_qalter(rerunnable) set qalterv(checkpoint_min) $def_qalter(checkpoint_min) clear_array qalterv_shellp clear_array qalterv_shellh clear_array qalterv_groupg clear_array qalterv_grouph clear_array qalterv_useru clear_array qalterv_userh init_qalter_misc_argstr } proc init_qalter_misc_argstr {} { global qalterv def_qalter set qalterv(checkpoint_arg) $def_qalter(checkpoint_arg) set qalterv(rerun_args) $def_qalter(rerun_args) set qalterv(group_args) $def_qalter(group_args) set qalterv(shell_args) $def_qalter(shell_args) set qalterv(user_args) $def_qalter(user_args) } # set_default_qalter_datetime: set the default widget values for the qalter # datetime window proc set_default_qalter_datetime {} { global qalterv def_qalter set qalterv(qtimeMon) $def_qalter(qtimeMon) set qalterv(qtimeDay) $def_qalter(qtimeDay) set qalterv(qtimeYear) $def_qalter(qtimeYear) set qalterv(qtimeHH) $def_qalter(qtimeHH) set qalterv(qtimeMM) $def_qalter(qtimeMM) set qalterv(qtimeSS) $def_qalter(qtimeSS) init_qalter_datetime_argstr } proc init_qalter_datetime_argstr {} { global qalterv def_qalter set qalterv(exec_time) $def_qalter(exec_time) } # set_default_qalter_email: set the default widget values for the qalter email # window proc set_default_qalter_email {} { global USER qalterv_notify_addr def_qalter clear_array qalterv_notify_addr init_qalter_email_argstr } proc init_qalter_email_argstr {} { global qalterv def_qalter set qalterv(email_args) $def_qalter(email_args) } proc set_pbs_commands {} { global PBS_HOSTS_DETAIL_CMD PBS_QUEUES_DETAIL_CMD PBS_JOBS_DETAIL_CMD \ PBS_QSTATDUMP_CMD LINES_TO_IGNORE PBS_SCRIPTLOAD_CMD cmdpath \ bindir xpbs_datadump xpbs_scriptload # COMMANDS set PBS_HOSTS_DETAIL_CMD "qstat -B -f" set PBS_QUEUES_DETAIL_CMD "qstat -Q -f" set PBS_JOBS_DETAIL_CMD "qstat -f" if [file exists $bindir/$xpbs_datadump] { set PBS_QSTATDUMP_CMD "$bindir/$xpbs_datadump" } else { set PBS_QSTATDUMP_CMD "./Ccode/$xpbs_datadump" } set LINES_TO_IGNORE "Unknown Job Id" if [file exists $bindir/$xpbs_scriptload] { set PBS_SCRIPTLOAD_CMD "$bindir/$xpbs_scriptload" } else { set PBS_SCRIPTLOAD_CMD "./Ccode/$xpbs_scriptload" } set cmdpath(QRUN) "qrun" set cmdpath(QRERUN) "qrerun" set cmdpath(QSIG) "qsig" set cmdpath(QMSG) "qmsg" set cmdpath(QMOVE) "qmove" set cmdpath(QRLS) "qrls" set cmdpath(QHOLD) "qhold" set cmdpath(QDEL) "qdel" set cmdpath(QSUB) "qsub" set cmdpath(QALTER) "qalter" set cmdpath(QSTOP) "qstop" set cmdpath(QSTART) "qstart" set cmdpath(QDISABLE) "qdisable" set cmdpath(QENABLE) "qenable" set cmdpath(QTERM) "qterm" set cmdpath(QORDER) "qorder" } ################## OPTIONS LIST ########################################### # FORMAT: options(name) = { {.qsub .qalter} optionLetter } # or # options(name) = { {.qsub .qalter} optionLetter } # NOTE: You can put things "toggle" in option-specific that says it a non-arg # option if set. ############################################################################# proc set_pbs_options {} { global options select_opt set options(jobName) { {.qsub .qalter} "-N" } set options(priority) { {.qsub .qalter} "-p" } set options(acctName) { {.qsub .qalter} "-A" } set options(destination) { {.qsub} "-q" } set options(exec_time) { {.qsub .qalter} "-a" } set options(holdjob) { {.qsub} "-h" "toggle" } set options(checkpoint_arg) { {.qsub .qalter} "-c" } set options(rerun_args) { {.qsub .qalter} "-r" } set options(res_args) { {.qsub .qalter} "-l" } set options(merge) { {.qsub .qalter} "-j" } set options(keep_args) { {.qsub .qalter} "-k" } set options(stdoutPath) { {.qsub .qalter} "-o" } set options(stderrPath) { {.qsub .qalter} "-e" } set options(export_current_var) { {.qsub} "-V" "toggle" } set options(env_args) { {.qsub} "-v" } set options(hold_args) { {.qalter} "-h" } set options(depend) { {.qsub .qalter} "-W" } set options(stagein_filelist) { {.qsub .qalter} "-W" } set options(stageout_filelist) { {.qsub .qalter} "-W" } set options(group_args) { {.qsub .qalter} "-W" } set options(mail_option) { {.qsub .qalter} "-m" } set options(email_args) { {.qsub .qalter} "-M" } set options(shell_args) { {.qsub .qalter} "-S" } set options(user_args) { {.qsub .qalter} "-u" } ### FORMAT: select_args(argname) {default_value option} set select_opt(owners_list) "-u" set select_opt(states) "-s" set select_opt(reslist) "-l" set select_opt(exec_time) "-a" set select_opt(acctname) "-A" set select_opt(checkpoint) "-c" set select_opt(hold_list) "-h" set select_opt(priority) "-p" set select_opt(rerun) "-r" set select_opt(jname) "-N" } proc set_pbs_defaults {} { global env def_qsub def_qalter USER set def_qsub(script_name) "" set def_qsub(jobName) "" set def_qsub(acctName) "" set def_qsub(destination) "" set def_qsub(notify_opt(begin)) "" set def_qsub(notify_opt(end)) "" if {[info exists env(PBS_DPREFIX)] && \ [string compare $env(PBS_DPREFIX) ""] != 0} { set def_qsub(pbs_prefix) $env(PBS_DPREFIX) } else { set def_qsub(pbs_prefix) "#PBS" } set def_qsub(priority) 0 set def_qsub(qtime) now set def_qsub(notify_opt(abort)) a set def_qsub(holdjob) 0 set def_qsub(export_current_var) 0 set def_qsub(exportVar) 0 set def_qsub(merge) n set def_qsub(stdoutRet) "" set def_qsub(stderrRet) "" set def_qsub(stdoutFile) "" set def_qsub(stdoutHost) "" set def_qsub(stderrFile) "" set def_qsub(stderrHost) "" set def_qsub(res_args) "" set def_qsub(env_args) "" set def_qsub(keep_args) "" set def_qsub(stdoutPath) "" set def_qsub(stderrPath) "" set def_qsub(mail_option) "" set def_qsub(concur) "syncnone" set def_qsub(synccountCnt) "" set def_qsub(syncwithJob) "" set def_qsub(afterJobs) "" set def_qsub(afterokJobs) "" set def_qsub(afternotokJobs) "" set def_qsub(afteranyJobs) "" set def_qsub(afterJob) "" set def_qsub(beforeJobs) "" set def_qsub(beforeokJobs) "" set def_qsub(beforenotokJobs) "" set def_qsub(beforeanyJobs) "" set def_qsub(oncount) "" set def_qsub(depend) "" set def_qsub(stagein_filelist) "" set def_qsub(stageout_filelist) "" set def_qsub(checkpoint_job) 0 set def_qsub(checkpoint_option) "c=" set def_qsub(rerun) 1 set def_qsub(rerunnable) y set def_qsub(checkpoint_min) "" set def_qsub(checkpoint_arg) "" set def_qsub(rerun_args) "y" set def_qsub(group_args) "" set def_qsub(shell_args) "" set def_qsub(user_args) "" set def_qsub(qtimeMon) "Jan" set def_qsub(qtimeDay) "01" set def_qsub(qtimeYear) "1970" set def_qsub(qtimeHH) "00" set def_qsub(qtimeMM) "00" set def_qsub(qtimeSS) "00" set def_qsub(exec_time) "197001010000.00" set def_qsub(email_args) $USER set def_qalter(jobName) "" set def_qalter(priority) "" set def_qalter(acctName) "" set def_qalter(destination) "" set def_qalter(priority) "" set def_qalter(qtime) now set def_qalter(notify_opt(abort)) "" set def_qalter(notify_opt(begin)) "" set def_qalter(notify_opt(end)) "" set def_qalter(notify) 0 set def_qalter(hold_action) place set def_qalter(merge) nc set def_qalter(retain) retain set def_qalter(qhold(user)) "" set def_qalter(qhold(other)) "" set def_qalter(qhold(system)) "" set def_qalter(stdoutRet) "" set def_qalter(stderrRet) "" set def_qalter(stdoutFile) "" set def_qalter(stdoutHost) "" set def_qalter(stderrFile) "" set def_qalter(stderrHost) "" set def_qalter(res_args) "" set def_qalter(keep_args) "" set def_qalter(stdoutPath) "" set def_qalter(stderrPath) "" set def_qalter(hold_args) "" set def_qalter(mail_option) "" set def_qalter(concur) "syncnone" set def_qalter(afterJobs) "" set def_qalter(afterokJobs) "" set def_qalter(afternotokJobs) "" set def_qalter(afteranyJobs) "" set def_qalter(beforeJobs) "" set def_qalter(beforeokJobs) "" set def_qalter(beforenotokJobs) "" set def_qalter(beforeanyJobs) "" set def_qalter(synccountCnt) "" set def_qalter(syncwithJob) "" set def_qalter(oncount) "" set def_qalter(depend) "" set def_qalter(stagein_filelist) "" set def_qalter(stageout_filelist) "" set def_qalter(checkpoint_job) 0 set def_qalter(checkpoint_option) "c=" set def_qalter(rerun) 0 set def_qalter(rerunnable) y set def_qalter(checkpoint_min) "" set def_qalter(checkpoint_arg) "" set def_qalter(rerun_args) "" set def_qalter(group_args) "" set def_qalter(shell_args) "" set def_qalter(user_args) "" set def_qalter(qtimeMon) "Jan" set def_qalter(qtimeDay) "01" set def_qalter(qtimeYear) "1970" set def_qalter(qtimeHH) "00" set def_qalter(qtimeMM) "00" set def_qalter(qtimeSS) "00" set def_qalter(exec_time) "197001010000.00" set def_qalter(email_args) "" } proc about {} { global bitmap_dir LABELFONT aboutDialogBox XPBS_VERSION set aboutDialogBox ".about" set dbox [popupDialogBox $aboutDialogBox "About..."] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] label $dbox_top.l -bitmap @$bitmap_dir/logo.bmp message $dbox_top.m -font $LABELFONT -justify center -aspect 1000 -text " XPBS $XPBS_VERSION written by Albeaus Bayucan The GUI toolkit used is Tcl/Tk. For more information about PBS, please visit us at: http://www.openpbs.org" set buttons [buildCmdButtons $dbox_bottom {{{ok ok} {notes "release notes"}}}\ x 20m 14 3] set ok_button [lindex $buttons 1] set notes_button [lindex $buttons 2] $ok_button configure -command [list destroy $aboutDialogBox] $notes_button configure -command {xpbs_help notes $aboutDialogBox} register_default_action $aboutDialogBox $ok_button pack $dbox_top.l $dbox_top.m -side left -anchor nw catch {tkwait window $aboutDialogBox} } # pre_build_depend_opt: builds the dependency options suitable for processing # by qsub and qalter. RETURNS: 1 if an error is detected; 0 otherwise. proc pre_build_depend_opt {array def_array} { upvar $array ARR upvar $def_array DEF global dependDialogBox if [regexp "qsub" $array] { init_qsub_depend_argstr } else { init_qalter_depend_argstr } set j 0 switch -exact -- $ARR(concur) { synccount { if {[string compare $ARR(synccountCnt) $DEF(synccountCnt)] != 0} { set dependency_list($j) "synccount:$ARR(synccountCnt)" incr j } } syncwith { if {[string compare $ARR(syncwithJob) $DEF(syncwithJob)] != 0} { set dependency_list($j) "syncwith:$ARR(syncwithJob)" incr j } } } if {[string compare $ARR(afterJobs) $DEF(afterJobs)] != 0} { set dependency_list($j) "after:$ARR(afterJobs)" incr j } if {[string compare $ARR(afterokJobs) $DEF(afterokJobs)] != 0} { set dependency_list($j) "afterok:$ARR(afterokJobs)" incr j } if {[string compare $ARR(afternotokJobs) $DEF(afternotokJobs)] != 0} { set dependency_list($j) "afternotok:$ARR(afternotokJobs)" incr j } if {[string compare $ARR(afteranyJobs) $DEF(afteranyJobs)] != 0} { set dependency_list($j) "afterany:$ARR(afteranyJobs)" incr j } if {[string compare $ARR(oncount) $DEF(oncount)] != 0} { set dependency_list($j) "on:$ARR(oncount)" incr j } if {[string compare $ARR(beforeJobs) $DEF(beforeJobs)] != 0} { set dependency_list($j) "before:$ARR(beforeJobs)" incr j } if {[string compare $ARR(beforeokJobs) $DEF(beforeokJobs)] != 0} { set dependency_list($j) "beforeok:$ARR(beforeokJobs)" incr j } if {[string compare $ARR(beforenotokJobs) $DEF(beforenotokJobs)] != 0} { set dependency_list($j) "beforenotok:$ARR(beforenotokJobs)" incr j } if {[string compare $ARR(beforeanyJobs) $DEF(beforeanyJobs)] != 0} { set dependency_list($j) "beforeany:$ARR(beforeanyJobs)" incr j } set ARR(depend) [construct_array_args dependency_list "," "depend="] catch {unset dependency_list} return 0 } torque-2.4.16/src/gui/misc.tk0000664000113300011330000004350311272401236012705 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # misc: defines the layout and functions of the misc dialog # box. Input focus returns to 'callerDialogBox' upon return. # CONTEXT: executes originally in the context of qsub, but can changed via # setting qalter to 1. proc misc {callerDialogBox {qalter 0}} { global LABELFONT miscDialogBox activeWindow def do_qalter if {!$qalter} { global qsubv ARR def_qsub set ARR "qsubv" set def def_qsub } else { global qalterv ARR def_qalter set ARR "qalterv" set def def_qalter } global ${ARR}_shellp ${ARR}_shellh ${ARR}_groupg ${ARR}_grouph \ ${ARR}_useru ${ARR}_userh set do_qalter $qalter busy_cursor ## Bring up the standard Dialog box ## set miscDialogBox .misc set dbox [popupDialogBox $miscDialogBox "Miscellaneous Dialog" 1 "" $callerDialogBox] set activeWindow($miscDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {cancel "reset to default"} {help help}}} x 10m 16 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdOk configure -command { if [pre_build_misc_opt $ARR $def] { return } destroy $miscDialogBox } $cmdCancel configure -width 18 \ -command { if {$do_qalter} { set_default_qalter_misc } else { set_default_qsub_misc } invoke_misc_widgets $ARR boxLoad [set ${ARR}(shellBox)] boxLoad [set ${ARR}(groupBox)] boxLoad [set ${ARR}(userBox)] } $cmdHelp configure -command {xpbs_help misc $miscDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.o -relief groove -borderwidth 2 frame $dbox_top.s -relief groove -borderwidth 2 frame $dbox_top.g -relief groove -borderwidth 2 frame $dbox_top.u -relief groove -borderwidth 2 frame $dbox_top.r2 frame $dbox_top.r2.sp1 set spinBox [buildSpinbox $dbox_top.r2.sp1 4 1-9999 ${ARR} \ checkpoint_min "CPU minutes" right] set manualCkpntMinFrame [lindex $spinBox 0] set ${ARR}(manualCkpntMin) [lindex $spinBox 1] set ${ARR}(manualCkpntScroll) [lindex $spinBox 2] set ${ARR}(manualCkpntLabel) [lindex $spinBox 3] register_default_action [set ${ARR}(manualCkpntMin)] $cmdOk set radioList [list [concat manual "every" $manualCkpntMinFrame] \ {automatic "when host shuts down"} \ {default "at host's default minimum time"} \ {nocheck "do not checkpoint"} ] pack $dbox_top.r2.sp1 set radiobox [buildRadioboxes $dbox_top.r2 \ [list $radioList] column 0] set radioboxFrame [lindex $radiobox 0] set ${ARR}(radioboxManual) [lindex $radiobox 1] set ${ARR}(radioboxAuto) [lindex $radiobox 2] set ${ARR}(radioboxDefault) [lindex $radiobox 3] set ${ARR}(radioboxNoChkpnt) [lindex $radiobox 4] [set ${ARR}(radioboxManual)] configure -variable ${ARR}(checkpoint_option) \ -value "c=" \ -command { \ enable_spinbox [set ${ARR}(manualCkpntMin)] \ [set ${ARR}(manualCkpntScroll)] \ [set ${ARR}(manualCkpntLabel)] focus [ set ${ARR}(manualCkpntMin)] } [set ${ARR}(radioboxAuto)] configure -variable ${ARR}(checkpoint_option) \ -value "s" -command { \ disable_spinbox [set ${ARR}(manualCkpntMin)] \ [set ${ARR}(manualCkpntScroll)] \ [set ${ARR}(manualCkpntLabel)] } [set ${ARR}(radioboxDefault)] configure -variable ${ARR}(checkpoint_option) \ -value "c" -command { disable_spinbox [set ${ARR}(manualCkpntMin)] \ [set ${ARR}(manualCkpntScroll)] \ [set ${ARR}(manualCkpntLabel)] } [set ${ARR}(radioboxNoChkpnt)] configure -variable ${ARR}(checkpoint_option) \ -value "n" -command { disable_spinbox [set ${ARR}(manualCkpntMin)] \ [set ${ARR}(manualCkpntScroll)] \ [set ${ARR}(manualCkpntLabel)] } frame $dbox_top.o.rerun set rbox [buildRadioboxes $dbox_top.o.rerun \ { {{y "rerunnable"} {n "not rerunnable"}} } grid 0 ""] set rerunValFrame [lindex $rbox 0] set ${ARR}(rerunY) [lindex $rbox 1] set ${ARR}(rerunN) [lindex $rbox 2] [set ${ARR}(rerunY)] configure -variable ${ARR}(rerunnable) -value y [set ${ARR}(rerunN)] configure -variable ${ARR}(rerunnable) -value n pack forget $rerunValFrame set chkboxList [list [concat chkpnt \"Checkpoint Job\" $radioboxFrame] \ [concat mark \"Mark Job as\" $rerunValFrame]] pack $dbox_top.r2 -in $dbox_top.o set chkbox [buildCheckboxes $dbox_top.o \ [list $chkboxList] column 0 "Job Attributes" 0 1] set chkboxFrame [lindex $chkbox 0] set ${ARR}(chkboxChkpnt) [lindex $chkbox 1] set ${ARR}(chkboxMark) [lindex $chkbox 2] [set ${ARR}(chkboxChkpnt)] configure -variable ${ARR}(checkpoint_job) \ -command { if {[set ${ARR}(checkpoint_job)]} { enable_rcbuttons [set ${ARR}(radioboxManual)] \ [set ${ARR}(radioboxAuto)] \ [set ${ARR}(radioboxDefault)] \ [set ${ARR}(radioboxNoChkpnt)] if {[string compare [set ${ARR}(checkpoint_option)] "c="] == 0} { [set ${ARR}(radioboxManual)] invoke } } else { disable_rcbuttons [set ${ARR}(radioboxManual)] \ [set ${ARR}(radioboxAuto)] \ [set ${ARR}(radioboxDefault)] \ [set ${ARR}(radioboxNoChkpnt)] disable_spinbox [set ${ARR}(manualCkpntMin)] \ [set ${ARR}(manualCkpntScroll)] \ [set ${ARR}(manualCkpntLabel)] } } [set ${ARR}(chkboxMark)] configure -variable ${ARR}(rerun) -command { if {[set ${ARR}(rerun)]} { enable_rcbuttons [set ${ARR}(rerunY)] [set ${ARR}(rerunN)] } else { disable_rcbuttons [set ${ARR}(rerunY)] [set ${ARR}(rerunN)] } } ## SHELL box $dbox_top.s -title "Shell Path List" \ -entrylabels {shell_path host} \ -lboxwidths {15 15} -lboxheights {3 3} \ -lboxlabels {{Shell Paths:} " " } -orient xy \ -grabBox $miscDialogBox \ -key {-1} \ -array 0 ${ARR}_shellp \ -array 1 ${ARR}_shellh boxLoad $dbox_top.s set ${ARR}(shellBox) $dbox_top.s box $dbox_top.g -title "Group List" \ -entrylabels {group host} \ -lboxwidths {15 15} -lboxheights {3 3} \ -lboxlabels {Groups: " " } -orient xy \ -grabBox $miscDialogBox \ -key {-1} \ -array 0 ${ARR}_groupg \ -array 1 ${ARR}_grouph boxLoad $dbox_top.g set ${ARR}(groupBox) $dbox_top.g box $dbox_top.u -title "User List" \ -entrylabels {user host} \ -lboxwidths {15 15} -lboxheights {3 3} \ -lboxlabels {Usernames: " " } -orient xy \ -grabBox $miscDialogBox \ -key {-1} \ -array 0 ${ARR}_useru \ -array 1 ${ARR}_userh boxLoad $dbox_top.u set ${ARR}(userBox) $dbox_top.u ## PACK the FRAMES frame $dbox_top.t frame $dbox_top.b pack $dbox_top.o $dbox_top.s -side left -padx 2m -pady 5m -in $dbox_top.t pack $dbox_top.u $dbox_top.g -side left -padx 2m -pady 5m -in $dbox_top.b raise $dbox_top.o $dbox_top.t raise $dbox_top.s $dbox_top.t raise $dbox_top.u $dbox_top.b raise $dbox_top.g $dbox_top.b raise $dbox_top.r2 $dbox_top.o raise $dbox_top.r2 $dbox_top.t raise $dbox_top.r2 $dbox_top.b pack $dbox_top.t $dbox_top.b -side top register_default_action $miscDialogBox $cmdOk focus $miscDialogBox ## INVOKE the widgets invoke_misc_widgets $ARR tkwait visibility $miscDialogBox remove_busy_cursor catch {tkwait window $miscDialogBox} set activeWindow($miscDialogBox) 0 focus $callerDialogBox catch {grab $callerDialogBox} } # pre_build_misc_opt: builds the misc options suitable for processing by # either qsub or qalter. RETURNS: 1 if an error is detected; 0 otherwise. proc pre_build_misc_opt {array def_array} { upvar $array ARR upvar $def_array DEF global miscDialogBox \ ${array}_shellp ${array}_shellh ${array}_groupg ${array}_grouph \ ${array}_useru ${array}_userh if [regexp "qsub" $array] { init_qsub_misc_argstr } else { init_qalter_misc_argstr } if {[string compare $ARR(checkpoint_job) $DEF(checkpoint_job)] != 0 && \ $ARR(checkpoint_job)} { switch -exact -- $ARR(checkpoint_option) { "c=" { if {[string compare $ARR(checkpoint_min) $DEF(checkpoint_min)] != 0} { set ARR(checkpoint_arg) \ "$ARR(checkpoint_option)$ARR(checkpoint_min)" } elseif {[string compare $ARR(checkpoint_min) ""] == 0} { popupInfoBox $miscDialogBox "Please specify the checkpoint interval (in mins)." return 1 } } default { set ARR(checkpoint_arg) $ARR(checkpoint_option) } } } if { $ARR(rerun)} { set ARR(rerun_args) $ARR(rerunnable) } set size 0 if [info exists ${array}_shellp] { set size [array size ${array}_shellp] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "@," ${array}_shellp($i)] || \ [trimvar "@," ${array}_shellh($i)] } { popupInfoBox $miscDialogBox "Detected an illegal character \"@\" or\ \",\" in shell path name or host entry [expr $i+1]. Please remove." return 1 } set shellp [set ${array}_shellp($i)] set shellh [set ${array}_shellh($i)] if {[string compare $shellp ""] == 0 && \ [string compare $shellh ""] != 0} { popupInfoBox $miscDialogBox "Shell path list entry [expr $i+1] is incomplete" return 1 } if {[string compare $shellh ""] != 0 || \ [string compare $shellp ""] != 0} { if [info exists shellHostCnt($shellh)] { incr shellHostCnt($shellh) if {$shellHostCnt($shellh) > 1} { popupInfoBox $miscDialogBox "Shell path entry [expr $i+1]. . . Must provide only one unique shell path per host" return 1 } } else { set shellHostCnt($shellh) 1 } if {[string compare $shellh ""] == 0} { set shellpath($i) "$shellp" } else { set shellpath($i) "$shellp@$shellh" } } } set ARR(shell_args) [construct_array_args shellpath ","] set size 0 if [info exists ${array}_useru] { set size [array size ${array}_useru] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "@," ${array}_useru($i)] || \ [trimvar "@," ${array}_userh($i)] } { popupInfoBox $miscDialogBox "Detected an illegal character \"@\" or\ \",\" in user name or host entry [expr $i+1]. Please remove." return 1 } set useru [set ${array}_useru($i)] set userh [set ${array}_userh($i)] if {[string compare $useru ""] == 0 && \ [string compare $userh ""] != 0} { popupInfoBox $miscDialogBox "User list entry [expr $i+1] is incomplete" return 1 } if {[string compare $useru ""] != 0 || \ [string compare $userh ""] != 0} { if [info exists userHostCnt($userh)] { incr userHostCnt($userh) if {$userHostCnt($userh) > 1} { popupInfoBox $miscDialogBox "User list entry [expr $i+1]. . .Must provide only one unique username per host." return 1 } } else { set userHostCnt($userh) 1 } if {[string compare $userh ""] == 0} { set userlist($i) "$useru" } else { set userlist($i) "$useru@$userh" } } } set ARR(user_args) [construct_array_args userlist ","] set size 0 if [info exists ${array}_groupg] { set size [array size ${array}_groupg] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "@," ${array}_groupg($i)] || \ [trimvar "@," ${array}_grouph($i)] } { popupInfoBox $miscDialogBox "Detected an illegal character \"@\" or\ \",\" in group name or host entry [expr $i+1]. Please remove." return 1 } set groupg [set ${array}_groupg($i)] set grouph [set ${array}_grouph($i)] if {[string compare $groupg ""] == 0 && \ [string compare $grouph ""] != 0} { popupInfoBox $miscDialogBox "Group list entry [expr $i+1] is incomplete" return 1 } if {[string compare $grouph ""] != 0 || \ [string compare $groupg ""] != 0} { if [info exists groupHostCnt($grouph)] { incr groupHostCnt($grouph) if {$groupHostCnt($grouph) > 1} { popupInfoBox $miscDialogBox "Group list entry [expr $i+1]. . .Must provide only one unique group per host." return 1 } } else { set groupHostCnt($grouph) 1 } if {[string compare $grouph ""] == 0} { set grouplist($i) "$groupg" } else { set grouplist($i) "$groupg@$grouph" } } } set ARR(group_args) [construct_array_args grouplist "," "group_list="] catch {unset shellHostCnt} catch {unset userHostCnt} catch {unset groupHostCnt} catch {unset shellpath} catch {unset grouplist} catch {unset userlist} return 0 } # invoke_misc_widgets: invoke the various widgets found in the Miscellaneous # dialog box. proc invoke_misc_widgets assoc_array { upvar $assoc_array arr invoke_rbutton [list $arr(radioboxManual) $arr(radioboxAuto) \ $arr(radioboxDefault) $arr(radioboxNoChkpnt)] invoke_cbutton $arr(chkboxChkpnt) invoke_cbutton $arr(chkboxMark) } torque-2.4.16/src/gui/owners.tk0000664000113300011330000002004211272401236013260 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # hold: defines the layout and functions of the select owners criteria # dialog box. proc owners {} { global LABELFONT ownersDialogBox activeWindow selv select_args \ selv_useru selv_userh busy_cursor ## Bring up the standard Dialog box ## set ownersDialogBox ".owners" set dbox [popupDialogBox $ownersDialogBox "Select Owners Criteria" 1 SelOwners "" 1] set activeWindow($ownersDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.owners $ownersDialogBox} $cmdOk configure -command { switch -exact -- $selv(owner_option) { user { set size 0 if [info exists selv_useru] { set size [array size selv_useru] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "@," selv_useru($i)] || \ [trimvar "@," selv_userh($i)] } { popupInfoBox $ownersDialogBox "Detected an illegal character \"@\" \ or \",\" within username/hostname. Please remove." return } if {[string compare $selv_useru($i) ""] == 0 && \ [string compare $selv_userh($i) ""] != 0} { popupInfoBox $ownersDialogBox "Owner list entry $i is incomplete" return } if {[string compare $selv_userh($i) ""] != 0 || \ [string compare $selv_useru($i) ""] != 0} { if {[string compare $selv_userh($i) ""] == 0} { set userlist($i) "$selv_useru($i)" } else { set userlist($i) "$selv_useru($i)@$selv_userh($i)" } } } if [info exists userlist] { set user_args [construct_array_args userlist ","] } else { set user_args "" } if {[string compare $user_args ""] == 0} { popupInfoBox $ownersDialogBox "Please specify an Owners list argument." return } else { set selv(owners_list) "Owners: $user_args" } catch {unset userlist} } ANY {set selv(owners_list) "Owners: -ANY-"} } destroy $ownersDialogBox } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.u frame $dbox_top.u.main frame $dbox_top.u.main.o set selv(user_frame) $dbox_top.u.main.o box $selv(user_frame) -title "" -entrylabels [list "user" "host"] \ -lboxlabels [list "Owners:" " "] -lboxwidths [list 20 20] \ -lboxheights [list 3 3] \ -orient y -array 0 selv_useru -array 1 selv_userh \ -grabBox $ownersDialogBox set radioList [list {a "ANY"} \ [concat list \"\" $selv(user_frame)]] pack $selv(user_frame) set rbox [buildRadioboxes $dbox_top.u.main [list $radioList] \ column 5 "Owners = "] set rboxFrame [lindex $rbox 0] set selv(rboxANY) [lindex $rbox 1] set selv(rboxUser) [lindex $rbox 2] $selv(rboxUser) configure -variable selv(owner_option) -value user -command { box $selv(user_frame) enable } $selv(rboxANY) configure -variable selv(owner_option) -value ANY -command { box $selv(user_frame) disable } ### PACK the FRAMES pack $rboxFrame -anchor nw pack $dbox_top.header $dbox_top.u $dbox_top.footer -side top -anchor nw \ -padx 5m set owner_arg [lindex $selv(owners_list) 1] switch -regexp -- $owner_arg { "ANY" {$selv(rboxANY) invoke} default { $selv(rboxUser) invoke load_argstr $owner_arg , {selv_useru selv_userh} {@} } } register_default_action SelOwners $cmdOk tkwait visibility $ownersDialogBox boxLoad $selv(user_frame) remove_busy_cursor catch {tkwait window $ownersDialogBox} result boxesUnset set activeWindow($ownersDialogBox) 0 } torque-2.4.16/src/gui/listbox.tk0000664000113300011330000003366511272401236013446 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains all procedures related to listboxes. # In PBS's GUI: # a listbox can have # one or more entries, # and each entry is made up of a # number of field values separated by one or more white spaces. # A field is referred to as # the index # representing the corresponding field value. # The terms "entry", "field", "fieldval" will be used to represent listbox # elements. # ################################################################################ # buildFullListbox: a procedure that automates the creation of a complete # listbox using the "listbox" widet command. # INPUT: frame_name - the name of the frame widget where to place the # complete listbox. # ColxRow - # of columns (characters) and # of rows # lines on the the listbox. Must have the # format, x # header_str - the header string of the listbox. # scrollbarType - specifies the orientation of the listbox's # scrollbar. Can only have the values: # xscroll, yscroll, xyscroll, noscroll. # IF header_str is the empty "" string, then the listbox will have no header # meaning, even the select all/deselect all button will not be placed. # # OPTIONS: # all_button - if you want the "Select All/Deselect All" to # be included. # header_at_left - if you want the header string to be at the # left side of the listbox. proc buildFullListbox {frame_name ColxRow header_str scrollbarType \ {all_button 1} {header_at_left 0} } { global BADPARAM errmsg FIXLABELFONT TEXTFONT LABELFONT tk_version set procname "buildFull_FullListbox" set scrollbars "" ## Let's be defensive about the input if { ![regexp "\\." $frame_name] || \ ![regexp "(\[0-9]+)x(\[0-9]+)" $ColxRow match Col Row] || \ ([string compare $scrollbarType "xscroll"] != 0 && \ [string compare $scrollbarType "yscroll"] != 0 && \ [string compare $scrollbarType "xyscroll"] != 0 && \ [string compare $scrollbarType "noscroll"] != 0) } { puts "Error $BADPARAM in $procname: $errmsg(BADPARAM) frame_name: $frame_name ColRow: $ColxRow scrollbarType: $scrollbarType" exit $BADPARAM } if { [string compare $frame_name "." ] == 0 } { set frame_name "" } if { [string compare $header_str ""] != 0 } { frame $frame_name.header -borderwidth 1 pack $frame_name.header -side top -expand 1 label $frame_name.header.label -font $FIXLABELFONT -text $header_str \ -anchor nw -width [expr $Col - 4] \ -padx 1 -pady 1 if {$all_button} { set selMode "Select All" button $frame_name.header.select -font $FIXLABELFONT -padx 2m \ -anchor c -width 12 -text "Select All" -pady 1 pack $frame_name.header.label -side left -anchor nw -expand 1 pack $frame_name.header.select -side left -anchor se } else { pack $frame_name.header.label -side left -anchor nw -expand 1 } if {$header_at_left && [string compare $header_str ""] != 0} { $frame_name.header.label configure -font $LABELFONT \ -width [string length $header_str] pack forget $frame_name.header $frame_name.header.label pack $frame_name.header $frame_name.header.label -expand 0 -side left \ -anchor nw } } listbox $frame_name.box -borderwidth 1 \ -setgrid 1 \ -font $TEXTFONT \ -exportselection false \ -relief sunken if { $tk_version < 4.0 } { $frame_name.box configure -geometry $ColxRow } else { $frame_name.box configure -width $Col -height $Row -selectmode extended } pack $frame_name.box -anchor se -side left -expand 1 -fill x if { [string compare $scrollbarType "yscroll"] == 0 || \ [string compare $scrollbarType "xyscroll"] == 0 } { scrollbar $frame_name.vscroll -command "$frame_name.box yview" \ -borderwidth 2 \ -orient vertical \ -relief groove $frame_name.box configure -yscrollcommand "$frame_name.vscroll set" pack $frame_name.vscroll -anchor w -fill y -expand 1 -side right \ -before $frame_name.box append scrollbars " $frame_name.vscroll" } if { [string compare $scrollbarType "xscroll"] == 0 || \ [string compare $scrollbarType "xyscroll"] == 0 } { scrollbar $frame_name.hscroll -command "$frame_name.box xview" \ -borderwidth 2 \ -orient horizontal \ -relief groove $frame_name.box configure -xscrollcommand "$frame_name.hscroll set" pack $frame_name.hscroll -fill x -expand 1 -side bottom \ -before $frame_name.box -anchor nw append scrollbars " $frame_name.hscroll" } return [concat $frame_name $frame_name.header.label \ $frame_name.header.select $frame_name.box $scrollbars] } # get_keyvals: Procedure that returns a formatted string containing field # values (indexes specified in 'key_list') of a listbox, 'lbox'. The format of # string puts 'inner_sep' within key values of an entry, and 'outer_sep' # between entries of the listbox. The entries of the listbox that will be # checked can be either "all" or "select". # # Ex. suppose you have a listbox, lbox1, whose key is a pair: # {column_0 column_6}. The idea is to return the string: # # "entry0_key0val@entry0_key6val|entry1_key0val@entry1_key6val}|.." # Do this by calling the procedure as follows: # get_keyvals lbox1 {0 6} "@" "|" "all" # # CAUTION: This procedure returns a list of elements ACCORDING to its # increasing entry position in the list box. # So returning "elem1 elem2 elem3" means 'elem1' appears in the listbox before # 'elem2', and 'elem2' appears before 'elem3', and so on. proc get_keyvals {lbox key_list inner_sep outer_sep {type "all"}} { # Get the indices to the entries if { [string compare $type "select"] == 0 } { set indices [$lbox curselection] } else { set num_els [$lbox size] set indices "" for {set i 0} {$i < $num_els} {incr i} { append indices " $i" } } if {[string compare $indices ""] == 0} { return "" ;# No need to proceed if there are no entries ;# in lbox1 selected. } set elems "" foreach entry [lsort -integer -increasing $indices] { set key_elems "" set lbox_entry [$lbox get $entry] foreach field [lrange $key_list 0 end] { append key_elems "[lindex $lbox_entry $field]$inner_sep" } if { [string compare $key_elems $outer_sep] == 0 } { InfoBox_sendmsg "Found \"$lbox_entry\" entry to have incomplete information" append elems "$key_elems$outer_sep" } else { append elems "[string trim $key_elems $inner_sep]$outer_sep" } } return "[string trim $elems $outer_sep]" } # strget_keyvals: similar to get_keyvals except instead of a listbox, the # source is a string. proc strget_keyvals {str key_list sep} { if {[string compare $str ""] == 0} { return "" ;# No need to proceed if there are no entries ;# in lbox1 selected. } set key_elems "" foreach field [lrange $key_list 0 end] { if {[string compare $key_elems ""] != 0} { append key_elems "$sep[lindex $str $field]" } else { set key_elems [lindex $str $field] } } return $key_elems } proc disable_listbox { box headerLabel selButton scrollbar {readonly 1}} { global disabledColor selColor if { [string compare $headerLabel ""] != 0 } { disable_label $headerLabel $disabledColor } if { [string compare $selButton ""] != 0 } { disable_button $selButton } if { [string compare $scrollbar ""] != 0 } { disable_scrollbar $scrollbar $disabledColor } if {$readonly} { bind_listbox_readonly $box } set fgColor [lindex [$box configure -foreground] 4] set selBgColor [lindex [$box configure -selectbackground] 4] set selFgColor [lindex [$box configure -selectforeground] 4] if { [string compare $disabledColor $fgColor] == 0 && \ [string compare $disabledColor $selFgColor] == 0 && \ [string compare $disabledColor $selBgColor] == 0} { return } set selColor(fg$box) $fgColor set selColor(selFg$box) $selFgColor set selColor(selBg$box) $selBgColor $box configure -foreground $disabledColor -selectforeground $disabledColor \ -selectbackground $disabledColor } proc enable_listbox { box headerLabel selButton scrollbar enaBox_proc } { global selColor if { ![info exists selColor(fg$box)] && \ ![info exists selColor(selFg$box)] && \ ![info exists selColor(selBg$box)]} { return } if { [string compare $headerLabel ""] != 0 } { enable_label $headerLabel } if { [string compare $selButton ""] != 0 } { enable_button $selButton } if { [string compare $scrollbar ""] != 0 } { enable_scrollbar $scrollbar } if {[string compare $enaBox_proc ""] != 0} { eval $enaBox_proc $box } $box configure -foreground $selColor(fg$box) \ -selectforeground $selColor(selFg$box) \ -selectbackground $selColor(selBg$box) } proc lboxvalue_isUnique {listbox value} { for {set k 0} {$k < [$listbox size]} {incr k} { set lboxval [$listbox get $k] if {[string compare $lboxval $value] == 0} { return 0 } } return 1 } # lcomp: compares 2 listboxes: returns 0 if the same; 1 otherwise proc lcomp {lbox1 lbox2} { set llen1 [llength $lbox1] set llen2 [llength $lbox2] if {$llen1 != $llen2} { return 1 } for {set i 0} {$i < $llen1} {incr i} { set elem1 [lindex $lbox1 $i] set elem2 [lindex $lbox2 $i] if {[string compare $elem1 $elem2] != 0} { return 1 } } return 0 } torque-2.4.16/src/gui/qsub.tk0000664000113300011330000011746711272401236012737 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qsub: defines the layout and functions of the submit job dialog box. proc qsub {} { global qsubDialogBox LABELFONT queuesListbox QUEUES_LISTBOX_KEY cmdpath \ activeWindow qsubv numRes numEnVars PBS_SCRIPTLOAD_CMD \ hostsSelected tk_version qsubv_res qsubv_val qsubv_evar qsubv_eval \ def_qsub qsubv_notify_addr qsubv_stagein_host qsubv_stagein_input \ qsubv_stagein_local qsubv_stageout_local qsubv_stageout_host \ qsubv_stageout_output qsubv_shellp qsubv_shellh qsubv_groupg \ qsubv_grouph qsubv_useru qsubv_userh submitHost qinfo fileselect \ activeColor jobResourceList busy_cursor ## Bring up the standard Dialog box ## set qsubDialogBox .qsub set dbox [popupDialogBox $qsubDialogBox "Submit Job Dialog"] set activeWindow($qsubDialogBox) 1 bind_button1 $qsubDialogBox set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ############################################################ set cmdButtons \ [buildCmdButtons $dbox_bottom \ { {{submit "confirm submit"} {pbssh "interactive"} {cancel cancel}} \ {{reset "reset options to default"}} {{help help}}} x 0 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdSubmit [lindex $cmdButtons 1] set cmdPbssh [lindex $cmdButtons 2] set cmdCancel [lindex $cmdButtons 3] set cmdReset [lindex $cmdButtons 4] set cmdHelp [lindex $cmdButtons 5] $cmdReset configure -width 25 -command { set_default_qsub_main invoke_qsub_widgets qsubv boxLoad $qsubv(resBox) 0 boxLoad $qsubv(varBox) } $cmdPbssh configure -width 19 -command { if { [pre_build_qsub_opt] == 0 } { set exitcode [cmdExec "$XTERM -e $cmdpath(QSUB) [build_opt 1] -I &" 1 1] if {$exitcode != 0} { popupInfoBox $qsubDialogBox "Failed to open interactive session. See INFO box in main window for details." } else { InfoBox_sendmsg "done." 0 1 5 } } } $cmdSubmit configure -width 15 -command { if [pre_build_qsub_opt] { return } set exitcode 1 if {[string compare $qsubv(scriptName) ""] != 0} { set actualScriptName [glob -nocomplain $qsubv(scriptName)] if {[string compare $actualScriptName ""] == 0} { popupInfoBox $qsubDialogBox "Script file non-existent!" return } set exitcode [win_cmdExec $qsubDialogBox \ "$cmdpath(QSUB) [build_opt 1] $actualScriptName"] } else { set body [$qsubv(bufferBox) get 1.0 end] if {[string compare $body ""] == 0 || [string compare $body "\n"] == 0} { popupInfoBox $qsubDialogBox "No script body specified." return } set exitcode [win_cmdExec $qsubDialogBox \ "$cmdpath(QSUB) [build_opt 1] << {$body}"] } if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] destroy $qsubDialogBox } } $cmdCancel configure -command {destroy $qsubDialogBox} $cmdHelp configure -command {xpbs_help submit $qsubDialogBox} ## TOP PART ## frame $dbox_top.script -borderwidth 3 -relief groove frame $dbox_top.script1 frame $dbox_top.simpleOpt -borderwidth 3 -relief groove frame $dbox_top.options -borderwidth 3 -relief groove frame $dbox_top.otherOptions -borderwidth 3 -relief groove -class CmdFrame frame $dbox_top.optionsMain frame $dbox_top.optionsMain.left frame $dbox_top.optionsMain.right frame $dbox_top.line1 frame $dbox_top.dest frame $dbox_top.line3 frame $dbox_top.line5 frame $dbox_top.line4 -relief groove -borderwidth 3 frame $dbox_top.resources -borderwidth 3 -relief groove frame $dbox_top.lower frame $dbox_top.output -relief groove -borderwidth 3 frame $dbox_top.env -relief groove -borderwidth 3 frame $dbox_top.fbuffer -borderwidth 2 -relief ridge frame $dbox_top.l -class CmdFrame -relief raised -borderwidth 2 frame $dbox_top.othOpts -borderwidth 2 -relief raised -class CmdFrame frame $dbox_top.l2 -class CmdFrame -relief raised -borderwidth 2 frame $dbox_top.entries frame $dbox_top.fileEntry frame $dbox_top.fileButton frame $dbox_top.l2.pbsPrefix frame $dbox_top.line1.1 frame $dbox_top.line1.2 frame $dbox_top.r1 frame $dbox_top.line5.1 frame $dbox_top.line5.2 frame $dbox_top.line4.t frame $dbox_top.line4.b frame $dbox_top.line4.b.when frame $dbox_top.resources.e frame $dbox_top.resources.hdr frame $dbox_top.resources.hdr.h frame $dbox_top.action frame $dbox_top.merge frame $dbox_top.retain frame $dbox_top.stderr frame $dbox_top.stderr.file frame $dbox_top.stderr.host frame $dbox_top.stdout frame $dbox_top.stdout.file frame $dbox_top.stdout.host set box [buildFullTextbox $dbox_top.fbuffer 40x14 yscroll ""] set qsubv(bufferBox) [lindex $box 1] $qsubv(bufferBox) configure -relief sunken label $dbox_top.l.optionsLabel -text "OPTIONS" -font $LABELFONT \ -anchor nw -height 2 pack $dbox_top.l.optionsLabel -anchor nw label $dbox_top.otherOptionsLabel -text "OTHER OPTIONS" \ -font $LABELFONT set miscButtons \ [buildCmdButtons $dbox_top.othOpts {\ {{concur "concurrency set.."} \ {after "after depend.."} \ {before "before depend.."} \ {staging "file staging.."} \ {misc "misc.."}} } \ y 0 17 0 0 0 0 "OTHER OPTIONS"] set miscFrame [lindex $miscButtons 0] set miscConcur [lindex $miscButtons 1] set miscAfter [lindex $miscButtons 2] set miscBefore [lindex $miscButtons 3] set miscStaging [lindex $miscButtons 4] set miscMisc [lindex $miscButtons 5] set miscLabel [lindex $miscButtons 6] $miscConcur configure -command {concur $qsubDialogBox} $miscAfter configure -command {after_depend $qsubDialogBox} $miscBefore configure -command {before_depend $qsubDialogBox} $miscStaging configure -command {staging $qsubDialogBox} -bg $activeColor $miscMisc configure -command {misc $qsubDialogBox} $miscLabel configure -anchor nw label $dbox_top.l2.label -text "SCRIPT" -font $LABELFONT pack $dbox_top.l2.label -fill x -anchor nw ### SCRIPT ################################################################ set filebox [buildFullEntrybox $dbox_top.fileEntry 0 "" 22 "" \ bottom 0] set fileFrame [lindex $filebox 0] set fileLabel [lindex $filebox 1] set fileEntry [lindex $filebox 2] $fileLabel configure -anchor nw $fileEntry configure -textvariable qsubv(scriptName) bind_entry_overselect $fileEntry button $dbox_top.fileFsboxButton -height 2 -width 7 -font $LABELFONT \ -text "FILE.." -padx 0 \ -command { fileselect $qsubDialogBox \ {set qsubv(scriptName) $fileselect(filepath)} "SCRIPT FILE SELECTION" } set fileButtons \ [buildCmdButtons $dbox_top.fileButton \ {{{load "load"} {save "save"}}} x 2 6 2 0 0] set filecmdFrame [lindex $fileButtons 0] set filecmdLoad [lindex $fileButtons 1] set filecmdSave [lindex $fileButtons 2] set filebox [buildFullEntrybox $dbox_top.l2.pbsPrefix 10 "Prefix" 10 "" \ bottom 0] set pbsPrefixFrame [lindex $filebox 0] set pbsPrefixLabel [lindex $filebox 1] set pbsPrefixEntry [lindex $filebox 2] $pbsPrefixEntry configure -textvariable qsubv(pbs_prefix) $filecmdSave configure -command { if { [string compare $qsubv(scriptName) ""] == 0 } { popupInfoBox $qsubDialogBox "Please specify a script name on the FILE entrybox." return } set qsubv(overwriteFile) 1 if [file exists [glob -nocomplain $qsubv(scriptName)]] { confirmDelete } if {!$qsubv(overwriteFile)} { return } busy_cursor if [pre_build_qsub_opt] { return } if [catch {open $qsubv(scriptName) w} fd] { popupInfoBox $qsubDialogBox "Error opening $qsubv(scriptName): Message: $fd" remove_busy_cursor return } else { puts -nonewline $fd [build_opt 0 $qsubv(pbs_prefix)] puts -nonewline $fd [$qsubv(bufferBox) get 1.0 end] close $fd } remove_busy_cursor popupInfoBox $qsubDialogBox "PBS job options and execution lines saved to \"$qsubv(scriptName)\" file" } $filecmdLoad configure -command { busy_cursor if { [string compare $qsubv(scriptName) ""] == 0 } { popupInfoBox $qsubDialogBox "Please specify a script name on the FILE entrybox" remove_busy_cursor return } if { ![file exists [glob -nocomplain $qsubv(scriptName)]] || \ [file isfile [glob -nocomplain $qsubv(scriptName)]] == 0 } { popupInfoBox $qsubDialogBox "Script file load failed: does not exist or is a directory" remove_busy_cursor return } set fd [cmdExec_bg \ "$PBS_SCRIPTLOAD_CMD -C \"$qsubv(pbs_prefix)\" [glob -nocomplain $qsubv(scriptName)]" 1] if {$fd == -1} { popupInfoBox $qsubDialogBox "Failed to execute load. See INFO box in main window for details" remove_busy_cursor return } set pbs_prefix_save $qsubv(pbs_prefix) set_default_qsub_main set_default_qsub_concur set_default_qsub_after set_default_qsub_before set_default_qsub_staging set_default_qsub_misc set_default_qsub_email init_qsub_depend_argstr if [load_qsub_input $fd] { remove_busy_cursor return } boxLoad $qsubv(resBox) 0 boxLoad $qsubv(varBox) set qsubv(pbs_prefix) $pbs_prefix_save invoke_qsub_widgets qsubv ##### Load the contents if {[info exists qsubv(bufferFile)] && \ [string compare $qsubv(bufferFile) ""] != 0} { if [catch {open $qsubv(bufferFile) r} tempfd] { popupInfoBox $qsubDialogBox "Error opening temp file $qsubv(bufferFile): Message: $fd" } else { $qsubv(bufferBox) delete 1.0 end $qsubv(bufferBox) insert end [read $tempfd] } close $tempfd ##### And remove the temporary file WITH EXTRA checks if { [string length $qsubv(bufferFile)] > 0 && \ [string compare $qsubv(bufferFile) "*"] != 0 && \ [string compare $qsubv(bufferFile) "?"] != 0 } { set fd [cmdExec_bg "/bin/rm -f $qsubv(bufferFile)"] } else { InfoBox_sendmsg "buffer filename matched a wildcard. Not removing" 0 1 51 } if [catch {close $fd} errmesg] { InfoBox_sendmsg "done: $errmesg" 0 1 5 } else { InfoBox_sendmsg "done." 0 1 5 } } remove_busy_cursor } ### OPTIONS ############################################################### ### MAIN OPTIONS ################# #### MAIN OPTIONS LINE1 ########## set jobbox [buildFullEntrybox $dbox_top.line1.1 11 "Job Name" 15 "" none 0] set JobNameFrame [lindex $jobbox 0] set JobNameEntry [lindex $jobbox 2] $JobNameEntry configure -textvariable qsubv(jobName) bind_entry_overselect $JobNameEntry register_entry_fixsize $JobNameEntry 15 set spinBox [buildSpinbox $dbox_top.line1.2 5 -1024-1023 qsubv priority \ "Priority" left ""] set priorityFrame [lindex $spinBox 0] set priorityEntry [lindex $spinBox 1] #### MAIN OPTIONS LINE 2 ######### set listBoxInfo [buildFullListbox $dbox_top.dest 30x2 "Destination" \ yscroll 0 1] set destListframe [lindex $listBoxInfo 0] set qsubv(destLbox) [lindex $listBoxInfo 3] bind_listbox_single_select $qsubv(destLbox) set queues [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " " "all"] foreach q $queues { if [regexp "@$submitHost" $q] { $qsubv(destLbox) insert end $q } } ## Let's specify a default value $qsubv(destLbox) insert 0 "@$submitHost" if {$tk_version < 4.0} { $qsubv(destLbox) select from 0 } else { $qsubv(destLbox) select anchor 0 $qsubv(destLbox) select set anchor 0 } #### MAIN OPTIONS LINE 3 ########## ## set radiobox [buildRadioboxes $dbox_top.r1 \ { {{now "NOW"} {later "LATER at.."}} }\ grid 0 "When to Queue"] set radioboxFrame [lindex $radiobox 0] set radioboxNow [lindex $radiobox 1] set radioboxLater [lindex $radiobox 2] $radioboxNow configure -variable qsubv(qtime) -value "now" \ -command { set_dateTime qsubv(qtimeMon) qsubv(qtimeDay) qsubv(qtimeYear) \ qsubv(qtimeHH) qsubv(qtimeMM) qsubv(qtimeSS) 1 set qsubv(exec_time) $def_qsub(exec_time)} $radioboxLater configure -variable qsubv(qtime) -value "later" \ -command {dateTime $qsubDialogBox 0} ## MAIN OPTIONS LINE 5 ####### ### LINE5, 1 set acctbox [buildFullEntrybox $dbox_top.line5.1 12 "Account Name" 15 "" none 0] set AcctNameFrame [lindex $acctbox 0] set AcctNameEntry [lindex $acctbox 2] $AcctNameEntry configure -textvariable qsubv(acctName) bind_entry_overselect $AcctNameEntry ### LINE5, 2 set chkbox [buildCheckboxes $dbox_top.line5.2 {{{hold "Hold Job"}}} column 0 "" 0] set chkboxFrame [lindex $chkbox 0] set chkboxHold [lindex $chkbox 1] $chkboxHold configure -variable qsubv(holdjob) ## MAIN OPTIONS LINE 4 ###### label $dbox_top.line4.t.label1 -text "Notify" -font $LABELFONT label $dbox_top.line4.b.label2 -text "when" -font $LABELFONT set qsubv(cmdEmail) [button $dbox_top.line4.t.email -font $LABELFONT \ -text "email addrs.."] $qsubv(cmdEmail) configure -command {email_list $qsubDialogBox 0} set chkbox [buildCheckboxes $dbox_top.line4.b.when \ {{{a "job aborts"} {b "job begins execution"} {e "job terminates"}}} column 0 ""] set chkboxFrame [lindex $chkbox 0] set qsubv(chkboxNotifyAbort) [lindex $chkbox 1] set qsubv(chkboxNotifyBegin) [lindex $chkbox 2] set qsubv(chkboxNotifyEnd) [lindex $chkbox 3] $qsubv(chkboxNotifyAbort) configure -variable qsubv(notify_opt(abort)) \ -onvalue "a" -offvalue "" -command { if {[string compare $qsubv(notify_opt\(abort\)) "a"] != 0 && \ [string compare $qsubv(notify_opt\(begin\)) "b"] != 0 && \ [string compare $qsubv(notify_opt\(end\)) "e"] != 0 } { disable_button $qsubv(cmdEmail) } else { enable_button $qsubv(cmdEmail) } } $qsubv(chkboxNotifyBegin) configure -variable qsubv(notify_opt(begin)) \ -onvalue "b" -offvalue "" -command { if {[string compare $qsubv(notify_opt\(abort\)) "a"] != 0 && \ [string compare $qsubv(notify_opt\(begin\)) "b"] != 0 && \ [string compare $qsubv(notify_opt\(end\)) "e"] != 0 } { disable_button $qsubv(cmdEmail) } else { enable_button $qsubv(cmdEmail) } } $qsubv(chkboxNotifyEnd) configure -variable qsubv(notify_opt(end)) \ -onvalue "e" -offvalue "" -command { if {[string compare $qsubv(notify_opt\(abort\)) "a"] != 0 && \ [string compare $qsubv(notify_opt\(begin\)) "b"] != 0 && \ [string compare $qsubv(notify_opt\(end\)) "e"] != 0 } { disable_button $qsubv(cmdEmail) } else { enable_button $qsubv(cmdEmail) } } ### RESOURCE OPTIONS ######## # label $dbox_top.resources.hdr.l -text "Resource List" -font $LABELFONT # set cmdButtons [buildCmdButtons $dbox_top.resources.hdr.h \ # {{{help help}}} x 0 6 1] # set cmdFrame [lindex $cmdButtons 0] # set cmdResHelp [lindex $cmdButtons 1] # pack forget $cmdFrame # $cmdResHelp configure -command {resources_help $qsubDialogBox} foreach res $jobResourceList { lappend resnames [list "" [lindex $res 0]] } box $dbox_top.resources -title "Resource List" \ -entrylabels [list [list "resource" MENU_ENTRY $jobResourceList] value] \ -lboxlabels [list " " "Resources"] -lboxwidths [list 8 20] \ -lboxheights [list 2 2] -orient xy -array 0 qsubv_res -array 1 qsubv_val \ -menuEntry [list [list $resnames] {resources_help $qsubDialogBox} help-] -key 0 \ -grabBox $qsubDialogBox set qsubv(resBox) $dbox_top.resources ## OUTPUT OPTIONS ##### set radiobox [buildRadioboxes $dbox_top.merge \ { {{stdoutMerge "Merge to Stdout"} \ {stderrMerge "Merge to Stderr"} \ {noMerge "Don't Merge"}} } column 0 "Output" 1 1] set qsubv(radioboxStdoutMerge) [lindex $radiobox 1] set qsubv(radioboxStderrMerge) [lindex $radiobox 2] set qsubv(radioboxNoMerge) [lindex $radiobox 3] set chkbox [buildCheckboxes $dbox_top.retain \ { {{stdoutRet "Stdout in exec_host:.o"} \ {stderrRet "Stderr in exec_host:.e"}} } \ column 0 "Retain" 1 1] set qsubv(chkboxStdoutRet) [lindex $chkbox 1] set qsubv(chkboxStderrRet) [lindex $chkbox 2] button $dbox_top.stdout.fsboxButton -height 1 -width 18 -font $LABELFONT \ -text "Stdout File Name.." -padx 0 \ -command { fileselect $qsubDialogBox \ { set qsubv(stdoutFile) $fileselect(filepath) if { [string compare $fileselect(filepath) ""] != 0 } { set qsubv(stdoutHost) $fileselect(host) } } "STDOUT FILE SELECTION" 0 } set filebox [buildFullEntrybox $dbox_top.stdout.file \ 0 "" 15 "" right 0] set qsubv(StdoutFileLabel) [lindex $filebox 1] set qsubv(StdoutFile) [lindex $filebox 2] set qsubv(StdoutFileScroll) [lindex $filebox 3] $qsubv(StdoutFile) configure -textvariable qsubv(stdoutFile) set filebox [buildFullEntrybox $dbox_top.stdout.host \ 12 "on hostname:" 15 "" right 0] set qsubv(StdoutHostLabel) [lindex $filebox 1] set qsubv(StdoutHost) [lindex $filebox 2] set qsubv(StdoutHostScroll) [lindex $filebox 3] $qsubv(StdoutHost) configure -textvariable qsubv(stdoutHost) button $dbox_top.stderr.fsboxButton -height 1 -width 18 -font $LABELFONT \ -text "Stderr File Name.." -padx 0 \ -command { fileselect $qsubDialogBox \ { set qsubv(stderrFile) $fileselect(filepath) if { [string compare $fileselect(filepath) ""] != 0 } { set qsubv(stderrHost) $fileselect(host) } } "STDERR FILE SELECTION" 0 } set filebox [buildFullEntrybox $dbox_top.stderr.file \ 0 "" 15 "" right 0] set qsubv(StderrFileLabel) [lindex $filebox 1] set qsubv(StderrFile) [lindex $filebox 2] set qsubv(StderrFileScroll) [lindex $filebox 3] $qsubv(StderrFile) configure -textvariable qsubv(stderrFile) set filebox [buildFullEntrybox $dbox_top.stderr.host \ 12 "on hostname:" 15 "" right 0] set qsubv(StderrHostLabel) [lindex $filebox 1] set qsubv(StderrHost) [lindex $filebox 2] set qsubv(StderrHostScroll) [lindex $filebox 3] $qsubv(StderrHost) configure -textvariable qsubv(stderrHost) ## Set the key tabbing option bind_entry_tab $qsubv(StdoutFile) $qsubv(StdoutHost) $qsubv(StdoutFile) bind_entry_tab $qsubv(StdoutHost) $qsubv(StderrFile) $qsubv(StdoutFile) bind_entry_tab $qsubv(StderrFile) $qsubv(StderrHost) $qsubv(StdoutHost) bind_entry_tab $qsubv(StderrHost) $qsubv(StderrHost) $qsubv(StderrFile) bind_entry_overselect $qsubv(StdoutFile) bind_entry_overselect $qsubv(StdoutHost) bind_entry_overselect $qsubv(StderrFile) bind_entry_overselect $qsubv(StderrHost) ## Now for the big trick on output retention. ################################# ## Clicking Retain Stdout, then only the "Stderr File/Path Name" will be ## enabled for input. Retain will construct its own path for Stdout on the ## execution host. $qsubv(chkboxStdoutRet) configure -variable qsubv(stdoutRet) -onvalue "o" \ -offvalue "" -command { if {[string compare $qsubv(stdoutRet) "o"] == 0} { disable_fullentry $qsubv(StdoutFileLabel) $qsubv(StdoutFile) \ $qsubv(StdoutFileScroll) disable_fullentry $qsubv(StdoutHostLabel) $qsubv(StdoutHost) \ $qsubv(StdoutHostScroll) if {[string compare $qsubv(stderrRet) "e"] != 0} { focus $qsubv(StderrFile) } } else { enable_fullentry $qsubv(StdoutFileLabel) $qsubv(StdoutFile) \ $qsubv(StdoutFileScroll) enable_fullentry $qsubv(StdoutHostLabel) $qsubv(StdoutHost) \ $qsubv(StdoutHostScroll) focus $qsubv(StdoutFile) }} ## Clicking Retain Stderr, then only the "Stdout File/Path Name" will be ## enabled for input. Retain will construct its own path for Stderr on the ## execution host. $qsubv(chkboxStderrRet) configure -variable qsubv(stderrRet) -onvalue "e" \ -offvalue "" -command { if {[string compare $qsubv(stderrRet) "e"] == 0} { disable_fullentry $qsubv(StderrFileLabel) $qsubv(StderrFile) \ $qsubv(StderrFileScroll) disable_fullentry $qsubv(StderrHostLabel) $qsubv(StderrHost) \ $qsubv(StderrHostScroll) if {[string compare $qsubv(stdoutRet) "o"] != 0} { focus $qsubv(StdoutFile) } } else { enable_fullentry $qsubv(StderrFileLabel) $qsubv(StderrFile) \ $qsubv(StderrFileScroll) enable_fullentry $qsubv(StderrHostLabel) $qsubv(StderrHost) \ $qsubv(StderrHostScroll) focus $qsubv(StderrFile) }} ## If standard error and standout are merged as standout output, then anything ## referring to stderr are meaningless. $qsubv(radioboxStdoutMerge) configure -variable qsubv(merge) -value oe \ -command { disable_rcbutton $qsubv(chkboxStderrRet) disable_fullentry $qsubv(StderrFileLabel) $qsubv(StderrFile) \ $qsubv(StderrFileScroll) disable_fullentry $qsubv(StderrHostLabel) $qsubv(StderrHost) \ $qsubv(StderrHostScroll) enable_rcbutton $qsubv(chkboxStdoutRet) if {[string compare $qsubv(stdoutRet) "o"] != 0} { enable_fullentry $qsubv(StdoutFileLabel) $qsubv(StdoutFile) \ $qsubv(StdoutFileScroll) enable_fullentry $qsubv(StdoutHostLabel) $qsubv(StdoutHost) \ $qsubv(StdoutHostScroll) focus $qsubv(StdoutFile) } } ## If standard error and standout are merged as standout error, then anything ## referring to stdout are meaningless. $qsubv(radioboxStderrMerge) configure -variable qsubv(merge) -value eo \ -command { disable_rcbutton $qsubv(chkboxStdoutRet) disable_fullentry $qsubv(StdoutFileLabel) $qsubv(StdoutFile) \ $qsubv(StdoutFileScroll) disable_fullentry $qsubv(StdoutHostLabel) $qsubv(StdoutHost) \ $qsubv(StdoutHostScroll) enable_rcbutton $qsubv(chkboxStderrRet) if {[string compare $qsubv(stderrRet) "e"] != 0} { enable_fullentry $qsubv(StderrFileLabel) $qsubv(StderrFile) \ $qsubv(StderrFileScroll) enable_fullentry $qsubv(StderrHostLabel) $qsubv(StderrHost) \ $qsubv(StderrHostScroll) focus $qsubv(StderrFile) } } $qsubv(radioboxNoMerge) configure -variable qsubv(merge) -value n \ -command { enable_rcbutton $qsubv(chkboxStdoutRet) enable_rcbutton $qsubv(chkboxStderrRet) if {[string compare $qsubv(stdoutRet) "o"] != 0} { enable_fullentry $qsubv(StdoutFileLabel) $qsubv(StdoutFile) \ $qsubv(StdoutFileScroll) enable_fullentry $qsubv(StdoutHostLabel) $qsubv(StdoutHost) \ $qsubv(StdoutHostScroll) focus $qsubv(StdoutFile) } if {[string compare $qsubv(stderrRet) "e"] != 0} { enable_fullentry $qsubv(StderrFileLabel) $qsubv(StderrFile) \ $qsubv(StderrFileScroll) enable_fullentry $qsubv(StderrHostLabel) $qsubv(StderrHost) \ $qsubv(StderrHostScroll) focus $qsubv(StderrFile) } } ## ENVIRONMENT VARIABLE ## # label $dbox_top.env.l -text "Environment Variables to Export" -font $LABELFONT # pack $dbox_top.env.l -anchor nw set var_frame $dbox_top.env set qsubv(varBox) $var_frame box $var_frame -title "Environment Variables to Export" \ -entrylabels [list variable value] \ -lboxlabels [list "Variables" " "] -lboxwidths [list 14 20] \ -lboxheights [list 2 2] -orient xy \ -array 0 qsubv_evar -array 1 qsubv_eval \ -key 0 -grabBox $qsubDialogBox -env 1 \ -checkbutton [list Current qsubv(export_current_var)] set qsubv(resBox) $dbox_top.resources ### PACK the FRAMES pack $dbox_top.resources $dbox_top.env -side left -fill both -expand 1 \ -in $dbox_top.entries -padx 1m raise $dbox_top.resources $dbox_top.entries raise $dbox_top.env $dbox_top.entries pack $dbox_top.othOpts $dbox_top.output -side left -fill both -expand 1 \ -in $dbox_top.lower -padx 1m raise $dbox_top.output $dbox_top.lower raise $dbox_top.othOpts $dbox_top.lower pack $dbox_top.options -side top -anchor nw -fill x pack $dbox_top.optionsMain $dbox_top.lower $dbox_top.entries \ -in $dbox_top.options -side top -anchor nw -pady 5 -fill both -expand 1 pack $dbox_top.optionsMain.left $dbox_top.optionsMain.right -side left \ -anchor nw -padx 1m pack $dbox_top.l $dbox_top.simpleOpt $dbox_top.line4 -side top -anchor nw \ -pady 5 -in $dbox_top.optionsMain.right -fill x raise $dbox_top.simpleOpt $dbox_top.optionsMain.right pack $dbox_top.line1 $dbox_top.line5 $dbox_top.dest \ $dbox_top.line3 -side top -anchor nw -pady 2 \ -in $dbox_top.simpleOpt -fill x pack forget $fileFrame $filecmdFrame $pbsPrefixFrame pack $fileFrame -in $dbox_top.script1 -anchor nw -side left -fill x -expand 1 pack $pbsPrefixFrame -anchor nw pack $dbox_top.l2.label -side left -anchor nw pack $pbsPrefixFrame -side right -anchor se pack $dbox_top.l2 $dbox_top.script1 $dbox_top.fbuffer \ -side top -in $dbox_top.optionsMain.left -anchor nw -fill x -pady 3 pack $dbox_top.fileFsboxButton $dbox_top.fileEntry $dbox_top.fileButton \ -in $dbox_top.script1 -anchor nw -side left pack $dbox_top.line1.1 $dbox_top.line1.2 -anchor nw -side left -pady 1m pack $dbox_top.r1 -in $dbox_top.line3 pack $dbox_top.r1 -in $dbox_top.line3 pack $dbox_top.line5.1 $dbox_top.line5.2 -side left pack $dbox_top.line4.t.label1 $qsubv(cmdEmail) -side left -anchor nw pack $dbox_top.line4.b.label2 $dbox_top.line4.b.when -side left -anchor nw pack $dbox_top.line4.t \ $dbox_top.line4.b -side left -anchor nw -pady 6 pack $dbox_top.action -side top -anchor nw -pady 3m \ -in $dbox_top.output -fill x -expand 1 pack $dbox_top.stdout $dbox_top.stderr \ -in $dbox_top.output -side top -anchor nw -fill x -expand 1 pack $dbox_top.merge $dbox_top.retain \ -in $dbox_top.action -side left -anchor nw -fill x -expand 1 pack $dbox_top.stdout.fsboxButton $dbox_top.stdout.file \ $dbox_top.stdout.host -side left -anchor nw pack $dbox_top.stderr.fsboxButton $dbox_top.stderr.file \ $dbox_top.stderr.host -side left -anchor nw ## END of PACK set_default_qsub_main set_default_qsub_concur set_default_qsub_after set_default_qsub_before set_default_qsub_staging set_default_qsub_misc set_default_qsub_email set_default_qsub_datetime init_qsub_depend_argstr invoke_qsub_widgets qsubv tkwait visibility $qsubDialogBox remove_busy_cursor catch {tkwait window $qsubDialogBox} boxesUnset set activeWindow($qsubDialogBox) 0 set varnames "qsubv qsubv_res qsubv_val qsubv_evar qsubv_eval \ qsubv_notify_addr qsubv_stagein_host qsubv_stagein_input \ qsubv_stagein_local qsubv_stageout_local qsubv_stageout_host \ qsubv_stageout_output qsubv_shellp qsubv_shellh qsubv_groupg \ qsubv_grouph qsubv_useru qsubv_userh" foreach v $varnames { catch {unset $v} } } # pre_build_opt: builds the options for QSUB based on widget values. # RETURNS: 0 if successful; 1 otherwise proc pre_build_qsub_opt {} { global def_qsub qsubv qsubDialogBox qsubv_res qsubv_val \ qsubv_evar qsubv_eval init_qsub_main_argstr if { [string compare $qsubv(jobName) ""] != 0 && \ ([string length $qsubv(jobName)] > 15 || \ ![regexp "\[a-zA-Z]+" [string index $qsubv(jobName) 0]]) } { popupInfoBox $qsubDialogBox "Found Job Name to be of more than 15 chars,\ or the first letter is non-alphabetic. Please fix." return 1 } set d_idx [$qsubv(destLbox) curselection] if {[string compare $d_idx ""] != 0} { set qsubv(destination) [$qsubv(destLbox) get $d_idx] } if { [string compare $qsubv(notify_opt\(abort\)) \ $def_qsub(notify_opt\(abort\))] != 0 || \ [string compare $qsubv(notify_opt\(begin\)) \ $def_qsub(notify_opt\(begin\))] != 0 || \ [string compare $qsubv(notify_opt\(end\)) \ $def_qsub(notify_opt\(end\))] != 0 } { set qsubv(mail_option) \ "$qsubv(notify_opt\(abort\))$qsubv(notify_opt\(begin\))$qsubv(notify_opt\(end\))" if {[string compare $qsubv(mail_option) ""] == 0} { set qsubv(mail_option) "n" } } if [info exists qsubv(chkboxStdoutRet)] { set state [lindex [$qsubv(chkboxStdoutRet) configure -state] 4] if {[string compare $state "normal"] == 0 && \ [string compare $qsubv(stdoutRet) $def_qsub(stdoutRet)] != 0} { append retain $qsubv(stdoutRet) } } if [info exists qsubv(chkboxStderrRet)] { set state [lindex [$qsubv(chkboxStderrRet) configure -state] 4] if {[string compare $state "normal"] == 0 && \ [string compare $qsubv(stderrRet) $def_qsub(stderrRet)] != 0} { append retain $qsubv(stderrRet) } } if {[info exists retain] && \ [string compare $retain ""] != 0} { set qsubv(keep_args) $retain unset retain } if [info exists qsubv(StdoutFile)] { set state [lindex [$qsubv(StdoutFile) configure -state] 4] if {[string compare $state "normal"] == 0} { if { [trimvar ":" qsubv(stdoutFile)] || \ [trimvar ":" qsubv(stdoutHost)] } { popupInfoBox $qsubDialogBox "Detected an illegal character \":\" within\ Stdout filename/hostname. Please remove." return 1 } if {[string compare $qsubv(stdoutHost) ""] != 0 && \ [string compare $qsubv(stdoutFile) ""] == 0} { popupInfoBox $qsubDialogBox "Stdout File/Host specification is incomplete" return 1 } if {[string compare $qsubv(stdoutHost) $def_qsub(stdoutHost)] != 0 || \ [string compare $qsubv(stdoutFile) $def_qsub(stdoutFile)] != 0} { if {[string compare $qsubv(stdoutHost) ""] != 0} { set qsubv(stdoutPath) "$qsubv(stdoutHost):$qsubv(stdoutFile)" } elseif {[string compare $qsubv(stdoutFile) ""] != 0} { set qsubv(stdoutPath) "$qsubv(stdoutFile)" } } } } if [info exists qsubv(StderrFile)] { set state [lindex [$qsubv(StderrFile) configure -state] 4] if {[string compare $state "normal"] == 0} { if { [trimvar ":" qsubv(stderrFile)] || \ [trimvar ":" qsubv(stderrHost)] } { popupInfoBox $qsubDialogBox "Detected an illegal character \":\" in\ Stderr filename/hostname. Please remove." return 1 } if {[string compare $qsubv(stderrHost) ""] != 0 && \ [string compare $qsubv(stderrFile) ""] == 0} { popupInfoBox $qsubDialogBox "Stderr File/Host specification is incomplete" return 1 } if {[string compare $qsubv(stderrHost) $def_qsub(stderrHost)] != 0 || \ [string compare $qsubv(stderrFile) $def_qsub(stderrFile)] != 0} { if {[string compare $qsubv(stderrHost) ""] != 0} { set qsubv(stderrPath) "$qsubv(stderrHost):$qsubv(stderrFile)" } elseif {[string compare $qsubv(stderrFile) ""] != 0} { set qsubv(stderrPath) "$qsubv(stderrFile)" } } } } set size 0 if [info exists qsubv_res] { set size [array size qsubv_res] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "=," qsubv_res($i)] || \ [trimvar "=," qsubv_val($i)] } { popupInfoBox $qsubDialogBox "Detected an illegal character \"=\" or\ \",\" in resource name or value entry $i. Please remove." return 1 } if {[string compare $qsubv_res($i) ""] == 0 && \ [string compare $qsubv_val($i) ""] != 0} { popupInfoBox $qsubDialogBox "Resource List entry $i is incomplete" return 1 } if {[string compare $qsubv_res($i) ""] != 0 || \ [string compare $qsubv_val($i) ""] != 0} { if {[string compare $qsubv_val($i) ""] == 0} { set resources($i) "$qsubv_res($i)" } else { set resources($i) "$qsubv_res($i)=$qsubv_val($i)" } } } set qsubv(res_args) [construct_array_args resources ","] catch {unset resources} set qsub(env_args) "" set size 0 if [info exists qsubv_evar] { set size [array size qsubv_evar] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "=," qsubv_evar($i)] || \ [trimvar "=," qsubv_eval($i)] } { popupInfoBox $qsubDialogBox "Detected an illegal character \"=\" \ or \",\" in environment variable name or value entry $i. Please remove." return 1 } if {[string compare $qsubv_evar($i) ""] == 0 && \ [string compare $qsubv_eval($i) ""] != 0} { popupInfoBox $qsubDialogBox "Variable List entry $i is incomplete" return 1 } if {[string compare $qsubv_evar($i) ""] != 0 || \ [string compare $qsubv_eval($i) ""] != 0} { if {[string compare $qsubv_eval($i) ""] == 0} { set envariables($i) "$qsubv_evar($i)" } else { set envariables($i) "$qsubv_evar($i)=$qsubv_eval($i)" } } } set qsubv(env_args) [construct_array_args envariables ","] catch {unset envariables} pre_build_depend_opt qsubv def_qsub pre_build_staging_opt qsubv pre_build_misc_opt qsubv def_qsub if { [string compare $qsubv(qtime) "now"] != 0 } { pre_build_datetime_opt qsubv } else { init_qsub_datetime_argstr } if {[string compare $qsubv(mail_option) "n"] == 0} { init_qsub_email_argstr } else { pre_build_email_opt qsubv } return 0 } # invoke_qsub_widgets: invoke the various widgets found in the Qsub Main # dialog box. proc invoke_qsub_widgets assoc_array { upvar $assoc_array arr invoke_cbutton $arr(chkboxStdoutRet) invoke_cbutton $arr(chkboxStderrRet) invoke_rbutton [list $arr(radioboxStdoutMerge) \ $arr(radioboxStderrMerge) \ $arr(radioboxNoMerge)] invoke_cbutton $arr(chkboxNotifyAbort) invoke_cbutton $arr(chkboxNotifyBegin) invoke_cbutton $arr(chkboxNotifyEnd) } # confirmDelete: pops up a dialog box asking confirmation from user about saving # current submit options into a file. proc confirmDelete {} { global LABELFONT qsubDialogBox qsubv confDialogBox set confDialogBox ".confirm" set dbox [popupDialogBox $confDialogBox "Save to File"] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left -font $LABELFONT \ -aspect 2000 -text \ "Overwrite \"$qsubv(scriptName)\" file?" pack $dbox_top.msg -padx 3m -pady 3m set buttons [buildCmdButtons $dbox_bottom {{{yes yes} {no no}}} x 0 10 3] set yes_button [lindex $buttons 1] set no_button [lindex $buttons 2] $yes_button configure -command { set qsubv(overwriteFile) 1 destroy $confDialogBox } $no_button configure -command { set qsubv(overwriteFile) 0 destroy $confDialogBox } register_default_action $confDialogBox $no_button tkwait window $confDialogBox focus $qsubDialogBox } # procedure that takes 'output' string and display it on screen via an output # box that includes a single Ok button. proc serverSelect {} { global LABELFONT serverDialogBox hostsSelected submitHost qsubv tk_version set serverDialogBox ".server" set dbox [popupDialogBox $serverDialogBox "Server Selection"] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left -aspect 1000 \ -font $LABELFONT \ -text "More than one host selected.\n Please select the one host to submit job to:" frame $dbox_top.dest set listBoxInfo [buildFullListbox $dbox_top.dest 30x6 "" yscroll 0 1] set destListframe [lindex $listBoxInfo 0] set qsubv(serverLbox) [lindex $listBoxInfo 3] bind_listbox_single_select $qsubv(serverLbox) foreach q $hostsSelected { $qsubv(serverLbox) insert end $q } if {$tk_version < 4.0} { $qsubv(serverLbox) select from 0 } else { $qsubv(serverLbox) select anchor 0 $qsubv(serverLbox) select set anchor 0 } set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command { set submitHost [$qsubv(serverLbox) get [$qsubv(serverLbox) curselection]] destroy $serverDialogBox } pack $dbox_top.msg $dbox_top.dest -side top -padx 3m -pady 3m register_default_action $serverDialogBox $ok_button catch {tkwait window $serverDialogBox} } torque-2.4.16/src/gui/before_depend.tk0000664000113300011330000002674711272401236014546 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # before_depend: defines the layout and functions of the concurrency set, before # before_dependency, and before before_dependency dialog box. This returns input focus # back to 'callerDialogBox' when the before_depend dialog box is closed. proc before_depend {callerDialogBox {qalter 0} } { global LABELFONT activeWindow def before_dependDialogBox if {!$qalter} { global qsubv ARR def_qsub set ARR "qsubv" set def def_qsub } else { global qalterv ARR def_qalter set ARR "qalterv" set def def_qalter } global jobinfo JOBS_LISTBOX_KEY beforeJob busy_cursor ## Bring up the standard Dialog box ## set before_dependDialogBox ".before_depend" set dbox [popupDialogBox $before_dependDialogBox "Before Dependency" 1 "" $callerDialogBox] set activeWindow($before_dependDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {cancel "reset to default"} {help help}}} x 9m 16 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdOk configure -command { destroy $before_dependDialogBox } if {$qalter} { $cmdCancel configure -width 18 -command { set_default_qalter_before } } else { $cmdCancel configure -width 18 -command { set_default_qsub_before } } $cmdHelp configure -command {xpbs_help before_depend $before_dependDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.lchild frame $dbox_top.rchild frame $dbox_top.beforebox frame $dbox_top.beforebuttons frame $dbox_top.beforebuttons.before frame $dbox_top.beforebuttons.beforeok frame $dbox_top.beforebuttons.beforenotok frame $dbox_top.beforebuttons.beforeany ## ARRANGEMENT ON SCREEN ### BEFORE #### message $dbox_top.beforeboxlabel -anchor c -font $LABELFONT -aspect 1000 \ -text "BEFORE scheduling the following job(s) for execution:" set listBoxInfo [buildFullListbox $dbox_top.beforebox 28x10 "(select one or more) " yscroll 1 0] set jobidframe [lindex $listBoxInfo 0] set ${ARR}(selButton) [lindex $listBoxInfo 2] set ${ARR}(beforejobidBox) [lindex $listBoxInfo 3] if [info exists jobinfo] { foreach el [array names jobinfo] { set vallist [list $jobinfo($el)] set i 0 foreach val [lindex $vallist $i] { set entry [strget_keyvals $val $JOBS_LISTBOX_KEY "@"] [set ${ARR}(beforejobidBox)] insert end $entry incr i } } } bind_depend before [set ${ARR}(beforejobidBox)] [set ${ARR}(selButton)] configure -textvariable ${ARR}(beforeSelMode) \ -command { if { [string compare [set ${ARR}(beforeSelMode)] "Select All"] == 0 } { if { $tk_version < 4.0 } { [set ${ARR}(beforejobidBox)] select from 0 [set ${ARR}(beforejobidBox)] select to end } else { [set ${ARR}(beforejobidBox)] select anchor 0 [set ${ARR}(beforejobidBox)] select set anchor end } set ${ARR}(beforeSelMode) "Deselect All" set beforeJob [get_keyvals [set ${ARR}(beforejobidBox)] \ {0} "" ":" "select"] } else { if {$tk_version < 4.0} { [set ${ARR}(beforejobidBox)] select clear } else { [set ${ARR}(beforejobidBox)] select clear 0 end } set ${ARR}(beforeSelMode) "Select All" set beforeJob "" } } set entrybox [buildFullEntrybox $dbox_top.beforebuttons.before 11 "before:" \ 45 "" right 0 left] set ${ARR}(beforeJobidLabel) [lindex $entrybox 1] set ${ARR}(beforeJobid) [lindex $entrybox 2] set ${ARR}(beforeJobidScroll) [lindex $entrybox 3] [set ${ARR}(beforeJobid)] configure -textvariable ${ARR}(beforeJobs) register_default_action [set ${ARR}(beforeJobid)] $cmdOk set entrybox [buildFullEntrybox $dbox_top.beforebuttons.beforeok 11 \ "beforeok:" 45 "" right 0 left] set ${ARR}(beforeokJobidLabel) [lindex $entrybox 1] set ${ARR}(beforeokJobid) [lindex $entrybox 2] set ${ARR}(beforeokJobidScroll) [lindex $entrybox 3] [set ${ARR}(beforeokJobid)] configure -textvariable ${ARR}(beforeokJobs) register_default_action [set ${ARR}(beforeokJobid)] $cmdOk set entrybox [buildFullEntrybox $dbox_top.beforebuttons.beforenotok 11 \ "beforenotok:" 45 "" right 0 left] set ${ARR}(beforenotokJobidLabel) [lindex $entrybox 1] set ${ARR}(beforenotokJobid) [lindex $entrybox 2] set ${ARR}(beforenotokJobidScroll) [lindex $entrybox 3] [set ${ARR}(beforenotokJobid)] configure -textvariable ${ARR}(beforenotokJobs) register_default_action [set ${ARR}(beforenotokJobid)] $cmdOk set entrybox [buildFullEntrybox $dbox_top.beforebuttons.beforeany 11 \ "beforeany:" 45 "" right 0 left] set ${ARR}(beforeanyJobidLabel) [lindex $entrybox 1] set ${ARR}(beforeanyJobid) [lindex $entrybox 2] set ${ARR}(beforeanyJobidScroll) [lindex $entrybox 3] [set ${ARR}(beforeanyJobid)] configure -textvariable ${ARR}(beforeanyJobs) register_default_action [set ${ARR}(beforeanyJobid)] $cmdOk set chkboxList \ [list [concat before \"THIS JOB must have started execution.\" $dbox_top.beforebuttons.before] \ [concat beforeOk \"THIS JOB must have terminated without errors." \ $dbox_top.beforebuttons.beforeok] \ [concat beforeNotok \"THIS JOB must have terminated with errors.\" \ $dbox_top.beforebuttons.beforenotok] \ [concat beforeAny \"THIS JOB must have terminated with or without errors.\" \ $dbox_top.beforebuttons.beforeany] \ ] set cmdbox [buildCmdButtons $dbox_top.beforebuttons [list $chkboxList] \ y 2m 56 0 0 0 10m "(click the appropriate button)" 0] set ${ARR}(cmdboxBefore) [lindex $cmdbox 1] set ${ARR}(cmdboxBeforeok) [lindex $cmdbox 2] set ${ARR}(cmdboxBeforenotok) [lindex $cmdbox 3] set ${ARR}(cmdboxBeforeany) [lindex $cmdbox 4] [set ${ARR}(cmdboxBefore)] configure -command { enable_fullentry [set ${ARR}(beforeJobidLabel)] \ [set ${ARR}(beforeJobid)] \ [set ${ARR}(beforeJobidScroll)] set ${ARR}(beforeJobs) $beforeJob } [set ${ARR}(cmdboxBeforeok)] configure -command { enable_fullentry [set ${ARR}(beforeokJobidLabel)] \ [set ${ARR}(beforeokJobid)] \ [set ${ARR}(beforeokJobidScroll)] set ${ARR}(beforeokJobs) $beforeJob } [set ${ARR}(cmdboxBeforenotok)] configure -command { enable_fullentry [set ${ARR}(beforenotokJobidLabel)] \ [set ${ARR}(beforenotokJobid)] \ [set ${ARR}(beforenotokJobidScroll)] set ${ARR}(beforenotokJobs) $beforeJob } [set ${ARR}(cmdboxBeforeany)] configure -command { enable_fullentry [set ${ARR}(beforeanyJobidLabel)] \ [set ${ARR}(beforeanyJobid)] \ [set ${ARR}(beforeanyJobidScroll)] set ${ARR}(beforeanyJobs) $beforeJob } ### PACK the FRAMES pack $dbox_top.beforeboxlabel $dbox_top.beforebox -side top \ -in $dbox_top.lchild -anchor nw label $dbox_top.dummy -height 3 pack $dbox_top.dummy $dbox_top.beforebuttons -side top -in $dbox_top.rchild pack $dbox_top.lchild $dbox_top.rchild -side left -anchor nw -padx 2m remove_busy_cursor catch {tkwait window $before_dependDialogBox} set activeWindow($before_dependDialogBox) 0 focus $callerDialogBox catch {grab $callerDialogBox} } torque-2.4.16/src/gui/qrls.tk0000664000113300011330000001633711272401236012740 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qrls: defines the layout and functions of the release job dialog box. proc qrls {} { global jobsSelected SERVER_HOSTS cmdpath qrlsDialogBox LABELFONT \ activeWindow qrlsv busy_cursor ## Bring up the standard Dialog box ## set qrlsDialogBox ".hold" set dbox [popupDialogBox $qrlsDialogBox "Release Job Dialog"] set activeWindow($qrlsDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{release release} {cancel cancel} {help help}}} x 10m 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdHold [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdHold configure -command { if { [string compare $qrlsv(other) ""] == 0 && \ [string compare $qrlsv(system) ""] == 0} { set qrlsv(user) u update idletasks set exitcode [win_cmdExec $qrlsDialogBox "$cmdpath(QRLS) $jobsSelected"] } else { set exitcode [win_cmdExec $qrlsDialogBox "$cmdpath(QRLS) -h $qrlsv(user)$qrlsv(other)$qrlsv(system) $jobsSelected"] } if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] destroy $qrlsDialogBox } } $cmdCancel configure -command [list destroy $qrlsDialogBox] $cmdHelp configure -command {xpbs_help release $qrlsDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.e frame $dbox_top.c frame $dbox_top.empty1 -width 10m frame $dbox_top.empty2 -width 10m set jobidbox [buildFullListbox $dbox_top.e 40x3 "" xyscroll 0] set jobidFrame [lindex $jobidbox 0] set jobidField [lindex $jobidbox 3] $jobidFrame configure -relief sunken bind_text_readonly $jobidField foreach el $jobsSelected { $jobidField insert end $el } set chkbox [buildCheckboxes $dbox_top.c \ {{{user user} {other other} {system system}}} column 0] set chkboxFrame [lindex $chkbox 0] set chkboxUser [lindex $chkbox 1] set chkboxOther [lindex $chkbox 2] set chkboxSystem [lindex $chkbox 3] $chkboxFrame configure -relief groove -borderwidth 2 $chkboxUser configure -variable qrlsv(user) -onvalue u -offvalue "" $chkboxOther configure -variable qrlsv(other) -onvalue o -offvalue "" $chkboxSystem configure -variable qrlsv(system) -onvalue s -offvalue "" set qrlsv(user) u set qrlsv(other) "" set qrlsv(system) "" label $dbox_top.chkboxLabel1 -text "Release" -font $LABELFONT label $dbox_top.chkboxLabel2 -text "hold(s) from job(s):" -font $LABELFONT ## ARRANGEMENT ON SCREEN pack $dbox_top.header -side top pack $dbox_top.empty1 $dbox_top.chkboxLabel1 -side left -anchor nw pack $chkboxFrame -after $dbox_top.chkboxLabel1 -anchor nw -side left -pady 2 pack $dbox_top.chkboxLabel2 $jobidFrame $dbox_top.empty2 -anchor nw -side left pack $dbox_top.footer -before $chkboxFrame -side bottom register_default_action $qrlsDialogBox $cmdCancel tkwait visibility $qrlsDialogBox remove_busy_cursor catch {tkwait window $qrlsDialogBox} set activeWindow($qrlsDialogBox) 0 catch {unset qrlsv} } torque-2.4.16/src/gui/after_depend.tk0000664000113300011330000003010211272401236014361 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # after_depend: defines the layout and functions of the concurrency set, after # after_dependency, and before after_dependency dialog box. This returns input focus # back to 'callerDialogBox' when the after_depend dialog box is closed. proc after_depend {callerDialogBox {qalter 0} } { global LABELFONT activeWindow def after_dependDialogBox if {!$qalter} { global qsubv ARR def_qsub set ARR "qsubv" set def def_qsub } else { global qalterv ARR def_qalter set ARR "qalterv" set def def_qalter } global ${ARR}_after_parent_id ${ARR}_afterok_parent_id \ ${ARR}_afternotok_parent_id ${ARR}_afterany_parent_id \ ${ARR}_before_parent_id ${ARR}_beforeok_parent_id \ ${ARR}_beforenotok_parent_id ${ARR}_beforeany_parent_id \ jobinfo JOBS_LISTBOX_KEY afterJob busy_cursor ## Bring up the standard Dialog box ## set after_dependDialogBox ".after_depend" set dbox [popupDialogBox $after_dependDialogBox "After Dependency" 1 "" $callerDialogBox] set activeWindow($after_dependDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {cancel "reset to default"} {help help}}} x 9m 16 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdOk configure -command { destroy $after_dependDialogBox } if {$qalter} { $cmdCancel configure -width 18 -command { set_default_qalter_after } } else { $cmdCancel configure -width 18 -command { set_default_qsub_after } } $cmdHelp configure -command {xpbs_help after_depend $after_dependDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.on frame $dbox_top.on.count frame $dbox_top.lchild frame $dbox_top.rchild frame $dbox_top.afterbox frame $dbox_top.afterbuttons frame $dbox_top.afterbuttons.after frame $dbox_top.afterbuttons.afterok frame $dbox_top.afterbuttons.afternotok frame $dbox_top.afterbuttons.afterany label $dbox_top.on.label -text "THIS JOB is dependent on" \ -font $LABELFONT -padx 1 -pady 1 set spinBox [buildSpinbox $dbox_top.on.count 2 \ 1-99 ${ARR} oncount "other job(s)." right] set spinCountFrame [lindex $spinBox 0] set ${ARR}(spinCountEntry) [lindex $spinBox 1] register_default_action [set ${ARR}(spinCountEntry)] $cmdOk ## ARRANGEMENT ON SCREEN ### AFTER #### message $dbox_top.afterboxlabel -anchor c -font $LABELFONT -aspect 1000 \ -text "THIS JOB should be scheduled for execution AFTER the following job(s):" set listBoxInfo [buildFullListbox $dbox_top.afterbox 28x10 "(select one or more) " yscroll 1 0] set jobidframe [lindex $listBoxInfo 0] set ${ARR}(selButton) [lindex $listBoxInfo 2] set ${ARR}(afterjobidBox) [lindex $listBoxInfo 3] if [info exists jobinfo] { foreach el [array names jobinfo] { set vallist [list $jobinfo($el)] set i 0 foreach val [lindex $vallist $i] { set entry [strget_keyvals $val $JOBS_LISTBOX_KEY "@"] [set ${ARR}(afterjobidBox)] insert end $entry incr i } } } bind_depend after [set ${ARR}(afterjobidBox)] [set ${ARR}(selButton)] configure -textvariable ${ARR}(afterSelMode) \ -command { if { [string compare [set ${ARR}(afterSelMode)] "Select All"] == 0 } { if { $tk_version < 4.0 } { [set ${ARR}(afterjobidBox)] select from 0 [set ${ARR}(afterjobidBox)] select to end } else { [set ${ARR}(afterjobidBox)] select anchor 0 [set ${ARR}(afterjobidBox)] select set anchor end } set ${ARR}(afterSelMode) "Deselect All" set afterJob [get_keyvals [set ${ARR}(afterjobidBox)] \ {0} "" ":" "select"] } else { if {$tk_version < 4.0} { [set ${ARR}(afterjobidBox)] select clear } else { [set ${ARR}(afterjobidBox)] select clear 0 end } set ${ARR}(afterSelMode) "Select All" set afterJob "" } } set entrybox [buildFullEntrybox $dbox_top.afterbuttons.after 11 "after:" 45 \ "" right 0 left] set ${ARR}(afterJobidLabel) [lindex $entrybox 1] set ${ARR}(afterJobid) [lindex $entrybox 2] set ${ARR}(afterJobidScroll) [lindex $entrybox 3] [set ${ARR}(afterJobid)] configure -textvariable ${ARR}(afterJobs) register_default_action [set ${ARR}(afterJobid)] $cmdOk set entrybox [buildFullEntrybox $dbox_top.afterbuttons.afterok 11 "afterok:" \ 45 "" right 0 left] set ${ARR}(afterokJobidLabel) [lindex $entrybox 1] set ${ARR}(afterokJobid) [lindex $entrybox 2] set ${ARR}(afterokJobidScroll) [lindex $entrybox 3] [set ${ARR}(afterokJobid)] configure -textvariable ${ARR}(afterokJobs) register_default_action [set ${ARR}(afterokJobid)] $cmdOk set entrybox [buildFullEntrybox $dbox_top.afterbuttons.afternotok 11 \ "afternotok:" 45 "" right 0 left] set ${ARR}(afternotokJobidLabel) [lindex $entrybox 1] set ${ARR}(afternotokJobid) [lindex $entrybox 2] set ${ARR}(afternotokJobidScroll) [lindex $entrybox 3] [set ${ARR}(afternotokJobid)] configure -textvariable ${ARR}(afternotokJobs) register_default_action [set ${ARR}(afternotokJobid)] $cmdOk set entrybox [buildFullEntrybox $dbox_top.afterbuttons.afterany 11 \ "afterany:" 45 "" right 0 left] set ${ARR}(afteranyJobidLabel) [lindex $entrybox 1] set ${ARR}(afteranyJobid) [lindex $entrybox 2] set ${ARR}(afteranyJobidScroll) [lindex $entrybox 3] [set ${ARR}(afteranyJobid)] configure -textvariable ${ARR}(afteranyJobs) register_default_action [set ${ARR}(afteranyJobid)] $cmdOk set chkboxList \ [list [concat after \"started execution.\" $dbox_top.afterbuttons.after] \ [concat afterOk \"terminated without errors." \ $dbox_top.afterbuttons.afterok] \ [concat afterNotok \"terminated with errors.\" \ $dbox_top.afterbuttons.afternotok] \ [concat afterAny \"terminated with or without errors.\" \ $dbox_top.afterbuttons.afterany] \ ] set cmdbox [buildCmdButtons $dbox_top.afterbuttons [list $chkboxList] \ y 2m 35 0 0 0 10m "(click the appropriate button)" 0] set ${ARR}(cmdboxAfter) [lindex $cmdbox 1] set ${ARR}(cmdboxAfterok) [lindex $cmdbox 2] set ${ARR}(cmdboxAfternotok) [lindex $cmdbox 3] set ${ARR}(cmdboxAfterany) [lindex $cmdbox 4] [set ${ARR}(cmdboxAfter)] configure -command { enable_fullentry [set ${ARR}(afterJobidLabel)] \ [set ${ARR}(afterJobid)] \ [set ${ARR}(afterJobidScroll)] set ${ARR}(afterJobs) $afterJob } [set ${ARR}(cmdboxAfterok)] configure -command { enable_fullentry [set ${ARR}(afterokJobidLabel)] \ [set ${ARR}(afterokJobid)] \ [set ${ARR}(afterokJobidScroll)] set ${ARR}(afterokJobs) $afterJob } [set ${ARR}(cmdboxAfternotok)] configure -command { enable_fullentry [set ${ARR}(afternotokJobidLabel)] \ [set ${ARR}(afternotokJobid)] \ [set ${ARR}(afternotokJobidScroll)] set ${ARR}(afternotokJobs) $afterJob } [set ${ARR}(cmdboxAfterany)] configure -command { enable_fullentry [set ${ARR}(afteranyJobidLabel)] \ [set ${ARR}(afteranyJobid)] \ [set ${ARR}(afteranyJobidScroll)] set ${ARR}(afteranyJobs) $afterJob } ### PACK the FRAMES pack $dbox_top.afterboxlabel $dbox_top.afterbox -side top \ -in $dbox_top.lchild -anchor nw label $dbox_top.dummy -height 3 pack $dbox_top.dummy $dbox_top.afterbuttons -side top -in $dbox_top.rchild pack $dbox_top.lchild $dbox_top.rchild -side left -anchor nw -padx 2m pack $dbox_top.on.label $dbox_top.on.count -side left -anchor nw pack $dbox_top.on -side bottom -before $dbox_top.lchild -anchor nw -padx 2m remove_busy_cursor catch {tkwait window $after_dependDialogBox} set activeWindow($after_dependDialogBox) 0 focus $callerDialogBox catch {grab $callerDialogBox} } torque-2.4.16/src/gui/staging.tk0000664000113300011330000003645211272401236013413 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # staging: defines the layout and functions of the file staging dialog box. # Input focus returns to 'callerDialogBox' upon return. # CONTEXT: executes originally in the context of qsub, but can changed via # setting qalter to 1. proc staging {callerDialogBox {qalter 0}} { global LABELFONT stagingDialogBox activeWindow numStaging fileselect if {!$qalter} { global qsubv ARR set ARR "qsubv" } else { global qalterv ARR set ARR "qalterv" } global ${ARR}_stagein_host ${ARR}_stagein_input ${ARR}_stagein_local \ ${ARR}_stageout_local ${ARR}_stageout_host ${ARR}_stageout_output busy_cursor ## Bring up the standard Dialog box ## set stagingDialogBox .staging set dbox [popupDialogBox $stagingDialogBox "File Staging Dialog" 1 "" $callerDialogBox] set activeWindow($stagingDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {cancel "reset to default"} {help help}}} x 10m 16 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdOk configure -width 18 -command { if [pre_build_staging_opt $ARR] { return } destroy $stagingDialogBox } if {$qalter} { $cmdCancel configure -width 18 \ -command "set_default_qalter_staging; boxLoad $dbox_top.stagein; boxLoad $dbox_top.stageout" } else { $cmdCancel configure -width 18 \ -command "set_default_qsub_staging; boxLoad $dbox_top.stagein; boxLoad $dbox_top.stageout" } $cmdHelp configure -command {xpbs_help staging $stagingDialogBox} ## TOP PART ## frame $dbox_top.header -height 5m -width 5m frame $dbox_top.footer -height 5m -width 5m frame $dbox_top.gap -height 5m -width 5m frame $dbox_top.stagein -relief groove -borderwidth 2 frame $dbox_top.stageout -relief groove -borderwidth 2 frame $dbox_top.fsbox -relief groove -borderwidth 4 set fileselect(path) {} set fileselect(filepath) {} ## STAGEIN box $dbox_top.stagein -title "Stagein (from HERE to THERE):" \ -entrylabels {{{HERE host}} {{HERE input_file}} {{THERE local_file}}} \ -lboxwidths {20 30 30} -lboxheights {2 2 2} \ -lboxlabels {{Stagein Files:} " " " "} -orient xy \ -grabBox $stagingDialogBox \ -cmdbutton [list {Add file selected from File Selection Box..} \ { \ box [set ${ARR}(stagein_frame)] -entryval 0 $fileselect(host); \ box [set ${ARR}(stagein_frame)] -entryval 1 $fileselect(filepath) \ }] \ -key {0 1 2} \ -array 0 ${ARR}_stagein_host \ -array 1 ${ARR}_stagein_input \ -array 2 ${ARR}_stagein_local boxLoad $dbox_top.stagein set ${ARR}(stagein_frame) $dbox_top.stagein box $dbox_top.stageout -title "Stageout (from THERE to HERE): " \ -entrylabels {{{THERE local_file}} {{HERE host}} {{HERE output_file}}} \ -lboxwidths {30 20 30} -lboxheights {2 2 2} \ -lboxlabels {{Stageout Files:} " " " "} -orient xy \ -grabBox $stagingDialogBox \ -key {0 1 2} \ -cmdbutton [list {Add file selected from File Selection Box..} \ { \ box [set ${ARR}(stageout_frame)] -entryval 1 $fileselect(host); \ box [set ${ARR}(stageout_frame)] -entryval 2 $fileselect(filepath) \ }] \ -array 0 ${ARR}_stageout_local \ -array 1 ${ARR}_stageout_host \ -array 2 ${ARR}_stageout_output boxLoad $dbox_top.stageout set ${ARR}(stageout_frame) $dbox_top.stageout focus $stagingDialogBox register_default_action $stagingDialogBox $cmdOk set fileselect(fsbox) $dbox_top.fsbox set fileselect(fsboxButton) $dbox_top.fsboxButton set fileselect(fsboxDisplay) 0 button $dbox_top.fsboxButton -font $LABELFONT \ -text "Click me to bring up File Selection Box.." \ -command { if { $fileselect(fsboxDisplay) } { pack forget $fileselect(fsbox) $fileselect(fsboxButton) configure \ -text "Click me to bring up File Selection Box.." set fileselect(fsboxDisplay) 0 } else { pack $fileselect(fsbox) -after $fileselect(fsboxButton) $fileselect(fsboxButton) configure \ -text "Click me to remove File Selection Box.." set fileselect(fsboxDisplay) 1 } } ## ARRANGEMENT ON SCREEN pack forget $dbox_top.stagein $dbox_top.stageout pack $dbox_top.fsboxButton -anchor c -side top pack $dbox_top.header -anchor nw -side top pack $dbox_top.stagein $dbox_top.gap -anchor c -side top pack $dbox_top.stageout $dbox_top.footer -anchor c -side top createFileselectWidget $dbox_top.fsbox "FILE SELECTION BOX" 0 80x6 tkwait visibility $stagingDialogBox remove_busy_cursor catch {tkwait window $stagingDialogBox} set activeWindow($stagingDialogBox) 0 focus $callerDialogBox catch {grab $callerDialogBox} } # check_staging_input: checks for the existence of "host:file" input. # RETURNS: # 1 if file@host exists # 0 if file@host does not exist # -1 If directory containing "file@host" does not exist, # implying "file@host" does not exist. # -2 if problem executing command needed to check for # existence of dir/file. proc check_staging_input {host file} { global RSH set basename [file tail $file] if { [string compare [string trimleft $file "./"] $basename] == 0 } { set hdir [cmdExec "$RSH $host pwd"] set file "$hdir/$file" } set dirname [file dirname $file] set localhost [cmdExec hostname] if { [string compare $host $localhost] == 0 } { if { ![file isdirectory $dirname] } { return -1 } return [file isfile $file] } else { set dirOk [cmdExec "$RSH $host \"test -d $dirname && echo 1\""] if { [string compare $dirOk ""] == 0 } { return -1 } elseif { [string compare $dirOk "1"] != 0 } { return -2 } set filOk [cmdExec "$RSH $host \"test -f $file && echo 1\""] if { [string compare $filOk "1"] == 0 } { return 1 } elseif { [string compare $filOk ""] == 0 } { return 0 } else { return -2 } } } # pre_build_staging_opt: builds the email options suitable for processing by # either qsub or qalter. proc pre_build_staging_opt {array} { upvar $array ARR global stagingDialogBox \ ${array}_stagein_host ${array}_stagein_input ${array}_stagein_local \ ${array}_stageout_local ${array}_stageout_host ${array}_stageout_output if [regexp "qsub" $array] { init_qsub_staging_argstr } else { init_qalter_staging_argstr } set size 0 if [info exists ${array}_stagein_host] { set size [array size ${array}_stagein_host] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "@:," ${array}_stagein_host($i)] || \ [trimvar "@:," ${array}_stagein_input($i)] || \ [trimvar "@:," ${array}_stagein_local($i)] } { popupInfoBox $stagingDialogBox "Detected an illegal character \ \"@\", \":\", \",\" in stagein entry $i. Please remove." return 1 } set stagein_host [set ${array}_stagein_host($i)] set stagein_input [set ${array}_stagein_input($i)] set stagein_local [set ${array}_stagein_local($i)] if {[string compare $stagein_host ""] != 0 && \ [string compare $stagein_input ""] != 0 && \ [string compare $stagein_local ""] != 0} { set stagein_file($i) "$stagein_local@$stagein_host:$stagein_input" } elseif {[string compare $stagein_host ""] != 0 || \ [string compare $stagein_input ""] != 0 || \ [string compare $stagein_local ""] != 0} { popupInfoBox $stagingDialogBox "Incomplete specification found in Stagein entry $i" return 1 } if [winfo exists $stagingDialogBox] { if { [string compare $stagein_host ""] != 0 && \ [string compare $stagein_input ""] != 0 } { set ret [check_staging_input $stagein_host $stagein_input] if { $ret == -1 || $ret == 0 } { if { [popupInfoBoxWOpt $stagingDialogBox \ "$stagein_input@$stagein_host\ file (stagein entry $i) does not exist."] == 1} { return 1 } } } } } set ARR(stagein_filelist) \ [construct_array_args stagein_file "," "stagein="] set size 0 if [info exists ${array}_stageout_host] { set size [array size ${array}_stageout_host] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "@:," ${array}_stageout_host($i)] || \ [trimvar "@:," ${array}_stageout_output($i)] || \ [trimvar "@:," ${array}_stageout_local($i)] } { popupInfoBox $stagingDialogBox "Detected an illegal character \ \"@\", \":\", \",\" in stageout entry $i. Please remove." return 1 } set stageout_host [set ${array}_stageout_host($i)] set stageout_output [set ${array}_stageout_output($i)] set stageout_local [set ${array}_stageout_local($i)] if {[string compare $stageout_host ""] != 0 && \ [string compare $stageout_output ""] != 0 && \ [string compare $stageout_local ""] != 0} { set stageout_file($i) "$stageout_local@$stageout_host:$stageout_output" } elseif {[string compare $stageout_host ""] != 0 || \ [string compare $stageout_output ""] != 0 || \ [string compare $stageout_local ""] != 0} { popupInfoBox $stagingDialogBox "Incomplete specification found in Stageout entry $i" return 1 } if [winfo exists $stagingDialogBox] { if { [string compare $stageout_host ""] != 0 && \ [string compare $stageout_output ""] != 0 } { if { [check_staging_input $stageout_host $stageout_output] == -1 } { if { [popupInfoBoxWOpt $stagingDialogBox "Subdir\ [file dirname $stageout_output]@$stageout_host\ (stageout entry $i) does not exist."] == 1 } { return 1 } } } } } set ARR(stageout_filelist) \ [construct_array_args stageout_file "," "stageout="] catch {unset stagein_file} catch {unset stageout_file} return 0 } proc insertHereStageinEntry {array host input} { upvar $array ARR global ${array}_stagein_host ${array}_stagein_input if { [string compare $input ""] == 0 } { return } set size 0 if [info exists ${array}_stagein_host] { set size [array size ${array}_stagein_host] } for {set i 0} {$i < $size} {incr i} { if {[string compare [set ${array}_stagein_host($i)] ""] == 0 && \ [string compare [set ${array}_stagein_input($i)] ""] == 0 } { set ${array}_stagein_host($i) $host set ${array}_stagein_input($i) $input return } } if { $i == $size } { set ${array}_stagein_host($i) $host set ${array}_stagein_input($i) $input } } proc insertHereStageoutEntry {array host output} { upvar $array ARR global ${array}_stageout_host ${array}_stageout_output if { [string compare $output ""] == 0 } { return } set size 0 if [info exists ${array}_stageout_host] { set size [array size ${array}_stageout_host] } for {set i 0} {$i < $size} {incr i} { if {[string compare [set ${array}_stageout_host($i)] ""] == 0 && \ [string compare [set ${array}_stageout_output($i)] ""] == 0 } { set ${array}_stageout_host($i) $host set ${array}_stageout_output($i) $output return } } if { $i == $size } { set ${array}_stageout_host($i) $host set ${array}_stageout_output($i) $output } } torque-2.4.16/src/gui/button.tk0000664000113300011330000005376011272401236013273 00000000000000 # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains procedures related to button widgets (checkboxes, radio # buttons, command buttons. ################################################################################ # buildCheckboxes: creates a row or column of checkbuttons on 'frame_name' # following the arrangement specified in 'checkbutton_list'. # # INPUT FORMATS: # 'checkbutton_list' - # { {group1_button1_name group1_button1_label group1_button1_assoc} # {group1_button2_name group1_button2_label group1_button1_assoc} # . . . } # { {group2_button1_name group2_button1_label group2_button1_assoc} # {group2_button2_name group2_button2_label group2_button1_assoc} # . . . } # } # # 'orient' - how the group of checkbuttons are to be arranged: column, grid. # 'spacing' - amount of spacing between groups of checkbuttons (in Get_Pixels # format). # OPTIONS: # 'checkbox_labelstr' - if the entire groups of checkbuttons are to be given one # label string. # 'place_buttonAssoc_right' - if the button*_assoc is to be placed on the # right side of a check button. # 'place_labelstr_top' - if 'checkbox_labelstr' is to be placed on top of all # checkbuttons instead of to the left. # 'button_assoc_groove_relief' - if the button*_assoc is to be enclosed in a # a groove relief. # 'selective_right_placement' - refers to the nth button whose # association will be displayed on its # right if 'place_buttonAssoc_right' is # set. # ############################################################################### proc buildCheckboxes {frame_name checkbutton_list orient spacing \ {checkbox_labelstr ""} {place_buttonAssoc_right 1} {place_labelstr_top 0} \ {button_assoc_groove_relief 0} } { global LABELFONT BADPARAM errmsg set procname "buildCheckboxes" ## Let's be defensive about the input if { ![regexp "\\." $frame_name] || \ ([string compare $orient "column"] != 0 && \ [string compare $orient "grid"] != 0) } { puts "Error $BADPARAM in \{$procname $frame_name\}: $errmsg(BADPARAM)" exit $BADPARAM } if { [string compare $frame_name "."] == 0 } { set frame_name "" } if {[string compare $checkbox_labelstr ""] != 0} { message $frame_name.clabel -font $LABELFONT -aspect 1000 \ -text $checkbox_labelstr if {$place_labelstr_top} { pack $frame_name.clabel -side top -anchor nw } else { pack $frame_name.clabel -side left -anchor nw } } set i 1 set allButtonsList "" foreach group [lrange $checkbutton_list 0 end] { frame $frame_name.$i label $frame_name.${i}_dummy -width 1 -font $LABELFONT -padx 1 -pady 1 eval pack "$frame_name.${i}_dummy" -side left eval pack "$frame_name.$i" -side top -anchor nw set buttonList "" foreach button_entry [lrange $group 0 end] { set buttonName [lindex $button_entry 0] set buttonLabel [lindex $button_entry 1] set buttonAssoc [lindex $button_entry 2] if {[string compare $buttonAssoc ""] != 0} { if {$button_assoc_groove_relief} { frame $frame_name.$i.f$buttonName -relief groove -borderwidth 2 } else { frame $frame_name.$i.f$buttonName } checkbutton $frame_name.$i.f$buttonName.$buttonName -relief flat \ -anchor c -font $LABELFONT -text $buttonLabel \ -padx 1 -pady 1 if {$place_buttonAssoc_right} { pack $frame_name.$i.f$buttonName.$buttonName -side left -anchor nw } else { pack $frame_name.$i.f$buttonName.$buttonName -side top -anchor nw } pack forget $buttonAssoc if { $place_buttonAssoc_right } { pack $buttonAssoc -in $frame_name.$i.f$buttonName -side right \ -anchor nw } else { pack $buttonAssoc -in $frame_name.$i.f$buttonName -side bottom -anchor nw } raise $buttonAssoc $frame_name.$i.f$buttonName append buttonList " " $frame_name.$i.f$buttonName append allButtonsList " " $frame_name.$i.f$buttonName.$buttonName } else { checkbutton $frame_name.$i.$buttonName -relief flat -anchor c \ -font $LABELFONT -text $buttonLabel -padx 1 -pady 1 append buttonList " " $frame_name.$i.$buttonName append allButtonsList " " $frame_name.$i.$buttonName } } if { [string compare $orient "column"] == 0 } { eval pack "$buttonList" -side top -anchor nw -pady $spacing } else { eval pack "$buttonList" -side left -anchor nw -padx $spacing } incr i } return [concat $frame_name $allButtonsList] } ############################################################################### # buildCmdButtons: creates a row or column of command buttons on 'frame_name' # following the arrangement specified in 'cmdbutton_list'. # # INPUT FORMATS: # 'cmdbutton_list' - # { {group1_button1_name group1_button1_label group1_button1_assoc} # {group1_button2_name group1_button2_label group1_button1_assoc} # . . . } # { {group2_button1_name group2_button1_label group2_button1_assoc} # {group2_button2_name group2_button2_label group2_button1_assoc} # . . . } # } # # 'orient' - how the group of cmd buttons are to be arranged: x (lie in # a horizontal line), y (line in a vertical line), xy (row of columned # buttons). # 'spacing' - amount of spacing between groups of checkbuttons (in Get_Pixels # format). # 'button_width' - the width of a command button (in Get_Pixels format) # 'button_height' - the height of a command button(in Get_Pixels format) # OPTIONS: # 'first_group_spacing' - an optional boolean value that says to put # a button spacing before the 1st group of buttons # 'spread_out_buttons' - if 1 (true), then the buttons will be spread out # in the frame # 'group_spacing' - spacing between groups of cmd buttons. # 'cmdbutton_labelstr' - if the entire groups of cmdbuttons are to be given one # label string. ############################################################################### proc buildCmdButtons {frame_name cmdbutton_list orient spacing button_width\ button_height {first_group_spacing 0} \ {spread_out_buttons 1} {group_spacing "10m"} \ {cmdButton_labelstr ""} {place_buttonAssoc_right 1} \ {place_labelstr_top 0} {button_assoc_groove_relief 0} } { global LABELFONT BADPARAM errmsg set procname "buildCmdboxes" ## Let's be defensive about the input if { ![regexp "\\." $frame_name] || \ ([string compare $orient "x"] != 0 && \ [string compare $orient "y"] != 0 && \ [string compare $orient "xy"] != 0) || \ ![regexp "\[0-9]+" $button_width] || \ ![regexp "\[0-9]+" $button_height] } { puts "Error $BADPARAM in \{$procname $frame_name\}: $errmsg(BADPARAM)" exit $BADPARAM } if { [string compare $frame_name "."] == 0 } { set frame_name "" } if { [string compare $cmdButton_labelstr ""] != 0 } { message $frame_name.clabel -font $LABELFONT -text $cmdButton_labelstr \ -aspect 1000 pack $frame_name.clabel -side top -anchor nw } if {$spread_out_buttons} { pack forget $frame_name pack $frame_name -fill both -expand 1 -ipadx 5m -ipady 5m } set i 1 set allButtonsList "" foreach group [lrange $cmdbutton_list 0 end] { frame $frame_name.$i -relief flat set buttonList "" foreach button_entry $group { set buttonName [lindex $button_entry 0] set buttonLabel [lindex $button_entry 1] set buttonAssoc [lindex $button_entry 2] if {[string compare $buttonAssoc ""] != 0} { if {$button_assoc_groove_relief} { frame $frame_name.$i.f$buttonName -relief groove -borderwidth 2 } else { frame $frame_name.$i.f$buttonName } button $frame_name.$i.f$buttonName.$buttonName -anchor nw \ -font $LABELFONT -text $buttonLabel -width $button_width \ -height $button_height -padx 1 -pady 1 if {$place_buttonAssoc_right} { pack $frame_name.$i.f$buttonName.$buttonName -side left -anchor nw \ -side left -anchor nw -fill x } else { pack $frame_name.$i.f$buttonName.$buttonName -side top -anchor nw \ -side top -anchor nw -fill y } pack forget $buttonAssoc if { $place_buttonAssoc_right } { pack $buttonAssoc -in $frame_name.$i.f$buttonName -side right \ -anchor nw -fill x } else { pack $buttonAssoc -in $frame_name.$i.f$buttonName -side bottom \ -anchor nw -fill y } raise $buttonAssoc $frame_name.$i.f$buttonName append buttonList " " $frame_name.$i.f$buttonName append allButtonsList " " $frame_name.$i.f$buttonName.$buttonName } else { button $frame_name.$i.$buttonName -anchor c \ -font $LABELFONT -text $buttonLabel -width $button_width \ -height $button_height -padx 1 -pady 1 append buttonList " " $frame_name.$i.$buttonName append allButtonsList " " $frame_name.$i.$buttonName } } if { [string compare $orient "y"] == 0 } { eval pack "$buttonList" -side top -anchor nw -pady $spacing } else { eval pack "$buttonList" -side left -anchor c -padx $spacing -expand 1 } if {$i == 1 && $first_group_spacing} { ;# put an extra spacing before 1st label $frame_name.empty$i -width $button_width -height $button_height \ -padx 1 -pady 1 if { [string compare $orient "x"] == 0 } { if {$spread_out_buttons} { eval pack "$frame_name.empty$i $frame_name.$i" -anchor c \ -expand 1 -fill both } else { eval pack "$frame_name.empty$i $frame_name.$i" -anchor c } } else { if {$spread_out_buttons} { eval pack "$frame_name.empty$i $frame_name.$i" -side top -anchor c \ -fill both -expand 1 } else { eval pack "$frame_name.empty$i $frame_name.$i" -side top -anchor c } } } elseif { [expr $i % 2] == 0 } { ;# space even number buttons if { [string compare $orient "x"] == 0 } { if {$spread_out_buttons} { eval pack "$frame_name.$i" -padx $group_spacing -side left -anchor c \ -fill both -expand 1 } else { eval pack "$frame_name.$i" -padx $group_spacing -side left -anchor c } } else { if {$spread_out_buttons} { eval pack "$frame_name.$i" -pady $group_spacing -side top -anchor c \ -fill both -expand 1 } else { eval pack "$frame_name.$i" -pady $group_spacing -side top -anchor c } } } else { if { [string compare $orient "x"] == 0 } { if {$spread_out_buttons} { eval pack "$frame_name.$i" -side left -anchor c -fill both -expand 1 } else { eval pack "$frame_name.$i" -side left -anchor c } } else { if {$spread_out_buttons} { eval pack "$frame_name.$i" -side top -anchor c -fill both -expand 1 } else { eval pack "$frame_name.$i" -side top -anchor c } } } incr i } if {[string compare $cmdButton_labelstr ""] != 0} { return [concat $frame_name $allButtonsList $frame_name.clabel] } else { return [concat $frame_name $allButtonsList] } } ############################################################################### # buildRadioboxes: creates a row or column of radiobuttons on 'frame_name' # following the arrangement specified in 'checkbutton_list'. # # INPUT FORMATS: # 'radiobutton_list' - # { {group1_button1_name group1_button1_label group1_button1_assoc} # {group1_button2_name group1_button2_label group1_button1_assoc} # . . . } # { {group2_button1_name group2_button1_label group2_button1_assoc} # {group2_button2_name group2_button2_label group2_button1_assoc} # . . . } # } # # 'orient' - how the group of radiobuttons are to be arranged: column, grid. # 'spacing' - amount of spacing between groups of radiobuttons (in Get_Pixels # format). # OPTIONS: # 'radiobox_labelstr' - if the entire groups of radiobuttons are to be given one # label string. # 'place_buttonAssoc_right' - if the button*_assoc is to be placed on the # right side of a check button. # 'place_labelstr_top' - if 'checkbox_labelstr' is to be placed on top of all # checkbuttons instead of to the left. # 'button_assoc_groove_relief' - if the button*_assoc is to be enclosed in a ############################################################################### proc buildRadioboxes {frame_name radiobutton_list orient spacing \ {radiobox_labelstr ""} {place_buttonAssoc_right 1} \ {place_labelstr_top 0} {button_assoc_groove_relief 0} \ {selective_right_placement ".*"}} { global LABELFONT BADPARAM errmsg set procname "buildRadioboxes" ## Let's be defensive about the input if { ![regexp "\\." $frame_name] || \ ([string compare $orient "column"] != 0 && \ [string compare $orient "grid"] != 0) } { puts "Error $BADPARAM in \{$procname $frame_name\}: $errmsg(BADPARAM)" exit $BADPARAM } if { [string compare $frame_name "."] == 0 } { set frame_name "" } if {[string compare $radiobox_labelstr ""] != 0} { message $frame_name.rlabel -font $LABELFONT -text $radiobox_labelstr \ -aspect 1000 if {$place_labelstr_top} { pack $frame_name.rlabel -side top -anchor nw -pady $spacing } else { pack $frame_name.rlabel -side left -anchor nw -pady $spacing } } set i 1 set allButtonsList "" foreach group [lrange $radiobutton_list 0 end] { frame $frame_name.$i label $frame_name.${i}_dummy -width 1 -font $LABELFONT -padx 1 -pady 1 eval pack "$frame_name.${i}_dummy" -side left -anchor nw eval pack "$frame_name.$i" -side top -anchor nw set buttonList "" set j 1 foreach button_entry [lrange $group 0 end] { set buttonName [lindex $button_entry 0] set buttonLabel [lindex $button_entry 1] set buttonAssoc [lindex $button_entry 2] if {[string compare $buttonAssoc ""] != 0} { if {$button_assoc_groove_relief} { frame $frame_name.$i.f$buttonName -borderwidth 2 -relief groove } else { frame $frame_name.$i.f$buttonName } radiobutton $frame_name.$i.f$buttonName.$buttonName -relief flat -anchor c \ -font $LABELFONT -text $buttonLabel -padx 1 -pady 1 if { $place_buttonAssoc_right && \ [regexp $selective_right_placement $j] } { pack $frame_name.$i.f$buttonName.$buttonName -side left \ -anchor nw pack $buttonAssoc -in $frame_name.$i.f$buttonName -side right \ -anchor nw } else { pack $frame_name.$i.f$buttonName.$buttonName -side top -anchor nw pack $buttonAssoc -in $frame_name.$i.f$buttonName -side bottom \ -anchor nw } raise $buttonAssoc $frame_name.$i.f$buttonName append buttonList " " $frame_name.$i.f$buttonName append allButtonsList " " $frame_name.$i.f$buttonName.$buttonName } else { radiobutton $frame_name.$i.$buttonName -relief flat -anchor c \ -font $LABELFONT -text $buttonLabel -padx 1 -pady 1 append buttonList " " $frame_name.$i.$buttonName append allButtonsList " " $frame_name.$i.$buttonName } incr j } if { [string compare $orient "column"] == 0 } { eval pack "$buttonList" -side top -anchor nw -pady $spacing } else { eval pack "$buttonList" -side left -anchor nw -padx $spacing } incr i } if {[string compare $radiobox_labelstr ""] != 0} { return [concat $frame_name $allButtonsList $frame_name.rlabel] } else { return [concat $frame_name $allButtonsList] } } # disable_rcbutton: disables radio/check button. proc disable_rcbutton button_name { global selColor disabledColor tk_version set state [lindex [$button_name configure -state] 4] if {[string compare $state "disabled"] == 0} { return ;# ignore if already disabled } if {$tk_version < 4.0} { set selColor($button_name) [lindex [$button_name configure -selector] 4] $button_name configure -state disabled -selector $disabledColor } else { set selColor($button_name) [lindex [$button_name configure -selectcolor] 4] $button_name configure -state disabled -selectcolor $disabledColor } } # enable_rcbutton: enables radio/check button. proc enable_rcbutton button_name { global selColor tk_version set state [lindex [$button_name configure -state] 4] if {![info exists selColor($button_name)] || \ [string compare $state "normal"] == 0} { return } if {$tk_version < 4.0} { $button_name configure -state normal -selector $selColor($button_name) } else { $button_name configure -state normal -selectcolor $selColor($button_name) } } # disable_button: disables a command button. proc disable_button button_name { global disabledColor set state [lindex [$button_name configure -state] 4] if {[string compare $state "disabled"] == 0} { return ;# ignore if already disabled } $button_name configure -state disabled } # enable_button: enables a command button. proc enable_button button_name { $button_name configure -state normal } # disable_rcbuttons: disables a list of radio/checkbuttons. proc disable_rcbuttons {args} { foreach button $args { disable_rcbutton $button } } # enable_rcbuttons: enables a list of radio/checkbuttons. proc enable_rcbuttons {args} { foreach button $args { enable_rcbutton $button } } # invoke_rbutton: for invoking an appropriately set radio button. proc invoke_rbutton {buttons} { global qsubv qalterv qsigv foreach button $buttons { $button configure -state normal set var [lindex [$button configure -variable] 4] set val [lindex [$button configure -value] 4] global $var if { [string compare [set $var] $val] == 0 } { $button invoke } } } # invoke_cbutton: for invoking an appropriately set check button. proc invoke_cbutton {buttons} { global selColor tk_version foreach button $buttons { set state [lindex [$button configure -state] 4] enable_rcbutton $button $button toggle $button invoke if {[string compare $state "disabled"] == 0} { disable_rcbutton $button } } } torque-2.4.16/src/gui/bitmaps/0000777000113300011330000000000011614035200013120 500000000000000torque-2.4.16/src/gui/bitmaps/cyclist-only.xbm0000664000113300011330000000466511272401236016220 00000000000000#define cyclist-only_width 55 #define cyclist-only_height 55 static unsigned char cyclist-only_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x80, 0x0d, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x04, 0x00, 0x78, 0x3e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0xca, 0x19, 0x00, 0x00, 0x00, 0x18, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x04, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x01, 0x00, 0x78, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xc0, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x14, 0xc0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x38, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; torque-2.4.16/src/gui/bitmaps/maximize.bmp0000664000113300011330000000043711272401236015373 00000000000000#define maximize_width 16 #define maximize_height 16 static char maximize_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00}; torque-2.4.16/src/gui/bitmaps/curve_down_arrow.bmp0000664000113300011330000000050011272401236017124 00000000000000#define curve_down_arrow_width 16 #define curve_down_arrow_height 16 static unsigned char curve_down_arrow_bits[] = { 0xf0, 0x03, 0xfc, 0x03, 0x1e, 0x00, 0x0e, 0x00, 0x07, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x8e, 0x00, 0xfe, 0x01, 0xfc, 0x03, 0xf8, 0x01, 0x80, 0x00}; torque-2.4.16/src/gui/bitmaps/curve_up_arrow.bmp0000664000113300011330000000047211272401236016611 00000000000000#define curve_up_arrow_width 16 #define curve_up_arrow_height 16 static unsigned char curve_up_arrow_bits[] = { 0x00, 0x01, 0x80, 0x1f, 0xc0, 0x3f, 0x80, 0x7f, 0x00, 0x71, 0x00, 0xe0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0x70, 0x00, 0x78, 0xc0, 0x3f, 0xc0, 0x0f}; torque-2.4.16/src/gui/bitmaps/sm_up_arrow.bmp0000664000113300011330000000046111272401236016102 00000000000000#define sm_up_arrow_width 16 #define sm_up_arrow_height 16 static unsigned char sm_up_arrow_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07, 0xf0, 0x0f, 0xf0, 0x0f, 0xf8, 0x1f, 0xf8, 0x1f, 0xfc, 0x3f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}; torque-2.4.16/src/gui/bitmaps/iconize.bmp0000664000113300011330000000043711272401236015210 00000000000000#define compress_width 16 #define compress_height 16 static char compress_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0xf0, 0x07, 0xf8, 0x0f, 0xf0, 0x07, 0xf0, 0x07, 0xe0, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; torque-2.4.16/src/gui/bitmaps/sm_down_arrow.bmp0000664000113300011330000000046711272401236016433 00000000000000#define sm_down_arrow_width 16 #define sm_down_arrow_height 16 static unsigned char sm_down_arrow_bits[] = { 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00}; torque-2.4.16/src/gui/bitmaps/hourglass.bmp0000664000113300011330000000105511272401236015554 00000000000000#define hourglass.bmp_width 19 #define hourglass.bmp_height 21 #define hourglass.bmp_x_hot 8 #define hourglass.bmp_y_hot 0 static char hourglass.bmp_bits[] = { 0xff, 0xfc, 0x07, 0x55, 0x55, 0x05, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xc2, 0x0a, 0x03, 0x46, 0x05, 0x01, 0x82, 0x0a, 0x03, 0x06, 0x05, 0x01, 0x02, 0x03, 0x03, 0x86, 0x05, 0x01, 0xc2, 0x0a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2b, 0x03, 0x66, 0x15, 0x01, 0xa2, 0x2a, 0x03, 0xff, 0xff, 0x07, 0xab, 0xaa, 0x02}; torque-2.4.16/src/gui/bitmaps/Downarrow.bmp0000664000113300011330000000045311272401236015530 00000000000000#define Downarrow_width 16 #define Downarrow_height 16 static unsigned char Downarrow_bits[] = { 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xff, 0xff, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f, 0xe0, 0x07, 0x80, 0x01}; torque-2.4.16/src/gui/bitmaps/logo.bmp0000664000113300011330000020325311272401236014511 00000000000000#define logo_width 260 #define logo_height 330 static unsigned char logo_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x07, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x1c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x07, 0x00, 0x00, 0x00, 0xf0, 0x07, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x83, 0x3f, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdf, 0x07, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x8f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x40, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0d, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xff, 0x02, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xa0, 0xff, 0x5b, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xeb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xbd, 0xfe, 0x7f, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xbf, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xe0, 0xd7, 0xd6, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xed, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xfe, 0xfb, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfd, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x6f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdd, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xab, 0xaa, 0x22, 0x00, 0xec, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x40, 0x55, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6d, 0xdb, 0xde, 0xff, 0xfb, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7b, 0xdb, 0xae, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xef, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xba, 0xd5, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb6, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xf6, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0xa8, 0xdf, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0xe0, 0x7d, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0xd7, 0xfb, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0xfc, 0x6e, 0x7b, 0xfb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0xc0, 0xff, 0xed, 0x7f, 0xff, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0xac, 0xbf, 0xed, 0xbd, 0xf5, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0xe0, 0xf6, 0xbf, 0xf7, 0xbf, 0xfb, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x81, 0x00, 0xbc, 0xf5, 0xde, 0xee, 0xee, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x01, 0x40, 0xbf, 0xf7, 0xfb, 0xbf, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xbe, 0x5f, 0xeb, 0xee, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x10, 0x00, 0x00, 0x00, 0xe8, 0xff, 0xbb, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x18, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xee, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x5b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x40, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xc0, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xed, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x60, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x6f, 0xbf, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x03, 0x00, 0x00, 0x80, 0xbf, 0xfd, 0xfb, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x70, 0x03, 0x00, 0x00, 0x78, 0xed, 0xb7, 0xaf, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x01, 0x00, 0x00, 0xed, 0xbf, 0xfd, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x58, 0x01, 0x00, 0xc0, 0xbf, 0xed, 0xef, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf8, 0x01, 0x00, 0x70, 0xeb, 0x7f, 0xbb, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x6c, 0x01, 0x00, 0xfc, 0x7f, 0xdb, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xfc, 0x00, 0x00, 0xdf, 0xf6, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xd6, 0x00, 0xc0, 0xfb, 0xdb, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x7e, 0x00, 0xf0, 0x5e, 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x77, 0x00, 0xec, 0xf7, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x5d, 0x00, 0xbe, 0x7d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80, 0x3f, 0x80, 0xeb, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80, 0x2d, 0xe0, 0x7f, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0x1f, 0xb8, 0xdd, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x40, 0x1b, 0xf6, 0xf7, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xe0, 0x0f, 0x5f, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x60, 0xcb, 0xf5, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xf0, 0xef, 0x7f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xd0, 0x7a, 0xdb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x78, 0x70, 0xdf, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x38, 0xd0, 0xf7, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x38, 0xf0, 0xbd, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x30, 0x78, 0xef, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x78, 0xdc, 0x7b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0xf7, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xf0, 0xde, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xf0, 0x7b, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x70, 0xef, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdf, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x47, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x43, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x43, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x43, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xbf, 0xc3, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xc3, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xdf, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x81, 0x3b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0xae, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xc0, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x60, 0x1b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xe0, 0x8f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xb0, 0x0d, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x8b, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xb8, 0x06, 0x01, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xe8, 0x87, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xaa, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xfc, 0x81, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xe0, 0x1f, 0xb4, 0x83, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xf0, 0x3f, 0xfc, 0x82, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xf0, 0xfd, 0xef, 0x81, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xf0, 0xf1, 0xbf, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xf0, 0xc1, 0xef, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x7f, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf0, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xfe, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xf0, 0x01, 0x08, 0x60, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xf0, 0x01, 0x00, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x01, 0x00, 0xe0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf0, 0x03, 0x00, 0xc0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x70, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0x07, 0x00, 0x40, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xc0, 0x07, 0x00, 0x20, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0x0f, 0x00, 0x60, 0x00, 0x0c, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x20, 0x00, 0x18, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x70, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x30, 0x00, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x38, 0x00, 0x60, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x3c, 0x00, 0xe0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x06, 0x00, 0x7e, 0x00, 0x1c, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x75, 0x03, 0x00, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x71, 0x03, 0x00, 0xfc, 0x00, 0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x02, 0x00, 0xf8, 0x01, 0x0f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb1, 0x02, 0x00, 0xf8, 0x83, 0x0f, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb1, 0x02, 0x00, 0xf0, 0x83, 0x0f, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x31, 0x02, 0x00, 0xe0, 0xc7, 0x0f, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3b, 0x06, 0x00, 0xe0, 0xcf, 0x07, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0xe8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; torque-2.4.16/src/gui/bitmaps/Uparrow.bmp0000664000113300011330000000044511272401236015206 00000000000000#define Uparrow_width 16 #define Uparrow_height 16 static unsigned char Uparrow_bits[] = { 0x80, 0x01, 0xe0, 0x07, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0xff, 0xff, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03}; torque-2.4.16/src/gui/qsig.tk0000664000113300011330000002127011272401236012712 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qsig: defines the layout and functions of the signal job dialog box. proc qsig {} { global jobsSelected LABELFONT jobidField SERVER_HOSTS cmdpath qsigDialogBox \ otherEntryField qsigv global radioboxOther global activeWindow busy_cursor ## Bring up the standard Dialog box ## set qsigDialogBox ".sig" set dbox [popupDialogBox $qsigDialogBox "Signal Running Job Dialog"] set activeWindow($qsigDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{sig signal} {cancel cancel} {help help}}} x 10m 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdSignal [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdSignal configure -command { if { [string compare $qsigv(signal) " "] == 0 } { if {[string compare $qsigv(other_signal) ""] == 0} { popupInfoBox $qsigDialogBox "Please enter the signal name or number." return } set exitcode [win_cmdExec $qsigDialogBox "$cmdpath(QSIG) -s $qsigv(other_signal) $jobsSelected"] } elseif { [string compare $qsigv(signal) "TERM"] != 0 } { set exitcode [win_cmdExec $qsigDialogBox "$cmdpath(QSIG) -s $qsigv(signal) $jobsSelected"] } else { set exitcode [win_cmdExec $qsigDialogBox "$cmdpath(QSIG) $jobsSelected"] } if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] destroy $qsigDialogBox } } $cmdCancel configure -command [list destroy $qsigDialogBox] $cmdHelp configure -command {xpbs_help signal $qsigDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.e frame $dbox_top.e.e1 frame $dbox_top.f -borderwidth 3 -relief groove frame $dbox_top.r frame $dbox_top.empty1 -width 14m frame $dbox_top.empty2 -width 11m frame $dbox_top.r.e label $dbox_top.e.l -text "to RUNNING job(s):" -font $LABELFONT set jobidbox [buildFullListbox $dbox_top.e.e1 45x3 "" xyscroll 0] set jobidFrame [lindex $jobidbox 0] set jobidField [lindex $jobidbox 3] $jobidField configure -relief sunken bind_text_readonly $jobidField foreach el $jobsSelected { $jobidField insert end $el } set otherEntrybox [buildFullEntrybox $dbox_top.r.e 0 "" 10 "" bottom 0] set otherEntryFrame [lindex $otherEntrybox 0] set qsigv(otherEntryField) [lindex $otherEntrybox 2] set qsigv(otherScroll) [lindex $otherEntrybox 3] $qsigv(otherEntryField) configure -textvariable qsigv(other_signal) register_default_action $qsigv(otherEntryField) $cmdCancel set radiolist [list {hup "HUP (hangup)"} {int "INT (interrupt)"} \ {kill "KILL"} {term "TERM (terminate)"} \ [concat other \"other (specify signal name or number)\" $otherEntryFrame]] set radiobox [buildRadioboxes $dbox_top.r [list $radiolist] column 0 \ "Send signal:"] set radioboxFrame [lindex $radiobox 0] set radioboxHup [lindex $radiobox 1] set radioboxInt [lindex $radiobox 2] set radioboxKill [lindex $radiobox 3] set radioboxTerm [lindex $radiobox 4] set radioboxOther [lindex $radiobox 5] $radioboxHup configure -variable qsigv(signal) -value HUP \ -command { disable_fullentry "" $qsigv(otherEntryField) \ $qsigv(otherScroll) } $radioboxInt configure -variable qsigv(signal) -value INT \ -command { disable_fullentry "" $qsigv(otherEntryField) \ $qsigv(otherScroll) } $radioboxKill configure -variable qsigv(signal) -value KILL \ -command { disable_fullentry "" $qsigv(otherEntryField) \ $qsigv(otherScroll) } $radioboxTerm configure -variable qsigv(signal) -value TERM \ -command { disable_fullentry "" $qsigv(otherEntryField) \ $qsigv(otherScroll) } $radioboxOther configure -variable qsigv(signal) -value " " \ -command { enable_fullentry "" $qsigv(otherEntryField) \ $qsigv(otherScroll) } set qsigv(signal) TERM invoke_rbutton [list $radioboxHup $radioboxInt $radioboxKill $radioboxTerm \ $radioboxOther] ## ARRANGEMENT ON SCREEN pack $dbox_top.e.l $dbox_top.e.e1 -side left -anchor nw pack $radioboxFrame -in $dbox_top.f -padx 2m -pady 2m raise $radioboxFrame $dbox_top.f pack $dbox_top.header $dbox_top.f $dbox_top.e $dbox_top.footer -side top \ -padx 10m -pady 2m pack $radioboxFrame.e register_default_action $qsigDialogBox $cmdCancel tkwait visibility $qsigDialogBox remove_busy_cursor catch {tkwait window $qsigDialogBox} set activeWindow($qsigDialogBox) 0 catch {unset qsigv} } torque-2.4.16/src/gui/common.tk0000664000113300011330000007071311272401236013245 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains procedures that are accessed across file modules. ################################################################################ # lintmax: returns the maximum value element in a positive list of integers. # return -1 if errors are encountered. proc lintmax intlist { set retval [catch {lsort -integer -decreasing $intlist} sorted_intlist] if { $retval == 0 && [string compare $sorted_intlist ""] != 0 } { return [lindex $sorted_intlist 0] } puts "Error in \"lintmax \{$intlist\}\": sorting resulted in: $sorted_intlist" return -1 } # lintmin: returns the minimum value element in a positive list of integers. # return -1 if errors are encountered. proc lintmin intlist { set retval [catch {lsort -integer -increasing $intlist} sorted_intlist] if { $retval == 0 && [string compare $sorted_intlist ""] != 0 } { return [lindex $sorted_intlist 0] } puts "Error in \"lintmin \{$intlist\}\": sorting resulted in: $sorted_intlist" return -1 } # popupDialogBox: A popupDialogBox creates the standard dialog box used by the GUI on # the toplevel named 'dialog_top' to be named 'title'. It # creates 2 frames: top frame (to be populated by widgets) and # bottom frame (to be populated by command buttons). # RETURNS: a list with 2 items: top_frame_name and bottom_frame_name. # OPTIONS: 'grab_window' says to set a grab on 'dialog_top'. # 'class' is the class name to associate 'dialog_top'. # 'master' specifies that the dialog box is working on behalf of # some 'master' window. proc popupDialogBox {dialog_top title {grab_window 1} {class ""} {master ""} {precisePlace 0} } { global activeWindow bitmap_dir mainWindow coordX coordY if {[string compare $class ""] == 0} { toplevel $dialog_top } else { toplevel $dialog_top -class $class } wm title $dialog_top $title if {$precisePlace} { if { [info exists coordX] && [info exists coordY] } { wm geometry $dialog_top "+$coordX+$coordY" } } if {$grab_window} { catch {grab $dialog_top} grab_msg if { [string compare $grab_msg ""] != 0 } { tkwait visibility $dialog_top catch {grab $dialog_top} grab_msg if { [string compare $grab_msg ""] != 0 } { InfoBox_sendmsg "Grabbing $dialog_top got: $grab_msg" 2 } } } focus $dialog_top frame $dialog_top.top -borderwidth 4 -relief ridge frame $dialog_top.bottom -borderwidth 2 -relief raised -class CmdFrame pack $dialog_top.top $dialog_top.bottom -side top -fill both -expand 1 if { [string compare $master ""] != 0 } { wm transient $dialog_top $master } else { wm transient $dialog_top $mainWindow } return [list $dialog_top.top $dialog_top.bottom] } # win_cmdExec: procedure that executes the given 'command_list' via catch/open # and returns any error code, message, and output in a nice popup # text box. 'callerDialogBox' is for returning the input focus # back to the calling dialog box. # OUTPUT: an output text box with all the necessary information. # RETURNS: the exit code of the executed command. # NOTE: The beauty of Tk is that you can almost feed exec with a commandline # of ANY size and be able to send to it without failure. I have tested # this on a commandline of up to 4111 chars without any unusual benavior. proc win_cmdExec {callerDialogBox command_list} { busy_cursor InfoBox_sendmsg "'$command_list'..." set retcode [catch {eval exec $command_list} output] if {$retcode != 0} { if { [string compare $callerDialogBox ""] != 0 } { popupErrorBox $retcode $command_list $output 500 $callerDialogBox } else { popupErrorBox $retcode $command_list $output 500 "" } InfoBox_sendmsg "failed!" 1 1 } else { if { [string compare $output ""] != 0 } { popupOutputBox $output $callerDialogBox } InfoBox_sendmsg "done." 1 1 5 } remove_busy_cursor if { [string compare $callerDialogBox ""] != 0 } { focus $callerDialogBox grab $callerDialogBox } return $retcode } # win_cmdExec2: similar to win_cmdExec except error is ignored. proc win_cmdExec2 {callerDialogBox command_list} { busy_cursor InfoBox_sendmsg "'$command_list'..." set retcode [catch {eval exec $command_list} output] if { [string compare $output ""] != 0 } { popupOutputBox $output $callerDialogBox } InfoBox_sendmsg "done." 1 1 5 remove_busy_cursor if { [string compare $callerDialogBox ""] != 0 } { focus $callerDialogBox grab $callerDialogBox } return $retcode } # busy_cursor: displays a busy cursor under the mouse pointer position over a # "registered" active window. proc busy_cursor {} { global activeWindow bitmap_dir foreach win [array names activeWindow] { if {$activeWindow($win)} { $win configure -cursor "@$bitmap_dir/hourglass.bmp black" } } } # remove_busy_cursor: removes the busy cursor set up by busy_cursor. proc remove_busy_cursor {} { global activeWindow foreach win [array names activeWindow] { if {$activeWindow($win)} { $win configure -cursor {} } } } # cmdExec: procedure that executes the given 'command_list' via catch/open. # RETURNS: # any regular output or error message. # If output is empty, then the return code is returned. # OPTIONS: # 'popupError' says if an error # 'retcode_only' says if return code is to be returned instead of the output # string. # OUTPUT: output string or return code of command depending on chosen option. proc cmdExec {command_list {popupError 0} {retcode_only 0} {callerDialogBox ""} } { busy_cursor InfoBox_sendmsg "'$command_list'..." set retcode [catch {eval exec $command_list} output] if {$retcode != 0} { InfoBox_sendmsg "failed! Output: $output" 1 1 if {$popupError} { popupErrorBox $retcode $command_list $output 500 $callerDialogBox } } else { InfoBox_sendmsg "done." 1 1 5 } remove_busy_cursor if {$retcode_only} { return $retcode } return $output } # InfoBox_sendmsg: The following procedure sends the specified 'message' to InfoBox. # OPTIONS: # 'line_number' - the position on the InfoBox where the message will be placed. # 'append' - to append messages to an existing entry. # 'xview_increment' - how much to right shift the horizontal display of the # InfoBox. proc InfoBox_sendmsg { message {line_number 1} {append 0} \ {xview_increment 1} } { global infoBox tk_version infoBox_counter INFOBOX_LISTBOX_WIDTH catch {exec date "+%D %T"} datestr if {!$append} { set msg "\[$datestr\] $message" set infoBox_counter [expr [string length $msg] - $INFOBOX_LISTBOX_WIDTH] catch {$infoBox insert $line_number $msg} set lsize [$infoBox size] set line_to_delete [expr $line_number + 1] if { $lsize > 1 && $line_to_delete < $lsize } { catch {$infoBox delete $line_to_delete} } } else { set cval [$infoBox get $line_number] incr infoBox_counter $xview_increment catch {$infoBox insert $line_number "$cval$message"} out set lsize [$infoBox size] set line_to_delete [expr $line_number + 1] if { $lsize > 1 && $line_to_delete < $lsize } { catch {$infoBox delete $line_to_delete} } } if {$tk_version >= 4.0} { if {$infoBox_counter > 0} { $infoBox xview moveto 1 } else { $infoBox xview 0 } } else { $infoBox xview $infoBox_counter } update idletasks } # cmdExec_bg: Executes 'command_list' in the background. # OPTIONS: # 'popupError' - if an error dialog box is to be displayed when error is # encountered. # RETURNS: the file descriptor from where input can be read; or -1 if an error # has occurred. proc cmdExec_bg {command_list {popupError 0}} { InfoBox_sendmsg "'$command_list'..." 0 if [catch {open "|$command_list" RDONLY} input] { InfoBox_sendmsg "failed: $input" 0 1 6 return -1 } return $input } # procedure that takes 'output' string and display it on screen via an output # box that includes a single Ok button. proc popupOutputBox {output {callerDialogBox ""} } { global TEXTFONT outDialogBox set outDialogBox ".output" set dbox [popupDialogBox $outDialogBox "Output Dialog" 1 "" $callerDialogBox] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] text $dbox_top.textbox -borderwidth 2 -setgrid 1 \ -font $TEXTFONT -exportselection true \ -width 80 -height 30 -relief flat bind_text_readonly $dbox_top.textbox pack $dbox_top.textbox -expand 1 -fill both -side left -padx 3m -pady 3m scrollbar $dbox_top.vscroll \ -command "$dbox_top.textbox yview" \ -borderwidth 2 \ -orient vertical \ -relief groove $dbox_top.textbox configure -yscrollcommand "$dbox_top.vscroll set" pack $dbox_top.vscroll -fill y -expand 1 -after $dbox_top.textbox set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $outDialogBox] $dbox_top.textbox insert 1.0 $output register_default_action $outDialogBox $ok_button catch {tkwait window $outDialogBox} } # popupErrorBox: procedure that displays 'retcode', 'command_list', 'errmsg' # information on the output screen via an error dialog box. # OPTIONS: # 'width_pixels' is the size of the error dialog box. # 'callerDialogBox' is for returning the input focus to the calling dialog box. proc popupErrorBox {retcode command_list errmsg {width_pixels 500} \ {callerDialogBox ""} } { global LABELFONT errDialogBox set errDialogBox ".error" set dbox [popupDialogBox $errDialogBox "Error Dialog" 1 "" $callerDialogBox] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left \ -font $LABELFONT -width $width_pixels \ -text "FAILED (return code=$retcode)\ to execute the following\ command:\n\n\n\t$command_list\n\n\nThe\ error message was\n\n\n\t$errmsg\n" pack $dbox_top.msg -padx 3m -pady 3m set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $errDialogBox] register_default_action $errDialogBox $ok_button catch {tkwait window $errDialogBox} if { [string compare $callerDialogBox ""] != 0 } { focus $callerDialogBox grab $callerDialogBox } } # popupInfoBox: pops up a dialog box informing the user of some 'msg'. # 'callerDialogBox' is for returning the the input focus to the calling dialog # box. # OPTIONS: # 'width_pixels' is the size of the info box. proc popupInfoBox {callerDialogBox msg {width_pixels 500} {focusBox ""}} { global LABELFONT infoDialogBox set infoDialogBox ".info" if [winfo exists $infoDialogBox] { return } set dbox [popupDialogBox $infoDialogBox "Info Dialog" 1 "" $callerDialogBox] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left \ -font $LABELFONT -width $width_pixels \ -text "\n\n\n\t$msg\n" pack $dbox_top.msg -padx 3m -pady 3m set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $infoDialogBox] register_default_action $infoDialogBox $ok_button tkwait window $infoDialogBox if { [string compare $callerDialogBox ""] != 0 } { focus $callerDialogBox grab $callerDialogBox } catch {focus $focusBox} } # popupInfoBoxWOpt: like popupInfoBox with an "ok" or "not ok" option which # will return a 0 (ok) or 1 (not ok). # OPTIONS: # 'width_pixels' is the size of the info box. proc popupInfoBoxWOpt {callerDialogBox msg {width_pixels 500} } { global LABELFONT infoDialogBox popupInfoBoxWOpt set infoDialogBox ".info" if [winfo exists $infoDialogBox] { return } set dbox [popupDialogBox $infoDialogBox "Info Dialog" 1 "" $callerDialogBox] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left \ -font $LABELFONT -width $width_pixels \ -text "\n\n\n\t$msg\n" pack $dbox_top.msg -padx 3m -pady 3m set button [buildCmdButtons $dbox_bottom {{{ok "ok"} {notok "not ok"}}} x 20m 10 3] set ok_button [lindex $button 1] set notok_button [lindex $button 2] $ok_button configure -command { set popupInfoBoxWOpt(ret) 0 destroy $infoDialogBox } $notok_button configure -command { set popupInfoBoxWOpt(ret) 1 destroy $infoDialogBox } register_default_action $infoDialogBox $ok_button tkwait window $infoDialogBox if { [string compare $callerDialogBox ""] != 0 } { focus $callerDialogBox grab $callerDialogBox } return $popupInfoBoxWOpt(ret) } # create_DateTime_box: procedure that creates the date and time spin boxes on # 'frame_name'. # INPUT: # frame_name - the frame where the boxes will appear. # def_* - the list of default values to be loaded in the respective # spin boxes. # ARR - holds the qtimeMon, qtimeDay, qtimeYear, qtimeHH, qtimeMM, # qtimeSS elements. proc create_DateTime_box {frame_name def_mon def_day def_yr def_hr \ def_min def_sec ARR } { global LABELFONT months frame $frame_name.1 frame $frame_name.2 frame $frame_name.3 frame $frame_name.4 frame $frame_name.5 pack $frame_name.1 $frame_name.2 $frame_name.3 $frame_name.4 $frame_name.5 \ -side left -anchor nw frame $frame_name.1.mon frame $frame_name.3.day frame $frame_name.5.year frame $frame_name.1.hh frame $frame_name.3.mm frame $frame_name.5.ss set scrolls "" set labels "" label $frame_name.2.slash1 -font $LABELFONT -text "/" -padx 1 -pady 1 label $frame_name.4.slash2 -font $LABELFONT -text "/" -padx 1 -pady 1 label $frame_name.2.col1 -font $LABELFONT -text ":" -padx 1 -pady 1 label $frame_name.4.col2 -font $LABELFONT -text ":" -padx 1 -pady 1 set labels "$labels $frame_name.2.slash1 $frame_name.4.slash2 \ $frame_name.2.col1 $frame_name.4.col2" pack $frame_name.1.hh $frame_name.1.mon -side top -anchor nw pack $frame_name.2.slash1 $frame_name.2.col1 -side top -anchor c -pady 16 \ -padx 1m pack $frame_name.3.mm $frame_name.3.day -side top -anchor nw pack $frame_name.4.slash2 $frame_name.4.col2 -side top -anchor c -pady 16 \ -padx 1m pack $frame_name.5.ss $frame_name.5.year -side top -anchor nw set spinBox [buildSpinbox $frame_name.1.mon 4 $months $ARR qtimeMon "mon" top \ $def_mon] set qtimeMon [lindex $spinBox 1] set scrolls "$scrolls [lindex $spinBox 2]" set labels "$labels [lindex $spinBox 3]" set spinBox [buildSpinbox $frame_name.3.day 2 1-31 $ARR qtimeDay "day" top \ $def_day 1] set qtimeDay [lindex $spinBox 1] set scrolls "$scrolls [lindex $spinBox 2]" set labels "$labels [lindex $spinBox 3]" set spinBox [buildSpinbox $frame_name.5.year 4 1970-2100 $ARR qtimeYear "year" top \ $def_yr] set qtimeYear [lindex $spinBox 1] set scrolls "$scrolls [lindex $spinBox 2]" set labels "$labels [lindex $spinBox 3]" set spinBox [buildSpinbox $frame_name.1.hh 2 0-23 $ARR qtimeHH "hour" top $def_hr 1] set qtimeHH [lindex $spinBox 1] set scrolls "$scrolls [lindex $spinBox 2]" set labels "$labels [lindex $spinBox 3]" set spinBox [buildSpinbox $frame_name.3.mm 2 0-59 $ARR qtimeMM "minute" top $def_min 1] set qtimeMM [lindex $spinBox 1] set scrolls "$scrolls [lindex $spinBox 2]" set labels "$labels [lindex $spinBox 3]" set spinBox [buildSpinbox $frame_name.5.ss 2 0-59 $ARR qtimeSS "secs" top $def_sec 1] set qtimeSS [lindex $spinBox 1] set scrolls "$scrolls [lindex $spinBox 2]" set labels "$labels [lindex $spinBox 3]" ## return [list $frame_name $qtimeMon $qtimeDay $qtimeYear $qtimeHH \ $qtimeMM $qtimeSS $scrolls $labels] } # disable_label: disables a label widget. proc disable_label {label_name color_name} { global selColor set cur_fgcolor [lindex [$label_name configure -fg] 4] if { [string compare $color_name $cur_fgcolor] == 0} { return } set selColor(fg$label_name) $cur_fgcolor $label_name configure -fg $color_name } # enable_label: enables a label widget. proc enable_label {label_name} { global selColor if {![info exists selColor(fg$label_name)]} { return } $label_name configure -fg $selColor(fg$label_name) } # disable_scrollbar: disables a scrollbar. proc disable_scrollbar {scrollbar color_name} { global selColor tk_version if {$tk_version < 4.0} { set cur_bgcolor [lindex [$scrollbar configure -bg] 4] set cur_activefgcolor [lindex [$scrollbar configure -activeforeground] 4] set cur_fgcolor [lindex [$scrollbar configure -fg] 4] } else { set cur_bgcolor [lindex [$scrollbar configure -troughcolor] 4] set cur_activefgcolor [lindex [$scrollbar configure -activebackground] 4] set cur_fgcolor [lindex [$scrollbar configure -background] 4] } if { [string compare $color_name $cur_bgcolor] == 0 && \ [string compare $color_name $cur_activefgcolor] == 0 && \ [string compare $color_name $cur_fgcolor] == 0} { return } set selColor(bg$scrollbar) $cur_bgcolor set selColor(active_fg$scrollbar) $cur_activefgcolor set selColor(fg$scrollbar) $cur_fgcolor if {$tk_version < 4.0} { $scrollbar configure -bg $color_name -activeforeground $color_name \ -fg $color_name } else { $scrollbar configure -troughcolor $color_name -activebackground $color_name \ -background $color_name } } # enable_scrollbar: enables a scrollbar. proc enable_scrollbar {scrollbar} { global selColor tk_version if { ![info exists selColor(bg$scrollbar)] && \ ![info exists selColor(active_fg$scrollbar)] && \ ![info exists selColor(fg$scrollbar)]} { return } if {$tk_version < 4.0} { $scrollbar configure -bg $selColor(bg$scrollbar) \ -activeforeground $selColor(active_fg$scrollbar) \ -fg $selColor(fg$scrollbar) } else { $scrollbar configure -troughcolor $selColor(bg$scrollbar) \ -activebackground $selColor(active_fg$scrollbar) \ -background $selColor(fg$scrollbar) } } # disable_dateTime: disables all components of a dateTime widget. proc disable_dateTime {entryList scrollList labelList} { global disabledColor set i 0 foreach e $entryList { disable_spinbox $e "" "" incr i } foreach l $labelList { disable_label $l $disabledColor } foreach s $scrollList { disable_scrollbar $s $disabledColor } } # enable_dateTime: enables all components of a dateTime widget. proc enable_dateTime {entryList scrollList labelList} { set i 0 foreach e $entryList { enable_spinbox $e "" "" incr i } foreach l $labelList { enable_label $l } foreach s $scrollList { enable_scrollbar $s } } # clear_array: procedure that initializes an array to empty values. proc clear_array {array_name} { upvar $array_name arr if [info exists arr] { foreach el [array names arr] { set arr($el) "" } } } # construct_array_args: constructs a string containing the elements of 'arr' # separated by 'sep'. If 'header_str' is supplied, then the resulting string # is prefixed with 'header_str'. proc construct_array_args {arr sep {header_str ""} } { upvar $arr a set arr_str "" set firstEntry 1 if [info exists a] { foreach i [lsort -integer [array names a]] { if {[info exists a($i)] && [string compare $a($i) ""] != 0} { if {!$firstEntry} { append arr_str "$sep" "$a($i)" } else { append arr_str "$header_str" "$a($i)" set firstEntry 0 } } } } return $arr_str } # deconstruct_array_args: reverse of "construct_array_args". proc deconstruct_array_args {arr_str arr sep {header_str_to_ignore ""} } { upvar $arr a set i 0 foreach token [split $arr_str $sep] { if {[string compare $token $header_str_to_ignore] == 0} { continue } set a($i) $token incr i } } # load_argstr: loads the array elements in 'arraylist' with values from # each sub-token separated by 'innersep_list' found in each # token of 'arr_str' separated by 'outersep'. proc load_argstr {arr_str outersep arraylist innersep_list \ {header_str_to_ignore ""} } { set i 0 # We have to use clear_array since the arrays can potentially be bound # to an existing widget - using unset will useless. foreach el $arraylist { global $el catch {clear_array $el} set array($i) $el incr i } set matchstr "" set i 0 foreach el $innersep_list { append matchstr {([^} if {$i == 0} { append matchstr "$el]+)$el*" } else { append matchstr "$el]*)$el*" } incr i } append matchstr {([^ ]*)} set i 0 regsub "${header_str_to_ignore}" $arr_str "" str foreach token [split $str $outersep] { set argstr "" lappend argstr $matchstr $token match foreach j [array names array] { lappend argstr [set array($j)]($i) set [set array($j)]($i) "" } eval regexp $argstr incr i } } # set_dateTime: sets month (m), day (d), year (y), hour, min, an sec to some default # value, to current date/time, or to 'valuestr', depending on options given. proc set_dateTime { m d y hour min sec {default 0} {valuestr ""} } { upvar $m mon upvar $d day upvar $y year upvar $hour hh upvar $min mm upvar $sec ss if {$default} { set datestr "Thu Jan 1 00:00:00 PST 1970" } elseif { [string compare $valuestr ""] != 0 } { set datestr $valuestr } else { set datestr [cmdExec "date"] } if [regexp \ "\[^ ]+ (\[^ ]+) +(\[^ ]+) +(\[^:]+):(\[^:]+):(\[^: ]+) +\[^ ]+" \ $datestr match mon day hh mm ss] { set year [lindex $datestr [expr [llength $datestr] - 1]] if {[string length $day] < 2 && $day >= 0 && $day <= 9} { set day "0$day" } if {[string length $hh] < 2 && $hh >= 0 && $hh <= 9} { set hh "0$hh" } if {[string length $mm] < 2 && $mm >= 0 && $mm <= 9} { set mm "0$mm" } if {[string length $ss] < 2 && $ss >= 0 && $ss <= 9} { set ss "0$ss" } } else { set mon "Jan" set day "01" set year "1970" set hh "00" set mm "00" set ss "00" } } # digit: returns the integer given some number string (like atoi). Tcl seems to # be having problems converting from 08/09 to 8/9 so this procedure is needed. proc digit {number_str} { switch -regexp -- $number_str { "^(00|01|02|03|04|05|06|07|08|09)$" {return [string index $number_str 1]} default {return $number_str} } } # packinfo: for returning the correct pack info/newinfo information based on tk # version. proc packinfo {slave} { global tk_version if {$tk_version < 4.0} { set cmd "pack newinfo $slave" } else { set cmd "pack info $slave" } if { [catch $cmd output] == 0 } { return $output } else { return "" } } # trimvar: removes from 'var' any leading or trailing chars from the set # given by 'chars'. # RETURNS: 1 if 'chars' still appear "within" (non-leading nor non-trailing) # 'var' string; otherwise, 0 is returned. proc trimvar {chars var} { upvar $var v set v [string trim $v $chars] set matche "\[$chars]+" return [regexp $matche $v] } proc cleanstr {str {exceptChar ""}} { global sysinfo set newstr "" for {set i 0} {$i < [string length $str]} {incr i} { set c [string index $str $i] if { [string compare $c $exceptChar] == 0 || \ ([string compare $c "="] != 0 && \ [string compare $c ","] != 0 && \ [string compare $c "\["] != 0 && \ [string compare $c "\]"] != 0) } { set newstr "$newstr$c" } } return $newstr } torque-2.4.16/src/gui/concur.tk0000664000113300011330000002760211272401236013245 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # concur: defines the layout and functions of the concurrency set dialog box. # This returns input focus back to 'callerDialogBox' when the depend # dialog box is closed. proc concur {callerDialogBox {qalter 0} } { global LABELFONT activeWindow def dependDialogBox global jobinfo JOBS_LISTBOX_KEY concurJob tk_version if {!$qalter} { global qsubv ARR def_qsub set ARR "qsubv" set def def_qsub } else { global qalterv ARR def_qalter set ARR "qalterv" set def def_qalter } busy_cursor ## Bring up the standard Dialog box ## set dependDialogBox ".concur" set dbox [popupDialogBox $dependDialogBox "Concurrency Set" 1 "" \ $callerDialogBox] set activeWindow($dependDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {cancel "reset to default"} {help help}}} x 9m 16 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdOk configure -command { if [pre_build_concur_depend_opt $ARR] { return } destroy $dependDialogBox } if {$qalter} { $cmdCancel configure -width 18 -command { set_default_qalter_concur invoke_concur_widgets $ARR } } else { $cmdCancel configure -width 18 -command { set_default_qsub_concur invoke_concur_widgets $ARR } } $cmdHelp configure -command {xpbs_help concur $dependDialogBox} ## TOP PART ## frame $dbox_top.concur -borderwidth 3 frame $dbox_top.concur.count frame $dbox_top.concur.syncwith frame $dbox_top.concur.syncwith.jobs frame $dbox_top.concur.syncwith.entry ## ARRANGEMENT ON SCREEN ## CONCURRENCY SET set spinBox [buildSpinbox $dbox_top.concur.count 2 \ 1-99 ${ARR} synccountCnt "other job(s)." right] set spinCountFrame [lindex $spinBox 0] set ${ARR}(spinCountEntry) [lindex $spinBox 1] set ${ARR}(spinCountScroll) [lindex $spinBox 2] set ${ARR}(spinCountLabel) [lindex $spinBox 3] register_default_action [set ${ARR}(spinCountEntry)] $cmdOk set listBoxInfo [buildFullListbox $dbox_top.concur.syncwith.jobs 28x10 \ "(select one)" yscroll 0 0] set jobidframe [lindex $listBoxInfo 0] set ${ARR}(headerLabel) [lindex $listBoxInfo 1] set ${ARR}(selButton) "" set ${ARR}(syncBox) [lindex $listBoxInfo 3] set ${ARR}(scrollBar) [lindex $listBoxInfo 4] if { ![info exists concurJob] } { set concurJob "" } if [info exists jobinfo] { foreach el [array names jobinfo] { set vallist [list $jobinfo($el)] set i 0 set concurJob [set ${ARR}(syncwithJob)] foreach val [lindex $vallist $i] { set entry [strget_keyvals $val $JOBS_LISTBOX_KEY "@"] [set ${ARR}(syncBox)] insert end $entry incr i } } } bind_listbox_single_select [set ${ARR}(syncBox)] bind_depend concur [set ${ARR}(syncBox)] label $dbox_top.concur.syncwith.label -font $LABELFONT \ -text "=" -width 5 -height 15 set ${ARR}(entryLabel) $dbox_top.concur.syncwith.e.label set entrybox [buildFullEntrybox $dbox_top.concur.syncwith.entry 10 \ "(or type job id here)" 40 \ "" right 0 top] set entryFrame [lindex $entrybox 0] set ${ARR}(syncWithEntryLabel) [lindex $entrybox 1] set ${ARR}(syncWithEntry) [lindex $entrybox 2] set ${ARR}(syncWithEntryScroll) [lindex $entrybox 3] [set ${ARR}(syncWithEntry)] configure -textvariable concurJob register_default_action [set ${ARR}(syncWithEntry)] $cmdOk pack $jobidframe -side left -padx 10m -anchor nw pack $dbox_top.concur.syncwith.label -side left -anchor nw pack $entryFrame -side right -anchor nw -pady 20m set radioList [list \ [concat synccount \ \"THIS JOB is first job to be executed concurrently with\" \ $spinCountFrame] \ [ concat syncwith \ \"THIS JOB is a member of a set of jobs to be executed\ concurrently with job:\" $dbox_top.concur.syncwith] \ {syncnone "THIS JOB is not a member of a concurrency set."} ] set radiobox [buildRadioboxes $dbox_top.concur [list $radioList] \ column 0 "" 1 0 0 1] set radioboxFrame [lindex $radiobox 0] set ${ARR}(radioboxSynccount) [lindex $radiobox 1] set ${ARR}(radioboxSyncwith) [lindex $radiobox 2] set ${ARR}(radioboxSyncNone) [lindex $radiobox 3] [set ${ARR}(radioboxSynccount)] configure -variable ${ARR}(concur) \ -value "synccount" \ -command { set sp_ent [set ${ARR}(spinCountEntry)] set sp_scr [set ${ARR}(spinCountScroll)] set sp_lab [set ${ARR}(spinCountLabel)] set lb_box [set ${ARR}(syncBox)] set lb_lab [set ${ARR}(headerLabel)] set lb_sel [set ${ARR}(selButton)] set lb_scr [set ${ARR}(scrollBar)] set sy_ent [set ${ARR}(syncWithEntry)] set sy_scr [set ${ARR}(syncWithEntryScroll)] set sy_lab [set ${ARR}(syncWithEntryLabel)] enable_spinbox $sp_ent $sp_scr $sp_lab disable_listbox $lb_box $lb_lab $lb_sel $lb_scr disable_fullentry $sy_lab $sy_ent $sy_scr focus $sp_ent } [set ${ARR}(radioboxSyncwith)] configure -variable ${ARR}(concur) \ -value "syncwith" \ -command { set sp_ent [set ${ARR}(spinCountEntry)] set sp_scr [set ${ARR}(spinCountScroll)] set sp_lab [set ${ARR}(spinCountLabel)] set lb_box [set ${ARR}(syncBox)] set lb_lab [set ${ARR}(headerLabel)] set lb_sel [set ${ARR}(selButton)] set lb_scr [set ${ARR}(scrollBar)] set sy_ent [set ${ARR}(syncWithEntry)] set sy_scr [set ${ARR}(syncWithEntryScroll)] set sy_lab [set ${ARR}(syncWithEntryLabel)] enable_listbox $lb_box $lb_lab $lb_sel $lb_scr "bind_depend concur" enable_fullentry $sy_lab $sy_ent $sy_scr disable_spinbox $sp_ent $sp_scr $sp_lab } [set ${ARR}(radioboxSyncNone)] configure -variable ${ARR}(concur) \ -value "syncnone" \ -command { set sp_ent [set ${ARR}(spinCountEntry)] set sp_scr [set ${ARR}(spinCountScroll)] set sp_lab [set ${ARR}(spinCountLabel)] set lb_box [set ${ARR}(syncBox)] set lb_lab [set ${ARR}(headerLabel)] set lb_sel [set ${ARR}(selButton)] set lb_scr [set ${ARR}(scrollBar)] set sy_ent [set ${ARR}(syncWithEntry)] set sy_scr [set ${ARR}(syncWithEntryScroll)] set sy_lab [set ${ARR}(syncWithEntryLabel)] disable_spinbox $sp_ent $sp_scr $sp_lab disable_listbox $lb_box $lb_lab $lb_sel $lb_scr disable_fullentry $sy_lab $sy_ent $sy_scr } focus $dependDialogBox ### PACK the FRAMES pack $dbox_top.concur -anchor nw -side top -fill x -padx 2m invoke_concur_widgets $ARR remove_busy_cursor catch {tkwait window $dependDialogBox} set activeWindow($dependDialogBox) 0 focus $callerDialogBox catch {grab $callerDialogBox} } # invoke_depend_widgets: invoke the various widgets found in the Dependency # dialog box. proc invoke_concur_widgets assoc_array { upvar $assoc_array arr invoke_rbutton [list $arr(radioboxSyncNone) $arr(radioboxSynccount) \ $arr(radioboxSyncwith)] } # pre_build_depend_opt: builds the dependency options suitable for processing # by qsub and qalter. RETURNS: 1 if an error is detected; 0 otherwise. proc pre_build_concur_depend_opt {array} { upvar $array ARR global dependDialogBox concurJob switch -exact -- $ARR(concur) { synccount { if {[string compare $ARR(synccountCnt) ""] == 0} { popupInfoBox $dependDialogBox "Please specify the # of jobs that will synchronize execution with current job." return 1 } } syncwith { if {[string compare $concurJob ""] == 0} { popupInfoBox $dependDialogBox "Please click to select the job to synchronize execution with." return 1 } set ARR(syncwithJob) $concurJob } } return 0 } torque-2.4.16/src/gui/acctname.tk0000664000113300011330000001604111272401236013522 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ###################################################################################### # acctname: defines the layout and function of the select account name dialog box. ###################################################################################### proc acctname {} { global LABELFONT acctnameDialogBox activeWindow selv busy_cursor ## Bring up the standard Dialog box ## set acctnameDialogBox ".acctname" set dbox [popupDialogBox $acctnameDialogBox "Select Account Name Criteria" 1 "" "" 1] set activeWindow($acctnameDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.acctname $acctnameDialogBox} $cmdOk configure -command { switch -exact -- $selv(account_option) { acct { if {[string compare $selv(account_name) ""] != 0} { set selv(acctname) "Account_Name: $selv(account_name)" } else { popupInfoBox $acctnameDialogBox "Please specify an account name." return } } ANY {set selv(acctname) "Account_Name: -ANY-"} } destroy $acctnameDialogBox } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.a frame $dbox_top.a.main frame $dbox_top.a.main.a pack $dbox_top.a -padx 2m -pady 5m set accountname [buildFullEntrybox $dbox_top.a.main.a 0 \ "" 15 "" "right" 0] set acctNameFrame [lindex $accountname 0] set acctNameLabel [lindex $accountname 1] set acctNameEntry [lindex $accountname 2] set acctNameScroll [lindex $accountname 3] $acctNameEntry configure -textvariable selv(account_name) register_default_action $acctNameEntry $cmdOk set radioList [list [concat list \"\" $acctNameFrame] \ {a "ANY"} ] set rbox [buildRadioboxes $dbox_top.a.main [list $radioList] \ column 12 "Account Name = "] set rboxFrame [lindex $rbox 0] set rboxAcct [lindex $rbox 1] set rboxANY [lindex $rbox 2] $rboxAcct configure -variable selv(account_option) -value acct -command \ [list enable_fullentry $acctNameLabel $acctNameEntry $acctNameScroll] $rboxANY configure -variable selv(account_option) -value ANY -command \ [list disable_fullentry $acctNameLabel $acctNameEntry $acctNameScroll] pack forget $rboxFrame pack $rboxFrame -side left -anchor nw ## SET DEFAULT set acct_arg [lindex $selv(acctname) 1] switch -exact -- $acct_arg { "-ANY-" {$rboxANY invoke} default { $rboxAcct invoke set selv(account_name) $acct_arg } } register_default_action $acctnameDialogBox $cmdOk tkwait visibility $acctnameDialogBox remove_busy_cursor catch {tkwait window $acctnameDialogBox} set activeWindow($acctnameDialogBox) 0 } torque-2.4.16/src/gui/fileselect.tk0000664000113300011330000002664611272401236014102 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # fileselect: defines the layout and functions of the fileselectrency set dialog box. # This returns input focus back to 'callerDialogBox' when the depend # dialog box is closed. proc fileselect {callerDialogBox selectProc {title "FILE SELECTION BOX"} \ {cdCWD 1} {dim 80x10}} { global activeWindow def fsDialogBox fileselect busy_cursor ## Bring up the standard Dialog box ## set fsDialogBox ".fileselect" set dbox [popupDialogBox $fsDialogBox "File Selection Dialog" 1 "" \ $callerDialogBox] set activeWindow($fsDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## ## TOP PART ## ## ARRANGEMENT ON SCREEN frame $dbox_top.fsBox -borderwidth 2 -relief raised createFileselectWidget $dbox_top.fsBox $title $cdCWD $dim pack $dbox_top.fsBox -padx 1m -pady 1m focus $fsDialogBox ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok "Select File"} {help help}}} x 9m 16 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdOk configure \ -command "uplevel #0 [list $selectProc]; destroy $fsDialogBox" $cmdHelp configure \ -command {xpbs_help fileselect $fsDialogBox} register_default_action $fsDialogBox $cmdOk tkwait visibility $fsDialogBox remove_busy_cursor catch {tkwait window $fsDialogBox} set activeWindow($fsDialogBox) 0 return $fileselect(filepath) } # createFileselectWidget: creates the File selection widget consisting of: # fileselect(dirEntry) : entry holding the current working # directory entry value in 'fileselect(dir)' # fileselect(list) : listbox holding the names of # files/directories under 'fileselect(dir)'. The # selected entry on this listbox is known via # 'fileselect(path)'. # fileselect(fileEntry) : entry holding a selected file (not # directory) in 'fileselect(filepath)'. # OPTION: 'cdCWD' is if you want the option to setting the # "current working directory" be displayed. proc createFileselectWidget {frame_name {title "FILE SELECTION BOX"} {cdCWD 1} {dim 80x10}} { global fileselect LABELFONT TEXTFONT activeColor frame $frame_name.header -height 2m -width 2m frame $frame_name.footer -height 2m -width 2m frame $frame_name.fileselectList frame $frame_name.fileselectEntry frame $frame_name.cwd frame $frame_name.cwd.hl frame $frame_name.cwd.hr set fileselect(host) [cmdExec hostname] label $frame_name.title -text $title -font $LABELFONT set entrybox [buildFullEntrybox $frame_name.cwd.hl 20 \ "SELECTION DIRECTORY:" 35 "" right 0 left] set entryFrame [lindex $entrybox 0] set elabel [lindex $entrybox 1] set entry [lindex $entrybox 2] set fileselect(dirEntry) $entry $entry configure -textvariable fileselect(dir) label $frame_name.cwd.hr.lab2 -font $LABELFONT -text "HOST:" label $frame_name.cwd.hr.host -font $TEXTFONT -text $fileselect(host) set listBoxInfo [buildFullListbox $frame_name.fileselectList $dim \ "" yscroll 0 0] set lbox [lindex $listBoxInfo 3] bind_listbox_single_select $lbox set fileselect(list) $lbox label $frame_name.msg -font $LABELFONT \ -text "(single click to select file; double click to go to a directory)" set entrybox [buildFullEntrybox $frame_name.fileselectEntry 14 \ "FILE Selected:" 58 "" right 0 left] set entryFrame [lindex $entrybox 0] set entry [lindex $entrybox 2] $entry configure -textvariable fileselect(filepath) set fileselect(fileEntry) $entry if {$cdCWD} { frame $frame_name.cwdM button $frame_name.cd -font $LABELFONT \ -text "cd " \ -bg $activeColor \ -command { cd $fileselect(dir) set fileselect(cwd) $fileselect(dir) } $elabel configure -bg $activeColor label $frame_name.cwdM.lab -font $LABELFONT \ -text "CURRENT WORKING DIRECTORY:" label $frame_name.cwdM.dir -font $TEXTFONT \ -textvariable fileselect(cwd) pack $frame_name.cwdM.lab $frame_name.cwdM.dir \ -side left -anchor nw } ### PACK the FRAMES pack $frame_name.cwd.hr.lab2 $frame_name.cwd.hr.host -side left -anchor nw pack $frame_name.cwd.hl $frame_name.cwd.hr -padx 2m -side left -anchor nw pack $frame_name.header $frame_name.title -side top -anchor c pack $frame_name.cwd $frame_name.fileselectList $frame_name.msg -side top \ -anchor nw -padx 4m if {$cdCWD} { frame $frame_name.filler -height 2m pack $frame_name.filler -side top pack $frame_name.cwdM -side top -anchor nw -padx 4m pack $frame_name.cd -side top -anchor c } pack $frame_name.fileselectEntry -side top -padx 2m \ -pady 4m -anchor nw set fileselect(path) {} set fileselect(filepath) {} set fileselect(cwd) [pwd] fileselectBindings $fileselect(dirEntry) $fileselect(list) fileselectList $fileselect(cwd) $fileselect(path) } proc fileselectList {dir {files {}} } { global fileselect tk_version set maxFiles 1000 if { [string compare $dir ""] == 0 } { set dir [pwd] } # Update the directory display set e1 $fileselect(dirEntry) set e2 $fileselect(fileEntry) $e1 delete 0 end $e2 delete 0 end # Scroll to view the tail end if {$tk_version >= 4.0} { $e1 xview moveto 1 $e2 xview moveto 1 } set fileselect(dir) $dir $fileselect(list) delete 0 end # Check for bogus names if ![file isdirectory $dir] { $fileselect(list) insert 0 "Bad directory" return } $fileselect(list) insert 0 "Listing first $maxFiles files..." update idletasks $fileselect(list) delete 0 if {[string length $files] == 0} { # List the directory and add an entry for the parent directory if there's # a parent if {[string compare $fileselect(dir) "/"] != 0} { catch {glob -nocomplain $fileselect(dir)/*} files $fileselect(list) insert end ../ } else { catch {glob -nocomplain /*} files } } # Sort the directories to the front set dirs {} set others {} set i 0 foreach f [lsort $files] { if [file isdirectory $f] { lappend dirs [file tail $f]/ } else { lappend others [file tail $f] } incr i if { $i == $maxFiles } { break } } foreach f [concat $dirs $others] { $fileselect(list) insert end $f } } proc fileselectCancel {} { global fileselect set fileselect(path) {} } proc fileselectClick { lb y } { # Take the item that the user clicked on global fileselect set fileselect(path) [$lb get [$lb nearest $y]] } proc fileselectOK {} { global fileselect if { [string compare $fileselect(dir) ""] == 0 } { set fileselect(dir) [pwd] } # Trim ../ (the parent) out of the pathname that is currently selected if {[regsub {^\.\./?} $fileselect(path) {} newpath] != 0} { set fileselect(path) $newpath set fileselect(dir) [file dirname $fileselect(dir)] fileselectOK return } # Assume path is relative to current directory. # Concatenate the directory entry and the selected pathname. if { [string compare $fileselect(dir) "/"] != 0 } { set path [string trimright $fileselect(dir)/$fileselect(path) /] } else { set path [string trimright /$fileselect(path) /] } if { [string compare $path ""] == 0 } { set path "/" } # If dir/selected_path is a directory, list its contents if [file isdirectory $path] { set fileselect(path) {} fileselectList $path return } # If dir/selected_path is a file, let it be the newly selected path. if [file exists $path] { set fileselect(path) $path return } } torque-2.4.16/src/gui/res.tk0000664000113300011330000002051411272401236012540 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # res: defines the layout and functions of the select resources attributes # criteria dialog box. proc res {} { global LABELFONT resDialogBox activeWindow selv selv_res selv_op \ selv_val jobResourceList busy_cursor ## Bring up the standard Dialog box ## set resDialogBox ".res" set dbox [popupDialogBox $resDialogBox "Select Resource Attributes Criteria" 1 "" "" 1] set activeWindow($resDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.resources $resDialogBox} $cmdOk configure -command { switch -exact -- $selv(res_option) { res { set size 0 if [info exists selv_res] { set size [array size selv_res] } for {set i 0} {$i < $size} {incr i} { if {[string compare $selv_res($i) ""] == 0 && \ [string compare $selv_val($i) ""] == 0} { continue } if {([string compare $selv_res($i) ""] == 0 && \ [string compare $selv_val($i) ""] != 0) || \ ([string compare $selv_res($i) ""] != 0 && \ [string compare $selv_val($i) ""] == 0) } { popupInfoBox $resDialogBox "Resource List entry $i is incomplete" return } set operator [oper $selv_op($i)] if { [string compare $operator ""] == 0 } { popupInfoBox $resDialogBox "Please specify the operator for entry $i" return } set sel_resources($i) "$selv_res($i)$operator$selv_val($i)" } set res_args [construct_array_args sel_resources ","] if {[string compare $res_args ""] == 0} { popupInfoBox $resDialogBox "Please specify a resource list argument" return } else { set selv(reslist) "Resources: $res_args" } catch {unset sel_resources} } ANY {set selv(reslist) "Resources: -ANY-"} } destroy $resDialogBox } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.r frame $dbox_top.r.main frame $dbox_top.r.main.r -relief ridge -borderwidth 2 frame $dbox_top.r.dummy -relief groove -borderwidth 3 set selv(res_frame) $dbox_top.r.main.r box $selv(res_frame) -title "" \ -entrylabels [list [list "resource" MENU_ENTRY $jobResourceList] \ [list "op" MENU_ENTRY "{ {} {=}} {{} {!=}} {{} {>=}} {{} {>}} {{} {<=}} {{} {<}}"] "value"] \ -lboxwidths [list 8 3 30] -lboxheights [list 3 3 3] -orient y \ -lboxlabels [list " " " " "Resources:"] \ -array 0 selv_res -array 1 selv_op -array 2 selv_val \ -key [list 0 1 2] -cleanstrExceptChar 1 "=" -grabBox $resDialogBox set radioList [list [concat list \"\" $selv(res_frame)] \ {a "ANY"} ] set rbox [buildRadioboxes $dbox_top.r.main [list $radioList] \ column 12 ""] set rboxFrame [lindex $rbox 0] set rboxRes [lindex $rbox 1] set rboxANY [lindex $rbox 2] $rboxRes configure -variable selv(res_option) -value res -command { box $selv(res_frame) enable } $rboxANY configure -variable selv(res_option) -value ANY -command { box $selv(res_frame) disable } ## PACK the FRAMES label $dbox_top.r.l -text "Resource Attribute" -font $LABELFONT pack $dbox_top.header $dbox_top.r $dbox_top.footer -padx 5m pack $dbox_top.r.l $dbox_top.r.dummy -side left -padx 5 -anchor nw pack $rboxFrame -in $dbox_top.r.dummy -padx 3 -pady 3 raise $rboxFrame $dbox_top.r.dummy pack $dbox_top.r ## set DEFAULT set res_arg [lindex $selv(reslist) 1] switch -regexp -- $res_arg { "-ANY-" { $rboxANY invoke } default { $rboxRes invoke load_argstr $res_arg {,} {selv_res selv_op selv_val} {\\. \\.} foreach o [array names selv_op] { set selv_op($o) [oper_invert $selv_op($o)] } } } register_default_action $resDialogBox $cmdOk tkwait visibility $resDialogBox boxLoad $selv(res_frame) 0 remove_busy_cursor catch {tkwait window $resDialogBox} boxesUnset set activeWindow($resDialogBox) 0 } torque-2.4.16/src/gui/jobname.tk0000664000113300011330000001566411272401236013374 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # jobname: defines the layout and functions of the select job names criteria # dialog box. ################################################################################ proc jobname {} { global LABELFONT jobnameDialogBox activeWindow selv busy_cursor ## Bring up the standard Dialog box ## set jobnameDialogBox ".jobname" set dbox [popupDialogBox $jobnameDialogBox "Select Job Name Criteria" 1 "" "" 1] set activeWindow($jobnameDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.jobname $jobnameDialogBox} $cmdOk configure -command { switch -exact -- $selv(job_option) { job { if {[string compare $selv(jobname) ""] != 0} { set selv(jname) "Job_Name: $selv(jobname)" } else { popupInfoBox $jobnameDialogBox "Please specify a job name." return } } ANY {set selv(jname) "Job_Name: -ANY-"} } destroy $jobnameDialogBox } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.a frame $dbox_top.a.main frame $dbox_top.a.main.a pack $dbox_top.a -padx 2m -pady 5m set jobname [buildFullEntrybox $dbox_top.a.main.a 0 \ "" 15 "" "right" 0] set jobNameFrame [lindex $jobname 0] set jobNameLabel [lindex $jobname 1] set jobNameEntry [lindex $jobname 2] set jobNameScroll [lindex $jobname 3] $jobNameEntry configure -textvariable selv(jobname) register_default_action $jobNameEntry $cmdOk set radioList [list [concat list \"\" $jobNameFrame] \ {a "ANY"} ] set rbox [buildRadioboxes $dbox_top.a.main [list $radioList] \ column 12 "Job Name = "] set rboxFrame [lindex $rbox 0] set rboxAcct [lindex $rbox 1] set rboxANY [lindex $rbox 2] $rboxAcct configure -variable selv(job_option) -value job -command \ [list enable_fullentry $jobNameLabel $jobNameEntry $jobNameScroll] $rboxANY configure -variable selv(job_option) -value ANY -command \ [list disable_fullentry $jobNameLabel $jobNameEntry $jobNameScroll] pack forget $rboxFrame pack $rboxFrame -side left -anchor nw ## set DEFAULT set job_arg [lindex $selv(jname) 1] switch -exact -- $job_arg { "-ANY-" {$rboxANY invoke} default { $rboxAcct invoke set selv(jobname) $job_arg } } register_default_action $jobnameDialogBox $cmdOk tkwait visibility $jobnameDialogBox remove_busy_cursor catch {tkwait window $jobnameDialogBox} set activeWindow($jobnameDialogBox) 0 } torque-2.4.16/src/gui/qalter.tk0000664000113300011330000011350011272401236013235 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # hold: defines the layout and functions of the modify job dialog box. ################################################################################ proc qalter {} { global qalterv LABELFONT def_qalter cmdpath activeWindow \ jobsSelected qalterDialogBox qalterv_res qalterv_val \ qalterv_stagein_host qalterv_stagein_input \ qalterv_stagein_local qalterv_stageout_local qalterv_stageout_host \ qalterv_stageout_output qalterv_shellp qalterv_shellh qalterv_groupg \ qalterv_grouph qalterv_useru qalterv_userh qalterv_notify_addr \ jobResourceList ## Bring up the standard Dialog box ## busy_cursor set qalterDialogBox .qalter set dbox [popupDialogBox $qalterDialogBox "Modify Job Dialog" 1 \ Qalter] set activeWindow($qalterDialogBox) 1 bind_button1 $qalterDialogBox set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ############################################################ set cmdButtons \ [buildCmdButtons $dbox_bottom \ { {{modify "confirm modify"} {cancel cancel}} \ {{reset "reset options to default"}} {{help help}}} x 0 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdModify [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdReset [lindex $cmdButtons 3] set cmdHelp [lindex $cmdButtons 4] $cmdReset configure -width 25 -command { set_default_qalter_main invoke_qalter_widgets qalterv boxLoad $qalterv(resBox) 0 } $cmdModify configure -width 15 -command { if { [string compare $qalterv(jobName) ""] != 0 && \ ([string length $qalterv(jobName)] > 15 || \ ![regexp "\[a-zA-Z]+" [string index $qalterv(jobName) 0]]) } { popupInfoBox $qalterDialogBox "Found Job Name to be of more than 15\ chars, or the first letter is non-alphabetic. Please fix." return 1 } init_qalter_main_argstr if {$qalterv(notify)} { set qalterv(mail_option) \ "$qalterv(notify_opt\(abort\))$qalterv(notify_opt\(begin\))$qalterv(notify_opt\(end\))" if {[string compare $qalterv(mail_option) ""] == 0} { set qalterv(mail_option) "n" init_qalter_email_argstr } else { pre_build_email_opt qalterv } } else { init_qalter_email_argstr } set hold_list "" if { [string compare $qalterv(qhold\(user\)) \ $def_qalter(qhold\(user\))] != 0 } { append hold_list $qalterv(qhold\(user\)) } if { [string compare $qalterv(qhold\(other\)) \ $def_qalter(qhold\(other\))] != 0 } { append hold_list $qalterv(qhold\(other\)) } if { [string compare $qalterv(qhold\(system\)) \ $def_qalter(qhold\(system\))] != 0} { append hold_list $qalterv(qhold\(system\)) } switch -exact -- $qalterv(hold_action) { place { if {[string compare $hold_list ""] != 0} { set qalterv(hold_args) $hold_list } } clear { set qalterv(hold_args) "n" } } set retain "" if [info exists qalterv(chkboxStdoutRet)] { set state [lindex [$qalterv(chkboxStdoutRet) configure -state] 4] if {[string compare $state "normal"] == 0 && \ [string compare $qalterv(stdoutRet) \ $def_qalter(stdoutRet)] != 0} { append retain $qalterv(stdoutRet) } } if [info exists qalterv(chkboxStderrRet)] { set state [lindex [$qalterv(chkboxStderrRet) configure -state] 4] if {[string compare $state "normal"] == 0 && \ [string compare $qalterv(stderrRet) \ $def_qalter(stderrRet)] != 0} { append retain $qalterv(stderrRet) } } switch -exact -- $qalterv(retain) { retain { if { [string compare $retain ""] != 0 } { set qalterv(keep_args) $retain } } noRetain { set qalterv(keep_args) n } } if [info exists qalterv(StdoutFile)] { set state [lindex [$qalterv(StdoutFile) configure -state] 4] if {[string compare $state "normal"] == 0} { if { [trimvar ":" qalterv(stdoutFile)] || \ [trimvar ":" qalterv(stdoutHost)] } { popupInfoBox $qalterDialogBox "Detected an illegal character \":\" \ in Stdout filename/hostname. Please remove." return 1 } if {[string compare $qalterv(stdoutHost) ""] != 0 && \ [string compare $qalterv(stdoutFile) ""] == 0} { popupInfoBox $qalterDialogBox "Stdout File/Host specification is incomplete" return } if {[string compare $qalterv(stdoutHost) \ $def_qalter(stdoutHost)] != 0 || \ [string compare $qalterv(stdoutFile) \ $def_qalter(stdoutFile)] != 0} { if {[string compare $qalterv(stdoutHost) ""] != 0} { set qalterv(stdoutPath) "$qalterv(stdoutHost):$qalterv(stdoutFile)" } elseif {[string compare $qalterv(stdoutFile) ""] != 0} { set qalterv(stdoutPath) "$qalterv(stdoutFile)" } } } } if [info exists qalterv(StderrFile)] { set state [lindex [$qalterv(StderrFile) configure -state] 4] if {[string compare $state "normal"] == 0} { if { [trimvar ":" qalterv(stderrFile)] || \ [trimvar ":" qalterv(stderrHost)] } { popupInfoBox $qalterDialogBox "Detected an illegal character \":\"\ in or Stderr filename/hostname. Please remove." return 1 } if {[string compare $qalterv(stderrHost) ""] != 0 && \ [string compare $qalterv(stderrFile) ""] == 0} { popupInfoBox $qalterDialogBox "Stderr File/Host specification is incomplete" return } if {[string compare $qalterv(stderrHost) \ $def_qalter(stderrHost)] != 0 || \ [string compare $qalterv(stderrFile) \ $def_qalter(stderrFile)] != 0} { if {[string compare $qalterv(stderrHost) ""] != 0} { set qalterv(stderrPath) "$qalterv(stderrHost):$qalterv(stderrFile)" } elseif {[string compare $qalterv(stderrFile) ""] != 0} { set qalterv(stderrPath) "$qalterv(stderrFile)" } } } } set size 0 if [info exists qalterv_res] { set size [array size qalterv_res] } for {set i 0} {$i < $size} {incr i} { if { [trimvar "=," qalterv_res($i)] || [trimvar "=," qalterv_val($i)] } { popupInfoBox $qalterDialogBox "Detected an illegal character \"=\"\ in resource name or value entry $i. Please remove." return 1 } if {[string compare $qalterv_res($i) ""] == 0 && \ [string compare $qalterv_val($i) ""] != 0} { popupInfoBox $qalterDialogBox "Resource List entry $i is incomplete" return } if {[string compare $qalterv_res($i) ""] != 0 || \ [string compare $qalterv_val($i) ""] != 0} { if {[string compare $qalterv_val($i) ""] == 0} { set resources($i) "$qalterv_res($i)" } else { set resources($i) "$qalterv_res($i)=$qalterv_val($i)" } } } set qalterv(res_args) [construct_array_args resources ","] catch {unset resources} pre_build_depend_opt qalterv def_qalter pre_build_staging_opt qalterv pre_build_misc_opt qalterv def_qalter if { [string compare $qalterv(qtime) "now"] != 0 } { pre_build_datetime_opt qalterv } else { init_qalter_datetime_argstr } set qopts [build_opt 1 "" 1] if { [string compare $qopts ""] == 0 } { popupInfoBox $qalterDialogBox "Nothing to alter." } else { set exitcode [win_cmdExec $qalterDialogBox \ "$cmdpath(QALTER) [build_opt 1 "" 1] $jobsSelected"] if {$exitcode == 0} { popupInfoBox $qalterDialogBox "Job(s) have been altered." after 500 [list getdata $SERVER_HOSTS 1] destroy $qalterDialogBox } } } $cmdCancel configure -command { destroy $qalterDialogBox } $cmdHelp configure -command {xpbs_help modify $qalterDialogBox} ## Bring up Frames frame $dbox_top.jobs frame $dbox_top.optionsLabel -class CmdFrame -relief raised -borderwidth 2 frame $dbox_top.options -borderwidth 4 -relief ridge frame $dbox_top.optionsMain frame $dbox_top.optionsMain.left -relief groove -borderwidth 3 frame $dbox_top.optionsMain.right -relief groove -borderwidth 3 frame $dbox_top.line1 frame $dbox_top.line3 frame $dbox_top.line4 frame $dbox_top.line4.n frame $dbox_top.line4.n.t frame $dbox_top.line4.n.b frame $dbox_top.line4.n.b.when frame $dbox_top.line5 frame $dbox_top.resources -borderwidth 3 -relief groove frame $dbox_top.lower frame $dbox_top.output -relief groove -borderwidth 3 frame $dbox_top.othOpts -class CmdFrame -borderwidth 3 -relief groove frame $dbox_top.r3 -relief groove -borderwidth 3 frame $dbox_top.r3.holdt frame $dbox_top.entries frame $dbox_top.jobs.e frame $dbox_top.line1.1 frame $dbox_top.line1.2 frame $dbox_top.r1 frame $dbox_top.action frame $dbox_top.merge frame $dbox_top.retain frame $dbox_top.stderr frame $dbox_top.stderr.file frame $dbox_top.stderr.host frame $dbox_top.stdout frame $dbox_top.stdout.file frame $dbox_top.stdout.host set miscButtons \ [buildCmdButtons $dbox_top.othOpts {\ {{concur "concurrency set.."}} \ {{after "after depend.."}} \ {{before "before depend.."}} \ {{staging "file staging.."}} \ {{misc "misc.."}} } \ y 0 17 0 0 0 0 "OTHER ATTRIBUTES"] set miscConcur [lindex $miscButtons 1] set miscAfter [lindex $miscButtons 2] set miscBefore [lindex $miscButtons 3] set miscStaging [lindex $miscButtons 4] set miscMisc [lindex $miscButtons 5] set miscLabel [lindex $miscButtons 6] $miscConcur configure -command {concur $qalterDialogBox 1} $miscAfter configure -command {after_depend $qalterDialogBox 1} $miscBefore configure -command {before_depend $qalterDialogBox 1} $miscStaging configure -command {staging $qalterDialogBox 1} $miscMisc configure -command {misc $qalterDialogBox 1} $miscLabel configure -anchor nw set chkbox [buildCheckboxes $dbox_top.r3.holdt \ {{{user user} {other other} {system system}}} column 0] set chkboxFrame [lindex $chkbox 0] set qalterv(chkboxUser) [lindex $chkbox 1] set qalterv(chkboxOther) [lindex $chkbox 2] set qalterv(chkboxSystem) [lindex $chkbox 3] $qalterv(chkboxUser) configure -variable qalterv(qhold(user)) -onvalue u \ -offvalue "" $qalterv(chkboxOther) configure -variable qalterv(qhold(other)) -onvalue o \ -offvalue "" $qalterv(chkboxSystem) configure -variable qalterv(qhold(system)) -onvalue s \ -offvalue "" set radioList [list [concat place "Place" $chkboxFrame] \ {clear "Clear all"}] set radiobox [buildRadioboxes $dbox_top.r3 \ [list $radioList] column 0 "Hold Types" 0 1] set qalterv(radioboxPlace) [lindex $radiobox 1] set qalterv(radioboxClear) [lindex $radiobox 2] $qalterv(radioboxPlace) configure -variable qalterv(hold_action) \ -value "place" -command { \ enable_rcbuttons $qalterv(chkboxUser) $qalterv(chkboxOther) \ $qalterv(chkboxSystem) } $qalterv(radioboxClear) configure -variable qalterv(hold_action) \ -value "clear" -command { \ disable_rcbuttons $qalterv(chkboxUser) $qalterv(chkboxOther) \ $qalterv(chkboxSystem) } ### JOBID ################################################################ label $dbox_top.jobs.l -font $LABELFONT -text "Modify job(s):" set jobidbox [buildFullListbox $dbox_top.jobs.e 55x3 "" yscroll 0] set jobidField [lindex $jobidbox 3] $jobidField configure -relief sunken bind_text_readonly $jobidField foreach el $jobsSelected { $jobidField insert end $el } label $dbox_top.optionsLabel.l -font $LABELFONT -text "ATTRIBUTES" pack $dbox_top.optionsLabel.l -anchor nw ### OPTIONS ############################################################### ### MAIN OPTIONS ################# #### MAIN OPTIONS LINE1 ########## set jobbox [buildFullEntrybox $dbox_top.line1.1 8 "Job Name" 15 "" none 0] set JobNameEntry [lindex $jobbox 2] $JobNameEntry configure -textvariable qalterv(jobName) bind_entry_overselect $JobNameEntry register_entry_fixsize $JobNameEntry 15 register_default_action $JobNameEntry $cmdCancel set spinBox [buildSpinbox $dbox_top.line1.2 5 -1024-1023 qalterv priority \ "Priority" left ""] set priorityEntry [lindex $spinBox 1] register_default_action $priorityEntry $cmdCancel #### MAIN OPTIONS LINE 3 ########## ## set radiobox [buildRadioboxes $dbox_top.r1 \ { {{now "NOW"} {later "LATER at.."}} }\ grid 0 "When to Queue"] set radioboxNow [lindex $radiobox 1] set radioboxLater [lindex $radiobox 2] $radioboxNow configure -variable qalterv(qtime) -value "now" \ -command { set_dateTime qalterv(qtimeMon) qalterv(qtimeDay) qalterv(qtimeYear) \ qalterv(qtimeHH) qalterv(qtimeMM) qalterv(qtimeSS) 1 set qalterv(exec_time) [lindex $def_qalter(exec_time) 1]} $radioboxLater configure -variable qalterv(qtime) -value "later" \ -command [list dateTime $qalterDialogBox 1] ## MAIN OPTIONS LINE 5 ####### set acctbox [buildFullEntrybox $dbox_top.line5 11 "Account Name" 15 "" none 0] set AcctNameEntry [lindex $acctbox 2] $AcctNameEntry configure -textvariable qalterv(acctName) bind_entry_overselect $AcctNameEntry register_default_action $AcctNameEntry $cmdCancel ## MAIN OPTIONS LINE 4 ###### label $dbox_top.line4.n.t.label1 -text "Notify" -font $LABELFONT label $dbox_top.line4.n.b.label2 -text "when" -font $LABELFONT set qalterv(cmdEmail) [button $dbox_top.line4.n.t.email -font $LABELFONT \ -text "email addrs.."] $qalterv(cmdEmail) configure -command {email_list $qalterDialogBox 1} set chkbox [buildCheckboxes $dbox_top.line4.n.b.when \ {{{a "job aborts"} {b "job begins execution"} {e "job terminates"}}} column 0 ""] set chkboxFrame [lindex $chkbox 0] set qalterv(chkboxNotifyAbort) [lindex $chkbox 1] set qalterv(chkboxNotifyBegin) [lindex $chkbox 2] set qalterv(chkboxNotifyEnd) [lindex $chkbox 3] $qalterv(chkboxNotifyAbort) configure -variable qalterv(notify_opt(abort)) \ -onvalue "a" -offvalue "" -command { if {[string compare $qalterv(notify_opt\(abort\)) "a"] != 0 && \ [string compare $qalterv(notify_opt\(begin\)) "b"] != 0 && \ [string compare $qalterv(notify_opt\(end\)) "e"] != 0 } { disable_button $qalterv(cmdEmail) } else { enable_button $qalterv(cmdEmail) } } $qalterv(chkboxNotifyBegin) configure -variable qalterv(notify_opt(begin)) \ -onvalue "b" -offvalue "" -command { if {[string compare $qalterv(notify_opt\(abort\)) "a"] != 0 && \ [string compare $qalterv(notify_opt\(begin\)) "b"] != 0 && \ [string compare $qalterv(notify_opt\(end\)) "e"] != 0 } { disable_button $qalterv(cmdEmail) } else { enable_button $qalterv(cmdEmail) } } $qalterv(chkboxNotifyEnd) configure -variable qalterv(notify_opt(end)) \ -onvalue "e" -offvalue "" -command { if {[string compare $qalterv(notify_opt\(abort\)) "a"] != 0 && \ [string compare $qalterv(notify_opt\(begin\)) "b"] != 0 && \ [string compare $qalterv(notify_opt\(end\)) "e"] != 0 } { disable_button $qalterv(cmdEmail) } else { enable_button $qalterv(cmdEmail) } } pack $dbox_top.line4.n.t.label1 -side left -anchor s pack $qalterv(cmdEmail) -side right -anchor s pack $dbox_top.line4.n.b.label2 $dbox_top.line4.n.b.when -side left -anchor nw set qalterv(notifyLabel1) $dbox_top.line4.n.t.label1 set qalterv(notifyLabel2) $dbox_top.line4.n.b.label2 set chkboxList [list [concat notify \"\" $dbox_top.line4.n] ] pack $dbox_top.line4.n set chkbox [buildCheckboxes $dbox_top.line4 \ [list $chkboxList] column 0] set qalterv(chkboxNotify) [lindex $chkbox 1] $qalterv(chkboxNotify) configure -variable qalterv(notify) -command { global disabledColor if {$qalterv(notify)} { enable_label $qalterv(notifyLabel1) enable_label $qalterv(notifyLabel2) enable_rcbuttons $qalterv(chkboxNotifyAbort) $qalterv(chkboxNotifyBegin) \ $qalterv(chkboxNotifyEnd) if {[string compare $qalterv(notify_opt\(abort\)) "a"] == 0 || \ [string compare $qalterv(notify_opt\(begin\)) "b"] == 0 || \ [string compare $qalterv(notify_opt\(end\)) "e"] == 0 } { enable_button $qalterv(cmdEmail) } } else { disable_label $qalterv(notifyLabel1) $disabledColor disable_label $qalterv(notifyLabel2) $disabledColor disable_rcbuttons $qalterv(chkboxNotifyAbort) $qalterv(chkboxNotifyBegin) \ $qalterv(chkboxNotifyEnd) disable_button $qalterv(cmdEmail) } } ### RESOURCE OPTIONS ######## foreach res $jobResourceList { lappend resnames [list "" [lindex $res 0]] } box $dbox_top.resources -title "Resource List" \ -entrylabels [list [list "resource" MENU_ENTRY $jobResourceList] value] \ -lboxlabels [list " " "Resources"] -lboxwidths [list 15 20] \ -lboxheights [list 2 2] -orient xy \ -array 0 qalterv_res -array 1 qalterv_val \ -menuEntry [list [list $resnames] {resources_help $qalterDialogBox} help-] -key 0 \ -grabBox $qalterDialogBox set qalterv(resBox) $dbox_top.resources ## OUTPUT OPTIONS ##### set radiobox [buildRadioboxes $dbox_top.merge \ { {{stdoutMerge "Merge to Stdout"} \ {stderrMerge "Merge to Stderr"} \ {noMerge "Don't Merge"} \ {noChange "No Change"}} } column 0 "Output" 1 1] set qalterv(radioboxStdoutMerge) [lindex $radiobox 1] set qalterv(radioboxStderrMerge) [lindex $radiobox 2] set qalterv(radioboxNoMerge) [lindex $radiobox 3] set qalterv(radioboxNoChange) [lindex $radiobox 4] frame $dbox_top.retain.ret set chkbox [buildCheckboxes $dbox_top.retain.ret \ { {{stdoutRet "Stdout in exec_host:.o"} \ {stderrRet "Stderr in exec_host:.e"}} } \ column 0 "" 1 1] set chkboxFrame [lindex $chkbox 0] set qalterv(chkboxStdoutRet) [lindex $chkbox 1] set qalterv(chkboxStderrRet) [lindex $chkbox 2] set radioList [list [concat ret "Retain" $chkboxFrame] \ {clear "Retain neither stdout/stderr in exec_host"}] set radiobox [buildRadioboxes $dbox_top.retain \ [list $radioList] column 0 "" 0 1] set qalterv(rboxRetain) [lindex $radiobox 1] set qalterv(rboxNoRetain) [lindex $radiobox 2] $qalterv(rboxRetain) configure -variable qalterv(retain) -value "retain" \ -command { if {[string compare $qalterv(merge) "eo"] != 0} { enable_rcbuttons $qalterv(chkboxStdoutRet) } if {[string compare $qalterv(merge) "oe"] != 0} { enable_rcbuttons $qalterv(chkboxStderrRet) } invoke_rbutton [list $qalterv(radioboxStdoutMerge) \ $qalterv(radioboxStderrMerge) \ $qalterv(radioboxNoMerge) \ $qalterv(radioboxNoChange)] } $qalterv(rboxNoRetain) configure -variable qalterv(retain) \ -value "noRetain" -command { disable_rcbuttons $qalterv(chkboxStdoutRet) $qalterv(chkboxStderrRet) invoke_rbutton [list $qalterv(radioboxStdoutMerge) \ $qalterv(radioboxStderrMerge) \ $qalterv(radioboxNoMerge) \ $qalterv(radioboxNoChange)] } button $dbox_top.stdout.fsboxButton -height 1 -width 18 -font $LABELFONT \ -text "Stdout File Name.." -padx 0 \ -command { fileselect $qalterDialogBox \ { set qalterv(stdoutFile) $fileselect(filepath) if { [string compare $fileselect(filepath) ""] != 0 } { set qalterv(stdoutHost) $fileselect(host) } } "STDOUT FILE SELECTION" 0 } set filebox [buildFullEntrybox $dbox_top.stdout.file \ 0 "" 15 "" right 0] set qalterv(StdoutFileLabel) [lindex $filebox 1] set qalterv(StdoutFile) [lindex $filebox 2] set qalterv(StdoutFileScroll) [lindex $filebox 3] $qalterv(StdoutFile) configure -textvariable qalterv(stdoutFile) register_default_action $qalterv(StdoutFile) $cmdCancel set filebox [buildFullEntrybox $dbox_top.stdout.host \ 12 "on hostname:" 15 "" right 0] set qalterv(StdoutHostLabel) [lindex $filebox 1] set qalterv(StdoutHost) [lindex $filebox 2] set qalterv(StdoutHostScroll) [lindex $filebox 3] $qalterv(StdoutHost) configure -textvariable qalterv(stdoutHost) register_default_action $qalterv(StdoutHost) $cmdCancel button $dbox_top.stderr.fsboxButton -height 1 -width 18 -font $LABELFONT \ -text "Stderr File Name.." -padx 0 \ -command { fileselect $qalterDialogBox \ { set qalterv(stderrFile) $fileselect(filepath) if { [string compare $fileselect(filepath) ""] != 0 } { set qalterv(stderrHost) $fileselect(host) } } "STDERR FILE SELECTION" 0 } set filebox [buildFullEntrybox $dbox_top.stderr.file \ 0 "" 15 "" right 0] set qalterv(StderrFileLabel) [lindex $filebox 1] set qalterv(StderrFile) [lindex $filebox 2] set qalterv(StderrFileScroll) [lindex $filebox 3] $qalterv(StderrFile) configure -textvariable qalterv(stderrFile) register_default_action $qalterv(StderrFile) $cmdCancel set filebox [buildFullEntrybox $dbox_top.stderr.host \ 12 "on hostname:" 15 "" right 0] set qalterv(StderrHostLabel) [lindex $filebox 1] set qalterv(StderrHost) [lindex $filebox 2] set qalterv(StderrHostScroll) [lindex $filebox 3] $qalterv(StderrHost) configure -textvariable qalterv(stderrHost) register_default_action $qalterv(StderrHost) $cmdCancel ## Set the key tabbing option bind_entry_tab $qalterv(StdoutFile) $qalterv(StdoutHost) \ $qalterv(StdoutFile) bind_entry_tab $qalterv(StdoutHost) $qalterv(StderrFile) \ $qalterv(StdoutFile) bind_entry_tab $qalterv(StderrFile) $qalterv(StderrHost) \ $qalterv(StdoutHost) bind_entry_tab $qalterv(StderrHost) $qalterv(StderrHost) \ $qalterv(StderrFile) bind_entry_overselect $qalterv(StdoutFile) bind_entry_overselect $qalterv(StdoutHost) bind_entry_overselect $qalterv(StderrFile) bind_entry_overselect $qalterv(StderrHost) ## Now for the big trick on output retention. ################################# ## Clicking Retain Stdout, then only the "Stderr File/Path Name" will be ## enabled for input. Retain will construct its own path for Stdout on the ## execution host. $qalterv(chkboxStdoutRet) configure -variable qalterv(stdoutRet) \ -onvalue "o" \ -offvalue "" -command { if {[string compare $qalterv(stdoutRet) "o"] == 0} { disable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) disable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) if {[string compare $qalterv(stderrRet) "e"] != 0} { focus $qalterv(StderrFile) } } else { enable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) enable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) focus $qalterv(StdoutFile) }} ## Clicking Retain Stderr, then only the "Stdout File/Path Name" will be ## enabled for input. Retain will construct its own path for Stderr on the ## execution host. $qalterv(chkboxStderrRet) configure -variable qalterv(stderrRet) -onvalue "e" \ -offvalue "" \ -command { if {[string compare $qalterv(stderrRet) "e"] == 0} { disable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) disable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) if {[string compare $qalterv(stdoutRet) "o"] != 0} { focus $qalterv(StdoutFile) } } else { enable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) enable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) focus $qalterv(StderrFile) }} ## If standard error and standout are merged as standout output, then anything ## referring to stderr are meaningless. $qalterv(radioboxStdoutMerge) configure -variable qalterv(merge) -value oe \ -command { if { [string compare $qalterv(retain) "retain"] == 0 } { disable_rcbutton $qalterv(chkboxStderrRet) enable_rcbutton $qalterv(chkboxStdoutRet) } disable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) disable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) if { [string compare $qalterv(retain) "retain"] != 0 || \ [string compare $qalterv(stdoutRet) "o"] != 0} { enable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) enable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) focus $qalterv(StdoutFile) } else { disable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) disable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) } } ## If standard error and standout are merged as standout error, then anything ## referring to stdout are meaningless. $qalterv(radioboxStderrMerge) configure -variable qalterv(merge) \ -value eo -command { if { [string compare $qalterv(retain) "retain"] == 0 } { disable_rcbutton $qalterv(chkboxStdoutRet) enable_rcbutton $qalterv(chkboxStderrRet) } disable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) disable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) if { [string compare $qalterv(retain) "retain"] != 0 || \ [string compare $qalterv(stderrRet) "e"] != 0} { enable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) enable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) focus $qalterv(StderrFile) } else { disable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) disable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) } } $qalterv(radioboxNoMerge) configure -variable qalterv(merge) -value n \ -command { if { [string compare $qalterv(retain) "retain"] == 0 } { enable_rcbutton $qalterv(chkboxStdoutRet) enable_rcbutton $qalterv(chkboxStderrRet) } if { [string compare $qalterv(retain) "retain"] != 0 || \ [string compare $qalterv(stdoutRet) "o"] != 0} { enable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) enable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) focus $qalterv(StdoutFile) } else { disable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) disable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) } if { [string compare $qalterv(retain) "retain"] != 0 || \ [string compare $qalterv(stderrRet) "e"] != 0} { enable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) enable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) focus $qalterv(StderrFile) } else { disable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) disable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) } } $qalterv(radioboxNoChange) configure -variable qalterv(merge) -value nc \ -command { if { [string compare $qalterv(retain) "retain"] == 0 } { enable_rcbutton $qalterv(chkboxStdoutRet) enable_rcbutton $qalterv(chkboxStderrRet) } if { [string compare $qalterv(retain) "retain"] != 0 || \ [string compare $qalterv(stdoutRet) "o"] != 0} { enable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) enable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) focus $qalterv(StdoutFile) } else { disable_fullentry $qalterv(StdoutFileLabel) $qalterv(StdoutFile) \ $qalterv(StdoutFileScroll) disable_fullentry $qalterv(StdoutHostLabel) $qalterv(StdoutHost) \ $qalterv(StdoutHostScroll) } if { [string compare $qalterv(retain) "retain"] != 0 || \ [string compare $qalterv(stderrRet) "e"] != 0} { enable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) enable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) focus $qalterv(StderrFile) } else { disable_fullentry $qalterv(StderrFileLabel) $qalterv(StderrFile) \ $qalterv(StderrFileScroll) disable_fullentry $qalterv(StderrHostLabel) $qalterv(StderrHost) \ $qalterv(StderrHostScroll) } } register_default_action Qalter $cmdCancel ### Pack the frames pack $dbox_top.jobs -side top -anchor c -pady 5 pack $dbox_top.optionsLabel -anchor nw -after $dbox_top.jobs -fill x pack $dbox_top.options \ -anchor nw -fill x -after $dbox_top.optionsLabel pack $dbox_top.optionsMain \ $dbox_top.entries \ $dbox_top.lower \ -in $dbox_top.options -side top -anchor nw -pady 5 -fill both -expand 1 pack $dbox_top.jobs.l $dbox_top.jobs.e -side left -anchor c pack $dbox_top.line1 \ -in $dbox_top.optionsMain.left -side top -anchor nw -pady 3m -padx 3m pack $dbox_top.line5 \ -in $dbox_top.optionsMain.left -anchor nw -padx 3m \ -after $dbox_top.line1 pack $dbox_top.line3 -after $dbox_top.line5 \ -in $dbox_top.optionsMain.left -anchor nw -pady 3m -padx 3m pack $dbox_top.line1.1 $dbox_top.line1.2 \ -anchor nw -side left pack $dbox_top.r1 -in $dbox_top.line3 pack $dbox_top.line4 \ -in $dbox_top.optionsMain.right -anchor nw -padx 1m -pady 1m pack $dbox_top.line4.n.t \ $dbox_top.line4.n.b -side top -anchor nw -pady 6 pack $dbox_top.optionsMain.left -side left -anchor c -padx 3m -pady 2m pack $dbox_top.optionsMain.right -side right -anchor c -pady 2m pack $dbox_top.resources \ -in $dbox_top.entries -side left -padx 2m pack $dbox_top.r3 \ -in $dbox_top.entries -side left pack $dbox_top.othOpts \ -in $dbox_top.entries -side left -padx 2m raise $dbox_top.resources $dbox_top.entries raise $dbox_top.r3 $dbox_top.entries raise $dbox_top.othOpts $dbox_top.entries pack $dbox_top.output \ -in $dbox_top.lower -padx 2m -side left -fill both -expand 1 raise $dbox_top.output $dbox_top.lower pack $dbox_top.action -side top -anchor nw -pady 3m -padx 2m \ -in $dbox_top.output -fill x -expand 1 pack $dbox_top.merge $dbox_top.retain \ -in $dbox_top.action -side left -anchor nw -fill both -expand 1 \ -padx 2m pack $dbox_top.stdout \ -in $dbox_top.output -side top -anchor nw -fill x -expand 1 \ -pady 2m -padx 2m pack $dbox_top.stderr -after $dbox_top.stdout\ -in $dbox_top.output -anchor nw -fill x -expand 1 -padx 2m pack $dbox_top.stdout.fsboxButton $dbox_top.stdout.file \ $dbox_top.stdout.host -side left -anchor nw pack $dbox_top.stderr.fsboxButton $dbox_top.stderr.file \ $dbox_top.stderr.host -side left -anchor nw # End of Pack ### SET OPTIONS TO DEFAULT set_default_qalter_main set_default_qalter_concur set_default_qalter_after set_default_qalter_before set_default_qalter_staging set_default_qalter_misc set_default_qalter_email set_default_qalter_datetime invoke_qalter_widgets qalterv tkwait visibility $qalterDialogBox remove_busy_cursor catch {tkwait window $qalterDialogBox} boxesUnset set activeWindow($qalterDialogBox) 0 set varnames "qalterv qalterv qalterv_res qalterv_val \ qalterv_stagein_host qalterv_stagein_input \ qalterv_stagein_local qalterv_stageout_local qalterv_stageout_host \ qalterv_stageout_output qalterv_shellp qalterv_shellh qalterv_groupg \ qalterv_grouph qalterv_useru qalterv_userh qalterv_notify_addr" foreach v $varnames { catch {unset $v} } } # invoke_qalter_widgets: invoke the various widgets found in the Qalter Main # dialog box. proc invoke_qalter_widgets assoc_array { upvar $assoc_array arr invoke_rbutton [list $arr(radioboxPlace) $arr(radioboxClear)] invoke_cbutton $arr(chkboxNotify) invoke_rbutton [list $arr(radioboxStdoutMerge) \ $arr(radioboxStderrMerge) \ $arr(radioboxNoMerge) \ $arr(radioboxNoChange)] invoke_rbutton [list $arr(rboxRetain) $arr(rboxNoRetain)] } torque-2.4.16/src/gui/datetime.tk0000664000113300011330000002007211272401236013542 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # dateTime: creates a dialog box containing date/time widgets. This returns # input focus back to 'callerDialogBox' when closed. # OPTION: # qalter - if dialog box is to be opened in the context of qalter. # proc dateTime {callerDialogBox {qalter 0}} { global LABELFONT dtimeDialogBox activeWindow def if {!$qalter} { global qsubv ARR def_qsub set ARR "qsubv" set def def_qsub } else { global qalterv ARR def_qalter set ARR "qalterv" set def def_qalter } if {[string compare [set ${ARR}(qtimeMon)] [set ${def}(qtimeMon)]] == 0 && \ [string compare [set ${ARR}(qtimeDay)] [set ${def}(qtimeDay)]] == 0 && \ [string compare [set ${ARR}(qtimeYear)] [set ${def}(qtimeYear)]] == 0 && \ [string compare [set ${ARR}(qtimeHH)] [set ${def}(qtimeHH)]] == 0 && \ [string compare [set ${ARR}(qtimeMM)] [set ${def}(qtimeMM)]] == 0 && \ [string compare [set ${ARR}(qtimeSS)] [set ${def}(qtimeSS)]] == 0 } { set_dateTime ${ARR}(qtimeMon) ${ARR}(qtimeDay) ${ARR}(qtimeYear) \ ${ARR}(qtimeHH) ${ARR}(qtimeMM) ${ARR}(qtimeSS) } busy_cursor ## Bring up the standard Dialog box ## set dtimeDialogBox ".dateTime" set dbox [popupDialogBox $dtimeDialogBox "Date/Time Dialog" 1 "" $callerDialogBox] set activeWindow($dtimeDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 1m 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdOk configure -command { set parts "[set ${ARR}(mon_widget)] [set ${ARR}(day_widget)] \ [set ${ARR}(year_widget)] [set ${ARR}(hour_widget)] \ [set ${ARR}(min_widget)] [set ${ARR}(sec_widget)]" foreach p $parts { check_spinbox_value $p if { [string compare [$p get] ""] == 0 } { popupInfoBox $dtimeDialogBox "Bad date/time value found. Please fix." return } } pre_build_datetime_opt $ARR destroy $dtimeDialogBox } $cmdHelp configure -command {xpbs_help datetime $dtimeDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.dtimeFrame set dateTimeFrame [create_DateTime_box $dbox_top.dtimeFrame "" \ "" "" "" "" "" $ARR] set frame_name [lindex $dateTimeFrame 0] set ${ARR}(mon_widget) [lindex $dateTimeFrame 1] set ${ARR}(day_widget) [lindex $dateTimeFrame 2] set ${ARR}(year_widget) [lindex $dateTimeFrame 3] set ${ARR}(hour_widget) [lindex $dateTimeFrame 4] set ${ARR}(min_widget) [lindex $dateTimeFrame 5] set ${ARR}(sec_widget) [lindex $dateTimeFrame 6] register_default_action [lindex $dateTimeFrame 1] $cmdOk register_default_action [lindex $dateTimeFrame 2] $cmdOk register_default_action [lindex $dateTimeFrame 3] $cmdOk register_default_action [lindex $dateTimeFrame 4] $cmdOk register_default_action [lindex $dateTimeFrame 5] $cmdOk register_default_action [lindex $dateTimeFrame 6] $cmdOk ## ARRANGEMENT ON SCREEN pack $dbox_top.header $dbox_top.dtimeFrame $dbox_top.footer -anchor nw \ -side top -padx 10m -anchor c register_default_action $dtimeDialogBox $cmdOk tkwait visibility $dtimeDialogBox remove_busy_cursor catch {tkwait window $dtimeDialogBox} set activeWindow($dtimeDialogBox) 0 focus $callerDialogBox catch {grab $callerDialogBox} } # pre_build_datetime_opt: builds an argument date/time string suitable for # processing by PBS commands, given an 'array' containing the elements: # qtimeMon, qtimeDay, qtimeYear, qtimeHH, qtimeMM, qtimeSS. proc pre_build_datetime_opt {array} { upvar $array ARR if [regexp "qsub" $array] { init_qsub_datetime_argstr } else { init_qalter_datetime_argstr } set ARR(exec_time) "[cvtdatetime_arg $ARR(qtimeMon) \ $ARR(qtimeDay) \ $ARR(qtimeYear) \ $ARR(qtimeHH) \ $ARR(qtimeMM) \ $ARR(qtimeSS)]" } torque-2.4.16/src/gui/qhold.tk0000664000113300011330000001634111272401236013061 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qhold: defines the layout and functions of the select hold job dialog box. proc qhold {} { global jobsSelected LABELFONT jobidField SERVER_HOSTS cmdpath \ qholdDialogBox activeWindow qholdv busy_cursor ## Bring up the standard Dialog box ## set qholdDialogBox ".hold" set dbox [popupDialogBox $qholdDialogBox "Hold Job Dialog"] set activeWindow($qholdDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{hold hold} {cancel cancel} {help help}}} x 0 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdHold [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdHold configure -command { if { [string compare $qholdv(other) ""] == 0 && \ [string compare $qholdv(system) ""] == 0} { set qholdv(user) u set exitcode [win_cmdExec $qholdDialogBox "$cmdpath(QHOLD) $jobsSelected"] } else { set exitcode [win_cmdExec $qholdDialogBox "$cmdpath(QHOLD) -h $qholdv(user)$qholdv(other)$qholdv(system) $jobsSelected"] } if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] destroy $qholdDialogBox } } $cmdCancel configure -command [list destroy $qholdDialogBox] $cmdHelp configure -command {xpbs_help hold $qholdDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.e frame $dbox_top.c frame $dbox_top.empty1 -width 10m frame $dbox_top.empty2 -width 10m set jobidbox [buildFullListbox $dbox_top.e 40x3 "" xyscroll 0] set jobidFrame [lindex $jobidbox 0] set jobidField [lindex $jobidbox 3] $jobidField configure -relief sunken bind_text_readonly $jobidField foreach el $jobsSelected { $jobidField insert end $el } set chkbox [buildCheckboxes $dbox_top.c \ {{{user user} {other other} {system system}}} column 0] set chkboxFrame [lindex $chkbox 0] set chkboxUser [lindex $chkbox 1] set chkboxOther [lindex $chkbox 2] set chkboxSystem [lindex $chkbox 3] $chkboxFrame configure -relief groove -borderwidth 2 $chkboxUser configure -variable qholdv(user) -onvalue u -offvalue "" $chkboxOther configure -variable qholdv(other) -onvalue o -offvalue "" $chkboxSystem configure -variable qholdv(system) -onvalue s -offvalue "" set qholdv(user) u set qholdv(other) "" set qholdv(system) "" label $dbox_top.chkboxLabel1 -text "Place" -font $LABELFONT label $dbox_top.chkboxLabel2 -text "hold(s) on job(s):" -font $LABELFONT ## ARRANGEMENT ON SCREEN pack $dbox_top.header -side top pack $dbox_top.empty1 $dbox_top.chkboxLabel1 -side left -anchor nw pack $chkboxFrame -after $dbox_top.chkboxLabel1 -anchor nw -side left -padx 2 pack $dbox_top.chkboxLabel2 $jobidFrame $dbox_top.empty2 -anchor nw -side left pack $dbox_top.footer -before $chkboxFrame -side bottom register_default_action $qholdDialogBox $cmdCancel tkwait visibility $qholdDialogBox remove_busy_cursor catch {tkwait window $qholdDialogBox} set activeWindow($qholdDialogBox) 0 catch {unset qholdv} } torque-2.4.16/src/gui/main.tk0000664000113300011330000006633011272401236012701 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ############################################################################## # # # Main.tk: Contains a series of procedures for building the main application # # window. # # # ############################################################################## proc build_main_window {} { global mainWindow iconview frame $mainWindow.hosts -borderwidth 1 -relief raised frame $mainWindow.queues -borderwidth 1 -relief raised frame $mainWindow.jobs -borderwidth 1 -relief raised frame $mainWindow.statusbar -borderwidth 1 -relief raised frame $mainWindow.menubar -borderwidth 2 -relief raised # Pack menubar and status bar as fixed size frames pack $mainWindow.menubar -side top -fill x -expand 0 \ ;# keeps the size fixed fillMenubarFrame $mainWindow.menubar # pack the rest of the frames: hosts, queues, and jobs. pack $mainWindow.hosts $mainWindow.queues $mainWindow.jobs \ $mainWindow.statusbar -after $mainWindow.menubar \ -pady 1 -side top -fill x fillHostsFrame $mainWindow.hosts fillQueuesFrame $mainWindow.queues fillJobsFrame $mainWindow.jobs fillStatusbarFrame $mainWindow.statusbar # Create the compressed frame views frame $mainWindow.hosts_iconized -borderwidth 2 -relief raised \ -class CmdFrame frame $mainWindow.queues_iconized -borderwidth 2 -relief raised \ -class CmdFrame frame $mainWindow.jobs_iconized -borderwidth 2 -relief raised \ -class CmdFrame frame $mainWindow.info_iconized -borderwidth 2 -relief raised \ -class CmdFrame fillIconizedFrame "HOSTS" maximizeHostsView $mainWindow.hosts_iconized fillIconizedFrame "QUEUES" maximizeQueuesView $mainWindow.queues_iconized fillIconizedFrame "JOBS" maximizeJobsView $mainWindow.jobs_iconized fillIconizedFrame "INFO" maximizeInfoView $mainWindow.info_iconized if {[string compare $iconview(hosts) "true"] == 0} { iconizeHostsView } if {[string compare $iconview(queues) "true"] == 0} { iconizeQueuesView } if {[string compare $iconview(jobs) "true"] == 0} { iconizeJobsView } if {[string compare $iconview(info) "true"] == 0} { iconizeInfoView } } ### fillconizedFrame: creates a label named "text" and a button with the ## iconization bitmap and an associated "cmd", and display them on ## "widget_name". proc fillIconizedFrame {text cmd widget_name} { global LABELFONT bitmap_dir label $widget_name.label -anchor nw -font $LABELFONT \ -text $text -padx 1 -pady 1 button $widget_name.maximize -anchor c \ -bitmap @$bitmap_dir/maximize.bmp \ -command [list $cmd] -padx 1 -pady 1 pack $widget_name.label -side left -anchor nw pack $widget_name.maximize -side right -anchor se } proc iconizeHostsView {} { global mainWindow iconview pack $mainWindow.hosts_iconized -after $mainWindow.menubar -fill x -pady 1 pack forget $mainWindow.hosts set iconview(hosts) true } proc iconizeQueuesView {} { global mainWindow iconview if { [string compare [packinfo $mainWindow.jobs] ""] != 0 } { pack $mainWindow.queues_iconized -before $mainWindow.jobs -fill x -pady 1 } else { pack $mainWindow.queues_iconized -before $mainWindow.jobs_iconized -fill x -pady 1 } pack forget $mainWindow.queues set iconview(queues) true } proc iconizeJobsView {} { global mainWindow iconview if { [string compare [packinfo $mainWindow.statusbar] ""] != 0 } { pack $mainWindow.jobs_iconized -before $mainWindow.statusbar -fill x -pady 1 } else { pack $mainWindow.jobs_iconized -before $mainWindow.info_iconized -fill x -pady 1 } pack forget $mainWindow.jobs set iconview(jobs) true } proc iconizeInfoView {} { global mainWindow iconview if { [string compare [packinfo $mainWindow.jobs] ""] != 0 } { pack $mainWindow.info_iconized -after $mainWindow.jobs -fill x -pady 1 } else { pack $mainWindow.info_iconized -after $mainWindow.jobs_iconized -fill x -pady 1 } pack forget $mainWindow.statusbar set iconview(info) true } proc maximizeHostsView {} { global mainWindow iconview pack $mainWindow.hosts -after $mainWindow.menubar -fill x pack forget $mainWindow.hosts_iconized set iconview(hosts) false } proc maximizeQueuesView {} { global mainWindow iconview if { [string compare [packinfo $mainWindow.jobs] ""] != 0 } { pack $mainWindow.queues -before $mainWindow.jobs -fill x } else { pack $mainWindow.queues -before $mainWindow.jobs_iconized -fill x } pack forget $mainWindow.queues_iconized set iconview(queues) false } proc maximizeJobsView {} { global mainWindow iconview if { [string compare [packinfo $mainWindow.statusbar] ""] != 0 } { pack $mainWindow.jobs -before $mainWindow.statusbar -fill x } else { pack $mainWindow.jobs -before $mainWindow.info_iconized -fill x } pack forget $mainWindow.jobs_iconized set iconview(jobs) false } proc maximizeInfoView {} { global mainWindow iconview if { [string compare [packinfo $mainWindow.jobs] ""] != 0 } { pack $mainWindow.statusbar -after $mainWindow.jobs -fill x } else { pack $mainWindow.statusbar -after $mainWindow.jobs_iconized -fill x } pack forget $mainWindow.info_iconized set iconview(info) false } ############################################################################## # Hosts Frame widget procedures # ############################################################################## proc fillHostsFrame widget_name { frame $widget_name.header -borderwidth 2 -relief raised -class CmdFrame frame $widget_name.list -borderwidth 1 pack $widget_name.header -fill x -side top pack $widget_name.list -after $widget_name.header fillHostsHeaderFrame $widget_name.header fillHostsListFrame $widget_name.list } proc fillHostsHeaderFrame widget_name { global LABELFONT bitmap_dir label $widget_name.label -anchor nw -font $LABELFONT \ -text "HOSTS " -padx 1 -pady 1 button $widget_name.iconize -anchor c \ -bitmap @$bitmap_dir/iconize.bmp \ -command iconizeHostsView \ -padx 1 -pady 1 pack $widget_name.label -side left -anchor nw -pady 1 pack $widget_name.iconize -side right -expand 1 -anchor e } proc fillHostsListFrame widget_name { global HOSTS_COLUMN_LABEL HOSTS_LISTBOX_KEY \ HOSTS_LISTBOX_WIDTH HOSTS_LISTBOX_HEIGHT \ hostsListbox hostsSelMode hostsSelected \ tk_version perm_level activeColor frame $widget_name.box -borderwidth 1 set dim "${HOSTS_LISTBOX_WIDTH}x${HOSTS_LISTBOX_HEIGHT}" set listBoxInfo [buildFullListbox $widget_name.box $dim $HOSTS_COLUMN_LABEL yscroll] set hostsListbox [lindex $listBoxInfo 3] set hostsListboxSelButton [lindex $listBoxInfo 2] set hostsListboxLabel [lindex $listBoxInfo 1] $hostsListboxLabel configure -textvariable HOSTS_COLUMN_LABEL $hostsListboxSelButton configure \ -textvariable hostsSelMode \ -command { if { [string compare "$hostsSelMode" "Select All"] == 0 } { if { $tk_version < 4.0 } { $hostsListbox select from 0 $hostsListbox select to end } else { $hostsListbox select anchor 0 $hostsListbox select set anchor end } set hostsSelMode "Deselect All" set hostsSelected \ [get_keyvals $hostsListbox $HOSTS_LISTBOX_KEY "@" " " "select"] } else { if {$tk_version < 4.0} { $hostsListbox select clear } else { $hostsListbox select clear 0 end } set hostsSelMode "Select All" set hostsSelected "" } set queuesSelected "" loadQueues } frame $widget_name.b pack $widget_name.b set buttonList [list {detail "detail"} {submit "Submit.."}] if { [string compare $perm_level "admin"] == 0 } { lappend buttonList {term terminate..} } set cmdButtons [buildCmdButtons $widget_name.b \ [list $buttonList] y 0 10 1 1 0 0] set cmdButtonFrame [lindex $cmdButtons 0] set cmdButtonDetail [lindex $cmdButtons 1] set cmdButtonSub [lindex $cmdButtons 2] pack forget $cmdButtonFrame $cmdButtonDetail configure -command getHostsDetail $cmdButtonSub configure -command {runQsub} -bg $activeColor if { [string compare $perm_level "admin"] == 0 } { set cmdButtonTerm [lindex $cmdButtons 3] $cmdButtonTerm configure -command runQterm } pack $widget_name.box $cmdButtonFrame \ -side left -anchor nw } ############################################################################## ############################################################################## # Queues Frame widget procedures # ############################################################################## proc fillQueuesFrame widget_name { frame $widget_name.header -borderwidth 2 -relief raised -class CmdFrame frame $widget_name.list -borderwidth 1 pack $widget_name.header -fill x -side top pack $widget_name.list -after $widget_name.header fillQueuesHeaderFrame $widget_name.header fillQueuesListFrame $widget_name.list } proc fillQueuesHeaderFrame widget_name { global LABELFONT bitmap_dir hostsSelected label $widget_name.label -anchor nw -font $LABELFONT \ -text QUEUES -padx 1 -pady 1 button $widget_name.iconize -anchor c \ -bitmap @$bitmap_dir/iconize.bmp \ -command iconizeQueuesView \ -padx 1 -pady 1 frame $widget_name.listby set entrybox [buildFullEntrybox $widget_name.listby 20 "Listed By Host(s):" 70 "" right 0] set entryFrame [lindex $entrybox 0] set entryLabel [lindex $entrybox 1] set entryField [lindex $entrybox 2] set entryScroll [lindex $entrybox 3] $entryField configure -textvariable hostsSelected -relief flat bind_entry_readonly $entryField pack $widget_name.label $entryFrame -side left -anchor nw -pady 1 pack $widget_name.iconize -side right -expand 1 -anchor e } proc fillQueuesListFrame widget_name { global QUEUES_COLUMN_LABEL QUEUES_LISTBOX_WIDTH \ QUEUES_LISTBOX_HEIGHT \ queuesListbox queuesSelMode queuesSelected \ tk_version perm_level frame $widget_name.box -borderwidth 1 set dim "${QUEUES_LISTBOX_WIDTH}x${QUEUES_LISTBOX_HEIGHT}" set listBoxInfo [buildFullListbox $widget_name.box $dim $QUEUES_COLUMN_LABEL yscroll] set queuesListbox [lindex $listBoxInfo 3] set queuesListboxSelButton [lindex $listBoxInfo 2] set queuesListboxLabel [lindex $listBoxInfo 1] $queuesListboxLabel configure -textvariable QUEUES_COLUMN_LABEL $queuesListboxSelButton configure \ -textvariable queuesSelMode \ -command { if { [string compare "$queuesSelMode" "Select All"] == 0 } { if {$tk_version < 4.0} { $queuesListbox select from 0 $queuesListbox select to end } else { $queuesListbox select anchor 0 $queuesListbox select set anchor end } set queuesSelMode "Deselect All" set queuesSelected \ [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " " "select"] } else { if {$tk_version < 4.0} { $queuesListbox select clear } else { $queuesListbox select clear 0 end } set queuesSelMode "Select All" set queuesSelected "" } loadJobs } frame $widget_name.b pack $widget_name.b set buttonList [list {detail "detail"} ] if { [string compare $perm_level "admin"] == 0 } { lappend buttonList {qstop stop} {qstart start} {qdisable disable} \ {qenable enable} } set cmdButtons [buildCmdButtons $widget_name.b \ [list $buttonList] y 0 9 1 1 0 0] set cmdButtonFrame [lindex $cmdButtons 0] set cmdButtonDetail [lindex $cmdButtons 1] pack forget $cmdButtonFrame pack $widget_name.box $cmdButtonFrame -side left -anchor nw $cmdButtonDetail configure -command getQueuesDetail if { [string compare $perm_level "admin"] == 0 } { set cmdButtonQstop [lindex $cmdButtons 2] set cmdButtonQstart [lindex $cmdButtons 3] set cmdButtonQdisable [lindex $cmdButtons 4] set cmdButtonQenable [lindex $cmdButtons 5] $cmdButtonQstop configure -command runQstop $cmdButtonQstart configure -command runQstart $cmdButtonQenable configure -command runQenable $cmdButtonQdisable configure -command runQdisable } } ############################################################################## ############################################################################## # Jobs Frame widget procedures # ############################################################################## proc fillJobsFrame widget_name { frame $widget_name.header -borderwidth 2 -relief raised -class CmdFrame frame $widget_name.header.t -borderwidth 2 frame $widget_name.header.b -borderwidth 2 frame $widget_name.misc -borderwidth 2 -relief ridge -class CmdFrame frame $widget_name.list -borderwidth 2 pack $widget_name.header.t $widget_name.header.b -side top -fill x pack $widget_name.header -side top -fill x pack $widget_name.misc -side top -padx 3m -anchor nw -pady 2m pack $widget_name.list -side top fillJobsHeaderFrame $widget_name.header.t fillJobsMiscFrame $widget_name.header.b fillJobsListFrame $widget_name.list } proc fillJobsHeaderFrame widget_name { global LABELFONT queuesSelected bitmap_dir button $widget_name.iconize -anchor c \ -bitmap @$bitmap_dir/iconize.bmp \ -command iconizeJobsView \ -padx 1 -pady 1 label $widget_name.label -anchor nw -font $LABELFONT \ -text "JOBS " -padx 1 -pady 1 frame $widget_name.e0 set entrybox [buildFullEntrybox $widget_name.e0 21 "Listed By Queue(s):" 67 "" right 0] set entryFrame [lindex $entrybox 0] set entryLabel [lindex $entrybox 1] set entryField [lindex $entrybox 2] set entryScroll [lindex $entrybox 3] $entryFrame configure $entryLabel configure $entryField configure -textvariable queuesSelected -relief flat bind_entry_readonly $entryField pack forget $entryFrame pack $widget_name.label $entryFrame -anchor nw -side left -pady 1 pack $widget_name.iconize -side right -expand 1 -anchor e } proc fillJobsMiscFrame widget_name { global LABELFONT USER SERVER_HOSTS selv activeColor tk_version frame $widget_name.invoke -class CmdFrame frame $widget_name.criteria label $widget_name.spaces -font $LABELFONT -width 18 set m $widget_name.criteria.m menubutton $m -relief raised -bd 2 -font $LABELFONT -anchor w \ -menu $m.menu -text "Other Criteria" if {$tk_version >= 4.0} { $m configure -indicatoron 1 } menu $m.menu bind_button1 $m.menu set selv(menubox) $m.menu $m.menu add command -label $selv(owners_list) -font $LABELFONT \ -command { owners $selv(menubox) entryconfigure 0 -label $selv(owners_list) } $m.menu add command -label $selv(states) -font $LABELFONT \ -command { state $selv(menubox) entryconfigure 1 -label $selv(states) } $m.menu add command -label $selv(jname) -font $LABELFONT \ -command { jobname $selv(menubox) entryconfigure 2 -label $selv(jname) } $m.menu add command -label $selv(hold_list) -font $LABELFONT \ -command { hold $selv(menubox) entryconfigure 3 -label $selv(hold_list) } $m.menu add command -label $selv(acctname) -font $LABELFONT \ -command { acctname $selv(menubox) entryconfigure 4 -label $selv(acctname) } $m.menu add command -label $selv(checkpoint) -font $LABELFONT \ -command { checkpoint $selv(menubox) entryconfigure 5 -label $selv(checkpoint) } $m.menu add command -label $selv(exec_time) -font $LABELFONT \ -command { qtime $selv(menubox) entryconfigure 6 -label $selv(exec_time) } $m.menu add command -label $selv(reslist) -font $LABELFONT \ -command { res $selv(menubox) entryconfigure 7 -label $selv(reslist) } $m.menu add command -label $selv(priority) -font $LABELFONT \ -command { priority $selv(menubox) entryconfigure 8 -label $selv(priority) } $m.menu add command -label $selv(rerun) -font $LABELFONT \ -command { rerun $selv(menubox) entryconfigure 9 -label $selv(rerun) } if {$tk_version >= 4.0} { $m.menu configure -tearoff 0 } pack $m frame $widget_name.invoke.sel set filter_button [lindex \ [buildCmdButtons $widget_name.invoke.sel \ {{{filter "Select Jobs"}}} x 0 18 2 0 0] 1] pack $widget_name.invoke.sel -padx 10m pack $widget_name.spaces $widget_name.criteria $widget_name.invoke \ -side left -fill both $filter_button configure -command {getdata $SERVER_HOSTS 1} } proc fillJobsListFrame widget_name { global JOBS_COLUMN_LABEL JOBS_LISTBOX_WIDTH JOBS_LISTBOX_HEIGHT \ jobsListbox jobsSelMode jobsSelected \ tk_version perm_level frame $widget_name.header -borderwidth 1 frame $widget_name.box -borderwidth 1 set dim ${JOBS_LISTBOX_WIDTH}x${JOBS_LISTBOX_HEIGHT} set listBoxInfo [buildFullListbox $widget_name.box $dim $JOBS_COLUMN_LABEL yscroll] set jobsListbox [lindex $listBoxInfo 3] set jobsListboxSelButton [lindex $listBoxInfo 2] set jobsListboxLabel [lindex $listBoxInfo 1] $jobsListboxLabel configure -textvariable JOBS_COLUMN_LABEL $jobsListboxSelButton configure \ -textvariable jobsSelMode \ -command { if { [string compare "$jobsSelMode" "Select All"] == 0 } { if {$tk_version < 4.0} { $jobsListbox select from 0 $jobsListbox select to end } else { $jobsListbox select anchor 0 $jobsListbox select set anchor end } set jobsSelMode "Deselect All" set jobsSelected \ [get_keyvals $jobsListbox $JOBS_LISTBOX_KEY @ " " "select"] } else { if {$tk_version < 4.0} { $jobsListbox select clear } else { $jobsListbox select clear 0 end } set jobsSelMode "Select All" set jobsSelected "" } } frame $widget_name.b pack $widget_name.b set buttonList [list {detail "detail"} \ {modify modify..} \ {delete delete..} \ {hold hold..} \ {release release..} \ {signal signal..} \ {msg msg..} \ {move move..} \ {order order}] if { [string compare $perm_level "admin"] == 0 } { lappend buttonList {run run} {rerun rerun} } set cmdButtons [buildCmdButtons $widget_name.b \ [list $buttonList] y 0 9 1 1 0 0] set cmdButtonFrame [lindex $cmdButtons 0] set cmdButtonDetail [lindex $cmdButtons 1] set cmdButtonModify [lindex $cmdButtons 2] set cmdButtonDelete [lindex $cmdButtons 3] set cmdButtonHold [lindex $cmdButtons 4] set cmdButtonRelease [lindex $cmdButtons 5] set cmdButtonSignal [lindex $cmdButtons 6] set cmdButtonMsg [lindex $cmdButtons 7] set cmdButtonMove [lindex $cmdButtons 8] set cmdButtonOrder [lindex $cmdButtons 9] $cmdButtonDetail configure -command getJobsDetail $cmdButtonModify configure -command runQalter $cmdButtonDelete configure -command runDelete $cmdButtonHold configure -command runHold $cmdButtonRelease configure -command runRelease $cmdButtonSignal configure -command runQsig $cmdButtonMsg configure -command runQmsg $cmdButtonMove configure -command runQmove $cmdButtonOrder configure -command runQorder if { [string compare $perm_level "admin"] == 0 } { set cmdButtonRun [lindex $cmdButtons 10] set cmdButtonRerun [lindex $cmdButtons 11] $cmdButtonRun configure -command runRun $cmdButtonRerun configure -command runRerun } pack forget $cmdButtonFrame pack $widget_name.box $cmdButtonFrame -side left -anchor nw } ############################################################################### ### STATUS BAR Frame procedures # ############################################################################### proc fillStatusbarFrame widget_name { global infoBox INFOBOX_LISTBOX_WIDTH INFOBOX_LISTBOX_HEIGHT frame $widget_name.header -borderwidth 2 -height 10m -relief raised \ -class CmdFrame frame $widget_name.list -borderwidth 3 pack $widget_name.header -side top -fill x pack $widget_name.list -fill both -side bottom fillStatusbarHeaderFrame $widget_name.header set infoBox [lindex [buildFullListbox $widget_name.list \ ${INFOBOX_LISTBOX_WIDTH}x${INFOBOX_LISTBOX_HEIGHT} "" xscroll] 3] } ############################################################################### proc fillStatusbarHeaderFrame widget_name { global LABELFONT bitmap_dir label $widget_name.label -anchor nw -font $LABELFONT -text "INFO" \ -padx 1 -pady 1 button $widget_name.iconize -anchor c \ -bitmap @$bitmap_dir/iconize.bmp \ -command iconizeInfoView \ -padx 1 -pady 1 pack $widget_name.label -anchor nw -side left -pady 1 pack $widget_name.iconize -side right -expand 1 -anchor e } ############################################################################### ### MENU BAR Frame procedures # ############################################################################### proc fillMenubarFrame widget_name { global LABELFONT SERVER_HOSTS DATA_UPDATE_SEQ trackjob_button \ backgroundColor cmdButtonUpdAuto set cmdButtons [buildCmdButtons $widget_name \ { { {update_man "Manual Update"} \ {update_auto "Auto Update.."} } \ { {track "Track Job.."} } \ { {prefer "Preferences.."} } \ { {help "Help"} \ {about "About.."} } \ { {close "Close"} } } x 1 10 1 0 0 20] set cmdButtonFrame [lindex $cmdButtons 0] set cmdButtonUpdMan [lindex $cmdButtons 1] set cmdButtonUpdAuto [lindex $cmdButtons 2] set trackjob_button [lindex $cmdButtons 3] set cmdButtonPref [lindex $cmdButtons 4] set cmdButtonHelp [lindex $cmdButtons 5] set cmdButtonAbout [lindex $cmdButtons 6] set cmdButtonClose [lindex $cmdButtons 7] $cmdButtonUpdMan configure -width 14 \ -command { incr DATA_UPDATE_SEQ getdata $SERVER_HOSTS $cmdButtonUpdAuto configure -background $backgroundColor } $cmdButtonUpdAuto configure -width 14 -command {auto_upd} $trackjob_button configure -command trackjob -width 11 $cmdButtonPref configure -width 13 -command {pref} $cmdButtonClose configure -command { if [prefDoIt] { prefsave } exit } $cmdButtonHelp configure -command { xpbs_help main ""} $cmdButtonAbout configure -command { about } } torque-2.4.16/src/gui/state.tk0000664000113300011330000001631611272401236013074 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # state: defines the layout and functions of the select job state dialog box. proc state {} { global LABELFONT stateDialogBox activeWindow selv busy_cursor ## Bring up the standard Dialog box ## set stateDialogBox ".states" set dbox [popupDialogBox $stateDialogBox "Select Job States Criteria" 1 "" "" 1] set activeWindow($stateDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.s pack $dbox_top.s -padx 2m -pady 5m set checkbox [buildCheckboxes $dbox_top.s \ { {{rstate R} {qstate Q} {wstate W} \ {hstate H} {estate E} {tstate T}} } grid 5 "Job State MATCH"] set checkboxFrame [lindex $checkbox 0] set checkboxR [lindex $checkbox 1] set checkboxQ [lindex $checkbox 2] set checkboxW [lindex $checkbox 3] set checkboxH [lindex $checkbox 4] set checkboxE [lindex $checkbox 5] set checkboxT [lindex $checkbox 6] $checkboxR configure -variable selv(Rstate) -onvalue R \ -offvalue "" $checkboxQ configure -variable selv(Qstate) -onvalue Q \ -offvalue "" $checkboxW configure -variable selv(Wstate) -onvalue W \ -offvalue "" $checkboxH configure -variable selv(Hstate) -onvalue H \ -offvalue "" $checkboxE configure -variable selv(Estate) -onvalue E \ -offvalue "" $checkboxT configure -variable selv(Tstate) -onvalue T \ -offvalue "" ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.states $stateDialogBox} $cmdOk configure -command { set jstates "$selv(Rstate)$selv(Qstate)$selv(Wstate)$selv(Hstate)$selv(Estate)$selv(Tstate)" if {[string compare $jstates ""] == 0} { popupInfoBox $stateDialogBox "Please pick a job state." return } else { if { [string compare $jstates "RQWHET"] == 0 } { set selv(states) "Job_States: -ANY-" } else { set selv(states) "Job_States: $jstates" } } destroy $stateDialogBox } ## SET DEFAULT OPTION ### set arg [lindex $selv(states) 1] switch -regexp -- $arg { "-ANY-" { set selv(Rstate) R set selv(Qstate) Q set selv(Wstate) W set selv(Hstate) H set selv(Estate) E set selv(Tstate) T } "R|Q|W|H|E|T" { if [regexp "R" $arg] { set selv(Rstate) R } if [regexp "Q" $arg] { set selv(Qstate) Q } if [regexp "W" $arg] { set selv(Wstate) W } if [regexp "H" $arg] { set selv(Hstate) H } if [regexp "E" $arg] { set selv(Estate) E } if [regexp "T" $arg] { set selv(Tstate) T } } } register_default_action $stateDialogBox $cmdOk tkwait visibility $stateDialogBox remove_busy_cursor catch {tkwait window $stateDialogBox} set activeWindow($stateDialogBox) 0 } torque-2.4.16/src/gui/wmgr.tk0000664000113300011330000001203111272401236012716 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains window manager settings for manipulating the # top-level windows. # # Info: # Relative position of pixels on the display screen # # (+x,+y) o-----------o (-x,+y) # | | # | | # (+x,-y) o-----------o (-x,-y) # ################################################################################ proc set_wmgr {top_level_win} { global appname ;# the name of the application global bitmap_dir set grid_meas [wm grid $top_level_win] # The following is the requested measurements of the top-level window set basewidth [lindex $grid_meas 0] set baseheight [lindex $grid_meas 1] wm minsize $top_level_win $basewidth $baseheight ;# minimum size during interactive wm title $top_level_win $appname wm iconbitmap $top_level_win @$bitmap_dir/cyclist-only.xbm wm protocol $top_level_win WM_DELETE_WINDOW { if [prefDoIt] { prefsave } exit } } torque-2.4.16/src/gui/Makefile.in0000664000113300011330000006473611605403726013500 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(dist_xpbs_DATA) $(dist_xpbsbitmap_DATA) \ $(dist_xpbshelp_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/buildutils/config.mk subdir = src/gui ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(xpbsdir)" \ "$(DESTDIR)$(xpbsbitmapdir)" "$(DESTDIR)$(xpbshelpdir)" \ "$(DESTDIR)$(xpbsdir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; dist_xpbsDATA_INSTALL = $(INSTALL_DATA) dist_xpbsbitmapDATA_INSTALL = $(INSTALL_DATA) dist_xpbshelpDATA_INSTALL = $(INSTALL_DATA) nodist_xpbsDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_xpbs_DATA) $(dist_xpbsbitmap_DATA) $(dist_xpbshelp_DATA) \ $(nodist_xpbs_DATA) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter SUBDIRS = Ccode xpbsdir = $(XPBS_DIR) xpbsbitmapdir = $(xpbsdir)/bitmaps xpbshelpdir = $(xpbsdir)/help SUFFIXES = .src bin_SCRIPTS = xpbs nodist_xpbs_DATA = xpbsrc tclIndex CLEANFILES = xpbs xpbsrc tclIndex buildindex EXTRA_DIST = xpbs.src xpbsrc.src buildindex.src dist_xpbs_DATA = pbs.tcl preferences.tcl acctname.tk after_depend.tk \ auto_upd.tk before_depend.tk bindings.tk box.tk button.tk \ checkpoint.tk common.tk concur.tk datetime.tk email_list.tk \ entry.tk fileselect.tk hold.tk jobname.tk listbox.tk main.tk \ misc.tk owners.tk prefsave.tk pref.tk priority.tk qalter.tk \ qdel.tk qhold.tk qmove.tk qmsg.tk qrls.tk qsig.tk qsub.tk \ qterm.tk qtime.tk rerun.tk res.tk spinbox.tk staging.tk \ state.tk text.tk trackjob.tk wmgr.tk dist_xpbsbitmap_DATA = bitmaps/curve_down_arrow.bmp \ bitmaps/curve_up_arrow.bmp bitmaps/cyclist-only.xbm \ bitmaps/Downarrow.bmp bitmaps/hourglass.bmp \ bitmaps/iconize.bmp bitmaps/logo.bmp \ bitmaps/maximize.bmp bitmaps/sm_down_arrow.bmp \ bitmaps/sm_up_arrow.bmp bitmaps/Uparrow.bmp dist_xpbshelp_DATA = help/after_depend.hlp help/auto_update.hlp \ help/before_depend.hlp help/concur.hlp help/datetime.hlp \ help/delete.hlp help/email.hlp help/fileselect.hlp \ help/hold.hlp help/main.hlp help/message.hlp \ help/misc.hlp help/modify.hlp help/move.hlp \ help/notes.hlp help/preferences.hlp help/release.hlp \ help/select.acctname.hlp help/select.checkpoint.hlp \ help/select.hold.hlp help/select.jobname.hlp \ help/select.owners.hlp help/select.priority.hlp \ help/select.qtime.hlp help/select.rerun.hlp \ help/select.resources.hlp help/select.states.hlp \ help/signal.hlp help/staging.hlp help/submit.hlp \ help/terminate.hlp help/trackjob.hlp all: all-recursive .SUFFIXES: .SUFFIXES: .src $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gui/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/gui/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-dist_xpbsDATA: $(dist_xpbs_DATA) @$(NORMAL_INSTALL) test -z "$(xpbsdir)" || $(mkdir_p) "$(DESTDIR)$(xpbsdir)" @list='$(dist_xpbs_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_xpbsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbsdir)/$$f'"; \ $(dist_xpbsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbsdir)/$$f"; \ done uninstall-dist_xpbsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xpbs_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbsdir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsdir)/$$f"; \ done install-dist_xpbsbitmapDATA: $(dist_xpbsbitmap_DATA) @$(NORMAL_INSTALL) test -z "$(xpbsbitmapdir)" || $(mkdir_p) "$(DESTDIR)$(xpbsbitmapdir)" @list='$(dist_xpbsbitmap_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_xpbsbitmapDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbsbitmapdir)/$$f'"; \ $(dist_xpbsbitmapDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbsbitmapdir)/$$f"; \ done uninstall-dist_xpbsbitmapDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xpbsbitmap_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbsbitmapdir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsbitmapdir)/$$f"; \ done install-dist_xpbshelpDATA: $(dist_xpbshelp_DATA) @$(NORMAL_INSTALL) test -z "$(xpbshelpdir)" || $(mkdir_p) "$(DESTDIR)$(xpbshelpdir)" @list='$(dist_xpbshelp_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_xpbshelpDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbshelpdir)/$$f'"; \ $(dist_xpbshelpDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbshelpdir)/$$f"; \ done uninstall-dist_xpbshelpDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xpbshelp_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbshelpdir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbshelpdir)/$$f"; \ done install-nodist_xpbsDATA: $(nodist_xpbs_DATA) @$(NORMAL_INSTALL) test -z "$(xpbsdir)" || $(mkdir_p) "$(DESTDIR)$(xpbsdir)" @list='$(nodist_xpbs_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(nodist_xpbsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(xpbsdir)/$$f'"; \ $(nodist_xpbsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(xpbsdir)/$$f"; \ done uninstall-nodist_xpbsDATA: @$(NORMAL_UNINSTALL) @list='$(nodist_xpbs_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(xpbsdir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils $(distdir)/bitmaps $(distdir)/help @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(xpbsdir)" "$(DESTDIR)$(xpbsbitmapdir)" "$(DESTDIR)$(xpbshelpdir)" "$(DESTDIR)$(xpbsdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dist_xpbsDATA install-dist_xpbsbitmapDATA \ install-dist_xpbshelpDATA install-nodist_xpbsDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-binSCRIPTS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-dist_xpbsDATA \ uninstall-dist_xpbsbitmapDATA uninstall-dist_xpbshelpDATA \ uninstall-info-am uninstall-nodist_xpbsDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binSCRIPTS \ install-data install-data-am install-data-hook \ install-dist_xpbsDATA install-dist_xpbsbitmapDATA \ install-dist_xpbshelpDATA install-exec install-exec-am \ install-info install-info-am install-man \ install-nodist_xpbsDATA install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-dist_xpbsDATA uninstall-dist_xpbsbitmapDATA \ uninstall-dist_xpbshelpDATA uninstall-hook uninstall-info-am \ uninstall-nodist_xpbsDATA install_gui: install xpbs: $(srcdir)/xpbs.src sed -e 's,#\!.*wish.*$$,#\!@WISH_PROG@,;' \ -e 's,set *libdir.*$$,set libdir $(xpbsdir),' \ -e 's,set *appdefdir.*$$,set appdefdir $(xpbsdir),' \ -e 's,set *xpbs_datadump.*$$,set xpbs_datadump $(program_prefix)xpbs_datadump$(program_suffix),' \ -e 's,set *xpbs_scriptload.*$$,set xpbs_scriptload $(program_prefix)xpbs_scriptload$(program_suffix),' \ -e 's,RSH_PATH,$(RSH_PATH),' \ $? > $@ xpbsrc: $(srcdir)/xpbsrc.src sed -e 's,\*serverHosts:.*$$,\*serverHosts: $(PBS_DEFAULT_SERVER),;' \ -e ' s,\*selectHosts:.*$$,\*selectHosts: $(PBS_DEFAULT_SERVER),' \ $? > $@ buildindex: $(srcdir)/buildindex.src @echo Processing buildindex @sed -e 's,#\!.*tclsh.*$$,#\!@TCLSH_PROG@,' $? > $@ @chmod +x $@ tclIndex: $(dist_xpbs_DATA) buildindex @echo Running buildindex \(locally\) @./buildindex $(srcdir) . install-data-hook: $(INSTALL_SCRIPT) buildindex $(DESTDIR)$(XPBS_DIR)/buildindex rm -f $(DESTDIR)$(XPBS_DIR)/tclIndex cd $(DESTDIR)$(XPBS_DIR) && ./buildindex $(DESTDIR)$(XPBS_DIR) . $(DESTDIR) chmod 644 $(DESTDIR)$(XPBS_DIR)/tclIndex uninstall-hook: rm -f $(DESTDIR)$(XPBS_DIR)/buildindex # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/gui/box.tk0000664000113300011330000007167511272401236012555 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # NOTE: we restrict to one element keys only for efficiency! proc box {frame_name {args}} { set boxName [string trim $frame_name "."] global $boxName sysinfo LABELFONT disabledColor set configure 0 set argc [llength $args] for {set i 0} {$i < $argc} {incr i} { switch -exact -- [lindex $args $i] { configure { set configure 1 } -title { set [set boxName](title) [lindex $args [incr i]] } title { if { ![info exists [set boxName](title)]} { return "" } return [set [set boxName](title)] } -class { set [set boxName](class) [lindex $args [incr i]] } class { if { ![info exists [set boxName](class)]} { return Plain } return [set [set boxName](class)] } titlelabel { if { ![info exists [set boxName](titlelabel)]} { return "" } return [set [set boxName](titlelabel)] } -key { set [set boxName](key) [lindex $args [incr i]] } key { if { ![info exists [set boxName](key)]} { return 0 } return [set [set boxName](key)] } -entrylabels { set [set boxName](entrylabels) [lindex $args [incr i]] } entrylabels { if { ![info exists [set boxName](entrylabels)]} { return "" } return [set [set boxName](entrylabels)] } -lboxlabels { set [set boxName](lboxlabels) [lindex $args [incr i]] } lboxlabels { if { ![info exists [set boxName](lboxlabels)]} { return "" } return [set [set boxName](lboxlabels)] } -lboxwidths { set [set boxName](lboxwidths) [lindex $args [incr i]] } lboxwidths { if { ![info exists [set boxName](lboxwidths)]} { return 0 } return [set [set boxName](lboxwidths)] } -lboxheights { set [set boxName](lboxheights) [lindex $args [incr i]] } lboxheights { if { ![info exists [set boxName](lboxheights)]} { return 0 } return [set [set boxName](lboxheights)] } -orient { set [set boxName](orient) [lindex $args [incr i]] } orient { if { ![info exists [set boxName](orient)]} { return "x" } return [set [set boxName](orient)] } -grabBox { set [set boxName](grabBox) [lindex $args [incr i]] } grabBox { if { ![info exists [set boxName](grabBox)]} { return "" } return [set [set boxName](grabBox)] } -selindex { set [set boxName](selindex) [lindex $args [incr i]] } selindex { if { ![info exists [set boxName](selindex)]} { return -1 } return [set [set boxName](selindex)] } vscroll { if { ![info exists [set boxName](vscroll)]} { return "" } return [set [set boxName](vscroll)] } ncols { if { ![info exists [set boxName](ncols)]} { return 1 } return [set [set boxName](ncols)] } -nrows { set lbox [box $frame_name lbox 0] if { [string compare $lbox ""] != 0 } { set [set boxName](nrows) [$lbox size] } incr [set boxName](nrows) [lindex $args [incr i]] return [set [set boxName](nrows)] } nrows { set lbox [box $frame_name lbox 0] if { [string compare $lbox ""] == 0 } { return 0 } set [set boxName](nrows) [$lbox size] return [set [set boxName](nrows)] } lbox { set index [lindex $args [incr i]] if {![info exists [set boxName](lbox,$index)]} { return "" } return [set [set boxName](lbox,$index)] } entry { set index [lindex $args [incr i]] if {![info exists [set boxName](entry,$index)]} { return "" } return [set [set boxName](entry,$index)] } firstNonMenuEntry { if { ![info exists [set boxName](firstentry)]} { return "" } return [set [set boxName](firstentry)] } -array { set index [lindex $args [incr i]] set eval [lindex $args [incr i]] set [set boxName](array,$index) $eval } array { set index [lindex $args [incr i]] if {![info exists [set boxName](array,$index)]} { return "" } return [set [set boxName](array,$index)] } arrayReIndex { set index [lindex $args [incr i]] set startindex [lindex $args [incr i]] if {![info exists [set boxName](array,$index)]} { return } set a [set [set boxName](array,$index)] global $a set size [array size $a] for {set i $startindex} {$i < [expr $size-1]} {incr i} { set [set a]($i) [set [set a]([expr $i+1])] } if {$size > 0} { catch {unset [set a]([expr $size-1])} } return } shrinkArray { set nrows [box $frame_name nrows] for {set s1 0} {$s1 < $nrows} {incr s1} { set isEmpty 1 set ncols [box $frame_name ncols] for {set s2 0} {$s2 < $ncols} {incr s2} { set a [set [set boxName](array,$s2)] global $a if {[info exists [set a]($s1)] && \ [string compare [set [set a]($s1)] ""] != 0} { set isEmpty 0 } } if {$isEmpty} { for {set s2 0} {$s2 < $ncols} {incr s2} { box $frame_name arrayReIndex $s2 $s1 } set nrows [expr $nrows - 1] set s1 [expr $s1 - 1] } } return } -entryval { set index [lindex $args [incr i]] set eval [lindex $args [incr i]] set [set boxName](entryval,$index) $eval return [set [set boxName](entryval,$index)] } entryval { set index [lindex $args [incr i]] if {![info exists [set boxName](entryval,$index)]} { return "" } return [set [set boxName](entryval,$index)] } -entryvalDeleted { set index [lindex $args [incr i]] set eval [lindex $args [incr i]] set [set boxName](entryvalDeleted,$index) $eval return [set [set boxName](entryvalDeleted,$index)] } entryvalDeleted { set index [lindex $args [incr i]] if {![info exists [set boxName](entryvalDeleted,$index)]} { return "" } return [set [set boxName](entryvalDeleted,$index)] } -noUpdateButton { set [set boxName](noUpdateButton) [lindex $args [incr i]] } noUpdateButton { if { ![info exists [set boxName](noUpdateButton)]} { return 0 } return [set [set boxName](noUpdateButton)] } -env { set [set boxName](env) [lindex $args [incr i]] } env { if { ![info exists [set boxName](env)]} { return 0 } return [set [set boxName](env)] } -addCmd { set [set boxName](addCmd) [lindex $args [incr i]] } addCmd { if { ![info exists [set boxName](addCmd)]} { return "" } return [set [set boxName](addCmd)] } -remCmd { set [set boxName](remCmd) [lindex $args [incr i]] } remCmd { if { ![info exists [set boxName](remCmd)]} { return "" } return [set [set boxName](remCmd)] } -checkbutton { set [set boxName](checkbutton) [lindex $args [incr i]] } checkbutton { if { ![info exists [set boxName](checkbutton)]} { return "" } return [set [set boxName](checkbutton)] } -cmdbutton { set [set boxName](cmdbutton) [lindex $args [incr i]] } cmdbutton { if { ![info exists [set boxName](cmdbutton)]} { return "" } return [set [set boxName](cmdbutton)] } -menuEntry { set [set boxName](menuEntry) [lindex $args [incr i]] } menuEntry { if { ![info exists [set boxName](menuEntry)]} { return "" } return [set [set boxName](menuEntry)] } -cleanstrExceptChar { set index [lindex $args [incr i]] set eval [lindex $args [incr i]] set [set boxName](cleanstrExceptChar,$index) $eval } cleanstrExceptChar { set index [lindex $args [incr i]] if {![info exists [set boxName](cleanstrExceptChar,$index)]} { return "" } return [set [set boxName](cleanstrExceptChar,$index)] } updateButton { if { ![info exists [set boxName](updateButton)]} { return "" } return [set [set boxName](updateButton)] } labelWidgets { if { ![info exists [set boxName](labelWidgets)]} { return "" } return [set [set boxName](labelWidgets)] } rcButtonWidgets { if { ![info exists [set boxName](rcButtonWidgets)]} { return "" } return [set [set boxName](rcButtonWidgets)] } buttonWidgets { if { ![info exists [set boxName](buttonWidgets)]} { return "" } return [set [set boxName](buttonWidgets)] } entryWidgets { if { ![info exists [set boxName](entryWidgets)]} { return "" } return [set [set boxName](entryWidgets)] } menuEntryWidgets { if { ![info exists [set boxName](menuEntryWidgets)]} { return "" } return [set [set boxName](menuEntryWidgets)] } listboxWidgets { if { ![info exists [set boxName](listboxWidgets)]} { return "" } return [set [set boxName](listboxWidgets)] } scrollWidgets { if { ![info exists [set boxName](scrollWidgets)]} { return "" } return [set [set boxName](scrollWidgets)] } disable { set labels [box $frame_name labelWidgets] foreach l $labels { if {[string compare $l ""] == 0} { break } disable_label $l $disabledColor } set rcButtons [box $frame_name rcButtonWidgets] foreach b $rcButtons { if {[string compare $b ""] == 0} { break } disable_rcbutton $b } set buttons [box $frame_name buttonWidgets] foreach b $buttons { if {[string compare $b ""] == 0} { break } disable_button $b } set entries [box $frame_name entryWidgets] foreach e $entries { if {[string compare $e ""] == 0} { break } eval disable_fullentry $e } set entries [box $frame_name menuEntryWidgets] foreach e $entries { if {[string compare $e ""] == 0} { break } menuEntry $e disable } set lboxes [box $frame_name listboxWidgets] foreach l $lboxes { if {[string compare $l ""] == 0} { break } lappend l 0 eval disable_listbox $l } set scrolls [box $frame_name scrollWidgets] foreach s $scrolls { if {[string compare $s ""] == 0} { continue } eval disable_scrollbar $s $disabledColor } return } enable { set labels [box $frame_name labelWidgets] foreach l $labels { if {[string compare $l ""] == 0} { break } enable_label $l } set rcButtons [box $frame_name rcButtonWidgets] foreach b $rcButtons { if {[string compare $b ""] == 0} { break } enable_rcbutton $b } set buttons [box $frame_name buttonWidgets] foreach b $buttons { if {[string compare $b ""] == 0} { break } enable_button $b } set entries [box $frame_name entryWidgets] foreach e $entries { if {[string compare $e ""] == 0} { break } eval enable_fullentry $e } set entries [box $frame_name menuEntryWidgets] foreach e $entries { if {[string compare $e ""] == 0} { break } menuEntry $e enable } set lboxes [box $frame_name listboxWidgets] foreach l $lboxes { if {[string compare $l ""] == 0} { break } lappend l "" eval enable_listbox $l } set scrolls [box $frame_name scrollWidgets] foreach s $scrolls { if {[string compare $s ""] == 0} { continue } eval enable_scrollbar $s } return } create { catch {unset $boxName} } unset { catch {unset $boxName} return } getBoxArray { return "[set boxName]" } } } # create one frame to hold everything set f $frame_name if { ![info exists sysinfo(boxes)] || \ [lsearch -exact $sysinfo(boxes) $f] == -1 } { lappend sysinfo(boxes) $f } frame $f.t -class CmdFrame -relief raised -borderwidth 2 frame $f.b -relief flat frame $f.b.e -relief flat frame $f.b.l -relief ridge -bd 4 frame $f.b.b -relief flat set titlelabel [box $f title] if {[string compare $titlelabel ""] != 0} { label $f.t.label -text $titlelabel -justify left -font $LABELFONT \ -width [string length $titlelabel] -padx 0 -pady 0 lappend [set boxName](labelWidgets) $f.t.label set cbuttonp [box $f checkbutton] if {[string compare $cbuttonp ""] != 0} { set cbuttonl [lindex $cbuttonp 0] set cbuttona [lindex $cbuttonp 1] global $cbuttona checkbutton $f.t.cbutton -relief flat \ -anchor nw -text $cbuttonl -padx 0 \ -pady 4m -variable $cbuttona -font $LABELFONT lappend [set boxName](rcButtonWidgets) $f.t.cbutton pack forget $f.t.cbutton pack $f.t.cbutton -anchor nw -side right -padx 0 -pady 0 } set menu [box $f menuEntry] if {[string compare $menu ""] != 0} { set resnames [lindex $menu 0] set cmd [lindex $menu 1] set labelprefix [lindex $menu 2] frame $f.t.menu set [set boxName](helpvariable) \ "help-[lindex [lindex [join $resnames] 0] 1]" menuEntry $f.t.menu create -menuvalues $resnames \ -title "" -command $cmd -noDFLT 1 \ -prefix $labelprefix \ -textvariable [set boxName](helpvariable) lappend [set boxName](menuEntryWidgets) $f.t.menu pack forget $f.t.menu pack $f.t.menu -anchor nw -side right } set cbuttonp [box $f cmdbutton] if {[string compare $cbuttonp ""] != 0} { set cbuttonl [lindex $cbuttonp 0] set cbuttonc [lindex $cbuttonp 1] button $f.t.cmd -relief raised \ -anchor nw -text $cbuttonl -padx 0 \ -command $cbuttonc -font $LABELFONT lappend [set boxName](buttonWidgets) $f.t.cmd pack forget $f.t.cmd pack $f.t.cmd -anchor nw -side right -padx 0 -pady 0 } set [set boxName](titlelabel) $f.t.label pack $f.t.label -anchor nw -side left -expand 1 -fill both -padx 0 -pady 0 } ## build the entry widget ## build the add button button $f.b.e.add -text add -height 2 -font $LABELFONT \ -command "boxAdd $f \"[box $f addCmd]\"" lappend [set boxName](buttonWidgets) $f.b.e.add if {[string compare [box $f orient] x] == 0 || \ [string compare [box $f orient] xy] == 0} { pack $f.b.e.add -side right -anchor c -pady 1m -padx 2m } else { pack $f.b.e.add -side bottom -anchor c -pady 1m } set k 0 set packlist "" set entrylabels [box $f entrylabels] set lboxwidths [box $f lboxwidths] set lboxheights [box $f lboxheights] foreach labelinfo $entrylabels { set elabel [lindex $labelinfo 0] set type [lindex $labelinfo 1] set args [lrange $labelinfo 2 end] frame $f.b.e.$k switch -exact -- $type { MENU_ENTRY { menuEntry $f.b.e.$k create -menuvalues $args -title $elabel \ -textvariable [set boxName](entryval,$k) lappend [set boxName](menuEntryWidgets) $f.b.e.$k set [set boxName](entry,$k) "" } default { set lboxwidth [lindex $lboxwidths $k] set einfo [buildFullEntrybox $f.b.e.$k [string length $elabel] \ $elabel $lboxwidth "" bottom 0 top] set eframew [lindex $einfo 0] set elabelw [lindex $einfo 1] set eentryw [lindex $einfo 2] set escroll [lindex $einfo 3] lappend [set boxName](entryWidgets) \ "$elabelw $eentryw $escroll" global sel$eentryw set sel$eentryw 0 set [set boxName](firstentry) $eentryw $eentryw configure -textvariable [set boxName](entryval,$k) $elabelw configure -anchor nw set [set boxName](entry,$k) $eentryw bind_entry_overselect $eentryw register_default_action $eentryw $f.b.e.add } } set packlist "$packlist $f.b.e.$k" incr k } set [set boxName](ncols) $k set [set boxName](nrows) 0 if {[string compare packlist ""] != 0} { eval pack [string trim $packlist] -side left -anchor nw } boxSetTabbing $f # build the listbox set packlist "" set k 0 set lboxlabels [box $f lboxlabels] set llen [llength $lboxlabels] foreach llabel $lboxlabels { frame $f.b.l.$k set lboxwidth [lindex $lboxwidths $k] set lboxheight [lindex $lboxheights $k] if {[expr $k + 1] != $llen} { set listBoxInfo [buildFullListbox $f.b.l.$k \ ${lboxwidth}x${lboxheight} $llabel xscroll 0 0] } else { set listBoxInfo [buildFullListbox $f.b.l.$k \ ${lboxwidth}x${lboxheight} $llabel xyscroll 0 0] set [set boxName](vscroll) [lindex $listBoxInfo 4] } set hostsOtherScroll [lrange $listBoxInfo 5 end] set hostsListboxScroll [lindex $listBoxInfo 4] set hostsListbox [lindex $listBoxInfo 3] set hostsListboxSelButton [lindex $listBoxInfo 2] set hostsListboxLabel [lindex $listBoxInfo 1] lappend [set boxName](listboxWidgets) \ "$hostsListbox $hostsListboxLabel {} $hostsListboxScroll" lappend [set boxName](scrollWidgets) $hostsOtherScroll bind_listbox_single_select $hostsListbox bind_listbox_select $hostsListbox $f set [set boxName](lbox,$k) $hostsListbox set packlist "$packlist $f.b.l.$k" incr k } if {[string compare packlist ""] != 0} { eval pack [string trim $packlist] -side left -anchor nw } boxSetScroll $f ## build the buttons set noUpdateButton [box $f noUpdateButton] if {$noUpdateButton} { set buttonList [list {delete "delete"}] } else { set buttonList [list {delete "delete"} {info "update"}] } set cmdButtons [buildCmdButtons $f.b.b [list $buttonList] y 0 11 1 1 0 0] set cmdButtonFrame [lindex $cmdButtons 0] set cmdButtonDelete [lindex $cmdButtons 1] lappend [set boxName](buttonWidgets) $cmdButtonDelete if {!$noUpdateButton} { set cmdButtonUpd [lindex $cmdButtons 2] set [set boxName](updateButton) $cmdButtonUpd $cmdButtonUpd configure -command "boxUpdate $f" lappend [set boxName](buttonWidgets) $cmdButtonUpd } $cmdButtonDelete configure -command "boxDelete $f \"[box $f remCmd]\"" if {[string compare [box $f orient] x] == 0} { pack $f.b.e -side left -anchor nw pack $f.b.l $f.b.b -side left -anchor nw } else { pack $f.b.e -side top -anchor nw -pady 0 -padx 0 pack $f.b.l $f.b.b -side left -after $f.b.e -pady 3m -anchor nw -padx 0 } pack $f.t -anchor nw -side top -fill both -expand 1 pack $f.b -anchor nw -side top -fill none -expand 0 } proc boxesUnset {} { global sysinfo if [info exists sysinfo(boxes)] { foreach b $sysinfo(boxes) { box $b unset } } set sysinfo(boxes) "" } # returns 1 if an item has been added; 0 otherwise. proc boxAdd {frame_name {addfunc ""} {insertIdx end}} { global tk_version set entrylabels [box $frame_name entrylabels] set keylist [box $frame_name key] set ncols [box $frame_name ncols] set keyval "" set keys "" for {set i 0} {$i < $ncols} {incr i} { box $frame_name -entryval $i \ [cleanstr [box $frame_name entryval $i] \ [box $frame_name cleanstrExceptChar $i]] set kindex [lsearch -regexp $keylist "(^| )$i"] if {$kindex != -1} { set entryval [box $frame_name entryval $i] if {[string compare $entryval ""] == 0} { set entrylab [lindex $entrylabels $i] set entryw [box $frame_name entry $i] popupInfoBox [box $frame_name grabBox] \ "Can't have an empty \"$entrylab\" entry!!!" \ 500 $entryw return 0 } set klist [split [lindex $keylist $kindex] ":"] set k [lindex $klist 0] lappend keys $k set kmatchval [lindex $klist 1] lappend keyval $entryval if {[string compare $kmatchval ""] != 0 && \ [regexp "^($kmatchval)$" $entryval]} { set kunique($k) 1 } else { set kunique($k) 0 } } } set nrows [box $frame_name nrows] for {set i 0} {$i < $nrows} {incr i} { set boxval "" for {set j 0} {$j < $ncols} {incr j} { if {[lsearch -exact $keys $j] != -1} { set entryv [box $frame_name entryval $j] set entryw [box $frame_name entryval $j] set lbox [box $frame_name lbox $j] if {$kunique($j)} { if {![lboxvalue_isUnique $lbox $entryv]} { popupInfoBox [box $frame_name grabBox] \ "\"$entryv\" already specified in one of the fields!" 500 $entryw return 0 } } lappend boxval [$lbox get $i] } } if {[string compare $keyval ""] != 0 && \ [lcomp $keyval $boxval] == 0} { popupInfoBox [box $frame_name grabBox] \ "Unable to add entry: key \"[concat $keyval]\" was duplicated!" 500 [box $frame_name firstNonMenuEntry] return 0 } } for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] set entry [box $frame_name entry $i] global sel$entry set entryval [box $frame_name entryval $i] $lbox insert $insertIdx $entryval set lboxidx $insertIdx if {[string compare $insertIdx end] == 0} { set lboxidx [expr [$lbox size] - 1] } set a [box $frame_name array $i] if { [string compare $a ""] != 0 } { global $a set [set a]($lboxidx) $entryval } set sel$entry 1 } box $frame_name -nrows +1 boxSelect $frame_name $insertIdx if {[string compare $addfunc ""] != 0} { eval $addfunc } return 1 } proc boxDelete {frame_name {remfunc ""}} { for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] set selindex [$lbox curselection] if {[string compare $selindex ""] != 0} { box $frame_name -entryvalDeleted $i [$lbox get $selindex] $lbox delete $selindex box $frame_name arrayReIndex $i $selindex boxSelect $frame_name $selindex } } box $frame_name -nrows -1 if {[string compare $remfunc ""] != 0} { eval $remfunc } } proc boxUpdate {frame_name} { set ncols [box $frame_name ncols] for {set i 0} {$i < $ncols} {incr i} { set lbox [box $frame_name lbox $i] set selindex [$lbox curselection] if {[string compare $selindex ""] != 0} { box $frame_name -entryvalDeleted $i [$lbox get $selindex] $lbox delete $selindex } } set add 0 if {[string compare $selindex ""] != 0} { set add [boxAdd $frame_name [box $frame_name addCmd] $selindex] if {!$add} { for {set i 0} {$i < $ncols} {incr i} { set lbox [box $frame_name lbox $i] set val [box $frame_name entryvalDeleted $i] $lbox insert $selindex $val box $frame_name -entryvalDeleted $i "" } } boxSelect $frame_name $selindex } } proc boxGetCurselect {frame_name index} { set selindex [box $frame_name selindex] if {$selindex == -1} { return } set lbox [box $frame_name lbox $index] catch {$lbox get $selindex} value return $value } proc boxSelect {frame_name index} { global tk_version set nrows [box $frame_name nrows] if { $index == -1 } { set lbox [box $frame_name lbox 0] global cmd$lbox if [info exists cmd$lbox] { eval [set cmd$lbox] } return } set boxName [box $frame_name getBoxArray] global $boxName set [set boxName](selindex) $index set selindex $index for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] set entry [box $frame_name entry $i] if { $tk_version < 4.0 } { $lbox select from $selindex } else { catch {$lbox selection clear [$lbox curselection]} $lbox select set $selindex $selindex } $lbox see $selindex set boxval [$lbox get $selindex] if {[string compare $boxval ""] != 0} { box $frame_name -entryval $i $boxval } if {$i == 0 && [string compare $entry ""] != 0} { focus $entry $entry select from 0 $entry select to end if {$tk_version >= 4.0} { $entry xview moveto 1 } } global cmd$lbox if [info exists cmd$lbox] { eval [set cmd$lbox] } } } proc boxSetScroll {frame_name} { global tk_version set vscroll [box $frame_name vscroll] if {[string compare $vscroll ""] == 0} { return } set lboxes "" for {set i 0} {$i < [box $frame_name ncols]} {incr i} { set lbox [box $frame_name lbox $i] $lbox configure -yscrollcommand "$vscroll set" lappend lboxes $lbox } $vscroll configure -command "boxAdjScrollView [list $lboxes]" } proc boxSetTabbing {f} { for {set i 0} {$i < [box $f ncols]} {incr i} { set entry [box $f entry $i] if {[string compare $entry ""] == 0} { continue } set nentry [box $f entry [expr $i+1]] if {[string compare $nentry ""] == 0} { set nentry $entry } set pentry [box $f entry [expr $i-1]] if {[string compare $pentry ""] == 0} { set pentry $entry } bind_entry_tab $entry $nentry $pentry [box $f env] } } proc boxAdjScrollView {args} { set lboxes [lindex $args 0] set params [lrange $args 1 end] foreach b $lboxes { eval $b yview $params } } # ReLoad the box with values from its array variables proc boxLoad {f {entryInit 1}} { box $f shrinkArray for {set i 0} {$i < [box $f ncols]} {incr i} { set a [box $f array $i] set lbox [box $f lbox $i] $lbox delete 0 end global $a for {set j 0} {$j < [array size $a]} {incr j} { $lbox insert end [set [set a]($j)] } if {$entryInit} { box $f -entryval $i "" } } } torque-2.4.16/src/gui/priority.tk0000664000113300011330000001772711272401236013644 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # priority: defines the layout and functions of the select priority criteria # dialog box. proc priority {} { global LABELFONT priorityDialogBox activeWindow selv busy_cursor ## Bring up the standard Dialog box ## set priorityDialogBox ".priority" set dbox [popupDialogBox $priorityDialogBox "Select Priority Criteria" 1 "" "" 1] set activeWindow($priorityDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom \ {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.priority $priorityDialogBox} $cmdOk configure -command { set operator [oper $selv(priority_op)] if { [string compare $operator ""] == 0 } { popupInfoBox $priorityDialogBox "Please specify the operator." return } switch -exact -- $selv(priority_option) { priority { if {[string compare $selv(priority_val) ""] == 0} { popupInfoBox $priorityDialogBox "Please select a priority value." return } set selv(priority) "Priority: [oper $selv(priority_op)]$selv(priority_val)" } ANY { set selv(priority) "Priority: -ANY-" } } destroy $priorityDialogBox } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.c frame $dbox_top.c.op frame $dbox_top.c.val frame $dbox_top.c.val.priority frame $dbox_top.c.dummy -relief groove -borderwidth 3 set spin [buildSpinbox $dbox_top.c.op 2 [list = != >= > <= <] selv \ priority_op "" "left" =] set priorityOpFrame [lindex $spin 0] set selv(priorityOpEntry) [lindex $spin 1] global vlist.$selv(priorityOpEntry) vlist.selv.priority_op register_default_action $selv(priorityOpEntry) $cmdOk set spinBox [buildSpinbox $dbox_top.c.val.priority 5 -1024-1023 selv \ priority_val "" "" 0] set priorityValFrame [lindex $spinBox 0] set selv(priorityValEntry) [lindex $spinBox 1] set selv(priorityValScroll) [lindex $spinBox 2] set selv(priorityValLabel) [lindex $spinBox 3] register_default_action $selv(priorityValEntry) $cmdOk set radioList [list [concat priority \"value\" $priorityValFrame] \ {a "ANY"} ] set rbox [buildRadioboxes $dbox_top.c.val [list $radioList] \ column 0 ""] set rboxFrame [lindex $rbox 0] set rboxPriority [lindex $rbox 1] set rboxANY [lindex $rbox 2] $rboxPriority configure -variable selv(priority_option) -value priority -command { enable_spinbox $selv(priorityValEntry) $selv(priorityValScroll) \ $selv(priorityValLabel) set vlist.$selv(priorityOpEntry) [list = != >= > <= <] set vlist.selv.priority_op [list = != >= > <= <] } $rboxANY configure -variable selv(priority_option) -value ANY -command { disable_spinbox $selv(priorityValEntry) $selv(priorityValScroll) \ $selv(priorityValLabel) set vlist.$selv(priorityOpEntry) [list =] set selv(priority_op) "=" set vlist.selv.priority_op "=" } ## PACK the FRAMES label $dbox_top.c.l -text "Priority" -font $LABELFONT pack $rboxFrame -in $dbox_top.c.dummy -padx 3 -pady 3 raise $rboxFrame $dbox_top.c.dummy pack $dbox_top.c.l $priorityOpFrame $dbox_top.c.dummy -side left -anchor nw \ -padx 5 pack $priorityOpFrame $rboxFrame -side left -anchor nw pack $dbox_top.header $dbox_top.c $dbox_top.footer -padx 5m set priority_arg [lindex $selv(priority) 1] switch -regexp -- $priority_arg { "-ANY-" {$rboxANY invoke} default {$rboxPriority invoke} } register_default_action $priorityDialogBox $cmdOk tkwait visibility $priorityDialogBox remove_busy_cursor catch {tkwait window $priorityDialogBox} set activeWindow($priorityDialogBox) 0 } torque-2.4.16/src/gui/Ccode/0000777000113300011330000000000011614035201012477 500000000000000torque-2.4.16/src/gui/Ccode/Makefile.in0000664000113300011330000004745611605403725014514 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(xpbs_datadump_SOURCES) $(xpbs_scriptload_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk xpbsbin_PROGRAMS = xpbs_datadump$(EXEEXT) xpbs_scriptload$(EXEEXT) subdir = src/gui/Ccode ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(xpbsbindir)" xpbsbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(xpbsbin_PROGRAMS) am_xpbs_datadump_OBJECTS = xpbs_datadump.$(OBJEXT) xpbs_datadump_OBJECTS = $(am_xpbs_datadump_OBJECTS) xpbs_datadump_LDADD = $(LDADD) am__DEPENDENCIES_1 = ../../lib/Libpbs/libtorque.la xpbs_datadump_DEPENDENCIES = $(am__DEPENDENCIES_1) am_xpbs_scriptload_OBJECTS = xpbs_scriptload.$(OBJEXT) xpbs_scriptload_OBJECTS = $(am_xpbs_scriptload_OBJECTS) xpbs_scriptload_LDADD = $(LDADD) xpbs_scriptload_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(xpbs_datadump_SOURCES) $(xpbs_scriptload_SOURCES) DIST_SOURCES = $(xpbs_datadump_SOURCES) $(xpbs_scriptload_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter PBS_LIBS = ../../lib/Libpbs/libtorque.la xpbsbindir = $(XPBS_DIR)/bin LDADD = $(PBS_LIBS) xpbs_datadump_SOURCES = xpbs_datadump.c xpbs_scriptload_SOURCES = xpbs_scriptload.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gui/Ccode/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/gui/Ccode/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-xpbsbinPROGRAMS: $(xpbsbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(xpbsbindir)" || $(mkdir_p) "$(DESTDIR)$(xpbsbindir)" @list='$(xpbsbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(xpbsbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(xpbsbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(xpbsbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(xpbsbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-xpbsbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(xpbsbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(xpbsbindir)/$$f'"; \ rm -f "$(DESTDIR)$(xpbsbindir)/$$f"; \ done clean-xpbsbinPROGRAMS: @list='$(xpbsbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done xpbs_datadump$(EXEEXT): $(xpbs_datadump_OBJECTS) $(xpbs_datadump_DEPENDENCIES) @rm -f xpbs_datadump$(EXEEXT) $(LINK) $(xpbs_datadump_LDFLAGS) $(xpbs_datadump_OBJECTS) $(xpbs_datadump_LDADD) $(LIBS) xpbs_scriptload$(EXEEXT): $(xpbs_scriptload_OBJECTS) $(xpbs_scriptload_DEPENDENCIES) @rm -f xpbs_scriptload$(EXEEXT) $(LINK) $(xpbs_scriptload_LDFLAGS) $(xpbs_scriptload_OBJECTS) $(xpbs_scriptload_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpbs_datadump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpbs_scriptload.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(xpbsbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-xpbsbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-xpbsbinPROGRAMS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-xpbsbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-xpbsbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip install-xpbsbinPROGRAMS installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-xpbsbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/gui/Ccode/xpbs_scriptload.c0000664000113300011330000006116211375011546016001 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * xpbs_scriptload - parses a job script file, separating PBS directive * from non-PBS lines. Job attributes are reported to stdout, * and non-PBS lines are shown in script_tmp. This code * is a modification of "qsub". * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California * * Albeaus Bayucan * Sterling Software * NASA Ames Research Center */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef sun #include #endif /* sun */ #if defined(HAVE_SYS_IOCTL_H) #include #endif /* HAVE_SYS_IOCTL_H */ #if !defined(sgi) && !defined(_AIX) && !defined(linux) #include #endif /* ! sgi */ #include "cmds.h" #define MAX_QSUB_PREFIX_LEN 32 #ifndef PBS_DEPEND_LEN #define PBS_DEPEND_LEN 2040 #endif static char PBS_DPREFIX_DEFAULT[] = "#PBS"; /* globals */ int inter_sock; struct termios oldtio; struct winsize wsz; struct attrl *attrib = NULL; char *new_jobname; /* return from submit request */ char dir_prefix[MAX_QSUB_PREFIX_LEN+1]; char path_out[MAXPATHLEN+1]; char destination[PBS_MAXDEST]; /* state booleans for protecting already-set options */ int a_opt = FALSE; int c_opt = FALSE; int e_opt = FALSE; int h_opt = FALSE; int j_opt = FALSE; int k_opt = FALSE; int l_opt = FALSE; int m_opt = FALSE; int o_opt = FALSE; int p_opt = FALSE; int q_opt = FALSE; int r_opt = FALSE; int u_opt = FALSE; int v_opt = FALSE; int z_opt = FALSE; int A_opt = FALSE; int C_opt = FALSE; int M_opt = FALSE; int N_opt = FALSE; int S_opt = FALSE; int V_opt = FALSE; int Depend_opt = FALSE; int Interact_opt = FALSE; int Stagein_opt = FALSE; int Stageout_opt = FALSE; int Grouplist_opt = FALSE; char *v_value = NULL; char * set_dir_prefix(char *prefix, int diropt) { char *s; if (notNULL(prefix)) return(prefix); else if (diropt == TRUE) return(""); else if ((s = getenv("PBS_DPREFIX")) != NULL) return(s); else return(PBS_DPREFIX_DEFAULT); } int isexecutable(char *s) { char *c; c = s; if ((*c == ':') || ((*c == '#') && (*(c + 1) == '!'))) return FALSE; while (isspace(*c)) c++; if (notNULL(c)) return (*c != '#'); return FALSE; } char * ispbsdir(char *s, char *prefix) { char *it; int l; it = s; while (isspace(*it)) it++; l = strlen(prefix); if (l > 0 && strncmp(it, prefix, l) == 0) return(it + l); else return((char *)NULL); } void make_argv(int *argc, char *argv[], char *line) { char *l, *b, *c; char buffer[4096]; int len; char quote; *argc = 0; argv[(*argc)++] = "scriptload"; l = line; b = buffer; while (isspace(*l)) l++; c = l; while (*c != '\0') { if ((*c == '"') || (*c == '\'')) { quote = *c; c++; while ((*c != quote) && *c) *b++ = *c++; if (*c == '\0') { fprintf(stderr, "scriptload: unmatched %c\n", *c); exit(1); } c++; } else if (*c == '\\') { c++; *b++ = *c++; } else if (isspace(*c)) { len = c - l; if (argv[*argc] != NULL) free(argv[*argc]); argv[*argc] = (char *) malloc(len + 1); if (argv[*argc] == NULL) { fprintf(stderr, "scriptload: out of memory\n"); exit(2); } *b = '\0'; strcpy(argv[(*argc)++], buffer); while (isspace(*c)) c++; l = c; b = buffer; } else *b++ = *c++; } if (c != l) { len = c - l; if (argv[*argc] != NULL) free(argv[*argc]); argv[*argc] = (char *) malloc(len + 1); if (argv[*argc] == NULL) { fprintf(stderr, "scriptload: out of memory\n"); exit(2); } *b = '\0'; strcpy(argv[(*argc)++], buffer); } } int process_opts( int argc, char **argv, int pass) { int i; int c; int errflg = 0; int passet; time_t after; char *keyword; char *valuewd; char *pc; char *pdepend; #if !defined(PBS_NO_POSIX_VIOLATION) #define GETOPT_ARGS "a:A:c:C:e:hIj:k:l:m:M:N:o:p:q:r:S:u:v:VW:z" #else #define GETOPT_ARGS "a:A:c:C:e:hj:k:l:m:M:N:o:p:q:r:S:u:v:VW:z" #endif /* PBS_NO_POSIX_VIOLATION */ #define MAX_RES_LIST_LEN 64 /* The following macro, together the value of passet (pass + 1) is used */ /* to enforce the following rules: 1. option on the command line take */ /* precedence over those in script directives. 2. With in the command */ /* line or within the script, the last occurance of an option takes */ /* precedence over the earlier occurance. */ #define if_cmd_line(x) if( (pass==0)||(x!=1) ) passet = pass + 1; if (pass > 0) { #ifdef linux optind = 0; /* prime getopt's starting point */ #else optind = 1; /* prime getopt's starting point */ #endif } while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) { switch (c) { case 'a': if_cmd_line(a_opt) { a_opt = passet; if ((after = cvtdate(optarg)) < 0) { fprintf(stderr, "scriptload: illegal -a value\n"); errflg++; break; } printf("%s = %s\n", ATTR_a, ctime(&after)); } break; case 'A': if_cmd_line(A_opt) { A_opt = passet; printf("%s = %s\n", ATTR_A, optarg); } break; case 'c': if_cmd_line(c_opt) { c_opt = passet; while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "scriptload: illegal -c value\n"); errflg++; break; } pc = optarg; if (strlen(optarg) == 1) { if (*pc != 'n' && *pc != 's' && *pc != 'c') { fprintf(stderr, "scriptload: illegal -c value\n"); errflg++; break; } } else { if (strncmp(optarg, "c=", 2) != 0) { fprintf(stderr, "scriptload: illegal -c value\n"); errflg++; break; } pc += 2; if (*pc == '\0') { fprintf(stderr, "scriptload: illegal -c value\n"); errflg++; break; } while (isdigit(*pc)) pc++; if (*pc != '\0') { fprintf(stderr, "scriptload: illegal -c value\n"); errflg++; break; } } printf("%s = %s\n", ATTR_c, optarg); } break; case 'C': if_cmd_line(C_opt) { C_opt = passet; strcpy(dir_prefix, optarg); } break; case 'e': if_cmd_line(e_opt) { e_opt = passet; if (prepare_path(optarg, path_out, NULL) == 0) { printf("%s = %s\n", ATTR_e, path_out); } else { fprintf(stderr, "scriptload: illegal -e value\n"); errflg++; } } break; case 'h': if_cmd_line(h_opt) { h_opt = passet; printf("%s = %s\n", ATTR_h, "u"); } break; #if !defined(PBS_NO_POSIX_VIOLATION) case 'I': if_cmd_line(Interact_opt) { Interact_opt = passet; } break; #endif /* PBS_NO_POSIX_VIOLATION */ case 'j': if_cmd_line(j_opt) { j_opt = passet; if (strcmp(optarg, "oe") != 0 && strcmp(optarg, "eo") != 0 && strcmp(optarg, "n") != 0) { fprintf(stderr, "scriptload: illegal -j value\n"); errflg++; break; } printf("%s = %s\n", ATTR_j, optarg); } break; case 'k': if_cmd_line(k_opt) { k_opt = passet; if (strcmp(optarg, "o") != 0 && strcmp(optarg, "e") != 0 && strcmp(optarg, "oe") != 0 && strcmp(optarg, "eo") != 0 && strcmp(optarg, "n") != 0) { fprintf(stderr, "scriptload: illegal -k value\n"); errflg++; break; } printf("%s = %s\n", ATTR_k, optarg); } break; case 'l': l_opt = passet; if (set_resources(&attrib, optarg, (pass == 0))) { fprintf(stderr, "scriptload: illegal -l value\n"); errflg++; } printf("Resource_List = %s\n", optarg); break; case 'm': if_cmd_line(m_opt) { m_opt = passet; while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "scriptload: illegal -m value\n"); errflg++; break; } if (strcmp(optarg, "n") != 0) { pc = optarg; while (*pc) { if (*pc != 'a' && *pc != 'b' && *pc != 'e') { fprintf(stderr, "scriptload: illegal -m value\n"); errflg++; break; } pc++; } } printf("%s = %s\n", ATTR_m, optarg); } break; case 'M': if_cmd_line(M_opt) { M_opt = passet; if (parse_at_list(optarg, FALSE, FALSE)) { fprintf(stderr, "scriptload: illegal -M value\n"); errflg++; break; } printf("%s = %s\n", ATTR_M, optarg); } break; case 'N': if_cmd_line(N_opt) { N_opt = passet; if (check_job_name(optarg, 1) == 0) { printf("%s = %s\n", ATTR_N, optarg); } else { fprintf(stderr, "scriptload: illegal -N value\n"); errflg++; } } break; case 'o': if_cmd_line(o_opt) { o_opt = passet; if (prepare_path(optarg, path_out, NULL) == 0) { printf("%s = %s\n", ATTR_o, path_out); } else { fprintf(stderr, "scriptload: illegal -o value\n"); errflg++; } } break; case 'p': if_cmd_line(p_opt) { p_opt = passet; while (isspace((int)*optarg)) optarg++; pc = optarg; if (*pc == '-' || *pc == '+') pc++; if (strlen(pc) == 0) { fprintf(stderr, "scriptload: illegal -p value\n"); errflg++; break; } while (*pc != '\0') { if (! isdigit(*pc)) { fprintf(stderr, "scriptload: illegal -p value\n"); errflg++; break; } pc++; } i = atoi(optarg); if (i < -1024 || i > 1023) { fprintf(stderr, "scriptload: illegal -p value\n"); errflg++; break; } printf("%s = %s\n", ATTR_p, optarg); } break; case 'q': if_cmd_line(q_opt) { q_opt = passet; strcpy(destination, optarg); printf("%s = %s\n", ATTR_queue, optarg); } break; case 'r': if_cmd_line(r_opt) { r_opt = passet; if (strlen(optarg) != 1) { fprintf(stderr, "scriptload: illegal -r value\n"); errflg++; break; } if (*optarg != 'y' && *optarg != 'n') { fprintf(stderr, "scriptload: illegal -r value\n"); errflg++; break; } if (*optarg == 'y') printf("%s = True\n", ATTR_r); else printf("%s = False\n", ATTR_r); } break; case 'S': if_cmd_line(S_opt) { S_opt = passet; if (parse_at_list(optarg, TRUE, TRUE)) { fprintf(stderr, "scriptload: illegal -S value\n"); errflg++; break; } printf("%s = %s\n", ATTR_S, optarg); } break; case 'u': if_cmd_line(u_opt) { u_opt = passet; if (parse_at_list(optarg, TRUE, FALSE)) { fprintf(stderr, "scriptload: illegal -u value\n"); errflg++; break; } printf("%s = %s\n", ATTR_u, optarg); } break; case 'v': if_cmd_line(v_opt) { v_opt = passet; if (v_value != (char *)0) free(v_value); v_value = (char *) malloc(strlen(optarg) + 1); if (v_value == (char *)0) { fprintf(stderr, "scriptload: out of memory\n"); errflg++; break; } strcpy(v_value, optarg); printf("Variable_List = %s\n", optarg); } break; case 'V': if_cmd_line(V_opt) { V_opt = passet; printf("Export_Current_Env = %d\n", TRUE); } break; case 'W': while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "scriptload: illegal -W value\n"); errflg++; break; } i = parse_equal_string(optarg, &keyword, &valuewd); while (i == 1) { if (strcmp(keyword, ATTR_depend) == 0) { if_cmd_line(Depend_opt) { Depend_opt = passet; pdepend = malloc(PBS_DEPEND_LEN); if ((pdepend == NULL) || parse_depend_list(valuewd,pdepend,PBS_DEPEND_LEN)) { fprintf(stderr, "scriptload: illegal -W value\n"); errflg++; break; } printf("%s = %s\n", ATTR_depend, pdepend); } } else if (strcmp(keyword, ATTR_stagein) == 0) { if_cmd_line(Stagein_opt) { Stagein_opt = passet; if (parse_stage_list(valuewd)) { fprintf(stderr, "scriptload: illegal -W value\n"); errflg++; break; } printf("%s = %s\n", ATTR_stagein, valuewd); } } else if (strcmp(keyword, ATTR_stageout) == 0) { if_cmd_line(Stageout_opt) { Stageout_opt = passet; if (parse_stage_list(valuewd)) { fprintf(stderr, "scriptload: illegal -W value\n"); errflg++; break; } printf("%s = %s\n", ATTR_stageout, valuewd); } } else if (strcmp(keyword, ATTR_g) == 0) { if_cmd_line(Grouplist_opt) { Grouplist_opt = passet; if (parse_at_list(valuewd, TRUE, FALSE)) { fprintf(stderr, "scriptload: illegal -W value\n"); errflg++; break; } printf("%s = %s\n", ATTR_g, valuewd); } } else if (strcmp(keyword, ATTR_inter) == 0) { if_cmd_line(Interact_opt) { Interact_opt = passet; if (strcmp(valuewd, "true") != 0) { fprintf(stderr, "scriptload: illegal -W value\n"); errflg++; break; } } } else { set_attr(&attrib, keyword, valuewd); } i = parse_equal_string((char *)0, &keyword, &valuewd); } if (i == -1) { fprintf(stderr, "scriptload: illegal -W value\n"); errflg++; } break; case 'z': if_cmd_line(z_opt) { z_opt = passet; } break; case '?': default : errflg++; } } if (!errflg && pass) { errflg = (optind != argc); if (errflg) { fprintf(stderr, "scriptload: directive error: "); for (optind = 1; optind < argc; optind++) fprintf(stderr, "%s ", argv[optind]); fprintf(stderr, "\n"); } } return (errflg); } int do_dir(char *opts) { static int opt_pass = 1; int argc; #define MAX_ARGV_LEN 128 static char *vect[MAX_ARGV_LEN+1]; if (opt_pass == 1) { argc = 0; while (argc < MAX_ARGV_LEN + 1) vect[argc++] = NULL; } make_argv(&argc, vect, opts); return process_opts(argc, vect, opt_pass++); } int get_script( FILE *file, char *script, char *prefix) { char s[MAX_LINE_LEN+1]; char *sopt; char *cont; int exec = FALSE; char tmp_name[] = "/tmp/qsub.XXXXXX"; FILE *TMP_FILE; char *in; int tmpfd; if ((tmpfd = mkstemp(tmp_name)) < 0) { fprintf(stderr, "scriptload: could not create buffer file %s\n", tmp_name); return(4); } if ((TMP_FILE = fdopen(tmpfd, "w+")) == NULL) { fprintf(stderr, "scriptload: could not create buffer file %s\n", tmp_name); return(4); } while ((in = fgets(s, MAX_LINE_LEN, file)) != NULL) { if (!exec && ((sopt = ispbsdir(s, prefix)) != NULL)) { while ((*(cont = in + strlen(in) - 2) == '\\') && (*(cont + 1) == '\n')) { /* next line is continuation of this line */ in = cont; if ((in = fgets(in, MAX_LINE_LEN - (in - s), file)) == NULL) { fprintf(stderr, "scriptload: unexpected end-of-file or read error in script\n"); fclose(TMP_FILE); return (6); } } /* END while ( (*(cont = in + strlen(in) - 2) == '\\') && (*(cont+1) == '\n') ) */ if (do_dir(sopt) != 0) { return (-1); } } /* END if ( !exec && ((sopt = ispbsdir(s, prefix)) != NULL)) */ else { if (fputs(in, TMP_FILE) < 0) { fprintf(stderr, "scriptload: error writing to buffer file, %s\n", tmp_name); fclose(TMP_FILE); return (3); } /* Stop processing PBS directive lines if we've reach the first executable line */ if (!exec && isexecutable(s)) { exec = TRUE; } } /* END else if ( !exec && ((sopt = ispbsdir(s, prefix)) != NULL)) */ } /* END while ( (in = fgets(s, MAX_LINE_LEN, file)) != NULL ) */ fclose(TMP_FILE); if (ferror(file)) { fprintf(stderr, "scriptload: error reading script file\n"); return(5); } else { strcpy(script, tmp_name); } return(0); } /* END get_script() */ int main( /* scriptload */ int argc, char **argv ) { int errflg; /* option error */ static char script[MAXPATHLEN+1] = ""; /* name of script file */ char script_tmp[MAXPATHLEN+1]; /* name of script containing non-PBS */ /* lines */ FILE *f; /* FILE pointer to the script */ struct stat statbuf; errflg = process_opts(argc, argv, 0); /* get cmd-line options */ if (errflg || ((optind + 1) > argc)) { static char usage[] = "usage: scriptload [-C directive_prefix] script\n"; fprintf(stderr, "%s", usage); exit(2); } strcpy(script, argv[optind]); if (stat(script, &statbuf) < 0) { perror("scriptload: script file:"); exit(1); } if (! S_ISREG(statbuf.st_mode)) { fprintf(stderr, "scriptload: script not a file\n"); exit(1); } if ((f = fopen(script, "r")) != NULL) { if ((errflg = get_script(f, script_tmp, set_dir_prefix(dir_prefix, C_opt))) > 0) { unlink(script_tmp); exit(1); } else if (errflg < 0) { exit(1); } } else { perror("scriptload: opening script file:"); exit(8); } printf("Buffer_File = %s\n", script_tmp); exit(0); } torque-2.4.16/src/gui/Ccode/xpbs_datadump.c0000664000113300011330000011175611272401236015434 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * xpbs_datadump - (PBS) show stats of batch jobs, queues, or servers. * - basically, this code borrows heavily from "qstat". * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California * * Albeaus Bayucan * Sterling Software * NASA Ames Research Center */ #include /* the master config generated by configure */ #include "cmds.h" #include #include #include #include #include static int connect; static sigjmp_buf env_alrm; static void no_hang(int sig) { fprintf(stderr, "xpbs_datadump: alarm timed-out\n"); connect = 0; /* connection to server has failed */ siglongjmp(env_alrm, 1); } static char *mystrdup( char *str) { char *dup; dup = (char *)malloc((size_t)strlen(str) * sizeof(str)); if (dup == NULL) { fprintf(stderr, "xpbs_datadump: out of memory\n"); exit(2); } strcpy(dup, str); return(dup); } void set_attrop( struct attropl **list, char *a_name, char *r_name, char *v_name, enum batch_op op) { struct attropl *attr; attr = (struct attropl *) malloc(sizeof(struct attropl)); if (attr == NULL) { fprintf(stderr, "xpbs_datadump: out of memory\n"); exit(2); } if (a_name == NULL) { attr->name = NULL; } else { attr->name = (char *) malloc(strlen(a_name) + 1); if (attr->name == NULL) { fprintf(stderr, "xpbs_datadump: out of memory\n"); exit(2); } strcpy(attr->name, a_name); } if (r_name == NULL) { attr->resource = (char *)NULL; } else { attr->resource = (char *) malloc(strlen(r_name) + 1); if (attr->resource == NULL) { fprintf(stderr, "xpbs_datadump: out of memory\n"); exit(2); } strcpy(attr->resource, r_name); } if (v_name == NULL) { attr->value = NULL; } else { attr->value = (char *) malloc(strlen(v_name) + 1); if (attr->value == NULL) { fprintf(stderr, "xpbs_datadump: out of memory\n"); exit(2); } strcpy(attr->value, v_name); } attr->op = op; attr->next = *list; *list = attr; return; } #define OPSTRING_LEN 4 #define OP_LEN 2 #define OP_ENUM_LEN 6 static char *opstring_vals[] = { "eq", "ne", "ge", "gt", "le", "lt" }; static enum batch_op opstring_enums[] = { EQ, NE, GE, GT, LE, LT }; void check_op(char *optarg, enum batch_op *op, char *optargout) { char opstring[OP_LEN+1]; int i; int cp_pos; *op = EQ; /* default */ cp_pos = 0; if (optarg[0] == '.') { strncpy(opstring, &optarg[1], OP_LEN); opstring[OP_LEN] = '\0'; cp_pos = OPSTRING_LEN; for (i = 0; i < OP_ENUM_LEN; i++) { if (strncmp(opstring, opstring_vals[i], OP_LEN) == 0) { *op = opstring_enums[i]; break; } } } strcpy(optargout, &optarg[cp_pos]); return; } int check_res_op(char *optarg, char *resource_name, enum batch_op *op, char *resource_value, char **res_pos) { char opstring[OPSTRING_LEN]; int i; int hit; char *p; p = strchr(optarg, '.'); if (p == NULL || *p == '\0') { fprintf(stderr, "xpbs_datadump: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } else { strncpy(resource_name, optarg, p - optarg); resource_name[p-optarg] = '\0'; *res_pos = p + OPSTRING_LEN; } if (p[0] == '.') { strncpy(opstring, &p[1] , OP_LEN); opstring[OP_LEN] = '\0'; hit = 0; for (i = 0; i < OP_ENUM_LEN; i++) { if (strncmp(opstring, opstring_vals[i], OP_LEN) == 0) { *op = opstring_enums[i]; hit = 1; break; } } if (! hit) { fprintf(stderr, "xpbs_datadump: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } } p = strchr(*res_pos, ','); if (p == NULL) { p = strchr(*res_pos, '\0'); } strncpy(resource_value, *res_pos, p - (*res_pos)); resource_value[p-(*res_pos)] = '\0'; if (strlen(resource_value) == 0) { fprintf(stderr, "xpbs_datadump: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } *res_pos = (*p == '\0') ? p : (p += 1) ; if (**res_pos == '\0' && *(p - 1) == ',') { fprintf(stderr, "xpbs_datadump: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } return(0); /* ok */ } int istrue(char *string) { if (strcmp(string, "TRUE") == 0) return TRUE; if (strcmp(string, "True") == 0) return TRUE; if (strcmp(string, "true") == 0) return TRUE; if (strcmp(string, "1") == 0) return TRUE; return FALSE; } void states(char *string, char *q, char *r, char *h, char *w, char *t, char *e, int len) { char *c, *d, *f, *s, l; c = string; while (isspace(*c) && *c != '\0') c++; while (*c != '\0') { s = c; while (*c != ':') c++; *c = '\0'; d = NULL; if (strcmp(s, "Queued") == 0) d = q; else if (strcmp(s, "Running") == 0) d = r; else if (strcmp(s, "Held") == 0) d = h; else if (strcmp(s, "Waiting") == 0) d = w; else if (strcmp(s, "Transit") == 0) d = t; else if (strcmp(s, "Exiting") == 0) d = e; c++; if (d != NULL) { s = c; while (*c != ' ' && *c != '\0') c++; l = *c; *c = '\0'; if (strlen(s) > (size_t)len) { f = s + len; *f = '\0'; } strcpy(d, s); if (l != '\0') c++; } } } /* * print a attribute value string, formating to break a comma if possible */ void prt_attr(char *n, char *r, char *v) { char *c; char *comma = ","; int first = 1; int l; int start; start = strlen(n) + 7; /* 4 spaces + ' = ' is 7 */ printf(" %s", n); if (r) { start += strlen(r) + 1; printf(".%s", r); } printf(" = "); c = strtok(v, comma); while (c) { if ((l = strlen(c)) + start < 78) { printf("%s", c); start += l; } else { if (! first) { printf("\n\t"); start = 9; } while (*c) { putchar(*c++); if (++start > 78) { start = 8; printf("\n\t"); } } } if ((c = strtok((char *)0, comma))) { first = 0; putchar(','); } } } #define NAMEL 12 /* printf of jobs, queues, and servers */ #define NODEL 5 #define OWNERL 8 /* printf of jobs */ #define TIMEUL 8 /* printf of jobs */ #define STATEL 1 /* printf of jobs */ #define LOCL 12 /* printf of jobs */ void display_statjob(struct batch_status *status, int prtheader, int full, char *server_name) { struct batch_status *p; struct attrl *a; int l; char *c, *e = NULL; char jid[PBS_MAXSEQNUM+14+1]; char name[NAMEL+1]; char owner[OWNERL+1]; char nodes[NODEL+1]; char cputimeu[TIMEUL+1]; char walltimeu[TIMEUL+1]; char state[STATEL+1]; char location[LOCL+1]; char format[80]; char format2[80]; char long_name[17]; time_t epoch; sprintf(format, "%%-%ds %%-%ds %%-%ds %%%ds %%%ds %%%ds %%%ds %%s@%%s %%s %%s\n", PBS_MAXSEQNUM + 14, NAMEL, OWNERL, NODEL, TIMEUL, TIMEUL, STATEL); sprintf(format2, "%%-%ds %%-%ds %%-%ds %%%ds %%%ds %%%ds %%%ds %%s\n", PBS_MAXSEQNUM + 14, NAMEL, OWNERL, NODEL, TIMEUL, TIMEUL, STATEL); if (! full && prtheader) { printf(":"); printf(format2, "Job id", "Name", "User", "PEs", "CputUse", "WalltUse", "S", "Queue"); } p = status; while (p != NULL) { jid[0] = '\0'; name[0] = '\0'; owner[0] = '\0'; cputimeu[0] = '\0'; walltimeu[0] = '\0'; state[0] = '\0'; location[0] = '\0'; nodes[0] = '\0'; if (full) { printf("Job Id: %s@%s\n", p->name, server_name); a = p->attribs; while (a != NULL) { if (a->name != NULL) { if (strcmp(a->name, ATTR_ctime) == 0 || strcmp(a->name, ATTR_mtime) == 0 || strcmp(a->name, ATTR_qtime) == 0 || strcmp(a->name, ATTR_a) == 0) { epoch = (time_t) atoi(a->value); prt_attr(a->name, a->resource, ctime(&epoch)); } else { prt_attr(a->name, a->resource, a->value); printf("\n"); } } a = a->next; } } else { if (p->name != NULL) { if ((e = mystrdup(p->name)) == NULL) { fprintf(stderr, "Error getting more space to malloc\n"); exit(2); } c = e; /* we need e as the starting address for */ /* future free */ while (*c != '.' && *c != '\0') c++; c++; /* List the first part of the server name, too. */ while (*c != '.' && *c != '\0') c++; c++; /* List also the 2nd part of the server name, too. */ while (*c != '.' && *c != '\0') c++; *c = '\0'; l = strlen(e); if (l > (PBS_MAXSEQNUM + 14)) { c = e + PBS_MAXSEQNUM + 14; *c = '\0'; } strcpy(jid, e); free(e); } a = p->attribs; while (a != NULL) { if (a->name != NULL) { if ((e = mystrdup(a->value)) == NULL) { fprintf(stderr, "Error getting more space to malloc\n"); exit(2); } c = e; /* we need e as the starting address for */ /* future free */ if (strcmp(a->name, ATTR_name) == 0) { l = strlen(e); if (l > NAMEL) { l = l - NAMEL + 3; c = e + l; while (*c != '/' && *c != '\0') c++; if (*c == '\0') c = e + l; strcpy(long_name, "..."); strcat(long_name, c); c = long_name; } else c = e; strcpy(name, c); } else if (strcmp(a->name, ATTR_owner) == 0) { c = e; while (*c != '@' && *c != '\0') c++; *c = '\0'; l = strlen(e); if (l > OWNERL) { c = e + OWNERL; *c = '\0'; } strcpy(owner, e); } else if (strcmp(a->name, ATTR_used) == 0) { if (strcmp(a->resource, "cput") == 0) { l = strlen(e); if (l > TIMEUL) { c = e + TIMEUL; *c = '\0'; } strcpy(cputimeu, e); } else if (strcmp(a->resource, "walltime") == 0) { l = strlen(e); if (l > TIMEUL) { c = e + TIMEUL; *c = '\0'; } strcpy(walltimeu, e); } } else if (strcmp(a->name, ATTR_state) == 0) { l = strlen(e); if (l > STATEL) { c = e + STATEL; *c = '\0'; } strcpy(state, e); } else if (strcmp(a->name, ATTR_queue) == 0) { c = e; while (*c != '@' && *c != '\0') c++; *c = '\0'; l = strlen(e); if (l > LOCL) { c = e + LOCL; *c = '\0'; } strcpy(location, e); } else if (strcmp(a->name, ATTR_l) == 0) { if (strcmp(a->resource, "nodect") == 0 || \ strcmp(a->resource, "ncpus") == 0) { l = strlen(e); if (l > NODEL) { c = e + NODEL; *c = '\0'; } strcpy(nodes, e); } } } a = a->next; free(e); } if (cputimeu[0] == '\0') strcpy(cputimeu, "0"); if (walltimeu[0] == '\0') strcpy(walltimeu, "0"); if (nodes[0] == '\0') strcpy(nodes, "-"); printf(format, jid, name, owner, nodes, cputimeu, walltimeu, state, location, server_name, server_name, p->name); } if (full) printf("\n"); p = p->next; } return; } void display_trackstatjob(struct batch_status *status, char *server_name) { struct batch_status *p; struct attrl *a; char owner[OWNERL+1]; char output_path[MAXPATHLEN]; char error_path[MAXPATHLEN]; int l; char *c, *e = NULL; p = status; while (p != NULL) { printf("%s@%s ", p->name, server_name); a = p->attribs; while (a != NULL) { if (a->name != NULL) { if ((e = mystrdup(a->value)) == NULL) { fprintf(stderr, "Error getting more space to malloc\n"); exit(2); } c = e; /* we need e as the starting address for */ /* future free */ if (strcmp(a->name, ATTR_owner) == 0) { c = e; while (*c != '@' && *c != '\0') c++; *c = '\0'; l = strlen(e); if (l > OWNERL) { c = e + OWNERL; *c = '\0'; } strcpy(owner, e); } else if (strcmp(a->name, ATTR_o) == 0) { strcpy(output_path, a->value); } else if (strcmp(a->name, ATTR_e) == 0) { strcpy(error_path, a->value); } } free(e); a = a->next; } printf("%s %s %s\n", owner, output_path, error_path); p = p->next; } return; } #define QNAMEL 16 #define NUML 5 #define TYPEL 10 void display_statque(struct batch_status *status, int prtheader, int full, char *server_name) { struct batch_status *p; struct attrl *a; int l; char *c, *e; char name[QNAMEL+1]; char max[NUML+1]; char tot[NUML+1]; char ena[NUML+1]; char str[NUML+1]; char que[NUML+1]; char run[NUML+1]; char hld[NUML+1]; char wat[NUML+1]; char trn[NUML+1]; char ext[NUML+1]; char type[TYPEL+1]; char format[80]; sprintf(format, "%%-%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%-%ds %%s\n", QNAMEL, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, TYPEL); if (! full && prtheader) { printf(":"); printf(format, "Queue", "Max", "Tot", "Ena", "Str", "Que", "Run", "Hld", "Wat", "Trn", "Ext", "Type", "Server"); } p = status; while (p != NULL) { name[0] = '\0'; strcpy(max, "0"); strcpy(tot, "0"); strcpy(ena, "no"); strcpy(str, "no"); strcpy(que, "0"); strcpy(run, "0"); strcpy(hld, "0"); strcpy(wat, "0"); strcpy(trn, "0"); strcpy(ext, "0"); type[0] = '\0'; if (full) { printf("Queue: %s@%s\n", p->name, server_name); a = p->attribs; while (a != NULL) { if (a->name != NULL) { prt_attr(a->name, a->resource, a->value); printf("\n"); } a = a->next; } } else { if (p->name != NULL) { if ((e = mystrdup(p->name)) == NULL) { fprintf(stderr, "Error getting more space to malloc\n"); exit(2); } c = e; /* we need e as the starting address for */ /* future free */ l = strlen(e); if (l > NAMEL) { c = e + NAMEL; *c = '\0'; } strcpy(name, e); free(e); } a = p->attribs; while (a != NULL) { if ((e = mystrdup(a->value)) == NULL) { fprintf(stderr, "Error getting more space to malloc\n"); exit(2); } c = e; /* we need e as the starting address for */ /* future free */ if (a->name != NULL) { if (strcmp(a->name, ATTR_maxrun) == 0) { l = strlen(e); if (l > NUML) { c = e + NUML; *c = '\0'; } strcpy(max, e); } else if (strcmp(a->name, ATTR_total) == 0) { l = strlen(e); if (l > NUML) { c = e + NUML; *c = '\0'; } strcpy(tot, e); } else if (strcmp(a->name, ATTR_enable) == 0) { if (istrue(e)) strcpy(ena, "yes"); else strcpy(ena, "no"); } else if (strcmp(a->name, ATTR_start) == 0) { if (istrue(e)) strcpy(str, "yes"); else strcpy(str, "no"); } else if (strcmp(a->name, ATTR_count) == 0) { states(e, que, run, hld, wat, trn, ext, NUML); } else if (strcmp(a->name, ATTR_qtype) == 0) { l = strlen(e); if (l > TYPEL) { c = e + TYPEL; *c = '\0'; } strcpy(type, e); } } a = a->next; free(e); } printf(format, name, max, tot, ena, str, que, run, hld, wat, trn, ext, type, server_name); } if (full) printf("\n"); p = p->next; } return; } #define SERVERL 23 #define STATUSL 10 #define NODESL 9 void display_statserver(struct batch_status *status, int prtheader, int full, int nodesInUse) { struct batch_status *p; struct attrl *a; int l; char *c, *e; char name[SERVERL+1]; char max[NUML+1]; char tot[NUML+1]; char que[NUML+1]; char run[NUML+1]; char hld[NUML+1]; char wat[NUML+1]; char trn[NUML+1]; char ext[NUML+1]; char nod[NODESL+1]; char stats[STATUSL+1]; char format[80]; sprintf(format, "%%-%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%-%ds %%%ds %%s\n", SERVERL, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, STATUSL, NODESL); if (! full && prtheader) { printf(":"); printf(format, "Server", "Max", "Tot", "Que", "Run", "Hld", "Wat", "Trn", "Ext", "Status", "PEsInUse", ""); } p = status; while (p != NULL) { name[0] = '\0'; strcpy(max, "0"); strcpy(tot, "0"); strcpy(que, "0"); strcpy(run, "0"); strcpy(hld, "0"); strcpy(wat, "0"); strcpy(trn, "0"); strcpy(ext, "0"); strcpy(nod, "-/-"); stats[0] = '\0'; if (full) { printf("Server: %s\n", p->name); a = p->attribs; while (a != NULL) { if (a->name != NULL) { prt_attr(a->name, a->resource, a->value); printf("\n"); } a = a->next; } } else { if (p->name != NULL) { if ((e = mystrdup(p->name)) == NULL) { fprintf(stderr, "Error getting more space to malloc\n"); exit(2); } c = e; /* we need e as the starting address for */ /* future free */ l = strlen(e); if (l > SERVERL) { c = e + SERVERL; *c = '\0'; } strcpy(name, e); free(e); } a = p->attribs; while (a != NULL) { if ((e = mystrdup(a->value)) == NULL) { fprintf(stderr, "Error getting more space to malloc\n"); exit(2); } c = e; /* we need e as the starting address for */ /* future free */ if (a->name != NULL) { if (strcmp(a->name, ATTR_maxrun) == 0) { l = strlen(e); if (l > NUML) { c = e + NUML; *c = '\0'; } strcpy(max, e); } else if (strcmp(a->name, ATTR_total) == 0) { l = strlen(e); if (l > NUML) { c = e + NUML; *c = '\0'; } strcpy(tot, e); } else if (strcmp(a->name, ATTR_count) == 0) { states(e, que, run, hld, wat, trn, ext, NUML); } else if (strcmp(a->name, ATTR_status) == 0) { l = strlen(e); if (l > STATUSL) { c = e + STATUSL; *c = '\0'; } strcpy(stats, e); } else if (strcmp(a->name, ATTR_rescmax) == 0) { if (strcmp(a->resource, "nodect") == 0 || \ strcmp(a->resource, "ncpus") == 0) { l = strlen(e); if (l > NODESL) { c = e + NODESL; *c = '\0'; } sprintf(nod, "%d/%s", nodesInUse, e); } } } a = a->next; free(e); } printf(format, name, max, tot, que, run, hld, wat, trn, ext, stats, nod, p->name ? p->name : ""); } if (full) printf("\n"); p = p->next; } return; } static int getNumNodesInUse(int connect) { struct batch_status *j_status; struct batch_status *temp; struct attrl *attr; struct attropl *run_list = 0; int nodesInUse = 0; char *errmsg; int nodect; int cpuct; int nodes; set_attrop(&run_list, ATTR_state, (char *)NULL, "R", EQ); j_status = pbs_selstat(connect, run_list, NULL); if (j_status == NULL) { if (pbs_errno != PBSE_NONE) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "xpbs_datadump: %s\n", errmsg); } else { fprintf(stderr, "xpbs_datadump: Error (%d) selecting running jobs to obtain nodes in use value\n", pbs_errno); } return(-1); } } else /* got some output */ { for (temp = j_status; temp; temp = temp->next) { nodect = 0; /* start with a nodect of 0 */ cpuct = 0; /* start with a cpuct of 0 */ nodes = 0; /* nodes is not set */ for (attr = temp->attribs; attr; attr = attr->next) { if (strcmp(attr->name, ATTR_l) == 0) { if (strcmp(attr->resource, "nodect") == 0) { nodect = atoi(attr->value); } else if (strcmp(attr->resource, "nodes") == 0) { nodes = 1; /* nodes is set */ } else if (strcmp(attr->resource, "ncpus") == 0) { cpuct = atoi(attr->value); } } } if (nodes) { nodesInUse += nodect; } else { nodesInUse += cpuct; } } pbs_statfree(j_status); } return(nodesInUse); } int main( /* qstat */ int argc, char **argv ) { int c; int errflg = 0; volatile int any_failed = 0; char server_out[MAXSERVERNAME]; char full_server_name[MAXSERVERNAME]; char *queue_name_out = NULL; struct batch_status *p_status; char *errmsg; #define MAX_OPTARG_LEN 256 #define MAX_RESOURCE_NAME_LEN 256 char optargout[MAX_OPTARG_LEN+1]; char resource_name[MAX_RESOURCE_NAME_LEN+1]; enum batch_op op; enum batch_op *pop = &op; struct attropl *select_list = 0; static char destination[PBS_MAXQUEUENAME+1] = ""; char *server_name_out; char *res_pos; char *pc; int u_cnt, o_cnt, s_cnt, n_cnt; time_t after; char a_value[80]; volatile int do_job_only = FALSE; volatile int do_trackjob_only = FALSE; volatile int timeout_secs = 30; /* # of seconds before timing out waiting */ /* for a connection to the server */ struct sigaction act; #define GETOPT_ARGS "a:A:c:h:l:N:p:q:r:s:u:JTt:" while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) switch (c) { case 't': timeout_secs = atoi(optarg); break; case 'T': do_trackjob_only = TRUE; break; case 'J': do_job_only = TRUE; break; case 'a': check_op(optarg, pop, optargout); if ((after = cvtdate(optargout)) < 0) { fprintf(stderr, "xpbs_datadump: illegal -a value\n"); errflg++; break; } sprintf(a_value, "%ld", (long)after); set_attrop(&select_list, ATTR_a, (char *)NULL, a_value, op); break; case 'c': check_op(optarg, pop, optargout); pc = optargout; while (isspace((int)*pc)) pc++; if (strlen(pc) == 0) { fprintf(stderr, "xpbs_datadump: illegal -c value\n"); errflg++; break; } if (strcmp(pc, "u") == 0) { if ((op != EQ) && (op != NE)) { fprintf(stderr, "xpbs_datadump: illegal -c value\n"); errflg++; break; } } else if ((strcmp(pc, "n") != 0) && (strcmp(pc, "s") != 0) && (strcmp(pc, "c") != 0)) { if (strncmp(pc, "c=", 2) != 0) { fprintf(stderr, "xpbs_datadump: illegal -c value\n"); errflg++; break; } pc += 2; if (strlen(pc) == 0) { fprintf(stderr, "xpbs_datadump: illegal -c value\n"); errflg++; break; } while (*pc != '\0') { if (!isdigit((int)*pc)) { fprintf(stderr, "xpbs_datadump: illegal -c value\n"); errflg++; break; } pc++; } } set_attrop(&select_list, ATTR_c, (char *)NULL, optargout, op); break; case 'h': check_op(optarg, pop, optargout); pc = optargout; while (isspace((int)*pc)) pc++; if (strlen(pc) == 0) { fprintf(stderr, "xpbs_datadump: illegal -h value\n"); errflg++; break; } u_cnt = o_cnt = s_cnt = n_cnt = 0; while (*pc) { if (*pc == 'u') u_cnt++; else if (*pc == 'o') o_cnt++; else if (*pc == 's') s_cnt++; else if (*pc == 'n') n_cnt++; else { fprintf(stderr, "xpbs_datadump: illegal -h value\n"); errflg++; break; } pc++; } if (n_cnt && (u_cnt + o_cnt + s_cnt)) { fprintf(stderr, "xpbs_datadump: illegal -h value\n"); errflg++; break; } set_attrop(&select_list, ATTR_h, (char *)NULL, optargout, op); break; case 'l': res_pos = optarg; while (*res_pos != '\0') { if (check_res_op(res_pos, resource_name, pop, optargout, &res_pos) != 0) { errflg++; break; } set_attrop(&select_list, ATTR_l, resource_name, optargout, op); } break; case 'p': check_op(optarg, pop, optargout); set_attrop(&select_list, ATTR_p, (char *)NULL, optargout, op); break; case 'q': strcpy(destination, optarg); check_op(optarg, pop, optargout); set_attrop(&select_list, ATTR_q, (char *)NULL, optargout, op); break; case 'r': op = EQ; pc = optarg; while (isspace((int)(*pc))) pc++; if (strlen(pc) != 1) { fprintf(stderr, "xpbs_datadump: illegal -r value\n"); errflg++; break; } if (*pc != 'y' && *pc != 'n') { fprintf(stderr, "xpbs_datadump: illegal -r value\n"); errflg++; break; } set_attrop(&select_list, ATTR_r, (char *)NULL, pc, op); break; case 's': check_op(optarg, pop, optargout); pc = optargout; while (isspace((int)(*pc))) pc++; if (strlen(optarg) == 0) { fprintf(stderr, "xpbs_datadump: illegal -s value\n"); errflg++; break; } while (*pc) { if (*pc != 'E' && *pc != 'H' && *pc != 'Q' && *pc != 'R' && *pc != 'T' && *pc != 'W') { fprintf(stderr, "xpbs_datadump: illegal -s value\n"); errflg++; break; } pc++; } set_attrop(&select_list, ATTR_state, (char *)NULL, optargout, op); break; case 'u': op = EQ; if (parse_at_list(optarg, FALSE, FALSE)) { fprintf(stderr, "xpbs_datadump: illegal -u value\n"); errflg++; break; } set_attrop(&select_list, ATTR_u, (char *)NULL, optarg, op); break; case 'A': op = EQ; set_attrop(&select_list, ATTR_A, (char *)NULL, optarg, op); break; case 'N': op = EQ; set_attrop(&select_list, ATTR_N, (char *)NULL, optarg, op); break; default : errflg++; } if (errflg || (optind == argc)) { static char usage[] = "usage: xpbs_datadump \ [-a [op]date_time] [-A account_string] [-c [op]interval] \n\ [-h hold_list] [-l resource_list] [-N name] [-p [op]priority] \n\ [-q destination] [-r y|n] [-s states] [-u user_name] [-J] [-T] \n\ [-t timeout_secs] server_name..\n"; fprintf(stderr, "%s", usage); exit(2); } if (notNULL(destination)) { if (parse_destination_id(destination, &queue_name_out, &server_name_out)) { fprintf(stderr, "xpbs_datadump: illegally formed destination: %s\n", destination); exit(2); } else { if (notNULL(server_name_out)) { strcpy(server_out, server_name_out); } } } act.sa_handler = no_hang; sigemptyset(&act.sa_mask); #ifdef SA_INTERRUPT act.sa_flags = SA_INTERRUPT; #else act.sa_flags = 0; #endif /* SA_INTERRUPT */ (void)sigaction(SIGALRM, &act, (struct sigaction *)0); for (; optind < argc; optind++) { strcpy(server_out, argv[optind]); if (sigsetjmp(env_alrm, 1) == 0) { alarm(timeout_secs); connect = cnt2server(server_out); } alarm(0); if (connect <= 0) { fprintf(stderr, "xpbs_datadump: Can not connect to server %s (%d)\n", server_out, pbs_errno); any_failed = connect; continue; } /* Get server information */ p_status = pbs_statserver(connect, NULL, NULL); if (p_status == NULL) { if (pbs_errno) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "qstat: %s ", errmsg); } else fprintf(stderr, "xpbs_datadump: Error (%d) getting status of server ", pbs_errno); fprintf(stderr, "%s\n", server_out); any_failed = pbs_errno; } } else { strcpy(full_server_name, p_status->name); if (!do_job_only && !do_trackjob_only) { display_statserver(p_status, TRUE, FALSE, getNumNodesInUse(connect)); } pbs_statfree(p_status); } /* Get the queue information */ p_status = pbs_statque(connect, queue_name_out, NULL, NULL); if (p_status == NULL) { if (pbs_errno) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "qstat: %s ", errmsg); } else fprintf(stderr, "xpbs_datadump: Error (%d) getting status of queue ", pbs_errno); fprintf(stderr, "%s\n", queue_name_out); any_failed = pbs_errno; } } else { if (!do_job_only && !do_trackjob_only) { display_statque(p_status, TRUE, FALSE, full_server_name); } pbs_statfree(p_status); } /* ### Get Jobs summary info information for each of the servers */ p_status = pbs_selstat(connect, select_list, NULL); if (p_status == NULL) { if (pbs_errno != PBSE_NONE) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "xpbs_datadump: %s\n", errmsg); } else { fprintf(stderr, "xpbs_datadump: Error (%d) selecting jobs\n", pbs_errno); } any_failed = pbs_errno; } } else /* got some output */ { if (!do_trackjob_only) { display_statjob(p_status, TRUE, FALSE, full_server_name); } else { display_trackstatjob(p_status, full_server_name); } pbs_statfree(p_status); } pbs_disconnect(connect); } exit(any_failed); } torque-2.4.16/src/gui/Ccode/Makefile.am0000664000113300011330000000041711272401236014460 00000000000000include $(top_srcdir)/buildutils/config.mk PBS_LIBS = ../../lib/Libpbs/libtorque.la xpbsbindir = $(XPBS_DIR)/bin xpbsbin_PROGRAMS = xpbs_datadump xpbs_scriptload LDADD = $(PBS_LIBS) xpbs_datadump_SOURCES = xpbs_datadump.c xpbs_scriptload_SOURCES = xpbs_scriptload.c torque-2.4.16/src/gui/email_list.tk0000664000113300011330000001523311272401236014073 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # email_list: defines the layout and functions of the email addresses dialog # box. Input focus returns to 'callerDialogBox' upon return. # CONTEXT: executes originally in the context of qsub, but can changed via # setting qalter to 1. proc email_list {callerDialogBox {qalter 0}} { global LABELFONT emailDialogBox activeWindow global numMisc if {!$qalter} { global qsubv ARR set ARR "qsubv" } else { global qalterv ARR set ARR "qalterv" } global ${ARR}_notify_addr busy_cursor ## Bring up the standard Dialog box ## set emailDialogBox ".email" set dbox [popupDialogBox $emailDialogBox "Email Addresses Dialog" 1 "" $callerDialogBox] set activeWindow($emailDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {cancel "reset to default"} \ {help help}}} x 1m 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdReset [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdHelp configure -command {xpbs_help email $emailDialogBox} $cmdOk configure -command { pre_build_email_opt $ARR destroy $emailDialogBox } if {$qalter} { $cmdReset configure -width 18 \ -command "set_default_qalter_email; boxLoad $dbox_top.e" } else { $cmdReset configure -width 18 \ -command "set_default_qsub_email; boxLoad $dbox_top.e" } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.e box $dbox_top.e -title "" -entrylabels [list "email: user\[@host\]"] \ -lboxlabels "{Email Addresses}" -lboxwidths 50 -lboxheights 4 \ -orient y -array 0 ${ARR}_notify_addr -grabBox $emailDialogBox boxLoad $dbox_top.e ## ARRANGEMENT ON SCREEN pack forget $dbox_top.e pack $dbox_top.header $dbox_top.e $dbox_top.footer -anchor nw \ -side top -padx 10m -anchor c register_default_action $emailDialogBox $cmdOk tkwait visibility $emailDialogBox remove_busy_cursor catch {tkwait window $emailDialogBox} set activeWindow($emailDialogBox) 0 focus $callerDialogBox catch {grab $callerDialogBox} } # pre_build_email_opt: builds the email options suitable for processing by # either qsub or qalter. proc pre_build_email_opt {array} { upvar $array ARR global ${array}_notify_addr if [regexp "qsub" $array] { init_qsub_email_argstr } else { init_qalter_email_argstr } set ARR(email_args) [construct_array_args ${array}_notify_addr ","] } torque-2.4.16/src/gui/text.tk0000664000113300011330000001446711272401236012745 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains all procedures related to a text widgets. ################################################################################ # buildFullTextbox: creates a text widget on 'frame_name' of 'ColxRow' # dimensions (in chars), with a 'scrollbar' type of either "yscroll" or # "noscroll". # OPTIONS: # text_title - if you choose to puts a label string on the text widget. proc buildFullTextbox {frame_name ColxRow scrollbarType {text_title ""} } { global BADPARAM errmsg TEXTFONT LABELFONT set procname "buildFull_Textbox" ## Let's be defensive about the input if { ![regexp "\\." $frame_name] || \ ![regexp "(\[0-9]+)x(\[0-9]+)" $ColxRow match Col Row] || \ ([string compare $scrollbarType "yscroll"] != 0 && \ [string compare $scrollbarType "noscroll"] != 0) } { puts "Error $BADPARAM in $procname: $errmsg(BADPARAM)" exit $BADPARAM } if { [string compare $frame_name "." ] == 0 } { set frame_name "" } text $frame_name.textbox -borderwidth 2 \ -relief groove \ -setgrid 1 \ -font $TEXTFONT \ -exportselection true \ -width $Col \ -height $Row \ -wrap word bind_text_overselect $frame_name.textbox if {[string compare $text_title ""] != 0} { label $frame_name.label -text $text_title -font $LABELFONT pack $frame_name.label -anchor nw -side left -fill x -expand 1 pack $frame_name.textbox -after $frame_name.label -anchor nw -side left \ -fill both -expand 1 } else { pack $frame_name.textbox -anchor nw -side left -expand 1 -fill both } set scrollbars "" if { [string compare $scrollbarType "yscroll"] == 0 } { scrollbar $frame_name.vscroll -command "$frame_name.textbox yview" \ -borderwidth 2 \ -orient vertical \ -relief groove $frame_name.textbox configure -yscrollcommand "$frame_name.vscroll set" pack $frame_name.vscroll -anchor se -fill y -expand 1 -side right \ -after $frame_name.textbox -expand 1 set scrollbars $frame_name.vscroll } return [concat $frame_name $frame_name.textbox $scrollbars] } torque-2.4.16/src/gui/buildindex.src0000664000113300011330000001345111272401236014251 00000000000000#!/usr/bin/pbs_tclsh # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # # this builds an index for a Tcl/Tk directory after checking the age # of files. The first argument is the directory where the Tcl/Tk files # are found and the second optional argument is where the tclIndex # file should end up. Normally the second arg defaults to be the same # as the first. This is to support separate src and build trees. # # an optional 3rd arg has been added to be the destdir # set libdir [lindex $argv 0] if {$argc == 3} { set tclIndex_dir [lindex $argv 1] set destdir [lindex $argv 2] set havedestdir 1 } else { set havedestdir 0 if {$argc == 2} { set tclIndex_dir [lindex $argv 1] } else { if {$argc == 1} { set tclIndex_dir $libdir } else { puts "$argv0 libpath [tclIndex_dir]" exit 1 } } } if { ![file exists $tclIndex_dir/tclIndex] } { set doit 1 } else { set age [file mtime $tclIndex_dir/tclIndex] set doit 0 if {[file mtime $libdir] > $age} { set doit 1 } else { foreach file [glob $libdir/*.tcl $libdir/*.tk] { if {[file mtime $file] > $age} { set doit 1 break } } } } if { $doit } { puts -nonewline "Running auto_mkindex..." auto_mkindex $tclIndex_dir $libdir/*.{tk,tcl} set f [open tclIndex] while {[gets $f line] >= 0} { set res [regsub {\$dir//} $line {/} match] append entry "$match\n" } close $f set f [open tclIndex w] puts $f $entry close $f puts "done" if { $havedestdir } { regsub -all {/} $libdir { } libdir_ regsub -all {/} $destdir { } destdir_ set f [open tclIndex] while {[gets $f line] >= 0} { set res [regsub $destdir_ $line {} match] append entry_ "$match\n" } close $f set f [open tclIndex w] puts $f $entry_ close $f } } exit 0 torque-2.4.16/src/gui/entry.tk0000664000113300011330000003676011272401236013122 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains procedures related to entry widgets used in xpbs. ################################################################################ # buildFullEntrybox: builds one of the following entry boxes and display it on # the 'frame_name' specified. # ----------- # (1) label | | <|=|> mode: right horizontal scrollbar # ----------- no all button # # ----------- # (2) label [all] | | <|=|> mode: right horizontal scrollbar # ----------- all button # # # ----------- # (3) label | | mode: bottom horiz. scrollbar # ----------- no all button # <|=======|> # # # ----------- # (4) label [all] | | mode: bottom horiz. scrollbar # ----------- all button # <|=======|> # OPTION: # The 'label_placement' allows for the label to be set "left", "right", # "top", and "bottom". # RETURNS: a list containing the frame holding the full entry box, # all_button (if any) label, entry, scrollbar widget names. proc buildFullEntrybox {frame_name label_width label entry_width \ default_entryval scrollbar_placement all_button \ {label_placement "left"}} { global TEXTFONT LABELFONT tk_version if {$all_button} { button $frame_name.all -font $LABELFONT -width 4 -text "all" -padx 1 \ -pady 1 } label $frame_name.label -font $LABELFONT -width $label_width \ -text $label -padx 1 -pady 1 entry $frame_name.entry -font $TEXTFONT \ -relief sunken \ -borderwidth 2 \ -width $entry_width if { $tk_version < 4.0 } { $frame_name.entry configure -scrollcommand "$frame_name.hscroll set" } else { $frame_name.entry configure -xscrollcommand "$frame_name.hscroll set" } $frame_name.entry insert 0 $default_entryval bind_entry_overselect $frame_name.entry if { [string compare $scrollbar_placement ""] != 0 } { scrollbar $frame_name.hscroll -orient horizontal \ -borderwidth 2 \ -relief groove if { $tk_version < 4.0 } { $frame_name.hscroll configure -command "$frame_name.entry view" } else { $frame_name.hscroll configure -command "$frame_name.entry xview" } } if {$label_width > 0} { if {[string compare $scrollbar_placement "left"] != 0} { if {[string compare $label_placement "left"] == 0} { pack $frame_name.label -side left -anchor nw -ipadx 1m -fill x } elseif {[string compare $label_placement "right"] == 0} { pack $frame_name.label -side right -anchor nw -ipadx 1m -fill x } elseif {[string compare $label_placement "top"] == 0} { pack $frame_name.label -side top -anchor nw -ipadx 1m -fill x } elseif {[string compare $label_placement "bottom"] == 0} { pack $frame_name.label -side bottom -anchor nw -ipadx 1m -fill x } } } if {$all_button && [string compare $scrollbar_placement "right"] == 0} { pack $frame_name.all $frame_name.entry \ $frame_name.hscroll -side left -anchor nw -ipadx 1m -fill x } elseif {!$all_button && \ [string compare $scrollbar_placement "right"] == 0} { pack $frame_name.entry $frame_name.hscroll \ -side left -anchor nw -ipadx 1m -fill x } elseif {$all_button && \ [string compare $scrollbar_placement "bottom"] == 0} { pack $frame_name.all $frame_name.entry \ -side left -anchor nw -fill x pack $frame_name.hscroll -side bottom -fill x -expand 1 } elseif {!$all_button && \ [string compare $scrollbar_placement "bottom"] == 0} { pack $frame_name.entry -side left -anchor nw -fill x pack $frame_name.hscroll -before $frame_name.entry -side bottom -fill x -expand 1 \ -anchor nw } elseif {$all_button && [string compare $scrollbar_placement "left"] == 0} { pack $frame_name.hscroll $frame_name.label $frame_name.all \ $frame_name.entry -side left -anchor nw -ipadx 1m -fill x } elseif {!$all_button && \ [string compare $scrollbar_placement "left"] == 0} { pack $frame_name.hscroll $frame_name.label $frame_name.entry \ -side left -anchor nw -ipadx 1m -fill x } else { pack $frame_name.entry -side left -anchor nw -fill x if {$tk_version < 4.0} { $frame_name.entry configure -scrollcommand "" } else { $frame_name.entry configure -xscrollcommand "" } } if {$all_button} { return [list $frame_name $frame_name.label $frame_name.all \ $frame_name.entry $frame_name.hscroll] } else { return [list $frame_name $frame_name.label $frame_name.entry \ $frame_name.hscroll] } } # disable_fullentry: disables all components of an entry box. proc disable_fullentry {entryLabel entry entryScroll {allButton ""}} { global disabledColor selColor if {[string compare $entryLabel ""] != 0} { disable_label $entryLabel $disabledColor } if {[string compare $entryScroll ""] != 0} { disable_scrollbar $entryScroll $disabledColor } if {[string compare $allButton ""] != 0} { disable_button $allButton } set state [lindex [$entry configure -state] 4] if {[string compare $state "disabled"] != 0} { set selColor($entry) [lindex [$entry configure -foreground] 4] $entry configure -state disabled -foreground $disabledColor } } # enable_fullentry: enables all components of an entry box. proc enable_fullentry {entryLabel entry entryScroll {allButton ""}} { global selColor foregroundColor if {[string compare $entryLabel ""] != 0} { enable_label $entryLabel } if {[string compare $entryScroll ""] != 0} { enable_scrollbar $entryScroll } if {[string compare $allButton ""] != 0} { enable_button $allButton } if [info exists selColor($entry)] { $entry configure -state normal -foreground $selColor($entry) } else { $entry configure -state normal } focus $entry } # compress_array: compresses a numerically-indexed array and returns its size. proc compress_array array_name { upvar $array_name arr set i 0 set next 0 for {set i 0} {$i < [array size arr]} {incr i} { if { [string compare $arr($i) ""] != 0 } { set arr2($next) $arr($i) incr next } } catch {unset arr} if [info exists arr2] { for {set i 0} {$i < [array size arr2]} {incr i} { set arr($i) $arr2($i) } } return $next } proc menuEntry {frame_name {args}} { set menuName [string trim $frame_name "."] global $menuName canvas tk_version TEXTFONT LABELFONT disabledColor set configure 0 set argc [llength $args] for {set i 0} {$i < $argc} {incr i} { switch -exact -- [lindex $args $i] { configure { set configure 1 } menubutton { if { ![info exists [set menuName](menubutton)]} { return "" } return [set [set menuName](menubutton)] } labelWidgets { if { ![info exists [set menuName](labelWidgets)]} { return "" } return [set [set menuName](labelWidgets)] } -menuvalues { set [set menuName](menuvalues) [join [lindex $args [incr i]]] } menuvalues { if { ![info exists [set menuName](menuvalues)]} { return "" } return [set [set menuName](menuvalues)] } -title { set [set menuName](title) [lindex $args [incr i]] } title { if { ![info exists [set menuName](title)]} { return "" } return [set [set menuName](title)] } -noDFLT { set [set menuName](noDFLT) [lindex $args [incr i]] } noDFLT { if { ![info exists [set menuName](noDFLT)]} { return 0 } return [set [set menuName](noDFLT)] } -prefix { set [set menuName](prefix) [lindex $args [incr i]] } prefix { if { ![info exists [set menuName](prefix)]} { return "" } return [set [set menuName](prefix)] } -textvariable { set [set menuName](textvariable) [lindex $args [incr i]] } -command { set [set menuName](command) [lindex $args [incr i]] } command { if { ![info exists [set menuName](command)]} { return "" } return [set [set menuName](command)] } disable { set labels [menuEntry $frame_name labelWidgets] foreach l $labels { if {[string compare $l ""] == 0} { break } disable_label $l $disabledColor } set mb [menuEntry $frame_name menubutton] $mb configure -state disabled return } enable { set labels [box $frame_name labelWidgets] foreach l $labels { if {[string compare $l ""] == 0} { break } enable_label $l } set mb [menuEntry $frame_name menubutton] $mb configure -state normal return } create { catch {unset $menuName} } getMenuArray { return "[set menuName]" } } } global [set [set menuName](textvariable)] set [set [set menuName](textvariable)] " " set f $frame_name set label [menuEntry $f title] label $frame_name.l -width [string length $label] -text $label -padx 1 \ -pady 1 -justify left -font $LABELFONT set [set menuName](labelWidgets) $frame_name.l menubutton $f.m -relief raised -bd 2 -anchor w -menu $f.m.menu \ -textvariable [set [set menuName](textvariable)] -font $LABELFONT set [set menuName](menubutton) $f.m menu $f.m.menu -borderwidth 2 -relief raised if {$tk_version >= 4.0} { $f.m configure -indicatoron 1 $f.m.menu configure -tearoff 0 } bind_button1 $f.m.menu set k 0 set maxwidth 0 set prefix [menuEntry $f prefix] set values [menuEntry $f menuvalues] foreach v $values { set cascLabel [lindex $v 0] set entries [lrange $v 1 end] set m2 $f.m.menu if {[string compare $cascLabel ""] != 0} { set m2 [menu $f.m.menu.$k] if {$tk_version >= 4.0} { $m2 configure -tearoff 0 } $f.m.menu add cascade -label $cascLabel -menu $m2 \ -font $LABELFONT } if {$k == 0} { set firstentry $m2 } foreach e $entries { set width [string length $prefix$e] if {$width > $maxwidth} { set maxwidth $width } set cmd [menuEntry $f command] if {[string compare $cmd ""] == 0} { $m2 add command -label $prefix$e -font $LABELFONT \ -command \ "set [set [set menuName](textvariable)] $prefix$e" } else { $m2 add command -label $prefix$e -font $LABELFONT \ -command \ "set [set [set menuName](textvariable)] $prefix$e; $cmd $e" } } incr k } if {![menuEntry $f noDFLT]} { $firstentry invoke 0 } $f.m configure -width $maxwidth pack $f.l $f.m -side top -anchor nw } torque-2.4.16/src/gui/xpbsrc.src0000664000113300011330000001446311272401236013427 00000000000000! OpenPBS (Portable Batch System) v2.3 Software License ! ! Copyright (c) 1999-2000 Veridian Information Solutions, Inc. ! All rights reserved. ! ! --------------------------------------------------------------------------- ! For a license to use or redistribute the OpenPBS software under conditions ! other than those described below, or to purchase support for this software, ! please contact Veridian Systems, PBS Products Department ("Licensor") at: ! ! www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org ! 877 902-4PBS (US toll-free) ! --------------------------------------------------------------------------- ! ! This license covers use of the OpenPBS v2.3 software (the "Software") at ! your site or location, and, for certain users, redistribution of the ! Software to other sites and locations. Use and redistribution of ! OpenPBS v2.3 in source and binary forms, with or without modification, ! are permitted provided that all of the following conditions are met. ! After December 31, 2001, only conditions 3-6 must be met: ! ! 1. Commercial and/or non-commercial use of the Software is permitted ! provided a current software registration is on file at www.OpenPBS.org. ! If use of this software contributes to a publication, product, or ! service, proper attribution must be given; see www.OpenPBS.org/credit.html ! ! 2. Redistribution in any form is only permitted for non-commercial, ! non-profit purposes. There can be no charge for the Software or any ! software incorporating the Software. Further, there can be no ! expectation of revenue generated as a consequence of redistributing ! the Software. ! ! 3. Any Redistribution of source code must retain the above copyright notice ! and the acknowledgment contained in paragraph 6, this list of conditions ! and the disclaimer contained in paragraph 7. ! ! 4. Any Redistribution in binary form must reproduce the above copyright ! notice and the acknowledgment contained in paragraph 6, this list of ! conditions and the disclaimer contained in paragraph 7 in the ! documentation and/or other materials provided with the distribution. ! ! 5. Redistributions in any form must be accompanied by information on how to ! obtain complete source code for the OpenPBS software and any ! modifications and/or additions to the OpenPBS software. The source code ! must either be included in the distribution or be available for no more ! than the cost of distribution plus a nominal fee, and all modifications ! and additions to the Software must be freely redistributable by any party ! (including Licensor) without restriction. ! ! 6. All advertising materials mentioning features or use of the Software must ! display the following acknowledgment: ! ! "This product includes software developed by NASA Ames Research Center, ! Lawrence Livermore National Laboratory, and Veridian Information ! Solutions, Inc. ! Visit www.OpenPBS.org for OpenPBS software support, ! products, and information." ! ! 7. DISCLAIMER OF WARRANTY ! ! THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS ! OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ! ARE EXPRESSLY DISCLAIMED. ! ! IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE ! U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, ! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ! LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ! OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! ! This license will be governed by the laws of the Commonwealth of Virginia, ! without reference to its choice of law rules. ! APPLICATION DEFAULT FILES !!! FONTS !! Three fonts that can be configured: ! labelFont - font applied to text that appears in labels. ! fixlabelFont - font appplied to text that label fixed-width widgets. ! NOTE: This MUST be a fixed-width font. ! textFont - font applied to a text widget. Keep this as fixed-width ! font. *labelFont: -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 *fixlabelFont: 7x13bold *textFont: 7x13 !!! COLORS !! Six color resources that can be modified: ! ! backgroundColor - the color applied to background of frames, buttons, ! entries, scrollbar handles. ! foregroundColor - the color applied to text in any context (under \ ! selection, insertion, etc...). ! activeColor - the color applied to the background of a selection, ! a selected command button, or a selected scroll bar ! handle. ! disabledColor - color applied to a disabled widget. ! signalColor - color applied to buttons that signals something to the ! user about a change of state. ! shadingColor - a color shading applied to some of the frames to ! emphasize focus as well as decoration. ! selectorColor - the color applied to the selector box of a radiobutton or ! checkbutton. *backgroundColor: #c8b9a6 *foregroundColor: #150567 *activeColor: #9db2ff *disabledColor: #8f8e8d *signalColor: #c11b17 *shadingColor: #c7af92 *selectorColor: #980517 !! OTHER OPTIONS ! serverHosts - the list of server hosts to be queried by xpbs. ! timeoutSecs - number of seconds before timing out waiting for a ! - connection to a server. ! xtermCmd - the xterm command to run when the PBS interactive feature ! is selected. ! selectHosts - the full host name that will be selected/highlighted with ! its queues automatically listed. ! selectQueues - the queue name that will be selected/highlighted with ! its jobs automatically listed. This is usually the default ! the default queue. ! Format: queue_name@fullHostname *serverHosts: nohost.OpenPBS.org *timeoutSecs: 30 *xtermCmd: xterm -sb *selectHosts: nohost.OpenPBS.org *selectQueues: slow@nohost.OpenPBS.org torque-2.4.16/src/gui/trackjob.tk0000664000113300011330000004165211272401236013554 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # trackjob: defines the layout and functions of the trackjob dialog box. proc trackjob {} { global trackjob_user trackjob_mins trackjob_location \ trackjob_lbox trackjob_output trackjob_button trackjob_normal_color \ LABELFONT trackjobDialogBox activeWindow default \ TRACKJOB_UPDATE_SEQ activeColor busy_cursor set trackjobDialogBox ".trackjob" if [winfo exists $trackjobDialogBox] { wm iconify $trackjobDialogBox wm deiconify $trackjobDialogBox return } ## Bring up the standard Dialog box ## set dbox [popupDialogBox $trackjobDialogBox "Track Job" 0] set activeWindow($trackjobDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{rstart "start/reset tracking"} {stop "stop tracking"} \ {cont "close window"} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdRstart [lindex $cmdButtons 1] set cmdStop [lindex $cmdButtons 2] set cmdCont [lindex $cmdButtons 3] set cmdHelp [lindex $cmdButtons 4] $cmdRstart configure -width 21 -command { busy_cursor trackjob_rstart $trackjob_button configure -background $activeColor remove_busy_cursor } $cmdStop configure -command { incr TRACKJOB_UPDATE_SEQ $trackjob_button configure -background $backgroundColor popupInfoBox $trackjobDialogBox "Job Tracking stopped." } $cmdCont configure -command { if { [string compare $trackjob_location "remote"] == 0 && \ [string compare $RSH ""] == 0 } { popupInfoBox $trackjobDialogBox "The RSH command is not set in Preferences. Please do so as it is used in order to access the files." return } destroy $trackjobDialogBox } $cmdHelp configure -command { xpbs_help trackjob "" } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.u frame $dbox_top.u.p -relief groove -borderwidth 3 frame $dbox_top.u.m frame $dbox_top.u.user frame $dbox_top.u.mins frame $dbox_top.u.out -relief groove -borderwidth 3 frame $dbox_top.u.dest message $dbox_top.u.msg -font $LABELFONT -aspect 2000 \ -text "Periodically check completion of" box $dbox_top.u.user -title "" \ -entrylabels [list "{jobs for user:}"] \ -lboxlabels "{Tracked Users:}" -lboxwidths 20 -lboxheights 3 \ -orient y -array 0 trackjob_user -grabBox $trackjobDialogBox boxLoad $dbox_top.u.user label $dbox_top.u.l -font $LABELFONT -text "mins" set spinBox [buildSpinbox $dbox_top.u.mins 4 1-9999 trackjob_mins "" \ "every" left $default(trackjob_mins)] set minsFrame [lindex $spinBox 0] set minsEntry [lindex $spinBox 1] register_default_action $minsEntry $cmdCont set radioList [list {l "local"} \ [concat r \"remote\"]] set rbox [buildRadioboxes $dbox_top.u.out [list $radioList] \ column 12 "Location of Job Output Files" 1 1] set rboxFrame [lindex $rbox 0] set rboxLocal [lindex $rbox 1] set rboxRemote [lindex $rbox 2] if {![info exists trackjob_location]} { set trackjob_location $default(trackjob_location) } $rboxLocal configure -variable trackjob_location -value local $rboxRemote configure -variable trackjob_location -value remote switch -exact -- $trackjob_location { local {$rboxLocal invoke} remote {$rboxRemote invoke} } set listBoxInfo [buildFullListbox $dbox_top.u.dest 55x5 "Jobs Found Completed"\ yscroll 0 1] set destListframe [lindex $listBoxInfo 0] set trackjob_lbox [lindex $listBoxInfo 3] bind_listbox_single_select $trackjob_lbox register_trackjob_box $trackjob_lbox if [info exists trackjob_output] { foreach el [array names trackjob_output] { $trackjob_lbox insert end "$el" } } pack $dbox_top.u.mins $dbox_top.u.l -anchor nw -side left \ -in $dbox_top.u.m -pady 2m pack $dbox_top.u.msg $dbox_top.u.user $dbox_top.u.m -anchor nw -side top \ -in $dbox_top.u.p pack $dbox_top.u.p $dbox_top.u.out -side left -anchor c -padx 5 pack $dbox_top.u.dest -before $dbox_top.u.p -side bottom -pady 5m pack $dbox_top.header $dbox_top.u $dbox_top.footer -padx 5m tkwait visibility $trackjobDialogBox remove_busy_cursor register_default_action $trackjobDialogBox $cmdCont catch {tkwait window $trackjobDialogBox} boxesUnset set activeWindow($trackjobDialogBox) 0 } # trackjob_auto_update: calls 'trackjob_check' in a polling loop. proc trackjob_auto_update {update_seq} { global trackjob_mins TRACKJOB_UPDATE_SEQ if { $update_seq != $TRACKJOB_UPDATE_SEQ} { return } after [expr $trackjob_mins * 60000] [list trackjob_auto_update $update_seq] trackjob_check } # trackjob_rstart: checks the currently queued or active jobs in the queue for # the list of users given in 'trackjob_user', and keeps track in the # array 'trackjob_array' the list of output and error files. proc trackjob_rstart {} { global trackjob_array trackjob_user trackjob_button trackjob_mins \ PBS_QSTATDUMP_CMD SERVER_HOSTS LINES_TO_IGNORE TRACKJOB_UPDATE_SEQ \ trackjob_lbox trackjob_output backgroundColor timeout_secs \ trackjobDialogBox catch {unset trackjob_array} set userlist [construct_array_args trackjob_user ","] if {[string compare $userlist ""] == 0} { popupInfoBox $trackjobDialogBox "Please specify the user(s) to track." return } if { [string compare $trackjob_mins ""] == 0 } { popupInfoBox $trackjobDialogBox "Please specify the minutes interval first." return } set f [cmdExec_bg "$PBS_QSTATDUMP_CMD -t $timeout_secs -T -u $userlist $SERVER_HOSTS"] if {$f == -1} { popupInfoBox $trackjobDialogBox "Unable to start tracking. See INFO box in main window for details" return } while {[gets $f line] >= 0 && \ ([string compare $LINES_TO_IGNORE ""] == 0 || \ ![regexp $LINES_TO_IGNORE $line]) } { set trackjob_array([lindex $line 0]) "[lrange $line 1 end]" } if [catch {close $f} errmesg] { InfoBox_sendmsg "received message: $errmesg" 0 1 16 } catch {unset trackjob_output} $trackjob_lbox delete 0 end $trackjob_button configure -background $backgroundColor incr TRACKJOB_UPDATE_SEQ after [expr $trackjob_mins * 60000] trackjob_auto_update $TRACKJOB_UPDATE_SEQ popupInfoBox $trackjobDialogBox "Job tracking will start in $trackjob_mins mins." InfoBox_sendmsg "done." 0 1 5 } # trackjob_check: checks for the existence of the output files or error files # as recorded in 'trackjob_array'. If it finds one, then inserts into the # trackjob_lbox (if it exists) the corresponding job id, and changes the # color of 'trackjob_button' to 'signalColor'. If no completed jobs are # found, then it sets the button color back to 'backgroundColor'. proc trackjob_check {} { global trackjob_location RSH trackjob_lbox trackjob_array \ signalColor foregroundColor trackjob_output \ trackjob_button trackjobDialogBox backgroundColor activeColor if {![info exists trackjob_array]} { return } if [winfo exists $trackjobDialogBox] { $trackjob_lbox delete 0 end } catch {unset trackjob_output} InfoBox_sendmsg "Looking for returned output files..." 0 foreach el [array names trackjob_array] { set username [lindex $trackjob_array($el) 0] regexp "(\[^:]+):(\[^ $]+)" [lindex $trackjob_array($el) 1] match \ outputh outputf regexp "(\[^:]+):(\[^ $]+)" [lindex $trackjob_array($el) 2] match \ errorh errorf switch -exact -- $trackjob_location { local { if { [file isfile $outputf] || [file isfile $errorf] } { if [winfo exists $trackjobDialogBox] { $trackjob_lbox insert end "$el" } set trackjob_output($el) $username } } remote { if {\ [cmdExec \ "$RSH $outputh \"test -f $outputf && echo 1\"" \ ] == 1 || \ [cmdExec \ "$RSH $errorh \"test -f $errorf && echo 1\"" \ ] == 1} { if [winfo exists $trackjobDialogBox] { $trackjob_lbox insert end "$el" } set trackjob_output($el) $username } } } InfoBox_sendmsg "." 0 1 } $trackjob_button configure -background $backgroundColor if {[info exists trackjob_output] && [array size trackjob_output] > 0} { $trackjob_button configure -background $signalColor } else { $trackjob_button configure -background $activeColor } InfoBox_sendmsg "done." 0 1 5 } # trackjob_show: displays the contents of the output file and error file of # 'jobid'. proc trackjob_show {jobid} { global TEXTFONT showDialogBox LABELFONT trackjob_array trackjob_location \ RSH busy_cursor set showDialogBox ".show" set dbox [popupDialogBox $showDialogBox "Job Output Dialog"] set activeWindow($showDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] regexp "(\[^:]+):(\[^ $]+)" [lindex $trackjob_array($jobid) 1] match \ outputh outputf regexp "(\[^:]+):(\[^ $]+)" [lindex $trackjob_array($jobid) 2] match \ errorh errorf frame $dbox_top.l1 -class CmdFrame -relief raised -borderwidth 3 frame $dbox_top.l2 -class CmdFrame -relief raised -borderwidth 3 frame $dbox_top.t1 frame $dbox_top.t2 message $dbox_top.l1.olabel -font $LABELFONT -text "OUTPUT FILE: $outputh:$outputf" -aspect 1000 message $dbox_top.l2.elabel -font $LABELFONT -text "ERROR FILE: $errorh:$errorf" -aspect 1000 text $dbox_top.t1.otextbox -borderwidth 5 -setgrid 1 \ -font $TEXTFONT -exportselection true \ -width 80 -height 15 -relief ridge -borderwidth 2 text $dbox_top.t2.etextbox -borderwidth 5 -setgrid 1 \ -font $TEXTFONT -exportselection true \ -width 80 -height 15 -relief ridge -borderwidth 2 bind_text_readonly $dbox_top.t1.otextbox bind_text_readonly $dbox_top.t2.etextbox scrollbar $dbox_top.t1.ovscroll \ -command "$dbox_top.t1.otextbox yview" \ -borderwidth 2 \ -orient vertical \ -relief groove $dbox_top.t1.otextbox configure -yscrollcommand "$dbox_top.t1.ovscroll set" scrollbar $dbox_top.t2.evscroll \ -command "$dbox_top.t2.etextbox yview" \ -borderwidth 2 \ -orient vertical \ -relief groove $dbox_top.t2.etextbox configure -yscrollcommand "$dbox_top.t2.evscroll set" ## COMMAND set ok_button [lindex \ [buildCmdButtons $dbox_bottom {{{ok ok}}} x 20m 10 3] 1] $ok_button configure -command [list destroy $showDialogBox] ## LOAD TEXTBOXES with OUTPUT switch -exact -- $trackjob_location { local { set retcode [catch {open $outputf} fd] if {$retcode != 0} { InfoBox_sendmsg "Error opening file $outputf. Returned: $retcode" 1 1 } else { set output [read $fd] if {[string compare $output ""] != 0} { $dbox_top.t1.otextbox insert end $output } close $fd } set retcode [catch {open $errorf} fd] if {$retcode != 0} { InfoBox_sendmsg "Error opening file $errorf. Returned: $retcode" 1 1 } else { set output [read $fd] if {[string compare $output ""] != 0} { $dbox_top.t2.etextbox insert end $output } close $fd } } remote { set fd [cmdExec_bg "$RSH $outputh cat $outputf"] if {$fd == -1} { return } set output [read $fd] if {[string compare $output ""] != 0} { $dbox_top.t1.otextbox insert end $output } if [catch {close $fd} errmesg] { InfoBox_sendmsg "received message: $errmesg" 0 1 16 } set fd [cmdExec_bg "$RSH $errorh cat $errorf"] if {$fd == -1} { return } set output [read $fd] if {[string compare $output ""] != 0} { $dbox_top.t2.etextbox insert end $output } if [catch {close $fd} errmesg] { InfoBox_sendmsg "received message: $errmesg" 0 1 16 } } } register_default_action $showDialogBox $ok_button # Make all widgets visible pack $dbox_top.l1.olabel -anchor nw -side left pack $dbox_top.l2.elabel -anchor nw -side left pack $dbox_top.t1.otextbox -expand 1 -fill both -side bottom -side left pack $dbox_top.t1.ovscroll -fill y -expand 1 -side right pack $dbox_top.t2.etextbox -expand 1 -fill both -side bottom -side left pack $dbox_top.t2.evscroll -fill y -expand 1 -side right pack $dbox_top.l1 $dbox_top.t1 $dbox_top.l2 $dbox_top.t2 -side top \ -anchor nw -fill x -expand 1 tkwait visibility $showDialogBox remove_busy_cursor catch {tkwait window $showDialogBox} set activeWindow($showDialogBox) 0 } torque-2.4.16/src/gui/pref.tk0000664000113300011330000001565611272401236012716 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # pref: defines the layout and functions of the user preferences # dialog box. proc pref {} { global LABELFONT prefDialogBox activeWindow SERVER_HOSTS XTERM \ timeout_secs RSH busy_cursor ## Bring up the standard Dialog box ## set prefDialogBox ".pref" set dbox [popupDialogBox $prefDialogBox "User Preferences Dialog"] set activeWindow($prefDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.a frame $dbox_top.a.main set servers [buildFullEntrybox $dbox_top.a.main 17 \ "Server Hosts:" 30 "" "right" 0] set serversFrame [lindex $servers 0] set serversEntry [lindex $servers 2] $serversEntry configure -textvariable SERVER_HOSTS frame $dbox_top.a.xterm set xterm [buildFullEntrybox $dbox_top.a.xterm 17 \ "Xterm command" 30 "" "right" 0] set xtermFrame [lindex $xterm 0] set xtermEntry [lindex $xterm 2] $xtermEntry configure -textvariable XTERM frame $dbox_top.a.rsh set rsh [buildFullEntrybox $dbox_top.a.rsh 17 \ "RSH command" 30 "" "right" 0] set rshFrame [lindex $rsh 0] set rshEntry [lindex $rsh 2] $rshEntry configure -textvariable RSH frame $dbox_top.a.secs set spinBox [buildSpinbox $dbox_top.a.secs 4 1-9999 timeout_secs "" \ "wait timeout secs: " left ""] set secsFrame [lindex $spinBox 0] set secsEntry [lindex $spinBox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdOk configure -command { if { [string compare $SERVER_HOSTS ""] == 0 } { popupInfoBox $prefDialogBox "Please specify a server host value" return } if { [string compare $timeout_secs ""] == 0 } { popupInfoBox $prefDialogBox "Please specify a value for wait timeout secs" return } if { [string compare $XTERM ""] == 0 } { popupInfoBox $prefDialogBox "Please specify xterm command" return } destroy $prefDialogBox } $cmdHelp configure -command {xpbs_help preferences $prefDialogBox} register_default_action $serversEntry $cmdOk register_default_action $secsEntry $cmdOk register_default_action $xtermEntry $cmdOk register_default_action $rshEntry $cmdOk register_default_action $prefDialogBox $cmdOk pack $dbox_top.header $dbox_top.a $dbox_top.footer -padx 5m pack $dbox_top.a.main \ $dbox_top.a.secs \ $dbox_top.a.xterm \ $dbox_top.a.rsh -side top -anchor nw -pady 2m tkwait visibility $prefDialogBox remove_busy_cursor catch {tkwait window $prefDialogBox} set activeWindow($prefDialogBox) 0 } torque-2.4.16/src/gui/qterm.tk0000664000113300011330000001541111272401236013077 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qterm: defines the layout and functions of the terminate server dialog box. proc qterm {} { global hostsSelected qtermv cmdpath SERVER_HOSTS activeWindow default \ LABELFONT busy_cursor ## Bring up the standard Dialog box ## set qtermv(DialogBox) ".terminate" set dbox [popupDialogBox $qtermv(DialogBox) "Terminate Server Dialog"] set activeWindow($qtermv(DialogBox)) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.e frame $dbox_top.e.e1 frame $dbox_top.r label $dbox_top.e.l -font $LABELFONT -text "Terminate server(s):" set jobidbox [buildFullListbox $dbox_top.e.e1 30x3 "" xyscroll 0] set jobidFrame [lindex $jobidbox 0] set qtermv(jobidField) [lindex $jobidbox 3] bind_text_readonly $qtermv(jobidField) foreach el $hostsSelected { $qtermv(jobidField) insert end $el } set radiobox [buildRadioboxes $dbox_top.r \ {{{immed "immediate"} \ {delay "delay"} \ }} column 0 "type of shutdown" 1 1 1] set radioboxFrame [lindex $radiobox 0] set radioboxImmed [lindex $radiobox 1] set radioboxDelay [lindex $radiobox 2] $radioboxImmed configure -variable qtermv(type) -value immediate $radioboxDelay configure -variable qtermv(type) -value delay set qtermv(type) $default(qterm_type) ## ARRANGE ON SCREEN pack forget $radioboxFrame $jobidFrame pack $dbox_top.e.l $dbox_top.e.e1 -side left -anchor nw pack $dbox_top.header $dbox_top.e $radioboxFrame $dbox_top.footer \ -side top -anchor nw -padx 14m -pady 3 ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{term terminate} {cancel cancel} {help help}}} x 10m 10 3] set cmdTerminate [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdTerminate configure -command { set exitcode [win_cmdExec $qtermv(DialogBox) \ "$cmdpath(QTERM) -t $qtermv(type) $hostsSelected"] if {$exitcode == 0} { ### Assuming we now have no selected server since their respective servers ### have been killed. set hostsSelected "" set queuesSelected "" after 500 [list getdata $SERVER_HOSTS] destroy $qtermv(DialogBox) } } $cmdCancel configure -command [list destroy $qtermv(DialogBox)] register_default_action $qtermv(DialogBox) $cmdCancel $cmdHelp configure -command {xpbs_help terminate $qtermv(DialogBox)} tkwait visibility $qtermv(DialogBox) remove_busy_cursor catch {tkwait window $qtermv(DialogBox)} set activeWindow($qtermv(DialogBox)) 0 catch {unset qtermv} } torque-2.4.16/src/gui/help/0000777000113300011330000000000011614035201012412 500000000000000torque-2.4.16/src/gui/help/select.acctname.hlp0000664000113300011330000000114111272401235016067 00000000000000The Select Account Name dialog box is for specifying the name of the account that will be checked when limiting the jobs appearing on the Jobs listbox in the main xpbs window. Either click on the radio button next to the account name entry box and type in the name string, or click on the wildcard button "ANY" to consider any account name string. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/move.hlp0000664000113300011330000000130111272401235014002 00000000000000The Move Job dialog box is for moving one more jobs into a selected queue. Use the left mouse button to highlight and select a destination queue in the queue listbox. The list of queues that appear on the listbox are those that are managed by the server host(s) selected in the Hosts listbox in the main xpbs window. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "move" to proceed moving the job(s) to the selected queue. Click on "cancel" to cancel the moving of job(s) to the selected queue and to quit out of this dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/select.resources.hlp0000664000113300011330000000272211272401235016334 00000000000000The Select Resources Attributes dialog box is for specifying the resource amounts/properties to consult when limiting the list of jobs appearing on the Jobs listbox in the main xpbs window. Click on either the resource/op/value radio button, or on the wildcard button "ANY". If the former is selected, specify in the input entry widgets the resource name, the logical operator, and resource amount or property. Move the mouse and button click the "resource" input entry to select a resource name, and do the same for the "op" entry to select a logical operator which could be: "=", "!=", ">", ">=", "<", "<=". When all entries have been filled out, click "add" (or simply hit ). Watch as your input gets loaded into the "Resources" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and then click the accompanying "update" button. You can use the key or to traverse the input entries, to go back to a previous input entry field. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/submit.hlp0000664000113300011330000002253711272401235014355 00000000000000The submit dialog box is composed of 4 distinct regions: (1) Job Script region (2) OPTIONS regions (3) OTHER OPTIONS region (4) Command Buttons region The Job Script file region is at the upper left, the OPTIONS region containing various widgets for setting job attributes is scattered all over the dialog box, the OTHER OPTIONS is located just below the Job Script file region, and Command Buttons region is at the bottom. ================= WORKING FRAMEWORK ================= The framework when working in the Submit dialog box is to first specify the job script file and/or contents (see JOB SCRIPT REGION), then manipulate the appropriate widgets to set job attributes, and finally click on any of the command buttons at the bottom of the dialog box to invoke an action, particularly the submission of a job. ================= JOB SCRIPT REGION ================= The job script region is composed of a header box, the text box, FILE entry box, and a couple of buttons labeled "load" and "save". The job script header box has a "Prefix" entry box that can be modified to specify the PBS directive to look for when parsing a script file for PBS options. The default value for the prefix is whatever the environment PBS_DPREFIX is set to, or if not set, then "#PBS". The text box is where you can also type in the execution lines of the job. You can use the arrow keys (left, right, up, down) for moving the text insertion cursor around the box. You can use the standard backspace, delete keys, and also can mouse highlight portions of text for deletion, or overwrite. The FILE entry box is for specifying the name of the script to load whose leading lines that match the PBS directive are mapped to job attribute (widget) values, and non-matching lines (job execution lines) are automatically loaded into the text box. To accomplish this, click on the "load" command button after specifying the script FILE. The default directory path of the file is the directory where "xpbs" was executed. Wildcards (*, ~) in a filename will be recognize. NOTE: The accompanying "FILE.." button will bring up the File Selection dialog that will also allow you to change the current working directory. Click on "save" for saving the current attribute values, and execution lines found in the text box to a script file named in the FILE entry box. This script file can later be read by xpbs or qsub. Clicking the "save" button isolates all (#PBS) directive lines from non-PBS lines. The newly-saved script file may or may not be identical to the original script file depending on what PBS options are set. For example, suppose you have the following original script named "job.test": #!/bin/sh #PBS -l nodes=1 #PBS -l walltime=00:45:00 #PBS -a 07172300 /u/wk/bayucan/pbs-dejagnu-1.2/dejagnu/pbs-tests/job/shortjob hi there After clicking "save", you will get: #PBS -l nodes=1,walltime=00:45:00 #PBS -q @nohost.OpenPBS.org #PBS -a 199607172300.00 #!/bin/sh /u/wk/bayucan/pbs-dejagnu-1.2/dejagnu/pbs-tests/job/shortjob hi there NOTE: The -l option settings were combined into one #PBS line, the execution time argument (-a) was expanded, and the destination queue was made explicit (-q option). ============== JOB ATTRIBUTES ============== The rest of the widgets that are waiting to be manipulated by user represent job attribute values. These are: Job Attribute How to Operate ------------- -------------- Job Name Type in the name of the job on the Job Name entry widget. You can use left, right arrow keys, and mouse highlight to select and overwrite or delete text. Priority Type in the job priority value (between -1024 and 1023) on Priority spinbox, or click on the scrollbar arrows to increment up or down the valid spinbox values. Account Name Type in the account name (usually used for CPU charging) on the Account Name entry widget. Hold Job Click on the Hold Job toggle button to place a user hold on the job upon submission. Execution Time Click on the button "Later at" if you want to specify a date/time when the job should be eligible for queueing and execution. Destination Simply highlight to select the queue where the job will be placed. The queues listed in the box are those that are managed by the selected server host. The special entry "@hostname" is for allowing the job to be queued to the host's default queue. Mail Click on the command button, "email addrs", to specify who to notify to notify regarding job status. Click any of the 3 toggle buttons, "job aborts", "job begins execution", "job terminates", to specify the condition when email should be sent out. Output Click on the various radio buttons to indicate whether the job output should be merged to stdout, to stderr, or to neither stdout or stderr. Click on the various check buttons to toggle the conditions of retaining the stdout files and/or stderr files in the execution host. Type in "Stdout File Name/ Hostname" and "Stderr File Name/Hostname" for the output files for the job. NOTE: The accompanying "Stdout File Name.." and "Stderr File Name.." buttons will bring up the File Selection dialog for a point-and-click way of specifying the filenames. Resources Move the mouse and button click the "resource" input entry to select a resource name, and in the second input field enter the resource value. When both entries have been filled out, click "add" (or simply hit ). Watch as your input gets loaded into the "Resources" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and then click the accompanying "update" button. You can use the key or to traverse the input entries, to go back to a previous input entry field. You can use the left and right keys to move left or right within an entry field, highlight to select a character and type any key to overwrite the selected text, or type delete, backspace to delete a selected or un-selected text. The "help" pull down button will give you a description of the different resources that can be requested when submitting jobs, as according to architecture type. NOTE: The list of valid resources for the "resource" input entry can be specified via the *jobResourceList xpbs resource. Environment Variables Click on the "Current" toggle button to specify that the current command line environment is to be exported to the job's execution environment. Specify in the first field (variable input entry) the name of the environment variable, and the value on the second field (value input entry). Watch as your input gets loaded into the "Variables" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and finally click the accompanying "update" button. You can use the key or to traverse the input entries. to go back to a previous input entry field. Clicking tab after entering the variable name will automatically fill the value field with the current value. You can use the left and right keys to move left or right within an entry field, highlight to select a character and type any key to overwrite the selected text, or type delete, backspace to delete a selected or un-selected text. Job Dependency Click on the "job dependency" command button under the "OTHER OPTIONS" box to bring up a dialog box for specifying the synccount, syncwith, on, after, afterok, afternotok, afterany, before, beforeok, beforenotok, beforeany depend attributes of the job. File Staging Click on the "file staging" command button under the "OTHER OPTIONS" box to bring up a dialog box for specifying the stagein and stageout attributes of the job. Misc Click on the "misc" command button under the "OTHER OPTIONS" box to specify the checkpoint attribute, rerunnable attribute, list of Unix shells, user names, and groups to use when executing the job. =============== COMMAND BUTTONS =============== At the bottom of the Submit dialog box is a row of command buttons. Click on "confirm submit" after specifying the script file and job attributes to submit a job to the specified destination queue. Click on "interactive" to run a job interactively. This will bring up an xterm window containing the session. Before running "PBSsh", you may want to specify the Resources attributes of the job first. Click on "cancel" if you don't want to submit the job at this time. Click on "reset options to default" if you want to reset the widget values (i.e. job attribute values) to default values (usually null) for the Submit dialog box only. This does not reset the values for "job dependency", "file staging", and "misc" widgets. This is useful for restarting the process of setting job attributes. torque-2.4.16/src/gui/help/delete.hlp0000664000113300011330000000117011272401235014302 00000000000000The Delete Job dialog box is for deleting one or more of the selected jobs. Specify the number of seconds delay between the sending of SIGTERM and SIGKILL to a running job by typing a valid value on the spinbox entry, or manipulating the scrollbar arrows to increment through the valid values. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "delete" to proceed with job deletion. Click on "cancel" to cancel job deletion and to quit out of this dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/terminate.hlp0000664000113300011330000000117311272401235015033 00000000000000The Terminate Server dialog box is for terminating the PBS server on one or more selected hosts. Click on either the "immediate" or "delay" radio button for specifying the type of shutdown to perform. See man pages for qterm for the definition of these shutdown types. =============== COMMAND BUTTONS =============== This region of command buttons represent the final step when manipulating this dialog box. Click on "terminate" to proceed with the PBS server termination. Click on "cancel" to cancel the PBS server termination and quit out of this dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/select.owners.hlp0000664000113300011330000000225511272401235015640 00000000000000The Select Owners dialog box is for specifying the list of owners that will be checked when limiting the jobs appearing on the Jobs listbox in the main xpbs window. Click on either the wildcard radio button ANY to specify any owners, or the user@host radio button. If the latter is selected, then type in the first field the user name, and in second field the hostname from where the job was originally submitted. You can also skip the hostname part altogether. After typing your input, click the "add" button. Watch as your input gets loaded into the "Owners:" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry, which would result in its values to be loaded into the "user" and "host" input entries, then change the value of the input entries, and finally click the accompanying "update" button. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/auto_update.hlp0000664000113300011330000000141011272401235015347 00000000000000The Automatic Update dialog box is for specifying the interval number of minutes for periodically taking updates of hosts, queues, and jobs data. Either type in the minutes value on the spinbox entry, or click on the scrollbar arrows of the spinbox to display valid values (> 0). NOTE: If the "Manual Update" option is selected while auto update feature is enabled, auto updating will automatically be canceled. Click on the "start updating" command button to signal automatic updating of data. Click on the "stop updating" command button to signal an end to automatic updates of data. Click on the "close window" command button to close the dialog box. This is also the default action (as indicated by a sunken look of the button) when the key is pressed. torque-2.4.16/src/gui/help/fileselect.hlp0000664000113300011330000000316711272401235015167 00000000000000The File Selection dialog box allows the selection of a single file from the the directory tree path of the local host. This single file can be used as input to script filename, stdout file/path, stderr file/path, file staging pathname when submitting or altering jobs. The listing directory is specified in SELECTION DIRECTORY entrybox, and the name of the local host is given in HOST. The accompanying listbox shows the list of files/directories in the "SELECTION DIRECTORY". ============= FILES LISTBOX ============= Single clicking a file will display the filename on the "FILE Selected" entry box. Double clicking on a directory will refresh the display of the listbox to show the files in the selected directory. You can also manually enter the name of the directory on the "SELECTION DIRECTORY" entrybox, hit , and then the files in that directory will be listed. You can also manually enter the filename of your choice on the "FILE Selected" entrybox. If the label "CURRENT WORKING DIRECTORY" is displayed, a button named "cd " will usually accompany it for making the "SELECTION DIRECTORY" (listed just above the selection listbox) the current working directory. The current working directory is the default directory that will be known to PBS commands when they are issued by xpbs. For example, when submitting jobs, the current working directory determines where the default job *.o and *.e files will be placed. =============== COMMAND BUTTONS =============== Click "Select File" if you want to accept filename specified on the "FILE Selected" entry box. This filename can even be the empty string. torque-2.4.16/src/gui/help/concur.hlp0000664000113300011330000000254711272401235014342 00000000000000The Concurrency Set dialog box contains widgets for instructing xpbs that the job being submitted is to be part of a set of concurrently executing jobs. The dialog box is composed of a set of radioboxes that respond to mouse button clicks for setting the number of additional jobs to be executed concurrently with the current job (synccount), or for adding the current job to an existing set of jobs that are dependent on each other for execution (syncwith). The "synccount" (first button) is for declaring this job being submitted to be the leader of the group; "syncwith" (second button) is simply for adding this job to an existing group with an already designated job leader. To specify the job leader in the second button, either select the job from the listbox, which lists all jobs currently known to xpbs from a recent poll, or to type the job id directly on the accompanying entrybox. On the listbox, you can also double click a job id to obtain more information about the job. ================ Command Buttons ================ Click on "ok" button after you are satisfied with the concurrency dependency attribute value of the job. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. Click on "reset to default" if you want to reset the concurrency dependency attribute values to the default settings. torque-2.4.16/src/gui/help/trackjob.hlp0000664000113300011330000000550711272401235014647 00000000000000The Track Job dialog box is for enabling the periodic checking of returned output files of running jobs. =================== MONITORED USER JOBS =================== The list of users whose jobs are to be monitored for returned output files can be specified by typing the username in the input entry, and then clicking the "add" button. Watch as your input gets loaded into the "Tracked Users:" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry, which would result in its values to be loaded into the input entry, then change the value of the input entry, and finally click the accompanying "update" button. ======== INTERVAL ======== Setting the interval number of minutes is done by manipulating a spin box located at the bottom of the user name entries. Either type in a valid minutes value (> 0) on the spinbox entry, or click on the scrollbar arrows to increment through the valid values. ============================ LOCATION OF JOB OUTPUT FILES ============================ A pair of radio buttons located at the upper right of the dialog box will inform xpbs if the job output files being monitored are local (host where xpbs was run), or would require some remote shell command to access the output files. If the output files are returned to some remote host, then xpbs will execute an RSH test -f to test existence of returned output files. RSH is whatever the remote shell entry box is set to. NOTE: Be sure the files are accessible from the host where xpbs was run (i.e. .rhosts appropriately set). The use of remote shells can potentially slow down the execution of xpbs so using this feature for remote files is discouraged. ===================== RETURNED OUTPUT FILES ===================== When an output file for a user job being monitored is found, then the "Track Job" button (the one that originally invoked this dialog box) will turn into a different color, and the "Jobs Found Completed" listbox is then loaded with the corresponding job id(s). Click on a job id to see the contents of the output file and the error file. =============== COMMAND BUTTONS =============== Clicking on these buttons represent the last step when manipulating this dialog box. Click "start/reset tracking" to: 1. cancel any previous tracking 2. build a new list of jobs to be monitored for returned output files by checking the currently queued jobs. 3. start periodic tracking NOTE: Be sure to submit the jobs that you want monitored first before enabling this feature. Click "stop tracking" to cancel any previous tracking without enabling a new tracking cycle. Click "close window" to exit out of the dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/datetime.hlp0000664000113300011330000000127211272401235014637 00000000000000The date/time dialog box is for setting a date/time parameter. It contains 6 spin boxes representing hour, minute, secs, month, day, and year. To manipulate the spin boxes, simply use the up and down arrows of the scrollbar to increment through valid values, or simply type in a valid value on the spinbox entry box. =============== COMMAND BUTTONS =============== Click on the "Ok" button when you're done setting values for the various widgets. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. If any of the spinboxes are left blank, it will not allow you to quit out of the dialog box until you've put in a valid value. torque-2.4.16/src/gui/help/select.rerun.hlp0000664000113300011330000000103511272401235015451 00000000000000The Select Rerunnable Attribute dialog box is for specifying the rerunnable attribute value to consult when limiting the list of jobs appearing on the Jobs listbox in the main xpbs window. Click on one of the radio buttons marked "y", "n", and "ANY" to specify the attribute value. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/after_depend.hlp0000664000113300011330000000332211272401235015461 00000000000000The After Dependency dialog box contains widgets for instructing xpbs that the job being submitted can only begin execution after one or more other jobs have started execution, terminated with errors, terminated without errors, and terminated with or without errors. The job ids with an "after" dependency on the job being submitted can be specified by selecting one or more job ids from the listbox, which lists all jobs currently known to xpbs from a previous poll, or typing directly into the "after:", "afterok:", "afternotok:", and "afterany:" entry boxes. If you select from the listbox, then be sure to click on one of the command buttons: "started execution", "terminated without errors", "terminated with errors", and "terminated with or without errors" to specify your intention. Note that after clicking a command button, the job ids selected will be displayed on the accompanying entry boxes with ":" being the separator for multiple job ids. If you specify the job ids manually, be sure to separate them with ":". This dialog box also contains a spinbox for specifying how many other jobs that this job is dependent on for its execution; that is, this job can only be scheduled for execution after dependencies on "count" number of jobs have been satisfied. On the listbox, you can also double click a job id to obtain more information about the job. ================ Command Buttons ================ Click on "ok" button after you are satisfied with the after dependency attribute value of the job. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. Click on "reset to default" if you want to reset the after dependency attribute values to the default settings. torque-2.4.16/src/gui/help/staging.hlp0000664000113300011330000000716611272401235014507 00000000000000File staging allows you to specify which (if any) files to copy onto the execution host before the job starts, and which (if any) to copy off when the job completes. PBS staging works like this: "move file X from HERE to THERE". Both HERE and THERE can be relative or absolute. The File Staging dialog box is composed of 3 regions: (1) File Selection Box region (2) Stagein/Stageout region (3) Command Buttons ================== File Selection Box ================== This is originally "iconized" in the form of a button labeled "Click me to bring up File Selection Box..". Upon clicking this button, the file selection box will be displayed to allow the selection of a single file from the the directory tree path of the local host. This single file can be used as input to HERE host/input_file in Stagein, and HERE host/output_file in Stageout of files. The listing directory is specified in SELECTION DIRECTORY entrybox, and the name of the local host is given in HOST. The accompanying listbox shows the list of files/directories in the "SELECTION DIRECTORY". Single clicking a file will display the filename on the "FILE Selected" entry box. Double clicking on a directory will refresh the display of the listbox to show the files in the selected directory. You can also manually entry the name of the directory on the "SELECTION DIRECTORY" entrybox, hit , and then the files in that directory will be listed. You can also manually enter the filename of your choice on the "FILE Selected" entrybox. To remove the "File Selection Box" from view, click on "Click me to remove File Selection Box". ======================= Stagein/Stageout region ======================= The Stagein/Stageout region contains 2 box widgets for specifying the stagein and stageout attribute values of the job. These attributes represent what files are staged (copied) in before job start, or staged out after job completes execution. Type in the values for stagein hostname, input file, and local file, and the stageout hostname, output file, local file in the provided input entry widgets. That is, on each entry, specify the "input file" ("host" specifies its location) that will be copied to the execution host as "local file" before job execution starts. Similarly, specify the "local file" on the execution host that will be copied back to "host" as "output file" when job execution finishes. Or, click on the accompanying button "Add file selected from File Selection Box" to load the selected file into the input entries. After you've entered the values, then click the accompanying "add" buttons. Watch as your input gets loaded into the "Stagein_Files:" and "Stageout_Files:" listboxes. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in a listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and then click the accompanying "update" button. You can move through the input entry fields using , , or (to go backwards). A horizontal scrollbar is associated with each field to scan horizontally a long input string. Within an entry field, you can use the left and right arrow keys, backspace or delete key, and mouse to highlight/select a text for immediate overwriting of newly typed character. ================ Command Buttons ================ Click on "ok" button after you are satisfied with the stagein/stageout attribute values set for the job. Click on "reset to default" if you want to reset the stagein/stageout attribute values to the default settings. torque-2.4.16/src/gui/help/notes.hlp0000664000113300011330000000727411272401235014203 00000000000000xpbs-1.2.12 =========== - minor fix for Tcl 8.4 xpbs-1.1.11 =========== - rid of the inefficient matrix of entry boxes and replaced them with specialized listboxes accompanied by input entry widgets. - the list of valid resources for the "Resource" box is now presented in a pull-down menu. (change request #1089). xpbs-1.1.10 (released July '97): ================================ - "Update Data Auto" and the "Track Job" buttons will appear in a different color when their functions are enabled by user. - The unnecessary vertical scroll bar in the INFO box has been removed. - Collapsed the set of selection criteria command buttons on the JOBS panel into a single drop-down menu box. - Forced newly-opened windows/sub-windows to be placed in a location that intersects the mouse pointer coordinates. (more precise placement of windows). - incorporated these release notes into the "About..." dialog box. - changed the name of the "NodesInUse" column on the HOSTS display to "PEsInUse" for processing elements in use. Also, the "Nodes" column on the JOBS display has been renamed to "PEs". For serves compiled in a non-NEEDNODES=1 model, PEsInUse value will be the resources_max.ncpus server attribute, and PEs will be the Resource_List.ncpus job attribute value. xpbs-1.1.9 (released Dec '96): ============================== - The HOSTS display on the main window now includes a "NodesInUse" column. - The JOBS display on the main window now includes information about # of "Nodes" requested, and "WalltimeUsed". - The Job Dependency dialog box was overhauled: it now breaks down into 3 sub-dialog boxes: Concurrency Set, After Dependency, and Before Dependency with each box allowing users to select the job ids from a listbox, instead of only allowing the typing of job ids. - It now behaves in a way where an active window will always be on top of inactive windows. - Several bug fixes xpbs-1.1.8.1 (released as a patch file Oct '96): ================================================ - fixed the following 2 bugs: 1. specifying a non-existent script file hangs xpbs. 2. an empty script body is not detected under Tk 4.0/4.1. - fixed Makefile and setup.sh so that script files are copied to the target directory during "./make" instead of at "./make install". This allows building of the GUI where the source is on one machine, and the target is on another machine, and the target cannot read the source as root. xpbs-1.1.8 (official release Aug '96): ====================================== - changed "Update Data Manually" label to simply "Manual Update" - changed "Update Data Auto" label to simply "Auto Update" - moved the Close button to the end in the menu bar. - improved the packing of widgets in the qsub/qalter windows to lessen flicker. xpbs-1.1.7b (beta release July '96): ==================================== - The number of entries in the matrix of entry widgets is now unlimited. - Submit button has now been moved from the menu bar to the Hosts area. - Clicking Submit button will not require users to have to select a single host from the Hosts listbox. Instead, if it detects more than one host are selected, then a bridge window opens up asking users to filter the selection. - Some checking for illegal characters are now done for entry widgets. Will be more exhaustive in future releases. - On the Submit window, switched the positions of the FILE entry box and the Job script textbox. - Improved the help notes and labeling of the widgets in the File staging window. Made file staging more clearer by following the example in the Parallel/PBS Web page. - Made the default size of the server window to be 4 instead of 3 for both "xpbs" and "xpbs -admin". - Many bug fixes. torque-2.4.16/src/gui/help/modify.hlp0000664000113300011330000001362211272401235014334 00000000000000The Modify dialog box is composed of 4 distinct regions: (1) Job id(s) region (2) Job Attributes region (3) Other Job Attributes region (4) Command Buttons region ================= WORKING FRAMEWORK ================= The framework when working under the Modify dialog box is to first manipulate the appropriate widget to set the replacement value or additional value for a job attribute, and then to click on any of the command buttons at the bottom of the dialog box to invoke an action, particularly "modify". ================= JOB ID(S) REGION ================= This shows the job id(s) whose attributes are currently being modified. ============== JOB ATTRIBUTES ============== Job Attribute How to Operate ------------- -------------- Job Name Type in the new name of the job on the Job Name entry widget. You can use left, right arrow keys, and mouse highlight to select and overwrite or delete text. Priority Type in the new job priority value (between -1024 and 1023) on the Priority spinbox, or click on the scrollbar arrows to increment up or down the valid spinbox values. Account Name Type in the new account name of the job (usually used for cpu charging) on the Account Name entry widget. Execution Time Click on the button "Later at" if you want to specify a new date/time when the job should be eligible for queueing and execution. Mail Click on the command button, "email addrs", to specify the new list of addresses to notify about job status. Click to toggle on any of the 3 check buttons, "job aborts", "job begins execution", "job terminates", to specify the replacement condition when email should be sent out. Output Click on the various radio buttons to indicate whether the job output should be merged to stdout, to stderr, or to neither stdout or stderr. Click on the various check buttons to toggle the conditions of retaining the stdout files and/or stderr files in the execution host. Type in "Stdout File Name/ Hostname" and "Stderr File Name/Hostname" for the output files for the job. NOTE: The accompanying "Stdout File Name.." and "Stderr File Name.." buttons will bring up the File Selection dialog for a point-and-click way of specifying the filenames. Resources Move the mouse and button click the "resource" input entry to select a resource name, and in the second input field enter the resource value. When both entries have been filled out, click "add" (or simply hit ). Watch as your input gets loaded into the "Resources" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and then click the accompanying "update" button. You can use the key or to traverse the input entries, to go back to a previous input entry field. You can use the left and right keys to move left or right within an entry field, highlight to select a character and type any key to overwrite the selected text, or type delete, backspace to delete a selected or un-selected text. The "help" pull down button will give you a description of the different resources that can be requested when submitting jobs, as according to architecture type. NOTE: The list of valid resources for the "resource" input entry can be specified via the *jobResourceList xpbs resource. Hold Types Click on the appropriate toggle button and radio button to update the list of hold types for the job. The hold types can be user, other, system, or n (no hold types or Clear all). No effect if the "Place" radio button is clicked but no hold type is selected. Job Dependency Click on the "job dependency" command button under the "OTHER OPTIONS" box to bring up a dialog box for updating the synccount, syncwith, on, after, afterok, afternotok, afterany, before, beforeok, beforenotok, beforeany depend attributes of the job. File Staging Click on the "file staging" command button under the "OTHER OPTIONS" box to bring up a dialog box for updating the stagein and stageout attributes of the job. Misc Click on the "misc" command button under the "OTHER OPTIONS" box to update the checkpoint attribute, rerunnable attribute, list of Unix shells, user names, and groups to use when executing the job. =============== COMMAND BUTTONS =============== At the bottom of the Modify dialog box is a row of command buttons. Click on "confirm modify" if you are satisfied with the widget settings and would want to proceed with the job alteration. Click on "cancel" if you don't want to modify the job at this time. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. Click on "reset options to default" if you want to reset the widget values (i.e. job attribute values) to default values (usually null) for the Modify dialog box only. This does not reset the values for "job dependency", "file staging", and "misc" widgets. This is useful for restarting the process of updating job attributes. torque-2.4.16/src/gui/help/misc.hlp0000664000113300011330000001014211272401235013772 00000000000000The Miscellaneous dialog box is for specifying various other job attributes like checkpointing, rerunnability, and what shell, disk group, and user name to use during execution of a job. The Miscellaneous dialog box is composed of 5 regions: (1) "Various" job attributes region (2) Shell Path List region (3) User List region (4) Group List region (5) Command buttons region =============================== "Various" job attributes region =============================== This region contains 2 toggle buttons that respond to mouse clicks for specifying the checkpoint attribute and rerunnable attribute of the job. Each toggle button enables radio buttons that represent mutually exclusive choices. Within "Checkpoint Job", a spinbox for specifying the checkpoint interval (in minutes) is made available which can be manipulated by clicking on the arrows of the scrollbar to increment through the valid values, or manually entering a valid value on the spinbox entry box. =============== Shell Path List =============== This contains a box containing input entry widgets for specifying the shell path (first field), and the hostname (2nd field) where the shell path will be used to interpret a job script. Click the "add" button after entering the values. Watch as your input gets loaded into the "Shell Paths:" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and then click the accompanying "update" button. The widget will only allow (as string matching allows) one unique shell path per host. An entry without the hostname part will be the default. ========== User List ========== This contains a box containing input entry widgets for specifying the username (first field), and the matching execution host (2nd field). Click the "add" button after entering the values. Watch as your input gets loaded into the "Usernames:" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and then click the accompanying "update" button. The widget will only allow (as string matching allows) one unique username per host. An entry without the hostname part will be the default. ========== Group List ========== This contains a box containing input entry widgets for specifying the group name (first field), and the matching execution host (2nd field). Click the "add" button after entering the values. Watch as your input gets loaded into the "Groups:" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry via mouse, which would result in its values to be loaded into the input entries, then change the values of the input entries, and then click the accompanying "update" button. The widget will only allow (as string matching allows) one group name per host. An entry without the hostname part will be the default. ================ Command Buttons ================ Click on "ok" button after you are satisfied with the attribute values of the job. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. Click on "reset to default" if you want to reset the misc attribute values to the default settings. ====================================== Manipulating the Matrix of Entry boxes ====================================== You can traverse each row of the box of entry widgets by using , , or (to move backwards). The up and down arrows to the right of the box are for moving through the entries in fixed pages. The scrollbar at the top of each vertical group of fields is for horizontally scanning a long entry string. torque-2.4.16/src/gui/help/message.hlp0000664000113300011330000000124511272401235014467 00000000000000The Send Message to Running Job dialog box is for sending some message string to selected running job(s). Enter the message in the "Send message" entry box, and click on the toggle buttons to specify whether the message is to be delivered to stdout or stderr of the job(s). =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "Send Message" to proceed sending the message to the selected job(s). Click on "cancel" to cancel the sending of message to the selected job(s) and to quit out of this dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/hold.hlp0000664000113300011330000000103211272401235013763 00000000000000The Hold Job dialog box is for placing a user, other, or system hold type to one or more of the selected jobs. To specify the hold type, click on one of the toggle buttons. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "hold" to proceed with the holding of job(s). Click on "cancel" to cancel placing a hold type on the job(s) and to quit out of this dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/select.checkpoint.hlp0000664000113300011330000000215511272401235016451 00000000000000The Select Checkpoint attribute dialog box is for specifying the checkpoint attribute relationship to consult, when limiting the list of jobs appearing on the Jobs listbox in the main xpbs window. Enter a valid logical operator in the Checkpoint Attribute spinbox, and click "on one of the radio buttons "n", "s", "c=", "c", "u", or "ANY" to put together a relationship for restricting the list of jobs. For "c=", a corresponding minutes spinbox is given for specifying the checkpoint interval. The values of the Checkpoint attribute are defined to have the following ordered relationship: n > s > c=minutes > c > u The valid checkpoint operators for checkpoint values "n", "s", "c=", and "c" are "=", "!=", ">", ">=", "<", "<=". But for checkpoint value "u", the valid operators are "=" and "!=", and for checkpoint value "ANY", the valid operator is "=" only. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/select.states.hlp0000664000113300011330000000106211272401235015621 00000000000000The Select Job States dialog box is for specifying the list of job states to look for when limiting the jobs appearing on the Jobs listbox in the main xpbs window. Simply click on any of 6 toggle buttons to specify R (running), Q (queued), W (waiting), H (held), E (exiting), and T (transiting) states. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/select.qtime.hlp0000664000113300011330000000170611272401235015442 00000000000000The Select Queue Time attribute dialog box is for specifying the Execution Time attribute relationship to consult (when to queue), when limiting the list of jobs appearing on the Jobs listbox in the main xpbs window. Enter a valid logical operator in the Queue Time spinbox, and click "on either the date/time button, or on the wildcard button "ANY" to setup a logical relationship to consult when restricting the list of jobs. For the date/time button, the valid Queue Time operators are "=", "!=", ">", ">=", "<", "<=". But for checkpoint value "ANY", the valid operator is "=" only. Specification of date/time parameter is done by manipulating the hour, minutes, seconds, month, day, year spin boxes. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/select.hold.hlp0000664000113300011330000000104011272401235015240 00000000000000The Select Hold Type dialog box is for specifying the SET of hold types to look for in a job, when limiting the jobs appearing on the Jobs listbox in the main xpbs window. Simply click on any of 3 toggle buttons to specify u (user), o (other), and s (system) for the hold types string. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/main.hlp0000664000113300011330000003556411272401235014002 00000000000000The main xpbs window is composed of 5 distinct areas (subwindows) arranged vertically (one on top of another) in the following order: 1) Menu region 2) Hosts region 3) Queues region 4) Jobs region 5) Info region =========== Menu region =========== The Menu area is composed of a row of command buttons that signal some action with a click of the left mouse button. The buttons are: Manual Update - to update the information on hosts, queues, and jobs. NOTE: choosing this option will automatically cancel any auto updates in progress. Auto Update - same as "Update Data Manually" except updating is done automatically every number of minutes. If currently enabled by user, the button will appear in a different color. Track Job - for periodically checking for returned output files of jobs. If currently enabled by user, the button will appear in a different color. Preferences - for setting certain parameters such as the list of server host(s) to query. Help - contains this help page. About - tells of the author and who to send comments, bugs, and suggestions to. Close - for exiting xpbs plus saving the current setup information in the user's $HOME/.xpbsrc file. Information saved include the selected host(s), queue(s), job(s), the different jobs listing criteria, the view states (i.e. minimized/maximized) of the Hosts Queues, Jobs, and INFO regions, and anything in the Preferences section. ============ Hosts region ============ The Hosts area is composed of a leading horizontal HOSTS bar, a listbox, and a set of command buttons. The HOSTS bar contains a minimize/maximize button, identified by a dot or a rectangular image, for displaying or iconizing the Hosts region. The listbox displays information about "favorite" server host(s), and each entry is meant to be selected via a single left mouse button click, shift key + mouse button 1 click for contiguous selection, or cntrl key + mouse button 1 click for non-contiguous selection. The command buttons represent actions on selected host(s), and commonly found buttons are: detail - for obtaining detailed information about selected server host(s). This functionality can also be achieved by double clicking on an entry in the Hosts listbox. Submit - for submitting a job to any of the queues managed by the selected server host(s). terminate - for terminating PBS servers on selected host(s). (-admin only) The server hosts can be chosen by specifying in the $HOME/.xpbsrc file (or .Xdefaults) the resource: *serverHosts: hostname1 hostname2 ... Another way of specifying the host is to click on the Preferences button in the Menu region, and manipulate the server Hosts entry widget from the preferences dialog box. ============= Queues region ============= The Queues area is composed of a leading horizontal QUEUES bar, a listbox, and a set of command buttons. The QUEUES bar lists the hosts that are consulted when listing queues; the bar also contains a minimize/maximize button for displaying or "iconizing" the Queues region. The listbox displays information about queues managed by the server host(s) selected from the Hosts listbox; each listbox entry is meant to be selected (highlighted) via a single left mouse button click, shift key + mouse button 1 click for contiguous selection, or cntrl key + mouse button 1 click for non-contiguous selection. The command buttons represent actions for operating on selected queue(s), and commonly found buttons are: detail - for obtaining detailed information about selected queue(s). This functionality can also be achieved by double clicking on a Queues listbox entry. stop - for stopping the selected queue(s). (-admin only) start - for starting the selected queue(s). (-admin only) disable - for disabling the selected queue(s). (-admin only) enable - for enabling the selected queue(s). (-admin only) =========== Jobs region =========== The Jobs area is composed of a leading horizontal JOBS bar, a listbox, and a set of command buttons. The JOBS bar lists the queues and other criteria that are consulted when listing jobs; the bar also contains a minimize/maximize button for displaying or "iconizing" the Jobs region. The listbox displays information about jobs that are found in the queue(s) that are selected from the Queues listbox; each listbox entry is meant to be selected (highlighted) via a single left mouse button click, shift key + mouse button 1 click for contiguous selection, or cntrl key + mouse button 1 click for non-contiguous selection. The "Other Criteria" drop-down menu describes selection criteria used for further filtering the contents of the Jobs listbox. The list of jobs can be selected according to the owner of jobs (Owners), job state (Job_States), name of the job (Job_Name), type of hold placed on the job (Hold_Types), the account name associated with the job (Account_Name), checkpoint attribute (Checkpoint), time the job is eligible for queueing/execution (Queue_Time), resources requested by the job (Resources), priority attached to the job (Priority), and whether or not the job is rerunnable (Rerunnable). The selection criteria can be modified by selecting the appropriate menu entry that would bring up a selection box. The menu is accompanied by a "Select Jobs" button, which when clicked, will update the contents of the Jobs listbox based on the new selection criteria. Finally, to the right of the listbox, the Jobs region is accompanied by the following command buttons, for operating on selected job(s): detail - for obtaining detailed information about selected job(s). This functionality can also be achieved by double clicking on a Jobs listbox entry. modify - for modifying attributes of the selected job(s). delete - for deleting the selected job(s). hold - for placing some type of hold on selected job(s). release - for releasing held job(s). signal - for sending signals to selected job(s) that are running. msg - for writing a message string into the output streams of the selected job(s). move - for moving selected job(s) into some specified destination queue. order - for exchanging order of two selected jobs in a queue. run - for running selected job(s). (-admin only) rerun - for requeueing selected job(s) that are running. (-admin only) =========== Info region =========== xpbs is a GUI front end to the PBS commands; it actually calls PBS commands after the user has set widget values. The Info Area shows the progress of the commands' executed by xpbs. Look into this box for errors. The INFO bar contains a minimize/maximize button for displaying or "iconizing" the Info region. ================ User Preferences ================ A global xpbs resources file (set by the administrator) is read first and then the user's preference file, $HOME/.xpbsrc is loaded. Keep in mind that within an Xresources file (Tk only), later entries take precedence. For example, suppose in your .xpbsrc file, the following entries appear in order: xpbsrc*backgroundColor: blue *backgroundColor: green The later entry "green" will take precedence even though the first one is more precise and longer matching. The things that can be set in the personal preferences file are fonts, colors, and favorite server host(s) to query. Ex. !!! FONTS !! Three fonts that can be configured: ! labelFont - font applied to text that appear in labels. ! fixlabelFont - font applied to text that label fixed-width widgets. ! NOTE: This MUST be a fixed-width font. ! textFont - font applied to a text widget. Keep this as fixed-width ! font. *labelFont: -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 *fixlabelFont: 7x13bold *textFont: 7x13 !!! COLORS !! Six color resources that can be modified: ! ! backgroundColor - the color applied to background of frames, buttons, ! entries, scrollbar handles. ! foregroundColor - the color applied to text in any context (under \ ! selection, insertion, etc...). ! activeColor - the color applied to the background of a selection, ! a selected command button, or a select scroll bar ! handle. ! disabledColor - color applied to a disabled widget. ! signalColor - color applied to buttons that signal something to the ! user about a change of state. ! shadingColor - a color shading applied to some of the frames to ! emphasize focus as well as decoration. ! selectorColor - the color applied to the selector box of a radiobutton or ! checkbutton. *backgroundColor: #c8b9a6 *foregroundColor: #150567 *activeColor: #9db2ff *disabledColor: #8f8e8d *signalColor: #c11b17 *shadingColor: #c7af92 *selectorColor: #980517 !! OTHER OPTIONS ! serverHosts - the list of server hosts to be queried by xpbs. ! timeoutSecs - number of seconds before timing out waiting for a ! - connection to a server. ! xtermCmd - the xterm command to run when the PBS interactive feature ! is selected. *serverHosts: davinci *timeoutSecs: 30 *xtermCmd: xterm ===================== Xpbs and PBS commands ===================== Xpbs is a GUI front end to PBS commands. It calls the commands as follows: Command Button PBS Command -------------- ----------- detail (Hosts) qstat -B -f terminate qterm detail (Queues) qstat -Q -f stop qstop start qstart enable qenable disable qdisable detail (Jobs) qstat -f modify qalter delete qdel hold qhold release qrls run qrun rerun qrerun signal qsig msg qmsg move qmove order qorder ================================ Some Common Widgets Used in Xpbs ================================ Widgets are graphical controls that user manipulate to invoke some action. Some widgets used in xpbs are: 1. listbox - can be multi-selectable (a number of entries can be selected/ highlighted using a mouse click) or single-selectable (one entry can be highlighted at a time). For a multi-selectable listbox, the following operations are allowed: a. single click with mouse button 1 to select/highlight an entry. b. shift key + mouse button 1 to contiguously select more than one entry. c. cntrl key + mouse button 1 to non-contiguously select more than one entry. NOTE: For systems running Tk < 4.0, the newly selected item is reshuffled to appear next to already selected items. d. click the "Select All/Deselect All" button to select all entries or deselect all entries at once. e. double clicking an entry usually activates some action that uses the selected entry as a parameter. 2. scrollbar - usually appears either vertically or horizontally and contains 5 distinct areas that are mouse clicked to achieve different effects: top arrow Causes the view in the associated window to shift up by one unit (i.e. the object appears to move down one unit in its window). If the button is held down the action will auto-repeat. top gap Causes the view in the associated window to shift up by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very top of the window will now appear at the very bottom). If the button is held down the action will auto-repeat. slider Pressing button 1 in this area has no immediate effect except to cause the slider to appear sunken rather than raised. However, if the mouse is moved with the button down then the slider will be dragged, adjusting the view as the mouse is moved. bottom gap Causes the view in the associated window to shift down by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very bottom of the window will now appear at the very top). If the button is held down the action will auto-repeat. bottom arrow Causes the view in the associated window to shift down by one unit (i.e. the object appears to move up one unit in its window). If the button is held down the action will auto-repeat. 3. entry - brought into focus with a click of the left mouse button. To manipulate this widget, simply type in the text value. Use of arrow keys, mouse selection of text for deletion or overwrite, copying and pasting with sole use of mouse buttons are permitted. This widget is usually accompanied by a scrollbar for horizontally scanning a long text entry string. 4. spin box - a combination of an entry widget and a horizontal scrollbar. The entry widget will only accept values that fall within a defined list of valid values, and incrementing through the valid values is done by clicking on the up/down arrows. 5. button - a rectangular region appearing either raised or pressed that invokes an action when clicked with the left mouse button. When the button appears pressed, then hitting the key will automatically select the button. 6. text - an editor like widget. This widget is brought into focus with a click of the left mouse button. To manipulate this widget, simply type in the text. Use of arrow keys, backspace/delete key, mouse selection of text for deletion or overwrite, copying and pasting with sole use of mouse buttons are permitted. To copy and paste text, drag the left mouse button to select text, click on the left button again to reposition the insertion cursor, and then click on the middle mouse button to paste. This widget is usually accompanied by a scrollbar for vertically scanning a long entry. torque-2.4.16/src/gui/help/signal.hlp0000664000113300011330000000124311272401235014316 00000000000000The Signal Running Job dialog box is for sending some specified signal to selected running job(s). To specify the signal name or number, click on one of the "Send signal" radio buttons. If the "other" signal is chosen, then type in the signal name or number on the provided entry box. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "signal" to proceed sending signal to the selected job(s). Click on "cancel" to cancel the sending of signal to the selected job(s) and to quit out of this dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/select.priority.hlp0000664000113300011330000000135411272401235016203 00000000000000The Select Priority dialog box is for specifying the priority relationship to consult, when limiting the list of jobs appearing on the Jobs listbox in the main xpbs window. Click on either the value radio button, or on the wildcard button "ANY". If the former is selected, specify the the logical operator, and the priority value by manipulating a couple of spinboxes. The valid logical operators are: "=", "!=", ">", ">=", "<", "<=". Valid priority values are between -1024 and 1023. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/release.hlp0000664000113300011330000000107511272401235014464 00000000000000The Release Job dialog box is for releasing the user, other, or system hold type from one or more of the selected jobs. To specify the hold type, click on one of the toggle buttons. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "release" to proceed releasing the specified hold type from job(s). Click on "cancel" to cancel releasing a hold type from the job(s) and to quit out of this dialog box. This is also the default action when the key is pressed. torque-2.4.16/src/gui/help/preferences.hlp0000664000113300011330000000256211272401235015347 00000000000000The User Preferences dialog box is for setting various parameters. On future releases of the GUI, more items can be set from this dialog box. On the server hosts entry box, specify a list of favorite hosts separated by white space. On the "wait timeout secs" spinbox, specify the number of seconds to wait before timing out waiting for a connection to the server. On the xterm entry box, specify the pathname (and arguments) to the xterm command that will spawn a PBS interactive session. The RSH Command is needed in 2 areas of xpbs: 1) "Track Job.." feature (button shown on the main xpbs window), and the 2) "file staging.." feature (button displayed on the submit window). When the "Track Job.." feature is enabled, xpbs will check (and notify user) for existence of output files for recently-run jobs. If the output files were returned by PBS into some remote host, then xpbs will need to execute an RSH (remote shell) command to check the existence of those output files. Similarly, when a user specifies the "file staging.." option, xpbs will need to check for existence of the specified input file or output file directory path, which could reside remotely, requiring xpbs to execute the RSH command. Click "ok" command button after making some necessary changes. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. torque-2.4.16/src/gui/help/email.hlp0000664000113300011330000000173211272401235014133 00000000000000The Email Addresses dialog box is for specifying the list of addresses to send email to regarding job status. Specify the list of addresses by typing the email address in the email input entry, and then clicking the "add" button. Watch as your input gets loaded into the "Email Addresses" listbox. Entries of the latter can be deleted by selecting an entry, and then clicking the accompanying "delete" button. If you want to modify an entry in the listbox, then select the entry, which would result in its values to be loaded into the "email" input entry, then change the value of the input entry, and finally click the accompanying "update" button. ================ Command Buttons ================ Click on "ok" button after you are satisfied with the list of addresses. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. Click on "reset to default" if you want to reset the box of entries to its default values. torque-2.4.16/src/gui/help/before_depend.hlp0000664000113300011330000000260511272401235015625 00000000000000The Before Dependency dialog box contains widgets for instructing xpbs that the job being submitted will determine when several other jobs can begin execution. The job ids with a "before" dependency on the job being submitted can be specified by selecting one or more job ids from the listbox, which lists all jobs currently known to xpbs from a previous poll, or typing directly into the "before:", "beforeok:", "beforenotok:", and "beforeany:" entry boxes. If you select from the listbox, then be sure to also click on one of the command buttons: "...started execution", "...terminated without errors", "...terminated with errors", "...terminated with or without errors" to specify your intention. Note that after clicking a command button, the job ids selected will be displayed on the accompanying entry boxes with ":" being the separator for multiple job ids. If you specify the job ids manually, be sure to separate them with ":". On the listbox, you can also double click a job id to obtain more information about the job. ================ Command Buttons ================ Click on "ok" button before you are satisfied with the before dependency attribute value of the job. This is also the default action (as indicated by the sunken look of the button) when the key is pressed. Click on "reset to default" if you want to reset the before dependency attribute values to the default settings. torque-2.4.16/src/gui/help/select.jobname.hlp0000664000113300011330000000113011272401235015725 00000000000000The Select Job Name dialog box is for specifying the name of the job that will be checked when limiting the jobs appearing on the Jobs listbox of the main xpbs window. Either click on the radio button next to the job name entry box and type in the name string, or click on the wildcard button "ANY" to consider any type of job name string. =============== COMMAND BUTTONS =============== This region of command buttons represents the final step when manipulating this dialog box. Click on "ok" when done setting widget values. This is also the default action when the key is pressed. torque-2.4.16/src/gui/qtime.tk0000664000113300011330000002244311272401236013071 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qtime: defines the layout and functions of the select queue time criteria # dialog box. proc qtime {} { global LABELFONT qtimeDialogBox activeWindow selv if {![info exists selv(qtimeMon)] } { set_dateTime selv(qtimeMon) selv(qtimeDay) selv(qtimeYear) selv(qtimeHH) selv(qtimeMM) selv(qtimeSS) } busy_cursor ## Bring up the standard Dialog box ## set qtimeDialogBox ".qtime" set dbox [popupDialogBox $qtimeDialogBox "Select Queue Time Criteria" 1 "" "" 1] set activeWindow($qtimeDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom \ {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.qtime $qtimeDialogBox} $cmdOk configure -command { set operator [oper $selv(qtime_op)] if { [string compare $operator ""] == 0 } { popupInfoBox $qtimeDialogBox "Please specify the operator." return } switch -exact -- $selv(qtime_option) { time { set parts "$selv(mon_widget) $selv(day_widget) \ $selv(year_widget) $selv(hour_widget) \ $selv(min_widget) $selv(sec_widget)" foreach p $parts { check_spinbox_value $p if { [string compare [$p get] ""] == 0 } { popupInfoBox $qtimeDialogBox "Bad date/time value found. Please fix." return } } set datetime_arg "[cvtdatetime_arg $selv(qtimeMon) $selv(qtimeDay) \ $selv(qtimeYear) $selv(qtimeHH) $selv(qtimeMM) \ $selv(qtimeSS)]" set selv(exec_time) "Queue_Time: $operator$datetime_arg" } ANY {set selv(exec_time) "Queue_Time: -ANY-"} } destroy $qtimeDialogBox } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.q frame $dbox_top.q.op frame $dbox_top.q.main frame $dbox_top.q.main.val frame $dbox_top.q.dummy -relief groove -borderwidth 3 set spin [buildSpinbox $dbox_top.q.op 2 [list = != >= > <= <] selv qtime_op \ "" "left" =] set qtimeOpFrame [lindex $spin 0] set selv(qtimeOp) [lindex $spin 1] global vlist.$selv(qtimeOp) global vlist.selv.qtime_op register_default_action $selv(qtimeOp) $cmdOk set dtime [create_DateTime_box $dbox_top.q.main.val $selv(qtimeMon) \ $selv(qtimeDay) $selv(qtimeYear) $selv(qtimeHH) \ $selv(qtimeMM) $selv(qtimeSS) selv] set dtimeFrame [lindex $dtime 0] set selv(mon_widget) [lindex $dtimeFrame 1] set selv(day_widget) [lindex $dtimeFrame 2] set selv(year_widget) [lindex $dtimeFrame 3] set selv(hour_widget) [lindex $dtimeFrame 4] set selv(min_widget) [lindex $dtimeFrame 5] set selv(sec_widget) [lindex $dtimeFrame 6] set selv(mon_widget) [lindex $dtime 1] set selv(day_widget) [lindex $dtime 2] set selv(yr_widget) [lindex $dtime 3] set selv(hh_widget) [lindex $dtime 4] set selv(mm_widget) [lindex $dtime 5] set selv(ss_widget) [lindex $dtime 6] set selv(scrolls) [lindex $dtime 7] set selv(labels) [lindex $dtime 8] register_default_action $selv(mon_widget) $cmdOk register_default_action $selv(day_widget) $cmdOk register_default_action $selv(yr_widget) $cmdOk register_default_action $selv(hh_widget) $cmdOk register_default_action $selv(mm_widget) $cmdOk register_default_action $selv(ss_widget) $cmdOk set radioList [list [concat v \"\" $dtimeFrame] \ {n "ANY"}] set rbox [buildRadioboxes $dbox_top.q.main [list $radioList] column 0 ""] set rboxFrame [lindex $rbox 0] set rboxTime [lindex $rbox 1] set rboxANY [lindex $rbox 2] $rboxTime configure -variable selv(qtime_option) -value "time" \ -command { \ enable_dateTime [join "$selv(mon_widget) $selv(day_widget) \ $selv(yr_widget) $selv(hh_widget) $selv(mm_widget) \ $selv(ss_widget)"] $selv(scrolls) $selv(labels) set vlist.$selv(qtimeOp) [list = != >= > <= <] set vlist.selv.qtime_op [list = != >= > <= <] } $rboxANY configure -variable selv(qtime_option) -value "ANY" \ -command { \ disable_dateTime [join "$selv(mon_widget) $selv(day_widget) \ $selv(yr_widget) $selv(hh_widget) $selv(mm_widget) \ $selv(ss_widget)"] $selv(scrolls) $selv(labels) set vlist.$selv(qtimeOp) = set vlist.selv.qtime_op = $selv(qtimeOp) delete 0 end $selv(qtimeOp) insert 0 "=" } label $dbox_top.q.l -text "Queue Time" -font $LABELFONT pack $rboxFrame -in $dbox_top.q.dummy -padx 3 -pady 3 raise $rboxFrame $dbox_top.q.dummy pack $dbox_top.q.l $qtimeOpFrame $dbox_top.q.dummy -side left -anchor nw \ -padx 5 pack $dbox_top.header $dbox_top.q $dbox_top.footer -padx 5m set dtime_option [lindex $selv(exec_time) 1] ## set DEFAULT switch -exact -- $dtime_option { -ANY- { $rboxANY invoke} default {$rboxTime invoke} } register_default_action $qtimeDialogBox $cmdOk tkwait visibility $qtimeDialogBox remove_busy_cursor catch {tkwait window $qtimeDialogBox} set activeWindow($qtimeDialogBox) 0 } torque-2.4.16/src/gui/checkpoint.tk0000664000113300011330000002456111272401236014104 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ###################################################################################### # checkpoint: defines the layout and functions of the select checkpoint attributes # dialog box. ###################################################################################### proc checkpoint {} { global LABELFONT checkpointDialogBox activeWindow selv busy_cursor ## Bring up the standard Dialog box ## set checkpointDialogBox ".checkpoint" set dbox [popupDialogBox $checkpointDialogBox "Select Checkpoint Attribute Criteria" 1 "" "" 1] set activeWindow($checkpointDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom \ {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.checkpoint $checkpointDialogBox} $cmdOk configure -command { set operator [oper $selv(checkpoint_op)] if { [string compare $operator ""] == 0 } { popupInfoBox $checkpointDialogBox "Please specify an operator." return } if {[string compare $selv(checkpoint_option) "c="] == 0} { if {[string compare $selv(checkpoint_min) ""] != 0} { set selv(checkpoint) "Checkpoint: $operator$selv(checkpoint_option)$selv(checkpoint_min)" } else { popupInfoBox $checkpointDialogBox "Please specify the checkpoint interval (in mins)." return } } elseif {[string compare $selv(checkpoint_option) "ANY"] == 0} { set selv(checkpoint) "Checkpoint: -ANY-" } else { set selv(checkpoint) "Checkpoint: $operator$selv(checkpoint_option)" } destroy $checkpointDialogBox } ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.c frame $dbox_top.c.op frame $dbox_top.c.val frame $dbox_top.c.val.mins frame $dbox_top.c.dummy -relief groove -borderwidth 3 ## Checkpoint attribute set spin [buildSpinbox $dbox_top.c.op 2 [list = != >= > <= <] selv \ checkpoint_op "" "left" =] set chkpntOpFrame [lindex $spin 0] set selv(chkpntSpbox) [lindex $spin 1] global vlist.$selv(chkpntSpbox) global vlist.selv.checkpoint_op global value.$selv(chkpntSpbox) register_default_action $selv(chkpntSpbox) $cmdOk set spin [buildSpinbox $dbox_top.c.val.mins 4 \ 1-9999 selv checkpoint_min "mins" "right" ""] set chkpntMinsFrame [lindex $spin 0] set selv(chkpntMins) [lindex $spin 1] set selv(chkpntMinsScroll) [lindex $spin 2] set selv(chkpntMinsLabel) [lindex $spin 3] register_default_action $selv(chkpntMins) $cmdOk set radioList [list {n "n: no checkpointing"} \ {s "s: checkpointing at host shutdown"} \ [concat c= \"c =\" $chkpntMinsFrame] \ {c "c: checkpointing at host default minimum time"}\ {u "u: checkpointing not set"} \ {a "ANY"}] set rbox [buildRadioboxes $dbox_top.c.val [list $radioList] column 0 ""] set chkpntAttrFrame [lindex $rbox 0] set rboxN [lindex $rbox 1] set rboxS [lindex $rbox 2] set rboxCeq [lindex $rbox 3] set rboxC [lindex $rbox 4] set rboxU [lindex $rbox 5] set rboxANY [lindex $rbox 6] $rboxN configure -variable selv(checkpoint_option) -value "n" \ -command { \ disable_spinbox $selv(chkpntMins) \ $selv(chkpntMinsScroll) \ $selv(chkpntMinsLabel) set vlist.$selv(chkpntSpbox) {= != >= > <= <} set vlist.selv.checkpoint_op {= != >= > <= <} } $rboxS configure -variable selv(checkpoint_option) -value "s" \ -command { \ disable_spinbox $selv(chkpntMins) \ $selv(chkpntMinsScroll) \ $selv(chkpntMinsLabel) set vlist.$selv(chkpntSpbox) {= != >= > <= <} set vlist.selv.checkpoint_op {= != >= > <= <} } $rboxCeq configure -variable selv(checkpoint_option) -value "c=" \ -command { \ enable_spinbox $selv(chkpntMins) \ $selv(chkpntMinsScroll) \ $selv(chkpntMinsLabel) set vlist.$selv(chkpntSpbox) {= != >= > <= <} set vlist.selv.checkpoint_op {= != >= > <= <} } $rboxC configure -variable selv(checkpoint_option) -value "c" \ -command { \ disable_spinbox $selv(chkpntMins) \ $selv(chkpntMinsScroll) \ $selv(chkpntMinsLabel) set vlist.$selv(chkpntSpbox) {= != >= > <= <} set vlist.selv.checkpoint_op {= != >= > <= <} } $rboxU configure -variable selv(checkpoint_option) -value "u" \ -command { \ disable_spinbox $selv(chkpntMins) \ $selv(chkpntMinsScroll) \ $selv(chkpntMinsLabel) set vlist.$selv(chkpntSpbox) {= !=} set vlist.selv.checkpoint_op {= !=} set curVal [$selv(chkpntSpbox) get] if {[string compare $curVal "="] != 0 && \ [string compare $curVal "!="] != 0} { $selv(chkpntSpbox) delete 0 end $selv(chkpntSpbox) insert 0 "=" } } $rboxANY configure -variable selv(checkpoint_option) -value "ANY" \ -command { \ disable_spinbox $selv(chkpntMins) \ $selv(chkpntMinsScroll) \ $selv(chkpntMinsLabel) set vlist.$selv(chkpntSpbox) {=} set vlist.selv.checkpoint_op {=} $selv(chkpntSpbox) delete 0 end $selv(chkpntSpbox) insert 0 "=" } ## set DEFAULT set option [lindex $selv(checkpoint) 1] switch -regexp -- $option { n$ { $rboxN invoke } s$ { $rboxS invoke } c=$ { $rboxCeq invoke} c$ { $rboxC invoke } u$ { $rboxU invoke } -ANY- { $rboxANY invoke} } pack $dbox_top.header $dbox_top.c $dbox_top.footer -padx 5m label $dbox_top.c.l -text "Checkpoint Attribute" -font $LABELFONT pack $chkpntAttrFrame -in $dbox_top.c.dummy -padx 3 -pady 3 raise $chkpntAttrFrame $dbox_top.c.dummy pack $dbox_top.c.l $chkpntOpFrame $dbox_top.c.dummy -side left \ -anchor nw -padx 5 register_default_action $checkpointDialogBox $cmdOk tkwait visibility $checkpointDialogBox remove_busy_cursor catch {tkwait window $checkpointDialogBox} set activeWindow($checkpointDialogBox) 0 } torque-2.4.16/src/gui/qmsg.tk0000664000113300011330000001710511272401236012720 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qmsg: defines the layout and functions of the send message to jobs dialog # box. proc qmsg {} { global jobsSelected LABELFONT SERVER_HOSTS cmdpath qmsgDialogBox \ qmsgv activeWindow busy_cursor ## Bring up the standard Dialog box ## set qmsgDialogBox ".msg" set dbox [popupDialogBox $qmsgDialogBox "Send Message to Running Job Dialog"] set activeWindow($qmsgDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{msg "Send Message"} {cancel cancel} {help help}}} x 5m 13 3] set cmdFrame [lindex $cmdButtons 0] set cmdMsg [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdMsg configure -command { update idletasks if {[string compare $qmsgv(msg) ""] == 0} { popupInfoBox $qmsgDialogBox "Please specify the message to send." return } if {[string compare $qmsgv(stdout) ""] == 0 && \ [string compare $qmsgv(stderr) ""] == 0} { set qmsgv(stderr) "-E" update idletasks } set exitcode [win_cmdExec $qmsgDialogBox "$cmdpath(QMSG) $qmsgv(stdout) $qmsgv(stderr) \"$qmsgv(msg)\" $jobsSelected"] if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] destroy $qmsgDialogBox } } $cmdCancel configure -command [list destroy $qmsgDialogBox] $cmdHelp configure -command {xpbs_help message $qmsgDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.j1 frame $dbox_top.m1 frame $dbox_top.r frame $dbox_top.empty1 -width 14m ## Create the job id box set jobid [buildFullListbox $dbox_top.j1 40x3 "" xyscroll 0] set jobidFrame [lindex $jobid 0] set jobidBox [lindex $jobid 3] bind_text_readonly $jobidBox foreach el $jobsSelected { $jobidBox insert end $el } ## Create the Send Message entry set msgbox [buildFullEntrybox $dbox_top.m1 13 "Send message:" 60 \ "" bottom 0] set msgFrame [lindex $msgbox 0] set msgField [lindex $msgbox 2] $msgField configure -textvariable qmsgv(msg) register_default_action $msgField $cmdCancel set checkbox [buildCheckboxes $dbox_top.r \ {{ {standout "Stdout"} \ {standerr "Stderr"} \ }} column 0] set checkboxFrame [lindex $checkbox 0] set checkboxStdout [lindex $checkbox 1] set checkboxStderr [lindex $checkbox 2] $checkboxStdout configure -variable qmsgv(stdout) -onvalue "-O" -offvalue "" $checkboxStderr configure -variable qmsgv(stderr) -onvalue "-E" -offvalue "" set qmsgv(stdout) "" set qmsgv(stderr) "-E" label $dbox_top.checkboxLabel1 -text "to" -font $LABELFONT label $dbox_top.label2 -text "of RUNNING job(s):" -font $LABELFONT ## ARRANGEMENT ON SCREEN pack $dbox_top.m1 pack $dbox_top.r pack forget $msgFrame $checkboxFrame pack $dbox_top.header -side top pack $msgFrame -anchor nw -pady 6m -padx 14m -anchor nw pack $dbox_top.empty1 $dbox_top.checkboxLabel1 -side left -anchor nw $checkboxFrame configure -borderwidth 2 -relief groove pack $checkboxFrame $dbox_top.label2 $jobidFrame \ -after $dbox_top.checkboxLabel1 -anchor nw \ -side left pack $dbox_top.footer -before $msgFrame -side bottom register_default_action $qmsgDialogBox $cmdCancel tkwait visibility $qmsgDialogBox remove_busy_cursor catch {tkwait window $qmsgDialogBox} set activeWindow($qmsgDialogBox) 0 catch {unset qmsgv} } torque-2.4.16/src/gui/auto_upd.tk0000664000113300011330000001567511272401236013603 00000000000000 # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ###################################################################################### # auto_upd: defines the layout and functions of the "Update Data Auto" dialog box. ###################################################################################### proc auto_upd {} { global LABELFONT auto_updDialogBox auto_update_mins DATA_UPDATE_SEQ default \ backgroundColor activeColor cmdButtonUpdAuto busy_cursor ## Bring up the standard Dialog box ## set auto_updDialogBox ".auto_upd" set dbox [popupDialogBox $auto_updDialogBox "Automatic Update of Data"] set activeWindow($auto_updDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{ {stop "stop updating"} {rstart "start updating"} {cont "close window"} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdStop [lindex $cmdButtons 1] set cmdRstart [lindex $cmdButtons 2] set cmdCont [lindex $cmdButtons 3] set cmdHelp [lindex $cmdButtons 4] $cmdRstart configure -command { if { [string compare $auto_update_mins ""] == 0 } { popupInfoBox $auto_updDialogBox "Please specify the minutes interval" return } incr DATA_UPDATE_SEQ after [expr $auto_update_mins * 60000] data_auto_update $DATA_UPDATE_SEQ popupInfoBox $auto_updDialogBox \ "Data auto updating will start in $auto_update_mins mins." if { [string compare $cmdButtonUpdAuto ""] != 0 } { $cmdButtonUpdAuto configure -background $activeColor } } $cmdStop configure -command { incr DATA_UPDATE_SEQ popupInfoBox $auto_updDialogBox "Data auto updating stopped." if { [string compare $cmdButtonUpdAuto ""] != 0 } { $cmdButtonUpdAuto configure -background $backgroundColor } } $cmdCont configure -command { destroy $auto_updDialogBox } $cmdHelp configure -command {xpbs_help auto_update $auto_updDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.u frame $dbox_top.u.mins label $dbox_top.u.l -font $LABELFONT -text "mins" set spinBox [buildSpinbox $dbox_top.u.mins 4 1-9999 auto_update_mins "" \ "Update Data every" left $default(auto_update_mins)] set minsFrame [lindex $spinBox 0] set minsEntry [lindex $spinBox 1] register_default_action $minsEntry $cmdCont pack $dbox_top.u.mins $dbox_top.u.l -anchor nw -side left pack $dbox_top.header $dbox_top.u $dbox_top.footer -padx 5m register_default_action $auto_updDialogBox $cmdCont tkwait visibility $auto_updDialogBox remove_busy_cursor catch {tkwait window $auto_updDialogBox} set activeWindow($auto_updDialogBox) 0 } proc data_auto_update {update_seq} { global auto_update_mins SERVER_HOSTS DATA_UPDATE_SEQ if {$update_seq != $DATA_UPDATE_SEQ} { return } after [expr $auto_update_mins * 60000] [list data_auto_update $update_seq] getdata $SERVER_HOSTS } torque-2.4.16/src/gui/hold.tk0000664000113300011330000001613011272401236012674 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # hold: defines the layout and functions of the select hold types criteria # dialog box. proc hold {} { global LABELFONT holdDialogBox activeWindow selv busy_cursor ## Bring up the standard Dialog box ## set holdDialogBox ".hold" set dbox [popupDialogBox $holdDialogBox "Select Hold Type Criteria" 1 "" "" 1] set activeWindow($holdDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.c frame $dbox_top.c.val pack $dbox_top.c.val set chkbox [buildCheckboxes $dbox_top.c.val \ {{{user user} {other other} {system system}}} grid 5 ""] set htypeFrame [lindex $chkbox 0] set htypeUser [lindex $chkbox 1] set htypeOther [lindex $chkbox 2] set htypeSystem [lindex $chkbox 3] $htypeUser configure -variable selv(userHoldType) -onvalue u -offvalue "" $htypeOther configure -variable selv(userOtherType) -onvalue o -offvalue "" $htypeSystem configure -variable selv(userSystemType) -onvalue s -offvalue "" set radioList [list [concat list \"\" $htypeFrame] \ {a "ANY"} ] set rbox [buildRadioboxes $dbox_top.c [list $radioList] \ column 12 "Hold Types ="] set rboxFrame [lindex $rbox 0] set rboxHoldt [lindex $rbox 1] set rboxANY [lindex $rbox 2] $rboxHoldt configure -variable selv(holdt_option) -value holdt -command \ [list enable_rcbuttons $htypeUser $htypeOther $htypeSystem] $rboxANY configure -variable selv(holdt_option) -value ANY -command \ [list disable_rcbuttons $htypeUser $htypeOther $htypeSystem] ## SET DEFAULT OPTION ### set arg [lindex $selv(hold_list) 1] switch -regexp -- $arg { "-ANY-" {$rboxANY invoke} "u|o|s" { $rboxHoldt invoke if [regexp "u" $arg] { set selv(userHoldType) u } if [regexp "o" $arg] { set selv(userOtherType) o } if [regexp "s" $arg] { set selv(userSystemType) s } } } ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom \ {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.hold $holdDialogBox} $cmdOk configure -command { switch -exact -- $selv(holdt_option) { holdt { set hold_args "$selv(userHoldType)$selv(userOtherType)$selv(userSystemType)" if {[string compare $hold_args ""] == 0} { set selv(hold_list) "Hold_Types: n" } else { set selv(hold_list) "Hold_Types: $hold_args" } } ANY {set selv(hold_list) "Hold_Types: -ANY-"} } destroy $holdDialogBox } register_default_action $holdDialogBox $cmdOk ## PACK the FRAMES pack $dbox_top.header $dbox_top.c $dbox_top.footer -padx 10m tkwait visibility $holdDialogBox remove_busy_cursor catch {tkwait window $holdDialogBox} set activeWindow($holdDialogBox) 0 } torque-2.4.16/src/gui/rerun.tk0000664000113300011330000001456711272401236013115 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # rerun: defines the layout and functions of the select rerunnable attributes # dialog box. proc rerun {} { global LABELFONT rerunDialogBox activeWindow selv busy_cursor ## Bring up the standard Dialog box ## set rerunDialogBox ".rerun" set dbox [popupDialogBox $rerunDialogBox "Select Rerunnable Attribute Criteria" 1 "" "" 1] set activeWindow($rerunDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.c frame $dbox_top.c.val frame $dbox_top.c.dummy -relief groove -borderwidth 3 set rbox [buildRadioboxes $dbox_top.c.val \ { {{y y} {n n} {any "ANY (y or n)"}} } column 0 ""] set rerunValFrame [lindex $rbox 0] set rerunY [lindex $rbox 1] set rerunN [lindex $rbox 2] set rerunANY [lindex $rbox 3] $rerunY configure -variable selv(rerun_val) -value y $rerunN configure -variable selv(rerun_val) -value n $rerunANY configure -variable selv(rerun_val) -value "ANY" ## set DEFAULT set rerun_arg [lindex $selv(rerun) 1] switch -regexp -- $rerun_arg { "-ANY-" {$rerunANY invoke} y {$rerunY invoke} n {$rerunN invoke} } ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom \ {{{ok ok} {help help}}} x 2m 18 3] set cmdFrame [lindex $cmdButtons 0] set cmdOk [lindex $cmdButtons 1] set cmdHelp [lindex $cmdButtons 2] $cmdHelp configure -command {xpbs_help select.rerun $rerunDialogBox} $cmdOk configure -command { if { [string compare $selv(rerun_val) "ANY"] == 0 } { set selv(rerun) "Rerunnable: -ANY-" } else { set selv(rerun) "Rerunnable: $selv(rerun_val)" } destroy $rerunDialogBox } ## PACK the FRAMES label $dbox_top.c.l -text "Rerunnable" -font $LABELFONT pack $dbox_top.c.val -in $dbox_top.c.dummy -padx 3 -pady 3 raise $dbox_top.c.val $dbox_top.c.dummy pack $dbox_top.c.l $dbox_top.c.dummy -side left -anchor nw -padx 5 pack $dbox_top.header $dbox_top.c $dbox_top.footer -padx 5m register_default_action $rerunDialogBox $cmdOk tkwait visibility $rerunDialogBox remove_busy_cursor catch {tkwait window $rerunDialogBox} set activeWindow($rerunDialogBox) 0 } torque-2.4.16/src/gui/preferences.tcl0000664000113300011330000001754511272401236014426 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains a set of procedures for defining and manipulating # X resources for xpbs. This is a piece code taken from Brent B. Welch's, # "Practical Programming in Tcl and Tk", Prentice Hall, 1995, pp. 329-338. proc Pref_Init { userDefaults appDefaults } { global pref set pref(uid) 0; # for a unique identifier for widgets set pref(userDefaults) $userDefaults set pref(appDefaults) $appDefaults PrefReadFile $appDefaults startup if [file exists $userDefaults] { PrefReadFile $userDefaults user } } proc PrefReadFile {basename level} { if [catch {option readfile $basename $level} err] { InfoBox_sendmsg "Error in $basename: $err" 1 } if { [catch {tk colormodel .}] == 0 } { if { [string compare [tk colormodel .] "color"] == 0 } { if [file exists $basename-color] { if [catch {option $basename-color $level} err] { InfoBox_sendmsg "Error in $basename-color: $err" 1 } } } else { if [file exists $basename-mono] { if [catch {option readfile $basename-mono $level} err] { InfoBox_sendmsg "Error in $basename-mono: $err" 1 } } } } } proc PrefVar { item } { lindex $item 0 } proc PrefXres { item } { lindex $item 1 } proc PrefDefault { item } { lindex $item 2 } proc PrefComment { item } { lindex $item 3 } proc PrefHelp { item } { lindex $item 4 } proc Pref_Add { prefs } { global pref append pref(items) $prefs foreach item $prefs { set varName [PrefVar $item] set xresName [PrefXres $item] set value [PrefValue $varName $xresName] if {$value == {}} { set default [PrefDefault $item] if {[llength $default] > 1} { if { [string compare [lindex $default 0] "CHOICE"] == 0 } { PrefValueSet $varName [lindex $default 1] } else { PrefValueSet $varName $default } } else { if {[string compare $default "OFF"] == 0} { PrefValueSet $varName 0 } elseif {[string compare $default "ON"] == 0} { PrefValueSet $varName 1 } else { PrefValueSet $varName $default } } } } } # PrefValue returns the X resource database value. proc PrefValue { varName xres } { upvar #0 $varName var if [info exists var] { return $var } set var [option get . $xres {}] } # PrefValueSet defines a variable in the global scope. proc PrefValueSet { varName value } { upvar #0 $varName var set var $value } proc PrefSave {} { global pref preferences if [catch { set old [open $pref(userDefaults) r] set oldValues [split [read $old] \n] close $old }] { set oldValues {} } if [catch {open $pref(userDefaults).new w} out] { InfoBox_sendmsg "Cannot save in $pref(userDefaults).new: $out" 1 return } foreach line $oldValues { if {[string compare $line \ "!!! Lines below here are automatically added"] == 0} { break } else { puts $out $line } } puts $out "!!! Lines below here are automatically added" puts $out "!!! [exec date]" foreach item $preferences { set varName [PrefVar $item] set xresName [PrefXres $item] set value [PrefValue $varName $xresName] puts $out [format "%s\t%s" *${xresName}: $value] } close $out set new [glob $pref(userDefaults).new] set old [file root $new] if [catch {exec mv $new $old} err] { InfoBox_sendmsg "Cannot install $new: $err" } } # prefDoIt: returns 1 if a change in the list of preference parameters is # detected and thus, necessitating saving current settings in # some preferences file. proc prefDoIt {} { global init preferences foreach pref $preferences { set varName [PrefVar $pref] set resName [PrefXres $pref] upvar #0 $varName var if { [string compare $var $init($resName)] != 0 } { flush stdout return 1 } } return 0 } torque-2.4.16/src/gui/bindings.tk0000664000113300011330000007254611272401236013560 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # ###################################################################################### # The procedures below defines customized bindings for some of the widgets. ###################################################################################### # listbox_non_contiguous_selection: procedure used in pre-4.0 Tk for simulating # non-contiguous selection in listboxes. Non-contiguous items that are selected will # appear "contiguously". ###################################################################################### proc listbox_non_contiguous_selection { W cur_selection new_selection } { if {[string compare $cur_selection ""] == 0} { $W select from $new_selection $W yview $new_selection return } if {[string compare $new_selection "end"] == 0} { set new_selection [expr [$W size] - 1] } set max_cur_selection [ lintmax $cur_selection ] set min_cur_selection [ lintmin $cur_selection ] set topview $min_cur_selection if { $new_selection > $max_cur_selection } { set new_element [$W get $new_selection] $W delete $new_selection set new_position [expr $max_cur_selection+1] $W insert $new_position $new_element $W select adjust $new_position } elseif { $new_selection < $min_cur_selection } { set new_element [$W get $new_selection] $W delete $new_selection set new_position [expr $min_cur_selection-1] $W insert $new_position $new_element $W select adjust $new_position set topview $new_position } $W yview $topview } # bind_listbox_single_select: binds a listbox to allow only one item selection at a # time. proc bind_listbox_single_select widget_name { global tk_version if {$tk_version < 4.0} { bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name <2> {;} bind $widget_name {;} } else { $widget_name configure -selectmode single } } # bind_listbox_readonly: binds a listbox to be in browse mode proc bind_listbox_readonly widget_name { global tk_version if {$tk_version >= 4.0} { bindtags $widget_name [list $widget_name] } bind $widget_name <1> {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name <2> {;} bind $widget_name {;} } # bind_text_readonly: binds a text widget to be read-only. proc bind_text_readonly widget_name { global tk_version if {$tk_version >= 4.0} { bindtags $widget_name [list $widget_name] } bind $widget_name <1> {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} bind $widget_name {;} } # bind_entry_readonly: binds an entry to be read only. proc bind_entry_readonly widget_name { $widget_name configure -state disabled } # register_dependency: registers a set of bindings for the main listboxes: hostsListbox, # jobsListbox, and queuesListbox. proc register_dependency {} { global queuesListbox jobsListbox hostsListbox \ HOSTS_LISTBOX_KEY QUEUES_LISTBOX_KEY JOBS_LISTBOX_KEY \ hostsSelMode queuesSelMode jobsSelMode \ hostsSelected queuesSelected jobsSelected tk_version if { $tk_version >= 4.0 } { bindtags $queuesListbox [list all Listbox $queuesListbox] bindtags $jobsListbox [list all Listbox $jobsListbox] bindtags $hostsListbox [list all Listbox $hostsListbox] } bind $queuesListbox <1> { if { $tk_version < 4.0 } { %W select from [%W nearest %y] } set queuesSelected \ [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " " "select"] loadJobs if { [$queuesListbox size] == [llength [$queuesListbox curselection]]} { set queuesSelMode "Deselect All" } else { set queuesSelMode "Select All" } } bind $queuesListbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set queuesSelected \ [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " " "select"] loadJobs if { [$queuesListbox size] == [llength [$queuesListbox curselection]]} { set queuesSelMode "Deselect All" } else { set queuesSelMode "Select All" } } bind $queuesListbox { if { $tk_version < 4.0 } { %W select adjust [%W nearest %y] } set queuesSelected \ [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " " "select"] loadJobs if { [$queuesListbox size] == [llength [$queuesListbox curselection]]} { set queuesSelMode "Deselect All" } else { set queuesSelMode "Select All" } } bind $queuesListbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set queuesSelected \ [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " " "select"] loadJobs if { [$queuesListbox size] == [llength [$queuesListbox curselection]]} { set queuesSelMode "Deselect All" } else { set queuesSelMode "Select All" } } bind $queuesListbox { if {$tk_version < 4.0} { set cur_selection [%W curselection] set new_selection [%W nearest %y] listbox_non_contiguous_selection %W $cur_selection $new_selection } set queuesSelected \ [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " " "select"] loadJobs if { [$queuesListbox size] == [llength [$queuesListbox curselection]]} { set queuesSelMode "Deselect All" } else { set queuesSelMode "Select All" } } bind $queuesListbox { getQueuesDetail } bind $hostsListbox <1> { if { $tk_version < 4.0 } { %W select from [%W nearest %y] } set hostsSelected \ [get_keyvals $hostsListbox $HOSTS_LISTBOX_KEY "@" " " "select"] loadQueues if { [$hostsListbox size] == [llength [$hostsListbox curselection]]} { set hostsSelMode "Deselect All" } else { set hostsSelMode "Select All" } } bind $hostsListbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set hostsSelected \ [get_keyvals $hostsListbox $HOSTS_LISTBOX_KEY "@" " " "select"] loadQueues if { [$hostsListbox size] == [llength [$hostsListbox curselection]]} { set hostsSelMode "Deselect All" } else { set hostsSelMode "Select All" } } bind $hostsListbox { if {$tk_version < 4.0} { %W select adjust [%W nearest %y] } set hostsSelected \ [get_keyvals $hostsListbox $HOSTS_LISTBOX_KEY "@" " " "select"] loadQueues if { [$hostsListbox size] == [llength [$hostsListbox curselection]]} { set hostsSelMode "Deselect All" } else { set hostsSelMode "Select All" } } bind $hostsListbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set hostsSelected \ [get_keyvals $hostsListbox $HOSTS_LISTBOX_KEY "@" " " "select"] loadQueues if { [$hostsListbox size] == [llength [$hostsListbox curselection]]} { set hostsSelMode "Deselect All" } else { set hostsSelMode "Select All" } } bind $hostsListbox { if {$tk_version < 4.0} { set cur_selection [%W curselection] set new_selection [%W nearest %y] listbox_non_contiguous_selection %W $cur_selection $new_selection %W yview [lindex [%W curselection] 0] } set hostsSelected \ [get_keyvals $hostsListbox $HOSTS_LISTBOX_KEY "@" " " "select"] loadQueues if { [$hostsListbox size] == [llength [$hostsListbox curselection]] } { set hostsSelMode "Deselect All" } else { set hostsSelMode "Select All" } } bind $hostsListbox { getHostsDetail } bind $jobsListbox <1> { if { $tk_version < 4.0 } { %W select from [%W nearest %y] } set jobsSelected [get_keyvals $jobsListbox $JOBS_LISTBOX_KEY "@" " " "select"] if {[$jobsListbox size] == [llength [$jobsListbox curselection]]} { set jobsSelMode "Deselect All" } else { set jobsSelMode "Select All" } } bind $jobsListbox { getJobsDetail } bind $jobsListbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set jobsSelected [get_keyvals $jobsListbox $JOBS_LISTBOX_KEY "@" " " "select"] if {[$jobsListbox size] == [llength [$jobsListbox curselection]]} { set jobsSelMode "Deselect All" } else { set jobsSelMode "Select All" } } bind $jobsListbox { if {$tk_version < 4.0} { %W select adjust [%W nearest %y] } set jobsSelected [get_keyvals $jobsListbox $JOBS_LISTBOX_KEY "@" " " "select"] if { [$jobsListbox size] == [llength [$jobsListbox curselection]]} { set jobsSelMode "Deselect All" } else { set jobsSelMode "Select All" } } bind $jobsListbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set jobsSelected [get_keyvals $jobsListbox $JOBS_LISTBOX_KEY "@" " " "select"] if { [$jobsListbox size] == [llength [$jobsListbox curselection]] } { set jobsSelMode "Deselect All" } else { set jobsSelMode "Select All" } } bind $jobsListbox { if {$tk_version < 4.0} { set cur_selection [%W curselection] set new_selection [%W nearest %y] listbox_non_contiguous_selection %W $cur_selection $new_selection %W yview [lindex [%W curselection] 0] } set jobsSelected [get_keyvals $jobsListbox $JOBS_LISTBOX_KEY "@" " " "select"] if { [$jobsListbox size] == [llength [$jobsListbox curselection]]} { set jobsSelMode "Deselect All" } else { set jobsSelMode "Select All" } } } # register_trackjob_box: binds 'listbox' to perform the function of a trackjob box. proc register_trackjob_box {listbox} { global tk_version if {$tk_version >= 4.0} { bindtags $listbox [list all Listbox $listbox] } bind $listbox <1> { if { $tk_version < 4.0 } { %W select from [%W nearest %y] } set curIdx [%W curselection] if {[string compare $curIdx ""] != 0} { set jobid [%W get $curIdx] if {[string compare $jobid ""] != 0} { trackjob_show $jobid } } } } # register_default_action: specify the default action (a 'button' activation) when # the key is pressed in a dialog box given by 'toplevel'. proc register_default_action {toplevel button} { $button configure -relief ridge -borderwidth 3 bind $toplevel "catch {$button flash; $button invoke}" } # bind_entry_tab: procedure that causes the 'entry_name' widget to pass the input # focus to the 'next_entry_name' widget when the key is hit on the # former, or to 'prev_entry_name' when is pressed. proc bind_entry_tab {entry_name next_entry_name prev_entry_name {env 0}} { global next$entry_name global prev$entry_name global tk_version if {$tk_version >= 4.0} { bindtags $entry_name [list all Entry $entry_name] } set next$entry_name $next_entry_name set prev$entry_name $prev_entry_name if {$env} { bind $entry_name { focus ${next%W} ${next%W} delete 0 end if { [info exists env([%W get])] } { ${next%W} insert 0 $env([%W get]) } if {$tk_version >= 4.0} { ${next%W} xview moveto 1 } } bind $entry_name { focus ${next%W} ${next%W} delete 0 end if { [info exists env([%W get])] } { ${next%W} insert 0 $env([%W get]) } if {$tk_version >= 4.0} { ${next%W} xview moveto 1 } } } else { bind $entry_name { focus ${next%W} if {$tk_version >= 4.0} { ${next%W} xview moveto 1 } } bind $entry_name { focus ${next%W} if {$tk_version >= 4.0} { ${next%W} xview moveto 1 } } } bind $entry_name { focus ${prev%W} if {$tk_version >= 4.0} { ${prev%W} xview moveto 1 } } } # bind_entry_overselect: creates a set of bindings for a user-friendly entry widget. # This includes features such as overwriting selected text, copying and pasting # text solely using mouse buttons, use of basic editing keys: left and right # arrow keys. proc bind_entry_overselect {entry_name} { global tk_version if {$tk_version >= 4.0} { return } bind $entry_name <1> { %W icursor @%x %W select clear %W select from @%x if {[lindex [%W config -state] 4] == "normal"} { focus %W } } bind $entry_name { ## Overwrite the selected region - the selected text is treated as a unit. ## catch {%W delete sel.first sel.last} if {[string compare %A ""] != 0} { %W insert insert %A tk_entrySeeCaret %W } } bind $entry_name <2> { catch {%W insert insert [selection get]} selection clear %W tk_entrySeeCaret %W } bind $entry_name {%W scan dragto %y} bind $entry_name { ## Delete selection if any. if [catch {%W delete sel.first sel.last}] { tk_entryBackspace %W } tk_entrySeeCaret %W } bind $entry_name { ## Delete selection if any. if [catch {%W delete sel.first sel.last}] { tk_entryBackspace %W } tk_entrySeeCaret %W } bind $entry_name { ## Delete selection if any. if [catch {%W delete sel.first sel.last}] { tk_entryBackspace %W } tk_entrySeeCaret %W } bind $entry_name { %W delete sel.first sel.last tk_entrySeeCaret %W } bind $entry_name {%W delete 0 end} bind $entry_name { %W insert insert [selection get] tk_entrySeeCaret %W } bind $entry_name { tk_entryBackword %W tk_entrySeeCaret %W } bind $entry_name { set c [ expr [%W index insert] + 1] %W icursor $c %W select from $c tk_entrySeeCaret %W } bind $entry_name { set c [ expr [%W index insert] - 1] %W icursor $c %W select from $c tk_entrySeeCaret %W } } # bind_entry_shared_scrollbar: a special procedure that binds a "reserved" scrollbar # to 'entry_name. proc bind_entry_shared_scrollbar {entry_name shared_scrollbar} { global tk_version scroll$entry_name set scroll$entry_name $shared_scrollbar bind $entry_name <1> { %W icursor @%x %W select clear %W select from @%x if {[lindex [%W config -state] 4] == "normal"} { focus %W if {$tk_version < 4.0} { if {[lindex [%W configure -scrollcommand] 4] == ""} { %W configure -scrollcommand "${scroll%W} set" } ${scroll%W} configure -command "%W view" } else { if {[lindex [%W configure -xscrollcommand] 4] == ""} { %W configure -xscrollcommand "${scroll%W} set" } ${scroll%W} configure -command "%W xview" } } } } # bind_text_overselect: creates a set of bindings for a user-friendly text widget. # This includes features such as overwriting selected text, copying and pasting # text solely using mouse buttons, use of basic editing keys: left, right, up, # and down arrow keys. proc bind_text_overselect {text_widget} { global tk_version if {$tk_version >= 4.0} { bindtags $text_widget [list $text_widget all Text] bind $text_widget <1> { tkTextButton1 %W %x %y break } bind $text_widget { set tkPriv(x) %x set tkPriv(y) %y tkTextSelectTo %W %x %y break } bind $text_widget { set tkPriv(selectMode) word tkTextSelectTo %W %x %y catch {%W mark set insert sel.first} break } bind $text_widget { set tkPriv(selectMode) line tkTextSelectTo %W %x %y catch {%W mark set insert sel.first} break } bind $text_widget { tkTextResetAnchor %W @%x,%y set tkPriv(selectMode) char tkTextSelectTo %W %x %y break } bind $text_widget { set tkPriv(selectMode) word tkTextSelectTo %W %x %y break } bind $text_widget { set tkPriv(selectMode) line tkTextSelectTo %W %x %y break } bind $text_widget { set tkPriv(x) %x set tkPriv(y) %y tkTextAutoScan %W break } bind $text_widget { tkCancelRepeat break } bind $text_widget { tkCancelRepeat break } bind $text_widget <2> { %W scan mark %x %y set tkPriv(x) %x set tkPriv(y) %y set tkPriv(mouseMoved) 0 break } bind $text_widget { if {(%x != $tkPriv(x)) || (%y != $tkPriv(y))} { set tkPriv(mouseMoved) 1 } if $tkPriv(mouseMoved) { %W scan dragto %x %y } break } bind $text_widget { if !$tkPriv(mouseMoved) { catch { %W insert @%x,%y [selection get -displayof %W] } %W tag remove sel 0.0 end } break } return } bind $text_widget <1> { set tk_priv(selectMode) char %W mark set insert @%x,%y %W mark set anchor insert if {[lindex [%W config -state] 4] == "normal"} {focus %W} } bind $text_widget { set tk_priv(selectMode) word %W mark set insert "@%x,%y wordstart" tk_textSelectTo %W insert } bind $text_widget { set tk_priv(selectMode) line %W mark set insert "@%x,%y linestart" tk_textSelectTo %W insert } bind $text_widget {tk_textSelectTo %W @%x,%y} bind $text_widget <2> { catch {%W insert insert [selection get]} selection clear %W } bind $text_widget {%W scan dragto %y} bind $text_widget {%W insert insert \n; %W yview -pickplace insert} bind $text_widget { if [catch {%W delete sel.first sel.last}] { tk_textBackspace %W %W yview -pickplace insert } } bind $text_widget { if [catch {%W delete sel.first sel.last}] { tk_textBackspace %W %W yview -pickplace insert } } bind $text_widget { catch {%W delete sel.first sel.last}} bind $text_widget { %W insert insert [selection get] %W yview -pickplace insert } bind $text_widget { if [catch {%W delete sel.first sel.last}] { tk_textBackspace %W %W yview -pickplace insert } } bind $text_widget { set idx [regexp "(\[0-9]+)\\.(\[0-9]+)" [%W index insert] match l c] incr c %W mark set insert $l.$c %W mark set anchor insert if {[lindex [%W config -state] 4] == "normal"} {focus %W} } bind $text_widget { set idx [regexp "(\[0-9]+)\\.(\[0-9]+)" [%W index insert] match l c] incr c -1 %W mark set insert $l.$c %W mark set anchor insert if {[lindex [%W config -state] 4] == "normal"} {focus %W} } bind $text_widget { set idx [regexp "(\[0-9]+)\\.(\[0-9]+)" [%W index insert] match l c] incr l -1 %W mark set insert $l.$c %W mark set anchor insert if {[lindex [%W config -state] 4] == "normal"} {focus %W} } bind $text_widget { set idx [regexp "(\[0-9]+)\\.(\[0-9]+)" [%W index insert] match l c] incr l %W mark set insert $l.$c %W mark set anchor insert if {[lindex [%W config -state] 4] == "normal"} {focus %W} } bind $text_widget { catch {%W delete sel.first sel.last} if {"%A" != ""} { %W insert insert %A %W yview -pickplace insert } } } # register_spinbox: place an appropriate binding to 'entry_name' so that it # behaves like a spinbox entry. proc register_spinbox entry { global tk_version vlist.$entry if {$tk_version >= 4.0} { bindtags $entry [list all Entry $entry] } bind $entry { if {$tk_version < 4.0} { catch {%W delete sel.first sel.last} if {[string compare %A ""] != 0} { %W insert insert %A tk_entrySeeCaret %W } } set valueList ${vlist.%W} set sbox_var [%W get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if { $min >= 0 } { if { ![regexp "^(\[0-9]+)$" $sbox_var match] || \ $sbox_var < $min || $sbox_var > $max } { %W delete 0 end } } else { set firstChar [string index $sbox_var 0] set restOfChar [string range $sbox_var 1 end] if { ![regexp "^(\[-0-9]+)$" $firstChar match] } { %W delete 0 end } elseif {[string compare $restOfChar ""] != 0} { if { ![regexp "^(\[0-9]+)$" $restOfChar match] || \ $sbox_var < $min || $sbox_var > $max } { %W delete 0 end } } } } elseif { ([lsearch -exact ". ^ $ \[ ] ( ) * + ? |" $sbox_var] != -1 && \ [lsearch -exact $valueList $sbox_var] == -1) || \ [lsearch -regexp $valueList "^${sbox_var}"] == -1 } { %W delete 0 end } } bind $entry { check_spinbox_value %W } } proc register_entry_fixsize {entry size} { global tk_version size.$entry set size.$entry $size if {$tk_version >= 4.0} { bindtags $entry [list all Entry $entry] } bind $entry { set size ${size.%W} set sbox_var [%W get] if {[string length $sbox_var] < $size} { if {$tk_version < 4.0} { catch {%W delete sel.first sel.last} if {[string compare %A ""] != 0} { %W insert insert %A tk_entrySeeCaret %W } } } else { if {$tk_version >= 4.0} { %W delete 0 end %W insert 0 [string range $sbox_var 0 [expr $size - 1]] } } } } proc bind_depend {mode listbox} { global tk_version PBS_JOBS_DETAIL_CMD global queuesListbox jobsListbox hostsListbox \ HOSTS_LISTBOX_KEY QUEUES_LISTBOX_KEY JOBS_LISTBOX_KEY \ hostsSelMode queuesSelMode jobsSelMode \ hostsSelected queuesSelected jobsSelected tk_version mode$listbox switch -exact -- $mode { concur { global concurJob set mode$listbox concur } after { global afterJob set mode$listbox after } before { global beforeJob set mode$listbox before } } if { $tk_version >= 4.0 } { bindtags $listbox [list all Listbox $listbox] } bind $listbox <1> { if { $tk_version < 4.0 } { %W select from [%W nearest %y] } set ${mode%W}Job [get_keyvals %W {0} "" ":" "select"] } bind $listbox { win_cmdExec "" "$PBS_JOBS_DETAIL_CMD [set ${mode%W}Job]" } bind $listbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set ${mode%W}Job [get_keyvals %W {0} "" ":" "select"] } bind $listbox { if {$tk_version < 4.0} { %W select adjust [%W nearest %y] } set ${mode%W}Job [get_keyvals %W {0} "" ":" "select"] } bind $listbox { if { $tk_version < 4.0 } { %W select to [%W nearest %y] } set ${mode%W}Job [get_keyvals %W {0} "" ":" "select"] } bind $listbox { if {$tk_version < 4.0} { set cur_selection [%W curselection] set new_selection [%W nearest %y] listbox_non_contiguous_selection %W $cur_selection $new_selection %W yview [lindex [%W curselection] 0] } set ${mode%W}Job [get_keyvals %W {0} "" ":" "select"] } } # t - toplevel # e - name entry # lb - listbox proc fileselectBindings { e lb } { global fileselect tk_version if { $tk_version >= 4.0 } { bindtags $lb [list all Listbox $lb] bindtags $e [list all Entry $e] } # Entry bindings bind $e { fileselectList $fileselect(dir) } # A single click puts the name in the entry # A double click or select the name bind $lb { if { $tk_version < 4.0 } { %W select from [%W nearest %y] } fileselectClick %W %y if { [string compare $fileselect(dir) "/"] != 0 && \ [file isfile $fileselect(dir)/$fileselect(path)] } { set fileselect(filepath) $fileselect(dir)/$fileselect(path) } elseif { [string compare $fileselect(dir) "/"] == 0 && \ [file isfile /$fileselect(path)] } { set fileselect(filepath) /$fileselect(path) } else { set fileselect(filepath) {} } } bind $lb { busy_cursor fileselectClick %W %y fileselectOK if [file isfile $fileselect(path)] { set fileselect(filepath) $fileselect(path) } else { set fileselect(filepath) {} } remove_busy_cursor } } proc bind_button1 win { global coordX coordY bind $win <1> { set coordX %X set coordY %Y } } proc bind_listbox_select {listbox boxframe} { global tk_version box$listbox set box$listbox $boxframe if { $tk_version >= 4.0 } { bindtags $listbox [list all Listbox $listbox] } bind $listbox <1> { if { $tk_version < 4.0 } { %W select from [%W nearest %y] boxSelect ${box%W} [%W index @%x,%y] } boxSelect ${box%W} [%W index @%x,%y] } } torque-2.4.16/src/gui/Makefile.am0000664000113300011330000000601411272401236013442 00000000000000include $(top_srcdir)/buildutils/config.mk SUBDIRS = Ccode xpbsdir = $(XPBS_DIR) xpbsbitmapdir = $(xpbsdir)/bitmaps xpbshelpdir = $(xpbsdir)/help SUFFIXES = .src bin_SCRIPTS = xpbs nodist_xpbs_DATA = xpbsrc tclIndex CLEANFILES = xpbs xpbsrc tclIndex buildindex EXTRA_DIST = xpbs.src xpbsrc.src buildindex.src dist_xpbs_DATA = pbs.tcl preferences.tcl acctname.tk after_depend.tk \ auto_upd.tk before_depend.tk bindings.tk box.tk button.tk \ checkpoint.tk common.tk concur.tk datetime.tk email_list.tk \ entry.tk fileselect.tk hold.tk jobname.tk listbox.tk main.tk \ misc.tk owners.tk prefsave.tk pref.tk priority.tk qalter.tk \ qdel.tk qhold.tk qmove.tk qmsg.tk qrls.tk qsig.tk qsub.tk \ qterm.tk qtime.tk rerun.tk res.tk spinbox.tk staging.tk \ state.tk text.tk trackjob.tk wmgr.tk dist_xpbsbitmap_DATA = bitmaps/curve_down_arrow.bmp \ bitmaps/curve_up_arrow.bmp bitmaps/cyclist-only.xbm \ bitmaps/Downarrow.bmp bitmaps/hourglass.bmp \ bitmaps/iconize.bmp bitmaps/logo.bmp \ bitmaps/maximize.bmp bitmaps/sm_down_arrow.bmp \ bitmaps/sm_up_arrow.bmp bitmaps/Uparrow.bmp dist_xpbshelp_DATA = help/after_depend.hlp help/auto_update.hlp \ help/before_depend.hlp help/concur.hlp help/datetime.hlp \ help/delete.hlp help/email.hlp help/fileselect.hlp \ help/hold.hlp help/main.hlp help/message.hlp \ help/misc.hlp help/modify.hlp help/move.hlp \ help/notes.hlp help/preferences.hlp help/release.hlp \ help/select.acctname.hlp help/select.checkpoint.hlp \ help/select.hold.hlp help/select.jobname.hlp \ help/select.owners.hlp help/select.priority.hlp \ help/select.qtime.hlp help/select.rerun.hlp \ help/select.resources.hlp help/select.states.hlp \ help/signal.hlp help/staging.hlp help/submit.hlp \ help/terminate.hlp help/trackjob.hlp install_gui: install xpbs: $(srcdir)/xpbs.src sed -e 's,#\!.*wish.*$$,#\!@WISH_PROG@,;' \ -e 's,set *libdir.*$$,set libdir $(xpbsdir),' \ -e 's,set *appdefdir.*$$,set appdefdir $(xpbsdir),' \ -e 's,set *xpbs_datadump.*$$,set xpbs_datadump $(program_prefix)xpbs_datadump$(program_suffix),' \ -e 's,set *xpbs_scriptload.*$$,set xpbs_scriptload $(program_prefix)xpbs_scriptload$(program_suffix),' \ -e 's,RSH_PATH,$(RSH_PATH),' \ $? > $@ xpbsrc: $(srcdir)/xpbsrc.src sed -e 's,\*serverHosts:.*$$,\*serverHosts: $(PBS_DEFAULT_SERVER),;' \ -e ' s,\*selectHosts:.*$$,\*selectHosts: $(PBS_DEFAULT_SERVER),' \ $? > $@ buildindex: $(srcdir)/buildindex.src @echo Processing buildindex @sed -e 's,#\!.*tclsh.*$$,#\!@TCLSH_PROG@,' $? > $@ @chmod +x $@ tclIndex: $(dist_xpbs_DATA) buildindex @echo Running buildindex \(locally\) @./buildindex $(srcdir) . install-data-hook: $(INSTALL_SCRIPT) buildindex $(DESTDIR)$(XPBS_DIR)/buildindex rm -f $(DESTDIR)$(XPBS_DIR)/tclIndex cd $(DESTDIR)$(XPBS_DIR) && ./buildindex $(DESTDIR)$(XPBS_DIR) . $(DESTDIR) chmod 644 $(DESTDIR)$(XPBS_DIR)/tclIndex uninstall-hook: rm -f $(DESTDIR)$(XPBS_DIR)/buildindex torque-2.4.16/src/gui/xpbs.src0000664000113300011330000003133611272401236013100 00000000000000#!/usr/local/bin/wish -f ############################################################################### # xpbs-gui: The GUI front end to the PBS user and operator commands. # # Written by Albeaus Bayucan # History # Initial Date: 1/17/96 ############################################################################### # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ set XPBS_VERSION 1.1.12 set libdir /u/wk/bayucan/xpbs.test set appdefdir . set bitmap_dir $libdir/bitmaps set helpdir $libdir/help set bindir $libdir/bin set auto_path [linsert $auto_path 0 $libdir] set auto_path [linsert $auto_path 0 .] set appDefaultsFile $appdefdir/xpbsrc set xpbs_datadump xpbs_datadump set xpbs_scriptload xpbs_scriptload set appname1 "xpbs" set appname "${appname1}${XPBS_VERSION}" if [catch {exec whoami} USER] { puts "Could not set USER. - exec whoami failed." } switch -exact -- $argc { 0 { set perm_level "user" } 1 { if { [string compare [lindex $argv 0] "-admin"] == 0 } { set perm_level "admin" } else { puts stderr "$appname1 \[-admin\]" exit 1 } } default { puts stderr "$appname1 \[-admin\]" exit 1 } } global env if { ![info exists env(DISPLAY)] } { puts "DISPLAY variable not set." exit 1 } catch {Pref_Init "$env(HOME)/.xpbsrc" $appDefaultsFile} output if {[string compare $output ""] != 0} { puts "xpbs: initialization failed! output: $output" exit 1 } ## For items that are configurable, please add an entry on this array set preferences { \ {LABELFONT labelFont "-adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1"} {FIXLABELFONT fixlabelFont "7x13bold"} {TEXTFONT textFont "7x13"} {SERVER_HOSTS serverHosts ""} {XTERM xtermCmd "xterm"} {RSH rshCmd "RSH_PATH"} {backgroundColor backgroundColor "#c8b9a6"} {foregroundColor foregroundColor "#150567"} {activeColor activeColor "#9db2ff"} {disabledColor disabledColor "#8f8e8d"} {signalColor signalColor "#c11b17"} {shadingColor shadingColor "#c7af92"} {selectorColor selectorColor "#980517"} {hostsSelected selectHosts ""} {queuesSelected selectQueues ""} {jobsSelected selectJobs ""} {jobResourceList jobResourceList \ "{unicos8 ncpus cput mem mppe mppt nice pncpus pcput pf pmem pmppt ppf procs psds sds srfs_tmp srfs_wrk srfs_big srfs_fast walltime arch nodes mta mtb mtc mtd mte mtf mtg mth} \ {irix5 cput file mem nice pcput pmem walltime workingset arch nodes} \ {irix6 cput file mem ncpus nice nodemask pcput pmem walltime workingset arch nodes} \ {irix6array cput file mem ncpus nice nodemask pcput pmem walltime workingset arch nodes} \ {solaris5 cput file mem nice pcput pmem walltime arch nodes} \ {linux cput file mem nice pcput pmem walltime workingset arch nodes} \ {aix4 cput file mem nice pcput pmem walltime workingset arch nodes} \ {sp2 nice walltime arch nodes} \ {sunos4 cput file mem nice pcput pmem walltime workingset arch nodes} \ {digitalunix cput file mem nice pcput pmem walltime arch nodes} \ {fujitsu cput file mem nice pcput pmem walltime arch nodes}" } {selv(owners_list) selectOwners ""} {selv(states) selectStates "Job_States: -ANY-"} {selv(reslist) selectRes "Resources: -ANY-"} {selv(exec_time) selectExecTime "Queue_Time: -ANY-"} {selv(acctname) selectAcctName "Account_Name: -ANY-"} {selv(checkpoint) selectCheckpoint "Checkpoint: -ANY-"} {selv(hold_list) selectHold "Hold_Types: -ANY-"} {selv(priority) selectPriority "Priority: -ANY-"} {selv(rerun) selectRerun "Rerunnable: -ANY-"} {selv(jname) selectJobName "Job_Name: -ANY-"} {iconview(hosts) iconizeHostsView {CHOICE false true}} {iconview(queues) iconizeQueuesView {CHOICE false true}} {iconview(jobs) iconizeJobsView {CHOICE false true}} {iconview(info) iconizeInfoView {CHOICE false true}} {timeout_secs timeoutSecs 30} } Pref_Add $preferences if { [string compare $selv(owners_list) ""] == 0 } { set selv(owners_list) "Owners: $USER" } # Let's save the current resource values # Format: init(XresourceName) XresourceVariable set init(labelFont) $LABELFONT set init(fixlabelFont) $FIXLABELFONT set init(textFont) $TEXTFONT set init(serverHosts) $SERVER_HOSTS set init(xtermCmd) $XTERM set init(rshCmd) $RSH set init(backgroundColor) $backgroundColor set init(foregroundColor) $foregroundColor set init(activeColor) $activeColor set init(disabledColor) $disabledColor set init(signalColor) $signalColor set init(shadingColor) $shadingColor set init(selectorColor) $selectorColor set init(selectHosts) $hostsSelected set init(selectQueues) $queuesSelected set init(selectJobs) $jobsSelected set init(jobResourceList) $jobResourceList set init(selectOwners) $selv(owners_list) set init(selectStates) $selv(states) set init(selectRes) $selv(reslist) set init(selectExecTime) $selv(exec_time) set init(selectAcctName) $selv(acctname) set init(selectCheckpoint) $selv(checkpoint) set init(selectHold) $selv(hold_list) set init(selectPriority) $selv(priority) set init(selectRerun) $selv(rerun) set init(selectJobName) $selv(jname) set init(iconizeHostsView) $iconview(hosts) set init(iconizeQueuesView) $iconview(queues) set init(iconizeJobsView) $iconview(jobs) set init(iconizeInfoView) $iconview(info) set init(timeoutSecs) $timeout_secs # Set the colors option add *background $backgroundColor option add *troughColor $backgroundColor option add *foreground $foregroundColor option add *activeForeground $foregroundColor option add *insertBackground $foregroundColor option add *selectForeground $foregroundColor option add *selectBackground $activeColor option add *activeBackground $activeColor option add *selector $selectorColor option add *selectColor $selectorColor ;# for 4.0 option add *disabledForeground $disabledColor option add *Scrollbar*troughColor $backgroundColor option add *Scrollbar*foreground $backgroundColor option add *Scrollbar*background $backgroundColor ;# 4.0 option add *Scrollbar*activeForeground $activeColor option add *Scrollbar*activeBackground $activeColor ;# 4.0 option add *CmdFrame*background $shadingColor #option add *CmdFrame*foreground $backgroundColor option add *CmdFrame*Button.foreground $foregroundColor option add *CmdFrame*Button.background $backgroundColor option add *highlightColor $backgroundColor option add *highlightThickness 0 set mainWindow ".main" set activeWindow($mainWindow) 1 if {[string compare $mainWindow "."] != 0} { toplevel $mainWindow wm withdraw . } else { set mainWindow "" } # LISTBOX-related parameters set HOSTS_LISTBOX_WIDTH 96 ;# number of chars + 2. set HOSTS_LISTBOX_HEIGHT 4 ;# number of lines set HOSTS_COLUMN_HEADER "Server" set HOSTS_COLUMN_LABEL $HOSTS_COLUMN_HEADER set HOSTS_LISTBOX_KEY 11 ;# defines the primary key(s) ;# of the host listbox. ;# in the Hosts Listbox. set HOSTS_LISTBOX_FKEY 11 ;# defines the foreign key set QUEUES_LISTBOX_WIDTH 98 ;# number of chars + 2. set QUEUES_LISTBOX_HEIGHT 6 ;# number of lines set QUEUES_COLUMN_HEADER "Queue" set QUEUES_COLUMN_LABEL $QUEUES_COLUMN_HEADER ;# what appears as column labels above the ;# queues list box set QUEUES_LISTBOX_KEY {0 12} set QUEUES_LISTBOX_FKEY 12 set JOBS_LISTBOX_WIDTH 96 ;# number of chars + 2. set JOBS_LISTBOX_HEIGHT 14 ;# number of lines set JOBS_COLUMN_HEADER "Job id" set JOBS_COLUMN_LABEL $JOBS_COLUMN_HEADER set JOBS_LISTBOX_KEY {9 8} ;# what appears as column labels above the ;# hosts list box. set JOBS_LISTBOX_FKEY {7} set INFOBOX_LISTBOX_WIDTH 100 set INFOBOX_LISTBOX_HEIGHT 2 if {[string compare $perm_level "user"] == 0} { set JOBS_LISTBOX_HEIGHT 11 ;# number of lines } set months {Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec} set default(trackjob_mins) 5 set default(trackjob_location) local set default(trackjob_rsh_command) RSH_PATH set default(auto_update_mins) 5 set default(qterm_type) immediate ############################################################################## ## POLLING-related parameters ## ############################################################################## set DATA_UPDATE_SEQ 0 ;# tracks current sequence in data update set TRACKJOB_UPDATE_SEQ 0 ;# tracks the current sequence in track job ;# update. set trackjob_user(0) $USER ### Errors #################################################################### set BADPARAM 7000 set errmsg(BADPARAM) "A procedure has encountered a bad parameter." ### ########################################################################### set tk_strictMotif 1 set_pbs_commands set_pbs_options set_pbs_defaults build_main_window set_wmgr $mainWindow bind_button1 $mainWindow register_dependency update idletasks after 500 [list getdata $SERVER_HOSTS] torque-2.4.16/src/gui/qdel.tk0000664000113300011330000001535411272401236012702 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qdel: defines the layout and functions of the delete job # dialog box. proc qdel {} { global jobsSelected qdelv LABELFONT SERVER_HOSTS cmdpath qdelDialogBox \ activeWindow busy_cursor ## Bring up the standard Dialog box ## set qdelDialogBox ".delete" set dbox [popupDialogBox $qdelDialogBox "Delete Job Dialog"] set activeWindow($qdelDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{delete delete} {cancel cancel} {help help}}} x 5m 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdDelete [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdDelete configure -command { if {[string compare $qdelv(delay) ""] != 0} { set exitcode [win_cmdExec $qdelDialogBox \ "$cmdpath(QDEL) -W $qdelv(delay) $jobsSelected"] } else { set exitcode [win_cmdExec $qdelDialogBox "$cmdpath(QDEL) $jobsSelected"] } if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] destroy $qdelDialogBox } } $cmdCancel configure -command [list destroy $qdelDialogBox] $cmdHelp configure -command {xpbs_help delete $qdelDialogBox} ## TOP PART ## frame $dbox_top.header -height 5m -width 10m frame $dbox_top.footer -height 2m -width 10m frame $dbox_top.d frame $dbox_top.d.e frame $dbox_top.c frame $dbox_top.c.sp label $dbox_top.d.l -font $LABELFONT -text "Delete job(s):" set jobidbox [buildFullListbox $dbox_top.d.e 55x3 "" yscroll 0] set jobidFrame [lindex $jobidbox 0] set jobidField [lindex $jobidbox 3] $jobidField configure -relief sunken bind_text_readonly $jobidField foreach el $jobsSelected { $jobidField insert end $el } label $dbox_top.c.l -font $LABELFONT \ -text "For running job(s), send kill signal after" set spinBox [buildSpinbox $dbox_top.c.sp 4 0-9999 qdelv delay \ "secs from sending terminate signal."] set spinBoxFrame [lindex $spinBox 0] set spinBoxEntry [lindex $spinBox 1] set spinBoxScroll [lindex $spinBox 2] set qdelv(delay) "" register_default_action $spinBoxEntry $cmdCancel ## ARRANGEMENT ON SCREEN pack $dbox_top.c.l -side left -pady 1m -anchor nw pack $spinBoxFrame -side right -pady 1m -anchor nw pack $dbox_top.d.l $dbox_top.d.e -side left -anchor nw pack $dbox_top.header $dbox_top.d $dbox_top.c $dbox_top.footer \ -anchor nw -side top -pady 2m -padx 10m register_default_action $qdelDialogBox $cmdCancel tkwait visibility $qdelDialogBox remove_busy_cursor catch {tkwait window $qdelDialogBox} set activeWindow($qdelDialogBox) 0 catch {unset qdelv} } torque-2.4.16/src/gui/prefsave.tk0000664000113300011330000001174711272401236013572 00000000000000# prefsave: pops up a dialog box asking confirmation from user about saving # current setup in xpbs. # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. proc prefsave {} { global LABELFONT prefSaveDialogBox set prefSaveDialogBox ".prefsave" set dbox [popupDialogBox $prefSaveDialogBox "Save Preference Settings"] set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] message $dbox_top.msg -borderwidth 2 -justify left -font $LABELFONT \ -aspect 2000 -text \ "Save current xpbs settings to your ~/.xpbsrc file?" pack $dbox_top.msg -padx 3m -pady 3m set buttons [buildCmdButtons $dbox_bottom {{{yes yes} {no no}}} x 0 10 3] set yes_button [lindex $buttons 1] set no_button [lindex $buttons 2] $yes_button configure -command {PrefSave; destroy $prefSaveDialogBox} $no_button configure -command [list destroy $prefSaveDialogBox] register_default_action $prefSaveDialogBox $yes_button tkwait window $prefSaveDialogBox } torque-2.4.16/src/gui/qmove.tk0000664000113300011330000001560311272401236013101 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # qmove: defines the layout and functions of the move job dialog box. proc qmove {} { global jobsSelected LABELFONT qlbox activeWindow tk_version global SERVER_HOSTS cmdpath qmoveDialogBox queuesListbox QUEUES_LISTBOX_KEY busy_cursor ## Bring up the standard Dialog box ## set qmoveDialogBox ".move" set dbox [popupDialogBox $qmoveDialogBox "Move Job Dialog"] set activeWindow($qmoveDialogBox) 1 set dbox_top [lindex $dbox 0] set dbox_bottom [lindex $dbox 1] ## BOTTOM PART ## set cmdButtons \ [buildCmdButtons $dbox_bottom {{{move move} {cancel cancel} {help help}}} x 10m 10 3] set cmdFrame [lindex $cmdButtons 0] set cmdMove [lindex $cmdButtons 1] set cmdCancel [lindex $cmdButtons 2] set cmdHelp [lindex $cmdButtons 3] $cmdMove configure -command { set exitcode \ [win_cmdExec $qmoveDialogBox \ "$cmdpath(QMOVE) [$qlbox get [$qlbox curselection]] $jobsSelected"] if {$exitcode == 0} { after 500 [list getdata $SERVER_HOSTS 1] destroy $qmoveDialogBox } } $cmdCancel configure -command [list destroy $qmoveDialogBox] $cmdHelp configure -command {xpbs_help move $qmoveDialogBox} ## TOP PART ## frame $dbox_top.header -height 10m -width 10m frame $dbox_top.footer -height 10m -width 10m frame $dbox_top.e frame $dbox_top.dest frame $dbox_top.empty -width 10m set jobidbox [buildFullListbox $dbox_top.e 55x3 "" xyscroll 0] set jobidFrame [lindex $jobidbox 0] set jobidField [lindex $jobidbox 3] bind_text_readonly $jobidField foreach el $jobsSelected { $jobidField insert end $el } set listBoxInfo [buildFullListbox $dbox_top.dest 30x3 \ "" yscroll 0] set queuesListframe [lindex $listBoxInfo 0] set qlbox [lindex $listBoxInfo 3] bind_listbox_single_select $qlbox set qlist [get_keyvals $queuesListbox $QUEUES_LISTBOX_KEY @ " "] foreach qitems $qlist { $qlbox insert end $qitems } if {[$qlbox size] > 0} { if {$tk_version < 4.0} { $qlbox select from 0 } else { $qlbox select anchor 0 $qlbox select set anchor 0 } } label $dbox_top.lboxLabel -text "to queue (select one):" -font $LABELFONT label $dbox_top.lboxLabel2 -text "Move job(s):" -font $LABELFONT ## ARRANGEMENT ON SCREEN pack forget $jobidFrame pack $dbox_top.e pack $dbox_top.dest pack $dbox_top.header -side top pack $dbox_top.lboxLabel2 $jobidFrame -after $dbox_top.header -side top \ -anchor nw -padx 10m pack $dbox_top.empty $dbox_top.lboxLabel $queuesListframe \ -after $jobidFrame -side left -anchor nw -pady 2m pack $dbox_top.footer -after $dbox_top.lboxLabel -side bottom register_default_action $qmoveDialogBox $cmdCancel tkwait visibility $qmoveDialogBox remove_busy_cursor catch {tkwait window $qmoveDialogBox} set activeWindow($qmoveDialogBox) 0 } torque-2.4.16/src/gui/spinbox.tk0000664000113300011330000002515511272401236013437 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. ################################################################################ # This file contains procedures related to spinbox widgets. ################################################################################ # buildSpinbox: builds a spinbox widget to be filled with 'list_discrete_values'. If # 'list_discrete_values' is of the form "-", then it will assume # that the values are integers starting from numX up to numY. 'assocVarName' and # 'assocVarElem' are the associated variable name and element (if variable is # an array) for the spinbox entry widget. # OPTIONS: # 'label_text' - the text string to label the spinbox. # 'label_placement' - where to place 'label_text': right, left, top, bottom. # 'default_val' - default value for the spin box entry. # 'dateFormat' - a boolean for declaring entry to be of date type: meaning # numbers from 0 to 9 are to be given a 0 prefix. proc buildSpinbox {frame_name cols list_discrete_values assocVarName \ assocVarElem \ {label_text ""} {label_placement "right"} {default_val ""} \ {dateFormat 0} } { global LABELFONT if {$dateFormat && [string length $default_val] < 2 && \ $default_val >= 0 && $default_val <= 9 } { set lboxinfo [buildFullEntrybox $frame_name 0 \ "" $cols "0$default_val" "" 0] } else { set lboxinfo [buildFullEntrybox $frame_name 0 \ "" $cols $default_val "" 0] } set sbox [lindex $lboxinfo 2] bind_entry_overselect $sbox pack forget $sbox scrollbar $frame_name.spinscroll -orient vertical -relief flat \ -borderwidth 2 -command [list spincmd $sbox $dateFormat] label $frame_name.splabel -font $LABELFONT -text $label_text -padx 1 -pady 1 switch -exact -- $label_placement { right { pack $sbox $frame_name.spinscroll $frame_name.splabel -side left \ -anchor nw } left { pack $frame_name.splabel $sbox $frame_name.spinscroll -side left \ -anchor nw } top { pack $frame_name.splabel -side top -anchor nw pack $sbox $frame_name.spinscroll -side left -after $frame_name.splabel \ -anchor nw } bottom { pack $sbox $frame_name.spinscroll -side left -anchor nw pack $frame_name.splabel -side bottom -anchor nw -before $sbox } default { pack $sbox -side left -anchor c -pady 2 pack $frame_name.spinscroll -side right -anchor nw -pady 2 } } # Initialize some special global variables if [regexp "(.+)\\((.+)\\)" $assocVarElem match elem1 elem2] { set assocVarElem "${elem1}_${elem2}" } global vlist.$sbox ;# vlist.? holds the list of ;# valid values for the ;# spin box. set vlist.$sbox $list_discrete_values if { [string compare $assocVarElem ""] != 0 } { set value.$sbox $assocVarName\($assocVarElem\) } else { set value.$sbox $assocVarName } $sbox configure -font $LABELFONT -textvariable [set value.$sbox] \ -relief groove register_spinbox $sbox return [concat $frame_name $sbox $frame_name.spinscroll $frame_name.splabel] } # spincmd: the associated command when the spinbox widget's scrollbar is manipulated. proc spincmd { sbox dateFormat view_idx } { ## It appears that since we have a one entry listbox, then pushing the up ## arrow returns an index of -1, and pushing down return an index of 1. if {$view_idx == -1} { incr_spinbox $sbox $dateFormat } else { decr_spinbox $sbox $dateFormat } } # disable_spinbox: disables all the components of a spinbox. proc disable_spinbox {spinEntry spinScroll {spinLabel ""}} { global disabledColor disable_fullentry "" $spinEntry "" if {[string compare $spinScroll ""] != 0} { disable_scrollbar $spinScroll $disabledColor } if {[string compare $spinLabel ""] != 0} { disable_label $spinLabel $disabledColor } } # enable_spinbox: enables all the components of a spinbox. proc enable_spinbox {spinEntry spinScroll {spinLabel ""}} { enable_fullentry "" $spinEntry "" if {[string compare $spinScroll ""] != 0} { enable_scrollbar $spinScroll } if {[string compare $spinLabel ""] != 0} { enable_label $spinLabel } } # incr_spinbox: procedure that brings into view the "next" element in the # spin box. # OPTION: # The option 'dateFormat' means to construct the numeric entry as a date # format, meaning, add leading 0 for numbers between 0 to 9. # proc incr_spinbox {spbox {dateFormat 0} } { global vlist.$spbox set valueList [set vlist.$spbox] set newval -1 set cval [$spbox get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if {[string compare $cval ""] == 0} { set cval [expr [digit $min] - 1] } if { [digit $cval] < [digit $max] } { set newval [expr [digit $cval] + 1] $spbox delete 0 end if {$dateFormat && $newval >= 0 && $newval <= 9 } { $spbox insert 0 "0$newval" } else { $spbox insert 0 $newval } } } else { if { [string compare $cval ""] == 0 } { set idx -1 } else { set idx [lsearch $valueList $cval] } if { [expr $idx + 1] < [llength $valueList]} { set newval [lindex $valueList [incr idx]] $spbox delete 0 end $spbox insert 0 $newval } } return $newval } # decr_spinbox: similar to incr_spinbox except in reverse. # proc decr_spinbox {spbox {dateFormat 0} } { global vlist.$spbox set valueList [set vlist.$spbox] set newval -1 set cval [$spbox get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if {[string compare $cval ""] == 0} { set cval [expr [digit $max] + 1] } if { [digit $cval] > [digit $min] } { set newval [expr [digit $cval] - 1] $spbox delete 0 end if {$dateFormat && $newval >= 0 && $newval <= 9 } { $spbox insert 0 "0$newval" } else { $spbox insert 0 $newval } } } else { if {[string compare $cval ""] == 0} { set idx [llength $valueList] } else { set idx [lsearch $valueList $cval] } if { [expr $idx - 1] >= 0 } { set newval [lindex $valueList [incr idx -1]] $spbox delete 0 end $spbox insert 0 $newval } } return $newval } proc check_spinbox_value {spin_entry} { global vlist.$spin_entry set valueList [set vlist.$spin_entry] set sbox_var [$spin_entry get] if [regexp "(\[-0-9]+)-(\[-0-9]+)" $valueList match min max] { if { ![regexp "^(\[-0-9]+)$" $sbox_var match] || \ ([digit $sbox_var] < $min || [digit $sbox_var] > $max) } { $spin_entry delete 0 end } } elseif { [lsearch -exact $valueList $sbox_var] == -1 } { $spin_entry delete 0 end } } torque-2.4.16/src/drmaa/0000777000113300011330000000000011614035204011765 500000000000000torque-2.4.16/src/drmaa/Doxyfile.in0000664000113300011330000000167011272401236014024 00000000000000 PROJECT_NAME = "@PACKAGE_NAME@" PROJECT_NUMBER = @PACKAGE_VERSION@ INPUT = @top_srcdir@/src/drmaa/src EXCLUDE = @top_srcdir@/src/drmaa/src/drmaa_attrib.c \ @top_srcdir@/src/drmaa/src/pbs_attrib.c OUTPUT_DIRECTORY = doc ENABLE_PREPROCESSING = YES PREDEFINED = __GNUC__ JAVADOC_AUTOBRIEF = YES EXTRACT_ALL = NO HIDE_UNDOC_MEMBERS = YES SORT_BRIEF_DOCS = NO SORT_MEMBER_DOCS = NO DETAILS_AT_TOP = YES OPTIMIZE_OUTPUT_FOR_C = YES TAB_SIZE = 2 HAVE_DOT = @HAVE_DOT@ CALL_GRAPH = YES GENERATE_TODOLIST = YES SHOW_DIRECTORIES = NO GENERATE_HTML = YES GENERATE_LATEX = YES USE_PDFLATEX = YES PDF_HYPERLINKS = YES COMPACT_LATEX = YES LATEX_BATCHMODE = YES GENERATE_MAN = YES #MAN_LINKS = YES torque-2.4.16/src/drmaa/test/0000777000113300011330000000000011614035204012744 500000000000000torque-2.4.16/src/drmaa/test/worker_job.c0000664000113300011330000000043611272401236015176 00000000000000 #include /* let's write some "effective" algortihm. */ long fib(int n) { switch (n) { case 0: case 1: return n; default: return fib(n -1) + fib(n - 2); } } int main(int argc, char *argv[]) { fib(atoi(argv[1])); exit(0); } torque-2.4.16/src/drmaa/test/Makefile.in0000664000113300011330000005137611605403725014752 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # $Id: Makefile.am,v 1.4 2006/06/08 01:27:17 ciesnik Exp $ # # DRMAA library for Torque/PBS # Copyright (C) 2006 Poznan Supercomputing and Networking Center # DSP team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # SOURCES = $(example_SOURCES) $(exit_job_SOURCES) $(sleeper_job_SOURCES) $(suicide_job_SOURCES) $(test_SOURCES) $(worker_job_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = test$(EXEEXT) example$(EXEEXT) sleeper_job$(EXEEXT) \ worker_job$(EXEEXT) suicide_job$(EXEEXT) exit_job$(EXEEXT) subdir = src/drmaa/test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am_example_OBJECTS = example.$(OBJEXT) example_OBJECTS = $(am_example_OBJECTS) example_DEPENDENCIES = @top_builddir@/src/drmaa/src/libdrmaa.la am_exit_job_OBJECTS = exit_job.$(OBJEXT) exit_job_OBJECTS = $(am_exit_job_OBJECTS) exit_job_LDADD = $(LDADD) am_sleeper_job_OBJECTS = sleeper_job.$(OBJEXT) sleeper_job_OBJECTS = $(am_sleeper_job_OBJECTS) sleeper_job_LDADD = $(LDADD) am_suicide_job_OBJECTS = suicide_job.$(OBJEXT) suicide_job_OBJECTS = $(am_suicide_job_OBJECTS) suicide_job_LDADD = $(LDADD) am_test_OBJECTS = test.$(OBJEXT) test_OBJECTS = $(am_test_OBJECTS) test_DEPENDENCIES = @top_builddir@/src/drmaa/src/libdrmaa.la am_worker_job_OBJECTS = worker_job.$(OBJEXT) worker_job_OBJECTS = $(am_worker_job_OBJECTS) worker_job_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(example_SOURCES) $(exit_job_SOURCES) \ $(sleeper_job_SOURCES) $(suicide_job_SOURCES) $(test_SOURCES) \ $(worker_job_SOURCES) DIST_SOURCES = $(example_SOURCES) $(exit_job_SOURCES) \ $(sleeper_job_SOURCES) $(suicide_job_SOURCES) $(test_SOURCES) \ $(worker_job_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AM_CPPFLAGS = -I$(top_srcdir)/src/drmaa/src test_SOURCES = test.c ../src/drmaa.h example_SOURCES = example.c ../src/drmaa.h sleeper_job_SOURCES = sleeper_job.c worker_job_SOURCES = worker_job.c suicide_job_SOURCES = suicide_job.c exit_job_SOURCES = exit_job.c test_LDADD = @top_builddir@/src/drmaa/src/libdrmaa.la example_LDADD = @top_builddir@/src/drmaa/src/libdrmaa.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/drmaa/test/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/drmaa/test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done example$(EXEEXT): $(example_OBJECTS) $(example_DEPENDENCIES) @rm -f example$(EXEEXT) $(LINK) $(example_LDFLAGS) $(example_OBJECTS) $(example_LDADD) $(LIBS) exit_job$(EXEEXT): $(exit_job_OBJECTS) $(exit_job_DEPENDENCIES) @rm -f exit_job$(EXEEXT) $(LINK) $(exit_job_LDFLAGS) $(exit_job_OBJECTS) $(exit_job_LDADD) $(LIBS) sleeper_job$(EXEEXT): $(sleeper_job_OBJECTS) $(sleeper_job_DEPENDENCIES) @rm -f sleeper_job$(EXEEXT) $(LINK) $(sleeper_job_LDFLAGS) $(sleeper_job_OBJECTS) $(sleeper_job_LDADD) $(LIBS) suicide_job$(EXEEXT): $(suicide_job_OBJECTS) $(suicide_job_DEPENDENCIES) @rm -f suicide_job$(EXEEXT) $(LINK) $(suicide_job_LDFLAGS) $(suicide_job_OBJECTS) $(suicide_job_LDADD) $(LIBS) test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) @rm -f test$(EXEEXT) $(LINK) $(test_LDFLAGS) $(test_OBJECTS) $(test_LDADD) $(LIBS) worker_job$(EXEEXT): $(worker_job_OBJECTS) $(worker_job_DEPENDENCIES) @rm -f worker_job$(EXEEXT) $(LINK) $(worker_job_LDFLAGS) $(worker_job_OBJECTS) $(worker_job_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exit_job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleeper_job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/suicide_job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker_job.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/drmaa/test/sleeper_job.c0000664000113300011330000000016711272401236015325 00000000000000 #include #include int main(int argc, char *argv[]) { sleep(atoi(argv[1])); exit(0); } torque-2.4.16/src/drmaa/test/exit_job.c0000664000113300011330000000012711272401236014633 00000000000000 #include int main(int argc, char *argv[]) { exit(atoi(argv[1])); } torque-2.4.16/src/drmaa/test/suicide_job.c0000664000113300011330000000025411272401236015310 00000000000000 #include #include #include #include int main(int argc, char *argv[]) { kill(getpid(), atoi(argv[1])); exit(1); } torque-2.4.16/src/drmaa/test/test.c0000664000113300011330000001163611272401236014016 00000000000000/* $Id: test.c,v 1.5 2006/06/08 01:27:39 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #define ERR_LEN DRMAA_ERROR_STRING_BUFFER #define errno_error( func ) do{ \ fprintf( stderr, "%s:%d: %s: %s\n", \ __FILE__, __LINE__, func, strerror(errno) ); \ exit( 1 ); \ } while(0) #define drmaa_error( func ) do{ \ fprintf( stderr, "%s:%d: %s: %s\n> %s\n", \ __FILE__, __LINE__, func, \ drmaa_strerror(rc), err_msg ); \ exit(1); \ }while(0) const char sleeper_job[] = "./sleeper_job"; const char exit_job[] = "./exit_job"; const char suicide_job[] = "./suicide_job"; char working_dir[ PATH_MAX ]; void test_exit_status(int exit_value); void signal_test(int signal); int main(int argc, char *argv[]) { char err_msg[ ERR_LEN ] = ""; int rc = DRMAA_ERRNO_SUCCESS; if (getcwd(working_dir, PATH_MAX) == NULL) errno_error("getcwd"); rc = drmaa_init(NULL, err_msg, ERR_LEN); { int tab[5] = { 0, 1, 3, 100, 21 }; int i; for (i = 0; i < 5; i++) test_exit_status(tab[i]); } signal_test(SIGTERM); signal_test(SIGABRT); signal_test(SIGKILL); rc = drmaa_exit(err_msg, ERR_LEN); return 0; } drmaa_job_template_t * create_simple_job(char *argv[], int no) { int rc = DRMAA_ERRNO_SUCCESS; drmaa_job_template_t *job = NULL; char err_msg[ ERR_LEN ] = ""; int i; rc = drmaa_allocate_job_template(&job, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_allocate_job_template"); rc = drmaa_set_attribute(job, DRMAA_WD, working_dir, err_msg, ERR_LEN); rc = drmaa_set_attribute(job, DRMAA_REMOTE_COMMAND, argv[0], err_msg, ERR_LEN); rc = drmaa_set_vector_attribute(job, DRMAA_V_ARGV, (const char**)argv + 1, err_msg, ERR_LEN); for (i = 0; i < 3; i++) { static const char *paths[3] = { "job.%d.input", "job.%d.output", "job.%d.error" }; static const char *attrs[3] = { DRMAA_INPUT_PATH, DRMAA_OUTPUT_PATH, DRMAA_ERROR_PATH }; char path[ PATH_MAX ]; sprintf(path, paths[i], no); rc = drmaa_set_attribute(job, attrs[i], path, err_msg, ERR_LEN); } if (rc) drmaa_error("drmaa_set_attribute"); return job; } void test_exit_status(int exit_value) { char err_msg[ DRMAA_ERROR_STRING_BUFFER ] = ""; int rc = DRMAA_ERRNO_SUCCESS; drmaa_job_template_t *job = NULL; char jobid[ 128 ]; char *argv[3]; int stat; drmaa_attr_values_t *rusage; argv[0] = strdup(exit_job); argv[1] = strdup(" "); argv[2] = NULL; sprintf(argv[1], "%d", exit_value); job = create_simple_job(argv, 1); rc = drmaa_run_job(jobid, sizeof(jobid), job, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_run_job"); rc = drmaa_wait(jobid, NULL, 0, &stat, DRMAA_TIMEOUT_WAIT_FOREVER, &rusage, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_wait"); rc = drmaa_delete_job_template(job, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_delete_job_template"); free(argv[0]); free(argv[1]); } void signal_test(int signal) { char err_msg[ DRMAA_ERROR_STRING_BUFFER ] = ""; int rc = DRMAA_ERRNO_SUCCESS; drmaa_job_template_t *job = NULL; char jobid[ 128 ]; char *argv[3]; int stat; drmaa_attr_values_t *rusage; argv[0] = strdup(suicide_job); argv[1] = strdup(" "); argv[2] = NULL; sprintf(argv[1], "%d", signal); job = create_simple_job(argv, 1); rc = drmaa_run_job(jobid, sizeof(jobid), job, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_run_job"); rc = drmaa_wait(jobid, NULL, 0, &stat, DRMAA_TIMEOUT_WAIT_FOREVER, &rusage, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_wait"); rc = drmaa_delete_job_template(job, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_delete_job_template"); free(argv[0]); free(argv[1]); } torque-2.4.16/src/drmaa/test/Makefile.am0000664000113300011330000000266611272401236014732 00000000000000# $Id: Makefile.am,v 1.4 2006/06/08 01:27:17 ciesnik Exp $ # # DRMAA library for Torque/PBS # Copyright (C) 2006 Poznan Supercomputing and Networking Center # DSP team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # AM_CPPFLAGS = -I$(top_srcdir)/src/drmaa/src noinst_PROGRAMS = test example sleeper_job worker_job suicide_job exit_job test_SOURCES = test.c ../src/drmaa.h example_SOURCES = example.c ../src/drmaa.h sleeper_job_SOURCES = sleeper_job.c worker_job_SOURCES = worker_job.c suicide_job_SOURCES = suicide_job.c exit_job_SOURCES = exit_job.c test_LDADD = @top_builddir@/src/drmaa/src/libdrmaa.la example_LDADD = @top_builddir@/src/drmaa/src/libdrmaa.la torque-2.4.16/src/drmaa/test/example.c0000664000113300011330000001725411272401236014474 00000000000000/* $Id: example.c,v 1.2 2006/09/04 22:03:51 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file test.c * DRMAA library test / usage example. */ #include #include #include #include #include #include #include #include #define SEND_MAIL 0 #define WITH_BULK 0 #define EXPORT_ENVS 0 #define DEBUG 0 #define N_JOBS 1 #define ERR_LEN DRMAA_ERROR_STRING_BUFFER #define JOB_ID_LEN 256 #define errno_error( func ) do{ \ fprintf( stderr, "%s:%d: %s: %s\n", \ __FILE__, __LINE__, func, strerror(errno) ); \ exit( 1 ); \ } while(0) #define drmaa_error( func ) do{ \ fprintf( stderr, "%s:%d: %s: %s\n> %s\n", \ __FILE__, __LINE__, func, \ drmaa_strerror(rc), err_msg ); \ exit(1); \ }while(0) void test_1(void); drmaa_job_template_t * construct_job(char *argv[], char *fds[3], const char *cwd); void time_fmt(time_t t, char *buf, size_t buflen); int main(int argc, char *argv[]) { test_1(); return 0; } void test_1(void) { char err_msg[ ERR_LEN ] = ""; char cwd[ PATH_MAX ]; char job_ids[ N_JOBS ][ JOB_ID_LEN ]; #if WITH_BULK drmaa_job_ids_t *bulk_job_ids = NULL; #endif int rc; int i; drmaa_job_template_t *jobs[ N_JOBS ]; drmaa_job_template_t *bulk_job = NULL; if (getcwd(cwd, PATH_MAX) == NULL) errno_error("getcwd"); printf("connecting\n"); rc = drmaa_init(NULL, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_init"); for (i = 0; i < N_JOBS; i++) { char arg[ 3 ]; char job_path[ PATH_MAX ]; char *argv[3]; char fds_t[3][64]; char *fds[3]; int j; printf("constructing %d\n", i); sprintf(arg, "%d", i); sprintf(job_path, "./test_job"); argv[0] = job_path; argv[1] = arg; argv[2] = NULL; for (j = 0; j < 3; j++) fds[j] = fds_t[j]; sprintf(fds[0], "$drmaa_wd_ph$/%d.stdin", i); sprintf(fds[1], "$drmaa_wd_ph$/%d.stdout", i); sprintf(fds[2], "$drmaa_wd_ph$/%d.stderr", i); jobs[i] = construct_job(argv, fds, cwd); #if 0 char start_time_buf[ 20 ]; time_fmt(time(NULL) + 15*i, start_time_buf, sizeof(start_time_buf)); printf("%d: drmaa_start_time=%s\n", i, start_time_buf); rc = drmaa_set_attribute(jobs[i], "drmaa_start_time", start_time_buf, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_set_attribute(\"drmaa_set_attribute\")"); #endif } for (i = 0; i < N_JOBS; i++) { char job_id[ DRMAA_JOBNAME_BUFFER ]; int stat; drmaa_attr_values_t *rusage; printf("running %d\n", i); rc = drmaa_run_job(job_ids[i], JOB_ID_LEN, jobs[ i ], err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_run_job"); sleep(1); rc = drmaa_wait(job_ids[i], job_id, sizeof(job_id), &stat, DRMAA_TIMEOUT_WAIT_FOREVER, &rusage, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_job_wait"); printf("stat=%d\n", stat); } #if WITH_BULK { char *argv[] = { "./job", "bulk", "$drmaa_incr_ph$", NULL }; char *fds[] = { "b.$drmaa_incr_ph$.stdin", "b.$drmaa_incr_ph$.stdout", "b.$drmaa_incr_ph$.stderr" }; bulk_job = construct_job(argv, fds, WD); } rc = drmaa_run_bulk_jobs(&bulk_job_ids, bulk_job, 1, N_JOBS, 1, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_run_bulk_jobs"); if (bulk_job_ids != NULL) drmaa_release_job_ids(bulk_job_ids); #endif for (i = 0; i < N_JOBS; i++) { rc = drmaa_delete_job_template(jobs[i], err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_delete_job_template"); } if (bulk_job != NULL) { rc = drmaa_delete_job_template(bulk_job, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_delete_job_template"); } rc = drmaa_exit(err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_exit"); } drmaa_job_template_t * construct_job(char *argv[], char *fds[3], const char *cwd) { #if 0 const char *scalar_attrs[] = { DRMAA_WD , cwd, DRMAA_REMOTE_COMMAND, argv[0], DRMAA_JOB_NAME , "jobname", DRMAA_INPUT_PATH , fds[0], DRMAA_OUTPUT_PATH , fds[1], DRMAA_ERROR_PATH , fds[2], /* DRMAA_DURATION_SLIMIT , "00:00:30", DRMAA_DURATION_HLIMIT , "00:01:00", DRMAA_WCT_SLIMIT , "00:00:02", DRMAA_WCT_HLIMIT , "00:00:02", */ NULL , NULL }; #endif const char *scalar_attrs[] = { DRMAA_WD , NULL, DRMAA_REMOTE_COMMAND, NULL, DRMAA_JOB_NAME , NULL, DRMAA_INPUT_PATH , NULL, DRMAA_OUTPUT_PATH , NULL, DRMAA_ERROR_PATH , NULL, NULL , NULL }; #if EXPORT_ENVS const char *exported_envs[] = { "HOME", "PATH", "LD_LIBRARY_PATH", "USER", "USERNAME", "LANG", "LC_ALL", "LC_CTYPE", "LC_MESSAGES", "NLSPATH", "DISPLAY", NULL }; char *env[ 32 ]; #endif drmaa_job_template_t *job; char err_msg[ ERR_LEN ] = ""; const char *const *i; int rc; scalar_attrs[ 1] = cwd; scalar_attrs[ 3] = argv[0]; scalar_attrs[ 5] = "jobname"; scalar_attrs[ 7] = fds[0]; scalar_attrs[ 9] = fds[1]; scalar_attrs[11] = fds[2]; printf("allocaing template\n"); rc = drmaa_allocate_job_template(&job, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_allocate_job_template"); { for (i = scalar_attrs; *i;) { const char *name = *i++; const char *value = *i++; printf("set %s=%s\n", name, value); rc = drmaa_set_attribute(job, name, value, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_set_attribute"); } # if EXPORT_ENVS for (i = exported_envs, j = env; *i != NULL; i++) { const char *value = getenv(*i); if (value != NULL) { *j = malloc(strlen(*i) + 1 + strlen(value) + 1); sprintf(*j, "%s=%s", *i, value); printf("env: %s\n", *j); j++; } } *j = NULL; # endif } rc = drmaa_set_vector_attribute(job, DRMAA_V_ARGV, (const char**)argv + 1, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_set_vector_attribute"); #if SEND_MAIL char *mail_list[] = { "lukasz.ciesnik@gmail.com", NULL }; rc = drmaa_set_vector_attribute(job, DRMAA_V_EMAIL, (const char**)mail_list, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_set_vector_attribute(DRMAA_V_EMAIL)"); #endif #if EXPORT_ENVS rc = drmaa_set_vector_attribute(job, DRMAA_V_ENV, (const char**)env, err_msg, ERR_LEN); if (rc) drmaa_error("drmaa_set_vector_attribute(DRMAA_V_ENV)"); #endif return job; } void time_fmt(time_t t, char *buf, size_t buflen) { struct tm timem; gmtime_r(&t, &timem); strftime(buf, buflen, "%Y/%m/%d %H:%M:%S", &timem); } torque-2.4.16/src/drmaa/src/0000777000113300011330000000000011614035204012554 500000000000000torque-2.4.16/src/drmaa/src/lookup3.h0000664000113300011330000000141411272401236014241 00000000000000/* $Id: lookup3.h,v 1.2 2006/09/08 18:18:08 ciesnik Exp $ */ /** * @file lookup3.h * 32bit hash function implementation. * * Taken from: * http://burtleburtle.net/bob/hash/ */ #ifndef __LOOKUP3_H #define __LOOKUP3_H #ifndef HAVE_CONFIG_H # include #endif #ifdef HAVE_STDINT_H # include #else # ifdef HAVE_INTTYPES_H # include # endif #endif uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval); uint32_t hashlittle(const void *key, size_t length, uint32_t initval); uint32_t hashbig(const void *key, size_t length, uint32_t initval); #if BYTEORDER == 1234 /* little endian */ # define hashstr hashlittle #endif #if BYTEORDER == 4321 /* big endian */ # define hashstr hashbig #endif #endif /* __LOOKUP3_H */ torque-2.4.16/src/drmaa/src/error.h0000664000113300011330000000456311272401236014006 00000000000000/* $Id: error.h,v 1.4 2006/09/08 18:18:08 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file error.h * Rasing errors. */ #ifndef __DRMAA__ERROR_H #define __DRMAA__ERROR_H #ifdef HAVE_CONFIG_H # include #endif #include int drmaa_get_errno_error(char *error_diagnosis, size_t error_diag_len); int drmaa_get_drmaa_error(char *error_diagnosis, size_t error_diag_len, int error_code); int drmaa_get_pbs_error(char *error_diagnosis, size_t error_diag_len); int drmaa_map_pbs_error(int pbs_errcode); void drmaa_log(const char *fmt, ...) __attribute__((format(printf, 1, 2))); #if DRMAA_DEBUG # define DEBUG( args ) do{ drmaa_log args ; }while(0) #else # define DEBUG( args ) /* nothing */ #endif #define STORE_ERRNO_MSG() \ do{ drmaa_get_errno_error( errmsg, errlen ); }while(0) #define RAISE_ERRNO( retcode ) do { \ STORE_ERRNO_MSG(); \ return retcode; \ } while(0) #define SET_DRMAA_ERROR( retcode ) \ do{ drmaa_get_drmaa_error( errmsg, errlen, (retcode) ); } while(0) #define RAISE_DRMAA( retcode ) do { \ SET_DRMAA_ERROR( retcode ); \ return retcode; \ } while(0) #define RAISE_NO_MEMORY() \ RAISE_DRMAA( DRMAA_ERRNO_NO_MEMORY ) #define RAISE_PBS() \ do{ return drmaa_get_pbs_error( errmsg, errlen ); } while(0) #define SET_PBS_ERROR( rc_var ) \ do{ (rc_var) = drmaa_get_pbs_error( errmsg, errlen ); } while(0) #endif /* __DRMAA__ERROR_H */ torque-2.4.16/src/drmaa/src/pbs_attrib.gperf0000664000113300011330000000601311272401236015652 00000000000000%{ /* $Id: pbs_attrib.gperf,v 1.4 2006/06/05 23:27:18 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__ ((unused)) # endif = "$Id: pbs_attrib.gperf,v 1.4 2006/06/05 23:27:18 ciesnik Exp $"; #endif %} struct pbs_attrib{ const char *name; int code; }; %% # used by used user commands Job_Name, ATTR_JOB_NAME Variable_List, ATTR_ENV Output_Path, ATTR_OUTPUT_PATH Error_Path, ATTR_ERROR_PATH Join_Path, ATTR_JOIN_FILES Mail_User, ATTR_EMAIL Mail_Points, ATTR_MAIL_POINTS stagein, ATTR_STAGEIN stageout, ATTR_STAGEOUT Keep_Files, ATTR_KEEP_FILES Execution_Time, ATTR_SOFT_CPU_TIME_LIMIT Checkpoint, ATTR_CHECKPOINT group_list, ATTR_GROUP_LIST Hold_Types, ATTR_HOLD_TYPES Resource_List, ATTR_RESOURCES Priority, ATTR_PRIORITY destination, ATTR_DESTINATION_QUEUE Rerunable, ATTR_RERUNABLE User_List, ATTR_USER_LIST Account_Name, ATTR_REMOTE_USER Shell_Path_List, ATTR_SHELL depend, ATTR_DEPENDENCIES interactive, ATTR_INTERACTIVE # additional job and general attribute names job_state, ATTR_JOB_STATE ctime, ATTR_CTIME etime, ATTR_ETIME qtime, ATTR_QTIME resources_used, ATTR_RESOURCES_USED exit_status, ATTR_EXIT_STATUS substate, ATTR_JOB_SUBMIT_STATE Job_Owner, ATTR_JOB_OWNER euser, ATTR_EUSER egroup, ATTR_EGROUP hop_count, ATTR_HOP_COUNT security, ATTR_SECURITY sched_hint, ATTR_SCHEDULER_HINT server, ATTR_SERVER queue, ATTR_QUEUE queue_rank, ATTR_QUEUE_RANK exec_host, ATTR_EXECUTION_HOST total_jobs, ATTR_TOTAL_JOBS max_running, ATTR_MAX_RUNNING comment, ATTR_COMMENT cookie, ATTR_JOB_COOKIE hashname, ATTR_HASHNAME session_id, ATTR_SESSION_ID alt_id, ATTR_ALT_ID # vim: syn=c torque-2.4.16/src/drmaa/src/drmaa_impl.h0000664000113300011330000001523311272401236014756 00000000000000/* $Id: drmaa_impl.h,v 1.9 2006/09/08 18:18:08 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __DRMAA_IMPL_H #define __DRMAA_IMPL_H #ifdef HAVE_CONFIG_H # include #endif #include #ifdef HAVE_STDBOOL_H #include #endif #include #include #include "pbs_ifl.h" #include #include #include typedef struct drmaa_session_s drmaa_session_t; typedef struct drmaa_job_s drmaa_job_t; /** Mutex for accessing @ref drmaa_session global variable. */ extern pthread_mutex_t drmaa_session_mutex; extern drmaa_session_t *drmaa_session; /** DRMAA session data. */ struct drmaa_session_s { int pbs_conn; /**< PBS connection (or -1). */ char *contact; /**< Contact to PBS server -- `host[:port]'. */ drmaa_job_template_t *jt_list; /**< Cyclic list (with sentinel) of job templates created in this DRMAA session. */ drmaa_job_t **job_hashtab; /**< Hash table of jobs which have to be remembered in DRMAA session (was submitted in this session and its status was not removed). */ int next_time_label; /**< Will be assigned to next submitted job. */ pthread_mutex_t conn_mutex; /**< Mutex for PBS connection. */ pthread_mutex_t jobs_mutex; /**< Mutex for #jt_list, #job_list and #next_time_label. */ }; /** Job template data. */ struct drmaa_job_template_s { drmaa_session_t *session; /**< DRMAA session in which job template was created. */ drmaa_job_template_t *prev; /**< Previous job template in list. */ drmaa_job_template_t *next; /**< Next job template in list. */ void **attrib; /**< Table of DRMAA attributes. It is filled with N_DRMAA_ATTRIBS values which are either @c NULL (attribute not set) or string (scalar attribute) or @c NULL terminated array of strings (vector attribute). */ pthread_mutex_t mutex; /**< Mutex for accessing job attributes. */ }; struct drmaa_attr_names_s { char **list, **iter; }; struct drmaa_attr_values_s { char **list, **iter; }; struct drmaa_job_ids_s { char **list, **iter; }; typedef struct drmaa_submission_context_s drmaa_submission_context_t; enum { DRMAA_PLACEHOLDER_MASK_HD = 1 << 0, DRMAA_PLACEHOLDER_MASK_WD = 1 << 1, DRMAA_PLACEHOLDER_MASK_INCR = 1 << 2 }; struct drmaa_submission_context_s { const drmaa_job_template_t *jt; struct attropl *pbs_attribs; char *script_filename; char *home_directory; char *working_directory; char *bulk_incr_no; }; /** @defgroup drmaa_session Session managing function. @{ */ int drmaa_create(drmaa_session_t **pc, const char *contact, char *errmsg, size_t errlen); int drmaa_destroy(drmaa_session_t *c, char *errmsg, size_t errlen); /** @} */ /** @addtogroup drmaa_jobt */ void drmaa_delete_async_job_template(drmaa_job_template_t *jt); int drmaa_impl_get_attribute_names( drmaa_attr_names_t **values, unsigned f_mask, unsigned flags, char *errmsg, size_t errlen ); int drmaa_run_job_impl( char *job_id, size_t job_id_len, const drmaa_job_template_t *jt, int bulk_no, char *errmsg, size_t errlen ); int drmaa_job_wait( const char *jobid, char *out_jobid, size_t out_jobid_size, int *stat, drmaa_attr_values_t **rusage, int dispose, time_t timeout_time, char *errmsg, size_t errlen ); /** * Check if session is empty (there are no jobs * which was submitted and termination information is left). * @return @c true if session is empty. * Otherwise clears the session and returns @c false. */ bool drmaa_check_empty_session(drmaa_session_t *c); int drmaa_create_submission_context( drmaa_submission_context_t **c, const drmaa_job_template_t *jt, int bulk_no, char *errmsg, size_t errlen); void drmaa_free_submission_context(drmaa_submission_context_t *c); int drmaa_set_job_std_attribs( drmaa_submission_context_t *c, char *errmsg, size_t errlen ); int drmaa_create_job_script( drmaa_submission_context_t *c, char *errmsg, size_t errlen ); int drmaa_set_job_files( drmaa_submission_context_t *c, char *errmsg, size_t errlen ); int drmaa_set_file_staging( drmaa_submission_context_t *c, char *errmsg, size_t errlen ); int drmaa_set_job_environment( drmaa_submission_context_t *c, char *errmsg, size_t errlen ); char * drmaa_translate_staging(const char *stage); int drmaa_set_job_email_notication( drmaa_submission_context_t *c, char *errmsg, size_t errlen ); int drmaa_set_job_submit_state( drmaa_submission_context_t *c, char *errmsg, size_t errlen ); int drmaa_add_pbs_attr( drmaa_submission_context_t *c, int attr, char *value, unsigned set, char *errmsg, size_t errlen ); int drmaa_write_tmpfile( char **filename, const char *content, size_t len, char *errmsg, size_t errlen ); char * drmaa_explode(const char **vector, char glue); void drmaa_free_vector(char **vector); void drmaa_free_attropl(struct attropl *attr); char * drmaa_expand_placeholders( drmaa_submission_context_t *c, char *input, unsigned set); char * drmaa_replace(char *input, const char *placeholder, const char *value); #define GET_DRMAA_SESSION( session ) do{ \ pthread_mutex_lock( &drmaa_session_mutex ); \ if( drmaa_session == NULL ) \ { \ pthread_mutex_unlock( &drmaa_session_mutex ); \ RAISE_DRMAA( DRMAA_ERRNO_NO_ACTIVE_SESSION ); \ } \ session = drmaa_session; \ pthread_mutex_unlock( &drmaa_session_mutex ); \ }while(0) #define RELEASE_DRMAA_SESSION( session ) /* nothing */ #endif /* __DRMAA_IMPL_H */ torque-2.4.16/src/drmaa/src/lookup3.c0000664000113300011330000005755711272401236014257 00000000000000/* ------------------------------------------------------------------------------- lookup3.c, by Bob Jenkins, May 2006, Public Domain. These are functions for producing 32-bit hashes for hash table lookup. hashword(), hashlittle(), hashbig(), mix(), and final() are externally useful functions. Routines to test the hash are included if SELF_TEST is defined. You can use this free for any purpose. It has no warranty. You probably want to use hashlittle(). hashlittle() and hashbig() hash byte arrays. hashlittle() is is faster than hashbig() on little-endian machines. Intel and AMD are little-endian machines. If you want to find a hash of, say, exactly 7 integers, do a = i1; b = i2; c = i3; mix(a,b,c); a += i4; b += i5; c += i6; mix(a,b,c); a += i7; final(a,b,c); then use c as the hash value. If you have a variable length array of 4-byte integers to hash, use hashword(). If you have a byte array (like a character string), use hashlittle(). If you have several byte arrays, or a mix of things, see the comments above hashlittle(). Code changed for ANSI C compilers and autotools by Łukasz Cieśnik. ------------------------------------------------------------------------------- */ #ifdef HAVE_CONFIG_H # include #endif #include #ifdef HAVE_STDINT_H # include #else # ifdef HAVE_INTTYPES_H # include # endif #endif #ifdef SELF_TEST #include #include #include #endif #ifndef lint static char rcsid[] # ifdef __GNUC__ # endif = "$Id: lookup3.c,v 1.2 2006/09/08 18:18:08 ciesnik Exp $"; #endif typedef uint32_t uint32; /* unsigned 4-byte quantities */ typedef uint16_t uint16; /* unsigned 2-byte quantities */ typedef uint8_t uint8; /* unsigned 1-byte quantities */ #if BYTEORDER == 1234 /* little endian */ # define HASH_LITTLE_ENDIAN 1 # define HASH_BIG_ENDIAN 0 #endif #if BYTEORDER == 4321 /* big endian */ # define HASH_LITTLE_ENDIAN 0 # define HASH_BIG_ENDIAN 1 #endif #if 0 /* * My best guess at if you are big-endian or little-endian. This may * need adjustment. */ #if defined(i386) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL) # define HASH_LITTLE_ENDIAN 1 # define HASH_BIG_ENDIAN 0 #elif defined(sparc) # define HASH_LITTLE_ENDIAN 0 # define HASH_BIG_ENDIAN 1 #else # define HASH_LITTLE_ENDIAN 0 # define HASH_BIG_ENDIAN 0 #endif #endif #define hashsize(n) ((uint32)1<<(n)) #define hashmask(n) (hashsize(n)-1) #define rot(x,k) (((x)<<(k)) ^ ((x)>>(32-(k)))) /* ------------------------------------------------------------------------------- mix -- mix 3 32-bit values reversibly. This is reversible, so any information in (a,b,c) before mix() is still in (a,b,c) after mix(). If four pairs of (a,b,c) inputs are run through mix(), or through mix() in reverse, there are at least 32 bits of the output that are sometimes the same for one pair and different for another pair. This was tested for: * pairs that differed by one bit, by two bits, in any combination of top bits of (a,b,c), or in any combination of bottom bits of (a,b,c). * "differ" is defined as +, -, ^, or ~^. For + and -, I transformed the output delta to a Gray code (a^(a>>1)) so a string of 1's (as is commonly produced by subtraction) look like a single 1-bit difference. * the base values were pseudorandom, all zero but one bit set, or all zero plus a counter that starts at zero. Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that satisfy this are 4 6 8 16 19 4 9 15 3 18 27 15 14 9 3 7 17 3 Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing for "differ" defined as + with a one-bit base and a two-bit delta. I used http://burtleburtle.net/bob/hash/avalanche.html to choose the operations, constants, and arrangements of the variables. This does not achieve avalanche. There are input bits of (a,b,c) that fail to affect some output bits of (a,b,c), especially of a. The most thoroughly mixed value is c, but it doesn't really even achieve avalanche in c. This allows some parallelism. Read-after-writes are good at doubling the number of bits affected, so the goal of mixing pulls in the opposite direction as the goal of parallelism. I did what I could. Rotates seem to cost as much as shifts on every machine I could lay my hands on, and rotates are much kinder to the top and bottom bits, so I used rotates. ------------------------------------------------------------------------------- */ #define mix(a,b,c) \ { \ a -= c; a ^= rot(c, 4); c += b; \ b -= a; b ^= rot(a, 6); a += c; \ c -= b; c ^= rot(b, 8); b += a; \ a -= c; a ^= rot(c,16); c += b; \ b -= a; b ^= rot(a,19); a += c; \ c -= b; c ^= rot(b, 4); b += a; \ } /* ------------------------------------------------------------------------------- final -- final mixing of 3 32-bit values (a,b,c) into c Pairs of (a,b,c) values differing in only a few bits will usually produce values of c that look totally different. This was tested for * pairs that differed by one bit, by two bits, in any combination of top bits of (a,b,c), or in any combination of bottom bits of (a,b,c). * "differ" is defined as +, -, ^, or ~^. For + and -, I transformed the output delta to a Gray code (a^(a>>1)) so a string of 1's (as is commonly produced by subtraction) look like a single 1-bit difference. * the base values were pseudorandom, all zero but one bit set, or all zero plus a counter that starts at zero. These constants passed: 14 11 25 16 4 14 24 12 14 25 16 4 14 24 and these came close: 4 8 15 26 3 22 24 10 8 15 26 3 22 24 11 8 15 26 3 22 24 ------------------------------------------------------------------------------- */ #define final(a,b,c) \ { \ c ^= b; c -= rot(b,14); \ a ^= c; a -= rot(c,11); \ b ^= a; b -= rot(a,25); \ c ^= b; c -= rot(b,16); \ a ^= c; a -= rot(c,4); \ b ^= a; b -= rot(a,14); \ c ^= b; c -= rot(b,24); \ } /** * This works on all machines. To be useful, it requires * -- that the key be an array of uint32's, and * -- that all your machines have the same endianness, and * -- that the length be the number of uint32's in the key * The function hashword() is identical to hashlittle() on little-endian * machines, and identical to hashbig() on big-endian machines, * except that the length has to be measured in uint32s rather than in * bytes. hashlittle() is more complicated than hashword() only because * hashlittle() has to dance around fitting the key bytes into registers. * * @param k the key, an array of uint32 values * @param length the length of the key, in uint32s * @param initval the previous hash, or an arbitrary value */ uint32 hashword(const uint32 *k, size_t length, uint32 initval) { uint32 a, b, c; /* Set up the internal state */ a = b = c = 0xdeadbeef + (((uint32)length) << 2) + initval; /*------------------------------------------------- handle most of the key */ while (length > 3) { a += k[0]; b += k[1]; c += k[2]; mix(a, b, c); length -= 3; k += 3; } /*--------------------------------------------- handle the last 3 uint32's */ switch (length) /* all the case statements fall through */ { case 3 : c += k[2]; case 2 : b += k[1]; case 1 : a += k[0]; final(a, b, c); case 0: /* case 0: nothing left to add */ break; } /*------------------------------------------------------ report the result */ return c; } /** * hashlittle() -- hash a variable-length key into a 32-bit value * @param key the key (the unaligned variable-length array of bytes) * @param length the length of the key, counting by bytes * @param initval can be any 4-byte value * * Returns a 32-bit value. Every bit of the key affects every bit of * the return value. Two keys differing by one or two bits will have * totally different hash values. * * The best hash table sizes are powers of 2. There is no need to do * mod a prime (mod is sooo slow!). If you need less than 32 bits, * use a bitmask. For example, if you need only 10 bits, do * h = (h & hashmask(10)); * In which case, the hash table should have hashsize(10) elements. * * If you are hashing n strings (uint8 **)k, do it like this: * for (i=0, h=0; i 12) { a += k[0]; b += k[1]; c += k[2]; mix(a, b, c); length -= 12; k += 3; } /*----------------------------- handle the last (probably partial) block */ switch (length) { case 12: c += k[2]; b += k[1]; a += k[0]; break; case 11: c += k[2] & 0xffffff; b += k[1]; a += k[0]; break; case 10: c += k[2] & 0xffff; b += k[1]; a += k[0]; break; case 9 : c += k[2] & 0xff; b += k[1]; a += k[0]; break; case 8 : b += k[1]; a += k[0]; break; case 7 : b += k[1] & 0xffffff; a += k[0]; break; case 6 : b += k[1] & 0xffff; a += k[0]; break; case 5 : b += k[1] & 0xff; a += k[0]; break; case 4 : a += k[0]; break; case 3 : a += k[0] & 0xffffff; break; case 2 : a += k[0] & 0xffff; break; case 1 : a += k[0] & 0xff; break; case 0 : return c; /* zero length strings require no mixing */ } } else if (HASH_LITTLE_ENDIAN && !((((uint8 *)key) - (uint8 *)0) & 0x1)) { const uint16 *k = key; /* read 16-bit chunks */ /*--------------- all but last block: aligned reads and different mixing */ while (length > 12) { a += k[0] + (((uint32)k[1]) << 16); b += k[2] + (((uint32)k[3]) << 16); c += k[4] + (((uint32)k[5]) << 16); mix(a, b, c); length -= 12; k += 6; } /*----------------------------- handle the last (probably partial) block */ switch (length) { case 12: c += k[4] + (((uint32)k[5]) << 16); b += k[2] + (((uint32)k[3]) << 16); a += k[0] + (((uint32)k[1]) << 16); break; case 11: c += ((uint32)(k[5] & 0xff)) << 16;/* fall through */ case 10: c += k[4]; b += k[2] + (((uint32)k[3]) << 16); a += k[0] + (((uint32)k[1]) << 16); break; case 9 : c += k[4] & 0xff; /* fall through */ case 8 : b += k[2] + (((uint32)k[3]) << 16); a += k[0] + (((uint32)k[1]) << 16); break; case 7 : b += ((uint32)(k[3] & 0xff)) << 16;/* fall through */ case 6 : b += k[2]; a += k[0] + (((uint32)k[1]) << 16); break; case 5 : b += k[2] & 0xff; /* fall through */ case 4 : a += k[0] + (((uint32)k[1]) << 16); break; case 3 : a += ((uint32)(k[1] & 0xff)) << 16;/* fall through */ case 2 : a += k[0]; break; case 1 : a += k[0] & 0xff; break; case 0 : return c; /* zero length requires no mixing */ } } else /* need to read the key one byte at a time */ { const uint8 *k = key; /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ while (length > 12) { a += k[0]; a += ((uint32)k[1]) << 8; a += ((uint32)k[2]) << 16; a += ((uint32)k[3]) << 24; b += k[4]; b += ((uint32)k[5]) << 8; b += ((uint32)k[6]) << 16; b += ((uint32)k[7]) << 24; c += k[8]; c += ((uint32)k[9]) << 8; c += ((uint32)k[10]) << 16; c += ((uint32)k[11]) << 24; mix(a, b, c); length -= 12; k += 12; } /*-------------------------------- last block: affect all 32 bits of (c) */ switch (length) /* all the case statements fall through */ { case 12: c += ((uint32)k[11]) << 24; case 11: c += ((uint32)k[10]) << 16; case 10: c += ((uint32)k[9]) << 8; case 9 : c += k[8]; case 8 : b += ((uint32)k[7]) << 24; case 7 : b += ((uint32)k[6]) << 16; case 6 : b += ((uint32)k[5]) << 8; case 5 : b += k[4]; case 4 : a += ((uint32)k[3]) << 24; case 3 : a += ((uint32)k[2]) << 16; case 2 : a += ((uint32)k[1]) << 8; case 1 : a += k[0]; break; case 0 : return c; } } final(a, b, c); return c; } /** * hashbig(): * This is the same as hashword() on big-endian machines. It is different * from hashlittle() on all machines. hashbig() takes advantage of * big-endian byte ordering. */ uint32 hashbig(const void *key, size_t length, uint32 initval) { uint32 a, b, c; /* Set up the internal state */ a = b = c = 0xdeadbeef + ((uint32)length) + initval; if (HASH_BIG_ENDIAN && !((((uint8 *)key) - (uint8 *)0) & 0x3)) { const uint32 *k = key; /* read 32-bit chunks */ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ while (length > 12) { a += k[0]; b += k[1]; c += k[2]; mix(a, b, c); length -= 12; k += 3; } /*----------------------------- handle the last (probably partial) block */ switch (length) { case 12: c += k[2]; b += k[1]; a += k[0]; break; case 11: c += k[2] << 8; b += k[1]; a += k[0]; break; case 10: c += k[2] << 16; b += k[1]; a += k[0]; break; case 9 : c += k[2] << 24; b += k[1]; a += k[0]; break; case 8 : b += k[1]; a += k[0]; break; case 7 : b += k[1] << 8; a += k[0]; break; case 6 : b += k[1] << 16; a += k[0]; break; case 5 : b += k[1] << 24; a += k[0]; break; case 4 : a += k[0]; break; case 3 : a += k[0] << 8; break; case 2 : a += k[0] << 16; break; case 1 : a += k[0] << 24; break; case 0 : return c; /* zero length strings require no mixing */ } } else /* need to read the key one byte at a time */ { const uint8 *k = key; /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ while (length > 12) { a += ((uint32)k[0]) << 24; a += ((uint32)k[1]) << 16; a += ((uint32)k[2]) << 8; a += ((uint32)k[3]); b += ((uint32)k[4]) << 24; b += ((uint32)k[5]) << 16; b += ((uint32)k[6]) << 8; b += ((uint32)k[7]); c += ((uint32)k[8]) << 24; c += ((uint32)k[9]) << 16; c += ((uint32)k[10]) << 8; c += ((uint32)k[11]); mix(a, b, c); length -= 12; k += 12; } /*-------------------------------- last block: affect all 32 bits of (c) */ switch (length) /* all the case statements fall through */ { case 12: c += ((uint32)k[11]) << 24; case 11: c += ((uint32)k[10]) << 16; case 10: c += ((uint32)k[9]) << 8; case 9 : c += k[8]; case 8 : b += ((uint32)k[7]) << 24; case 7 : b += ((uint32)k[6]) << 16; case 6 : b += ((uint32)k[5]) << 8; case 5 : b += k[4]; case 4 : a += ((uint32)k[3]) << 24; case 3 : a += ((uint32)k[2]) << 16; case 2 : a += ((uint32)k[1]) << 8; case 1 : a += k[0]; break; case 0 : return c; } } final(a, b, c); return c; } #ifdef SELF_TEST /* used for timings */ void driver1(void) { uint8 buf[256]; uint32 i; uint32 h = 0; time_t a, z; time(&a); for (i = 0; i < 256; ++i) buf[i] = 'x'; for (i = 0; i < 1; ++i) { h = hashlittle(&buf[0], 1, h); } time(&z); if (z - a > 0) printf("time %ld %.8lx\n", z - a, h); } /* check that every input bit changes every output bit half the time */ #define HASHSTATE 1 #define HASHLEN 1 #define MAXPAIR 60 #define MAXLEN 70 void driver2(void) { uint8 qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1]; uint32 c[HASHSTATE], d[HASHSTATE], i, j = 0, k, l, m, z; uint32 e[HASHSTATE], f[HASHSTATE], g[HASHSTATE], h[HASHSTATE]; uint32 x[HASHSTATE], y[HASHSTATE]; uint32 hlen; printf("No more than %d trials should ever be needed \n", MAXPAIR / 2); for (hlen = 0; hlen < MAXLEN; ++hlen) { z = 0; for (i = 0; i < hlen; ++i) /*----------------------- for each input byte, */ { for (j = 0; j < 8; ++j) /*------------------------ for each input bit, */ { for (m = 1; m < 8; ++m) /*------------ for serveral possible initvals, */ { for (l = 0; l < HASHSTATE; ++l) e[l] = f[l] = g[l] = h[l] = x[l] = y[l] = ~((uint32)0); /*---- check that every output bit is affected by that input bit */ for (k = 0; k < MAXPAIR; k += 2) { uint32 finished = 1; /* keys have one bit different */ for (l = 0; l < hlen + 1; ++l) { a[l] = b[l] = (uint8)0; } /* have a and b be two keys differing in only one bit */ a[i] ^= (k << j); a[i] ^= (k >> (8 - j)); c[0] = hashlittle(a, hlen, m); b[i] ^= ((k + 1) << j); b[i] ^= ((k + 1) >> (8 - j)); d[0] = hashlittle(b, hlen, m); /* check every bit is 1, 0, set, and not set at least once */ for (l = 0; l < HASHSTATE; ++l) { e[l] &= (c[l] ^ d[l]); f[l] &= ~(c[l] ^ d[l]); g[l] &= c[l]; h[l] &= ~c[l]; x[l] &= d[l]; y[l] &= ~d[l]; if (e[l] | f[l] | g[l] | h[l] | x[l] | y[l]) finished = 0; } if (finished) break; } if (k > z) z = k; if (k == MAXPAIR) { printf("Some bit didn't change: "); printf("%.8lx %.8lx %.8lx %.8lx %.8lx %.8lx ", e[0], f[0], g[0], h[0], x[0], y[0]); printf("i %ld j %ld m %ld len %ld\n", i, j, m, hlen); } if (z == MAXPAIR) goto done; } } } done: if (z < MAXPAIR) { printf("Mix success %2ld bytes %2ld initvals ", i, m); printf("required %ld trials\n", z / 2); } } printf("\n"); } /* Check for reading beyond the end of the buffer and alignment problems */ void driver3(void) { uint8 buf[MAXLEN+20], *b; uint32 len; uint8 q[] = "This is the time for all good men to come to the aid of their country..."; uint32 dummy1; uint8 qq[] = "xThis is the time for all good men to come to the aid of their country..."; uint32 dummy2; uint8 qqq[] = "xxThis is the time for all good men to come to the aid of their country..."; uint32 dummy3; uint8 qqqq[] = "xxxThis is the time for all good men to come to the aid of their country..."; uint32 h, i, j, ref, x, y; uint8 *p; printf("Endianness. These lines should all be the same (for values filled in):\n"); printf("%.8lx %.8lx %.8lx\n", hashword((uint32 *)q, (sizeof(q) - 1) / 4, 13), hashword((uint32 *)q, (sizeof(q) - 5) / 4, 13), hashword((uint32 *)q, (sizeof(q) - 9) / 4, 13)); p = q; printf("%.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx\n", hashlittle(p, sizeof(q) - 1, 13), hashlittle(p, sizeof(q) - 2, 13), hashlittle(p, sizeof(q) - 3, 13), hashlittle(p, sizeof(q) - 4, 13), hashlittle(p, sizeof(q) - 5, 13), hashlittle(p, sizeof(q) - 6, 13), hashlittle(p, sizeof(q) - 7, 13), hashlittle(p, sizeof(q) - 8, 13), hashlittle(p, sizeof(q) - 9, 13), hashlittle(p, sizeof(q) - 10, 13), hashlittle(p, sizeof(q) - 11, 13), hashlittle(p, sizeof(q) - 12, 13)); p = &qq[1]; printf("%.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx\n", hashlittle(p, sizeof(q) - 1, 13), hashlittle(p, sizeof(q) - 2, 13), hashlittle(p, sizeof(q) - 3, 13), hashlittle(p, sizeof(q) - 4, 13), hashlittle(p, sizeof(q) - 5, 13), hashlittle(p, sizeof(q) - 6, 13), hashlittle(p, sizeof(q) - 7, 13), hashlittle(p, sizeof(q) - 8, 13), hashlittle(p, sizeof(q) - 9, 13), hashlittle(p, sizeof(q) - 10, 13), hashlittle(p, sizeof(q) - 11, 13), hashlittle(p, sizeof(q) - 12, 13)); p = &qqq[2]; printf("%.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx\n", hashlittle(p, sizeof(q) - 1, 13), hashlittle(p, sizeof(q) - 2, 13), hashlittle(p, sizeof(q) - 3, 13), hashlittle(p, sizeof(q) - 4, 13), hashlittle(p, sizeof(q) - 5, 13), hashlittle(p, sizeof(q) - 6, 13), hashlittle(p, sizeof(q) - 7, 13), hashlittle(p, sizeof(q) - 8, 13), hashlittle(p, sizeof(q) - 9, 13), hashlittle(p, sizeof(q) - 10, 13), hashlittle(p, sizeof(q) - 11, 13), hashlittle(p, sizeof(q) - 12, 13)); p = &qqqq[3]; printf("%.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx %.8lx\n", hashlittle(p, sizeof(q) - 1, 13), hashlittle(p, sizeof(q) - 2, 13), hashlittle(p, sizeof(q) - 3, 13), hashlittle(p, sizeof(q) - 4, 13), hashlittle(p, sizeof(q) - 5, 13), hashlittle(p, sizeof(q) - 6, 13), hashlittle(p, sizeof(q) - 7, 13), hashlittle(p, sizeof(q) - 8, 13), hashlittle(p, sizeof(q) - 9, 13), hashlittle(p, sizeof(q) - 10, 13), hashlittle(p, sizeof(q) - 11, 13), hashlittle(p, sizeof(q) - 12, 13)); printf("\n"); for (h = 0, b = buf + 1; h < 8; ++h, ++b) { for (i = 0; i < MAXLEN; ++i) { len = i; for (j = 0; j < i; ++j) *(b + j) = 0; /* these should all be equal */ ref = hashlittle(b, len, (uint32)1); *(b + i) = (uint8)~0; *(b - 1) = (uint8)~0; x = hashlittle(b, len, (uint32)1); y = hashlittle(b, len, (uint32)1); if ((ref != x) || (ref != y)) { printf("alignment error: %.8lx %.8lx %.8lx %ld %ld\n", ref, x, y, h, i); } } } } /* check for problems with nulls */ void driver4(void) { uint8 buf[1]; uint32 h, i, state[HASHSTATE]; buf[0] = ~0; for (i = 0; i < HASHSTATE; ++i) state[i] = 1; printf("These should all be different\n"); for (i = 0, h = 0; i < 8; ++i) { h = hashlittle(buf, (uint32)0, h); printf("%2ld 0-byte strings, hash is %.8lx\n", i, h); } } int main(void) { driver1(); /* test that the key is hashed: used for timings */ driver2(); /* test that whole key is hashed thoroughly */ driver3(); /* test that nothing but the key is hashed */ driver4(); /* test hashing multiple buffers (all buffers are null) */ return 1; } #endif /* SELF_TEST */ torque-2.4.16/src/drmaa/src/compat.c0000664000113300011330000000475111272401236014132 00000000000000/* $Id: compat.c,v 1.1 2006/08/29 10:24:38 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: compat.c,v 1.1 2006/08/29 10:24:38 ciesnik Exp $"; #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *dest, const char *src, size_t size) { size_t result = 0; if (size == 0) return 0; while (*src && --size > 0) { *dest++ = *src++; result++; } *dest++ = '\0'; return result; } #endif /* ! HAVE_STRLCPY */ #ifndef HAVE_ASPRINTF int asprintf(char **strp, const char *fmt, ...) { va_list args; int result; va_start(args, fmt); result = vasprintf(strp, fmt, args); va_end(args); return result; } #endif /* ! HAVE_ASPRINTF */ #ifndef HAVE_VASPRINTF int vasprintf(char **strp, const char *fmt, va_list ap) { size_t size; char *buf; buf = (char*)malloc(size = 128); if (buf == NULL) return -1; while (1) { int len; char *oldbuf; # if defined(HAVE_VA_COPY) || defined(HAVE___VA_COPY) va_list args; va_copy(args, ap); len = sprintfv(fmt, args); # else /* ! HAVE_VA_COPY */ len = sprintfv(fmt, ap); # endif if (len < size) { buf = realloc(buf, len + 1); *strp = buf; return len; } if (len == -1) size *= 2; else size = len + 1; buf = realloc(oldbuf = buf, size *= 2); if (buf == NULL) { free(oldbuf); return -1; } } } #endif /* ! HAVE_VASPRINTF */ torque-2.4.16/src/drmaa/src/pbs_attrib.c0000664000113300011330000003422311272401236014775 00000000000000/* ANSI-C code produced by gperf version 3.0.1 */ /* Command-line: gperf --language=ANSI-C --struct-type --readonly-tables --includes --pic --hash-function-name=pbs_attrib_hash --lookup-function-name=pbs_attrib_lookup pbs_attrib.gperf */ /* Computed positions: -k'1,3' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ #error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #line 1 "pbs_attrib.gperf" /* $Id: pbs_attrib.gperf,v 1.4 2006/06/05 23:27:18 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: pbs_attrib.gperf,v 1.4 2006/06/05 23:27:18 ciesnik Exp $"; #endif #line 36 "pbs_attrib.gperf" struct pbs_attrib { const char *name; int code; }; #include #define TOTAL_KEYWORDS 47 #define MIN_WORD_LENGTH 5 #define MAX_WORD_LENGTH 15 #define MIN_HASH_VALUE 6 #define MAX_HASH_VALUE 75 /* maximum key range = 70, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int pbs_attrib_hash(register const char *str, register unsigned int len) { static const unsigned char asso_values[] = { 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 0, 76, 51, 76, 45, 76, 76, 35, 76, 15, 60, 76, 25, 76, 30, 15, 76, 20, 50, 76, 40, 15, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 5, 0, 35, 25, 0, 76, 40, 30, 10, 5, 76, 30, 0, 76, 10, 0, 20, 0, 5, 15, 76, 76, 76, 5, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76 }; return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]]; } struct stringpool_t { char stringpool_str6[sizeof("egroup")]; char stringpool_str9[sizeof("exec_host")]; char stringpool_str10[sizeof("euser")]; char stringpool_str11[sizeof("server")]; char stringpool_str13[sizeof("substate")]; char stringpool_str14[sizeof("job_state")]; char stringpool_str15[sizeof("etime")]; char stringpool_str16[sizeof("max_running")]; char stringpool_str17[sizeof("stagein")]; char stringpool_str18[sizeof("stageout")]; char stringpool_str19[sizeof("resources_used")]; char stringpool_str20[sizeof("session_id")]; char stringpool_str21[sizeof("exit_status")]; char stringpool_str23[sizeof("Job_Name")]; char stringpool_str24[sizeof("Job_Owner")]; char stringpool_str25[sizeof("queue")]; char stringpool_str26[sizeof("alt_id")]; char stringpool_str28[sizeof("Variable_List")]; char stringpool_str29[sizeof("Rerunable")]; char stringpool_str30[sizeof("queue_rank")]; char stringpool_str31[sizeof("depend")]; char stringpool_str33[sizeof("Priority")]; char stringpool_str34[sizeof("Join_Path")]; char stringpool_str35[sizeof("qtime")]; char stringpool_str36[sizeof("interactive")]; char stringpool_str38[sizeof("Resource_List")]; char stringpool_str39[sizeof("hop_count")]; char stringpool_str40[sizeof("total_jobs")]; char stringpool_str41[sizeof("destination")]; char stringpool_str42[sizeof("comment")]; char stringpool_str43[sizeof("hashname")]; char stringpool_str44[sizeof("Mail_User")]; char stringpool_str45[sizeof("sched_hint")]; char stringpool_str46[sizeof("Mail_Points")]; char stringpool_str47[sizeof("Account_Name")]; char stringpool_str48[sizeof("security")]; char stringpool_str49[sizeof("User_List")]; char stringpool_str50[sizeof("ctime")]; char stringpool_str51[sizeof("cookie")]; char stringpool_str55[sizeof("Error_Path")]; char stringpool_str56[sizeof("Output_Path")]; char stringpool_str59[sizeof("Execution_Time")]; char stringpool_str60[sizeof("group_list")]; char stringpool_str61[sizeof("Checkpoint")]; char stringpool_str65[sizeof("Shell_Path_List")]; char stringpool_str70[sizeof("Keep_Files")]; char stringpool_str75[sizeof("Hold_Types")]; }; static const struct stringpool_t stringpool_contents = { "egroup", "exec_host", "euser", "server", "substate", "job_state", "etime", "max_running", "stagein", "stageout", "resources_used", "session_id", "exit_status", "Job_Name", "Job_Owner", "queue", "alt_id", "Variable_List", "Rerunable", "queue_rank", "depend", "Priority", "Join_Path", "qtime", "interactive", "Resource_List", "hop_count", "total_jobs", "destination", "comment", "hashname", "Mail_User", "sched_hint", "Mail_Points", "Account_Name", "security", "User_List", "ctime", "cookie", "Error_Path", "Output_Path", "Execution_Time", "group_list", "Checkpoint", "Shell_Path_List", "Keep_Files", "Hold_Types" }; #define stringpool ((const char *) &stringpool_contents) #ifdef __GNUC__ __inline #endif const struct pbs_attrib * pbs_attrib_lookup(register const char *str, register unsigned int len) { static const struct pbs_attrib wordlist[] = { { -1 }, { -1}, { -1}, { -1}, { -1}, { -1}, #line 72 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, ATTR_EGROUP}, { -1}, { -1}, #line 79 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, ATTR_EXECUTION_HOST}, #line 71 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, ATTR_EUSER}, #line 76 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, ATTR_SERVER}, { -1}, #line 69 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, ATTR_JOB_SUBMIT_STATE}, #line 63 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, ATTR_JOB_STATE}, #line 65 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, ATTR_ETIME}, #line 81 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, ATTR_MAX_RUNNING}, #line 46 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, ATTR_STAGEIN}, #line 47 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, ATTR_STAGEOUT}, #line 67 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, ATTR_RESOURCES_USED}, #line 85 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, ATTR_SESSION_ID}, #line 68 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, ATTR_EXIT_STATUS}, { -1}, #line 39 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, ATTR_JOB_NAME}, #line 70 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, ATTR_JOB_OWNER}, #line 77 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, ATTR_QUEUE}, #line 86 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, ATTR_ALT_ID}, { -1}, #line 40 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, ATTR_ENV}, #line 56 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, ATTR_RERUNABLE}, #line 78 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, ATTR_QUEUE_RANK}, #line 60 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, ATTR_DEPENDENCIES}, { -1}, #line 54 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, ATTR_PRIORITY}, #line 43 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, ATTR_JOIN_FILES}, #line 66 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, ATTR_QTIME}, #line 61 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, ATTR_INTERACTIVE}, { -1}, #line 53 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, ATTR_RESOURCES}, #line 73 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, ATTR_HOP_COUNT}, #line 80 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, ATTR_TOTAL_JOBS}, #line 55 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, ATTR_DESTINATION_QUEUE}, #line 82 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, ATTR_COMMENT}, #line 84 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, ATTR_HASHNAME}, #line 44 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, ATTR_EMAIL}, #line 75 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str45, ATTR_SCHEDULER_HINT}, #line 45 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, ATTR_MAIL_POINTS}, #line 58 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, ATTR_REMOTE_USER}, #line 74 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str48, ATTR_SECURITY}, #line 57 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str49, ATTR_USER_LIST}, #line 64 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str50, ATTR_CTIME}, #line 83 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str51, ATTR_JOB_COOKIE}, { -1}, { -1}, { -1}, #line 42 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str55, ATTR_ERROR_PATH}, #line 41 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str56, ATTR_OUTPUT_PATH}, { -1}, { -1}, #line 49 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str59, ATTR_SOFT_CPU_TIME_LIMIT}, #line 51 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str60, ATTR_GROUP_LIST}, #line 50 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str61, ATTR_CHECKPOINT}, { -1}, { -1}, { -1}, #line 59 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str65, ATTR_SHELL}, { -1}, { -1}, { -1}, { -1}, #line 48 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str70, ATTR_KEEP_FILES}, { -1}, { -1}, { -1}, { -1}, #line 52 "pbs_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str75, ATTR_HOLD_TYPES} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = pbs_attrib_hash(str, len); if (key <= MAX_HASH_VALUE && key >= 0) { register int o = wordlist[key].name; if (o >= 0) { register const char *s = o + stringpool; if (*str == *s && !strcmp(str + 1, s + 1)) return &wordlist[key]; } } } return 0; } torque-2.4.16/src/drmaa/src/submit.c0000664000113300011330000005006511272401236014151 00000000000000/* $Id: submit.c,v 1.16 2006/09/05 07:07:04 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: submit.c,v 1.16 2006/09/05 07:07:04 ciesnik Exp $"; #endif int drmaa_run_job( char *job_id, size_t job_id_len, const drmaa_job_template_t *jt, char *errmsg, size_t errlen ) { DEBUG(("-> drmaa_run_job")); return drmaa_run_job_impl(job_id, job_id_len, jt, -1, errmsg, errlen); } int drmaa_run_bulk_jobs( drmaa_job_ids_t **job_ids, const drmaa_job_template_t *jt, int start, int end, int incr, char *errmsg, size_t errlen ) { unsigned n_jobs; unsigned i; char **j; int rc = DRMAA_ERRNO_SUCCESS; DEBUG(("-> drmaa_run_bulk_jobs(start=%d,end=%d,incr=%d)", start, end, incr)); /* Be conform with general DRMAA specifiaction * -- accept negative incr with end <= start. */ if (incr < 0) { /* swap(start,end) */ int tmp; tmp = start; start = end; end = tmp; incr = - incr; } if (0 < start && start <= end && 0 < incr) {} else return DRMAA_ERRNO_INVALID_ARGUMENT; n_jobs = (end - start) / incr + 1; *job_ids = (drmaa_job_ids_t*)malloc(sizeof(drmaa_job_ids_t)); if (*job_ids == NULL) RAISE_NO_MEMORY(); (*job_ids)->list = (*job_ids)->iter = (char**) calloc(n_jobs + 1, sizeof(char*)); if ((*job_ids)->list == NULL) { free(*job_ids); RAISE_NO_MEMORY(); } j = (*job_ids)->list; for (i = start; i <= (unsigned)end; i += incr) { char *job_id = (char*)malloc(DRMAA_JOBNAME_BUFFER); if (job_id == NULL) { drmaa_release_job_ids(*job_ids); RAISE_NO_MEMORY(); } rc = drmaa_run_job_impl(job_id, DRMAA_JOBNAME_BUFFER, jt, i, errmsg, errlen); *j++ = job_id; if (rc) { drmaa_release_job_ids(*job_ids); return rc; } } *j++ = NULL; DEBUG(("<- drmaa_run_bulk_jobs() =%d, job_ids=%p", rc, (void*)*job_ids)); return DRMAA_ERRNO_SUCCESS; } /** * Submits job. In addtion do drmaa_run_job() it has @a bulk_no which * should be -1 for submiting single job or bulk job index for bulk jobs. * @see drmaa_run_job * @see drmaa_run_bulk_jobs */ int drmaa_run_job_impl( char *job_id, size_t job_id_len, const drmaa_job_template_t *jt, int bulk_no, char *errmsg, size_t errlen ) { drmaa_session_t *c = NULL; drmaa_submission_context_t *sc = NULL; char *pbs_job_id; drmaa_job_t *job = NULL; int rc = DRMAA_ERRNO_SUCCESS; rc = drmaa_create_submission_context(&sc, jt, bulk_no, errmsg, errlen); if (rc) return rc; pthread_mutex_lock((pthread_mutex_t*)&jt->mutex); if (rc == DRMAA_ERRNO_SUCCESS) rc = drmaa_set_job_std_attribs(sc, errmsg, errlen); if (rc == DRMAA_ERRNO_SUCCESS) rc = drmaa_create_job_script(sc, errmsg, errlen); if (rc == DRMAA_ERRNO_SUCCESS) rc = drmaa_set_job_submit_state(sc, errmsg, errlen); if (rc == DRMAA_ERRNO_SUCCESS) rc = drmaa_set_job_environment(sc, errmsg, errlen); if (rc == DRMAA_ERRNO_SUCCESS) rc = drmaa_set_job_files(sc, errmsg, errlen); if (rc == DRMAA_ERRNO_SUCCESS) rc = drmaa_set_file_staging(sc, errmsg, errlen); if (rc == DRMAA_ERRNO_SUCCESS) rc = drmaa_set_job_email_notication(sc, errmsg, errlen); if (rc == DRMAA_ERRNO_SUCCESS) job = (drmaa_job_t*)malloc(sizeof(drmaa_job_t)); pthread_mutex_unlock((pthread_mutex_t*)&jt->mutex); if (rc == DRMAA_ERRNO_SUCCESS && job == NULL) { STORE_ERRNO_MSG(); rc = DRMAA_ERRNO_NO_MEMORY; } /* check for error */ if (rc != DRMAA_ERRNO_SUCCESS) { drmaa_free_submission_context(sc); return rc; } #if DRMAA_DEBUG { struct attropl *i; for (i = sc->pbs_attribs; i != NULL; i = i->next) DEBUG(("job attr: %s=%s", i->name, i->value)); } #endif c = jt->session; pthread_mutex_lock(&c->conn_mutex); pbs_job_id = pbs_submit(c->pbs_conn, sc->pbs_attribs, sc->script_filename, "", NULL); pthread_mutex_unlock(&c->conn_mutex); drmaa_free_submission_context(sc); if (pbs_job_id == NULL) RAISE_PBS(); strlcpy(job_id, pbs_job_id, job_id_len); DEBUG(("job_id=%s", pbs_job_id)); job->jobid = pbs_job_id; job->terminated = false; job->suspended = false; drmaa_add_job(c, job); return DRMAA_ERRNO_SUCCESS; } int drmaa_create_submission_context( drmaa_submission_context_t **c, const drmaa_job_template_t *jt, int bulk_no, char *errmsg, size_t errlen) { drmaa_submission_context_t *sc; sc = (drmaa_submission_context_t*)malloc(sizeof(drmaa_submission_context_t)); if (sc == NULL) RAISE_NO_MEMORY(); sc->jt = jt; sc->pbs_attribs = NULL; sc->script_filename = NULL; sc->home_directory = strdup(getenv("HOME")); if (jt->attrib[ATTR_JOB_WORKING_DIR] != NULL) sc->working_directory = strdup(jt->attrib[ATTR_JOB_WORKING_DIR]); else sc->working_directory = strdup(sc->home_directory); asprintf(&sc->bulk_incr_no, "%d", bulk_no); *c = sc; return DRMAA_ERRNO_SUCCESS; } void drmaa_free_submission_context(drmaa_submission_context_t *c) { if (c->script_filename != NULL) { unlink(c->script_filename); free(c->script_filename); } free(c->working_directory); free(c->home_directory); free(c->bulk_incr_no); drmaa_free_attropl(c->pbs_attribs); free(c); } struct drmaa_def_attr_s { int attr; const char *value; }; int drmaa_set_job_std_attribs( drmaa_submission_context_t *c, char *errmsg, size_t errlen ) { static const struct drmaa_def_attr_s tab[] = { { ATTR_CHECKPOINT, "u" }, { ATTR_KEEP_FILES, "n" }, { ATTR_PRIORITY, "0" }, { ATTR_RERUNABLE, "y" }, { ATTR_SHELL, "/bin/sh" }, { -1, NULL } }; const struct drmaa_def_attr_s *i; void **attrib = c->jt->attrib; const char *job_name; int rc; job_name = attrib[ATTR_JOB_NAME]; if (job_name != NULL) { rc = drmaa_add_pbs_attr(c, ATTR_JOB_NAME, strdup(attrib[ATTR_JOB_NAME]), DRMAA_PLACEHOLDER_MASK_INCR, errmsg, errlen); if (rc) return rc; } for (i = tab; i->attr != -1; i++) { rc = drmaa_add_pbs_attr(c, i->attr, strdup(i->value), 0, errmsg, errlen); if (rc) return rc; } return DRMAA_ERRNO_SUCCESS; } /** Writes job's PBS script to temporary file. */ int drmaa_create_job_script( drmaa_submission_context_t *c, char *errmsg, size_t errlen ) { size_t script_size; const char *job, *wd, **argv; char *input_path; char *script, *s; const char **i; int rc; void **attrib = c->jt->attrib; job = (const char*) attrib[ ATTR_JOB_PATH ]; wd = (const char*) attrib[ ATTR_JOB_WORKING_DIR ]; argv = (const char**)attrib[ ATTR_ARGV ]; input_path = attrib[ ATTR_INPUT_PATH ]; if (job == NULL) RAISE_DRMAA(DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE); /* compute script length */ script_size = 0; if (wd != NULL) script_size += strlen("cd ") + strlen(wd) + strlen("; "); script_size += strlen("exec ") + strlen(job); if (argv != NULL) for (i = argv; *i != NULL; i++) script_size += 1 + strlen(*i); if (input_path != NULL) script_size += sizeof(" <") + strlen(input_path); script = (char*)malloc(script_size + 1); if (script == NULL) RAISE_NO_MEMORY(); s = script; if (wd != NULL) s += sprintf(s, "cd %s; ", wd); s += sprintf(s, "exec %s", job); if (argv != NULL) for (i = argv; *i != NULL; i++) s += sprintf(s, " %s", *i); if (input_path != NULL) { char *colon = strchr(input_path, ':'); if (colon != NULL) input_path = colon + 1; s += sprintf(s, " <%s", input_path); } DEBUG(("script before substitution = {%s}", script)); script = drmaa_expand_placeholders(c, script, DRMAA_PLACEHOLDER_MASK_HD | DRMAA_PLACEHOLDER_MASK_WD | DRMAA_PLACEHOLDER_MASK_INCR); DEBUG(("script after substitution = {%s}", script)); rc = drmaa_write_tmpfile(&c->script_filename, script, strlen(script), errmsg, errlen); free(script); return rc; } /** * Set files where job's standard input/output/error * streams will be redirected. */ int drmaa_set_job_files( drmaa_submission_context_t *c, char *errmsg, size_t errlen ) { void **attrib = c->jt->attrib; const char *join_files = attrib[ATTR_JOIN_FILES]; bool b_join_files; int i; int rc; for (i = 0; i < 2; i++) { int attr = i ? ATTR_OUTPUT_PATH : ATTR_ERROR_PATH; char *path = (char*)attrib[attr]; if (path != NULL) { char *colon; colon = strchr(path, ':'); if (colon != NULL) path = colon + 1; rc = drmaa_add_pbs_attr(c, attr, strdup(path), DRMAA_PLACEHOLDER_MASK_HD | DRMAA_PLACEHOLDER_MASK_WD | DRMAA_PLACEHOLDER_MASK_INCR, errmsg, errlen ); if (rc) return rc; } } b_join_files = join_files != NULL && !strcmp(join_files, "1"); rc = drmaa_add_pbs_attr(c, ATTR_JOIN_FILES, strdup(b_join_files ? "y" : "n"), 0, errmsg, errlen); if (rc) return rc; return DRMAA_ERRNO_SUCCESS; } /** Sets job environment variables. */ int drmaa_set_job_environment( drmaa_submission_context_t *c, char *errmsg, size_t errlen ) { void **attrib = c->jt->attrib; size_t s; char *env; int rc; env = strdup(""); s = strlen(env); if (attrib[ATTR_ENV] != NULL) { char *value = drmaa_explode(attrib[ATTR_ENV], ','); if (value == NULL) { free(env); RAISE_NO_MEMORY(); } env = realloc(env, s + strlen(value) + 1); strcpy(env + s, value); free(value); } else env[s-1] = 0; rc = drmaa_add_pbs_attr(c, ATTR_ENV, env, DRMAA_PLACEHOLDER_MASK_INCR, errmsg, errlen); if (rc) return rc; return DRMAA_ERRNO_SUCCESS; } /** * Set e-mail notification about job state. */ int drmaa_set_job_email_notication( drmaa_submission_context_t *c, char *errmsg, size_t errlen ) { void **attrib = c->jt->attrib; const char *block_email = (const char*)attrib[ATTR_BLOCK_EMAIL]; int rc; if (block_email != NULL && !strcmp(block_email, "1")) { rc = drmaa_add_pbs_attr(c, ATTR_MAIL_POINTS, strdup(""), 0, errmsg, errlen); if (rc) return rc; } else { const char **mail_list = (const char**)attrib[ATTR_EMAIL]; char *pbs_mail_list = NULL; if (mail_list != NULL) { pbs_mail_list = drmaa_explode(mail_list, ','); if (pbs_mail_list == NULL) RAISE_NO_MEMORY(); rc = drmaa_add_pbs_attr(c, ATTR_EMAIL, pbs_mail_list, 0, errmsg, errlen); if (rc) { free(pbs_mail_list); return rc; } /* a mail is sent when the job is aborted by the batch system. b mail is sent when the job begins execution. e mail is sent when the job terminates. */ rc = drmaa_add_pbs_attr(c, ATTR_MAIL_POINTS, strdup("ae"), 0, errmsg, errlen); if (rc) return rc; } } return DRMAA_ERRNO_SUCCESS; } int drmaa_set_job_submit_state( drmaa_submission_context_t *c, char *errmsg, size_t errlen ) { const char *submit_state = c->jt->attrib[ATTR_JOB_SUBMIT_STATE]; const char *hold_types; int rc = DRMAA_ERRNO_SUCCESS; if (submit_state == NULL || !strcmp(submit_state, DRMAA_SUBMISSION_STATE_ACTIVE)) hold_types = "n"; else if (!strcmp(submit_state, DRMAA_SUBMISSION_STATE_HOLD)) hold_types = "u"; else RAISE_DRMAA(DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE); rc = drmaa_add_pbs_attr(c, ATTR_HOLD_TYPES, strdup(hold_types), 0, errmsg, errlen); return rc; } #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 255 #endif char * drmaa_translate_staging(const char *stage) { char hostname[ HOST_NAME_MAX+1 ]; const char *host = NULL, *filename = NULL; size_t hostlen = 0; char *result, *p; p = strchr(stage, ':'); if (p == NULL) { host = NULL; filename = stage; } else { if (p == stage) host = NULL; else { host = stage; hostlen = p - stage; } filename = p + 1; } if (host == NULL) { gethostname(hostname, sizeof(hostname)); host = hostname; hostlen = strlen(hostname); } asprintf(&result, "%s@%.*s:%s", filename, hostlen, host, filename); return result; } int drmaa_set_file_staging( drmaa_submission_context_t *c, char *errmsg, size_t errlen ) { void **attrib = c->jt->attrib; char *transfer_files = (char*)attrib[ ATTR_TRANSFER_FILES ]; char *input_file = NULL; char *output_file = NULL; char *error_file = NULL; char *output_staging = NULL; char *error_staging = NULL; char *stageout = NULL; int rc = DRMAA_ERRNO_SUCCESS; if (transfer_files) { char *i; for (i = transfer_files; *i; i++) switch (*i) { case 'i': input_file = (char*)attrib[ ATTR_INPUT_PATH ]; break; case 'o': output_file = (char*)attrib[ ATTR_OUTPUT_PATH ]; break; case 'e': error_file = (char*)attrib[ ATTR_ERROR_PATH ]; break; default: RAISE_DRMAA(DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE); } } else return DRMAA_ERRNO_SUCCESS; if (input_file) { rc = drmaa_add_pbs_attr(c, ATTR_STAGEIN, drmaa_translate_staging(input_file), DRMAA_PLACEHOLDER_MASK_HD | DRMAA_PLACEHOLDER_MASK_WD | DRMAA_PLACEHOLDER_MASK_INCR, errmsg, errlen); if (rc) return rc; } if (output_file) output_staging = drmaa_translate_staging(output_file); if (error_file) error_staging = drmaa_translate_staging(error_file); if (output_staging && error_staging) asprintf(&stageout, "%s,%s", output_staging, error_staging); else if (output_staging) stageout = output_staging; else if (error_staging) stageout = error_staging; rc = drmaa_add_pbs_attr(c, ATTR_STAGEOUT, stageout, DRMAA_PLACEHOLDER_MASK_HD | DRMAA_PLACEHOLDER_MASK_WD | DRMAA_PLACEHOLDER_MASK_INCR, errmsg, errlen); if (output_staging && output_staging != stageout) free(output_staging); if (error_staging && error_staging != stageout) free(error_staging); return rc; } /** * Adds jobs PBS attributes list. * @param attr_code Attribute code (@ref drmaa_attribute_t). * @param value Attribute value -- null terminated string allocated with * malloc(); callee is responsible for freeing it. * @param placeholders Placeholders to substitute inside value. * It have following bits: * - @ref DRMAA_PLACEHOLDER_MASK_HD -- replaces @ref DRMAA_PLACEHOLDER_HD with * user's home direcotry, * - @ref DRMAA_PLACEHOLDER_MASK_WD -- replaces @ref DRMAA_PLACEHOLDER_WD with * job's working direcotry, * - @ref DRMAA_PLACEHOLDER_MASK_INCR -- replaces @ref DRMAA_PLACEHOLDER_INCR * with bulk job index. */ int drmaa_add_pbs_attr( drmaa_submission_context_t *c, int attr_code, char *value, unsigned placeholders, char *errmsg, size_t errlen ) { struct attropl *attr = NULL; value = drmaa_expand_placeholders(c, value, placeholders); if (value == NULL) goto cleanup; attr = (struct attropl*)malloc(sizeof(*attr)); if (attr == NULL) goto cleanup; attr->next = c->pbs_attribs; attr->name = strdup(drmaa_attr_table[attr_code].pbs_name); if (attr->name == NULL) goto cleanup; attr->value = value; attr->resource = NULL; attr->op = SET; c->pbs_attribs = attr; return DRMAA_ERRNO_SUCCESS; cleanup: if (value != NULL) free(value); if (attr != NULL) free(attr); RAISE_NO_MEMORY(); } /** * Writes temporary file. * @param filename Upon successful return temporary * file name will be stored here. * @param content Buffer with content to write. * @param len Buffer's length. * @return DRMAA return code. */ int drmaa_write_tmpfile( char **filename, const char *content, size_t len, char *errmsg, size_t errlen ) { char *name; int fd; #define TMPFILE_TEMPLATE "/tmp/pbs_drmaa.XXXXXX" DEBUG(("-> drmaa_write_tmpfile(content=\"%.*s\")", len, content)); name = strdup(TMPFILE_TEMPLATE); if (name == NULL) RAISE_NO_MEMORY(); fd = mkstemp(name); if (fd < 0) RAISE_ERRNO(DRMAA_ERRNO_INTERNAL_ERROR); while (len > 0) { size_t written = write(fd, content, len); if (written != (size_t) - 1) { content += written; len -= written; } else { free(name); close(fd); RAISE_ERRNO(DRMAA_ERRNO_INTERNAL_ERROR); } } if (close(fd)) { free(name); RAISE_ERRNO(DRMAA_ERRNO_INTERNAL_ERROR); } DEBUG(("<- drmaa_write_tmpfile; filename=%s", name)); *filename = name; return DRMAA_ERRNO_SUCCESS; } char * drmaa_explode(const char **vector, char glue) { char *result, *s; const char **i; size_t size = 0; for (i = vector; *i != NULL; i++) { if (i != vector) size++; size += strlen(*i); } result = (char*)malloc(size + 1); if (result == NULL) return NULL; s = result; for (i = vector; *i != NULL; i++) { if (i != vector) *s++ = glue; strcpy(s, *i); s += strlen(*i); } return result; } void drmaa_free_attropl(struct attropl *attr) { while (attr != NULL) { struct attropl *p = attr; attr = attr->next; free(p->name); free(p->value); free(p->resource); free(p); } } char * drmaa_expand_placeholders( drmaa_submission_context_t *c, char *s, unsigned set) { unsigned mask; for (mask = 1; ; mask *= 2) { const char *ph; const char *value; char *r; switch (mask) { case DRMAA_PLACEHOLDER_MASK_HD: ph = DRMAA_PLACEHOLDER_HD; value = c->home_directory; break; case DRMAA_PLACEHOLDER_MASK_WD: ph = DRMAA_PLACEHOLDER_WD; value = c->working_directory; break; case DRMAA_PLACEHOLDER_MASK_INCR: ph = DRMAA_PLACEHOLDER_INCR; value = c->bulk_incr_no; break; default: return s; } if (mask & set) { r = drmaa_replace(s, ph, value); if (r != NULL) s = r; else { free(s); return NULL; } } } } #if 0 char * drmaa_quote_shell_command(char *word) { unsigned char *i; char *quoted = NULL; for (i = (unsigned char*)word; *i; i++) if (!isalnum(*i)) switch (*i) { case '/': case '.': case '_': case '-': break; default: { if (quoted) } } } #endif torque-2.4.16/src/drmaa/src/attrib.c0000664000113300011330000002043711272401236014133 00000000000000/* $Id: attrib.c,v 1.5 2006/09/07 15:23:14 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: attrib.c,v 1.5 2006/09/07 15:23:14 ciesnik Exp $"; #endif struct drmaa_attrib { const char *name; int code; }; extern const struct drmaa_attrib * drmaa_attrib_lookup(const char *str, unsigned int len); struct pbs_attrib { const char *name; int code; }; extern const struct pbs_attrib * pbs_attrib_lookup(const char *str, unsigned int len); const drmaa_attrib_info_t * attr_by_drmaa_name(const char *drmaa_name) { const struct drmaa_attrib *attr = drmaa_attrib_lookup(drmaa_name, strlen(drmaa_name)); if (attr == NULL) return NULL; else return & drmaa_attr_table[ attr->code ]; } const drmaa_attrib_info_t * attr_by_pbs_name(const char *pbs_name) { const struct pbs_attrib *attr = pbs_attrib_lookup(pbs_name, strlen(pbs_name)); if (attr == NULL) return NULL; return & drmaa_attr_table[ attr->code ]; } #define OK ATTR_F_IMPL #define no 0 const drmaa_attrib_info_t drmaa_attr_table[] = { /* DRMAA 1.0 attributes: */ { ATTR_JOB_NAME, "drmaa_job_name" , "Job_Name" , OK | ATTR_F_STR }, { ATTR_JOB_PATH, "drmaa_remote_command" , NULL , OK | ATTR_F_PATH }, { ATTR_ARGV, "drmaa_v_argv" , NULL , OK | ATTR_F_VECTOR | ATTR_F_STR }, { ATTR_ENV, "drmaa_v_env" , "Variable_List" , OK | ATTR_F_VECTOR | ATTR_F_STR }, { ATTR_INPUT_PATH, "drmaa_input_path" , NULL , OK | ATTR_F_PATH }, { ATTR_OUTPUT_PATH, "drmaa_output_path" , "Output_Path" , OK | ATTR_F_PATH }, { ATTR_ERROR_PATH, "drmaa_error_path" , "Error_Path" , OK | ATTR_F_PATH }, { ATTR_JOIN_FILES, "drmaa_join_files" , "Join_Path" , OK | ATTR_F_BOOL }, { ATTR_TRANSFER_FILES, "drmaa_transfer_files" , NULL , OK | ATTR_F_BOOL }, { ATTR_JOB_WORKING_DIR, "drmaa_wd" , NULL , OK | ATTR_F_PATH }, { ATTR_EMAIL, "drmaa_v_email" , "Mail_Users" , OK | ATTR_F_VECTOR | ATTR_F_STR }, { ATTR_BLOCK_EMAIL, "drmaa_block_email" , NULL , OK | ATTR_F_BOOL }, { ATTR_START_TIME, "drmaa_start_time" , NULL , no | ATTR_F_TIME }, { ATTR_JOB_SUBMIT_STATE, "drmaa_js_state" , "substate" , OK | ATTR_F_STR }, { ATTR_HARD_CPU_TIME_LIMIT, "drmaa_duration_hlimit" , NULL , no | ATTR_F_TIMED }, { ATTR_SOFT_CPU_TIME_LIMIT, "drmaa_duration_slimit" , NULL , no | ATTR_F_TIMED }, { ATTR_HARD_WCT_LIMIT, "drmaa_wct_hlimit" , NULL , no | ATTR_F_TIMED }, { ATTR_SOFT_WCT_LIMIT, "drmaa_wct_slimit" , NULL , no | ATTR_F_TIMED }, { ATTR_DEADLINE_TIME, "drmaa_deadline_time" , NULL , no | ATTR_F_TIME }, { ATTR_JOB_CATEGORY, "drmaa_job_category" , NULL , no | ATTR_F_STR }, { ATTR_NATIVE, "drmaa_native_specification" , NULL , no | ATTR_F_STR }, /* Additional Torque/OpenPBS attribs (not in DRMAA specification): */ /* Used by OpenPBS user commands: */ { ATTR_CHECKPOINT, NULL, "Checkpoint" , ATTR_F_STR }, { ATTR_GROUP_LIST, NULL, "group_list" , ATTR_F_VECTOR }, { ATTR_HOLD_TYPES, NULL, "Hold_Types" , ATTR_F_STR }, { ATTR_KEEP_FILES, NULL, "Keep_Files" , ATTR_F_BOOL }, { ATTR_RESOURCES, NULL, "Resource_List" , ATTR_F_VECTOR | ATTR_F_STR }, { ATTR_MAIL_POINTS, NULL, "Mail_Points" , ATTR_F_STR }, { ATTR_PRIORITY, NULL, "Priority" , ATTR_F_INT }, { ATTR_DESTINATION_QUEUE, NULL, "destination" , ATTR_F_STR }, { ATTR_RERUNABLE, NULL, "Rerunable" , ATTR_F_BOOL }, { ATTR_USER_LIST, NULL, "User_List" , ATTR_F_VECTOR | ATTR_F_STR }, { ATTR_REMOTE_USER, NULL, "Account_Name" , ATTR_F_STR }, { ATTR_SHELL, NULL, "Shell_Path_List" , ATTR_F_VECTOR | ATTR_F_STR | ATTR_F_PATH }, { ATTR_DEPENDENCIES, NULL, "depend" , ATTR_F_VECTOR | ATTR_F_STR }, { ATTR_INTERACTIVE, NULL, "interactive" , ATTR_F_BOOL }, { ATTR_STAGEIN, NULL, "stagein" , ATTR_F_VECTOR | ATTR_F_STR | ATTR_F_PATH }, { ATTR_STAGEOUT, NULL, "stageout" , ATTR_F_VECTOR | ATTR_F_STR | ATTR_F_PATH }, /* Additional job and general attribute names: */ { ATTR_JOB_STATE, NULL, "job_state" , ATTR_F_STR }, { ATTR_CTIME, NULL, "ctime" , ATTR_F_STR }, { ATTR_ETIME, NULL, "etime" , ATTR_F_STR }, { ATTR_QTIME, NULL, "qtime" , ATTR_F_STR }, { ATTR_RESOURCES_USED, NULL, "resources_used" , 0 }, { ATTR_EXIT_STATUS, NULL, "exit_status" , ATTR_F_INT }, { ATTR_JOB_OWNER, NULL, "Job_Owner" , ATTR_F_STR }, { ATTR_EUSER, NULL, "euser" , 0 }, { ATTR_EGROUP, NULL, "egroup" , 0 }, { ATTR_HOP_COUNT, NULL, "hop_count" , 0 }, { ATTR_SECURITY, NULL, "security" , 0 }, { ATTR_SCHEDULER_HINT, NULL, "sched_hint" , 0 }, { ATTR_SERVER, NULL, "server" , 0 }, { ATTR_QUEUE, NULL, "queue" , 0 }, { ATTR_QUEUE_RANK, NULL, "queue_rank" , 0 }, { ATTR_EXECUTION_HOST, NULL, "exec_host" , 0 }, { ATTR_TOTAL_JOBS, NULL, "total_jobs" , 0 }, { ATTR_MAX_RUNNING, NULL, "max_running" , 0 }, { ATTR_COMMENT, NULL, "comment" , 0 }, { ATTR_JOB_COOKIE, NULL, "cookie" , 0 }, { ATTR_HASHNAME, NULL, "hashname" , 0 }, { ATTR_SESSION_ID, NULL, "session_id" , 0 }, { ATTR_ALT_ID, NULL, "alt_id" , 0 }, { -1, NULL, NULL, 0 } /* sentinel */ }; torque-2.4.16/src/drmaa/src/Makefile.in0000664000113300011330000005527411605403724014562 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # $Id: Makefile.am,v 1.9 2006/08/28 23:03:26 ciesnik Exp $ # # DRMAA library for Torque/PBS # Copyright (C) 2006 Poznan Supercomputing and Networking Center # DSP team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # SOURCES = $(libdrmaa_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/buildutils/config.mk subdir = src/drmaa/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = ../../lib/Libpbs/libtorque.la libdrmaa_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libdrmaa_la_OBJECTS = attrib.lo compat.lo drmaa_attrib.lo error.lo \ jobs.lo lookup3.lo pbs_attrib.lo session.lo submit.lo util.lo \ wait.lo libdrmaa_la_OBJECTS = $(am_libdrmaa_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libdrmaa_la_SOURCES) DIST_SOURCES = $(libdrmaa_la_SOURCES) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter PBS_LIBS = ../../lib/Libpbs/libtorque.la AM_CFLAGS = @PTHREAD_CFLAGS@ GPERFFLAGS = --language=ANSI-C --struct-type --readonly-tables --includes --pic lib_LTLIBRARIES = libdrmaa.la libdrmaa_la_SOURCES = \ attrib.c \ attrib.h \ compat.c \ compat.h \ drmaa_attrib.gperf \ drmaa_impl.h \ error.c \ error.h \ jobs.c \ jobs.h \ lookup3.c \ lookup3.h \ pbs_attrib.gperf \ session.c \ submit.c \ util.c \ wait.c include_HEADERS = drmaa.h BUILT_SOURCES = drmaa_attrib.c pbs_attrib.c EXTRA_DIST = drmaa_attrib.c pbs_attrib.c libdrmaa_la_LIBADD = $(PBS_LIBS) @PTHREAD_LIBS@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .gperf .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/drmaa/src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/drmaa/src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdrmaa.la: $(libdrmaa_la_OBJECTS) $(libdrmaa_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libdrmaa_la_LDFLAGS) $(libdrmaa_la_OBJECTS) $(libdrmaa_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attrib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drmaa_attrib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jobs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_attrib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/submit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .gperf.c: base=`basename $< .gperf`; \ if $(GPERF) $(GPERFFLAGS) --hash-function-name=$${base}_hash \ --lookup-function-name=$${base}_lookup $< >$@; \ then exit 0; \ else rm $@; exit 1; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/drmaa/src/attrib.h0000664000113300011330000001027111272401236014133 00000000000000/* $Id: attrib.h,v 1.4 2006/06/05 23:27:17 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __DRMAA__ATTRIB_H #define __DRMAA__ATTRIB_H #ifdef HAVE_CONFIG_H # include #endif #include #ifdef HAVE_STDBOOL_H #include #endif #include typedef struct drmaa_attrib_info_s drmaa_attrib_info_t; enum { ATTR_F_VECTOR = 1 << 0, /* bit 0: scalar/vector attribute */ ATTR_F_BOOL = 1 << 1, /* bits 1-2: type */ ATTR_F_INT = 2 << 1, ATTR_F_STR = 3 << 1, ATTR_F_PATH = 1 << 3, /* bits 3-4: (string) format */ ATTR_F_TIME = 2 << 3, ATTR_F_TIMED = 3 << 3, ATTR_F_IMPL = 1 << 5, /* bit 5: implemented flag */ ATTR_F_TYPE_MASK = 06, ATTR_F_FORMAT_MASK = 030 }; struct drmaa_attrib_info_s { int code; const char *drmaa_name; const char *pbs_name; unsigned flags; }; /** @brief Attributes information table. */ extern const drmaa_attrib_info_t drmaa_attr_table[]; #if defined(__GNUC__) && 0 bool drmaa_is_vector(const drmaa_attrib_info_t *attr) __attribute__((weak)); bool drmaa_is_implemented(const drmaa_attrib_info_t *attr) __attribute__((weak)); bool drmaa_is_vector(const drmaa_attrib_info_t *attr) { return attr->flags & ATTR_F_VECTOR; } bool drmaa_is_implemented(const drmaa_attrib_info_t *attr) { return attr->flags & ATTR_F_IMPL; } #else #define drmaa_is_vector( attr ) ( ((attr)->flags & ATTR_F_VECTOR) != 0 ) #define drmaa_is_implemented( attr ) ( ((attr)->flags & ATTR_F_IMPL) != 0 ) #endif /* __GNUC__ */ const drmaa_attrib_info_t * attr_by_drmaa_name(const char *drmaa_name); const drmaa_attrib_info_t * attr_by_pbs_name(const char *pbs_name); /** * Attributes codes. * Keep it synchronized with @ref drmaa_attr_table. */ typedef enum { /* DRMAA 1.0 attributes: */ ATTR_JOB_NAME, ATTR_JOB_PATH, ATTR_ARGV, ATTR_ENV, ATTR_INPUT_PATH, ATTR_OUTPUT_PATH, ATTR_ERROR_PATH, ATTR_JOIN_FILES, ATTR_TRANSFER_FILES, /* optional */ ATTR_JOB_WORKING_DIR, ATTR_EMAIL, ATTR_BLOCK_EMAIL, ATTR_START_TIME, ATTR_JOB_SUBMIT_STATE, ATTR_HARD_CPU_TIME_LIMIT, /* optional */ ATTR_SOFT_CPU_TIME_LIMIT, /* optional */ ATTR_HARD_WCT_LIMIT, /* optional */ ATTR_SOFT_WCT_LIMIT, /* optional */ ATTR_DEADLINE_TIME, /* optional */ ATTR_JOB_CATEGORY, ATTR_NATIVE, /* Additional Torque/OpenPBS attribs (not in DRMAA specification): */ /* Used by OpenPBS user commands: */ ATTR_CHECKPOINT, ATTR_GROUP_LIST, ATTR_HOLD_TYPES, ATTR_KEEP_FILES, ATTR_RESOURCES, ATTR_MAIL_POINTS, ATTR_PRIORITY, ATTR_DESTINATION_QUEUE, ATTR_RERUNABLE, ATTR_USER_LIST, ATTR_REMOTE_USER, ATTR_SHELL, ATTR_DEPENDENCIES, ATTR_INTERACTIVE, ATTR_STAGEIN, ATTR_STAGEOUT, /* Additional job and general attribute names: */ ATTR_JOB_STATE, ATTR_CTIME, ATTR_ETIME, ATTR_QTIME, ATTR_RESOURCES_USED, ATTR_EXIT_STATUS, ATTR_JOB_OWNER, ATTR_EUSER, ATTR_EGROUP, ATTR_HOP_COUNT, ATTR_SECURITY, ATTR_SCHEDULER_HINT, ATTR_SERVER, ATTR_QUEUE, ATTR_QUEUE_RANK, ATTR_EXECUTION_HOST, ATTR_TOTAL_JOBS, ATTR_MAX_RUNNING, ATTR_COMMENT, ATTR_JOB_COOKIE, ATTR_HASHNAME, ATTR_SESSION_ID, ATTR_ALT_ID, N_ATTRIBS, MIN_DRMAA_ATTR = ATTR_JOB_NAME, MAX_DRMAA_ATTR = ATTR_NATIVE, N_DRMAA_ATTRIBS = MAX_DRMAA_ATTR + 1 } drmaa_attribute_t; #endif /* __ATTRIB_H */ torque-2.4.16/src/drmaa/src/drmaa.h0000664000113300011330000006165211272401236013743 00000000000000/* $Id: drmaa.h,v 1.15 2006/09/08 18:18:08 ciesnik Exp $ */ /** * @file drmaa.h * DRMAA library for Torque/PBS * @author Lukasz Ciesnik * * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * * Documentation taken from: * * Distributed Resource Management Application API C Bindings v1.0 * * Copyright (C) Global Grid Forum (2003). All Rights Reserved. * * This document and translations of it may be copied and furnished to * others, and derivative works that comment on or otherwise explain it * or assist in its implementation may be prepared, copied, published * and distributed, in whole or in part, without restriction of any kind, * provided that the above copyright notice and this paragraph are included * on all such copies and derivative works. However, this document itself * may not be modified in any way, such as by removing the copyright notice * or references to the GGF or other organizations, except as needed for the * purpose of developing Grid Recommendations in which case the procedures * for copyrights defined in the GGF Document process must be followed, * or as required to translate it into languages other than English. * * The limited permissions granted above are perpetual and will not be * revoked by the GGF or its successors or assigns. * This document and the information contained herein is provided on an * "AS IS" basis and THE GLOBAL GRID FORUM DISCLAIMS ALL WARRANTIES, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE * INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES * OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef __DRMAA_H #define __DRMAA_H #include #include /** @defgroup drmaa_jobt Job template operations. */ /** @defgroup drmaa DRMAA interface. */ /* @{ */ typedef struct drmaa_job_template_s drmaa_job_template_t; typedef struct drmaa_attr_names_s drmaa_attr_names_t; typedef struct drmaa_attr_values_s drmaa_attr_values_t; typedef struct drmaa_job_ids_s drmaa_job_ids_t; #define DRMAA_ATTR_BUFFER 1024 #define DRMAA_CONTACT_BUFFER 1024 #define DRMAA_DRM_SYSTEM_BUFFER 1024 #define DRMAA_DRMAA_IMPL_BUFFER 1024 #define DRMAA_ERROR_STRING_BUFFER 1024 #define DRMAA_JOBNAME_BUFFER 1024 #define DRMAA_SIGNAL_BUFFER 32 #define DRMAA_TIMEOUT_NO_WAIT 0 #define DRMAA_TIMEOUT_WAIT_FOREVER -1 #define DRMAA_PS_UNDETERMINED 0x00 #define DRMAA_PS_QUEUED_ACTIVE 0x10 #define DRMAA_PS_SYSTEM_ON_HOLD 0x11 #define DRMAA_PS_USER_ON_HOLD 0x12 #define DRMAA_PS_USER_SYSTEM_ON_HOLD 0x13 #define DRMAA_PS_RUNNING 0x20 #define DRMAA_PS_SYSTEM_SUSPENDED 0x21 #define DRMAA_PS_USER_SUSPENDED 0x22 #define DRMAA_PS_USER_SYSTEM_SUSPENDED 0x23 #define DRMAA_PS_DONE 0x30 #define DRMAA_PS_FAILED 0x40 #define DRMAA_CONTROL_SUSPEND 0 #define DRMAA_CONTROL_RESUME 1 #define DRMAA_CONTROL_HOLD 2 #define DRMAA_CONTROL_RELEASE 3 #define DRMAA_CONTROL_TERMINATE 4 #define DRMAA_JOB_IDS_SESSION_ALL "DRMAA_JOB_IDS_SESSION_ALL" #define DRMAA_JOB_IDS_SESSION_ANY "DRMAA_JOB_IDS_SESSION_ANY" #define DRMAA_BLOCK_EMAIL "drmaa_block_email" #define DRMAA_DEADLINE_TIME "drmaa_deadline_time" #define DRMAA_DURATION_HLIMIT "drmaa_duration_hlimit" #define DRMAA_DURATION_SLIMIT "drmaa_duration_slimit" #define DRMAA_ERROR_PATH "drmaa_error_path" #define DRMAA_INPUT_PATH "drmaa_input_path" #define DRMAA_JOB_CATEGORY "drmaa_job_category" #define DRMAA_JOB_NAME "drmaa_job_name" #define DRMAA_JOIN_FILES "drmaa_join_files" #define DRMAA_JS_STATE "drmaa_js_state" #define DRMAA_NATIVE_SPECIFICATION "drmaa_native_specification" #define DRMAA_OUTPUT_PATH "drmaa_output_path" #define DRMAA_REMOTE_COMMAND "drmaa_remote_command" #define DRMAA_START_TIME "drmaa_start_time" #define DRMAA_TRANSFER_FILES "drmaa_transfer_files" #define DRMAA_V_ARGV "drmaa_v_argv" #define DRMAA_V_EMAIL "drmaa_v_email" #define DRMAA_V_ENV "drmaa_v_env" #define DRMAA_WCT_HLIMIT "drmaa_wct_hlimit" #define DRMAA_WCT_SLIMIT "drmaa_wct_slimit" #define DRMAA_WD "drmaa_wd" #define DRMAA_SUBMISSION_STATE_ACTIVE "drmaa_active" #define DRMAA_SUBMISSION_STATE_HOLD "drmaa_hold" #define DRMAA_PLACEHOLDER_HD "$drmaa_hd_ph$" #define DRMAA_PLACEHOLDER_WD "$drmaa_wd_ph$" #define DRMAA_PLACEHOLDER_INCR "$drmaa_incr_ph$" #define DRMAA_ERRNO_SUCCESS 0 #define DRMAA_ERRNO_INTERNAL_ERROR 1 #define DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE 2 #define DRMAA_ERRNO_AUTH_FAILURE 3 #define DRMAA_ERRNO_INVALID_ARGUMENT 4 #define DRMAA_ERRNO_NO_ACTIVE_SESSION 5 #define DRMAA_ERRNO_NO_MEMORY 6 #define DRMAA_ERRNO_INVALID_CONTACT_STRING 7 #define DRMAA_ERRNO_DEFAULT_CONTACT_STRING_ERROR 8 #define DRMAA_ERRNO_NO_DEFAULT_CONTACT_STRING_SELECTED 9 #define DRMAA_ERRNO_DRMS_INIT_FAILED 10 #define DRMAA_ERRNO_ALREADY_ACTIVE_SESSION 11 #define DRMAA_ERRNO_DRMS_EXIT_ERROR 12 #define DRMAA_ERRNO_INVALID_ATTRIBUTE_FORMAT 13 #define DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE 14 #define DRMAA_ERRNO_CONFLICTING_ATTRIBUTE_VALUES 15 #define DRMAA_ERRNO_TRY_LATER 16 #define DRMAA_ERRNO_DENIED_BY_DRM 17 #define DRMAA_ERRNO_INVALID_JOB 18 #define DRMAA_ERRNO_RESUME_INCONSISTENT_STATE 19 #define DRMAA_ERRNO_SUSPEND_INCONSISTENT_STATE 20 #define DRMAA_ERRNO_HOLD_INCONSISTENT_STATE 21 #define DRMAA_ERRNO_RELEASE_INCONSISTENT_STATE 22 #define DRMAA_ERRNO_EXIT_TIMEOUT 23 #define DRMAA_ERRNO_NO_RUSAGE 24 #define DRMAA_ERRNO_NO_MORE_ELEMENTS 25 #if defined(__cplusplus) extern "C" { #endif /** * The drmaa_init() function SHALL initialize DRMAA library and create * a new DRMAA session, using the contact parameter, if provided, to * determine to which DRMS to connect. This function MUST be called * before any other DRMAA function, except for drmaa_get_DRM_system(), * drmaa_get_DRMAA_implementation(), drmaa_get_contact(), and * drmaa_strerror(). If @a contact is @c NULL, the default DRM system * SHALL be used, provided there is only one DRMAA implementation * in the provided binary module. When there is more than one DRMAA * implementation in the binary module, drmaa_init() SHALL return * the DRMAA_ERRNO_NO_DEFAULT_CONTACT_STRING_SELECTED error code. * The drmaa_init() function SHOULD be called by only one of the threads. * The main thread is RECOMMENDED. A call by another thread SHALL return * the DRMAA_ERRNO_ALREADY_ACTIVE_SESSION error code. */ int drmaa_init( const char *contact, char *error_diagnosis, size_t error_diag_len ); /** * The drmaa_exit() function SHALL disengage from DRMAA library and * allow the DRMAA library to perform any necessary internal cleanup. * This routine SHALL end the current DRMAA session but SHALL NOT * affect any jobs (e.g, queued and running jobs SHALL remain queued and * running). drmaa_exit() SHOULD be called by only one of the threads. * The first call to call drmaa_exit() by a thread will operate normally. * All other calls from the same and other threads SHALL fail, returning * a DRMAA_ERRNO_NO_ACTIVE_SESSION error code. */ int drmaa_exit(char *error_diagnosis, size_t error_diag_len); /** * The function drmaa_allocate_job_template() SHALL allocate a new job * template, returned in @a jt. This template is used to describe the * job to be submitted. This description is accomplished by setting the * desired scalar and vector attributes to their appropriate values. This * template is then used in the job submission process. * @addtogroup drmaa_jobt */ int drmaa_allocate_job_template( drmaa_job_template_t **jt, char *error_diagnosis, size_t error_diag_len ); /** * The function drmaa_delete_job_template() SHALL free the job template * pointed to by @a jt. * @addtogroup drmaa_jobt */ int drmaa_delete_job_template( drmaa_job_template_t *jt, char *error_diagnosis, size_t error_diag_len ); /** * The function drmaa_set_attribute() SHALL set the value of the scalar * attribute, @a name, in the job template, @a jt, to the value, @a value. * @addtogroup drmaa_jobt */ int drmaa_set_attribute( drmaa_job_template_t *jt, const char *name, const char *value, char *error_diagnosis, size_t error_diag_len ); /** * The function drmaa_get_attribute() SHALL fill the @a value buffer with * up to @a value_len characters of the scalar attribute, @a name's, value * in the given job template. */ int drmaa_get_attribute( drmaa_job_template_t *jt, const char *name, char *value, size_t value_len, char *error_diagnosis, size_t error_diag_len ); /** * The function drmaa_set_vector_attribute() SHALL set the vector attribute, * @a name, in the job template, @a jt, to the value(s), @a value. The DRMAA * implementation MUST accept value values that are arrays of one or more * strings terminated by a @c NULL entry. */ int drmaa_set_vector_attribute( drmaa_job_template_t *jt, const char *name, const char *value[], char *error_diagnosis, size_t error_diag_len ); /** * The function drmaa_get_vector_attribute() SHALL store in @a values an * opaque values string vector containing the values of the vector attribute, * @a name's, value in the given job template. */ int drmaa_get_vector_attribute( drmaa_job_template_t *jt, const char *name, drmaa_attr_values_t **values, char *error_diagnosis, size_t error_diag_len ); /** * The function drmaa_get_attribute_names() SHALL return the set of supported * scalar attribute names in an opaque names string vector stored in * @a values. This vector SHALL include all required scalar attributes, all * supported optional scalar attributes, all DRM-specific scalar attributes, * and no unsupported optional attributes. */ int drmaa_get_attribute_names( drmaa_attr_names_t **values, char *error_diagnosis, size_t error_diag_len ); /** * The function drmaa_get_vector_attribute_names() SHALL return the set * of supported vector attribute names in an opaque names string vector * stored in @a values. This vector SHALL include all required vector * attributes, all supported optional vector attributes, all DRM-specific * vector attributes, and no unsupported optional attributes. */ int drmaa_get_vector_attribute_names( drmaa_attr_names_t **values, char *error_diagnosis, size_t error_diag_len ); /** * @defgroup drmaa_viter Vector iteration functions. * @ingroup drmaa * * The drmaa_get_next_X() functions SHALL store up to @a value_len * bytes of the next attribute name / attribute value / job identifier * from the @a values opaque string vector in the @a value buffer. * The opaque string vector's internal iterator SHALL then be moved forward * to the next entry. If there are no more values those functions return * @ref DRMAA_ERRNO_INVALID_ARGUMENT (but this is outside DRMAA specification). * * The drmaa_get_num_X() functions SHALL store the number of elements * in the space provided by @a size. * * The drmaa_release_X() functions free the memory used by the * @a values opaque string vector. All memory used by strings contained * therein is also freed. */ /* @addtogroup drmaa_viter @{ */ int drmaa_get_next_attr_name(drmaa_attr_names_t* values, char *value, size_t value_len); int drmaa_get_next_attr_value(drmaa_attr_values_t* values, char *value, size_t value_len); int drmaa_get_next_job_id(drmaa_job_ids_t* values, char *value, size_t value_len); int drmaa_get_num_attr_names(drmaa_attr_names_t* values, size_t *size); int drmaa_get_num_attr_values(drmaa_attr_values_t* values, size_t *size); int drmaa_get_num_job_ids(drmaa_job_ids_t* values, size_t *size); void drmaa_release_attr_names(drmaa_attr_names_t* values); void drmaa_release_attr_values(drmaa_attr_values_t* values); void drmaa_release_job_ids(drmaa_job_ids_t* values); /* @} */ /** * The drmaa_run_job() function submits a single job with the attributes * defined in the job template, @a jt. Upon success, up to @a job_id_len * characters of the submitted job's job identifier are stored in the buffer, * @a job_id. */ int drmaa_run_job( char *job_id, size_t job_id_len, const drmaa_job_template_t *jt, char *error_diagnosis, size_t error_diag_len ); /** * The drmaa_run_bulk_jobs() function submits a set of parametric jobs which * can be run concurrently. The attributes defined in the job template, * @a jt are used for every parametric job in the set. Each job in the * set is identical except for it's index. The first parametric job has an * index equal to @a start. The next job has an index equal to @a start + * @a incr, and so on. The last job has an index equal to start + n * * incr, where @c n is equal to (end - start) / incr. * Note that the value of the last job's index may not be equal to end if * the difference between @a start and @a end is not evenly divisble by * @a incr. The smallest valid value for @a start is 1. The largest valid * value for @a end is 2147483647 (@f$2^{31}-1@f$). The @a start value * must be less than or equal to the @a end value, and only positive index * numbers are allowed. The index number can be determined by the job in * an implementation specific fashion. On success, an opaque job id string * vector containing job identifiers for all submitted jobs SHALL be returned * into @a job_ids. The job identifiers in the opaque job id string vector * can be extracted using the drmaa_get_next_job_id() function. The caller * is responsible for releasing the opaque job id string vector returned * into @a job_ids using the drmaa_release_job_ids() function. */ int drmaa_run_bulk_jobs( drmaa_job_ids_t **jobids, const drmaa_job_template_t *jt, int start, int end, int incr, char *error_diagnosis, size_t error_diag_len ); /** * The drmaa_control() function SHALL enact the action indicated * by @a action on the job specified by the job identifier, @a jobid. * The action parameter's value may be one of the following: * - DRMAA_CONTROL_SUSPEND * - DRMAA_CONTROL_RESUME * - DRMAA_CONTROL_HOLD * - DRMAA_CONTROL_RELEASE * - DRMAA_CONTROL_TERMINATE * The drmaa_control() function SHALL return after the DRM system has * acknowledged the command, not necessarily after the desired action has * been performed. If @a jobid is DRMAA_JOB_IDS_SESSION_ALL, this function * SHALL perform the specified action on all jobs submitted during this * session as of this function is called. */ int drmaa_control( const char *job_id, int action, char *error_diagnosis, size_t error_diag_len ); /** * The drmaa_job_ps() function SHALL store in @a remote_ps the program * status of the job identified by @a job_id. The possible values of * a program's staus are: * - DRMAA_PS_UNDETERMINED * - DRMAA_PS_QUEUED_ACTIVE * - DRMAA_PS_SYSTEM_ON_HOLD * - DRMAA_PS_USER_ON_HOLD * - DRMAA_PS_USER_SYSTEM_ON_HOLD * - DRMAA_PS_RUNNING * - DRMAA_PS_SYSTEM_SUSPENDED * - DRMAA_PS_USER_SUSPENDED * - DRMAA_PS_DONE * - DRMAA_PS_FAILED * * Terminated jobs have a status of DRMAA_PS_FAILED. */ int drmaa_job_ps( const char *job_id, int *remote_ps, char *error_diagnosis, size_t error_diag_len ); /** * The drmaa_synchronize() function SHALL cause the calling thread to * block until all jobs specified by @a job_ids have finished execution. * If @a job_ids contains DRMAA_JOB_IDS_SESSION_ALL, then this function * SHALL wait for all jobs submitted during this DRMAA session as of the * point in time when drmaa_synchronize() is called. To avoid thread race * conditions in multithreaded applications, the DRMAA implementation user * should explicitly synchronize this call with any other job submission * calls or control calls that may change the number of remote jobs. * * The @a timeout parameter value indicates how many seconds to remain * blocked in this call waiting for results to become available, before * returning with a DRMAA_ERRNO_EXIT_TIMEOUT error code. The value, * DRMAA_TIMEOUT_WAIT_FOREVER, MAY be specified to wait indefinitely for * a result. The value, DRMAA_TIMEOUT_NO_WAIT, MAY be specified to return * immediately with a DRMAA_ERRNO_EXIT_TIMEOUT error code if no result is * available. If the call exits before the timeout has elapsed, all the * jobs have been waited on or there was an interrupt. The caller should * check system time before and after this call in order to be sure of how * much time has passed. The @a dispose parameter specifies how to treat * the reaping of the remote job's internal data record, which includes a * record of the job's consumption of system resources during its execution * and other statistical information. If the @a dispose parameter's value * is 1, the DRMAA implementation SHALL dispose of the job's data record at * the end of the drmaa_synchroniize() call. If the @a dispose parameter's * value is 0, the data record SHALL be left for future access via the * drmaa_wait() method. */ int drmaa_synchronize( const char *job_ids[], signed long timeout, int dispose, char *error_diagnosis, size_t error_diag_len ); /** * The drmaa_wait() function SHALL wait for a job identified by @a job_id * to finish execution or fail. If the special string, JOB_IDS_SESSION_ANY, * is provided as the job_id, this function will wait for any job from the * session to finish execution or fail. In this case, any job for which exit * status information is available will satisfy the requirement, including * jobs which preivously finished but have never been the subject of a * drmaa_wait() call. This routine is modeled on the @c wait3 POSIX routine. * * The @a timeout parameter value indicates how many seconds * to remain blocked in this call waiting for a result, before * returning with a DRMAA_ERRNO_EXIT_TIMEOUT error code. The value, * DRMAA_TIMEOUT_WAIT_FOREVER, MAY be specified to wait indefinitely for * a result. The value, DRMAA_TIMEOUT_NO_WAIT, MAY be specified to return * immediately with a DRMAA_ERRNO_EXIT_TIMEOUT error code if no result is * available. If the call exits before the timeout has elapsed, the job * has been successfully waited on or there was an interrupt. The caller * should check system time before and after this call in order to be sure * of how much time has passed. * * Upon success, drmaa_wait() fills @a job_id_out with up to @a * job_id_out_len characters of the waited job's id, stat with the * a code that includes information about the conditions under which * the job terminated, and @a rusage with an array of \=\ * strings that describe the amount of resources consumed by the job * and are implementation defined. The @a stat parameter is further * described below. The @a rusage parameter's values may be accessed via * drmaa_get_next_attr_value(). * * The drmaa_wait() function reaps job data records on a successful * call, so any subsequent calls to drmaa_wait() will fail, returning * a DRMAA_ERRNO_INVALID_JOB error code, meaning that the job's data * record has already been reaped. This error code is the same as * if the job were unknown. If drmaa_wait() exists due to a timeout, * DRMAA_ERRNO_EXIT_TIMEOUT is returned and no rusage information is reaped. * (The only case where drmaa_wait() can be successfully called on a single * job more than once is when the previous call(s) to drmaa_wait() returned * DRMAA_ERRNO_EXIT_TIMEOUT.) * * The stat parameter, set by a successful call to drmaa_wait(), is used * to retrieve further input about the exit condition of the waited * job, identified by job_id_out, through the following functions: * drmaa_wifexited(), drmaa_wexitstatus(), drmaa_wifsignaled(), * drmaa_wtermsig(),drmaa_wcoredump() and drmaa_wifaborted(). */ int drmaa_wait( const char *job_id, char *job_id_out, size_t job_id_out_len, int *stat, signed long timeout, drmaa_attr_values_t **rusage, char *error_diagnosis, size_t error_diag_len ); int drmaa_wifexited(int *exited, int stat, char *error_diagnosis, size_t error_diag_len); int drmaa_wexitstatus(int *exit_status, int stat, char *error_diagnosis, size_t error_diag_len); int drmaa_wifsignaled(int *signaled, int stat, char *error_diagnosis, size_t error_diag_len); int drmaa_wtermsig(char *signal, size_t signal_len, int stat, char *error_diagnosis, size_t error_diag_len); int drmaa_wcoredump(int *core_dumped, int stat, char *error_diagnosis, size_t error_diag_len); int drmaa_wifaborted(int *aborted, int stat, char *error_diagnosis, size_t error_diag_len); /** * The drmaa_strerror() function SHALL return the error string describing * the DRMAA error number @a drmaa_errno. */ const char *drmaa_strerror(int drmaa_errno); /** * The drmaa_get_contact() function, if called before drmaa_init(), SHALL * return a string containing a comma-delimited list of default DRMAA * implementation contacts strings, one per DRM implementation provided. * If called after drmaa_init(), drmaa_get_contacts() SHALL return the * contact string for the DRM system for which the library has been * initialized. */ int drmaa_get_contact(char *contact, size_t contact_len, char *error_diagnosis, size_t error_diag_len); /** * The drmaa_version() function SHALL set major and minor to the major and * minor versions of the DRMAA C binding specification implemented by the * DRMAA implementation. */ int drmaa_version(unsigned int *major, unsigned int *minor, char *error_diagnosis, size_t error_diag_len); /** * The drmaa_get_DRM_system() function, if called before drmaa_init(), * SHALL return a string containing a comma-delimited list of DRM system * identifiers, one per DRM system implementation provided. If called after * drmaa_init(), drmaa_get_DRM_system() SHALL return the selected DRM system. */ int drmaa_get_DRM_system(char *drm_system, size_t drm_system_len, char *error_diagnosis, size_t error_diag_len); /** * The drmaa_get_DRMAA_implementation() function, if called before * drmaa_init(), SHALL return a string containing a comma-delimited list of * DRMAA implementations, one per DRMAA implementation provided. If called * after drmaa_init(), drmaa_get_DRMAA_implementation() SHALL return the * selected DRMAA implementation. */ int drmaa_get_DRMAA_implementation(char *drmaa_impl, size_t drmaa_impl_len, char *error_diagnosis, size_t error_diag_len); #if defined(__cplusplus) } /* extern "C" */ #endif /* @} */ /* * Functions outside of DRMAA specification. */ /** * Specify place where goes log messages from library when they were enabled * at configure time. By default they are written to standard error stream. * @param file File to write to. */ void drmaa_set_logging_output(FILE *file); #endif /* __DRMAA_H */ torque-2.4.16/src/drmaa/src/jobs.h0000664000113300011330000000706311272401236013610 00000000000000/* $Id: jobs.h,v 1.6 2006/09/08 18:18:08 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file jobs.h * Remembering submitted job in session. */ #ifndef __DRMAA__JOBS_H #define __DRMAA__JOBS_H #ifdef HAVE_CONFIG_H # include #endif #include /** * @defgroup jobs Remembering submitted job in session. * @internal */ /** @{ */ typedef enum { DRMAA_JOB_SUSPENDED = 1 << 0, DRMAA_JOB_RESUMED = 1 << 1, DRMAA_JOB_TERMINATED = 1 << 2, DRMAA_JOB_DISPOSE = 1 << 3 } job_flag_t; /** * Job data stored for each submitted job. * It is freed when job terminates and it's status is disposed * by drmaa_wait() or drmaa_synchronize(). */ struct drmaa_job_s { drmaa_job_t *next; /**< Next job in list or @c NULL. */ char *jobid; /**< Job identifier from DRM. */ /** * Job submission timestamp increased in DRMAA session * with each submitted job. */ int time_label; /** * Whether we know that job terminated and its status * is waiting to rip. */ bool terminated; /** * Whether job was suspended within session by drmaa_control(). */ bool suspended; }; typedef struct drmaa_job_iter_s drmaa_job_iter_t; enum { HASHTAB_SIZE = 1024 }; /** Iterates over submitted jobs set. */ struct drmaa_job_iter_s { drmaa_session_t *c; unsigned hash; /**< Hash value of job identifier. */ drmaa_job_t **iter; }; /** * Returns iterator to jobs held in DRMAA session. Caller thread should have * drmaa_session_s#jobs_mutex acquired iterator remains valid until job list is * modified (or lock is released). */ void drmaa_get_job_list_iter(drmaa_session_t *session, drmaa_job_iter_t *iter); /** Returns next job identifier from set or @c NULL if set finished. */ drmaa_job_t * drmaa_get_next_job(drmaa_job_iter_t *iter); /** * Adds job identifier to session. * @param c DRMAA session. * @param job Malloced drmaa_job_t structure with filled jobid field (also * malloced). */ void drmaa_add_job( drmaa_session_t *c, drmaa_job_t *job ); /** * Checks if job with given identifier exist in hash table and optionally * removes it. * @param c Opened DRMAA session. * @param jobid Job identifier. * @param found If not @c NULL and job was found * job session data will be stored here. * @param flags Information to store into session. * If DRMAA_JOB_DISPOSE bit is set session data will be removed. * @see job_flag_t */ bool drmaa_find_job( drmaa_session_t *c, const char *jobid, drmaa_job_t *found, unsigned flags ); void drmaa_delete_job_hashtab(drmaa_job_t **tab); /** @} */ #endif /* __DRMAA_JOBS_H */ torque-2.4.16/src/drmaa/src/drmaa_attrib.c0000664000113300011330000002440411272401236015275 00000000000000/* ANSI-C code produced by gperf version 3.0.1 */ /* Command-line: gperf --language=ANSI-C --struct-type --readonly-tables --includes --pic --hash-function-name=drmaa_attrib_hash --lookup-function-name=drmaa_attrib_lookup drmaa_attrib.gperf */ /* Computed positions: -k'11,16' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ #error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #line 1 "drmaa_attrib.gperf" /* $Id: drmaa_attrib.gperf,v 1.4 2006/06/05 23:27:17 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: drmaa_attrib.gperf,v 1.4 2006/06/05 23:27:17 ciesnik Exp $"; #endif #line 36 "drmaa_attrib.gperf" struct drmaa_attrib { const char *name; int code; }; #include #define TOTAL_KEYWORDS 21 #define MIN_WORD_LENGTH 8 #define MAX_WORD_LENGTH 26 #define MIN_HASH_VALUE 8 #define MAX_HASH_VALUE 46 /* maximum key range = 39, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int drmaa_attrib_hash(register const char *str, register unsigned int len) { static const unsigned char asso_values[] = { 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 18, 47, 0, 47, 0, 47, 47, 20, 0, 13, 10, 5, 0, 5, 47, 5, 47, 0, 47, 15, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47 }; register int hval = len; switch (hval) { default: hval += asso_values[(unsigned char)str[15] + 1]; /*FALLTHROUGH*/ case 15: case 14: case 13: case 12: case 11: hval += asso_values[(unsigned char)str[10]]; /*FALLTHROUGH*/ case 10: case 9: case 8: break; } return hval; } struct stringpool_t { char stringpool_str8[sizeof("drmaa_wd")]; char stringpool_str11[sizeof("drmaa_v_env")]; char stringpool_str12[sizeof("drmaa_v_argv")]; char stringpool_str13[sizeof("drmaa_v_email")]; char stringpool_str14[sizeof("drmaa_js_state")]; char stringpool_str16[sizeof("drmaa_wct_slimit")]; char stringpool_str17[sizeof("drmaa_output_path")]; char stringpool_str18[sizeof("drmaa_job_category")]; char stringpool_str19[sizeof("drmaa_job_name")]; char stringpool_str20[sizeof("drmaa_transfer_files")]; char stringpool_str21[sizeof("drmaa_duration_slimit")]; char stringpool_str22[sizeof("drmaa_block_email")]; char stringpool_str24[sizeof("drmaa_deadline_time")]; char stringpool_str25[sizeof("drmaa_remote_command")]; char stringpool_str26[sizeof("drmaa_input_path")]; char stringpool_str29[sizeof("drmaa_wct_hlimit")]; char stringpool_str31[sizeof("drmaa_duration_hlimit")]; char stringpool_str34[sizeof("drmaa_join_files")]; char stringpool_str36[sizeof("drmaa_start_time")]; char stringpool_str41[sizeof("drmaa_error_path")]; char stringpool_str46[sizeof("drmaa_native_specification")]; }; static const struct stringpool_t stringpool_contents = { "drmaa_wd", "drmaa_v_env", "drmaa_v_argv", "drmaa_v_email", "drmaa_js_state", "drmaa_wct_slimit", "drmaa_output_path", "drmaa_job_category", "drmaa_job_name", "drmaa_transfer_files", "drmaa_duration_slimit", "drmaa_block_email", "drmaa_deadline_time", "drmaa_remote_command", "drmaa_input_path", "drmaa_wct_hlimit", "drmaa_duration_hlimit", "drmaa_join_files", "drmaa_start_time", "drmaa_error_path", "drmaa_native_specification" }; #define stringpool ((const char *) &stringpool_contents) #ifdef __GNUC__ __inline #endif const struct drmaa_attrib * drmaa_attrib_lookup(register const char *str, register unsigned int len) { static const struct drmaa_attrib wordlist[] = { { -1 }, { -1}, { -1}, { -1}, { -1}, { -1}, { -1}, { -1}, #line 47 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, ATTR_JOB_WORKING_DIR}, { -1}, { -1}, #line 41 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, ATTR_ENV}, #line 40 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, ATTR_ARGV}, #line 48 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, ATTR_EMAIL}, #line 51 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, ATTR_JOB_SUBMIT_STATE}, { -1}, #line 55 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, ATTR_SOFT_WCT_LIMIT}, #line 43 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, ATTR_OUTPUT_PATH}, #line 57 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, ATTR_JOB_CATEGORY}, #line 38 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, ATTR_JOB_NAME}, #line 46 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, ATTR_TRANSFER_FILES}, #line 53 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, ATTR_SOFT_CPU_TIME_LIMIT}, #line 49 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, ATTR_BLOCK_EMAIL}, { -1}, #line 56 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, ATTR_DEADLINE_TIME}, #line 39 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, ATTR_JOB_PATH}, #line 42 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, ATTR_INPUT_PATH}, { -1}, { -1}, #line 54 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, ATTR_HARD_WCT_LIMIT}, { -1}, #line 52 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, ATTR_HARD_CPU_TIME_LIMIT}, { -1}, { -1}, #line 45 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, ATTR_JOIN_FILES}, { -1}, #line 50 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, ATTR_START_TIME}, { -1}, { -1}, { -1}, { -1}, #line 44 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, ATTR_ERROR_PATH}, { -1}, { -1}, { -1}, { -1}, #line 58 "drmaa_attrib.gperf" {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, ATTR_NATIVE} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = drmaa_attrib_hash(str, len); if (key <= MAX_HASH_VALUE && key >= 0) { register int o = wordlist[key].name; if (o >= 0) { register const char *s = o + stringpool; if (*str == *s && !strcmp(str + 1, s + 1)) return &wordlist[key]; } } } return 0; } torque-2.4.16/src/drmaa/src/jobs.c0000664000113300011330000000654611272401236013610 00000000000000/* $Id: jobs.c,v 1.6 2006/09/05 13:50:00 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: jobs.c,v 1.6 2006/09/05 13:50:00 ciesnik Exp $"; #endif void drmaa_delete_job_hashtab(drmaa_job_t **tab) { int i; drmaa_job_t *j; for (i = 0; i < HASHTAB_SIZE; i++) for (j = tab[i]; j != NULL;) { drmaa_job_t *d = j; j = j->next; free(d->jobid); free(d); } free(tab); } bool drmaa_find_job( drmaa_session_t *c, const char *jobid, drmaa_job_t *result, unsigned flags ) { drmaa_job_t **i, **found = NULL; unsigned h = hashstr(jobid, strlen(jobid), 0); h &= HASHTAB_SIZE - 1; pthread_mutex_lock(&c->jobs_mutex); for (i = &c->job_hashtab[ h ]; *i != NULL; i = &(*i)->next) { if (!strcmp((*i)->jobid, jobid)) { found = i; break; } } if (found && result) { memcpy(result, *found, sizeof(drmaa_job_t)); result->next = NULL; result->jobid = NULL; } if (found) { if (flags & DRMAA_JOB_SUSPENDED) (*found)->suspended = true; if (flags & DRMAA_JOB_RESUMED) (*found)->suspended = false; if (flags & DRMAA_JOB_TERMINATED) (*found)->terminated = true; if (flags & DRMAA_JOB_DISPOSE) { drmaa_job_t *job = *found; *found = (*found)->next; free(job->jobid); free(job); } } pthread_mutex_unlock(&c->jobs_mutex); return found != NULL; } void drmaa_add_job( drmaa_session_t *c, drmaa_job_t *job ) { unsigned h = hashstr(job->jobid, strlen(job->jobid), 0); h &= HASHTAB_SIZE - 1; pthread_mutex_lock(&c->jobs_mutex); job->time_label = c->next_time_label ++; job->next = c->job_hashtab[ h ]; c->job_hashtab[ h ] = job; pthread_mutex_unlock(&c->jobs_mutex); } void drmaa_get_job_list_iter(drmaa_session_t *c, drmaa_job_iter_t *i) { i->c = c; i->hash = HASHTAB_SIZE - 1; i->iter = & c->job_hashtab[ i->hash ]; } drmaa_job_t * drmaa_get_next_job(drmaa_job_iter_t *i) { drmaa_job_t *result; while (*(i->iter) == NULL) { if (i->hash != 0) i->iter = & i->c->job_hashtab[ --i->hash ]; else return NULL; } result = *(i->iter); i->iter = & (*i->iter)->next; return result; } torque-2.4.16/src/drmaa/src/drmaa_attrib.gperf0000664000113300011330000000434611272401236016161 00000000000000%{ /* $Id: drmaa_attrib.gperf,v 1.4 2006/06/05 23:27:17 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__ ((unused)) # endif = "$Id: drmaa_attrib.gperf,v 1.4 2006/06/05 23:27:17 ciesnik Exp $"; #endif %} struct drmaa_attrib { const char *name; int code; }; %% drmaa_job_name, ATTR_JOB_NAME drmaa_remote_command, ATTR_JOB_PATH drmaa_v_argv, ATTR_ARGV drmaa_v_env, ATTR_ENV drmaa_input_path, ATTR_INPUT_PATH drmaa_output_path, ATTR_OUTPUT_PATH drmaa_error_path, ATTR_ERROR_PATH drmaa_join_files, ATTR_JOIN_FILES drmaa_transfer_files, ATTR_TRANSFER_FILES drmaa_wd, ATTR_JOB_WORKING_DIR drmaa_v_email, ATTR_EMAIL drmaa_block_email, ATTR_BLOCK_EMAIL drmaa_start_time, ATTR_START_TIME drmaa_js_state, ATTR_JOB_SUBMIT_STATE drmaa_duration_hlimit, ATTR_HARD_CPU_TIME_LIMIT drmaa_duration_slimit, ATTR_SOFT_CPU_TIME_LIMIT drmaa_wct_hlimit, ATTR_HARD_WCT_LIMIT drmaa_wct_slimit, ATTR_SOFT_WCT_LIMIT drmaa_deadline_time, ATTR_DEADLINE_TIME drmaa_job_category, ATTR_JOB_CATEGORY drmaa_native_specification, ATTR_NATIVE # vim: syn=c torque-2.4.16/src/drmaa/src/util.c0000664000113300011330000001420311272401236013615 00000000000000/* $Id: util.c,v 1.6 2006/09/05 13:50:00 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: util.c,v 1.6 2006/09/05 13:50:00 ciesnik Exp $"; #endif int drmaa_get_attribute_names(drmaa_attr_names_t **values, char *errmsg, size_t errlen) { return drmaa_impl_get_attribute_names(values, ATTR_F_VECTOR | ATTR_F_IMPL, ATTR_F_IMPL, errmsg, errlen); } int drmaa_get_vector_attribute_names(drmaa_attr_names_t **values, char *errmsg, size_t errlen) { return drmaa_impl_get_attribute_names(values, ATTR_F_VECTOR | ATTR_F_IMPL, ATTR_F_VECTOR | ATTR_F_IMPL, errmsg, errlen); } int drmaa_impl_get_attribute_names( drmaa_attr_names_t **values, unsigned f_mask, unsigned flags, char *errmsg, size_t errlen ) { char **result; unsigned i, j; result = (char**)calloc(N_DRMAA_ATTRIBS + 1, sizeof(char*)); if (result == NULL) RAISE_NO_MEMORY(); for (i = 0, j = 0; i < N_ATTRIBS; i++) { const drmaa_attrib_info_t *attr = drmaa_attr_table + i; if (attr->drmaa_name != NULL && (attr->flags & f_mask) == flags) { result[j] = strdup(attr->drmaa_name); if (result[j] == NULL) { drmaa_free_vector(result); RAISE_NO_MEMORY(); } j++; } } result[j] = NULL; *values = (drmaa_attr_names_t*)malloc(sizeof(drmaa_attr_names_t)); if (*values == NULL) { drmaa_free_vector(result); RAISE_NO_MEMORY(); } (*values)->list = (*values)->iter = result; return DRMAA_ERRNO_SUCCESS; } #define DRMAA_GET_NEXT_VALUE() \ if( values == NULL || *values->iter == NULL ) \ return DRMAA_ERRNO_NO_MORE_ELEMENTS; \ strlcpy( value, *values->iter++, value_len ); \ return DRMAA_ERRNO_SUCCESS; int drmaa_get_next_attr_name(drmaa_attr_names_t* values, char *value, size_t value_len) { DRMAA_GET_NEXT_VALUE(); } int drmaa_get_next_attr_value(drmaa_attr_values_t* values, char *value, size_t value_len) { DRMAA_GET_NEXT_VALUE(); } int drmaa_get_next_job_id(drmaa_job_ids_t* values, char *value, size_t value_len) { DRMAA_GET_NEXT_VALUE(); } #define DRMAA_GET_NUM_VALUES() \ char **i; \ size_t cnt = 0; \ if( values != NULL ) \ for( i = values->list; *i != NULL; i++ ) \ cnt++; \ *size = cnt; \ return DRMAA_ERRNO_SUCCESS; int drmaa_get_num_attr_names(drmaa_attr_names_t* values, size_t *size) { DRMAA_GET_NUM_VALUES(); } int drmaa_get_num_attr_values(drmaa_attr_values_t* values, size_t *size) { DRMAA_GET_NUM_VALUES(); } int drmaa_get_num_job_ids(drmaa_job_ids_t* values, size_t *size) { DRMAA_GET_NUM_VALUES(); } void drmaa_release_attr_names(drmaa_attr_names_t* values) { drmaa_free_vector(values->list); free(values); } void drmaa_release_attr_values(drmaa_attr_values_t* values) { drmaa_free_vector(values->list); free(values); } void drmaa_release_job_ids(drmaa_job_ids_t* values) { drmaa_free_vector(values->list); free(values); } void drmaa_free_vector(char **vector) { char **i; if (vector == NULL) return; for (i = vector; *i != NULL; i++) free(*i); free(vector); } int drmaa_get_contact( char *contact, size_t contact_len, char *errmsg, size_t errlen ) { pthread_mutex_lock(&drmaa_session_mutex); if (drmaa_session != NULL) strlcpy(contact, drmaa_session->contact, contact_len); else strlcpy(contact, "localhost", contact_len); pthread_mutex_unlock(&drmaa_session_mutex); return DRMAA_ERRNO_SUCCESS; } int drmaa_version( unsigned int *major, unsigned int *minor, char *errmsg, size_t errlen ) { *major = 1; *minor = 0; return DRMAA_ERRNO_SUCCESS; } int drmaa_get_DRM_system( char *drm_system, size_t drm_system_len, char *errmsg, size_t errlen ) { strlcpy(drm_system, "Torque/PBS", drm_system_len); return DRMAA_ERRNO_SUCCESS; } int drmaa_get_DRMAA_implementation( char *drmaa_impl, size_t drmaa_impl_len, char *errmsg, size_t errlen ) { strlcpy( drmaa_impl, PACKAGE_NAME" v. "PACKAGE_VERSION" (by DSP Team)", drmaa_impl_len); return DRMAA_ERRNO_SUCCESS; } char * drmaa_replace(char *str, const char *placeholder, const char *value) { size_t ph_len, v_len; char *found = NULL; ph_len = strlen(placeholder); v_len = strlen(value); do { size_t str_len; str_len = strlen(str); found = strstr(str, placeholder); if (found) { char *result; size_t pos = found - str; result = (char*)malloc(str_len - ph_len + v_len + 1); if (result == NULL) return NULL; memcpy(result, str, pos); memcpy(result + pos, value, v_len); memcpy(result + pos + v_len, str + pos + ph_len, str_len - pos - ph_len); result[ str_len-ph_len+v_len ] = 0; free(str); str = result; } } while (found); return str; } torque-2.4.16/src/drmaa/src/wait.c0000664000113300011330000003774311272401236013622 00000000000000/* $Id: wait.c,v 1.13 2006/09/05 07:49:36 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: wait.c,v 1.13 2006/09/05 07:49:36 ciesnik Exp $"; #endif int drmaa_synchronize( const char **job_ids, signed long timeout, int dispose, char *errmsg, size_t errlen ) { drmaa_session_t *c = NULL; bool wait_for_all = false; time_t timeout_time; switch (timeout) { case DRMAA_TIMEOUT_NO_WAIT: timeout_time = time(NULL) - 1; break; case DRMAA_TIMEOUT_WAIT_FOREVER: timeout_time = (time_t)INT_MAX; break; default: timeout_time = time(NULL) + timeout; break; } { const char **j; for (j = job_ids; *j != NULL; j++) if (!strcmp(*j, DRMAA_JOB_IDS_SESSION_ALL)) wait_for_all = true; } if (wait_for_all) { int timestamp; int rc = DRMAA_ERRNO_SUCCESS; bool more_jobs = true; DEBUG(("-> drmaa_synchronize(DRMAA_JOB_IDS_SESSION_ALL, timeout=%ld", timeout)); GET_DRMAA_SESSION(c); pthread_mutex_lock(&c->jobs_mutex); timestamp = c->next_time_label; pthread_mutex_unlock(&c->jobs_mutex); do { drmaa_job_iter_t iter; char *jobid = NULL; pthread_mutex_lock(&c->jobs_mutex); drmaa_get_job_list_iter(c, &iter); do { drmaa_job_t *job; job = drmaa_get_next_job(&iter); if (job == NULL) break; if (!job->terminated && job->time_label < timestamp) jobid = strdup(job->jobid); } while (!jobid); pthread_mutex_unlock(&c->jobs_mutex); more_jobs = (jobid != NULL); if (jobid) { rc = drmaa_job_wait(jobid, NULL, 0, NULL, NULL, dispose, timeout_time, errmsg, errlen); free(jobid); } } while (more_jobs && !rc); RELEASE_DRMAA_SESSION(c); DEBUG(("<- drmaa_synchronize =%d", rc)); return rc; } else /* ! wait_for_all */ { const char **j; int rc = DRMAA_ERRNO_SUCCESS; DEBUG(("-> drmaa_synchronize( timeout=%ld )", timeout)); for (j = job_ids; *j != NULL; j++) { DEBUG(("wait for %s; timeout=%ld", *j, (long)(timeout_time - time(NULL)))); rc = drmaa_job_wait(*j, NULL, 0, NULL, NULL, dispose, timeout_time, errmsg, errlen); if (rc != DRMAA_ERRNO_SUCCESS) break; } DEBUG(("<- drmaa_synchronize =%d", rc)); return rc; } } int drmaa_wait( const char *job_id, char *job_id_out, size_t job_id_out_len, int *stat, signed long timeout, drmaa_attr_values_t **rusage, char *errmsg, size_t errlen ) { time_t timeout_time; int rc; DEBUG(("-> drmaa_wait(%s)", job_id)); switch (timeout) { case DRMAA_TIMEOUT_NO_WAIT: timeout_time = time(NULL) - 1; break; case DRMAA_TIMEOUT_WAIT_FOREVER: timeout_time = (time_t)INT_MAX; break; default: timeout_time = time(NULL) + timeout; break; } if (!strcmp(job_id, DRMAA_JOB_IDS_SESSION_ANY)) job_id = NULL; rc = drmaa_job_wait( job_id, job_id_out, job_id_out_len, stat, rusage, 1, timeout_time, errmsg, errlen); DEBUG(("<- drmaa_wait =%d", rc)); return rc; } int drmaa_get_job_status( const struct batch_status *status, bool *terminated, int *stat, char *errmsg, size_t errlen ) { struct attropl *i; char pbs_state = 0; *stat = -1; for (i = (struct attropl*)status->attribs; i != NULL; i = i->next) { const drmaa_attrib_info_t *attr; /*DEBUG(( "attr: addr=%p, name=%s, value=%s, resource=%s", (void*)i, i->name, i->value, i->resource ));*/ attr = attr_by_pbs_name(i->name); if (attr == NULL) continue; switch (attr->code) { case ATTR_JOB_STATE: pbs_state = i->value[0]; break; case ATTR_EXIT_STATUS: *stat = atoi(i->value); break; } } DEBUG(("job %s in queue: state=%c, exit_status=%d", status->name, pbs_state, *stat)); switch (pbs_state) { case 'C': /* Job is completed after having run. */ case 'E': /* Job is exiting after having run. */ *terminated = true; break; case 'H': /* Job is held. */ case 'Q': /* Job is queued, eligible to run or routed. */ case 'R': /* Job is running. */ case 'T': /* Job is being moved to new location. */ case 'W': /* Job is waiting for its execution time to be reached. */ case 'S': /* (Unicos only) job is suspend. */ *terminated = false; break; case 0: default: RAISE_DRMAA(DRMAA_ERRNO_INTERNAL_ERROR); } return DRMAA_ERRNO_SUCCESS; } int drmaa_get_job_rusage( drmaa_session_t *c, const char *jobid, drmaa_attr_values_t **rusage, char *errmsg, size_t errlen ) { int rc = DRMAA_ERRNO_SUCCESS; struct batch_status *pbs_status = NULL; drmaa_attr_values_t *result = NULL; /* const char *submission_time =NULL; const char *start_time =NULL; const char *end_time =NULL; */ const char *cpu_usage = NULL; const char *mem_usage = NULL; DEBUG(("-> drmaa_get_job_rusage(%s)", jobid)); result = (drmaa_attr_values_t*)malloc(sizeof(drmaa_attr_values_t)); if (result == NULL) RAISE_NO_MEMORY(); result->list = result->iter = (char**)calloc(6, sizeof(char*)); if (result->list == NULL) { free(result); RAISE_NO_MEMORY(); } pthread_mutex_lock(&c->conn_mutex); pbs_status = pbs_statjob(c->pbs_conn, (char*)jobid, NULL, NULL); if (pbs_status == NULL) rc = drmaa_get_pbs_error(errmsg, errlen); pthread_mutex_unlock(&c->conn_mutex); if (!rc && pbs_status->attribs == NULL) SET_DRMAA_ERROR(rc = DRMAA_ERRNO_NO_RUSAGE); if (!rc) { struct attropl *i; for (i = (struct attropl*)pbs_status->attribs; i != NULL; i = i->next) { DEBUG(("name=%s, resource=%s, value=%s", i->name, i->resource, i->value)); if (!strcmp(i->name, "resources_used")) { if (!strcmp(i->resource, "cput")) cpu_usage = i->value; else if (!strcmp(i->resource, "mem")) mem_usage = i->value; } } } if (!rc) { long cpu = 0, mem = 0; int hours, minutes, seconds, i = 0; if (cpu_usage && sscanf(cpu_usage, "%d:%d:%d", &hours, &minutes, &seconds) == 3) cpu = 60 * (60 * hours + minutes) + seconds; /* TODO */ asprintf(& result->list[i++], "submission_time=%ld", (long)time(NULL)); asprintf(& result->list[i++], "start_time=%ld", (long)time(NULL)); asprintf(& result->list[i++], "end_time=%ld", (long)time(NULL)); asprintf(& result->list[i++], "cpu=%ld", cpu); asprintf(& result->list[i++], "mem=%ld", mem); } if (pbs_status) pbs_statfree(pbs_status); if (!rc) *rusage = result; else drmaa_release_attr_values(result); DEBUG(("<- drmaa_get_job_rusage =%d", rc)); return rc; } int drmaa_job_wait( const char *jobid, char *out_jobid, size_t out_jobid_size, int *stat, drmaa_attr_values_t **rusage, int dispose, time_t timeout_time, char *errmsg, size_t errlen ) { struct attropl *attribs = NULL; drmaa_session_t *c = NULL; int rc = DRMAA_ERRNO_SUCCESS; bool terminated = false; DEBUG(("-> drmaa_job_wait(jobid=%s)", jobid)); GET_DRMAA_SESSION(c); if (!rc) { struct attropl *l; l = (struct attropl*)calloc(2, sizeof(struct attropl)); if (l != NULL) { l[0].name = "exit_status"; l[0].next = &l[1]; l[1].name = "job_state"; l[1].next = NULL; attribs = l; } else SET_DRMAA_ERROR(rc = DRMAA_ERRNO_NO_MEMORY); } do { struct batch_status *pbs_status = NULL; struct batch_status *job_status = NULL; int exit_status = 0; if (!rc) { pthread_mutex_lock(&c->conn_mutex); DEBUG(("** probing queue: pbs_statjob( %d, %s, %p, NULL )", c->pbs_conn, jobid, (void*)attribs)); pbs_status = pbs_statjob(c->pbs_conn, (char*)jobid, (struct attrl*)attribs, NULL); pthread_mutex_unlock(&c->conn_mutex); } if (rc) break; if (jobid != NULL) { job_status = pbs_status; if (!rc && job_status && strcmp(job_status->name, jobid) != 0) SET_DRMAA_ERROR(rc = DRMAA_ERRNO_INTERNAL_ERROR); if (!rc && job_status) rc = drmaa_get_job_status(job_status, &terminated, &exit_status, errmsg, errlen); if (!rc) { unsigned action = 0; if (terminated) action |= DRMAA_JOB_TERMINATED; if ((terminated && dispose) || !job_status) action |= DRMAA_JOB_DISPOSE; if (!drmaa_find_job(c, jobid, NULL, action)) SET_DRMAA_ERROR(rc = DRMAA_ERRNO_INVALID_JOB); } } else /* jobid == NULL */ { bool found_any = false; struct batch_status *i; for (i = pbs_status; !rc && i; i = i->next) { unsigned action = 0; rc = drmaa_get_job_status(i, &terminated, &exit_status, errmsg, errlen); if (rc) break; if (!terminated && found_any) continue; /* we do not have to check if job is in session */ if (terminated) action |= DRMAA_JOB_TERMINATED; if (terminated && dispose) action |= DRMAA_JOB_DISPOSE; if (drmaa_find_job(c, i->name, NULL, action)) { job_status = i; found_any = true; } else job_status = NULL; if (job_status && terminated) break; } if (!rc && !found_any) { # ifdef DRMAA_DEBUG drmaa_check_empty_session(c); # endif SET_DRMAA_ERROR(rc = DRMAA_ERRNO_INVALID_JOB); } } /* jobid == NULL */ if (job_status) DEBUG(("job %s found in session data", job_status->name)); if (!rc && !job_status) SET_DRMAA_ERROR(rc = DRMAA_ERRNO_NO_RUSAGE); if (!rc && terminated) { strlcpy(out_jobid, job_status->name, out_jobid_size); if (stat) *stat = exit_status; if (rusage) { #if 1 rc = drmaa_get_job_rusage(c, job_status->name, rusage, errmsg, errlen); #else *rusage = (drmaa_attr_values_t*)malloc(sizeof(drmaa_attr_values_t)); (*rusage)->list = (*rusage)->iter = (char**)calloc(6, sizeof(char*)); asprintf(&(*rusage)->list[0], "submission_time=%ld", (long)time(NULL)); asprintf(&(*rusage)->list[1], "start_time=%ld", (long)time(NULL)); asprintf(&(*rusage)->list[2], "end_time=%ld", (long)time(NULL)); asprintf(&(*rusage)->list[3], "cpu=%d", 0); asprintf(&(*rusage)->list[4], "mem=%d", 0); (*rusage)->list[5] = NULL; #endif } /* * Unfortunetly following code crashes Torque 2.1.2 :/ */ #if 0 if (dispose) { pthread_mutex_lock(&c->conn_mutex); /* * We need to force Torque to delete completed job from queue. * Otherwise (for unknown reason) it complains about * invalid job state. */ DEBUG(("pbs_deljob(%s,DELPURGE=1)", job_status->name)); pbs_deljob(c->pbs_conn, job_status->name, DELPURGE"1"); pthread_mutex_unlock(&c->conn_mutex); } #endif } if (pbs_status != NULL) pbs_statfree(pbs_status); if (!rc && !terminated) { if (time(NULL) < timeout_time) sleep(1); /* pooling interval */ else SET_DRMAA_ERROR(rc = DRMAA_ERRNO_EXIT_TIMEOUT); } } while (!(rc || terminated)); free(attribs); RELEASE_DRMAA_SESSION(c); DEBUG(("<- drmaa_job_wait =%d", rc)); return rc; } bool drmaa_check_empty_session(drmaa_session_t *c) { drmaa_job_iter_t it; bool jobs_in_session = false; drmaa_job_t *job; pthread_mutex_lock(&c->jobs_mutex); drmaa_get_job_list_iter(c, &it); while ((job = drmaa_get_next_job(&it)) != NULL) { DEBUG(("!!! job in session not in DRM queue: jobid=%s submit_label=%d", job->jobid, job->time_label)); jobs_in_session = true; } drmaa_delete_job_hashtab(c->job_hashtab); c->job_hashtab = (drmaa_job_t**)calloc(HASHTAB_SIZE, sizeof(drmaa_job_t*)); pthread_mutex_unlock(&c->jobs_mutex); assert(!jobs_in_session); return !jobs_in_session; } int drmaa_wifexited(int *exited, int stat, char *errmsg, size_t errlen) { *exited = (stat < 128); return DRMAA_ERRNO_SUCCESS; } int drmaa_wexitstatus(int *exit_status, int stat, char *errmsg, size_t errlen) { *exit_status = stat & 0x7f; return DRMAA_ERRNO_SUCCESS; } int drmaa_wifsignaled(int *signaled, int stat, char *errmsg, size_t errlen) { *signaled = (stat >= 128); return DRMAA_ERRNO_SUCCESS; } int drmaa_wtermsig(char *signal, size_t signal_len, int stat, char *errmsg, size_t errlen) { int sig = stat & 0x7f; /* stat - 128 */ #define DETECT_SIG( signame ) \ case signame: strlcpy( signal, #signame, signal_len ); break; switch (sig) { /* signals described by POSIX.1 */ DETECT_SIG(SIGHUP) DETECT_SIG(SIGINT) DETECT_SIG(SIGQUIT) DETECT_SIG(SIGILL) DETECT_SIG(SIGABRT) DETECT_SIG(SIGFPE) DETECT_SIG(SIGKILL) DETECT_SIG(SIGSEGV) DETECT_SIG(SIGPIPE) DETECT_SIG(SIGALRM) DETECT_SIG(SIGTERM) DETECT_SIG(SIGUSR1) DETECT_SIG(SIGUSR2) DETECT_SIG(SIGCHLD) DETECT_SIG(SIGCONT) DETECT_SIG(SIGSTOP) DETECT_SIG(SIGTSTP) DETECT_SIG(SIGTTIN) DETECT_SIG(SIGTTOU) /* signals described in SUSv2 and SUSv3 / POSIX 1003.1-2001 */ #ifdef SIGBUS DETECT_SIG(SIGBUS) #endif #ifdef SIGPOLL DETECT_SIG(SIGPOLL) #endif #ifdef SIGPROF DETECT_SIG(SIGPROF) #endif #ifdef SIGSYS DETECT_SIG(SIGSYS) #endif #ifdef SIGTRAP DETECT_SIG(SIGTRAP) #endif #ifdef SIGURG DETECT_SIG(SIGURG) #endif #ifdef SIGVTALRM DETECT_SIG(SIGVTALRM) #endif #ifdef SIGXCPU DETECT_SIG(SIGXCPU) #endif #ifdef SIGXFSZ DETECT_SIG(SIGXFSZ) #endif default: # if HAVE_SYS_SIGLIST /* strsignal() supported on some systems (Linux, Solaris) is not thread safe * so we use sys_siglist global array whenever possible. */ strlcpy(signal, sys_siglist[sig], signal_len); # else snprintf(signal, signal_len, "unknown signal=%d", sig); # endif break; } return DRMAA_ERRNO_SUCCESS; } int drmaa_wcoredump(int *core_dumped, int stat, char *errmsg, size_t errlen) { /* We have no way to find out whether core file was created. */ *core_dumped = 0; return DRMAA_ERRNO_SUCCESS; } int drmaa_wifaborted(int *aborted, int stat, char *errmsg, size_t errlen) { if (stat < 128) *aborted = false; else switch (stat & 0x7f) { case SIGTERM: case SIGKILL: *aborted = true; break; default: *aborted = false; break; } return DRMAA_ERRNO_SUCCESS; } torque-2.4.16/src/drmaa/src/error.c0000664000113300011330000002445411272401236014002 00000000000000/* $Id: error.c,v 1.9 2006/09/08 18:18:08 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include "pbs_error.h" #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: error.c,v 1.9 2006/09/08 18:18:08 ciesnik Exp $"; #endif static FILE *drmaa_logging_output = NULL; /** Gets last system error message and returns its code. */ int drmaa_get_errno_error(char *error_diagnosis, size_t error_diag_len) { #if HAVE_STRERROR_R strerror_r(errno, error_diagnosis, error_diag_len); #else /* assume strerror is thread safe */ strlcpy(error_diagnosis, strerror(errno), error_diag_len); #endif return errno; } int drmaa_get_drmaa_error(char *error_diagnosis, size_t error_diag_len, int error_code) { snprintf(error_diagnosis, error_diag_len, "drmaa: %s", drmaa_strerror(error_code)); return error_code; } /** Retrieves last PBS error message. */ int drmaa_get_pbs_error(char *error_diagnosis, size_t error_diag_len) { snprintf(error_diagnosis, error_diag_len, "pbs-drm: %s", pbse_to_txt(pbs_errno)); return drmaa_map_pbs_error(pbs_errno); } void drmaa_set_logging_output(FILE *file) { drmaa_logging_output = file; } void drmaa_log(const char *fmt, ...) { va_list args; char *linefmt = NULL; char *line = NULL; FILE *out = drmaa_logging_output; if (out == NULL) out = stderr; linefmt = (char*)malloc(strlen("drmaa pid=XXXXXXXXX: ") + strlen(fmt) + 2); sprintf(linefmt, "drmaa pid=%d: %s\n", (int)getpid(), fmt); va_start(args, fmt); if (-1 == vasprintf(&line, linefmt, args)) { free(linefmt); return; } va_end(args); fwrite(line, 1, strlen(line), out); fflush(drmaa_logging_output); free(linefmt); free(line); } const char * drmaa_strerror(int drmaa_errno) { switch (drmaa_errno) { case DRMAA_ERRNO_SUCCESS: return "Success."; case DRMAA_ERRNO_INTERNAL_ERROR: return "Unexpected or internal DRMAA error."; case DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE: return "Could not contact DRM system for this request."; case DRMAA_ERRNO_AUTH_FAILURE: return "Authorization failure."; case DRMAA_ERRNO_INVALID_ARGUMENT: return "Invalid argument value."; case DRMAA_ERRNO_NO_ACTIVE_SESSION: return "No active DRMAA session."; case DRMAA_ERRNO_NO_MEMORY: return "Not enough memory."; case DRMAA_ERRNO_INVALID_CONTACT_STRING: return "Invalid contact string."; case DRMAA_ERRNO_DEFAULT_CONTACT_STRING_ERROR: return "Can not determine default contact to DRM system."; case DRMAA_ERRNO_NO_DEFAULT_CONTACT_STRING_SELECTED: return "Contact to DRM must be set explicitly because there is no default."; case DRMAA_ERRNO_DRMS_INIT_FAILED: return "Unable to initialize DRM system."; case DRMAA_ERRNO_ALREADY_ACTIVE_SESSION: return "DRMAA session already exist."; case DRMAA_ERRNO_DRMS_EXIT_ERROR: return "Disengagement from the DRM system failed."; case DRMAA_ERRNO_INVALID_ATTRIBUTE_FORMAT: return "Invalid format of job attribute."; case DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE: return "Invalid value of job attribute."; case DRMAA_ERRNO_CONFLICTING_ATTRIBUTE_VALUES: return "Value of attribute conflicts with other attribute value."; case DRMAA_ERRNO_TRY_LATER: return "DRM system is overloaded. Try again later."; case DRMAA_ERRNO_DENIED_BY_DRM: return "DRM rejected job due to its configuration or job attributes."; case DRMAA_ERRNO_INVALID_JOB: return "Job does not exist in DRMs queue."; case DRMAA_ERRNO_RESUME_INCONSISTENT_STATE: return "Can not resume job (not in valid state)."; case DRMAA_ERRNO_SUSPEND_INCONSISTENT_STATE: return "Can not suspend job (not in valid state)."; case DRMAA_ERRNO_HOLD_INCONSISTENT_STATE: return "Can not hold job (not in valid state)."; case DRMAA_ERRNO_RELEASE_INCONSISTENT_STATE: return "Can not release job (not in valid state)."; case DRMAA_ERRNO_EXIT_TIMEOUT: return "Waiting for job to terminate finished due to time-out."; case DRMAA_ERRNO_NO_RUSAGE: return "Job finished but resource usage information " "and/or termination status could not be provided."; case DRMAA_ERRNO_NO_MORE_ELEMENTS: return "Vector have no more elements."; default: return "?? unknown DRMAA error code ??"; } } /** Maps PBS error code into DMRAA code. */ int drmaa_map_pbs_error(int pbs_errcode) { DEBUG(("-> drmaa_map_pbs_error(%d)", pbs_errcode)); switch (pbs_errcode) { case PBSE_NONE: /* no error */ return DRMAA_ERRNO_SUCCESS; case PBSE_UNKJOBID: /* Unknown Job Identifier */ case PBSE_UNKQUE: /* Unknown queue name */ return DRMAA_ERRNO_INVALID_JOB; case PBSE_NOATTR: /* Undefined Attribute */ case PBSE_ATTRRO: /* attempt to set READ ONLY attribute */ case PBSE_IVALREQ: /* Invalid request */ case PBSE_UNKREQ: /* Unknown batch request */ return DRMAA_ERRNO_INTERNAL_ERROR; case PBSE_PERM: /* No permission */ case PBSE_BADHOST: /* access from host not allowed */ return DRMAA_ERRNO_AUTH_FAILURE; case PBSE_JOBEXIST: /* job already exists */ return DRMAA_ERRNO_DENIED_BY_DRM; case PBSE_SYSTEM: /* system error occurred */ case PBSE_INTERNAL: /* internal server error occurred */ case PBSE_REGROUTE: /* parent job of dependent in rte que */ case PBSE_UNKSIG: /* unknown signal name */ return DRMAA_ERRNO_INTERNAL_ERROR; case PBSE_BADATVAL: /* bad attribute value */ return DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE; case PBSE_MODATRRUN: /* Cannot modify attrib in run state */ case PBSE_BADSTATE: /* request invalid for job state */ case PBSE_BADCRED: /* Invalid Credential in request */ case PBSE_EXPIRED: /* Expired Credential in request */ case PBSE_QUNOENB: /* Queue not enabled */ return DRMAA_ERRNO_INTERNAL_ERROR; case PBSE_QACESS: /* No access permission for queue */ case PBSE_BADUSER: /* Bad user - no password entry */ return DRMAA_ERRNO_AUTH_FAILURE; case PBSE_HOPCOUNT: /* Max hop count exceeded */ case PBSE_QUEEXIST: /* Queue already exists */ case PBSE_ATTRTYPE: /* incompatable queue attribute type */ return DRMAA_ERRNO_INTERNAL_ERROR; case PBSE_QUEBUSY: /* Queue Busy (not empty) */ case PBSE_MAXQUED: /* Max number of jobs in queue */ case PBSE_NOCONNECTS: /* No free connections */ case PBSE_TOOMANY: /* Too many submit retries */ return DRMAA_ERRNO_TRY_LATER; case 111: return DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE; #if 0 case PBSE_QUENBIG: /* Queue name too long */ case PBSE_NOSUP: /* Feature/function not supported */ case PBSE_QUENOEN: /* Cannot enable queue,needs add def */ case PBSE_PROTOCOL: /* Protocol (ASN.1) error */ case PBSE_BADATLST: /* Bad attribute list structure */ case PBSE_NOSERVER: /* No server to connect to */ case PBSE_UNKRESC: /* Unknown resource */ case PBSE_EXCQRESC: /* Job exceeds Queue resource limits */ case PBSE_QUENODFLT: /* No Default Queue Defined */ case PBSE_NORERUN: /* Job Not Rerunnable */ case PBSE_ROUTEREJ: /* Route rejected by all destinations */ case PBSE_ROUTEEXPD: /* Time in Route Queue Expired */ case PBSE_MOMREJECT: /* Request to MOM failed */ case PBSE_BADSCRIPT: /* (qsub) cannot access script file */ case PBSE_STAGEIN: /* Stage In of files failed */ case PBSE_RESCUNAV: /* Resources temporarily unavailable */ case PBSE_BADGRP: /* Bad Group specified */ case PBSE_CKPBSY: /* Checkpoint Busy, may be retries */ case PBSE_EXLIMIT: /* Limit exceeds allowable */ case PBSE_BADACCT: /* Bad Account attribute value */ case PBSE_ALRDYEXIT: /* Job already in exit state */ case PBSE_NOCOPYFILE: /* Job files not copied */ case PBSE_CLEANEDOUT: /* unknown job id after clean init */ case PBSE_NOSYNCMSTR: /* No Master in Sync Set */ case PBSE_BADDEPEND: /* Invalid dependency */ case PBSE_DUPLIST: /* Duplicate entry in List */ case PBSE_DISPROTO: /* Bad DIS based Request Protocol */ case PBSE_EXECTHERE: /* cannot execute there */ case PBSE_SISREJECT: /* sister rejected */ case PBSE_SISCOMM: /* sister could not communicate */ case PBSE_SVRDOWN: /* req rejected -server shutting down */ case PBSE_CKPSHORT: /* not all tasks could checkpoint */ case PBSE_UNKNODE: /* Named node is not in the list */ case PBSE_UNKNODEATR: /* node-attribute not recognized */ case PBSE_NONODES: /* Server has no node list */ case PBSE_NODENBIG: /* Node name is too big */ case PBSE_NODEEXIST: /* Node name already exists */ case PBSE_BADNDATVAL: /* Bad node-attribute value */ case PBSE_MUTUALEX: /* State values are mutually exclusive */ case PBSE_GMODERR: /* Error(s) during global modification of nodes */ case PBSE_NORELYMOM: /* could not contact Mom */ case PBSE_NOTSNODE: /* no time-shared nodes */ return DRMAA_ERRNO_INTERNAL_ERROR; #endif default: return DRMAA_ERRNO_INTERNAL_ERROR; } } torque-2.4.16/src/drmaa/src/session.c0000664000113300011330000003432011272401236014325 00000000000000/* $Id: session.c,v 1.12 2006/09/05 13:50:00 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__((unused)) # endif = "$Id: session.c,v 1.12 2006/09/05 13:50:00 ciesnik Exp $"; #endif pthread_mutex_t drmaa_session_mutex = PTHREAD_MUTEX_INITIALIZER; drmaa_session_t *drmaa_session = NULL; int drmaa_init(const char *contact, char *errmsg, size_t errlen) { int rc = DRMAA_ERRNO_SUCCESS; DEBUG(("-> drmaa_init(%s)", contact)); pthread_mutex_lock(&drmaa_session_mutex); if (drmaa_session != NULL) SET_DRMAA_ERROR(rc = DRMAA_ERRNO_ALREADY_ACTIVE_SESSION); if (!rc) rc = drmaa_create(&drmaa_session, contact, errmsg, errlen); pthread_mutex_unlock(&drmaa_session_mutex); DEBUG(("<- drmaa_init =%d", rc)); return rc; } int drmaa_exit(char *errmsg, size_t errlen) { int rc = DRMAA_ERRNO_SUCCESS; DEBUG(("-> drmaa_exit")); pthread_mutex_lock(&drmaa_session_mutex); if (drmaa_session == NULL) { pthread_mutex_unlock(&drmaa_session_mutex); RAISE_DRMAA(DRMAA_ERRNO_NO_ACTIVE_SESSION); } rc = drmaa_destroy(drmaa_session, errmsg, errlen); drmaa_session = NULL; pthread_mutex_unlock(&drmaa_session_mutex); DEBUG(("<- drmaa_exit =%d", rc)); return rc; } /** Creates DRMAA session and opens connection with DRM. */ int drmaa_create(drmaa_session_t **pc, const char *contact, char *errmsg, size_t errlen) { drmaa_session_t *c; c = malloc(sizeof(drmaa_session_t)); if (c == NULL) RAISE_NO_MEMORY(); c->pbs_conn = -1; c->contact = NULL; c->jt_list = NULL; c->job_hashtab = NULL; c->next_time_label = 0; pthread_mutex_init(&c->conn_mutex, NULL); pthread_mutex_init(&c->jobs_mutex, NULL); c->jt_list = (drmaa_job_template_t*)malloc(sizeof(drmaa_job_template_t)); if (c->jt_list == NULL) { drmaa_destroy(c, errmsg, errlen); RAISE_NO_MEMORY(); } c->jt_list->next = c->jt_list->prev = c->jt_list; c->job_hashtab = (drmaa_job_t**)calloc(HASHTAB_SIZE, sizeof(drmaa_job_t*)); if (c->job_hashtab == NULL) { drmaa_destroy(c, errmsg, errlen); RAISE_NO_MEMORY(); } c->pbs_conn = pbs_connect((char*)contact); DEBUG(("pbs_connect(%s)=%d", contact, c->pbs_conn)); if (c->pbs_conn < 0) { drmaa_destroy(c, errmsg, errlen); RAISE_PBS(); } if (contact) c->contact = strdup(contact); else c->contact = strdup(pbs_server); if (c->contact == NULL) { drmaa_destroy(c, errmsg, errlen); RAISE_NO_MEMORY(); } *pc = c; return DRMAA_ERRNO_SUCCESS; } /** Closes connection with DRM (if any) and destroys DRMAA session data. */ int drmaa_destroy(drmaa_session_t *c, char *errmsg, size_t errlen) { int rc = 0; if (c->pbs_conn >= 0) rc = pbs_disconnect(c->pbs_conn); free(c->contact); if (c->jt_list) { drmaa_job_template_t *i; for (i = c->jt_list->next; i != c->jt_list;) { drmaa_job_template_t *jt = i; i = i->next; drmaa_delete_async_job_template(jt); } free(c->jt_list); } drmaa_delete_job_hashtab(c->job_hashtab); pthread_mutex_destroy(&c->conn_mutex); pthread_mutex_destroy(&c->jobs_mutex); free(c); if (rc) RAISE_PBS(); return DRMAA_ERRNO_SUCCESS; } int drmaa_allocate_job_template(drmaa_job_template_t **p_jt, char *errmsg, size_t errlen) { drmaa_session_t *c = NULL; drmaa_job_template_t *jt = NULL; DEBUG(("-> drmaa_allocate_job_template")); GET_DRMAA_SESSION(c); jt = (drmaa_job_template_t*)malloc(sizeof(drmaa_job_template_t)); if (jt == NULL) { RELEASE_DRMAA_SESSION(c); RAISE_NO_MEMORY(); } jt->session = c; jt->attrib = (void**)calloc(N_DRMAA_ATTRIBS, sizeof(void*)); if (jt->attrib == NULL) { free(jt); RELEASE_DRMAA_SESSION(c); RAISE_NO_MEMORY(); } pthread_mutex_init(&jt->mutex, NULL); pthread_mutex_lock(& c->jobs_mutex); jt->next = c->jt_list->next; jt->prev = c->jt_list; jt->next->prev = jt; jt->prev->next = jt; pthread_mutex_unlock(& c->jobs_mutex); *p_jt = jt; RELEASE_DRMAA_SESSION(c); DEBUG(("<- drmaa_allocate_job_template")); return DRMAA_ERRNO_SUCCESS; } int drmaa_delete_job_template(drmaa_job_template_t *jt, char *errmsg, size_t errlen) { drmaa_session_t *c = jt->session; pthread_mutex_lock(&c->jobs_mutex); jt->prev->next = jt->next; jt->next->prev = jt->prev; pthread_mutex_unlock(&c->jobs_mutex); drmaa_delete_async_job_template(jt); return DRMAA_ERRNO_SUCCESS; } /** * Frees memory associated with @a jt job template * without locking associated session. */ void drmaa_delete_async_job_template(drmaa_job_template_t *jt) { if (jt->attrib != NULL) { unsigned i; for (i = 0; i < N_DRMAA_ATTRIBS; i++) if (drmaa_is_vector(&drmaa_attr_table[i])) drmaa_free_vector(jt->attrib[i]); else free(jt->attrib[i]); free(jt->attrib); } pthread_mutex_destroy(&jt->mutex); free(jt); } int drmaa_set_attribute( drmaa_job_template_t *jt, const char *name, const char *value, char *errmsg, size_t errlen ) { const drmaa_attrib_info_t *attr; int attr_no; attr = attr_by_drmaa_name(name); if (attr == NULL || drmaa_is_vector(attr)) RAISE_DRMAA(DRMAA_ERRNO_INVALID_ARGUMENT); attr_no = attr->code; pthread_mutex_lock(&jt->mutex); if (jt->attrib[attr_no] != NULL) free(jt->attrib[attr_no]); jt->attrib[attr_no] = strdup(value); pthread_mutex_unlock(&jt->mutex); return DRMAA_ERRNO_SUCCESS; } int drmaa_get_attribute( drmaa_job_template_t *jt, const char *name, char *value, size_t value_len, char *errmsg, size_t errlen ) { const drmaa_attrib_info_t *attr; int attr_no; attr = attr_by_drmaa_name(name); if (attr == NULL || drmaa_is_vector(attr)) RAISE_DRMAA(DRMAA_ERRNO_INVALID_ARGUMENT); attr_no = attr->code; pthread_mutex_lock(&jt->mutex); if (jt->attrib[attr_no] != NULL) strlcpy(value, jt->attrib[attr_no], value_len); else strlcpy(value, "", value_len); pthread_mutex_unlock(&jt->mutex); return DRMAA_ERRNO_SUCCESS; } int drmaa_set_vector_attribute( drmaa_job_template_t *jt, const char *name, const char *value[], char *errmsg, size_t errlen ) { const drmaa_attrib_info_t *attr; char **v; int attr_no; unsigned i, n_values; attr = attr_by_drmaa_name(name); if (attr == NULL || !drmaa_is_vector(attr)) RAISE_DRMAA(DRMAA_ERRNO_INVALID_ARGUMENT); attr_no = attr->code; for (n_values = 0; value[n_values] != NULL; n_values++) {} v = (char**)calloc(n_values + 1, sizeof(char*)); if (v == NULL) RAISE_NO_MEMORY(); for (i = 0; i < n_values; i++) { v[i] = strdup(value[i]); if (v[i] == NULL) { drmaa_free_vector(v); RAISE_NO_MEMORY(); } } v[n_values] = NULL; pthread_mutex_lock(&jt->mutex); if (jt->attrib[attr_no] != NULL) drmaa_free_vector((char**)jt->attrib[attr_no]); jt->attrib[attr_no] = v; pthread_mutex_unlock(&jt->mutex); return DRMAA_ERRNO_SUCCESS; } int drmaa_get_vector_attribute( drmaa_job_template_t *jt, const char *name, drmaa_attr_values_t **out_values, char *errmsg, size_t errlen ) { const drmaa_attrib_info_t *attr; unsigned i, n_values; char **v, **value; attr = attr_by_drmaa_name(name); if (attr == NULL || !drmaa_is_vector(attr)) RAISE_DRMAA(DRMAA_ERRNO_INVALID_ARGUMENT); pthread_mutex_lock(&jt->mutex); value = (char**)jt->attrib[ attr->code ]; pthread_mutex_unlock(&jt->mutex); if (value == NULL) { *out_values = NULL; return DRMAA_ERRNO_SUCCESS; } for (n_values = 0; value[n_values] != NULL; n_values++) {} v = (char**)calloc(n_values + 1, sizeof(char*)); if (v == NULL) RAISE_NO_MEMORY(); for (i = 0; i < n_values; i++) { v[i] = strdup(value[i]); if (v[i] == NULL) { drmaa_free_vector(v); RAISE_NO_MEMORY(); } } v[n_values] = NULL; *out_values = malloc(sizeof(drmaa_attr_values_t)); (*out_values)->list = (*out_values)->iter = v; return DRMAA_ERRNO_SUCCESS; } int drmaa_control(const char *job_id, int action, char *errmsg, size_t errlen) { drmaa_session_t *c = NULL; int rc = 0; DEBUG(("-> drmaa_control(job_id=%s,action=%d)", job_id, action)); GET_DRMAA_SESSION(c); pthread_mutex_lock(&c->conn_mutex); switch (action) { /* * We cannot know whether we did suspend job * in other way than remembering this inside DRMAA session. */ case DRMAA_CONTROL_SUSPEND: drmaa_find_job(c, job_id, NULL, DRMAA_JOB_SUSPENDED); rc = pbs_sigjob(c->pbs_conn, (char*)job_id, "SIGSTOP", NULL); break; case DRMAA_CONTROL_RESUME: drmaa_find_job(c, job_id, NULL, DRMAA_JOB_RESUMED); rc = pbs_sigjob(c->pbs_conn, (char*)job_id, "SIGCONT", NULL); break; case DRMAA_CONTROL_HOLD: rc = pbs_holdjob(c->pbs_conn, (char*)job_id, USER_HOLD, NULL); break; case DRMAA_CONTROL_RELEASE: rc = pbs_rlsjob(c->pbs_conn, (char*)job_id, USER_HOLD, NULL); break; case DRMAA_CONTROL_TERMINATE: rc = pbs_deljob(c->pbs_conn, (char*)job_id, NULL); /* deldelay=N -- delay between SIGTERM and SIGKILL (default 0)*/ break; } pthread_mutex_unlock(&c->conn_mutex); RELEASE_DRMAA_SESSION(c); DEBUG(("<- drmaa_control() =%d", rc)); if (rc) RAISE_PBS(); else return DRMAA_ERRNO_SUCCESS; } int drmaa_job_ps(const char *job_id, int *remote_ps, char *errmsg, size_t errlen) { drmaa_session_t *c = NULL; int rc = DRMAA_ERRNO_SUCCESS; char pbs_state = 0; int exit_status = -1; struct batch_status *status; struct attropl *i; struct attropl attribs[2]; memset(attribs, 0, sizeof(attribs)); attribs[0].name = "job_state"; attribs[1].name = "exit_status"; attribs[0].next = & attribs[1]; #if 0 { NULL, "exit_status", NULL, NULL, 0 } { attribs + 1, "exit_status", NULL, NULL, 0 }, { attribs + 2, "resources_used", "walltime", NULL, 0 }, { attribs + 3, "resources_used", "cput", NULL, 0 }, { attribs + 4, "resources_used", "mem", NULL, 0 }, { attribs + 5, "resources_used", "vmem", NULL, 0 }, { attribs + 6, "Resource_List", "walltime", NULL, 0 }, { attribs + 7, "Resource_List", "cput", NULL, 0 }, { attribs + 8, "Resource_List", "mem", NULL, 0 }, { NULL, "Resource_List", "vmem", NULL, 0 } #endif #if DRMAA_DEBUG DEBUG(("-> drmaa_job_ps(job_id=%s)", job_id)); for (i = (struct attropl*)attribs; i != NULL; i = i->next) { DEBUG(("query attr: name=%s, value=%s, resource=%s", i->name, i->value, i->resource)); } #endif GET_DRMAA_SESSION(c); pthread_mutex_lock(&c->conn_mutex); status = pbs_statjob(c->pbs_conn, (char*)job_id, (struct attrl*)attribs, NULL); pthread_mutex_unlock(&c->conn_mutex); RELEASE_DRMAA_SESSION(c); if (status == NULL) { if (drmaa_find_job(c, job_id, NULL, DRMAA_JOB_TERMINATED)) { /* assumption is made that job was removed from queue */ *remote_ps = DRMAA_PS_FAILED; return DRMAA_ERRNO_SUCCESS; } else RAISE_PBS(); } #if DRMAA_DEBUG DEBUG(("status of %s: name=%s, text=%s", job_id, status->name, status->text)); for (i = (struct attropl*)status->attribs; i != NULL; i = i->next) { DEBUG(("attr: name=%s, value=%s, resource=%s", i->name, i->value, i->resource)); } #endif for (i = (struct attropl*)status->attribs; i != NULL; i = i->next) { const drmaa_attrib_info_t *attr; attr = attr_by_pbs_name(i->name); switch (attr->code) { case ATTR_JOB_STATE: pbs_state = i->value[0]; break; case ATTR_EXIT_STATUS: exit_status = atoi(i->value); break; } } if (!rc) switch (pbs_state) { case 'C': /* Job is completed after having run. */ if (!drmaa_find_job(c, job_id, NULL, DRMAA_JOB_TERMINATED)) { SET_DRMAA_ERROR(rc = DRMAA_ERRNO_INVALID_JOB); break; } /* nobreak */ case 'E': /* Job is exiting after having run. */ if (exit_status == 0) *remote_ps = DRMAA_PS_DONE; else *remote_ps = DRMAA_PS_FAILED; break; case 'H': /* Job is held. */ *remote_ps = DRMAA_PS_USER_ON_HOLD; break; case 'Q': /* Job is queued, eligible to run or routed. */ *remote_ps = DRMAA_PS_QUEUED_ACTIVE; break; case 'R': /* Job is running. */ { drmaa_job_t job; if (drmaa_find_job(c, job_id, &job, 0) && job.suspended) *remote_ps = DRMAA_PS_USER_SUSPENDED; else *remote_ps = DRMAA_PS_RUNNING; break; } case 'T': /* Job is being moved to new location. */ *remote_ps = DRMAA_PS_RUNNING; break; /* ?? */ case 'W': /* Job is waiting for its execution time to be reached. */ *remote_ps = DRMAA_PS_USER_ON_HOLD; break; case 'S': /* (Unicos only) job is suspend. */ *remote_ps = DRMAA_PS_SYSTEM_SUSPENDED; break; /* ?? */ case 0: default: *remote_ps = DRMAA_PS_UNDETERMINED; break; } pbs_statfree(status); DEBUG(("<- drmaa_job_ps() =%d, remote_ps=0x%02x", rc, *remote_ps)); return rc; } torque-2.4.16/src/drmaa/src/Makefile.am0000664000113300011330000000350411272401236014532 00000000000000# $Id: Makefile.am,v 1.9 2006/08/28 23:03:26 ciesnik Exp $ # # DRMAA library for Torque/PBS # Copyright (C) 2006 Poznan Supercomputing and Networking Center # DSP team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # include $(top_srcdir)/buildutils/config.mk PBS_LIBS = ../../lib/Libpbs/libtorque.la AM_CFLAGS = @PTHREAD_CFLAGS@ GPERF = @GPERF@ GPERFFLAGS = --language=ANSI-C --struct-type --readonly-tables --includes --pic lib_LTLIBRARIES = libdrmaa.la libdrmaa_la_SOURCES = \ attrib.c \ attrib.h \ compat.c \ compat.h \ drmaa_attrib.gperf \ drmaa_impl.h \ error.c \ error.h \ jobs.c \ jobs.h \ lookup3.c \ lookup3.h \ pbs_attrib.gperf \ session.c \ submit.c \ util.c \ wait.c include_HEADERS = drmaa.h BUILT_SOURCES = drmaa_attrib.c pbs_attrib.c EXTRA_DIST = drmaa_attrib.c pbs_attrib.c libdrmaa_la_LIBADD = $(PBS_LIBS) @PTHREAD_LIBS@ .gperf.c: base=`basename $< .gperf`; \ if $(GPERF) $(GPERFFLAGS) --hash-function-name=$${base}_hash \ --lookup-function-name=$${base}_lookup $< >$@; \ then exit 0; \ else rm $@; exit 1; \ fi torque-2.4.16/src/drmaa/src/compat.h0000664000113300011330000000314611272401236014134 00000000000000/* $Id: compat.h,v 1.2 2006/09/08 18:18:08 ciesnik Exp $ */ /* * DRMAA library for Torque/PBS * Copyright (C) 2006 Poznan Supercomputing and Networking Center * DSP team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file compat.h * System compatibility functions. */ #ifndef __DRMAA__COMPAT_H #define __DRMAA__COMPAT_H #ifdef HAVE_CONFIG_H # include #endif #include #include #ifndef HAVE_STRLCPY size_t strlcpy(char *dest, const char *src, size_t size); #endif #ifndef HAVE_ASPRINTF int asprintf(char **strp, const char *fmt, ...); #endif #ifndef HAVE_VASPRINTF int vasprintf(char **strp, const char *fmt, va_list ap); #endif #ifndef HAVE_STDBOOL_H # ifndef bool # define bool int # endif # ifndef true # define true 1 # endif # ifndef false # define false 0 # endif #endif #endif /* __DRMAA__COMPAT_H */ torque-2.4.16/src/drmaa/AUTHORS0000664000113300011330000000025411272401236012756 00000000000000$Id: AUTHORS,v 1.4 2006/05/31 14:18:45 ciesnik Exp $ Author: Łukasz Cieśnik Send bug reports to: DSP team torque-2.4.16/src/drmaa/Makefile.in0000664000113300011330000005315111605403723013762 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # $Id: Makefile.am,v 1.13 2006/08/28 23:03:26 ciesnik Exp $ # # DRMAA library for Torque/PBS # Copyright (C) 2006 Poznan Supercomputing and Networking Center # DSP team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/drmaa DIST_COMMON = README $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in AUTHORS COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = Doxyfile SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgdocdir)" pkgdocDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgdoc_DATA) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ SUBDIRS = src test pkgdocdir = @drmaadocdir@ @DRMAA_DOCS_TRUE@pdf_doc = drmaa.pdf pkgdoc_DATA = $(pdf_doc) DISTCLEANFILES = doc-timestamp doc/html/* doc/latex/* doc/man/man*/* drmaa.pdf all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/drmaa/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/drmaa/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-pkgdocDATA: $(pkgdoc_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdocdir)" || $(mkdir_p) "$(DESTDIR)$(pkgdocdir)" @list='$(pkgdoc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgdocDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdocdir)/$$f'"; \ $(pkgdocDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdocdir)/$$f"; \ done uninstall-pkgdocDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdoc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdocdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdocdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdocdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @DRMAA_DOCS_FALSE@install-data-local: clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-pkgdocDATA install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-pkgdocDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-exec \ install-exec-am install-info install-info-am install-man \ install-pkgdocDATA install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-local \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-hook \ uninstall-info-am uninstall-pkgdocDATA @DRMAA_DOCS_TRUE@install-data-local: install-doc uninstall-hook: rm -rf $(DESTDIR)$(pkgdocdir) #install-data-hook: # for i in $(plaintext_doc); do gzip --force --best $(pkgdocdir)/$$i; done install-doc: doc ( cd doc; find -type f -exec $(INSTALL_DATA) -D '{}' '$(DESTDIR)$(pkgdocdir)/{}' \; ) doc: doc-timestamp drmaa.pdf: doc-timestamp doc-timestamp: @if [ ! -f $@ \ -o `find $(srcdir)/src \( -name '*.c' -o -name '*.h' \) -a -newer $@ \ | wc -l` -gt 0 \ -o Doxyfile -nt $@ \ ]; then \ rm -rf doc; \ echo "$(DOXYGEN)"; \ $(DOXYGEN) && touch $@ || exit 1; \ if [ -d doc/latex ]; then \ (cd doc/latex && $(MAKE) $(AM_MAKEFLAGS) ) || exit 1; \ mv doc/latex/refman.pdf drmaa.pdf; \ (cd doc/latex && $(MAKE) $(AM_MAKEFLAGS) clean ); \ fi \ fi maintainer-clean-local: -rm -rf doc doc doc-timestamp: FORCE FORCE: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/drmaa/COPYING0000664000113300011330000006350411272401236012750 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! torque-2.4.16/src/drmaa/README0000664000113300011330000000616011272401236012570 00000000000000PBS DRMAA 1.0 library for Torque/PBS ******************************************************************** * Copyright (C) 2006 * * FedStage Systems (www.fedstage.com), * Poznan Supercomputing and Networking Center (www.man.poznan.pl), * and the OpenDSP project (http://sourceforge.net/projects/opendsp) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ******************************************************************** Installation ============ To compile the library just go to the main source directory and type: ./configure [--prefix=/installation/directory] && make If you had installed Torque in a non standard directory pass it in --with-pbs configure parameter. If you have taken sources directly from a CVS repository you would need _gperf_ perfect hash function generator for compilation (http://www.gnu.org/projects/gperf). For further information regarding GNU build system see the INSTALL file. To setup and use the DRMAA 1.0 library a default Torque batch queue must be configured so it leaves jobs after the completion. To achieve this simply type the following commands: $ qmgr Qmgr: set queue batch keep_completed = 60 Qmgr: quit The actual value of the keep_completed parameter denotes a number of seconds jobs will have to wait in the queue after the completion. It enables the DRMAA library to retrieve the information about finished jobs. Known bugs and limitations ========================== The PBS DRMAA 1.0 library is meant to be compliant with the Global Grid Forum DRMAA 1.0 specification. Although Torque APIs impose some limitations: - Waiting functions (drmaa_wait() and drmaa_synchronize()) must pool DRM to find out whether job finished. - Resource usage information is not provided. - "start_time" attribute is missing. - Job termination (when job is running) is realized by Torque by sending SIGTERM and/or SIGKILL therefore retrieving those signals cannot be distinguished from abort using drmaa_control(DRMAA_CONTROL_TERMINATE). Then job termination state is marked as "aborted" and "signaled" whatever is the state. - drmaa_wcoredump() always returns false. Please send your comments or questions to the following mailing list: Please also visit the PBS DRMAA sourceforge project webpage to find news and new releases of our software. http://sourceforge.net/projects/pbs-drmaa/ The PBS DRMAA 1.0 library was successfully tested with Torque 2.0.0p8 and 2.1.2 on Linux OS. torque-2.4.16/src/drmaa/Makefile.am0000664000113300011330000000373711272401236013753 00000000000000# $Id: Makefile.am,v 1.13 2006/08/28 23:03:26 ciesnik Exp $ # # DRMAA library for Torque/PBS # Copyright (C) 2006 Poznan Supercomputing and Networking Center # DSP team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # SUBDIRS = src test pkgdocdir=@drmaadocdir@ if DRMAA_DOCS pdf_doc = drmaa.pdf install-data-local: install-doc endif pkgdoc_DATA = $(pdf_doc) uninstall-hook: rm -rf $(DESTDIR)$(pkgdocdir) #install-data-hook: # for i in $(plaintext_doc); do gzip --force --best $(pkgdocdir)/$$i; done install-doc: doc ( cd doc; find -type f -exec $(INSTALL_DATA) -D '{}' '$(DESTDIR)$(pkgdocdir)/{}' \; ) doc: doc-timestamp drmaa.pdf: doc-timestamp doc-timestamp: @if [ ! -f $@ \ -o `find $(srcdir)/src \( -name '*.c' -o -name '*.h' \) -a -newer $@ \ | wc -l` -gt 0 \ -o Doxyfile -nt $@ \ ]; then \ rm -rf doc; \ echo "$(DOXYGEN)"; \ $(DOXYGEN) && touch $@ || exit 1; \ if [ -d doc/latex ]; then \ (cd doc/latex && $(MAKE) $(AM_MAKEFLAGS) ) || exit 1; \ mv doc/latex/refman.pdf drmaa.pdf; \ (cd doc/latex && $(MAKE) $(AM_MAKEFLAGS) clean ); \ fi \ fi DISTCLEANFILES = doc-timestamp doc/html/* doc/latex/* doc/man/man*/* drmaa.pdf maintainer-clean-local: -rm -rf doc doc doc-timestamp: FORCE FORCE: torque-2.4.16/src/pam/0000777000113300011330000000000011614035204011456 500000000000000torque-2.4.16/src/pam/Makefile.in0000664000113300011330000004676311605403742013467 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(pam_pbssimpleauth_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/pam ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pammoddir)" pammodLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(pammod_LTLIBRARIES) pam_pbssimpleauth_la_DEPENDENCIES = am_pam_pbssimpleauth_la_OBJECTS = pam_pbssimpleauth.lo pam_pbssimpleauth_la_OBJECTS = $(am_pam_pbssimpleauth_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pam_pbssimpleauth_la_SOURCES) DIST_SOURCES = $(pam_pbssimpleauth_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter pammod_LTLIBRARIES = pam_pbssimpleauth.la AM_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" EXTRA_DIST = README.pam pam_pbssimpleauth_la_SOURCES = pam_pbssimpleauth.c pam_pbssimpleauth_la_LDFLAGS = -no-undefined -module -avoid-version pam_pbssimpleauth_la_LIBADD = -lpam all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/pam/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/pam/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-pammodLTLIBRARIES: $(pammod_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pammoddir)" || $(mkdir_p) "$(DESTDIR)$(pammoddir)" @list='$(pammod_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(pammodLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pammoddir)/$$f'"; \ $(LIBTOOL) --mode=install $(pammodLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pammoddir)/$$f"; \ else :; fi; \ done uninstall-pammodLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(pammod_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pammoddir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pammoddir)/$$p"; \ done clean-pammodLTLIBRARIES: -test -z "$(pammod_LTLIBRARIES)" || rm -f $(pammod_LTLIBRARIES) @list='$(pammod_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done pam_pbssimpleauth.la: $(pam_pbssimpleauth_la_OBJECTS) $(pam_pbssimpleauth_la_DEPENDENCIES) $(LINK) -rpath $(pammoddir) $(pam_pbssimpleauth_la_LDFLAGS) $(pam_pbssimpleauth_la_OBJECTS) $(pam_pbssimpleauth_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam_pbssimpleauth.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pammoddir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pammodLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pammodLTLIBRARIES install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pammodLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pammodLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pammodLTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-pammodLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/pam/pam_pbssimpleauth.c0000664000113300011330000001225111272401247015262 00000000000000/* pam_pbssimpleauth module */ #define NEED_BLOCKING_CONNECTIONS #include "pbs_config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "list_link.h" #include "pbs_ifl.h" #include "attribute.h" #include "server_limits.h" #include "pbs_job.h" #define MODNAME "pam_pbssimpleauth" /* * here, we make a definition for the externally accessible function * in this file (this definition is required for static a module * but strongly encouraged generally) it is used to instruct the * modules include file to define the function prototypes. */ #define PAM_SM_AUTH #define PAM_SM_ACCOUNT #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_SECURITY_PAM_MODULES_H #include #else #ifdef HAVE_PAM_PAM_MODULES_H #include #endif #endif /* this isn't defined on solaris */ #ifndef PAM_EXTERN #define PAM_EXTERN #endif /* --- authentication management functions (only) --- */ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) { int retval = PAM_SERVICE_ERR; pam_get_user_2nd_arg_t *username; struct passwd *user_pwd; char *ubuf = NULL; struct dirent *jdent; DIR *jobdir = NULL; int fp; struct job xjob; ssize_t amt; char jobpath[PATH_MAX+1]; char jobdirpath[PATH_MAX+1]; int debug = 0; openlog(MODNAME, LOG_PID, LOG_USER); strcpy(jobdirpath, PBS_SERVER_HOME "/mom_priv/jobs"); /* step through arguments */ for (; argc-- > 0; ++argv) { if (!strcmp(*argv, "debug")) debug = 1; else if (!strcmp(*argv, "jobdir")) strncpy(jobdirpath, *argv, PATH_MAX); else syslog(LOG_ERR, "unknown option: %s", *argv); } if (debug) syslog(LOG_INFO, "opening %s", jobdirpath); if ((jobdir = opendir(jobdirpath)) == NULL) { if (debug) syslog(LOG_INFO, "failed to open jobs dir: %s", strerror(errno)); closelog(); return PAM_IGNORE; } /* get the username and passwd, allow uid 0 */ retval = pam_get_user(pamh, &username, NULL); #if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE) if (retval == PAM_CONV_AGAIN) { closelog(); return PAM_INCOMPLETE; } #endif if ((retval != PAM_SUCCESS) || !username) { syslog(LOG_ERR, "failed to retrieve username"); closelog(); return PAM_SERVICE_ERR; } user_pwd = getpwnam(username); /* no early returns from this point on because we need to free ubuf */ if (debug) syslog(LOG_INFO, "username %s, %s", username, user_pwd ? "known" : "unknown"); if (!user_pwd) { retval = PAM_USER_UNKNOWN; } else if (user_pwd->pw_uid == 0) { if (debug) syslog(LOG_INFO, "allowing uid 0"); retval = PAM_SUCCESS; } else { retval = PAM_AUTH_ERR; while ((jdent = readdir(jobdir)) != NULL) { if (strstr(jdent->d_name, ".JB") == NULL) continue; snprintf(jobpath, PATH_MAX - 1, "%s/%s", jobdirpath, jdent->d_name); if (debug) syslog(LOG_INFO, "opening %s", jobpath); fp = open(jobpath, O_RDONLY, 0); if (fp < 0) { syslog(LOG_ERR, "error opening job file"); continue; } amt = read(fp, &xjob.ji_qs, sizeof(xjob.ji_qs)); if (amt != sizeof(xjob.ji_qs)) { close(fp); syslog(LOG_ERR, "short read of job file"); continue; } if (xjob.ji_qs.ji_un_type != JOB_UNION_TYPE_MOM) { /* odd, this really should be JOB_UNION_TYPE_MOM */ close(fp); syslog(LOG_ERR, "job file corrupt"); continue; } if (debug) syslog(LOG_INFO, "state=%d, substate=%d", xjob.ji_qs.ji_state, xjob.ji_qs.ji_substate); if ((xjob.ji_qs.ji_un.ji_momt.ji_exuid == user_pwd->pw_uid) && ((xjob.ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) || (xjob.ji_qs.ji_substate == JOB_SUBSTATE_STARTING) || (xjob.ji_qs.ji_substate == JOB_SUBSTATE_RUNNING))) { /* success! */ close(fp); if (debug) syslog(LOG_INFO, "allowed by %s", jdent->d_name); retval = PAM_SUCCESS; break; } close(fp); } /* END while (readdir(jobdir)) */ if (jobdir) closedir(jobdir); } if (ubuf) free(ubuf); if (debug) syslog(LOG_INFO, "returning %s", retval == PAM_SUCCESS ? "success" : "failed"); closelog(); return retval; } PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv) { return PAM_SUCCESS; } PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv) { return pam_sm_authenticate(pamh, flags, argc, argv); } #ifdef PAM_STATIC /* static module data */ /* this only exists for the unlikely event that this built *with* libpam */ struct pam_module _pam_pbssimpleauth_modstruct = { MODNAME, pam_sm_authenticate, pam_sm_setcred, pam_sm_acct_mgmt, NULL, NULL, NULL, }; #endif /* end of module definition */ torque-2.4.16/src/pam/Makefile.am0000664000113300011330000000053211272401247013434 00000000000000 include $(top_srcdir)/buildutils/config.mk pammoddir=@pammoddir@ pammod_LTLIBRARIES = pam_pbssimpleauth.la AM_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" EXTRA_DIST = README.pam pam_pbssimpleauth_la_SOURCES = pam_pbssimpleauth.c pam_pbssimpleauth_la_LDFLAGS = -no-undefined -module -avoid-version pam_pbssimpleauth_la_LIBADD = -lpam torque-2.4.16/src/pam/README.pam0000664000113300011330000000104111272401247013030 00000000000000This is a simple PAM module to be used on PBS pbs_mom hosts used to authorize users that having a running job. You'll want something like this in your PAM config: account sufficient pam_pbssimpleauth.so If other users should having login priviledges (such as the cluster admins), then use the pam_access module after the pam_pbssimpleauth module. account sufficient pam_pbssimpleauth.so debug account required pam_access.so /etc/security/access.conf can then have something like: -:ALL EXCEPT root admgroup:ALL torque-2.4.16/src/cmds/0000777000113300011330000000000011614035165011635 500000000000000torque-2.4.16/src/cmds/qalter.c0000664000113300011330000004026411375011547013217 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qalter - (PBS) alter batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ int main( int argc, /* I */ char **argv) /* I */ { int c; int errflg = 0; int any_failed = 0; char *pc; int i; int u_cnt, o_cnt, s_cnt, n_cnt; int asynch = FALSE; int rc = 0; struct attrl *attrib = NULL; char *keyword; char *pdepend; char *valuewd; time_t after; char a_value[80]; char job_id[PBS_MAXCLTJOBID]; char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; char path_out[MAXPATHLEN + 1]; #define GETOPT_ARGS "a:A:c:e:h:j:k:l:m:M:N:o:p:qr:S:u:v:W:x:" while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) { switch (c) { case 'a': if ((after = cvtdate(optarg)) < 0) { fprintf(stderr, "qalter: illegal -a value\n"); errflg++; break; } sprintf(a_value, "%ld", (long)after); set_attr(&attrib, ATTR_a, a_value); break; case 'A': set_attr(&attrib, ATTR_A, optarg); break; case 'c': while (isspace((int)*optarg)) optarg++; pc = optarg; if (strlen(pc) == 1) { if ((*pc != 'n') && (*pc != 's') && (*pc != 'c')) { fprintf(stderr, "qalter: illegal -c value\n"); errflg++; break; } } else { if (strncmp(pc, "c=", 2) != 0) { fprintf(stderr, "qalter: illegal -c value\n"); errflg++; break; } pc += 2; if (*pc == '\0') { fprintf(stderr, "qalter: illegal -c value\n"); errflg++; break; } while (isdigit(*pc)) pc++; if (*pc != '\0') { fprintf(stderr, "qalter: illegal -c value\n"); errflg++; break; } } set_attr(&attrib, ATTR_c, optarg); break; case 'e': rc = prepare_path(optarg, path_out,NULL); if ((rc == 0) || (rc == 3)) { set_attr(&attrib, ATTR_e, path_out); } else { fprintf(stderr, "qalter: illegal -e value\n"); errflg++; } break; case 'h': /* hold */ while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "qalter: illegal -h value\n"); errflg++; break; } pc = optarg; u_cnt = o_cnt = s_cnt = n_cnt = 0; while (*pc) { if (*pc == 'u') u_cnt++; else if (*pc == 'o') o_cnt++; else if (*pc == 's') s_cnt++; else if (*pc == 'n') n_cnt++; else { fprintf(stderr, "qalter: illegal -h value\n"); errflg++; break; } pc++; } if (n_cnt && (u_cnt + o_cnt + s_cnt)) { fprintf(stderr, "qalter: illegal -h value\n"); errflg++; break; } set_attr(&attrib, ATTR_h, optarg); break; case 'j': if ((strcmp(optarg, "oe") != 0) && (strcmp(optarg, "eo") != 0) && (strcmp(optarg, "n") != 0)) { fprintf(stderr, "qalter: illegal -j value\n"); errflg++; break; } set_attr(&attrib, ATTR_j, optarg); break; case 'k': /* keep */ if ((strcmp(optarg, "o") != 0) && (strcmp(optarg, "e") != 0) && (strcmp(optarg, "oe") != 0) && (strcmp(optarg, "eo") != 0) && (strcmp(optarg, "n") != 0)) { fprintf(stderr, "qalter: illegal -k value\n"); errflg++; break; } set_attr(&attrib, ATTR_k, optarg); break; case 'l': /* resource requirements */ if (set_resources(&attrib, optarg, TRUE)) { fprintf(stderr, "qalter: illegal -l value\n"); errflg++; } break; case 'm': /* mail event */ while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "qalter: illegal -m value\n"); errflg++; break; } if (strcmp(optarg, "n") != 0) { pc = optarg; while (*pc) { if ((*pc != 'a') && (*pc != 'b') && (*pc != 'e')) { fprintf(stderr, "qalter: illegal -m value\n"); errflg++; break; } pc++; } } set_attr(&attrib, ATTR_m, optarg); break; case 'M': /* mail destination */ if (parse_at_list(optarg, FALSE, FALSE)) { fprintf(stderr, "qalter: illegal -M value\n"); errflg++; break; } set_attr(&attrib, ATTR_M, optarg); break; case 'N': /* name */ if (check_job_name(optarg, 1) == 0) { set_attr(&attrib, ATTR_N, optarg); } else { fprintf(stderr, "qalter: illegal -N value\n"); errflg++; } break; case 'o': /* output */ rc = prepare_path(optarg, path_out,NULL); if ((rc == 0) || (rc == 3)) { set_attr(&attrib, ATTR_o, path_out); } else { fprintf(stderr, "qalter: illegal -o value\n"); errflg++; } break; case 'p': /* priority */ while (isspace((int)*optarg)) optarg++; pc = optarg; if ((*pc == '-') || (*pc == '+')) pc++; if (strlen(pc) == 0) { fprintf(stderr, "qalter: illegal -p value\n"); errflg++; break; } while (*pc != '\0') { if (!isdigit(*pc)) { fprintf(stderr, "qalter: illegal -p value\n"); errflg++; break; } pc++; } i = atoi(optarg); if ((i < -1024) || (i > 1023)) { fprintf(stderr, "qalter: illegal -p value\n"); errflg++; break; } set_attr(&attrib, ATTR_p, optarg); break; case 'q': /* quick - asynchronous */ asynch = TRUE; break; case 'r': /* rerun */ if (strlen(optarg) != 1) { fprintf(stderr, "qalter: illegal -r value\n"); errflg++; break; } if ((*optarg != 'y') && (*optarg != 'n')) { fprintf(stderr, "qalter: illegal -r value\n"); errflg++; break; } set_attr(&attrib, ATTR_r, optarg); break; case 'S': if (parse_at_list(optarg, TRUE, TRUE)) { fprintf(stderr, "qalter: illegal -S value\n"); errflg++; break; } set_attr(&attrib, ATTR_S, optarg); break; case 'u': if (parse_at_list(optarg, TRUE, FALSE)) { fprintf(stderr, "qalter: illegal -u value\n"); errflg++; break; } set_attr(&attrib, ATTR_u, optarg); break; case 'v': set_attr(&attrib, ATTR_v, optarg); break; case 'W': while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "qalter: illegal -W value\n"); errflg++; break; } i = parse_equal_string(optarg, &keyword, &valuewd); while (i == 1) { if (strcmp(keyword, ATTR_depend) == 0) { int rtn = 0; pdepend = malloc(PBS_DEPEND_LEN); if ((pdepend == NULL) || (rtn = parse_depend_list(valuewd,pdepend,PBS_DEPEND_LEN))) { if (rtn == 2) { fprintf(stderr,"qalter: -W value exceeded max length (%d)\n", PBS_DEPEND_LEN); } else { fprintf(stderr,"qalter: illegal -W value\n"); } errflg++; break; } valuewd = pdepend; } else if (strcmp(keyword, ATTR_stagein) == 0) { if (parse_stage_list(valuewd)) { fprintf(stderr, "qalter: illegal -W value\n"); errflg++; break; } } else if (strcmp(keyword, ATTR_stageout) == 0) { if (parse_stage_list(valuewd)) { fprintf(stderr, "qalter: illegal -W value\n"); errflg++; break; } } else if (strcmp(keyword, ATTR_g) == 0) { if (parse_at_list(valuewd, TRUE, FALSE)) { fprintf(stderr, "qalter: illegal -W value\n"); errflg++; break; } } set_attr(&attrib, keyword, valuewd); i = parse_equal_string(NULL, &keyword, &valuewd); } if (i == -1) { fprintf(stderr, "qalter: illegal -W value\n"); errflg++; } break; case 'x': /* exec_hosts */ set_attr(&attrib, ATTR_exechost, optarg); break; case '?': default: errflg++; break; } /* END switch(c) */ } /* END while(c = getopt()) */ if (errflg || (optind == argc)) { static char usage[] = "usage: qalter \ [-a date_time] [-A account_string] [-c interval] [-e path] \n\ [-h hold_list] [-j y|n] [-k keep] [-l resource_list] [-m mail_options] \n\ [-M user_list] [-N jobname] [-o path] [-p priority] [-q] [-r y|n] [-S path] \n\ [-u user_list] [-v variable_list] [-W dependency_list] [-x exec_host] \n\ job_identifier...\n"; fprintf(stderr, "%s", usage); exit(2); } for (;optind < argc;optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qalter: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qalter: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } if (asynch) { stat = pbs_alterjob_async(connect, job_id_out, attrib, NULL); } else { stat = pbs_alterjob(connect, job_id_out, attrib, NULL); } if ((stat != 0) && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qalter", connect, job_id_out); any_failed = pbs_errno; } else if ((stat != 0) && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qalter", connect, job_id_out); any_failed = pbs_errno; } /* END else if (stat && ...) */ pbs_disconnect(connect); } /* END for (optind) */ exit(any_failed); } /* END main() */ /* END qalter.c */ torque-2.4.16/src/cmds/qrls.c0000664000113300011330000001615211272401236012701 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qrls - (PBS) release a hold on a batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ int main( int argc, /* I */ char **argv) /* I */ { int c; int errflg = 0; int any_failed = 0; int u_cnt, o_cnt, s_cnt; char *pc; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; #define MAX_HOLD_TYPE_LEN 32 char hold_type[MAX_HOLD_TYPE_LEN+1]; #define GETOPT_ARGS "h:" hold_type[0] = '\0'; while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) { switch (c) { case 'h': while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "qrls: illegal -h value\n"); errflg++; break; } pc = optarg; u_cnt = o_cnt = s_cnt = 0; while (*pc) { if (*pc == 'u') u_cnt++; else if (*pc == 'o') o_cnt++; else if (*pc == 's') s_cnt++; else { fprintf(stderr, "qrls: illegal -h value\n"); errflg++; break; } pc++; } strcpy(hold_type, optarg); break; default: errflg++; break; } } if (errflg || optind >= argc) { static char usage[] = "usage: qrls [-h {uos}] job_identifier...\n"; fprintf(stderr,"%s", usage); exit(2); } for (;optind < argc;optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qrls: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qrls: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } stat = pbs_rlsjob(connect, job_id_out, hold_type, NULL); if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qrls", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qrls", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } /* END for () */ exit(any_failed); /*NOTREACHED*/ return(0); } /* END main() */ /* END qrls.c */ torque-2.4.16/src/cmds/qsig.c0000664000113300011330000001477611334071076012701 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qsig - (PBS) signal a batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ int main( int argc, char **argv) /* qsig */ { int c; int errflg = 0; int any_failed = 0; int runAsync = FALSE; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; #define MAX_SIGNAL_TYPE_LEN 32 static char sig_string[MAX_SIGNAL_TYPE_LEN+1] = "SIGTERM"; #define GETOPT_ARGS "as:" while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) switch (c) { case 'a': runAsync = TRUE; break; case 's': strcpy(sig_string, optarg); break; default : errflg++; } if (errflg || optind >= argc) { static char usage[] = "usage: qsig [-a] [-s signal] job_identifier...\n"; fprintf(stderr,"%s", usage); exit(2); } for (; optind < argc; optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qsig: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qsig: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } if (runAsync == TRUE) { stat = pbs_sigjobasync(connect,job_id_out,sig_string,NULL); } else { stat = pbs_sigjob(connect, job_id_out, sig_string, NULL); } if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qsig", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qsig", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } exit(any_failed); } torque-2.4.16/src/cmds/MXML.c0000664000113300011330000006661011413216777012514 00000000000000/* HEADER */ /* * * Contains: * * * * */ #include "mcom.h" #include #include #include #include /* prototypes */ int MXMLGetChild(mxml_t *, char *, int *, mxml_t **); int MXMLAddE(mxml_t *, mxml_t *); int MXMLGetAttrF(mxml_t *, char *, int *, void *, enum MDataFormatEnum, int); int MXMLGetAttr(mxml_t *, char *, int *, char *, int); int MXMLToString(mxml_t *, char *, int, char **, mbool_t); /* END prototypes */ int MXMLExtractE( mxml_t *E, /* I */ mxml_t *C, /* I */ mxml_t **CP) /* O (optional) */ { int cindex; if ((E == NULL) || (C == NULL)) { return(FAILURE); } for (cindex = 0;cindex < E->CCount;cindex++) { if (C != E->C[cindex]) { if (MXMLExtractE(E->C[cindex], C, CP) == SUCCESS) { return(SUCCESS); } continue; } if (CP != NULL) *CP = E->C[cindex]; E->C[cindex] = NULL; return(SUCCESS); } /* END for (cindex) */ return(FAILURE); } /* MXMLExtractE() */ int MXMLSetChild( mxml_t *E, /* I */ char *CName, /* I */ mxml_t **CE) /* O */ { if (CE != NULL) *CE = NULL; if ((E == NULL) || (CName == NULL)) { return(FAILURE); } if (MXMLGetChild(E, CName, NULL, CE) == SUCCESS) { /* located existing child */ return(SUCCESS); } /* create new child */ if ((*CE = (mxml_t *)calloc(1, sizeof(mxml_t))) == NULL) { return(FAILURE); } MXMLAddE(E, *CE); if (CName != NULL) { (*CE)->Name = strdup(CName); if ((*CE)->Name == NULL) { return(FAILURE); } } return(SUCCESS); } /* END MXMLSetChild() */ int MXMLCreateE( mxml_t **E, /* O */ char *Name) /* I (optional) */ { /* NOTE: should 'Name' be mandatory? */ if (E == NULL) { return(FAILURE); } if ((*E = (mxml_t *)calloc(1, sizeof(mxml_t))) == NULL) { return(FAILURE); } if ((Name != NULL) && (Name[0] != '\0')) { (*E)->Name = strdup(Name); if ((*E)->Name == NULL) { return(FAILURE); } } return(SUCCESS); } /* END MXMLCreateE() */ int MXMLDestroyE( mxml_t **EP) /* I (modified) */ { int index; mxml_t *E; if (EP == NULL) { return(FAILURE); } E = *EP; if (E == NULL) { return(SUCCESS); } if (E->C != NULL) { /* destroy children */ for (index = 0;index < E->CCount;index++) { if (E->C[index] == NULL) continue; MXMLDestroyE(&E->C[index]); } /* END for (index) */ free(E->C); } /* END if (E->C != NULL) */ /* free attributes */ if (E->AName != NULL) { for (index = 0;index < E->ACount;index++) { if (E->AName[index] == NULL) break; free(E->AName[index]); if ((E->AVal != NULL) && (E->AVal[index] != NULL)) free(E->AVal[index]); } /* END for (index) */ if (E->AVal != NULL) { free(E->AVal); } if (E->AName != NULL) { free(E->AName); } } /* END if (E->AName != NULL) */ /* free name */ if (E->Name != NULL) free(E->Name); if (E->Val != NULL) free(E->Val); free(E); *EP = NULL; return(SUCCESS); } /* END MXMLDestroyE() */ int MXMLSetAttr( mxml_t *E, /* I (modified) */ char *A, /* I */ void *V, /* I */ enum MDataFormatEnum Format) /* I */ { int aindex; int iindex; int rc; char tmpLine[MMAX_LINE]; char *ptr; /* NOTE: overwrite existing attr if found */ if ((E == NULL) || (A == NULL) || (V == NULL)) { return(FAILURE); } switch (Format) { case mdfString: default: ptr = (char *)V; break; case mdfInt: sprintf(tmpLine, "%d", *(int *)V); ptr = tmpLine; break; case mdfLong: sprintf(tmpLine, "%ld", *(long *)V); ptr = tmpLine; break; case mdfDouble: sprintf(tmpLine, "%f", *(double *)V); ptr = tmpLine; break; } /* END switch (Format) */ /* initialize attribute table */ if (E->AName == NULL) { if ((E->AName = (char **)calloc(1, sizeof(char *) * MMAX_XMLATTR)) == NULL) { fprintf(stderr,"ERROR: calloc() failed!\n"); return(FAILURE); } if ((E->AVal = (char **)calloc(1, sizeof(char *) * MMAX_XMLATTR)) == NULL) { fprintf(stderr,"ERROR: calloc() failed!\n"); return(FAILURE); } E->ASize = MMAX_XMLATTR; E->ACount = 0; } /* END if (E->AName == NULL) */ /* insert in alphabetical order */ /* overwrite existing attribute if found */ iindex = 0; rc = 0; for (aindex = 0;aindex < E->ACount;aindex++) { rc = strcmp(E->AName[aindex], A); if (rc > 0) break; if (rc == 0) { iindex = aindex; break; } iindex = aindex + 1; } /* END for (aindex) */ if (aindex >= E->ACount) { iindex = aindex; if (aindex >= E->ASize) { char **tmpAName; char **tmpAVal; /* allocate memory */ tmpAName = (char **)realloc(E->AName,sizeof(char *) * MAX(16,E->ASize << 1)); if (tmpAName == NULL) { /* FAILURE - cannot allocate memory */ return(FAILURE); } E->AName = tmpAName; tmpAVal = (char **)realloc(E->AVal,sizeof(char *) * MAX(16,E->ASize << 1)); if (tmpAVal == NULL) { /* FAILURE - cannot allocate memory */ return(FAILURE); } E->AVal = tmpAVal; E->ASize <<= 1; } /* END if (aindex >= E->ASize) */ } /* END if (aindex >= E->ACount) */ if ((ptr == NULL) && (aindex >= E->ACount)) { /* no action required for empty attribute */ return(SUCCESS); } /* prepare insertion point */ if (rc != 0) { for (aindex = E->ACount - 1;aindex >= iindex;aindex--) { E->AVal[aindex + 1] = E->AVal[aindex]; E->AName[aindex + 1] = E->AName[aindex]; } /* END for (aindex) */ E->AVal[aindex + 1] = NULL; E->AName[aindex + 1] = NULL; } /* END if (rc != 0) */ if (E->AVal[iindex] != NULL) free(E->AVal[iindex]); E->AVal[iindex] = strdup((ptr != NULL) ? ptr : ""); if (E->AVal[iindex] == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } if ((rc != 0) || (E->AName[iindex] == NULL)) { E->AName[iindex] = strdup(A); if (E->AName[iindex] == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } E->ACount++; } return(SUCCESS); } /* END MXMLSetAttr() */ int MXMLAppendAttr( mxml_t *E, /* I root element */ char *AName, /* I */ char *AVal, /* I */ char Delim) /* I */ { int ATok; int len; char VBuf[MMAX_LINE]; if ((E == NULL) || (AName == NULL) || (AVal == NULL)) { return(FAILURE); } ATok = -1; if (MXMLGetAttr(E, AName, &ATok, VBuf, sizeof(VBuf)) == SUCCESS) { char DString[2]; char *tmpAVal; len = strlen(E->AVal[ATok]) + strlen(AVal) + 2; tmpAVal = realloc( E->AVal[ATok], len); if (tmpAVal == NULL) { return(FAILURE); } E->AVal[ATok] = tmpAVal; DString[0] = Delim; DString[1] = '\0'; /* just allocated adequate space, should not be able to overflow */ strcat(E->AVal[ATok], DString); strcat(E->AVal[ATok], AVal); } else if (MXMLSetAttr(E, AName, AVal, mdfString) == FAILURE) { return(FAILURE); } return(SUCCESS); } /* END MXMLAppendAttr() */ int MXMLSetVal( mxml_t *E, /* I (modified) */ void *V, /* I */ enum MDataFormatEnum Format) /* I */ { char *outbuf = NULL; char *ptr; char tmpLine[MMAX_LINE]; int Vlen; int final_len = 0; int buf_size = MMAX_LINE; int i; if ((E == NULL) || (V == NULL)) { return(FAILURE); } if (E->Val != NULL) { free(E->Val); E->Val = NULL; } switch (Format) { case mdfString: default: /* temporarily use ptr as the input string */ ptr = (char *)V; Vlen = strlen(ptr); outbuf = (char *)malloc(buf_size*(sizeof(char))); if (outbuf == NULL) { fprintf(stderr,"Unable to allocate memory for XML output\n"); return(FAILURE); } for (i = 0; i < Vlen; i++) { /* escape characters &"'<> */ /* check 7 because we could add 6 character and a NULL terminator */ if (final_len + 7 >= buf_size) { char *tmp; buf_size += MMAX_LINE; tmp = (char *)realloc(outbuf,buf_size); if (tmp == NULL) { fprintf(stderr,"Unable to allocate memeory for XML output\n"); free(outbuf); return(FAILURE); } outbuf = tmp; } /* escape characters &"'<> */ switch (ptr[i]) { case '<': outbuf[final_len++] = '&'; outbuf[final_len++] = 'l'; outbuf[final_len++] = 't'; outbuf[final_len++] = ';'; break; case '>': outbuf[final_len++] = '&'; outbuf[final_len++] = 'g'; outbuf[final_len++] = 't'; outbuf[final_len++] = ';'; break; case '&': outbuf[final_len++] = '&'; outbuf[final_len++] = 'a'; outbuf[final_len++] = 'm'; outbuf[final_len++] = 'p'; outbuf[final_len++] = ';'; break; case '"': outbuf[final_len++] = '&'; outbuf[final_len++] = 'q'; outbuf[final_len++] = 'u'; outbuf[final_len++] = 'o'; outbuf[final_len++] = 't'; outbuf[final_len++] = ';'; break; case '\'': outbuf[final_len++] = '&'; outbuf[final_len++] = 'a'; outbuf[final_len++] = 'p'; outbuf[final_len++] = 'o'; outbuf[final_len++] = 's'; outbuf[final_len++] = ';'; break; default: outbuf[final_len++] = ptr[i]; break; } /* END switch(ptr[i]) */ } /* END for (i < Vlen) */ outbuf[final_len] = '\0'; break; case mdfInt: sprintf(tmpLine, "%d", *(int *)V); ptr = tmpLine; break; case mdfLong: sprintf(tmpLine, "%ld", *(long *)V); ptr = tmpLine; break; case mdfDouble: sprintf(tmpLine, "%f", *(double *)V); ptr = tmpLine; break; } /* END switch (Format) */ if (outbuf != NULL) { E->Val = outbuf; } else { E->Val = strdup(ptr); } return(SUCCESS); } /* END MXMLSetVal() */ int MXMLAddE( mxml_t *E, /* I (modified) */ mxml_t *C) /* I (required) */ { if ((E == NULL) || (C == NULL)) { return(FAILURE); } if (E->CCount >= E->CSize) { if (E->C == NULL) { E->C = (mxml_t **)calloc(1, sizeof(mxml_t *) * MDEF_XMLICCOUNT); E->CSize = MDEF_XMLICCOUNT; } else { mxml_t **tmpC; tmpC = (mxml_t **)realloc(E->C,sizeof(mxml_t *) * MAX(16,E->CSize << 1)); if (tmpC == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } E->C = tmpC; E->CSize <<= 1; } if (E->C == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } /* END if (E->C == NULL) */ } /* END if (E->CCount >= E->CSize) */ E->C[E->CCount] = C; E->CCount++; return(SUCCESS); } /* END MXMLAddE() */ /** * NOTE: Buf may be allocated on FAILURE */ int MXMLToXString( mxml_t *E, /* I */ char **Buf, /* O (alloc/populated/modified) */ int *BufSize, /* I/O */ int MaxBufSize, /* I */ char **Tail, /* O */ mbool_t IsRootElement) /* I */ { int NewSize; /* NOTE: MXMLToString() only fails due to lack of space */ if ((E == NULL) || (Buf == NULL)) { return(FAILURE); } /* allocate initial memory if required */ if (*Buf == NULL) { NewSize = MMAX_BUFFER; if ((*Buf = (char *)malloc(NewSize)) == NULL) { /* cannot allocate buffer */ return(FAILURE); } if (BufSize != NULL) *BufSize = MMAX_BUFFER; } else { if (BufSize == NULL) { return(FAILURE); } NewSize = *BufSize; } while (MXMLToString( E, *Buf, NewSize, Tail, IsRootElement) == FAILURE) { char *tmpBuf; if (NewSize >= MaxBufSize) { return(FAILURE); } NewSize = MIN(NewSize << 1, MaxBufSize); tmpBuf = (char *)realloc(*Buf,NewSize); if (tmpBuf == NULL) { /* cannot allocate buffer */ return(FAILURE); } *Buf = tmpBuf; if (BufSize != NULL) *BufSize = NewSize; } /* END while (MXMLToString() == FAILURE) */ return(SUCCESS); } /* END MXMLToXString() */ int MXMLToString( mxml_t *E, /* I */ char *Buf, /* O */ int BufSize, /* I */ char **Tail, /* O */ mbool_t IsRootElement) /* I */ { int index; int BSpace; char *BPtr; char *tail; int len; if (Buf != NULL) { Buf[0] = '\0'; } if ((E == NULL) || (Buf == NULL)) { return(FAILURE); } if (BufSize < MMAX_NAME) { return(FAILURE); } BPtr = Buf; BSpace = BufSize; /* display header */ BPtr[0] = '<'; BPtr++; BSpace--; if (E->Name != NULL) { len = strlen(E->Name); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->Name); BSpace -= len; BPtr += len; } else { strcpy(BPtr, "NA"); len = strlen("NA"); BPtr += len; BSpace -= len; } /* display attributes */ for (index = 0;index < E->ACount;index++) { /* FORMAT: ="" */ BPtr[0] = ' '; BPtr++; BSpace--; len = strlen(E->AName[index]); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->AName[index]); BSpace -= len; BPtr += len; BPtr[0] = '='; BPtr++; BSpace--; BPtr[0] = '"'; BPtr++; BSpace--; len = strlen(E->AVal[index]); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->AVal[index]); BSpace -= len; BPtr += len; BPtr[0] = '"'; BPtr++; BSpace--; } /* END for (index) */ BPtr[0] = '>'; BPtr++; BSpace--; if (E->Val != NULL) { len = strlen(E->Val); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->Val); BSpace -= len; BPtr += len; } /* display children */ for (index = 0;index < E->CCount;index++) { if (E->C[index] == NULL) continue; if (MXMLToString(E->C[index], BPtr, BSpace, &tail, FALSE) == FAILURE) { return(FAILURE); } len = strlen(BPtr); BSpace -= len; BPtr += len; } /* END for (index) */ /* display footer */ if (E->Name != NULL) { len = strlen(E->Name); } else { len = strlen("NA"); } if (BSpace < len + 4) { return(FAILURE); } BPtr[0] = '<'; BPtr++; BSpace--; BPtr[0] = '/'; BPtr++; BSpace--; if (E->Name != NULL) { strcpy(BPtr, E->Name); } else { strcpy(BPtr, "NA"); } BSpace -= len; BPtr += len; BPtr[0] = '>'; BPtr++; BSpace--; /* terminate string */ BPtr[0] = '\0'; if (Tail != NULL) *Tail = BPtr; return(SUCCESS); } /* END MXMLToString() */ int MXMLGetAttrF( mxml_t *E, /* I */ char *AName, /* I/O */ int *ATok, /* I (optional) */ void *AVal, /* O */ enum MDataFormatEnum DFormat, /* I */ int VSize) /* I */ { char tmpLine[MMAX_LINE]; int rc; if (AVal == NULL) { return(FAILURE); } switch (DFormat) { case mdfString: rc = MXMLGetAttr( E, AName, ATok, (char *)AVal, VSize); return(rc); /* NOTREACHED*/ break; case mdfInt: case mdfLong: case mdfDouble: if (MXMLGetAttr( E, AName, ATok, tmpLine, sizeof(tmpLine)) == FAILURE) { /* clear response */ switch (DFormat) { case mdfInt: *(int *)AVal = 0; break; case mdfLong: *(long *)AVal = 0; break; case mdfDouble: *(double *)AVal = 0.0; break; default: break; } /* END switch(DFormat) */ return(FAILURE); } break; default: return(FAILURE); /*NOTREACHED*/ break; } /* END switch(DFormat) */ switch (DFormat) { case mdfInt: *(int *)AVal = (int)strtol(tmpLine, NULL, 10); break; case mdfLong: *(long *)AVal = strtol(tmpLine, NULL, 10); break; case mdfDouble: *(double *)AVal = strtod(tmpLine, NULL); break; default: *(char **)AVal = NULL; return(FAILURE); /*NOTREACHED*/ break; } /* END switch (DFormat) */ return(SUCCESS); } /* END MXMLGetAttrF() */ int MXMLGetAttr( mxml_t *E, /* I */ char *AName, /* I/O */ int *ATok, /* I (optional) */ char *AVal, /* O (optional) */ int VSize) /* I */ { /* NOTE: set AName to empty string to get Name */ int aindex; int astart; int EVSize; if (AVal != NULL) AVal[0] = '\0'; if (E == NULL) { return(FAILURE); } EVSize = (VSize > 0) ? VSize : MMAX_LINE; if (ATok != NULL) astart = *ATok; else astart = -1; for (aindex = astart + 1;aindex < E->ACount;aindex++) { if ((AName == NULL) || (AName[0] == '\0') || !strcmp(AName, E->AName[aindex])) { if ((AName != NULL) && (AName[0] == '\0')) { strncpy(AName, E->AName[aindex], MMAX_NAME); AName[MMAX_NAME - 1] = '\0'; } if (AVal != NULL) { strncpy(AVal, E->AVal[aindex], EVSize); AVal[EVSize - 1] = '\0'; } if (ATok != NULL) *ATok = aindex; return(SUCCESS); } } /* END for (aindex) */ return(FAILURE); } /* END MXMLGetAttr() */ int MXMLGetChild( mxml_t *E, /* I */ char *CName, /* I (optional) */ int *CTok, /* I (optional) */ mxml_t **C) /* O */ { int cindex; int cstart; if (C != NULL) *C = NULL; if ((E == NULL) || (C == NULL)) { return(FAILURE); } if (CTok != NULL) cstart = *CTok; else cstart = -1; for (cindex = cstart + 1;cindex < E->CCount;cindex++) { if (E->C[cindex] == NULL) continue; if ((CName == NULL) || !strcmp(CName, E->C[cindex]->Name)) { *C = E->C[cindex]; if (CTok != NULL) *CTok = cindex; return(SUCCESS); } } /* END for (cindex) */ return(FAILURE); } /* END MXMLGetChild() */ int MXMLGetChildCI( mxml_t *E, /* I */ char *CName, /* I (optional) */ int *CTok, /* I (optional) */ mxml_t **CP) /* O (optional) */ { int cindex; int cstart; int SLen; if (CP != NULL) *CP = NULL; #ifndef __MOPT if (E == NULL) { return(FAILURE); } #endif /* __MOPT */ if (CTok != NULL) cstart = *CTok; else cstart = -1; if (CName != NULL) SLen = strlen(CName) + 1; else SLen = 0; for (cindex = cstart + 1;cindex < E->CCount;cindex++) { if (E->C[cindex] == NULL) continue; if ((CName == NULL) || !strncasecmp(CName, E->C[cindex]->Name, SLen)) { if (CP != NULL) *CP = E->C[cindex]; if (CTok != NULL) *CTok = cindex; return(SUCCESS); } } /* END for (cindex) */ return(FAILURE); } /* END MXMLGetChildCI() */ #define MMAX_XBUFFER 131072 int MXMLFromString( mxml_t **EP, /* O (populate or create) */ char *XMLString, /* I */ char **Tail, /* O (optional) */ char *EMsg) /* O (optional) */ { mxml_t *E; char *ptr; char *tail; int index; mbool_t ElementIsClosed = FALSE; mbool_t DoAppend = FALSE; char tmpNLine[MMAX_LINE + 1]; char tmpVLine[MMAX_XBUFFER + 1]; if (EP != NULL) *EP = NULL; if (EMsg != NULL) EMsg[0] = '\0'; if ((XMLString == NULL) || (EP == NULL)) { if (EMsg != NULL) strcpy(EMsg, "invalid arguments"); return(FAILURE); } if ((ptr = strchr(XMLString, '<')) == NULL) { if (EMsg != NULL) strcpy(EMsg, "no XML in string"); return(FAILURE); } if (ptr[1] == '/') { /* located tail marker */ if (EMsg != NULL) strcpy(EMsg, "premature termination marker"); return(FAILURE); } /* NOTE: should support append/overlay parameter (NYI) */ /* ignore 'meta' elements */ while ((ptr[1] == '?') || (ptr[1] == '!')) { ptr++; /* ignore 'meta' elements */ if (*ptr == '?') { ptr++; if ((ptr = strstr(ptr, "?>")) == NULL) { /* cannot locate end of meta element */ return(FAILURE); } if ((ptr = strchr(ptr, '<')) == NULL) { /* cannot locate next element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate post-meta XML"); return(FAILURE); } } /* END if (*ptr == '?') */ /* ignore 'comment' element */ if (!strncmp(ptr, "!--", 3)) { ptr += 3; if ((ptr = strstr(ptr, "-->")) == NULL) { /* cannot locate end of comment element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate comment termination marker"); return(FAILURE); } if ((ptr = strchr(ptr, '<')) == NULL) { /* cannot locate next element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate post-comment XML"); return(FAILURE); } } /* END if (!strncmp(ptr,"!--",3)) */ } /* END while ((ptr[1] == '?') || (ptr[1] == '!')) */ /* remove whitespace */ while (isspace(*ptr)) ptr++; /* extract root element */ if (*ptr != '<') { /* cannot located start of element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate start of root element"); return(FAILURE); } ptr++; /* ignore '<' */ index = 0; while ((*ptr != ' ') && (*ptr != '>')) { if ((ptr[0] == '/') && (ptr[1] == '>')) { ElementIsClosed = TRUE; break; } tmpNLine[index++] = *(ptr++); if ((index >= MMAX_LINE) || (ptr[0] == '\0')) { if (EMsg != NULL) sprintf(EMsg, "element name is too long - %.10s", tmpNLine); return(FAILURE); } } tmpNLine[index] = '\0'; if ((*EP == NULL) && (MXMLCreateE(EP, tmpNLine) == FAILURE)) { if (EMsg != NULL) sprintf(EMsg, "cannot create XML element '%s'", tmpNLine); return(FAILURE); } E = *EP; if ((E->ACount > 0) || (E->CCount > 0)) { DoAppend = TRUE; } if (ElementIsClosed == TRUE) { ptr += 2; /* skip '/>' */ if (Tail != NULL) *Tail = ptr; return(SUCCESS); } while (*ptr == ' ') ptr++; while (*ptr != '>') { /* extract attributes */ /* FORMAT: ="" */ index = 0; while ((*ptr != '=') && (*ptr != '\0')) { tmpNLine[index++] = *(ptr++); if (index >= MMAX_LINE) break; } tmpNLine[index] = '\0'; if (*ptr != '\0') ptr++; /* skip '=' */ if (*ptr != '\0') ptr++; /* skip '"' */ if (*ptr == '\0') { if (EMsg != NULL) sprintf(EMsg, "string is corrupt - early termination"); return(FAILURE); } index = 0; while ((*ptr != '"') || ((ptr > XMLString) && (*(ptr - 1) == '\\'))) { tmpVLine[index++] = *(ptr++); if ((index >= MMAX_XBUFFER) || (*ptr == '\0')) { MXMLDestroyE(EP); /* locate tail */ if (Tail != NULL) *Tail = ptr + strlen(ptr); if (EMsg != NULL) { sprintf(EMsg, "attribute name is too long - %.10s", tmpVLine); } return(FAILURE); } } tmpVLine[index] = '\0'; MXMLSetAttr(E, tmpNLine, (void *)tmpVLine, mdfString); ptr++; /* ignore '"' */ while (*ptr == ' ') ptr++; if ((ptr[0] == '/') && (ptr[1] == '>')) { /* element terminator reached */ ptr += 2; /* skip '/>' */ if (Tail != NULL) *Tail = ptr; return(SUCCESS); } } /* END while (*ptr != '>') */ ptr++; /* ignore '>' */ /* skip whitespace */ while (isspace(*ptr)) ptr++; /* extract value */ if (*ptr != '<') { char *ptr2; index = 0; while (*ptr != '<') { tmpVLine[index++] = *(ptr++); if (index >= MMAX_XBUFFER) break; } tmpVLine[index] = '\0'; E->Val = strdup(tmpVLine); if (E->Val == NULL) { if (EMsg != NULL) { sprintf(EMsg,"cannot alloc memory for value - %.10s", tmpVLine); } return(FAILURE); } /* restore '<' symbols */ for (ptr2 = strchr(E->Val, (char)14);ptr2 != NULL;ptr2 = strchr(ptr2, (char)14)) *ptr2 = '<'; } /* END if (*ptr != '<') */ /* extract children */ while (ptr[1] != '/') { mxml_t *C; C = NULL; if (DoAppend == TRUE) { char *ptr2; char tmpCName[MMAX_NAME]; int index; /* FORMAT: ... */ /* locate name */ ptr2 = ptr + 1; /* ignore '<' */ index = 0; while ((*ptr2 != ' ') && (*ptr2 != '>')) { if ((ptr2[0] == '/') && (ptr2[1] == '>')) { break; } tmpCName[index++] = *(ptr2++); if ((index >= MMAX_LINE) || (ptr2[0] == '\0')) { if (EMsg != NULL) { sprintf(EMsg, "element name is too long - %.10s", tmpCName); } return(FAILURE); } } tmpCName[index] = '\0'; MXMLGetChild(E, tmpCName, NULL, &C); } if ((MXMLFromString(&C, ptr, &tail, EMsg) == FAILURE) || (MXMLAddE(E, C) == FAILURE)) { break; } ptr = tail; if ((ptr == NULL) || (ptr[0] == '\0')) { /* XML is corrupt */ if (Tail != NULL) *Tail = ptr; if ((EMsg != NULL) && (EMsg[0] == '\0')) strcpy(EMsg, "cannot extract child"); return(FAILURE); } } /* END while (ptr[1] != '/') */ /* ignore whitespace */ while (isspace(*ptr)) ptr++; /* process tail */ if (*ptr == '/') { /* process '/>' */ ptr++; /* ignore '/' */ } else { ptr++; /* ignore '<' */ ptr++; /* ignore '/' */ ptr += strlen(E->Name); } ptr++; /* ignore '>' */ if (Tail != NULL) *Tail = ptr; return(SUCCESS); } /* END MXMLFromString() */ /* END MXML.c */ torque-2.4.16/src/cmds/qterm.c0000664000113300011330000002012711272401236013045 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qterm * The qterm command terminates the batch server. * * Synopsis: * qterm -t type [server ...] * * Options: * -t delay Jobs are (1) checkpointed if possible; otherwise, (2) jobs are * rerun (requeued) if possible; otherwise, (3) jobs are left to * run. * * immediate * Jobs are (1) checkpointed if possible; otherwise, (2) jobs are * rerun if possible; otherwise, (3) jobs are aborted. * * quick * The server will save state and exit leaving running jobs * still running. Good for shutting down when you wish to * quickly restart the server. * * Arguments: * server ... * A list of servers to terminate. * * Written by: * Bruce Kelly * National Energy Research Supercomputer Center * Livermore, CA * May, 1993 */ #include "cmds.h" #include /* the master config generated by configure */ int exitstatus = 0; /* Exit Status */ static void execute(int, char *); int main( int argc, /* I */ char **argv) /* I */ { /* * This routine sends a Server Shutdown request to the batch server. If the * batch request is accepted, and the type is IMMEDIATE, then no more jobs * are accepted and all jobs are checkpointed or killed. If the type is * DELAY, then only privileged users can submit jobs, and jobs will be * checkpointed if available. */ static char opts[] = "t:"; /* See man getopt */ int s; /* The execute line option */ static char usage[] = "Usage: qterm [-t immediate|delay|quick] [server ...]\n"; char *type = NULL; /* Pointer to the type of termination */ int manner; /* The type of termination */ int errflg = 0; /* Error flag */ /* Command line options */ while ((s = getopt(argc, argv, opts)) != EOF) { switch (s) { case 't': type = optarg; break; case '?': default: errflg++; break; } } /* END while() */ if (errflg) { fprintf(stderr, "%s", usage); exit(1); } if (type == NULL) { /* use 'quick' as default */ manner = SHUT_QUICK; } else { if (!strcasecmp(type, "delay")) { manner = SHUT_DELAY; } else if (!strcasecmp(type, "immediate")) { manner = SHUT_IMMEDIATE; } else if (!strcasecmp(type, "quick")) { manner = SHUT_QUICK; } else { /* invalid type specified */ fprintf(stderr, "%s", usage); exit(1); } } if (optind < argc) { /* shutdown each specified server */ for (;optind < argc;optind++) { execute(manner, argv[optind]); } } else { /* shutdown default server */ execute(manner, ""); } exit(exitstatus); /*NOTREACHED*/ return(0); } /* END main() */ /* * void execute(int manner,char *server) * * manner The manner in which to terminate the server. * server The name of the server to terminate. * * Returns: * None * * File Variables: * exitstatus Set to two if an error occurs. */ static void execute( int manner, /* I */ char *server) /* I */ { int ct; /* Connection to the server */ int err; /* Error return from pbs_terminate */ char *errmsg; /* Error message from pbs_terminate */ if ((ct = cnt2server(server)) > 0) { err = pbs_terminate(ct, manner, NULL); if (err != 0) { errmsg = pbs_geterrmsg(ct); if (errmsg != NULL) { fprintf(stderr, "qterm: %s", errmsg); } else { fprintf(stderr, "qterm: Error (%d - %s) terminating server ", pbs_errno, pbs_strerror(pbs_errno)); } fprintf(stderr, "%s\n", server); exitstatus = 2; } pbs_disconnect(ct); } else { /* FAILURE */ fprintf(stderr, "qterm: could not connect to server '%s' (%d) %s\n", server, pbs_errno, pbs_strerror(pbs_errno)); exitstatus = 2; } return; } /* END execute() */ torque-2.4.16/src/cmds/qsub.c0000664000113300011330000027653311556046065012717 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qsub - (PBS) submit batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef sun #include #endif /* sun */ #if defined(HAVE_SYS_IOCTL_H) #include #endif /* HAVE_SYS_IOCTL_H */ #if defined(HAVE_SYS_TTY_H) #include #endif #if defined(FD_SET_IN_SYS_SELECT_H) # include #endif #include "cmds.h" #include "net_connect.h" #include "log.h" #include "port_forwarding.h" /* DefaultFilterPath is used to fall back on in order to maintain backwards compatibility. the new preferred path for the submit filter is ${libexecdir}/qsub_filter */ /* NOTE: submitfilter specified using SUBMITFILTER in $TORQUEHOME/torque.cfg */ static char *DefaultFilterPath = "/usr/local/sbin/torque_submitfilter"; static char *DefaultXauthPath = XAUTH_PATH; #define SUBMIT_FILTER_ADMIN_REJECT_CODE -1 #define MAX_QSUB_PREFIX_LEN 32 static char PBS_DPREFIX_DEFAULT[] = "#PBS"; char PBS_Filter[256]; char PBS_InitDir[256]; char PBS_RootDir[256]; char PBS_WorkDir[256]; char xauth_path[256]; char default_ckpt[256]; int validate_path = 1; int rerunnable_by_default = 1; int fault_tolerant_by_default = 0; int interactivechild = 0; int x11child = 0; int do_dir(char *); int process_opts(int, char **, int); int have_terminal = TRUE; int validate_group = FALSE; char *checkpoint_strings = "n,c,s,u,none,shutdown,periodic,enabled,interval,depth,dir"; /* adapted from openssh */ static char *x11_get_proto( char *EMsg) /* O (optional,minsize=1024) */ { char line[512]; char proto[512], data[512], screen[512]; char *authstring; FILE *f; int got_data = 0; char *display, *p; struct stat st; proto[0] = '\0'; data[0] = '\0'; screen[0] = '\0'; if (EMsg != NULL) EMsg[0] = '\0'; if ((display = getenv("DISPLAY")) == NULL) { fprintf(stderr, "qsub: DISPLAY not set\n"); return(NULL); } if (stat(xauth_path, &st)) { perror("qsub: xauth: "); return(NULL); } /* Try to get Xauthority information for the display. */ if (strncmp(display, "localhost:", 10) == 0) { /* * Handle FamilyLocal case where $DISPLAY does * not match an authorization entry. For this we * just try "xauth list unix:displaynum.screennum". * XXX: "localhost" match to determine FamilyLocal * is not perfect. */ snprintf(line, sizeof(line), "%s list unix:%s 2>/dev/null", xauth_path, display + 10); } else { snprintf(line, sizeof(line), "%s list %.200s 2>/dev/null", xauth_path, display); } p = strchr(display, ':'); if (p != NULL) p = strchr(p, '.'); if (p != NULL) strncpy(screen, p + 1, sizeof(screen)); else strcpy(screen, "0"); if (getenv("PBSDEBUG") != NULL) fprintf(stderr, "x11_get_proto: %s\n", line); f = popen(line, "r"); if (f == NULL) { fprintf(stderr, "execution of '%s' failed, errno=%d (%s)\n", line, errno, pbs_strerror(errno)); } else if (fgets(line, sizeof(line), f) == 0) { fprintf(stderr, "cannot read data from '%s', errno=%d (%s)\n", line, errno, pbs_strerror(errno)); } else if (sscanf(line, "%*s %511s %511s", proto, data) != 2) { fprintf(stderr, "cannot parse output from '%s'\n", line); } else { /* SUCCESS */ got_data = 1; } if (f != NULL) pclose(f); #if 0 /* we aren't inspecting the returned xauth data yet */ /* * If we didn't get authentication data, just make up some * data. The forwarding code will check the validity of the * response anyway, and substitute this data. The X11 * server, however, will ignore this fake data and use * whatever authentication mechanisms it was using otherwise * for the local connection. */ if (!got_data) { u_int32_t _rand = 0; int i; fprintf(stderr, "Warning: No xauth data; using fake authentication data for X11 forwarding.\n"); strncpy(proto, "MIT-MAGIC-COOKIE-1", sizeof proto); for (i = 0; i < 16; i++) { if (i % 4 == 0) _rand = rand(); snprintf(data + 2 * i, sizeof data - 2 * i, "%02x", _rand & 0xff); _rand >>= 8; } } #endif if (!got_data) { /* FAILURE */ return(NULL); } authstring = malloc(strlen(proto) + strlen(data) + strlen(screen) + 4); if (authstring == NULL) { /* FAILURE */ return(NULL); } sprintf(authstring, "%s:%s:%s", proto, data, screen); return(authstring); } /* END x11_get_proto() */ char *smart_strtok( char *line, /* I */ char *delims, /* I */ char **ptrPtr, /* O */ int ign_backslash) /* I */ { char *head = NULL; char *start = NULL; int dindex; int ignchar; int ignore; int sq_count = 0; int dq_count = 0; int sb_count = 0; char *tmpLine = NULL; int tmpLineSize; int tindex; char *ptr; if (line != NULL) { *ptrPtr = line; } else if (ptrPtr == NULL) { /* FAILURE */ return(head); } start = *ptrPtr; tmpLineSize = (line == NULL) ? strlen(*ptrPtr) + 1 : strlen(line) + 1; tmpLine = (char *)malloc(tmpLineSize * sizeof(char)); tmpLine[0] = '\0'; tindex = 0; ignchar = FALSE; ptr = *ptrPtr; while (*ptr != '\0') { if (*ptr == '\'') { sq_count++; if ((head != NULL) && !(sq_count % 2) && !(dq_count % 2)) { ptr++; ignchar = TRUE; } else { ignore = TRUE; if (ign_backslash == TRUE) { /* check if backslash precedes delimiter */ if ((ptr > start) && (*(ptr-1) == '\\')) { /* check if backslash is backslashed */ if ((ptr > start + 1) && (*(ptr-2) != '\\')) { /* delimiter is backslashed, ignore */ ignore = FALSE; sq_count--; } } } if (ignore == TRUE) { ptr++; ignchar = TRUE; } } } else if (*ptr == '\"') { dq_count++; if ((head != NULL) && !(sq_count % 2) && !(dq_count % 2)) { ptr++; ignchar = TRUE; } else { ignore = TRUE; if (ign_backslash == TRUE) { /* check if backslash precedes delimiter */ if ((ptr > start) && (*(ptr-1) == '\\')) { /* check if backslash is backslashed */ if ((ptr > start + 1) && (*(ptr-2) != '\\')) { /* delimiter is backslashed, ignore */ ignore = FALSE; dq_count--; } } } if (ignore == TRUE) { ptr++; ignchar = TRUE; } } } else if (*ptr == '[' ) { sb_count = 1; } else if (*ptr == ']') { sb_count = 0; } else if (*ptr == '{') { sb_count = 1; } else if (*ptr == '}') { sb_count = 0; } else if (!(sq_count % 2) && !(dq_count % 2) && (sb_count == 0)) { /* not in quotations, locate delimiter */ for (dindex = 0; delims[dindex] != '\0'; dindex++) { if (*ptr != delims[dindex]) continue; if ((ign_backslash == TRUE) && (head != NULL)) { /* check if backslash precedes delimiter */ if ((ptr > head) && (*(ptr-1) == '\\')) { /* check if backslash is backslashed */ if ((ptr > head + 1) && (*(ptr-1) != '\\')) { /* delimiter is backslashed, ignore */ continue; } } } /* delimiter found */ *ptr = '\0'; ptr++; if (head != NULL) { *ptrPtr = ptr; tmpLine[tindex] = '\0'; if (tindex > 0) strcpy(head,tmpLine); free(tmpLine); return(head); } ignchar = TRUE; break; } /* END for (dindex) */ } if ((ignchar != TRUE) && (*ptr != '\0')) { if (head == NULL) head = ptr; tmpLine[tindex++] = ptr[0]; ptr++; } ignchar = FALSE; } /* END while (*ptr != '\0') */ tmpLine[tindex] = '\0'; if (tindex > 0) strcpy(head,tmpLine); free(tmpLine); *ptrPtr = ptr; return(head); } /* END smarter_strtok */ int get_name_value(start, name, value) char *start; char **name; char **value; { static char *tok_ptr; char *curr_ptr; char *equals; /* we've reached the end */ if ((start == NULL) && (*tok_ptr == '\0')) return(0); curr_ptr = smart_strtok(start,",",&tok_ptr,FALSE); if ((curr_ptr == NULL)) return(0); if ((*curr_ptr == '=') || (*curr_ptr == '\0')) { /* no name, fail */ return(-1); } /* skip leading spaces */ while (isspace((int)*curr_ptr) && (*curr_ptr)) curr_ptr++; *name = curr_ptr; equals = *name; /* skip over name */ while ((*equals) && (!isspace((int)*equals)) && (*equals != '=')) equals++; /* strip blanks */ while ((*equals) && (isspace((int)*equals))) *equals++ = '\0'; if (*equals != '=') return (-1); /* should have found a = as first non blank */ *equals++ = '\0'; /* skip leading white space */ while (isspace((int)*equals) && *equals) equals++; if (*equals == '\0') return(-1); *value = equals; return (1); } char *set_dir_prefix( char *prefix, int diropt) { char *s; if (notNULL(prefix)) { return(prefix); } if (diropt == TRUE) { return(""); } if ((s = getenv("PBS_DPREFIX")) != NULL) { return(s); } return(PBS_DPREFIX_DEFAULT); } /* END set_dir_prefix() */ int isexecutable( char *s) /* I */ { char *c; c = s; if ((*c == ':') || ((*c == '#') && (*(c + 1) == '!'))) { return(FALSE); } while (isspace(*c)) c++; if (notNULL(c)) { return(*c != '#'); } return(FALSE); } char *ispbsdir( char *s, char *prefix) { char *it; int l; it = s; while (isspace(*it)) it++; l = strlen(prefix); if ((l > 0) && (strncmp(it, prefix, l) == 0)) { return(it + l); } return((char *)NULL); } #define MMAX_VERIFY_BYTES 50 int istext( FILE *fd, /* I */ int *IsText) /* O (optional) */ { int i; int c; if (IsText != NULL) *IsText = FALSE; if (fd == NULL) { return(0); } if (fd == stdin) { return(1); } /* read first characters to ensure this is ASCII text */ for (i = 0;i < MMAX_VERIFY_BYTES;i++) { c = fgetc(fd); if (c == EOF) break; if (!isprint(c) && !isspace(c)) { fseek(fd, 0, SEEK_SET); return(0); } } /* END for (i) */ if (IsText != NULL) *IsText = TRUE; fseek(fd, 0, SEEK_SET); return(1); } /* END FileIsText() */ /* return 3, 4, 5, 6, -1 on FAILURE, 0 on success */ int get_script( int ArgC, /* I */ char **ArgV, /* I */ FILE *file, /* I */ char *script, /* O (minsize=X) */ char *prefix) /* I */ { char s[MAX_LINE_LEN + 1]; char *sopt; int exec = FALSE; char *cont; char tmp_name[] = "/tmp/qsub.XXXXXX"; FILE *TMP_FILE; char *in; int tmpfd; int index; /* START WRAPPER */ char cfilter[MAXPATHLEN + 1024]; char tmp_name2[] = "/tmp/qsub.XXXXXX"; struct stat sfilter; FILE *filesaved; FILE *filter_pipe; int rc; /* if the submitfilter exists, run it. */ /* check that the file is text */ if (istext(file, NULL) == 0) { fprintf(stderr, "qsub: file must be an ascii script\n"); return(4); } if (stat(PBS_Filter, &sfilter) != -1) { /* run the copy through the submit filter. */ if ((tmpfd = mkstemp(tmp_name2)) < 0) { fprintf(stderr, "qsub: could not create filter o/p %s\n", tmp_name2); return(4); } close(tmpfd); strcpy(cfilter, PBS_Filter); for (index = 1;index < ArgC;index++) { if (ArgV[index] != NULL) { strcat(cfilter, " "); strcat(cfilter, ArgV[index]); } } /* END for (index) */ strcat(cfilter, " >"); strcat(cfilter, tmp_name2); filter_pipe = popen(cfilter, "w"); while ((in = fgets(s, MAX_LINE_LEN, file)) != NULL) { if (fputs(in, filter_pipe) < 0) { fprintf(stderr, "qsub: error writing to filter stdin\n"); fclose(filter_pipe); unlink(tmp_name2); return(3); } } rc = pclose(filter_pipe); if (WEXITSTATUS(rc) == (unsigned char)SUBMIT_FILTER_ADMIN_REJECT_CODE) { fprintf(stderr, "qsub: Your job has been administratively rejected by the queueing system.\n"); fprintf(stderr, "qsub: There may be a more detailed explanation prior to this notice.\n"); unlink(tmp_name2); return(3); } if (WEXITSTATUS(rc)) { fprintf(stderr, "qsub: submit filter returned an error code, aborting job submission.\n"); unlink(tmp_name2); return(3); } /* get rid of the i/p copy. */ /* preserve the original pointer. */ filesaved = file; /* open the filtered script. */ if ((file = fopen(tmp_name2, "r")) == NULL) { fprintf(stderr, "qsub: could not open filter o/p %s\n", tmp_name2); unlink(tmp_name2); file = filesaved; return(3); } /* Get rid of the filtered o/p; data remains accessible until */ /* file is closed. */ unlink(tmp_name2); /* Complete redirection. */ fclose(filesaved); } /* END if (stat(PBS_Filter,&sfilter) != -1) */ /* END WRAPPER */ if ((tmpfd = mkstemp(tmp_name)) < 0) { fprintf(stderr, "qsub: could not create copy of script %s\n", tmp_name); return(4); } if ((TMP_FILE = fdopen(tmpfd, "w+")) == NULL) { fprintf(stderr, "qsub: could not create copy of script %s\n", tmp_name); unlink(tmp_name); return(4); } while ((in = fgets(s, MAX_LINE_LEN, file)) != NULL) { int len; /* replace DOS EOL ('^M') characters */ len = strlen(in); if ((len >= 2) && (in[len - 2] == '\r') && (in[len - 1] == '\n')) { in[len - 2] = '\n'; in[len - 1] = '\0'; } if (!exec && ((sopt = ispbsdir(s, prefix)) != NULL)) { while ((*(cont = in + strlen(in) - 2) == '\\') && (*(cont + 1) == '\n')) { /* next line is continuation of this line */ *cont = '\0'; /* clear newline from our copy */ if (fputs(in, TMP_FILE) < 0) { fprintf(stderr, "qsub: error writing copy of script, %s\n", tmp_name); fclose(TMP_FILE); unlink(tmp_name); return(3); } in = cont; if ((in = fgets(in, MAX_LINE_LEN - (in - s), file)) == NULL) { fprintf(stderr, "qsub: unexpected end-of-file or read error in script\n"); fclose(TMP_FILE); unlink(tmp_name); return(6); } } /* END while ((*(cont = in + strlen(in) - 2) == '\\') && (*(cont + 1) == '\n')) */ if (do_dir(sopt) != 0) { return(-1); } } /* END if (!exec && ((sopt = ispbsdir(s,prefix)) != NULL)) */ else if (!exec && isexecutable(s)) { exec = TRUE; } if (fputs(in, TMP_FILE) < 0) { fprintf(stderr, "qsub: error writing copy of script, %s\n", tmp_name); fclose(TMP_FILE); unlink(tmp_name); return(3); } } /* END while ((in = fgets(s,MAX_LINE_LEN,file)) != NULL) */ fclose(TMP_FILE); if (ferror(file)) { fprintf(stderr, "qsub: error reading script file\n"); return(5); } strcpy(script, tmp_name); return(0); } /* END get_script() */ void make_argv( int *argc, char *argv[], char *line) { char *l, *b, *c, *buffer; int len; char quote; buffer = malloc(strlen(line) + 1); if (buffer == NULL) { fprintf(stderr, "qsub: out of memory\n"); exit(2); } *argc = 0; argv[(*argc)++] = "qsub"; l = line; b = buffer; while (isspace(*l)) l++; c = l; while (*c != '\0') { if ((*c == '"') || (*c == '\'')) { if ((*c == '\'') && (strchr(c+1,'\'') == NULL) && (!strcmp(argv[*argc-1],"-M"))) { /* if this is an email list and it has a single quote, this is a legal character, * so allow unmatched quotes as part of the qsub */ *b++ = *c++; } else { quote = *c; c++; while ((*c != quote) && *c) *b++ = *c++; if (*c == '\0') { fprintf(stderr, "qsub: unmatched %c\n", *c); exit(1); } c++; } } else if (*c == '\\') { c++; *b++ = *c++; } else if (isspace(*c)) { len = c - l; assert(len > 0); if (argv[*argc] != NULL) free(argv[*argc]); argv[*argc] = (char *)malloc(len + 1); if (argv[*argc] == NULL) { fprintf(stderr, "qsub: out of memory\n"); exit(2); } *b = '\0'; strcpy(argv[(*argc)++], buffer); while (isspace(*c)) c++; l = c; b = buffer; } else { *b++ = *c++; } } if (c != l) { len = c - l; assert(len > 0); if (argv[*argc] != NULL) free(argv[*argc]); argv[*argc] = (char *) malloc(len + 1); if (argv[*argc] == NULL) { fprintf(stderr, "qsub: out of memory\n"); exit(2); } *b = '\0'; strcpy(argv[(*argc)++], buffer); } free(buffer); return; } /* END make_argv() */ int do_dir( char *opts) { static int opt_pass = 1; int argc; #define MAX_ARGV_LEN 128 static char *vect[MAX_ARGV_LEN + 1]; if (opt_pass == 1) { argc = 0; while (argc < MAX_ARGV_LEN + 1) vect[argc++] = NULL; } make_argv(&argc, vect, opts); return(process_opts(argc, vect, opt_pass++)); } /* END do_dir() */ /* globals */ int inter_sock = -1; struct termios oldtio; struct attrl *attrib = NULL; char *new_jobname; /* return from submit request */ char dir_prefix[MAX_QSUB_PREFIX_LEN + 1]; char path_out[MAXPATHLEN + 1]; char destination[PBS_MAXDEST]; static char server_out[PBS_MAXSERVERNAME + PBS_MAXPORTNUM + 2]; char server_host[PBS_MAXHOSTNAME + 1]; char qsub_host[PBS_MAXHOSTNAME + 1]; char owner_uid[MAXPATHLEN + 1]; long cnt2server_retry = -100; /* state booleans for protecting already-set options */ int a_opt = FALSE; int b_opt = FALSE; int c_opt = FALSE; int e_opt = FALSE; int f_opt = FALSE; int h_opt = FALSE; int j_opt = FALSE; int k_opt = FALSE; int l_opt = FALSE; int m_opt = FALSE; int o_opt = FALSE; int p_opt = FALSE; int q_opt = FALSE; int r_opt = FALSE; int t_opt = FALSE; int T_opt = FALSE; int u_opt = FALSE; int v_opt = FALSE; int z_opt = FALSE; int A_opt = FALSE; int C_opt = FALSE; int F_opt = FALSE; int M_opt = FALSE; int N_opt = FALSE; int S_opt = FALSE; int V_opt = FALSE; int Depend_opt = FALSE; int Interact_opt = FALSE; int Run_Inter_opt = FALSE; int Stagein_opt = FALSE; int Stageout_opt = FALSE; int Grouplist_opt = FALSE; int Forwardx11_opt = FALSE; int Umask_opt = FALSE; char *v_value = NULL; char *copy_env_value( char *dest, /* destination */ char *pv, /* value string */ int quote_flg) /* non-zero then assume single word (quoting on) */ { int go = 1; int q_ch = 0; while (*dest) ++dest; while (go && *pv) { switch (*pv) { case '"': case '\'': if (q_ch) { /* local quoting is in progress */ if (q_ch == (int)*pv) { q_ch = 0; /* end quote */ } else { *dest++ = '\\'; /* escape quote */ *dest++ = *pv; } } else if (quote_flg) { /* global quoting is on */ *dest++ = '\\'; /* escape quote */ *dest++ = *pv; } else { q_ch = (int) * pv; /* turn local quoting on */ } break; case '\\': *dest++ = '\\'; /* escape back-slash */ *dest++ = *pv; break; case '\n': *dest++ = '\\'; /* escape newline */ *dest++ = *pv; break; case ',': if (q_ch || quote_flg) { *dest++ = '\\'; *dest++ = *pv; } else { go = 0; /* end of value string */ } break; default: *dest++ = *pv; break; } pv++; } /* END while (go && *pv) */ *dest = '\0'; if (q_ch) return(NULL); /* error-unterminated quote */ return(pv); } int set_job_env( char **envp) /* I */ { char **evp; char *job_env; char *s, *c, *env, l; unsigned len; int rc = 0; int eindex; const char *EList[] = { "HOME", "LANG", "LOGNAME", "MAIL", "PATH", "SHELL", "TZ", NULL }; /* Calculate how big to make the variable string. */ len = PBS_MAXHOSTNAME * 2 + MAXPATHLEN; if (v_opt) { len += strlen(v_value); } if (V_opt) { evp = envp; while (notNULL(*evp)) { /* add 1 for ',' */ len += strlen(*evp) + 1; evp++; } } for (eindex = 0;EList[eindex] != NULL;eindex++) { env = getenv(EList[eindex]); if (env == NULL) continue; /* prepend 'PBS_O_' to each var and add '2' for ',' and '=' */ len += strlen(env) + strlen(EList[eindex]) + strlen("PBS_O_") + 2; } /* END for (eindex) */ if (PBS_InitDir[0] != '\0') { len += strlen("PBS_O_INITDIR=") + strlen(PBS_InitDir) + 1; } if (PBS_RootDir[0] != '\0') { len += strlen("PBS_O_ROOTDIR=") + strlen(PBS_RootDir) + 1; } if (PBS_WorkDir[0] != '\0') { len += strlen("PBS_O_WORKDIR=") + strlen(PBS_WorkDir) + 1; } len += strlen("PBS_SERVER=") + 1; len++; /* Terminating '0' */ if ((job_env = (char *)malloc(len)) == NULL) { return(FALSE); } *job_env = '\0'; /* Send the required variables with the job. */ c = getenv("HOME"); strcat(job_env, "PBS_O_HOME="); if (c != NULL) strcat(job_env, c); else strcat(job_env, "/"); c = getenv("LANG"); if (c != NULL) { strcat(job_env, ",PBS_O_LANG="); strcat(job_env, c); } c = getenv("LOGNAME"); if (c != NULL) { strcat(job_env, ",PBS_O_LOGNAME="); strcat(job_env, c); } c = getenv("PATH"); if (c != NULL) { strcat(job_env, ",PBS_O_PATH="); strcat(job_env, c); } c = getenv("MAIL"); if (c != NULL) { strcat(job_env, ",PBS_O_MAIL="); strcat(job_env, c); } c = getenv("SHELL"); if (c != NULL) { strcat(job_env, ",PBS_O_SHELL="); strcat(job_env, c); } c = getenv("TZ"); if (c != NULL) { strcat(job_env, ",PBS_O_TZ="); strcat(job_env, c); } /* * Commented out by dbeer * This isn't a reliable way to find the hostname because it doesn't * account for the interface over which the connection is happening, * or any aliasing on that interface. Letting the server discover * PBS_O_HOST works better and the code is already there. * * Unless you are certain CRAY sites that want this value for PBS_O_HOST */ #ifdef QSUBHOSTNAME if (qsub_host[0] != '\0' || (rc = gethostname(qsub_host, PBS_MAXHOSTNAME + 1)) == 0) { if ((rc = get_fullhostname(qsub_host, qsub_host, PBS_MAXHOSTNAME, NULL)) == 0) { strcat(job_env, ",PBS_O_HOST="); strcat(job_env, qsub_host); } } #endif if (rc != 0) { fprintf(stderr, "qsub: cannot get (full) local host name\n"); exit(3); } if (server_host[0] != '\0') { if (get_fullhostname(server_host, server_host, PBS_MAXHOSTNAME, NULL) == 0) { strcat(job_env,",PBS_SERVER="); strcat(job_env,server_host); } else { fprintf(stderr,"qsub: cannot get full server host name\n"); exit(3); } } else { c = pbs_default(); if (*c != '\0') { strncpy(server_host, c, sizeof(server_host)); strcat(job_env,",PBS_SERVER="); strcat(job_env,server_host); } else { strcat(job_env,",PBS_SERVER="); strcat(job_env,qsub_host); } } if (owner_uid[0] != '\0') { strcat(job_env, ",PBS_O_UID="); strcat(job_env, owner_uid); } /* load init dir into env if specified */ if (PBS_InitDir[0] != '\0') { /* load init dir into env */ strcat(job_env, ",PBS_O_INITDIR="); strcat(job_env, PBS_InitDir); } if (PBS_RootDir[0] != '\0') { /* load init dir into env */ strcat(job_env, ",PBS_O_ROOTDIR="); strcat(job_env, PBS_RootDir); } /* get current working directory, use $PWD if available, it is more */ /* NFS automounter "friendly". But must double check that is right */ /* load work dir into env if specified */ if (PBS_WorkDir[0] != '\0') { /* load work dir into env */ strcat(job_env, ",PBS_O_WORKDIR="); strcat(job_env, PBS_WorkDir); } else { s = job_env + strlen(job_env); strcat(job_env, ",PBS_O_WORKDIR="); c = getenv("PWD"); if (c != NULL) { struct stat statbuf; dev_t dev; ino_t ino; if (stat(c, &statbuf) < 0) { c = NULL; /* cannot stat, cannot trust it */ } else { dev = statbuf.st_dev; ino = statbuf.st_ino; if (stat(".", &statbuf) < 0) { /* compare against "." */ perror("qsub: cannot stat current directory: "); exit(3); } if (!memcmp(&dev, &statbuf.st_dev, sizeof(dev_t)) && !memcmp(&ino, &statbuf.st_ino, sizeof(ino_t))) { strcat(job_env, c); } else { c = NULL; } } } /* END if (c != NULL) */ if (c == NULL) { /* fall back to using the cwd */ c = job_env + strlen(job_env); if (getcwd(c, MAXPATHLEN + 1) == NULL) *s = '\0'; } } /* Send these variables with the job. */ /* POSIX requirement: If a variable is given without a value, supply the value from the environment. */ /* MY requirement: There can be no white space in -v value. */ if (v_opt) { c = v_value; state1: /* goto label : Initial state comes here */ switch (*c) { case ',': case '=': return FALSE; /*NOTREACHED*/ break; case '\0': goto final; /*NOTRREACHED*/ break; } s = c; /* pass through to next case */ state2: /* goto label : Variable name */ switch (*c) { case ',': case '\0': goto state3; /*NOTREACHED*/ break; case '=': /* if we just have the '=' and no value after it then we look in the environment same as if the '=' was not there */ if ((c[1] == ',') || (c[1] == '\0')) { *c = '\0'; c++; goto state3; /*NOTREACHED*/ } goto state4; /*NOTREACHED*/ break; default: c++; goto state2; /*NOTREACHED*/ break; } /* END switch (*c) */ state3: /* No value - get it from qsub environment */ l = *c; *c = '\0'; env = getenv(s); if (env == NULL) { env = ""; } if (strlen(job_env) + 2 + strlen(s) + 2*strlen(env) >= len) { /* increase size of job env buffer */ len += 2 * strlen(env) + 1; job_env = (char *)realloc(job_env, len); if (job_env == NULL) { return(FALSE); } } strcat(job_env, ","); strcat(job_env, s); strcat(job_env, "="); if (copy_env_value(job_env, env, 1) == NULL) { return(FALSE); } if (l == ',') c++; goto state1; state4: /* goto label - Value specified */ *c++ = '\0'; if (strlen(job_env) + 2 + strlen(s) + 2*strlen(c) >= len) { /* increase size of job env buffer */ len += 2 * strlen(c) + 1; job_env = (char *)realloc(job_env, len); if (job_env == NULL) { return(FALSE); } } strcat(job_env, ","); strcat(job_env, s); strcat(job_env, "="); if ((c = copy_env_value(job_env, c, 0)) == NULL) { return(FALSE); } goto state1; } /* END if (v_opt) */ final: if (V_opt != 0) { /* Send every environment variable with the job. */ evp = envp; while (notNULL(*evp)) { s = *evp; while ((*s != '=') && *s) ++s; if (!*s) { evp++; continue; } *s = '\0'; /* NOTE: *s is clobbering our current, real, environ */ if (strlen(job_env) + 2 + strlen(*evp) + 2*strlen(s + 1) >= len) { /* increase size of job env buffer */ len += 2 * strlen(s + 1) + 1; job_env = (char *)realloc(job_env, len); if (job_env == NULL) { *s = '='; /* restore our existing environ */ return(FALSE); } } strcat(job_env, ","); strcat(job_env, *evp); strcat(job_env, "="); copy_env_value(job_env, s + 1, 1); *s = '='; /* restore our existing environ */ evp++; } } /* END if (V_opt) */ set_attr(&attrib, ATTR_v, job_env); free(job_env); return(TRUE); } /* END set_job_env() */ /* * The following bunch of functions support the "Interactive Job" * capability of PBS. */ /* * interactive_port - get a socket to listen to for "interactive" job * When the "interactive" job is run, its standard in, out, and error * will be connected to this socket. */ char *interactive_port(int *sock) { torque_socklen_t namelen; static char portstring[8]; struct sockaddr_in myaddr; unsigned short port; *sock = socket(AF_INET, SOCK_STREAM, 0); if (*sock < 0) { perror("qsub: unable to obtain socket"); exit(1); } namelen = sizeof(myaddr); myaddr.sin_family = AF_INET; myaddr.sin_addr.s_addr = INADDR_ANY; myaddr.sin_port = 0; if (bind(*sock, (struct sockaddr *)&myaddr, namelen) < 0) { perror("qsub: unable to bind to socket"); exit(1); } /* get port number assigned */ if (getsockname(*sock, (struct sockaddr *)&myaddr, &namelen) < 0) { perror("qsub: unable to get port number"); exit(1); } port = ntohs(myaddr.sin_port); sprintf(portstring, "%u", (unsigned int)port); if (listen(*sock, 1) < 0) { perror("qsub: listen on interactive socket"); exit(1); } return(portstring); } /* END interactive_port() */ /* * settermraw - set terminal into "raw" mode */ void settermraw( struct termios *ptio) { struct termios tio; tio = *ptio; tio.c_lflag &= ~(ICANON | ISIG | ECHO | ECHOE | ECHOK); tio.c_iflag &= ~(IGNBRK | INLCR | ICRNL | IXON | IXOFF); tio.c_oflag = 0; tio.c_oflag |= (OPOST); /* TAB3 */ tio.c_cc[VMIN] = 1; tio.c_cc[VTIME] = 0; #if defined(TABDLY) && defined(TAB3) if ((tio.c_oflag & TABDLY) == TAB3) tio.c_oflag &= ~TABDLY; #endif tio.c_cc[VKILL] = -1; tio.c_cc[VERASE] = -1; if (tcsetattr(0, TCSANOW, &tio) < 0) perror("qsub: set terminal mode"); return; } /* END settermraw() */ /* * stopme - suspend process on ~^Z or ~^Y * on suspend, reset terminal to normal "cooked" mode; * when resumed, again set terminal to raw. */ void stopme( pid_t p) /* pid of 0 (process group) or just myself (writer) */ { tcsetattr(0, TCSANOW, &oldtio); /* reset terminal */ kill(p, SIGTSTP); settermraw(&oldtio); /* back to raw when we resume */ return; } /* * Interactive Reader process: reads from the remote socket, * and writes that out to the stdout */ int reader( int s, /* I - reading socket */ int d) /* I - writing socket */ { char buf[4096]; int c; char *p; int wc; /* read from the socket, and write to d */ /* NOTE: s should be blocking */ while (1) { c = read(s, buf, sizeof(buf)); if (c > 0) { p = buf; while (c) { if ((wc = write(d, p, c)) < 0) { if (errno == EINTR) { continue; } perror("qsub: write error"); return(-1); } c -= wc; p += wc; } } else if (c == 0) { return(0); /* EOF - all done */ } else { if (errno == EINTR) continue; if (errno == EAGAIN) { sleep(1); continue; } perror("qsub: read error"); return(-1); } } /* END while (1) */ return(0); } /* END reader() */ /* * Writer process: reads from stdin, and writes * data out to the rem socket */ void writer( int s, /* writing socket */ int d) /* reader socket */ { char c; int i; int newline = 1; char tilde = '~'; int wi; /* read from stdin, and write to the socket */ while (1) { i = read(d, &c, 1); if (i > 0) { /* read data */ if (newline) { if (c == tilde) { /* maybe escape character */ /* read next character to check */ while ((i = read(d, &c, 1)) != 1) { if ((i == -1) && (errno == EINTR)) continue; break; } if (i != 1) break; if (c == '.') /* termination character */ break; if (c == oldtio.c_cc[VSUSP]) { stopme(0); /* ^Z suspend all */ continue; #ifdef VDSUSP } else if (c == oldtio.c_cc[VDSUSP]) { stopme(getpid()); continue; #endif /* VDSUSP */ } else { /* not escape, write out tilde */ while ((wi = write(s, &tilde, 1)) != 1) { if ((wi == -1) && (errno == EINTR)) continue; break; } if (wi != 1) break; } } newline = 0; /* no longer at start of line */ } else { /* reset to newline if \n \r kill or interrupt */ newline = (c == '\n') || (c == oldtio.c_cc[VKILL]) || (c == oldtio.c_cc[VINTR]) || (c == '\r'); } while ((wi = write(s, &c, 1)) != 1) { /* write out character */ if ((wi == -1) && (errno == EINTR)) continue; break; } if (wi != 1) break; } else if (i == 0) { /* EOF */ break; } else if (i < 0) { /* error */ if (errno == EAGAIN) { sleep(1); continue; } if (errno == EAGAIN) { sleep(1); continue; } if (errno != EINTR) { perror("qsub: read error"); return; } } } /* END while (1) */ return; } /* END writer() */ /* * getwinsize - get the current window size */ int getwinsize( struct winsize *wsz) { if (ioctl(0, TIOCGWINSZ, wsz) < 0) { perror("qsub: unable to get window size"); return(-1); } return(0); } /* * send_winsize = send the current tty's window size */ void send_winsize( int sock, struct winsize *wsz) { char buf[PBS_TERM_BUF_SZ]; sprintf(buf, "WINSIZE %hu,%hu,%hu,%hu", wsz->ws_row, wsz->ws_col, wsz->ws_xpixel, wsz->ws_ypixel); if (write(sock, buf, PBS_TERM_BUF_SZ) != PBS_TERM_BUF_SZ) { perror("sending winsize"); exit(2); } return; } /* * send_term - send the current TERM type and certain control characters */ void send_term( int sock) { char buf[PBS_TERM_BUF_SZ]; char *term; char cc_array[PBS_TERM_CCA]; strcpy(buf, "TERM="); term = getenv("TERM"); if (term == NULL) strcat(buf, "unknown"); else strncat(buf, term, PBS_TERM_BUF_SZ - 5); if (write(sock, buf, PBS_TERM_BUF_SZ) != PBS_TERM_BUF_SZ) { perror("sending term type"); exit(2); } cc_array[0] = oldtio.c_cc[VINTR]; cc_array[1] = oldtio.c_cc[VQUIT]; cc_array[2] = oldtio.c_cc[VERASE]; cc_array[3] = oldtio.c_cc[VKILL]; cc_array[4] = oldtio.c_cc[VEOF]; cc_array[5] = oldtio.c_cc[VSUSP]; if (write(sock, cc_array, PBS_TERM_CCA) != PBS_TERM_CCA) { perror("sending term options"); exit(2); } return; } /* * catchchild = signal handler for Death of Child */ void catchchild( int sig) { int status; int pid; while (1) { pid = waitpid(-1, &status, WNOHANG | WUNTRACED); if (pid == 0) { return; } if ((pid > 0) && (WIFSTOPPED(status) == 0)) break; if ((pid == -1) && (errno != EINTR)) { perror("qsub: bad status in catchchild: "); return; } } if (interactivechild > 0) kill(interactivechild, SIGTERM); if (x11child > 0) kill(x11child, SIGTERM); /* reset terminal to cooked mode */ if(have_terminal) tcsetattr(0, TCSANOW, &oldtio); exit(0); /*NOTREACHED*/ return; } /* END catchchild() */ void no_suspend( int sig) { fprintf(stderr, "Sorry, you cannot suspend qsub until the job is started\n"); fflush(stderr); } /* does not return */ void bailout(void) { int c; shutdown(inter_sock, 2); close(inter_sock); printf("Job %s is being deleted\n", new_jobname); c = cnt2server(server_out); if (c <= 0) { fprintf(stderr, "qsub: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); if (getenv("PBSDEBUG") != NULL) { fprintf(stderr, "qsub: pbs_server daemon may not be running on host %s or hostname in file '$TORQUEHOME/server_name' may be incorrect)\n", pbs_server); } exit(1); } pbs_deljob(c, new_jobname, NULL); pbs_disconnect(c); exit(0); } void toolong( int sig) { printf("Timeout -- deleting job\n"); bailout(); /*NOTREACHED*/ exit(0); } void catchint( int sig) { int c; printf("Do you wish to terminate the job and exit (y|[n])? "); fflush(stdout); while (1) { alarm(60); /* give a minute to think about it */ c = getchar(); if ((c == 'n') || (c == 'N') || (c == '\n')) break; if ((c == 'y') || (c == 'Y')) { bailout(); /*NOTREACHED*/ exit(0); } if (printf("yes or no please\n") < 0) { /* terminal probably went away */ bailout(); /*NOTREACHED*/ exit(0); } while ((c != '\n') && (c != EOF)) c = getchar(); } /* END while (1) */ alarm(0); /* reset alarm */ while ((c != '\n') && (c != EOF)) c = getchar(); return; } /* END catchint() */ void x11handler( int inter_sock) { struct pfwdsock *socks; int n; char *display; socks = calloc(sizeof(struct pfwdsock), NUM_SOCKS); if (!socks) { perror("x11handler malloc: "); exit(EXIT_FAILURE); } for (n = 0;n < NUM_SOCKS;n++) (socks + n)->active = 0; (socks + 0)->sock = inter_sock; (socks + 0)->active = 1; (socks + 0)->listening = 1; /* Try to open a socket for the local X server. */ display = getenv("DISPLAY"); if (!display) { fprintf(stderr, "DISPLAY not set."); return; } port_forwarder(socks, x11_connect_display, display, 0, NULL); exit(EXIT_FAILURE); } /* * interactive - set up for interactive communication with job */ void interactive(void) { int amt; char cur_server[PBS_MAXSERVERNAME + PBS_MAXPORTNUM + 2]; char momjobid[LOG_BUF_SIZE+1]; int news; int nsel; char *pc; fd_set selset; struct sigaction act; struct sockaddr_in from; torque_socklen_t fromlen; struct timeval timeout; struct winsize wsz; /* Catch SIGINT and SIGTERM, and */ /* setup to catch Death of child */ sigemptyset(&act.sa_mask); act.sa_handler = catchint; act.sa_flags = 0; if ((sigaction(SIGINT, &act, (struct sigaction *)0) < 0) || (sigaction(SIGTERM, &act, (struct sigaction *)0) < 0)) { perror("unable to catch signals"); exit(1); } act.sa_handler = toolong; if ((sigaction(SIGALRM, &act, NULL) < 0)) { perror("cannot catch alarm"); exit(2); } /* save the old terminal setting */ if (have_terminal && tcgetattr(0, &oldtio) < 0) { perror("qsub: unable to get terminal settings"); exit(1); } /* Get the current window size, to be sent to MOM later */ if (!have_terminal || getwinsize(&wsz)) { wsz.ws_row = 20; /* unable to get actual values */ wsz.ws_col = 80; /* set defaults */ wsz.ws_xpixel = 0; wsz.ws_ypixel = 0; } printf("qsub: waiting for job %s to start\n", new_jobname); /* Accept connection on socket set up earlier */ nsel = 0; while (nsel == 0) { FD_ZERO(&selset); FD_SET(inter_sock, &selset); timeout.tv_usec = 0; timeout.tv_sec = 30; nsel = select(FD_SETSIZE, &selset, NULL, NULL, &timeout); if (nsel > 0) { break; } else if (nsel == -1) { if (errno == EINTR) { nsel = 0; } else { perror("qsub: select failed"); exit(1); } } /* connect to server, status job to see if still there */ if (!locate_job(new_jobname, server_out, cur_server)) { fprintf(stderr, "qsub: job %s apparently deleted\n", new_jobname); exit(1); } } /* apparently someone is attempting to connect to us */ fromlen = sizeof(from); if ((news = accept(inter_sock, (struct sockaddr *) & from, &fromlen)) < 0) { perror("qsub: accept error"); exit(1); } /* When MOM connects, she will send the job id for us to verify */ amt = LOG_BUF_SIZE + 1; pc = momjobid; while (amt > 0) { fromlen = read(news, pc, amt); if (fromlen <= 0) break; pc += fromlen; if (*(pc - 1) == '\0') break; amt -= fromlen; } if (strncmp(momjobid, "PBS:", 4) == 0) { fprintf(stderr, "qsub: %s\n", momjobid); shutdown(news, 2); exit(1); } if (strncmp(momjobid, new_jobname, PBS_MAXSVRJOBID) != 0) { fprintf(stderr, "qsub: invalid job name from execution server\n"); shutdown(news, 2); exit(1); } /* * got the right job, send: * terminal type as "TERM=xxxx" * window size as "WINSIZE=r,c,x,y" */ send_term(news); send_winsize(news, &wsz); printf("qsub: job %s ready\n\n", new_jobname); /* set SIGINT, SIGTERM processing to ignore */ act.sa_handler = SIG_IGN; if ((sigaction(SIGINT, &act, (struct sigaction *)0) < 0) || (sigaction(SIGTERM, &act, (struct sigaction *)0) < 0) || (sigaction(SIGALRM, &act, (struct sigaction *)0) < 0) || (sigaction(SIGTSTP, &act, (struct sigaction *)0) < 0)) { perror("unable to reset signals"); exit(1); } fflush(NULL); interactivechild = fork(); if (interactivechild == 0) { /* * child process - start the reader function * set terminal into raw mode */ if (have_terminal) settermraw(&oldtio); reader(news, fileno(stdout)); /* reset terminal */ if (have_terminal) tcsetattr(0, TCSANOW, &oldtio); printf("\nqsub: job %s completed\n", new_jobname); exit(0); } else if (interactivechild > 0) { /* parent - start the writer function */ act.sa_handler = catchchild; if (sigaction(SIGCHLD, &act, (struct sigaction *)0) < 0) { exit(1); } if (Forwardx11_opt) { if ((x11child = fork()) == 0) { act.sa_handler = SIG_DFL; sigaction(SIGTERM, &act, (struct sigaction *)0); x11handler(inter_sock); } } writer(news, fileno(stdin)); /* all done - make sure reader child is gone and reset terminal */ if (interactivechild > 0) kill(interactivechild, SIGTERM); if (x11child > 0) kill(x11child, SIGTERM); shutdown(inter_sock, SHUT_RDWR); close(inter_sock); if (have_terminal) tcsetattr(0, TCSANOW, &oldtio); exit(0); } else { perror("qsub: unable to fork"); exit(1); } return; } /* END interactive() */ int validate_group_list( char *glist) { /* check each group to determine if it is a valid group that the user can be a part of. * group list is of the form group[@host][,group[@host]...] */ char *groups = strdup(glist); char *delims = ","; char *tmp_group = strtok(groups,delims); char *at; char *u_name; char **pmem; struct group *grent; struct passwd *pwent; pwent = getpwuid(getuid()); u_name = pwent->pw_name; while (tmp_group != NULL) { if ((at = strchr(tmp_group,'@')) != NULL) *at = '\0'; if ((grent = getgrnam(tmp_group)) == NULL) return(FALSE); pmem = grent->gr_mem; if (pmem == NULL) return(FALSE); while (*pmem != NULL) { if (!strcmp(*pmem,u_name)) break; pmem++; } if (*pmem == NULL) { /* match not found */ return(FALSE); } tmp_group = strtok(NULL,delims); } return(TRUE); } /** * Process command line options. * * @see main() - parent * * NOTE: return 0 on success * NOTE: only run submitfilter if pass < 10 */ int process_opts( int argc, /* I */ char **argv, /* I */ int pass) /* I */ { int i; int c; int errflg = 0; int passet; time_t after; char a_value[80]; char *keyword; char *valuewd; char *pc; char *pdepend; FILE *fP = NULL; char tmp_name[] = "/tmp/qsub.XXXXXX"; char tmp_name2[] = "/tmp/qsub.XXXXXX"; char cline[4096]; char flag; /* submitfilter flag character */ char *vptr; /* submitfilter flag value */ char tmpResources[4096] = ""; char *cP; char *ptr; struct stat sfilter; int tmpfd; int nitems; char search_string[256]; #if !defined(PBS_NO_POSIX_VIOLATION) #define GETOPT_ARGS "a:A:b:c:C:d:D:e:fhIj:k:l:m:M:N:o:p:P:q:r:S:t:T:u:v:Vw:W:Xxz-:" #else #define GETOPT_ARGS "a:A:c:C:e:hj:k:l:m:M:N:o:p:q:r:S:u:v:VW:z" #endif /* PBS_NO_POSIX_VIOLATION */ /* The following macro, together the value of passet (pass + 1) is used */ /* to enforce the following rules: 1. option on the command line take */ /* precedence over those in script directives. 2. With in the command */ /* line or within the script, the last occurance of an option takes */ /* precedence over the earlier occurance. */ #define if_cmd_line(x) if ((pass == 0) || (x != 1)) passet = pass + 1; if (pass > 0) { #ifdef linux optind = 0; /* prime getopt's starting point */ #else optind = 1; /* prime getopt's starting point */ #endif } while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) { switch (c) { case '-': if ((optarg != NULL) && !strcmp(optarg, "version")) { fprintf(stderr, "version: %s\n", PACKAGE_VERSION); exit(0); } else if ((optarg != NULL) && !strcmp(optarg, "about")) { TShowAbout(); exit(0); } else if ((optarg != NULL) && !strncmp(optarg, "port=", strlen("port="))) { /* NOTE: mothballed, server can be specified via '-q' */ int PBSPort; /* FORMAT: --port=X */ ptr = optarg + strlen("port="); PBSPort = (int)strtol(ptr, NULL, 0); } else { errflg = 1; } break; case 'a': if_cmd_line(a_opt) { a_opt = passet; if ((after = cvtdate(optarg)) < 0) { fprintf(stderr, "qsub: illegal -a value\n"); errflg++; break; } sprintf(a_value, "%ld", (long)after); set_attr(&attrib, ATTR_a, a_value); } break; case 'A': if_cmd_line(A_opt) { A_opt = passet; set_attr(&attrib, ATTR_A, optarg); } break; case 'b': if_cmd_line(b_opt) { b_opt = passet; cnt2server_retry = atoi(optarg); } break; case 'c': if_cmd_line(c_opt) { c_opt = passet; /* remove whitespace */ while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "qsub: illegal -c value\n"); errflg++; break; } pc = optarg; /* OLD FORMAT: -c { n | s | c | c=X } * New format: -c [ { | } ',' ] * new items: none | shutdown | checkpoint | name=xyz | dir=xyz | interval=X */ #if 0 if (strlen(optarg) == 1) { if ((*pc != 'n') && (*pc != 's') && (*pc != 'c')) { fprintf(stderr, "qsub: illegal -c value\n"); errflg++; break; } } else { if (strncmp(optarg, "c=", 2) != 0) { fprintf(stderr, "qsub: illegal -c value\n"); errflg++; break; } pc += 2; if (*pc == '\0') { fprintf(stderr, "qsub: illegal -c value\n"); errflg++; break; } while (isdigit(*pc)) pc++; if (*pc != '\0') { fprintf(stderr, "qsub: illegal -c value\n"); errflg++; break; } } #else nitems = csv_length(optarg); for (i = 0; i < nitems; i++) { if ((ptr = csv_nth(optarg, i)) != NULL) { strcpy(search_string, ptr); ptr = strchr(search_string, '='); if (ptr) *ptr = 0; else ptr = &search_string[strlen(search_string)]; while (ptr > search_string && *(ptr - 1) == ' ') *--ptr = 0; if (csv_find_string(checkpoint_strings, search_string) == NULL) { fprintf(stderr, "qsub: illegal -c value \"%s\"\n", ptr); errflg++; goto err; } } } #endif set_attr(&attrib, ATTR_c, optarg); } /* END if_cmd_line() */ break; case 'C': if_cmd_line(C_opt) { C_opt = passet; strcpy(dir_prefix, optarg); } break; case 'd': if (optarg != NULL) { if (optarg[0] != '/') { /* make '-d' relative to current directory, not $HOME */ char tmpPWD[1024]; char *mypwd; mypwd = getcwd(tmpPWD, sizeof(tmpPWD)); if (mypwd == NULL) { fprintf(stderr, "qsub: unable to get cwd: %d (%s)\n", errno, strerror(errno)); errflg++; /* we don't want to return yet, but we also don't want a segfault either */ /* NOTE: if cwd cannot be resolved, set errflag which will cause exit later */ tmpPWD[0] = '\0'; mypwd = tmpPWD; } if ((strlen(mypwd) + strlen(optarg)) >= sizeof(PBS_InitDir)) { fprintf(stderr, "qsub: -d arg is longer than %ld characters\n", (long)sizeof(PBS_InitDir)); errflg++; } snprintf(PBS_InitDir, sizeof(PBS_InitDir), "%s/%s", mypwd, optarg); } /* END if (optarg[0] != '/') */ else { if (strlen(optarg) >= sizeof(PBS_InitDir)) { fprintf(stderr, "qsub: -d arg is longer than %ld characters\n", (long)sizeof(PBS_InitDir)); errflg++; } strncpy(PBS_InitDir, optarg, sizeof(PBS_InitDir)); } /* end optarg[1] != '/' */ if (validate_path != 0) { /* validate local existence of '-d' working directory */ if (chdir(PBS_InitDir) == -1) { fprintf(stderr, "qsub: cannot chdir to '%s' errno: %d (%s)\n", optarg, errno, strerror(errno)); errflg++; } } } /* END if (optarg != NULL) */ else { fprintf(stderr, "qsub: illegal -d value\n"); errflg++; } break; case 'D': if (optarg != NULL) { strncpy(PBS_RootDir, optarg, sizeof(PBS_RootDir)); } else { fprintf(stderr, "qsub: illegal -D value\n"); errflg++; } break; case 'e': if_cmd_line(e_opt) { int rc = 0; e_opt = passet; if (qsub_host[0] != '\0') rc = prepare_path(optarg,path_out,qsub_host); else rc = prepare_path(optarg,path_out,NULL); if ((rc == 0) || (rc == 3)) { set_attr(&attrib, ATTR_e, path_out); } else { fprintf(stderr, "qsub: illegal -e value\n"); errflg++; } } break; #if !defined(PBS_NO_POSIX_VIOLATION) case 'f': if_cmd_line(f_opt) { f_opt = passet; set_attr(&attrib, ATTR_f, "TRUE"); } break; #endif case 'h': if_cmd_line(h_opt) { h_opt = passet; set_attr(&attrib, ATTR_h, "u"); } break; #if !defined(PBS_NO_POSIX_VIOLATION) case 'I': if_cmd_line(Interact_opt) { Interact_opt = passet; set_attr(&attrib, ATTR_inter, interactive_port(&inter_sock)); } break; #endif /* PBS_NO_POSIX_VIOLATION */ case 'j': /* FORMAT: {oe|eo|n} */ if_cmd_line(j_opt) { j_opt = passet; if (strcmp(optarg, "oe") != 0 && strcmp(optarg, "eo") != 0 && strcmp(optarg, "n") != 0) { fprintf(stderr, "qsub: illegal -j value\n"); errflg++; break; } set_attr(&attrib, ATTR_j, optarg); } break; case 'k': /* FORMAT: {o|e} */ if_cmd_line(k_opt) { k_opt = passet; if (strcmp(optarg, "o") != 0 && strcmp(optarg, "e") != 0 && strcmp(optarg, "oe") != 0 && strcmp(optarg, "eo") != 0 && strcmp(optarg, "n") != 0) { fprintf(stderr, "qsub: illegal -k value\n"); errflg++; break; } set_attr(&attrib, ATTR_k, optarg); } break; case 'l': l_opt = passet; /* defer evaluation of resources in interactive submission. */ /* ORNL WRAPPER */ if (Interact_opt == 1) { char tmpLine[4096]; /* Queue interactive resources to temp file. */ strcpy(tmpLine, tmpResources); sprintf(tmpResources, "%s#PBS -l %s\n", tmpLine, optarg); } else { /* Normal evaluation of batch job resources. */ if (set_resources(&attrib, optarg, (pass == 0)) != 0) { fprintf(stderr, "qsub: illegal -l value\n"); errflg++; } if (strstr(optarg, "walltime") != NULL) { struct attrl *attr; char *ptr; /* if walltime range specified, break into minwclimit and walltime resources */ for (attr = attrib;attr != NULL;attr = attr->next) { if (!strcmp(attr->name, "walltime")) { if ((ptr = strchr(attr->value, '-'))) { char tmpLine[1024]; *ptr = '\0'; ptr++; /* set minwclimit to min walltime range value */ snprintf(tmpLine, sizeof(tmpLine), "minwclimit=%s", attr->value); if (set_resources(&attrib, tmpLine, (pass == 0)) != 0) { fprintf(stderr, "qsub: illegal -l value\n"); errflg++; } /* set walltime to max walltime range value */ strcpy(tmpLine, ptr); strcpy(attr->value, tmpLine); } break; } } /* END for (attr) */ } } /* END else (Interact_opt == 1) */ /* END ORNL WRAPPER */ break; case 'm': if_cmd_line(m_opt) { /* FORMAT: {a|b|e|n} */ m_opt = passet; while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "qsub: illegal -m value\n"); errflg++; break; } if (strcmp(optarg, "n") != 0) { pc = optarg; while (*pc) { if ((*pc != 'a') && (*pc != 'b') && (*pc != 'e')) { fprintf(stderr, "qsub: illegal -m value\n"); errflg++; break; } pc++; } } /* END if (strcmp(optarg,"n") != 0) */ set_attr(&attrib, ATTR_m, optarg); } break; case 'M': if_cmd_line(M_opt) { M_opt = passet; if (parse_at_list(optarg, FALSE, FALSE)) { fprintf(stderr, "qsub: illegal -M value\n"); errflg++; break; } set_attr(&attrib, ATTR_M, optarg); } break; case 'N': if_cmd_line(N_opt) { N_opt = passet; /* NOTE: did enforce alpha start previously - relax this constraint allowing numeric job names (CRI - 6/26/07) */ if (check_job_name(optarg, 0) == 0) { set_attr(&attrib, ATTR_N, optarg); } else { fprintf(stderr, "qsub: illegal -N value\n"); errflg++; } } break; case 'o': if_cmd_line(o_opt) { int rc = 0; o_opt = passet; if (qsub_host[0] != '\0') rc = prepare_path(optarg,path_out,qsub_host); else rc = prepare_path(optarg,path_out,NULL); if ((rc == 0) || (rc == 3)) { set_attr(&attrib, ATTR_o, path_out); } else { fprintf(stderr, "qsub: illegal -o value\n"); errflg++; } } break; case 'p': if_cmd_line(p_opt) { p_opt = passet; while (isspace((int)*optarg)) optarg++; pc = optarg; if ((*pc == '-') || (*pc == '+')) pc++; if (strlen(pc) == 0) { fprintf(stderr, "qsub: illegal -p value\n"); errflg++; break; } while (*pc != '\0') { if (!isdigit(*pc)) { fprintf(stderr, "qsub: illegal -p value\n"); errflg++; break; } pc++; } i = atoi(optarg); if ((i < -1024) || (i > 1023)) { fprintf(stderr, "qsub: illegal -p value\n"); errflg++; break; } set_attr(&attrib, ATTR_p, optarg); } break; #if !defined(PBS_NO_POSIX_VIOLATION) case 'P': if (strlen(optarg) > 0) { char *user; char *group; char *colon; /* make sure this is the super user */ if (geteuid() != (uid_t)0) { fprintf(stderr, "qsub: Must be the super user to submit a proxy job\n"); errflg++; } user = optarg; colon = strchr(user,':'); if (colon != NULL) { group = colon+1; *colon = '\0'; set_attr(&attrib, ATTR_g, group); } set_attr(&attrib, ATTR_P, user); } else { fprintf(stderr, "qsub: -P requires a user name\n"); errflg++; } break; #endif /* PBS_NO_POSIX_VIOLATION */ case 'q': if_cmd_line(q_opt) { q_opt = passet; strcpy(destination, optarg); } break; case 'r': if_cmd_line(r_opt) { r_opt = passet; if (strlen(optarg) != 1) { fprintf(stderr, "qsub: illegal -r value\n"); errflg++; break; } if ((*optarg != 'y') && (*optarg != 'n')) { fprintf(stderr, "qsub: illegal -r value\n"); errflg++; break; } set_attr(&attrib, ATTR_r, optarg); } break; case 'S': if_cmd_line(S_opt) { S_opt = passet; if (parse_at_list(optarg, TRUE, TRUE)) { fprintf(stderr, "qsub: illegal -S value\n"); errflg++; break; } set_attr(&attrib, ATTR_S, optarg); } break; #if !defined(PBS_NO_POSIX_VIOLATION) case 't': if_cmd_line(t_opt) { t_opt = passet; /* validate before sending request to server? */ set_attr(&attrib, ATTR_t, optarg); } break; case 'T': if_cmd_line(T_opt) { T_opt = passet; /* validate before sending request to server? */ set_attr(&attrib,ATTR_jobtype,optarg); } break; #endif case 'u': if_cmd_line(u_opt) { u_opt = passet; if (parse_at_list(optarg, TRUE, FALSE)) { fprintf(stderr, "qsub: illegal -u value\n"); errflg++; break; } set_attr(&attrib, ATTR_u, optarg); } break; case 'v': if_cmd_line(v_opt) { v_opt = passet; if (v_value != NULL) free(v_value); v_value = (char *)malloc(strlen(optarg) + 1); if (v_value == NULL) { fprintf(stderr, "qsub: out of memory\n"); errflg++; break; } strcpy(v_value, optarg); } break; case 'V': if_cmd_line(V_opt) { V_opt = passet; } break; case 'w': if (optarg != NULL) { strncpy(PBS_WorkDir, optarg, sizeof(PBS_WorkDir)); } else { fprintf(stderr, "qsub: illegal -w value\n"); errflg++; } break; case 'W': while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { /* value is empty */ fprintf(stderr, "qsub: illegal -W value\n"); errflg++; break; } i = get_name_value(optarg, &keyword, &valuewd); if (i != 1) { char tmpLine[65536]; /* assume resource manager extension */ snprintf(tmpLine, sizeof(tmpLine), "x=%s", optarg); i = get_name_value(tmpLine, &keyword, &valuewd); } while (i == 1) { if (!strcmp(keyword, ATTR_depend)) { if_cmd_line(Depend_opt) { int rtn = 0; Depend_opt = passet; pdepend = malloc(PBS_DEPEND_LEN); if ((pdepend == NULL) || (rtn = parse_depend_list(valuewd,pdepend,PBS_DEPEND_LEN))) { /* cannot parse 'depend' value */ if (rtn == 2) { fprintf(stderr,"qsub: -W value exceeded max length (%d)\n", PBS_DEPEND_LEN); } else { fprintf(stderr,"qsub: illegal -W value\n"); } errflg++; break; } set_attr(&attrib, ATTR_depend, pdepend); } } else if (!strcmp(keyword, ATTR_stagein)) { if_cmd_line(Stagein_opt) { Stagein_opt = passet; if (parse_stage_list(valuewd)) { /* cannot parse 'stagein' value */ fprintf(stderr, "qsub: illegal -W value\n"); errflg++; break; } set_attr(&attrib, ATTR_stagein, valuewd); } } else if (!strcmp(keyword, ATTR_stageout)) { if_cmd_line(Stageout_opt) { Stageout_opt = passet; if (parse_stage_list(valuewd)) { /* cannot parse 'stageout' value */ fprintf(stderr, "qsub: illegal -W value\n"); errflg++; break; } set_attr(&attrib, ATTR_stageout, valuewd); } } else if (!strcmp(keyword, ATTR_t)) { if_cmd_line(t_opt) { t_opt = passet; set_attr(&attrib, ATTR_t, valuewd); } } else if (!strcmp(keyword, ATTR_g)) { if_cmd_line(Grouplist_opt) { Grouplist_opt = passet; if (parse_at_list(valuewd, TRUE, FALSE)) { /* cannot parse 'grouplist' value */ fprintf(stderr, "qsub: illegal -W value\n"); errflg++; break; } if (validate_group == TRUE) { if (validate_group_list(valuewd) == FALSE) { fprintf(stderr,"qsub: User isn't a member of one or more groups in %s\n", valuewd); errflg++; break; } } set_attr(&attrib, ATTR_g, valuewd); } } else if (!strcmp(keyword, ATTR_inter)) { /* specify interactive job */ if_cmd_line(Interact_opt) { Interact_opt = passet; if (strcmp(valuewd, "true") != 0) { fprintf(stderr, "qsub: illegal -W value\n"); errflg++; break; } set_attr(&attrib, ATTR_inter, interactive_port(&inter_sock)); } } else if (!strcmp(keyword, ATTR_umask)) { int len; len = strlen(valuewd); if (valuewd[0] == '0') --len; if (len > 3) { fprintf(stderr, "Invalid umask value, too many digits: %s\n", valuewd); errflg++; break; } Umask_opt = passet; if (valuewd[0] == '0') { /* value is octal, convert to decimal */ long mask; char buf[4]; mask = strtol(valuewd, NULL, 8); snprintf(buf, 4, "%ld", mask); /* value is octal, convert to decimal */ set_attr(&attrib,ATTR_umask,buf); } else { set_attr(&attrib,ATTR_umask,valuewd); } } else if (!strcmp(keyword, ATTR_f)) { switch (valuewd[0]) { /*accept 1, TRUE,true,YES,yes, 0, FALSE, false, NO, no */ case 1: case 'T': case 't': case 'Y': case 'y': f_opt = passet; set_attr(&attrib, ATTR_f, "TRUE"); break; case 0: case 'F': case 'f': case 'N': case 'n': f_opt = passet; set_attr(&attrib, ATTR_f, "FALSE"); break; default: fprintf(stderr, "invalid %s value: %s\n", ATTR_f, valuewd); errflg++; } } else { /* generic job attribute specified */ set_attr(&attrib, keyword, valuewd); } i = get_name_value(NULL, &keyword, &valuewd); } /* END while (i == 1) */ if (i == -1) { fprintf(stderr, "qsub: illegal -W value\n"); errflg++; } break; #if !defined(PBS_NO_POSIX_VIOLATION) case 'X': if_cmd_line(Forwardx11_opt) { Forwardx11_opt = passet; if (!getenv("DISPLAY")) { fprintf(stderr, "qsub: DISPLAY not set\n"); errflg++; } } break; case 'x': if_cmd_line(Run_Inter_opt) { Run_Inter_opt = passet; } break; #endif case 'z': if_cmd_line(z_opt) z_opt = passet; break; case '?': default : errflg++; break; } } /* END while ((c = getopt(argc,argv,GETOPT_ARGS)) != EOF) */ /* ORNL WRAPPER */ if ((pass < 10) && (Interact_opt == 1)) { int original_optind = optind; int rc = 0; /* Evaluate resources for interactive submission here. */ if ((tmpfd = mkstemp(tmp_name)) < 1) { fprintf(stderr, "qsub: could not create tmp job file %s\n", tmp_name); errflg++; goto err; } if ((fP = fdopen(tmpfd, "w+")) == NULL) { fprintf(stderr, "qsub: could not create tmp job file %s\n", tmp_name); unlink(tmp_name); errflg++; goto err; } if (fprintf(fP, "%s\n\n", tmpResources) < 0) { fprintf(stderr, "qsub: unable to write to tmp job file %s\n", tmp_name); fclose(fP); unlink(tmp_name); errflg++; goto err; } fclose(fP); if (stat(PBS_Filter, &sfilter) != -1) { int index; if ((tmpfd = mkstemp(tmp_name2)) < 1) { fprintf(stderr, "qsub: could not create tmp job file %s\n", tmp_name2); errflg++; goto err; } close(tmpfd); /* run the specified resources through the submitfilter. */ strcpy(cline, PBS_Filter); for (index = 1;index < argc;index++) { if (argv[index] != NULL) { strcat(cline, " "); strcat(cline, argv[index]); } } /* END for (index) */ strcat(cline, " <"); strcat(cline, tmp_name); strcat(cline, " >"); strcat(cline, tmp_name2); rc = system(cline); if (rc == -1) { fprintf(stderr, "qsub: error writing filter o/p, %s\n", tmp_name2); exit(1); } if (WEXITSTATUS(rc) == (unsigned char)SUBMIT_FILTER_ADMIN_REJECT_CODE) { fprintf(stderr, "qsub: Your job has been administratively rejected by the queueing system.\n"); fprintf(stderr, "qsub: There may be a more detailed explanation prior to this notice.\n"); unlink(tmp_name2); unlink(tmp_name); exit(1); } if (WEXITSTATUS(rc)) { fprintf(stderr, "qsub: submit filter returned an error code, aborting job submission.\n"); unlink(tmp_name2); unlink(tmp_name); exit(1); } fP = fopen(tmp_name2, "r+"); unlink(tmp_name2); unlink(tmp_name); } /* END if (stat(PBS_Filter,&sfilter) != -1) */ else { fP = fopen(tmp_name, "r+"); unlink(tmp_name); } /* evaluate the resources */ while (fgets(cline, sizeof(cline), fP) != NULL) { if (strlen(cline) < 5) break; for (cP = cline;cP < cline + strlen(cline);cP++) { if (*cP == '\n') { *cP = '\0'; } } /* NOTE: allow for job attributes other than '-l' */ /* FORMAT: '#PBS - ' */ if (strncasecmp(cline, "#pbs -", strlen("#pbs -"))) { /* invalid line specified */ continue; } /* NOTE: a better design would be to process the submitfilter outside of process_opts(), add valid args to ArgC/ArgV, and call process_opts() once. (NYI) */ /* NOTE: can we utilize 'process_opts' to process submit filter lines? (NYI) */ flag = cline[strlen("#pbs -")]; vptr = cline + strlen("#pbs -x "); switch (flag) { case 'l': if (set_resources(&attrib, vptr, (pass == 0))) { fprintf(stderr, "qsub: illegal -l value\n"); errflg++; } break; default: { char FlagString[3]; char *tmpArgV[4]; int aindex; FlagString[0] = '-'; FlagString[1] = flag; FlagString[2] = '\0'; #ifdef linux aindex = 1; /* prime getopt's starting point */ tmpArgV[0] = ""; #else aindex = 1; /* prime getopt's starting point */ tmpArgV[0] = ""; #endif tmpArgV[aindex] = FlagString; tmpArgV[aindex + 1] = vptr; tmpArgV[aindex + 2] = NULL; tmpArgV[3] = NULL; /* fprintf(stderr,"PLINE: '%s' '%s' '%s'\n", tmpArgV[0], tmpArgV[1], cline); */ /* set pass to 10 to allow submit filter to override user-specified values and to prevent recursive calling of submit filter processing */ if (process_opts(aindex + 2, tmpArgV, 10) != 0) { fprintf(stderr, "submitfilter line '%s' ignored\n", cline); } } break; } /* END switch (cptr[0]) */ } /* END while (fgets(cline,sizeof(cline),fP) != NULL) */ /* restore optind */ optind = original_optind; fclose(fP); } /* END if (Interact_opt == 1) */ /* END ORNL WRAPPER */ err: if (!errflg && pass) { errflg = (optind != argc); if (errflg) { fprintf(stderr, "qsub: directive error: "); for (optind = 1;optind < argc;optind++) fprintf(stderr, "%s ", argv[optind]); fprintf(stderr, "\n"); } } return(errflg); } /* END process_opts() */ /* * set_opt_defaults - if not already set, set certain job attributes to * their default value */ void set_opt_defaults(void) { if (c_opt == FALSE) set_attr(&attrib, ATTR_c, default_ckpt); if (h_opt == FALSE) set_attr(&attrib, ATTR_h, NO_HOLD); if (j_opt == FALSE) set_attr(&attrib, ATTR_j, NO_JOIN); if (k_opt == FALSE) set_attr(&attrib, ATTR_k, NO_KEEP); if (m_opt == FALSE) set_attr(&attrib, ATTR_m, MAIL_AT_ABORT); if (p_opt == FALSE) set_attr(&attrib, ATTR_p, "0"); if (r_opt == FALSE) { if (rerunnable_by_default) set_attr(&attrib, ATTR_r, "TRUE"); else set_attr(&attrib, ATTR_r, "FALSE"); } if (f_opt == FALSE) { if (fault_tolerant_by_default) set_attr(&attrib, ATTR_f, "TRUE"); else set_attr(&attrib, ATTR_f, "FALSE"); } return; } /* END set_opt_defaults() */ #define TCONST_CFGFILE "torque.cfg" int load_config( char *config_buf, /* O */ int BufSize) /* I */ { FILE *config_stream; char home_dir[MAXPATHLEN]; int length = strlen(PBS_SERVER_HOME) + strlen(TCONST_CFGFILE) + 1; char *ptr; if (length >= MAXPATHLEN) { /* FAILURE */ return(1); } home_dir[0] = '\0'; strcat(home_dir, PBS_SERVER_HOME); strcat(home_dir, "/"); strcat(home_dir, TCONST_CFGFILE); if ((config_stream = fopen(home_dir, "r")) == NULL) { /* FAILURE */ return(1); } if ((fread(config_buf, BufSize, 1, config_stream) <= 0) && (ferror(config_stream) != 0)) { /* FAILURE */ return(1); } ptr = config_buf; while ((ptr = strchr(ptr, '#')) != NULL) { ptr++; for (;(*ptr != '\0') && (*ptr != '\n');ptr++) { *ptr = ' '; } } /* END while ((ptr = strchr(ptr,'#')) != NULL) */ /* SUCCESS */ return(0); } /* END load_config() */ char *get_param( char *param, /* I */ char *config_buf) /* I */ { char tmpLine[1024]; char *param_val; char *new_val = NULL; /* FORMAT: \n */ /* NOTE: does not support comments */ /* if (strcasestr() == NULL) */ /* NOTE: currently case-sensitive (FIXME) */ if ((param_val = strstr(config_buf, param)) == NULL) { return(NULL); } strncpy(tmpLine, param_val, sizeof(tmpLine)); strtok(tmpLine, " \t\n"); if ((new_val = (char *)strtok(NULL, "\t \n")) == NULL) { return(NULL); } return(new_val); } /* END get_param() */ /** * qsub main * * @see process_opts() - child */ int main( int argc, /* I */ char **argv, /* I */ char **envp) /* I */ { int errflg; /* option error */ static char script[MAXPATHLEN + 1] = ""; /* name of script file */ char script_tmp[MAXPATHLEN + 1] = ""; /* name of script file copy */ char *bnp; FILE *f; /* FILE pointer to the script */ char *q_n_out; /* queue part of destination */ char *s_n_out; /* server part of destination */ /* server:port to send request to */ int connect; /* return from pbs_connect */ char *errmsg; /* return from pbs_geterrmsg */ struct stat statbuf; struct sigaction act; char config_buf[MAX_LINE_LEN]; /* Buffer holds config file */ char *param_val; /* value of parameter returned from config */ char *submit_args_str = NULL; /* buffer to hold args */ int argi, argslen = 0; int idx; int have_intr_cmd = FALSE; if ((param_val = getenv("PBS_CLIENTRETRY")) != NULL) { cnt2server_retry = atoi(param_val); } /* set the submit_args */ for (argi = 1;argi < argc;argi++) { argslen += strlen(argv[argi]) + 1; } if (argslen > 0) { submit_args_str = malloc(sizeof(char) * argslen); if (submit_args_str == NULL) { fprintf(stderr, "qsub: out of memory\n"); exit(2); } *submit_args_str = '\0'; for (argi = 1;argi < argc;argi++) { strcat(submit_args_str, argv[argi]); if (argi != argc - 1) { strcat(submit_args_str, " "); } } } /* check TORQUE config settings */ strncpy(PBS_Filter, SUBMIT_FILTER_PATH, 255); /* check to see if PBS_Filter exists. If not then fall back to the default hard-coded file */ if (stat(PBS_Filter, &statbuf) == -1) { strncpy(PBS_Filter, DefaultFilterPath, 255); } strncpy(xauth_path, DefaultXauthPath, 255); strncpy(default_ckpt, CHECKPOINT_UNSPECIFIED, sizeof(default_ckpt)); validate_path = 1; /* boolean - by default verify '-d' working dir locally */ server_host[0] = '\0'; qsub_host[0] = '\0'; owner_uid[0] = '\0'; if (getenv("PBSDEBUG") != NULL) { fprintf(stderr, "xauth_path=%s\n", xauth_path); } if (load_config(config_buf, sizeof(config_buf)) == 0) { if ((param_val = get_param("QSUBSLEEP", config_buf)) != NULL) { sleep(atoi(param_val)); } if ((param_val = get_param("SUBMITFILTER", config_buf)) != NULL) { strncpy(PBS_Filter, param_val, sizeof(PBS_Filter)); PBS_Filter[sizeof(PBS_Filter) - 1] = '\0'; } if ((param_val = get_param("SERVERHOST", config_buf)) != NULL) { strncpy(server_host, param_val, sizeof(server_host)); server_host[sizeof(server_host) - 1] = '\0'; } if ((param_val = get_param("QSUBHOST", config_buf)) != NULL) { strncpy(qsub_host, param_val, sizeof(qsub_host)); qsub_host[sizeof(qsub_host) - 1] = '\0'; } if ((param_val = get_param("QSUBSENDUID", config_buf)) != NULL) { sprintf(owner_uid, "%d", (int)getuid()); } if ((param_val = get_param("QSUBSENDGROUPLIST", config_buf)) != NULL) { gid_t group_id = getgid(); struct group *gpent = getgrgid(group_id); if (gpent != NULL) { set_attr(&attrib, ATTR_g, gpent->gr_name); } } if ((param_val = get_param("XAUTHPATH", config_buf)) != NULL) { strncpy(xauth_path, param_val, sizeof(xauth_path)); xauth_path[sizeof(xauth_path) - 1] = '\0'; } if ((param_val = get_param("CLIENTRETRY", config_buf)) != NULL) { if (cnt2server_retry == -100) cnt2server_retry = atoi(param_val); } if ((param_val = get_param("VALIDATEGROUP", config_buf)) != NULL) { if (getgrgid(getgid()) == NULL) { fprintf(stderr, "qsub: cannot validate submit group.\n"); exit(1); } validate_group = TRUE; } if ((param_val = get_param("DEFAULTCKPT", config_buf)) != NULL) { strncpy(default_ckpt, param_val, sizeof(default_ckpt)); } if ((param_val = get_param("VALIDATEPATH", config_buf)) != NULL) { if (!strcasecmp(param_val, "false")) validate_path = 0; } if ((param_val = get_param("RERUNNABLEBYDEFAULT", config_buf)) != NULL) { if (!strcasecmp(param_val, "false")) rerunnable_by_default = 0; } if ((param_val = get_param("FAULT_TOLERANT_BY_DEFAULT", config_buf)) != NULL) { if (!strcasecmp(param_val, "true")) fault_tolerant_by_default = 1; } } /* END if (load_config(config_buf,sizeof(config_buf)) == 0) */ /* NOTE: load config before processing opts since config may modify how opts are handled */ errflg = process_opts(argc, argv, 0); /* get cmd-line options */ if (errflg || (((optind + 1) < argc) && !Interact_opt)) { static char usage[] = "usage: qsub [-a date_time] [-A account_string] [-b secs]\n\ [-c [ none | { enabled | periodic | shutdown |\n\ depth= | dir= | interval=}... ]\n\ [-C directive_prefix] [-d path] [-D path]\n\ [-e path] [-h] [-I] [-j oe] [-k {oe}] [-l resource_list] [-m n|{abe}]\n\ [-M user_list] [-N jobname] [-o path] [-p priority] [-P proxy_user] [-q queue] \n\ [-r y|n] [-S path] [-t number_to_submit] [-T type] [-u user_list] [-w] path\n"; /* need secondary usage since there appears to be a 512 byte size limit */ static char usage2[] = " [-W otherattributes=value...] [-v variable_list] [-V ] [-x] [-X] [-z] [script]\n"; fprintf(stderr,"%s%s", usage, usage2); exit(2); } /* check to see if PBS_Filter exists. If not then fall back to the old hard-coded file */ if (stat(PBS_Filter, &statbuf) == -1) { strncpy(PBS_Filter, DefaultFilterPath, 255); } if (optind < argc) strcpy(script, argv[optind]); argi = argc - optind; if (Interact_opt) { for (idx = 1; idx < argi; idx++) { strcat(script," "); strcat(script, argv[optind + idx]); } } /* store the saved args string in "submit_args" attribute */ if (submit_args_str != NULL) { set_attr(&attrib, ATTR_submit_args, submit_args_str); free(submit_args_str); } /* end setting submit_args */ if (Forwardx11_opt) { char *x11authstr; /* get the DISPLAY's auth proto, data, and screen number */ if ((x11authstr = x11_get_proto(NULL)) != NULL) { /* stuff this info into the job */ set_attr(&attrib, ATTR_forwardx11, x11authstr); if (getenv("PBSDEBUG") != NULL) fprintf(stderr, "x11auth string: %s\n", x11authstr); } else { fprintf(stderr, "qsub: Failed to get xauth data (check $DISPLAY variable)\n"); exit(1); } } /* if script is empty, get standard input */ if (!strcmp(script, "") || !strcmp(script, "-")) { if (!N_opt) set_attr(&attrib, ATTR_N, "STDIN"); if (Interact_opt == FALSE) { if ((errflg = get_script( argc, argv, stdin, script_tmp, /* O */ set_dir_prefix(dir_prefix, C_opt))) > 0) { unlink(script_tmp); exit(1); } if (errflg < 0) { unlink(script_tmp); exit(1); } } } /* END if (!strcmp(script,"") || !strcmp(script,"-")) */ else if ((Interact_opt != FALSE) && (Run_Inter_opt)) { set_attr(&attrib, ATTR_intcmd, script); have_intr_cmd = TRUE; } else { /* non-empty script, read it for directives */ if (stat(script, &statbuf) < 0) { fprintf(stderr, "qsub: script file '%s' cannot be loaded - %s\n", script, strerror(errno)); exit(1); } if (!S_ISREG(statbuf.st_mode)) { fprintf(stderr, "qsub: script not a file\n"); exit(1); } if ((f = fopen(script, "r")) != NULL) { if (!N_opt) { if ((bnp = strrchr(script, (int)'/'))) bnp++; else bnp = script; if (check_job_name(bnp, 0) == 0) { set_attr(&attrib, ATTR_N, bnp); } else { fprintf(stderr, "qsub: cannot form a valid job name from the script name\n"); exit(1); } } if ((errflg = get_script( argc, argv, f, script_tmp, /* O */ set_dir_prefix(dir_prefix, C_opt))) > 0) { unlink(script_tmp); exit(1); } if (errflg < 0) { unlink(script_tmp); exit(1); } } /* END if ((f = fopen(script,"r")) != NULL) */ else { perror("qsub: opening script file:"); unlink(script_tmp); exit(8); } } /* END else (!strcmp(script,"") || !strcmp(script,"-")) */ /* interactive job can not be job array */ if (Interact_opt && t_opt) { fprintf(stderr, "qsub: interactive job can not be job array.\n"); unlink(script_tmp); exit(2); } if (Interact_opt && ((isatty(0) == 0) || (isatty(1) == 0))) { if (have_intr_cmd) { have_terminal = FALSE; } else { fprintf(stderr, "qsub:\tstandard input and output must be a terminal for \n\tinteractive job submission\n"); unlink(script_tmp); close(inter_sock); exit(1); } } set_opt_defaults(); /* set option default values */ server_out[0] = '\0'; if (parse_destination_id(destination, &q_n_out, &s_n_out)) { fprintf(stderr, "qsub: illegally formed destination: %s\n", destination); unlink(script_tmp); exit(2); } if (notNULL(s_n_out)) { strcpy(server_out, s_n_out); } /* connect to the server */ if (cnt2server_retry != -100) cnt2server_conf(cnt2server_retry); /* set number of seconds to retry */ connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qsub: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); if (getenv("PBSDEBUG") != NULL) { fprintf(stderr, "qsub: pbs_server daemon may not be running on host %s or hostname in file '$TORQUEHOME/server_name' may be incorrect)\n", pbs_server); } unlink(script_tmp); exit(pbs_errno); } /* Get required environment variables to be sent to the server. */ if (!set_job_env(envp)) { fprintf(stderr, "qsub: cannot send environment with the job\n"); unlink(script_tmp); exit(3); } /* disallow ^Z which hangs up MOM starting an interactive job */ sigemptyset(&act.sa_mask); act.sa_handler = no_suspend; act.sa_flags = 0; if (sigaction(SIGTSTP, &act, (struct sigaction *)0) < 0) { perror("unable to catch signals"); unlink(script_tmp); exit(1); } /* Send submit request to the server. */ pbs_errno = 0; new_jobname = pbs_submit( connect, (struct attropl *)attrib, script_tmp, destination, NULL); if (new_jobname == NULL) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "qsub: %s\n", errmsg); } else { fprintf(stderr, "qsub: Error (%d - %s) submitting job\n", pbs_errno, pbs_strerror(pbs_errno)); } unlink(script_tmp); exit(pbs_errno); } else { if (!z_opt && !Interact_opt) { printf("%s\n", new_jobname); } } /* disconnet from the server. */ pbs_disconnect(connect); unlink(script_tmp); /* is this an interactive job ??? */ if (Interact_opt == 1) interactive(); exit(0); } /* END main() */ torque-2.4.16/src/cmds/qdel.c0000664000113300011330000002366211406473145012660 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qdel - (PBS) delete batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ void qdel_all(char *extend); /* qdel */ int main( int argc, char **argv) { int c; int errflg = 0; int any_failed = 0; int purge_completed = FALSE; int located = FALSE; char *pc; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; char extend[1024]; #define GETOPT_ARGS "cm:pW:" extend[0] = '\0'; while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) { switch (c) { case 'c': if (extend[0] != '\0') { errflg++; break; } snprintf(extend,sizeof(extend),"%s%ld",PURGECOMP,(long)(time(NULL))); purge_completed = TRUE; break; case 'm': /* add delete message */ if (extend[0] != '\0') { /* extension option already specified */ errflg++; break; } strncpy(extend, optarg, sizeof(extend)); break; case 'p': if (extend[0] != '\0') { errflg++; break; } strcpy(extend, DELPURGE); strcat(extend, "1"); break; case 'W': if (extend[0] != '\0') { errflg++; break; } pc = optarg; if (strlen(pc) == 0) { fprintf(stderr, "qdel: illegal -W value\n"); errflg++; break; } while (*pc != '\0') { if (!isdigit(*pc)) { fprintf(stderr, "qdel: illegal -W value\n"); errflg++; break; } pc++; } strcpy(extend, DELDELAY); strcat(extend, optarg); break; default: errflg++; break; } } /* END while (c) */ if (purge_completed) { strcpy(server_out,pbs_default()); goto cnt; } if ((errflg != 0) || (optind >= argc)) { static char usage[] = "usage: qdel [{ -c | -p | -W delay | -m message}] [[]|'all'|'ALL']...\n"; fprintf(stderr, "%s", usage); fprintf(stderr, " -c, -m, -p, and -W are mutually exclusive\n"); exit(2); } for (;optind < argc;optind++) { int connect; int stat = 0; /* check to see if user specified 'all' to delete all jobs */ strcpy(job_id, argv[optind]); if ((strcmp("all", job_id) == 0) || (strcmp("ALL", job_id) == 0)) { qdel_all(extend); continue; } else if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qdel: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qdel: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } stat = pbs_deljob(connect, job_id_out, extend); if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qdel", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qdel", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } exit(any_failed); } /* END main() */ /* if a user requested deleting 'all' then this routine will get the list of * jobs from the server and try to delete all jobs that are not in a * 'C'omplete or 'E'xiting state */ void qdel_all( char *extend) /* I */ { char *jobid; char *state = 0; int connect; int stat; int retries; struct batch_status *p_status; struct batch_status *p; struct attropl *p_atropl = 0; struct attrl *a; connect = cnt2server('\0'); if (connect <= 0) { fprintf(stderr, "qdel: cannot connect to default server (errno=%d) %s\n", pbs_errno, pbs_strerror(pbs_errno)); return; } p_status = pbs_selstat(connect, p_atropl, NULL); if (p_status == NULL) { fprintf(stderr, "qdel: cannot find any jobs to delete\n"); } for (p = p_status;p != NULL;p = p->next) { jobid = p->name; a = p->attribs; while (a != NULL) { if ((a->name != NULL) && (!strcmp(a->name, ATTR_state))) { state = a->value; break; } a = a->next; } /* * Don't bother deleting jobs that are 'C'omplete or 'E'xiting * Unless we are Purging, then try 'C'ompleted jobs as well */ if (((strstr(extend,DELPURGE) != NULL) && (*state != 'E')) || ((*state != 'E') && (*state != 'C'))) { retries = 0; redo: stat = pbs_deljob(connect, jobid, extend); /* * if MOM is too slow to respond, we will retry a few times before * before giving up */ if (stat && (pbs_errno == PBSE_NORELYMOM) && (retries < 3)) { sleep(1); retries++; goto redo; } if (stat && (pbs_errno != PBSE_UNKJOBID) && (pbs_errno != PBSE_BADSTATE)) { printf("Deletion Error: %d (%s)\n", pbs_errno, pbs_strerror(pbs_errno)); prt_job_err("qdel", connect, jobid); } } } pbs_disconnect(connect); return; } torque-2.4.16/src/cmds/sample.qstatrc0000664000113300011330000001337311272401236014442 00000000000000# # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # proc niceprint {level name} { upvar $name str if {$level == 0} { set colone "" set limit 78 } else { set colone "\t" set limit 70 } set comma [string first "," $str] if {$comma != -1} { if {$comma < $limit} { set line "" while {[string length $line] + $comma < $limit} { set line "$line[string range $str 0 $comma]" set str [string range $str [expr $comma+1] end] set comma [string first "," $str] if {$comma == -1} { break } } } else { set line [string range $str 0 $comma] set str [string range $str [expr $comma+1] end] } } else { set line $str set str "" } puts "$colone[string range $line 0 $limit]" set line [string range $line [expr $limit+1] end] set len [string length $line] while {$len > 0} { puts "\t[string range $line 0 70]" set line [string range $line 71 end] set len [string length $line] } } if {[lsearch [info vars] objects] == -1} return foreach object $objects { foreach obj [lindex $object 1] { puts "[lindex $object 0]: [lindex $obj 0]" foreach attr [lindex $obj 1] { set name [lindex $attr 0] set value [lindex $attr 1] set line " $name = $value" set len [string length $line] if {$len < 80} { puts $line continue } set comma [string first "," $line] if {$comma == -1} { puts [string range $line 0 78] set line [string range $line 79 end] set len [string length $line] while {$len > 0} { puts "\t[string range $line 0 70]" set line [string range $line 71 end] set len [string length $line] } continue; } niceprint 0 line set len [string length $line] while {$len > 0} { niceprint 1 line set len [string length $line] } } puts [lindex $obj 3] } } torque-2.4.16/src/cmds/qstop.c0000664000113300011330000001644511272401236013073 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qstop * The qstop command directs that a destination should stop scheduling * or routing batch jobs. * * Synopsis: * qstop destination ... * * Arguments: * destination ... * A list of destinations. A destination has one of the following * three forms: * queue * @server * queue@server * If queue is specified, the request is to stop the queue at * the default server. If @server is given, the request is to * stop all queues at the server. If queue@server is used, * the request is to stop the named queue at the named server. * * Written by: * Bruce Kelly * National Energy Research Supercomputer Center * Livermore, CA * May, 1993 */ #include "cmds.h" #include /* the master config generated by configure */ int exitstatus = 0; /* Exit Status */ static void execute(char *, char *); int main(int argc, char **argv) { /* * This routine sends a Manage request to the batch server specified by * the destination. The STARTED queue attribute is set to {False}. If the * batch request is accepted, the server will stop scheduling or routing * requests for the specified queue. */ int dest; /* Index into the destination array (argv) */ char *queue; /* Queue name part of destination */ char *server; /* Server name part of destination */ if (argc == 1) { fprintf(stderr, "Usage: qstop [queue][@server] ...\n"); exit(1); } else if (argc > 1 && argv[1][0] == '-') { fprintf(stderr, "Usage: qstop [queue][@server] ...\n"); exit(1); } for (dest = 1; dest < argc; dest++) if (parse_destination_id(argv[dest], &queue, &server) == 0) execute(queue, server); else { fprintf(stderr, "qstop: illegally formed destination: %s\n", argv[dest]); exitstatus = 1; } exit(exitstatus); } /* * void execute( char *queue, char *server ) * * queue The name of the queue to disable. * server The name of the server that manages the queue. * * Returns: * None * * File Variables: * exitstatus Set to two if an error occurs. */ static void execute(char *queue, char *server) { int ct; /* Connection to the server */ int merr; /* Error return from pbs_manager */ char *errmsg; /* Error message from pbs_manager */ /* The disable request */ static struct attropl attr = { NULL, "started", NULL, "FALSE", SET }; if ((ct = cnt2server(server)) > 0) { merr = pbs_manager(ct, MGR_CMD_SET, MGR_OBJ_QUEUE, queue, &attr, NULL); if (merr != 0) { errmsg = pbs_geterrmsg(ct); if (errmsg != NULL) { fprintf(stderr, "qstop: %s ", errmsg); } else { fprintf(stderr, "qstop: Error (%d - %s) disabling queue ", pbs_errno, pbs_strerror(pbs_errno)); } if (notNULL(queue)) fprintf(stderr, "%s", queue); if (notNULL(server)) fprintf(stderr, "@%s", server); fprintf(stderr, "\n"); exitstatus = 2; } pbs_disconnect(ct); } else { fprintf(stderr, "qstop: could not connect to server %s (%d) %s\n", server, pbs_errno, pbs_strerror(pbs_errno)); exitstatus = 2; } } torque-2.4.16/src/cmds/pbs_track.c0000664000113300011330000001673411272401236013676 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * pbs_track - (TORQUE) start tracking a session not spawned through the usual TM interface * * Authors: * Josh Butikofer * David Jackon * Alan Taufer * Cluster Resources, Inc. */ #include #include "cmds.h" #include "tm.h" #include /* the master config generated by configure */ #define MAXARGS 64 int main( int argc, char **argv) /* pbs_track */ { int ArgIndex; int NumErrs = 0; char *Args[MAXARGS]; int aindex = 0; int rc; int pid; char tmpJobID[PBS_MAXCLTJOBID]; /* from the command line */ char JobID[PBS_MAXCLTJOBID]; /* modified job ID for MOM/server consumption */ char ServerName[MAXSERVERNAME]; int DoBackground = 0; tmpJobID[0] = '\0'; /* USAGE: pbs_track [-j ] a.out arg1 arg2 ... argN */ #define GETOPT_ARGS "bj:" while ((ArgIndex = getopt(argc, argv, GETOPT_ARGS)) != EOF) { switch (ArgIndex) { case 'b': /* background process */ DoBackground = 1; break; case 'j': strncpy(tmpJobID, optarg, sizeof(tmpJobID)); if (tmpJobID[PBS_MAXCLTJOBID-1] != '\0') { /* truncation occurred! */ fprintf(stderr, "pbs_track: given job ID too large (> %d)\n", PBS_MAXCLTJOBID); exit(-1); } break; default: NumErrs++; break; } } if ((NumErrs > 0) || (optind >= argc) || (tmpJobID[0] == '\0')) { static char Usage[] = "USAGE: pbs_track [-j ] [-b] a.out arg1 arg2 ... argN\n"; fprintf(stderr, "%s", Usage); exit(2); } if (get_server(tmpJobID, JobID, ServerName)) { fprintf(stderr, "pbs_track: illegally formed job identifier: '%s'\n", JobID); exit(1); } /* gather a.out and other arguments */ aindex = 0; for (;optind < argc;optind++) { Args[aindex++] = strdup(argv[optind]); printf("Got arg: %s\n", Args[aindex-1]); } Args[aindex] = NULL; /* decide if we should fork or not */ pid = 1; if (DoBackground == 1) { printf("FORKING!\n"); pid = fork(); } if ((DoBackground == 0) || (pid == 0)) { /* either parent or child, depending on the setting */ /* call tm_adopt() to start tracking this process */ rc = tm_adopt(JobID, TM_ADOPT_JOBID, getpid()); switch (rc) { case TM_SUCCESS: /* success! */ break; case TM_ENOTFOUND: fprintf(stderr, "pbs_track: MOM could not find job %s\n", JobID); break; case TM_ESYSTEM: case TM_ENOTCONNECTED: fprintf(stderr, "pbs_track: error occurred while trying to communication with pbs_mom: %s (%d)\n", pbse_to_txt(rc), rc); break; default: /* Unexpected error occurred */ fprintf(stderr, "pbs_track: unexpected error %s (%d) occurred\n", pbse_to_txt(rc), rc); break; } /* END switch(rc) */ if (rc != TM_SUCCESS) { exit(-1); } /* do the exec */ execv(Args[0], Args); } /* END if ((DoBackground == 0) || (pid == 0)) */ else if (pid > 0) { /* parent*/ fclose(stdin); fclose(stdout); fclose(stderr); } else if (pid < 0) { fprintf(stderr, "pbs_track: could not fork (%d:%s)\n", errno, strerror(errno)); } exit(0); } /* END main() */ torque-2.4.16/src/cmds/qrun.c0000664000113300011330000001771611272401236012714 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qrun * The qrun command forces a batch job to run. * * Synopsis: * qrun [-H host] job_identifier ... * * Arguments: * host * The host to run the job at. * job_identifier ... * A list of job_identifiers. A job_identifier has the following form: * sequence_number[.server_name][@server] * * Written by: * Bruce Kelly * National Energy Research Supercomputer Center * Livermore, CA * May, 1993 */ #include "cmds.h" #include /* the master config generated by configure */ int exitstatus = 0; /* Exit Status */ static void execute(char *, char *, char *, int); int main( int argc, /* I */ char **argv) /* I */ { /* * This routine sends a Run Job request to the batch server. If the * batch request is accepted, the server will have started the execution * of the job. */ char job[PBS_MAXCLTJOBID]; /* Job Id */ char server[MAXSERVERNAME]; /* Server name */ char *location = NULL; /* Where to run the job */ static char opts[] = "aH:"; /* See man getopt */ static char *usage = "Usage: qrun [-a] [-H host] job_id ...\n"; int s; int errflg = 0; int runAsync = FALSE; /* Command line options */ while ((s = getopt(argc, argv, opts)) != EOF) { switch (s) { case 'a': /* Async job start */ runAsync = TRUE; break; case 'H': if (strlen(optarg) == 0) { fprintf(stderr, "qrun: illegal -H value\n"); errflg++; break; } location = optarg; break; case '?': default: errflg++; break; } /* END switch(s) */ } /* END while (getopt() != -1) */ if (errflg || (optind >= argc)) { fprintf(stderr,"%s", usage); exit(1); } for (;optind < argc;optind++) { if (get_server(argv[optind], job, server)) { fprintf(stderr, "qrun: illegally formed job identifier: %s\n", argv[optind]); exitstatus = 1; continue; } execute(job, server, location, runAsync); } /* END for (;optind) */ exit(exitstatus); /*NOTREACHED*/ return(0); } /* END main() */ /* * void execute(char *job,char *server,char *location) * * job The fully qualified job id. * server The name of the server that manages the job. * location The name of the server to run the job. * * Returns: * None * * File Variables: * exitstatus Set to two if an error occurs. */ static void execute( char *job, /* I */ char *server, /* I */ char *location, /* I */ int async) /* I */ { int ct; /* Connection to the server */ int err; /* Error return from pbs_run */ int located = FALSE; char rmt_server[MAXSERVERNAME]; cnt: if ((ct = cnt2server(server)) > 0) { if (async == TRUE) { err = pbs_asyrunjob(ct, job, location, NULL); /* see lib/Libifl/pbsD_runjob.c */ } else { err = pbs_runjob(ct, job, location, NULL); /* see lib/Libifl/pbsD_runjob.c */ } if (err && (pbs_errno == PBSE_UNKNODE)) { fprintf(stderr, "qrun: Unknown node in hostlist '%.16s...' for job %s\n", location, job); exitstatus = 2; } else if (err && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qrun", ct, job); exitstatus = 2; } else if (err && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job, server, rmt_server)) { pbs_disconnect(ct); strcpy(server, rmt_server); goto cnt; } prt_job_err("qrun", ct, job); exitstatus = 2; } pbs_disconnect(ct); } else { fprintf(stderr, "qrun: could not connect to server %s (%d) %s\n", server, pbs_errno, pbs_strerror(pbs_errno)); exitstatus = 2; } return; } /* END execute() */ /* END qrun.c */ torque-2.4.16/src/cmds/qselect.c0000664000113300011330000003633611432602263013367 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qselect - (PBS) select batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ void set_attrop(struct attropl **list, char *a_name, char *r_name, char *v_name, enum batch_op op) { struct attropl *attr; attr = (struct attropl *) malloc(sizeof(struct attropl)); if (attr == NULL) { fprintf(stderr, "qselect: out of memory\n"); exit(2); } if (a_name == NULL) attr->name = NULL; else { attr->name = (char *) malloc(strlen(a_name) + 1); if (attr->name == NULL) { fprintf(stderr, "qselect: out of memory\n"); exit(2); } strcpy(attr->name, a_name); } if (r_name == NULL) attr->resource = NULL; else { attr->resource = (char *) malloc(strlen(r_name) + 1); if (attr->resource == NULL) { fprintf(stderr, "qselect: out of memory\n"); exit(2); } strcpy(attr->resource, r_name); } if (v_name == NULL) attr->value = NULL; else { attr->value = (char *) malloc(strlen(v_name) + 1); if (attr->value == NULL) { fprintf(stderr, "qselect: out of memory\n"); exit(2); } strcpy(attr->value, v_name); } attr->op = op; attr->next = *list; *list = attr; return; } #define OPSTRING_LEN 4 #define OP_LEN 2 #define OP_ENUM_LEN 6 static char *opstring_vals[] = { "eq", "ne", "ge", "gt", "le", "lt" }; static enum batch_op opstring_enums[] = { EQ, NE, GE, GT, LE, LT }; void check_op(char *optarg, enum batch_op *op, char *optargout) { char opstring[OP_LEN+1]; int i; int cp_pos; *op = EQ; /* default */ cp_pos = 0; if (optarg[0] == '.') { strncpy(opstring, &optarg[1], OP_LEN); opstring[OP_LEN] = '\0'; cp_pos = OPSTRING_LEN; for (i = 0; i < OP_ENUM_LEN; i++) { if (strncmp(opstring, opstring_vals[i], OP_LEN) == 0) { *op = opstring_enums[i]; break; } } } strcpy(optargout, &optarg[cp_pos]); return; } int check_res_op(char *optarg, char *resource_name, enum batch_op *op, char *resource_value, char **res_pos) { char opstring[OPSTRING_LEN]; int i; int hit; char *p; p = strchr(optarg, '.'); if (p == NULL || *p == '\0') { fprintf(stderr, "qselect: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } else { strncpy(resource_name, optarg, p - optarg); resource_name[p-optarg] = '\0'; *res_pos = p + OPSTRING_LEN; } if (p[0] == '.') { strncpy(opstring, &p[1] , OP_LEN); opstring[OP_LEN] = '\0'; hit = 0; for (i = 0; i < OP_ENUM_LEN; i++) { if (strncmp(opstring, opstring_vals[i], OP_LEN) == 0) { *op = opstring_enums[i]; hit = 1; break; } } if (! hit) { fprintf(stderr, "qselect: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } } p = strchr(*res_pos, ','); if (p == NULL) { p = strchr(*res_pos, '\0'); } strncpy(resource_value, *res_pos, p - (*res_pos)); resource_value[p-(*res_pos)] = '\0'; if (strlen(resource_value) == 0) { fprintf(stderr, "qselect: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } *res_pos = (*p == '\0') ? p : (p += 1) ; if (**res_pos == '\0' && *(p - 1) == ',') { fprintf(stderr, "qselect: illegal -l value\n"); fprintf(stderr, "resource_list: %s\n", optarg); return (1); } return(0); /* ok */ } /* qselect */ int main( int argc, char **argv) { int c; int errflg = 0; char *errmsg; #define MAX_OPTARG_LEN 256 #define MAX_RESOURCE_NAME_LEN 256 char optargout[MAX_OPTARG_LEN+1]; char resource_name[MAX_RESOURCE_NAME_LEN+1]; enum batch_op op; enum batch_op *pop = &op; struct attropl *select_list = 0; static char destination[PBS_MAXROUTEDEST+1] = ""; char server_out[MAXSERVERNAME] = ""; char *queue_name_out; char *server_name_out; int connect; char **selectjob_list; char *res_pos; char *pc; int u_cnt, o_cnt, s_cnt, n_cnt; time_t after; char a_value[80]; int exec_only = 0; if (getenv("PBS_QSTAT_EXECONLY") != NULL) exec_only = 1; #define GETOPT_ARGS "a:A:ec:h:l:N:p:q:r:s:u:" while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) switch (c) { case 'a': check_op(optarg, pop, optargout); if ((after = cvtdate(optargout)) < 0) { fprintf(stderr, "qselect: illegal -a value\n"); errflg++; break; } sprintf(a_value, "%ld", (long)after); set_attrop(&select_list, ATTR_a, NULL, a_value, op); break; case 'e': exec_only = 1; break; case 'c': check_op(optarg, pop, optargout); pc = optargout; while (isspace((int)*pc)) pc++; if (strlen(pc) == 0) { fprintf(stderr, "qselect: illegal -c value\n"); errflg++; break; } if (strcmp(pc, "u") == 0) { if ((op != EQ) && (op != NE)) { fprintf(stderr, "qselect: illegal -c value\n"); errflg++; break; } } else if ((strcmp(pc, "n") != 0) && (strcmp(pc, "s") != 0) && (strcmp(pc, "c") != 0)) { if (strncmp(pc, "c=", 2) != 0) { fprintf(stderr, "qselect: illegal -c value\n"); errflg++; break; } pc += 2; if (strlen(pc) == 0) { fprintf(stderr, "qselect: illegal -c value\n"); errflg++; break; } while (*pc != '\0') { if (!isdigit((int)*pc)) { fprintf(stderr, "qselect: illegal -c value\n"); errflg++; break; } pc++; } } set_attrop(&select_list, ATTR_c, NULL, optargout, op); break; case 'h': check_op(optarg, pop, optargout); pc = optargout; while (isspace((int)*pc)) pc++; if (strlen(pc) == 0) { fprintf(stderr, "qselect: illegal -h value\n"); errflg++; break; } u_cnt = o_cnt = s_cnt = n_cnt = 0; while (*pc) { if (*pc == 'u') u_cnt++; else if (*pc == 'o') o_cnt++; else if (*pc == 's') s_cnt++; else if (*pc == 'n') n_cnt++; else { fprintf(stderr, "qselect: illegal -h value\n"); errflg++; break; } pc++; } if (n_cnt && (u_cnt + o_cnt + s_cnt)) { fprintf(stderr, "qselect: illegal -h value\n"); errflg++; break; } set_attrop(&select_list, ATTR_h, NULL, optargout, op); break; case 'l': res_pos = optarg; while (*res_pos != '\0') { if (check_res_op(res_pos, resource_name, pop, optargout, &res_pos) != 0) { errflg++; break; } set_attrop(&select_list, ATTR_l, resource_name, optargout, op); } break; case 'p': check_op(optarg, pop, optargout); set_attrop(&select_list, ATTR_p, NULL, optargout, op); break; case 'q': strncpy(destination, optarg, PBS_MAXROUTEDEST); check_op(optarg, pop, optargout); set_attrop(&select_list, ATTR_q, NULL, optargout, op); break; case 'r': op = EQ; pc = optarg; while (isspace((int)(*pc))) pc++; if (strlen(pc) != 1) { fprintf(stderr, "qsub: illegal -r value\n"); errflg++; break; } if (*pc != 'y' && *pc != 'n') { fprintf(stderr, "qsub: illegal -r value\n"); errflg++; break; } set_attrop(&select_list, ATTR_r, NULL, pc, op); break; case 's': check_op(optarg, pop, optargout); pc = optargout; while (isspace((int)(*pc))) pc++; if (strlen(optarg) == 0) { fprintf(stderr, "qselect: illegal -s value\n"); errflg++; break; } while (*pc) { if (*pc != 'E' && *pc != 'H' && *pc != 'Q' && *pc != 'R' && *pc != 'T' && *pc != 'W') { fprintf(stderr, "qselect: illegal -s value\n"); errflg++; break; } pc++; } set_attrop(&select_list, ATTR_state, NULL, optargout, op); break; case 'u': op = EQ; if (parse_at_list(optarg, FALSE, FALSE)) { fprintf(stderr, "qselect: illegal -u value\n"); errflg++; break; } set_attrop(&select_list, ATTR_u, NULL, optarg, op); break; case 'A': op = EQ; set_attrop(&select_list, ATTR_A, NULL, optarg, op); break; case 'N': op = EQ; set_attrop(&select_list, ATTR_N, NULL, optarg, op); break; default : errflg++; } if (errflg || (optind < argc)) { static char usage[] = "usage: qselect \ [-a [op]date_time] [-A account_string] [-e] [-c [op]interval] \n\ [-h hold_list] [-l resource_list] [-N name] [-p [op]priority] \n\ [-q destination] [-r y|n] [-s states] [-u user_name]\n"; fprintf(stderr,"%s", usage); exit(2); } if (notNULL(destination)) { if (parse_destination_id(destination, &queue_name_out, &server_name_out)) { fprintf(stderr, "qselect: illegally formed destination: %s\n", destination); exit(2); } else { if (notNULL(server_name_out)) { strcpy(server_out, server_name_out); } } } connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qselect: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); exit(pbs_errno); } selectjob_list = pbs_selectjob(connect, select_list, exec_only ? EXECQUEONLY : NULL); if (selectjob_list == NULL) { if (pbs_errno != PBSE_NONE) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "qselect: %s\n", errmsg); } else { fprintf(stderr, "qselect: Error (%d - %s) selecting jobs\n", pbs_errno, pbs_strerror(pbs_errno)); } exit(pbs_errno); } } else /* got some jobs ids */ { int i = 0; while (selectjob_list[i] != NULL) { printf("%s\n", selectjob_list[i++]); } free(selectjob_list); } pbs_disconnect(connect); exit(0); } torque-2.4.16/src/cmds/nqs2pbs0000775000113300011330000004650311614035164013100 00000000000000#!/bin/sh # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. if [ \( $# -eq 0 \) -o \( $# -gt 2 \) ] then echo Usage: $0 NQSscript \[PBSscript\] exit 1 fi if [ $# -eq 2 ] then OUT=$2 else OUT=$1.new fi echo Converting NQS script \"$1\" into \"$OUT\" gawk ' # # Rule 0 - Initialize a few variables # BEGIN { suffix = " kKmMgGtT" err_ct = 0 cvn_ct = 0 warn_ct = 0 line_ct = 1 } # # Rule 1 - Make copy of line # { copy_of_line = $0 } # # Rule 2 - if line starts with either #QSUB or #@$ , convert it # ($0 ~ /^[ \t]*#[ \t]*QSUB/) || ($0 ~ /^[ \t]*#[ \t]*\@\$/) { if (donedate == 0 ) { "date" | getline today_is print "# This script converted on " today_is donedate = 1 } i = 1 if ($1 ~ /#$/) i = 2 if (($i ~ /QSUB-/) || ($i ~ /\@\$-/)) { $i = substr($i, index($i, "-")) } else { ++i; } printf ("#PBS "); for ( ; i <= NF; ++i ) { if ($i ~ /-a/ ) { # -a date # treat multiple words from a quoted string as separate # words and process them as a date date["CC"] = "" date["YY"] = "" date["MM"] = "" date["DD"] = "" date["hh"] = "00" date["mm"] = "00" date["ss"] = "" should_be_date = 0 if ($(++i) ~ /^["\047]/) quote = 1 else quote = 0 do { start = 1 if ($i ~ /^["\047]/ ) start = 2 len = length($i) + 1 - start if ($i ~ /["\047]$/ ) { --len quote = 0 } word = substr($i, start, len) # process the date word here... crackdate(word) } while (quote && (++i <= NF)) if (date["ss"] == "") printf("-a %s%s%s%s%s%s ",date["CC"],date["YY"],date["MM"],date["DD"],date["hh"],date["mm"] ) else printf("-a %s%s%s%s%s%s.%s ", date["CC"],date["YY"],date["MM"],date["DD"],date["hh"],date["mm"],date["ss"]) } else if ($i ~ /-A/ ) { # -A account printf("-A %s ",$(++i)) } else if ($i ~ /-C/ ) { # -C compartment prt_warning(sprintf("NQS %s option not supported", $i)) ++i } else if ($i ~ /-e$/ ) { # -e file printf("-e %s ",$(++i)) } else if ($i ~ /-eo/ ) { # -eo printf("-j oe ") } else if ($i ~ /-j|J/ ) { # -j prt_warning("NQS joblog options not supported") ++i } else if ($i ~ /-ke/ ) { # -ke if (have_ke == 0) { if (have_ko == 1) printf("-keo ") else printf("-ke ") have_ke = 1 } } else if ($i ~ /-ko/ ) { # -ke if (have_ko == 0) { if (have_ke == 1) printf("-keo ") else printf("-ko ") have_ko = 1 } } else if ($i ~ /-kj/ ) { # -kj prt_warning("NQS joblog options not supported") } else if ($i ~ /-l$/ ) { # -l ++i if ($i ~ /^"/ ) { word = cat_qstring() } else { word = $i } sub(/mpp_p/, "mppe", word) sub(/p_mpp_t/, "pmppt", word) sub(/mpp_t/, "mppt", word) printf("-l \"%s\"", word) } else if ($i ~ /-l[acdsw]/ ) { # -la -lc -ld -ls -lw prt_warning(sprintf("NQS %s options not supported",$i)) ++i } else if ($i ~ /-lf/ ) { # -lf limit printf("-l ppf=") cnv_limit($(++i)) } else if ($i ~ /-lF/ ) { # -lF limit printf("-l pf=") cnv_limit($(++i)) } else if ($i ~ /-lm/ ) { # -lm limit printf("-l pmem=") cnv_limit($(++i)) } else if ($i ~ /-lM/ ) { # -lM limit printf("-l mem=") cnv_limit($(++i)) } else if ($i ~ /-ln/ ) { # -ln nice printf("-l nice=%s ",$(++i)) } else if ($i ~ /-lr/ ) { # -lr srfs ++i cnv_srfs() } else if ($i ~ /-lQ/ ) { # -lQ sds printf("-l sds=") cnv_limit($(++i)) } else if ($i ~ /-lt/ ) { # -lt time printf("-l pcput=%s ",$(++i)) } else if ($i ~ /-lT/ ) { # -lT time printf("-l cput=%s ",$(++i)) } else if ($i ~ /-lU[a-h]/ ) { # -lUmttype printf("-l mt%s=%s ", substr($(i), 4, 1), $(++i)) } else if ($i ~ /-L/ ) { # -L level prt_warning(sprintf("NQS %s option not supported", $i)) ++i } else if ($i ~ /-mb/ ) { # -mb if (have_mb == 0) { if (have_me == 0) printf("-mb ") else printf("-mbe ") have_mb = 1 } } else if ($i ~ /-me/ ) { # -mb if (have_me == 0) { if (have_mb == 0) printf("-me ") else printf("-mbe ") have_me = 1 } } else if ($i ~ /-m[rt]/ ) { # -mr -mt prt_warning(sprintf("NQS %s option not supported", $i)) } else if ($i ~ /-mu/ ) { #-mu user printf("-M %s ", $(++i)) } else if ($i ~ /-nc/ ) { # -nc printf("-cn ") } else if ($i ~ /-nr/ ) { # -nr printf("-rn ") } else if ($i ~ /-o/ ) { # -o file printf("-o %s ",$(++i)) } else if ($i ~ /-p/ ) { # -p priority prior = $(++i) if (prior > 1023) prior = 1023 else if (prior < -1024) prior = -1024 printf("-p %s ", prior) } else if ($i ~ /-q/ ) { # -q queue printf("-q %s ",$(++i)) } else if ($i ~ /-r$/ ) { # -r name printf("-N %s ",$(++i)) } else if ($i ~ /-r[eo]/ ) { # -re -ro prt_warning(sprintf("NQS %s option not supported, you may wish to use -k%c", $i, substr($i, 3, 3))) } else if ($i ~ /-Rf/ ) { # -Rf prt_warning("NQS -Rf option not supported") ++i } else if ($i ~ /^-s$/ ) { # -s shell printf("-S %s ",$(++i)) } else if ($i ~ /-u/ ) { # -u user printf("-u %s ",$(++i)) } else if ($i ~ /-x/ ) { # -x printf("-V ") } else if ($i ~ /-z/ ) { # -z printf("-z ") } else if ($i ~ /^#/ ) { # #comment break } else if ($i ~ /^-/ ) { # -any_thing_else prt_warning(sprintf("Unknown NQS option \"%s\"\n\tabove option was not converted", $i)) } else { prt_error("unknown option/parameter ", $i) } } printf("\n"); } # # Rule 3 - for every line, print it # { print copy_of_line ++line_ct } # # END Rule - print number of warnings and errors, if errors exit non-zero # END { if ( cvn_ct > 0 ) { printf("\nFractional size values, i.e. \"23.4mw\" are not supported in PBS.\n") > "/dev/tty" printf("In %d occurrence in this conversion, a fractonal size value was converted\nto the corresponding integeral value of the next small unit.\n", cvn_ct) > "/dev/tty" printf("For example, \"23.4mw\" converted to \"23962kw\"\n") > "/dev/tty" } printf("\nIn converting the script, %d errors and %d warnings occurred\n", err_ct, warn_ct) > "/dev/tty" exit err_ct } # # function prt_warning - print a warning message and the script line causing it # function prt_warning(text) { print "\nWarning on line #" line_ct " of NQS script" > "/dev/tty" print "\t" text > "/dev/tty" print "\tinput line: " substr($0, 1, 40) > "/dev/tty" ++warn_ct } # # function prt_error - print a error message and the script line causing it # function prt_error(text, word) { print "\nError on line #" line_ct " of NQS script" > "/dev/tty" print "\t" text " \""word "\"" > "/dev/tty" print "\tinput line: " substr($0, 1, 40) > "/dev/tty" ++err_ct } # # function crackdate - convert NQS complex date/time to PBSs # [[[[YY]CC]MM]DD]hhmm[.ss] # function crackdate(word) { # noon if (word ~ /noon$/) { date["hh"] = "12" date["mm"] = "00" # midnight } else if (word ~ /midnight$/) { date["hh"] = "00" date["mm"] = "00" # day of week, today, tomorrow - all bad news } else if ( (word ~ /^[Mm][Oo][Nn][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Tt][Uu][Ee][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ww][Ee][Dd][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Tt][Hh][Uu][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ff][Rr][Ii][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ss][Aa][Tt][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ss][Uu][Nn][a-zA-Z]*[.,]*$/ ) || (word ~ /^today,*$/ ) || (word ~ /^Today,*$/ ) || (word ~ /^TODAY,*$/ ) || (word ~ /^tomorrow,*$/ ) || (word ~ /^Tomorrow,*$/ ) || (word ~ /^TOMORROW,*$/ ) ) { prt_warning(sprintf("PBS does not support a date form of \"%s\".\n\Recommend use of -a option on command line rather than in the script.", word)) # Time Zone specifier } else if ( word ~ /^[ACEGMP][DMPS]T,?$/ ) { prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # MM/DD } else if ( word ~ /^[01][0-9]\/[0-3][0-9]$/ ) { date["MM"] = substr(word, 1, 2) date["DD"] = substr(word, 4, 2) # MM/DD/YY }else if (word ~ /^[01][0-9]\/[0-3][0-9]\/[0-9][0-9]$/ ) { date["MM"] = substr(word, 1, 2) date["DD"] = substr(word, 4, 5) date["YY"] = substr(word, 7, 2) # MM/DD/YYYY } else if (word ~ /^[01][0-9]\/[0-3][0-9]\/[0-9][0-9][0-9][0-9]$/ ) { date["MM"] = substr(word, 1, 2) date["DD"] = substr(word, 4, 2) date["YY"] = substr(word, 9, 2) date["CC"] = substr(word, 7, 2) # YYYY }else if (word ~ /^[0-9][0-9][0-9][0-9]$/ ) { date["CC"] = substr(word, 1, 2) date["YY"] = substr(word, 3, 2) should_be_date = 1 # YYYY-MM-DD } else if (word ~ /^[0-9][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]$/ ) { date["CC"] = substr(word, 1, 2) date["YY"] = substr(word, 3, 2) date["MM"] = substr(word, 6, 2) date["DD"] = substr(word, 9, 2) # month } else if (word ~ /^[a-zA-Z][a-zA-Z][a-zA-Z]*$/ ) { get_month(word) should_be_date = 1 # either DD or HH } else if (word ~ /^[0-3][0-9],?$/ ) { if (should_be_date == 1) { date["DD"] = substr(word, 1, 2) should_be_date = 0 } else { date["hh"] = substr(word, 1, 2) date["mm"] = "00" } # either D or H } else if (word ~ /^[0-9],?$/) { if (should_be_date == 1) { date["DD"] = "0" substr(word, 1, 1) should_be_date = 0 } else { date["hh"] = "0" substr(word, 1, 1) date["mm"] = "00" } # H[[a|p]m] } else if (word ~ /^[0-9][ap]?m?,?$/ ) { date["hh"] = "0" substr(word, 1, 1) adj_hour(word) # HH[[a|p]m] } else if (word ~ /^[0-2][0-9][ap]?m?,?$/ ) { date["hh"] = substr(word, 1, 2) adj_hour(word) # HHtimezone } else if (word ~ /^[0-2][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # H:MM[[a|p]m] } else if (word ~ /^[0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) adj_hour(word) # H:MMtimezone } else if (word ~ /^[0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # HH:MM[[a|p]m] } else if (word ~ /^[0-2][0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) adj_hour(word) # HH:MMtimezone } else if (word ~ /^[0-2][0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # H:MM:SS[[a|p]m] } else if (word ~ /^[0-9]:[0-5][0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) date["ss"] = substr(word, 6, 2) adj_hour(word) # H:MM:SStimezone } else if (word ~ /^[0-9]:[0-5][0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) date["ss"] = substr(word, 6, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # HH:MM:SS[[a|p]m] } else if (word ~ /^[0-2][0-9]:[0-5][0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) date["ss"] = substr(word, 7, 2) adj_hour(word) # HH:MM:SStimezone } else if (word ~ /^[0-2][0-9]:[0-5][0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) date["ss"] = substr(word, 7, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # DD-month } else if (word ~ /^[0-3][0-9]-[a-zA-Z][a-zA-Z][a-zA-Z]*$/ ) { date["DD"] = substr(word, 1, 2) get_month(substr(word, 4)) # DD-month-YY DD-month-YYYY } else if (word ~ /^[0-3][0-9]-[a-zA-Z][a-zA-Z][a-zA-Z]*-[0-9][0-9]*$/) { date["DD"] = substr(word, 1, 2) get_month(substr(word, 4, 3)) if (word ~ /.*-[0-9][0-9]$/ ) { # -YY date["YY"] = substr(word, length(word)-1, 2) } else { # -YYYY date["CC"] = substr(word, length(word)-3, 2) date["YY"] = substr(word, length(word)-1, 2) } } else { prt_error("unrecognized date syntax: ", word) > "/dev/tty" } } # # function get_month - convert abbrev of a month to numerical index 01-12 # function get_month(word) { if (word ~ /[Jj][Aa][Nn].*/ ) date["MM"] = "01" else if (word ~ /[Ff][Ee][Bb].*/ ) date["MM"] = "02" else if (word ~ /[Mm][Aa][Rr].*/ ) date["MM"] = "03" else if (word ~ /[Aa][Pp][Rr].*/ ) date["MM"] = "04" else if (word ~ /[Mm][Aa][Yy]/ ) date["MM"] = "05" else if (word ~ /[Jj][Uu][Nn].*/ ) date["MM"] = "06" else if (word ~ /[Jj][Uu][Ll].*/ ) date["MM"] = "07" else if (word ~ /[Aa][Uu][Gg].*/ ) date["MM"] = "08" else if (word ~ /[Ss][Ee][Pp].*/ ) date["MM"] = "09" else if (word ~ /[Oo][Cc][Tt].*/ ) date["MM"] = "10" else if (word ~ /[Nn][Oo][Vv].*/ ) date["MM"] = "11" else if (word ~ /[Dd][Ee][Cc].*/ ) date["MM"] = "12" else { prt_error("Bad month specification ", word) > "/dev/tty" } } # # function adj_hour - adjust 12 hour clock to 24 hour # function adj_hour(word) { if (((word ~ /pm,?$/ ) || (word ~ /[0-9]m,?$/)) && (date["hh"] < 12)) { date["hh"] = substr(word, 1, 2) + 12; } else if (word ~ /am,?$/) { if (date["hh"] == 12) { date["hh"] = "00" } } } # # function cnv_srfs - convert NQS srfs request to PBS srfs request # function cnv_srfs() { if ($i ~ /^[\047"]/) val = cat_qstring() # pull parameters into one string else val = $i nele = split(val, parts, ",") # split into 2,3,or 4 parts if (nele < 2) { prt_error("incorrect SRFS syntax in ", $0) return } if (parts[1] ~ /\$FASTDIR/) { # $FASTDIR dir = "srfs_fast" } else if (parts[1] ~ /\/fast/) { dir = "srfs_fast" } else if (parts[1] ~ /\$BIGDIR/) { # $BIGDIR dir = "srfs_big" } else if (parts[1] ~ /\$TMPDIR/) { # $TMPDIR dir = "srfs_tmp" } else if (parts[1] ~ /\$WRKDIR/) { # $WRKDIR dir = "srfs_wrk" } else { prt_error("cannot convert this srfs request\n\t", $0) return } printf("-l %s=", dir) cnv_limit(parts[2]) if (nele > 2) { prt_warning("GID/ACID not supported on SRFS request") } } # # function cat_qstring - concat quoted words into a single string # "abc def ghi " -> abcdefghi # function cat_qstring() { if ($i ~ /^[\047"]..*/) { # start of quoted words tmp = $i while ( tmp !~ /[\047"]$/) tmp = tmp $(++i) } else if ($i ~ /^[\047"]$/ ) { tmp = $i $(++i) while ( tmp !~ /[\047"]$/) tmp = tmp $(++i) } tmp = substr(tmp, 2, length(tmp)-2) return tmp } # # function cnv_limit - convert NQS limit value ###[.###][[kmg]wb] to # PBSs ###[kmgt][wb] # # if NQS has fraction, mutiple by 1024 and drop suffix to next lower # magnitude, e.g "4.5MW" -> "4608KW" # function cnv_limit(word) { len = length(word) # nnn if (word ~ /^[0-9][0-9]*$/) { val = word suf = "" byte= "b" # nnnMB } else if (word ~ /^[0-9][0-9]*[kKmMgGtT][wWbB]$/) { val = substr(word, 1, len-2) suf = substr(word, len-1, 1) byte = substr(word, len, 1) # nnnW } else if (word ~ /^[0-9][0-9]*[wWbB]$/) { val = substr(word, 1, len-1) suf = "" byte = substr(word, len, 1) # nnn.nnMW } else if (word ~ /^[0-9]*\.[0-9]*[kKmMgGtT][wWbB]$/) { ++cvn_ct val = sprintf("%.0f", (substr(word, 1, len-2) * 1024)+1) ind = index(suffix, substr(word, length(word)-1, 1)) suf = substr(suffix, ind-2, 1) if (suf == " ") suf = "" byte = substr(word, length(word), 1) } else { prt_error("unrecognized limit ", word) } printf("%s%s%s ", val, suf, byte) } ' < $1 > $OUT if [ $? -ne 0 ] then echo Because of errors in converting the script, echo $OUT is being removed. rm $OUT exit 1 else echo Script conversion complete, new PBS script in $OUT exit 0 fi torque-2.4.16/src/cmds/qstat.c0000664000113300011330000015372211343271765013074 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qstat - (PBS) show stats of batch jobs, queues, or servers * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include /* the master config generated by configure */ #include #include #if TCL_QSTAT #include #include #if TCLX #include #endif #endif #include "cmds.h" #include "mcom.h" #include "utils.h" static void states(); #if !defined(PBS_NO_POSIX_VIOLATION) /* defines for alternative display formats */ #define ALT_DISPLAY_a 1 /* -a option - show all jobs */ #define ALT_DISPLAY_i 2 /* -i option - show not running */ #define ALT_DISPLAY_r 4 /* -r option - show only running */ #define ALT_DISPLAY_u 8 /* -u option - list user's jobs */ #define ALT_DISPLAY_n 0x10 /* -n option - add node list */ #define ALT_DISPLAY_s 0x20 /* -s option - add scheduler comment */ #define ALT_DISPLAY_R 0x40 /* -R option - add SRFS info */ #define ALT_DISPLAY_q 0x80 /* -q option - alt queue display */ #define ALT_DISPLAY_Mb 0x100 /* show sizes in MB */ #define ALT_DISPLAY_Mw 0x200 /* -M option - show sizes in MW */ #define ALT_DISPLAY_G 0x400 /* -G option - show sizes in GB */ #define ALT_DISPLAY_o 0x800 /* -1 option - add node list on same line */ #endif /* not PBS_NO_POSIX_VIOLATION */ /* globals */ mbool_t DisplayXML = FALSE; #define maxlinesize 65536 int linesize = 77; int tasksize; /* END globals */ #ifdef TXT #define DEFTASKSIZE 5 #else #define DEFTASKSIZE 3 #endif int tasksize = DEFTASKSIZE; int alias_opt = FALSE; int isjobid( char *string) { int i; int result; i = strspn(string, " "); /* locate first non-blank */ if (isdigit(string[i])) result = 1; /* job_id */ else if (isalpha(string[i])) result = 0; /* not a job_id */ else result = 0; /* who knows - probably a syntax error */ return(result); } /* END isjobid() */ int istrue( char *string) /* I */ { if (!strcasecmp(string, "TRUE")) { return(TRUE); } if (!strcmp(string, "1")) { return(TRUE); } return(FALSE); } /* END istrue() */ static void states( char *string, /* I */ char *q, /* O */ char *r, /* O */ char *h, /* O */ char *w, /* O */ char *t, /* O */ char *e, /* O */ int len) /* I */ { char *c, *d, *f, *s, l; /* FORMAT: Queued:X Running:Y... */ c = string; while (isspace(*c) && *c != '\0') c++; while (*c != '\0') { s = c; while (*c != ':') c++; *c = '\0'; d = NULL; if (strcmp(s, "Queued") == 0) d = q; else if (strcmp(s, "Running") == 0) d = r; else if (strcmp(s, "Held") == 0) d = h; else if (strcmp(s, "Waiting") == 0) d = w; else if (strcmp(s, "Transit") == 0) d = t; else if (strcmp(s, "Exiting") == 0) d = e; c++; if (d != NULL) { s = c; while ((*c != ' ') && (*c != '\0')) c++; l = *c; *c = '\0'; if (strlen(s) > (size_t)len) { f = s + len; *f = '\0'; } strcpy(d, s); if (l != '\0') c++; } } return; } /* END states() */ /* * print a attribute value string, formating to break a comma if possible */ void prt_attr( char *n, /* I name */ char *r, /* I resource (optional) */ char *v) /* I value */ { char *c; char *comma = ","; int first = 1; int l; int start; start = strlen(n) + 7; /* 4 spaces + ' = ' is 7 */ printf(" %s", n); if (r != NULL) { start += strlen(r) + 1; printf(".%s", r); } printf(" = "); c = strtok(v, comma); while (c != NULL) { if ((l = strlen(c)) + start < linesize) { printf("%s", c); start += l; } else { if (!first) { printf("\n\t"); start = 9; } while (*c) { putchar(*c++); if (++start > linesize) { start = 8; printf("\n\t"); } } } if ((c = strtok(NULL, comma)) != NULL) { first = 0; putchar(','); } } return; } /* END prt_attr() */ /* * locate a attribute (attrl) by name (and resource) and return value * returns null if not found */ static char *findattrl( struct attrl *pattrl, char *name, char *resc) { while (pattrl != NULL) { if (!strcmp(name, pattrl->name)) { if (resc != NULL) { if (!strcmp(resc, pattrl->resource)) { return(pattrl->value); } } else { return(pattrl->value); } } pattrl = pattrl->next; } return(NULL); } #ifndef PBS_MINNAMELEN #define PBS_MINNAMELEN 16 /* min size for printf job jobs, queues, and servers */ #endif /* PBS_MINNAMELEN */ #ifndef PBS_NAMELEN #define PBS_NAMELEN 16 /* printf of jobs, queues, and servers */ #endif /* PBS_NAMELEN */ #define OWNERL 15 /* printf of jobs */ #define TIMEUL 8 /* printf of jobs */ #define STATEL 1 /* printf of jobs */ #define LOCL 15 /* printf of jobs */ #define SIZEL 6 /* length of "SIZE" fields in printf */ /* * Format and display string of assigned nodes, (1) strip off domain name * if present and (2) break line at '+' sign. */ static void prt_nodes( char *nodes) /* I */ { int i; char *stp; char linebuf[65536]; if ((nodes == NULL) || (*nodes == '\0')) { /* FAILURE - node is invalid */ return; } i = 0; stp = nodes; while (*nodes != '\0') { if ((*stp == '.') || (*stp == '+') || (*stp == '\0')) { /* does node fit into line? */ if (i + stp - nodes < linesize) { while (nodes < stp) linebuf[i++] = *nodes++; } else { /* flush line and start next */ linebuf[i] = '\0'; printf(" %s\n", linebuf); i = 0; while (nodes < stp) linebuf[i++] = *nodes++; } /* strip off domain name to keep string short */ while ((*stp != '+') && (*stp != '\0')) stp++; nodes = stp++; } else { stp++; } } if (i != 0) { linebuf[i] = '\0'; printf(" %s\n", linebuf); } return; } /* END prt_nodes() */ /* * convert size from suffix string (nnnn[ kmgt][ bw]) to string of * k[bw] for neither -M or -G * mw for -M * gb for -G */ static char *cnv_size( char *value, int opt) { static int sift_factor[3][5] = { { -20, -10, 0, 10, 20 }, /* mb conversion */ { -23, -13, -3, 7, 17 }, /* mw conversion */ { -30, -20, -10, 0, 10 } }; /* gb conversion */ int in; int out; int sft; unsigned long nval; char *pc; char *suffix; static char outbuf[25]; if (opt & ALT_DISPLAY_Mb) { out = 0; suffix = "mb"; } else if (opt & ALT_DISPLAY_Mw) { out = 1; suffix = "mw"; } else if (opt & ALT_DISPLAY_G) { out = 2; suffix = "gb"; } else { return (value); /* return unmodified */ } nval = strtol(value, &pc, 10); if (*pc == 'k') in = 1; else if (*pc == 'm') in = 2; else if (*pc == 'g') in = 3; else if (*pc == 't') in = 4; else in = 0; sft = sift_factor[out][in]; if ((*pc == 'w') || (*(pc + 1) == 'w')) nval = nval << 3; /* convert to bytes */ if (sft < 0) { nval = nval + ((1 << -sft) - 1); /* round up (ceiling) */ nval = nval >> -sft; } else { nval = nval << sft; } sprintf(outbuf, "%lu%s", nval, suffix); return(outbuf); } /* * Format and display status of job in alternate form (not POSIX standard) */ static void altdsp_statjob( struct batch_status *pstat, /* I */ struct batch_status *prtheader, /* I */ int alt_opt) /* I */ { char *comment; char *pc; struct attrl *pat; char *exechost; char *usern = NULL; char *queuen = NULL; char *jobn = NULL; char *sess; char *tasks; char calcTasks[64]; char *nodect; char *rqtimecpu; char *rqtimewal; char *jstate; char *eltimecpu; char *eltimewal; char tmpLine[MAX_LINE_LEN]; int usecput; static char pfs[SIZEL]; static char rqmem[SIZEL]; static char srfsbig[SIZEL]; static char srfsfast[SIZEL]; static char *blank = " -- "; if (prtheader) { printf("\n%s: ", prtheader->name); if ((pc = findattrl(prtheader->attribs, ATTR_comment, NULL)) != NULL) { printf("%s", pc); } if (alt_opt & ALT_DISPLAY_R) { printf("\n Req'd Req'd Elap \n"); printf("Job ID Username Queue NDS TSK Memory Time S Time BIG FAST PFS\n"); printf("-------------------- -------- -------- ----- --- ------ ----- - ----- ----- ----- -----\n"); } else if (tasksize == 5) { printf("\n Req'd Req'd Elap\n"); printf("Job ID Username Queue Jobname SessID NDS Tasks Memory Time S Time\n"); printf("-------------------- -------- -------- ---------------- ------ ----- ----- ------ ----- - -----\n"); } else { printf("\n Req'd Req'd Elap\n"); printf("Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time\n"); printf("-------------------- -------- -------- ---------------- ------ ----- --- ------ ----- - -----\n"); } } while (pstat != NULL) { exechost = blank; sess = blank; nodect = blank; tasks = blank; rqtimecpu = blank; rqtimewal = blank; eltimecpu = blank; eltimewal = blank; jstate = blank; comment = blank; /* *pfs = *blank; */ strcpy(pfs, blank); /* *rqmem = *blank; */ strcpy(rqmem, blank); /* *srfsbig = *blank; */ strcpy(srfsbig, blank); /* *srfsfast = *blank; */ strcpy(srfsfast, blank); usecput = 0; pat = pstat->attribs; while (pat != NULL) { if (!strcmp(pat->name, ATTR_N)) { jobn = pat->value; } else if (!strcmp(pat->name, ATTR_owner)) { usern = pat->value; if ((pc = strchr(usern, (int)'@')) != NULL) * pc = '\0'; } else if (!strcmp(pat->name, ATTR_state)) { jstate = pat->value; } else if (!strcmp(pat->name, ATTR_queue)) { queuen = pat->value; } else if (!strcmp(pat->name, ATTR_session)) { sess = pat->value; } else if (!strcmp(pat->name, ATTR_l)) { if (!strcmp(pat->resource, "nodect")) { nodect = pat->value; } else if (!strcmp(pat->resource, "nodes")) { char *tmp = pat->value; char *eq = strchr(tmp,'='); if (eq != NULL) { int nodes = atoi(pat->value); int procs = atoi(eq+1); sprintf(calcTasks,"%d",nodes*procs); tasks = calcTasks; } else { tasks = pat->value; } } else if (!strcmp(pat->resource, "ncpus")) { if ((!strcmp(tasks,blank)) && (strcmp(pat->value, "0"))) tasks = pat->value; } else if (!strcmp(pat->resource, "mppe")) { if (strcmp(pat->value, "0")) tasks = pat->value; } else if (!strcmp(pat->resource, "size")) { if (strcmp(pat->value, "0")) tasks = pat->value; } else if (!strcmp(pat->resource, "mem")) { strncpy(rqmem, cnv_size(pat->value, alt_opt), SIZEL); } else if (!strcmp(pat->resource, "walltime")) { rqtimewal = pat->value; } else if (!strcmp(pat->resource, "cput")) { rqtimecpu = pat->value; usecput = 1; } else if (!strcmp(pat->resource, "srfs_big")) { strncpy(srfsbig, cnv_size(pat->value, alt_opt), SIZEL - 1); } else if (!strcmp(pat->resource, "srfs_fast")) { strncpy(srfsfast, cnv_size(pat->value, alt_opt), SIZEL - 1); } else if (!strcmp(pat->resource, "piofs")) { strncpy(pfs, cnv_size(pat->value, alt_opt), SIZEL - 1); } } else if (!strcmp(pat->name, ATTR_exechost)) { exechost = pat->value; } else if (!strcmp(pat->name, ATTR_used)) { if (!strcmp(pat->resource, "walltime")) { eltimewal = pat->value; } else if (!strcmp(pat->resource, "cput")) { eltimecpu = pat->value; } } else if (!strcmp(pat->name, ATTR_comment)) { comment = pat->value; } pat = pat->next; } snprintf(tmpLine, sizeof(tmpLine), "%%-20.%ds %%-8.8s %%-8.8s ", PBS_NAMELEN); printf(tmpLine, pstat->name, usern, queuen); if (alt_opt & ALT_DISPLAY_R) { printf("%5.5s %*.*s %6.6s %5.5s %1.1s %5.5s %5.5s %5.5s %5.5s", nodect, tasksize, tasksize, tasks, rqmem, usecput ? rqtimecpu : rqtimewal, jstate, usecput ? eltimecpu : eltimewal, srfsbig, srfsfast, pfs); } else { snprintf(tmpLine, sizeof(tmpLine), "%%-%d.%ds %%6.6s %%5.5s %%*.*s %%6.6s %%5.5s %%1.1s %%5.5s", PBS_NAMELEN, PBS_NAMELEN); printf(tmpLine, jobn, sess, nodect, tasksize, tasksize, tasks, rqmem, usecput ? rqtimecpu : rqtimewal, jstate, usecput ? eltimecpu : eltimewal); } if (linesize < maxlinesize) printf("\n"); if (alt_opt & ALT_DISPLAY_n) { /* print assigned nodes */ prt_nodes(exechost); } if (alt_opt & ALT_DISPLAY_s) { /* print (scheduler) comment */ if (*comment != '\0') printf(" %s\n", comment); } pstat = pstat->next; } return; } /* END altdsp_statjob() */ /* * get_ct - get count of jobs in queue/run state * support function for altdsp_statque() */ static void get_ct( char *str, int *jque, int *jrun) { char *ps; int colon = (int)':'; ps = strchr(str, colon); /* Transit - skip */ ps = strchr(ps + 1, colon); /* Queued - add to jque */ *jque += atoi(ps + 1); ps = strchr(ps + 1, colon); /* Held - add to jque */ *jque += atoi(ps + 1); ps = strchr(ps + 1, colon); /* Waiting - add to jque */ *jque += atoi(ps + 1); ps = strchr(ps + 1, colon); /* Running - add to jrun */ *jrun += atoi(ps + 1); return; } /* END get_ct() */ /* * altdsp_statque - alternative display for queue information, -q option */ static void altdsp_statque( char *serv, struct batch_status *pstat, int opt) { char rmem[SIZEL]; char *cput; char *wallt; char *jmax; char *nodect; char *blank = "-- "; int jrun; int jque; char qenabled = '\0'; char qstarted = '\0'; int tot_jrun = 0; int tot_jque = 0; struct attrl *pat; printf("\nserver: %s\n\n", serv); printf("Queue Memory CPU Time Walltime Node Run Que Lm State\n"); printf("---------------- ------ -------- -------- ---- --- --- -- -----\n"); while (pstat != NULL) { /* *rmem = '\0'; */ strncpy(rmem, "-- ", SIZEL - 1); cput = blank; wallt = blank; nodect = "-- "; jrun = 0; jque = 0; jmax = blank; pat = pstat->attribs; while (pat != NULL) { if (strcmp(pat->name, ATTR_maxrun) == 0) { jmax = pat->value; } else if (strcmp(pat->name, ATTR_enable) == 0) { if (*pat->value == 'T') qenabled = 'E'; else qenabled = 'D'; } else if (strcmp(pat->name, ATTR_start) == 0) { if (*pat->value == 'T') qstarted = 'R'; else qstarted = 'S'; } else if (strcmp(pat->name, ATTR_count) == 0) { get_ct(pat->value, &jque, &jrun); tot_jque += jque; tot_jrun += jrun; } else if (strcmp(pat->name, ATTR_rescmax) == 0) { if (strcmp(pat->resource, "mem") == 0) { strncpy( rmem, cnv_size(pat->value, opt), SIZEL); } else if (strcmp(pat->resource, "cput") == 0) { cput = pat->value; } else if (strcmp(pat->resource, "walltime") == 0) { wallt = pat->value; } else if (strcmp(pat->resource, "nodect") == 0) { nodect = pat->value; } } pat = pat->next; } printf("%-16.16s %6.6s %8.8s %8.8s %5.5s ", pstat->name, rmem, cput, wallt, nodect); printf("%3d %3d %2.2s %c %c\n", jrun, jque, jmax, qenabled, qstarted); pstat = pstat->next; } /* END while (pstat != NULL) */ printf(" ----- -----\n"); printf(" %5d %5d\n", tot_jrun, tot_jque); return; } /* END altdsp_statque() */ /* build and add an attropl struct to the list */ static void add_atropl( struct attropl **list, char *name, char *resc, char *value, enum batch_op op) { struct attropl *patro; patro = (struct attropl *)malloc(sizeof(struct attropl)); if (patro == NULL) { fprintf(stderr, "cannot malloc space\n"); exit(1); } patro->next = *list; patro->name = name; patro->resource = resc; patro->value = value; patro->op = op; *list = patro; return; } /* END add_atropl() */ /* display when a normal "qstat" is executed */ void display_statjob( struct batch_status *status, /* I (data) */ int prtheader, /* I (boolean) */ int full) /* I (boolean) */ { struct batch_status *p; struct attrl *a; int l; char *c; char *jid; char *name; char *owner; char *timeu; char *state; char *location; char format[80]; char long_name[17]; time_t epoch; mxml_t *DE; mxml_t *JE; mxml_t *AE; mxml_t *RE1; mxml_t *JI; /* XML only support for full output */ if (DisplayXML == TRUE) full = 1; if (!full) { sprintf(format, "%%-%ds %%-%ds %%-%ds %%%ds %%%ds %%-%ds\n", PBS_MAXSEQNUM + PBS_MAXJOBARRAYLEN + 11, PBS_MINNAMELEN, OWNERL, TIMEUL, STATEL, LOCL); if (prtheader) { /* display summary header TODO - the sizes of these fields should be determined from #defines in pbs_ifl.h */ printf("Job id Name User Time Use S Queue\n"); printf("------------------------- ---------------- --------------- -------- - -----\n"); } } /* END if (!full) */ if (DisplayXML == TRUE) { /* create parent */ DE = NULL; MXMLCreateE(&DE, "Data"); } for (p = status;p != NULL;p = p->next) { jid = NULL; name = NULL; owner = NULL; timeu = NULL; state = NULL; location = NULL; if (full) { if (DisplayXML == TRUE) { JE = NULL; MXMLCreateE(&JE, "Job"); MXMLAddE(DE, JE); JI = NULL; MXMLCreateE(&JI, "Job_Id"); MXMLSetVal(JI, p->name,mdfString); MXMLAddE(JE, JI); } else { printf("Job Id: %s\n", p->name); } a = p->attribs; RE1 = NULL; while (a != NULL) { if (a->name != NULL) { if (DisplayXML == TRUE) { /* lookup a->name -> XML attr name */ AE = NULL; if (a->resource != NULL) { if (RE1 == NULL) { MXMLCreateE(&RE1, a->name); MXMLAddE(JE, RE1); } MXMLCreateE(&AE, a->resource); MXMLSetVal(AE, a->value, mdfString); MXMLAddE(RE1, AE); } else { RE1 = NULL; MXMLCreateE(&AE, a->name); MXMLSetVal(AE, a->value, mdfString); MXMLAddE(JE, AE); } } else { if (!strcmp(a->name, ATTR_ctime) || !strcmp(a->name, ATTR_etime) || !strcmp(a->name, ATTR_mtime) || !strcmp(a->name, ATTR_qtime) || !strcmp(a->name, ATTR_start_time) || !strcmp(a->name, ATTR_comp_time) || !strcmp(a->name, ATTR_checkpoint_time) || !strcmp(a->name, ATTR_a)) { epoch = (time_t)atoi(a->value); prt_attr(a->name, a->resource, ctime(&epoch)); } else { prt_attr(a->name, a->resource, a->value); printf("\n"); } } } a = a->next; } } /* END if (full) */ else { /* display summary data */ if (p->name != NULL) { c = p->name; while ((*c != '.') && (*c != '\0')) c++; if (alias_opt == TRUE) { /* show the alias as well as the first part of the server name */ if (*c == '.') { c++; while((*c != '.') && (*c != '\0')) c++; } } c++; /* List the first part of the server name, too. */ while ((*c != '.') && (*c != '\0')) c++; *c = '\0'; l = strlen(p->name); if (l > (PBS_MAXSEQNUM + PBS_MAXJOBARRAYLEN + 8)) { /* truncate job name */ c = p->name + PBS_MAXSEQNUM + PBS_MAXJOBARRAYLEN + 14; *c = '\0'; } jid = p->name; } a = p->attribs; while (a != NULL) { if (a->name != NULL) { if (strcmp(a->name, ATTR_name) == 0) { l = strlen(a->value); /* truncate AName */ if (l > PBS_NAMELEN) { l = l - PBS_NAMELEN + 3; c = a->value + l; while ((*c != '/') && (*c != '\0')) c++; if (*c == '\0') c = a->value + l; strcpy(long_name, "..."); strcat(long_name, c); c = long_name; } else { c = a->value; } name = c; } else if (!strcmp(a->name, ATTR_owner)) { c = a->value; while ((*c != '@') && (*c != '\0')) c++; *c = '\0'; l = strlen(a->value); if (l > OWNERL) { c = a->value + OWNERL; *c = '\0'; } owner = a->value; } else if (!strcmp(a->name, ATTR_used)) { if (!strcmp(a->resource, "cput")) { l = strlen(a->value); if (l > TIMEUL) { c = a->value + TIMEUL; *c = '\0'; } timeu = a->value; } } else if (!strcmp(a->name, ATTR_state)) { l = strlen(a->value); if (l > STATEL) { c = a->value + STATEL; *c = '\0'; } state = a->value; } else if (!strcmp(a->name, ATTR_queue)) { c = a->value; while ((*c != '@') && (*c != '\0')) c++; *c = '\0'; l = strlen(a->value); if (l > LOCL) { c = a->value + LOCL; *c = '\0'; } location = a->value; } } a = a->next; } if (timeu == NULL) timeu = "0"; /* display summary data */ printf(format, jid, name, owner, timeu, state, location); } /* END else (full) */ if (DisplayXML != TRUE) { if (full) printf("\n"); } } /* END for (p = status) */ if (DisplayXML == TRUE) { char *tmpBuf = NULL, *tail = NULL; int bufsize; MXMLToXString(DE, &tmpBuf, &bufsize, INT_MAX, &tail, TRUE); MXMLDestroyE(&DE); fprintf(stdout, "%s\n", tmpBuf); } return; } /* END display_statjob() */ #define MINNUML 3 #define MAXNUML 5 #define TYPEL 10 void display_statque( struct batch_status *status, int prtheader, int full) { struct batch_status *p; struct attrl *a = NULL; int l; char *c; char *name; char *max; char *tot; char ena[MAXNUML + 1]; char str[MAXNUML + 1]; char que[MAXNUML + 1]; char run[MAXNUML + 1]; char hld[MAXNUML + 1]; char wat[MAXNUML + 1]; char trn[MAXNUML + 1]; char ext[MAXNUML + 1]; char *type; char format[80]; int NUML = 5; sprintf(format, "%%-%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%-%ds\n", PBS_MINNAMELEN, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, TYPEL); if (!full && prtheader) { printf(format, "Queue", "Max", "Tot", "Ena", "Str", "Que", "Run", "Hld", "Wat", "Trn", "Ext", "T"); printf(format, "----------------", "---", "---", "---", "---", "---", "---", "---", "---", "---", "---", "-"); } p = status; while (p != NULL) { name = NULL; max = "0"; tot = "0"; strcpy(ena, "no"); strcpy(str, "no"); strcpy(que, "0"); strcpy(run, "0"); strcpy(hld, "0"); strcpy(wat, "0"); strcpy(trn, "0"); strcpy(ext, "0"); type = "not defined"; if (full) { printf("Queue: %s\n", p->name); a = p->attribs; while (a != NULL) { if (a->name != NULL) { prt_attr(a->name, a->resource, a->value); printf("\n"); } a = a->next; } } else { if (p->name != NULL) { l = strlen(p->name); if (l > PBS_NAMELEN) { c = a->name + PBS_NAMELEN; *c = '\0'; } name = p->name; } a = p->attribs; while (a != NULL) { if (a->name != NULL) { if (strcmp(a->name, ATTR_maxrun) == 0) { l = strlen(a->value); if (l > NUML) { c = a->value + NUML; *c = '\0'; } max = a->value; } else if (strcmp(a->name, ATTR_total) == 0) { l = strlen(a->value); if (l > NUML) { c = a->value + NUML; *c = '\0'; } tot = a->value; } else if (strcmp(a->name, ATTR_enable) == 0) { if (istrue(a->value)) strcpy(ena, "yes"); else strcpy(ena, "no"); } else if (strcmp(a->name, ATTR_start) == 0) { if (istrue(a->value)) strcpy(str, "yes"); else strcpy(str, "no"); } else if (strcmp(a->name, ATTR_count) == 0) { states(a->value, que, run, hld, wat, trn, ext, NUML); } else if (strcmp(a->name, ATTR_qtype) == 0) { type = a->value; *(type + 1) = '\0'; } } a = a->next; } printf(format, name, max, tot, ena, str, que, run, hld, wat, trn, ext, type); } if (full) printf("\n"); p = p->next; } return; } #define STATUSL 10 void display_statserver( struct batch_status *status, int prtheader, int full) { struct batch_status *p; struct attrl *a; int l; char *c; char *name; char *max; char *tot; char que[MAXNUML + 1]; char run[MAXNUML + 1]; char hld[MAXNUML + 1]; char wat[MAXNUML + 1]; char trn[MAXNUML + 1]; char ext[MAXNUML + 1]; char *stats; char format[80]; int NUML; NUML = MAXNUML; sprintf(format, "%%-%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%%ds %%-%ds\n", PBS_MINNAMELEN, NUML, NUML, NUML, NUML, NUML, NUML, NUML, NUML, STATUSL); if (!full && prtheader) { printf(format, "Server", "Max", "Tot", "Que", "Run", "Hld", "Wat", "Trn", "Ext", "Status"); printf(format, "----------------", "---", "---", "---", "---", "---", "---", "---", "---", "----------"); } p = status; while (p != NULL) { name = NULL; max = "0"; tot = "0"; strcpy(que, "0"); strcpy(run, "0"); strcpy(hld, "0"); strcpy(wat, "0"); strcpy(trn, "0"); strcpy(ext, "0"); stats = ""; if (full) { printf("Server: %s\n", p->name); a = p->attribs; while (a != NULL) { if (a->name != NULL) { prt_attr(a->name, a->resource, a->value); printf("\n"); } a = a->next; } } else { if (p->name != NULL) { l = strlen(p->name); if (l > PBS_NAMELEN) { c = p->name + PBS_NAMELEN; *c = '\0'; } name = p->name; } a = p->attribs; while (a != NULL) { if (a->name != NULL) { if (strcmp(a->name, ATTR_maxrun) == 0) { l = strlen(a->value); if (l > NUML) { c = a->value + NUML; *c = '\0'; } max = a->value; } else if (strcmp(a->name, ATTR_total) == 0) { l = strlen(a->value); if (l > NUML) { c = a->value + NUML; *c = '\0'; } tot = a->value; } else if (strcmp(a->name, ATTR_count) == 0) { states(a->value, que, run, hld, wat, trn, ext, NUML); } else if (strcmp(a->name, ATTR_status) == 0) { l = strlen(a->value); if (l > STATUSL) { c = a->value + STATUSL; *c = '\0'; } stats = a->value; } } a = a->next; } printf(format, name, max, tot, que, run, hld, wat, trn, ext, stats); } if (full) printf("\n"); p = p->next; } return; } /* END display_statserver() */ #if TCL_QSTAT #define ARGNUM 1024 char *attrlist( struct attrl *ap) { char nameres[256]; char *argv[ARGNUM]; char *ret; int i, num = 0; while (ap) { char *twol[2]; if (ap->resource != NULL) { sprintf(nameres, "%s%s%s", ap->name, TCL_ATRSEP, ap->resource); twol[0] = nameres; } else { twol[0] = ap->name; } twol[1] = ap->value; argv[num++] = Tcl_Merge(2, (const char **)twol); if (num == ARGNUM) break; ap = ap->next; } ret = Tcl_Merge(num, (const char **)argv); for (i = 0;i < num;i++) free(argv[i]); return(ret); } Tcl_Interp *interp = NULL; char script[200]; char flags[] = "flags"; char ops[] = "operands"; char error[] = "error"; void tcl_init(void) { struct passwd *pw; uid_t uid; struct stat sb; uid = getuid(); pw = getpwuid(uid); if (pw == NULL) return; sprintf(script, "%s/.qstatrc", pw->pw_dir); if (stat(script, &sb) == -1) { strcpy(script, QSTATRC_PATH); if (stat(script, &sb) == -1) return; } interp = Tcl_CreateInterp(); if (Tcl_Init(interp) == TCL_ERROR) { fprintf(stderr, "Tcl_Init error: %s", interp->result); } #if TCLX #if TCL_MINOR_VERSION < 5 && TCL_MAJOR_VERSION < 8 if (TclX_Init(interp) == TCL_ERROR) { #else if (Tclx_Init(interp) == TCL_ERROR) { #endif fprintf(stderr, "Tclx_Init error: %s", interp->result); } #endif /* TCLX */ return; } void tcl_addarg(name, arg) char *name; char *arg; { if (interp == NULL) return; if (arg == NULL || *arg == '\0') return; Tcl_SetVar(interp, name, arg, TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT | TCL_APPEND_VALUE); } int tcl_stat( char *type, struct batch_status *bs, int f_opt) { struct batch_status *bp; char *twol[2]; char *argv[ARGNUM]; int i, num = 0; char *result; if (interp == NULL) { return(1); } if (f_opt == 0) { return(1); } twol[0] = type; for (bp = bs;bp != NULL;bp = bp->next) { char *threel[3]; threel[0] = bp->name; threel[1] = attrlist(bp->attribs); threel[2] = bp->text; argv[num++] = Tcl_Merge(3, (const char **)threel); free(threel[1]); /* malloc'ed in attrlist() */ if (num == ARGNUM) break; } twol[1] = Tcl_Merge(num, (const char **)argv); for (i = 0;i < num;i++) free(argv[i]); result = Tcl_Merge(2, (const char **)twol); Tcl_SetVar( interp, "objects", result, TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT | TCL_APPEND_VALUE); free(twol[1]); free(result); return(0); } void tcl_run( int f_opt) { if (interp == NULL) { return; } if (f_opt && Tcl_EvalFile(interp, script) != TCL_OK) { char *trace; trace = (char *)Tcl_GetVar(interp, "errorInfo", 0); if (trace == NULL) trace = interp->result; fprintf(stderr, "%s: TCL error @ line %d: %s\n", script, interp->errorLine, trace); } Tcl_DeleteInterp(interp); return; } /* END tcl_run() */ #else #define tcl_init() #define tcl_addarg(name, arg) #define tcl_stat(type, bs, f_opt) 1 #define tcl_run(f_opt) #endif /* TCL_QSTAT */ /* connects to server side routine pbs_statjob() in lib/Libifl/pbs_statjob.c */ /* routes to req_stat_job() in server/req_stat.c (PBS_BATCH_StatusJob) */ int main( int argc, /* I */ char **argv) /* I */ { int c; int errflg = 0; int any_failed = 0; extern char *optarg; char *conflict = "qstat: conflicting options.\n"; #if (TCL_QSTAT == 0) char *pc; #endif int located = FALSE; char option[3]; char job_id[PBS_MAXCLTJOBID]; char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char server_old[MAXSERVERNAME] = ""; char rmt_server[MAXSERVERNAME]; char destination[PBS_MAXDEST + 1]; char *def_server; char *queue_name_out; char *server_name_out; char *ExtendOpt = NULL; char operand[PBS_MAXCLTJOBID + 1]; int alt_opt; int f_opt, B_opt, Q_opt; int p_header = TRUE; int stat_single_job = 0; enum { JOBS, QUEUES, SERVERS } mode; struct batch_status *p_status; struct batch_status *p_server; struct attropl *p_atropl = 0; char *errmsg; int exec_only = 0; #ifndef mbool #define mbool char #endif /* !mbool */ #ifndef TRUE #define TRUE 1 #endif /* !TRUE */ #ifndef FALSE #define FALSE 1 #endif /* !FALSE */ #if !defined(PBS_NO_POSIX_VIOLATION) #define GETOPT_ARGS "aeE:filn1qrsu:xGMQRBW:-:" #else #define GETOPT_ARGS "flQBW:" #endif /* PBS_NO_POSIX_VIOLATION */ mode = JOBS; /* default */ alt_opt = 0; f_opt = 0; B_opt = 0; Q_opt = 0; tcl_init(); tcl_addarg(flags, argv[0]); option[0] = '-'; option[2] = '\0'; if (getenv("PBS_QSTAT_EXECONLY") != NULL) exec_only = 1; while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) { option[1] = (char)c; tcl_addarg(flags, option); tcl_addarg(flags, optarg); switch (c) { #if !defined(PBS_NO_POSIX_VIOLATION) case '1': alt_opt |= ALT_DISPLAY_o; break; case 'a': alt_opt |= ALT_DISPLAY_a; break; case 'e': exec_only = 1; break; case 'E': if (optarg != NULL) ExtendOpt = strdup(optarg); break; case 'i': alt_opt |= ALT_DISPLAY_i; add_atropl(&p_atropl, ATTR_state, NULL, "EHQTW", EQ); break; case 'n': alt_opt |= ALT_DISPLAY_n; break; case 'q': alt_opt |= ALT_DISPLAY_q; mode = QUEUES; break; case 'r': alt_opt |= ALT_DISPLAY_r; add_atropl(&p_atropl, ATTR_state, NULL, "RS", EQ); break; case 's': alt_opt |= ALT_DISPLAY_s; break; case 'u': alt_opt |= ALT_DISPLAY_u; add_atropl(&p_atropl, ATTR_u, NULL, optarg, EQ); break; case 'R': alt_opt |= ALT_DISPLAY_R; break; case 'G': alt_opt |= ALT_DISPLAY_G; break; case 'M': alt_opt |= ALT_DISPLAY_Mw; break; #endif /* PBS_NO_POSIX_VIOLATION */ case 'f': if (alt_opt != 0) { fprintf(stderr, "%s", conflict); errflg++; } f_opt = 1; break; case 'x': DisplayXML = TRUE; break; case 'B': B_opt = 1; mode = SERVERS; if (Q_opt || alt_opt) { fprintf(stderr, "%s", conflict); errflg++; } break; case 'l': alias_opt = TRUE; break; case 'Q': Q_opt = 1; mode = QUEUES; if (B_opt || alt_opt) { fprintf(stderr, "%s", conflict); errflg++; } break; case '-': /* handle '--' options */ if ((optarg != NULL) && !strcmp(optarg, "version")) { fprintf(stderr, "version: %s\n", PACKAGE_VERSION); exit(0); } if ((optarg != NULL) && !strcmp(optarg, "about")) { TShowAbout(); exit(0); } /* unexpected '--' option received */ errflg = 1; break; case 'W': #if (TCL_QSTAT == 0) pc = optarg; while (*pc) { switch (*pc) { case 'a': alt_opt |= ALT_DISPLAY_a; break; case 'i': alt_opt |= ALT_DISPLAY_i; add_atropl(&p_atropl, ATTR_state, (char *)0, "EHQTW", EQ); break; case 'r': alt_opt |= ALT_DISPLAY_r; add_atropl(&p_atropl, ATTR_state, (char *)0, "RS", EQ); break; case 'u': /* note - u option is assumed to be last in */ /* string and all remaining is the name list */ alt_opt |= ALT_DISPLAY_u; while (*++pc == ' '); add_atropl(&p_atropl, ATTR_u, (char *)0, pc, EQ); pc = pc + strlen(pc) - 1; /* for the later incr */ break; case 'n': alt_opt |= ALT_DISPLAY_n; break; case 's': alt_opt |= ALT_DISPLAY_s; break; case 'q': alt_opt |= ALT_DISPLAY_q; mode = QUEUES; break; case 'R': alt_opt |= ALT_DISPLAY_R; break; case 'G': alt_opt |= ALT_DISPLAY_G; break; case 'M': alt_opt |= ALT_DISPLAY_Mw; break; case ' ': break; /* ignore blanks */ default: errflg++; } ++pc; } #endif /* (TCL_QSTAT == 0) */ break; case '?': default: /* unexpected argument */ errflg++; break; } /* END switch (c) */ } /* END while (c = getopt()) */ #if !defined(PBS_NO_POSIX_VIOLATION) /* certain combinations are not allowed */ c = alt_opt & (ALT_DISPLAY_a | ALT_DISPLAY_i | ALT_DISPLAY_r | ALT_DISPLAY_q); if ((c != 0) && (c != ALT_DISPLAY_a) && (c != ALT_DISPLAY_i) && (c != ALT_DISPLAY_r) && (c != ALT_DISPLAY_q)) { fprintf(stderr, "%s", conflict); errflg++; } c = alt_opt & (ALT_DISPLAY_Mw | ALT_DISPLAY_G); if (c == (ALT_DISPLAY_Mw | ALT_DISPLAY_G)) { fprintf(stderr, "%s", conflict); errflg++; } if ((alt_opt & ALT_DISPLAY_q) && (f_opt == 1)) { fprintf(stderr, "%s", conflict); errflg++; } if ((alt_opt & ALT_DISPLAY_o) && !((alt_opt & ALT_DISPLAY_n) || (f_opt))) { fprintf(stderr, "%s", conflict); errflg++; } if (alt_opt & ALT_DISPLAY_o) { linesize = maxlinesize; alt_opt &= ~ALT_DISPLAY_o; } #endif /* PBS_NO_POSIX_VIOLATION */ if (errflg) { static char usage[] = "usage: \n\ qstat [-f [-1]] [-W site_specific] [-x] [ job_identifier... | destination... ]\n\ qstat [-a|-i|-r|-e] [-u user] [-n [-1]] [-s] [-G|-M] [-R] [job_id... | destination...]\n\ qstat -Q [-f [-1]] [-W site_specific] [ destination... ]\n\ qstat -q [-G|-M] [ destination... ]\n\ qstat -B [-f [-1]] [-W site_specific] [ server_name... ]\n"; fprintf(stderr,"%s", usage); exit(2); } def_server = pbs_default(); if (def_server == NULL) def_server = ""; if (optind >= argc) { /* If no arguments, then set defaults */ switch (mode) { case JOBS: server_out[0] = '@'; strcpy(&server_out[1], def_server); tcl_addarg(ops, server_out); job_id_out[0] = '\0'; server_out[0] = '\0'; goto job_no_args; /*NOTREACHED*/ break; case QUEUES: server_out[0] = '@'; strcpy(&server_out[1], def_server); tcl_addarg(ops, server_out); queue_name_out = NULL; server_out[0] = '\0'; goto que_no_args; /*NOTREACHED*/ break; case SERVERS: tcl_addarg(ops, def_server); server_out[0] = '\0'; goto svr_no_args; /*NOTREACHED*/ break; default: /* NO-OP */ break; } } /* END if (optind >= argc) */ for (;optind < argc;optind++) { int connect; int ret; located = FALSE; strcpy(operand, argv[optind]); tcl_addarg(ops, operand); switch (mode) { case JOBS: /* get status of batch jobs */ if (isjobid(operand)) { /* must be a job-id */ stat_single_job = 1; strcpy(job_id, operand); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qstat: illegally formed job identifier: %s\n", job_id); ret = tcl_stat(error, NULL, f_opt); any_failed = 1; break; } } else { /* must be a destination-id */ stat_single_job = 0; strcpy(destination, operand); if (parse_destination_id( destination, &queue_name_out, &server_name_out)) { fprintf(stderr, "qstat: illegally formed destination: %s\n", destination); ret = tcl_stat(error, NULL, f_opt); any_failed = 1; break; } if (notNULL(server_name_out)) { strcpy(server_out, server_name_out); } else { server_out[0] = '\0'; } strcpy(job_id_out, queue_name_out); if (*queue_name_out != '\0') { add_atropl(&p_atropl, ATTR_q, NULL, queue_name_out, EQ); } } /* END else */ job_no_args: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qstat: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); ret = tcl_stat(error, NULL, f_opt); any_failed = connect; break; } if ((alt_opt != 0) && (strcmp(pbs_server, server_old) != 0)) { /* changing to a different server */ p_server = pbs_statserver(connect, NULL, NULL); strcpy(server_old, pbs_server); } else { p_server = 0; } if ((stat_single_job == 1) || (p_atropl == 0)) { p_status = pbs_statjob( connect, job_id_out, NULL, exec_only ? EXECQUEONLY : ExtendOpt); } else { p_status = pbs_selstat(connect, p_atropl, exec_only ? EXECQUEONLY : NULL); } if (p_status == NULL) { if ((pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto job_no_args; } ret = tcl_stat("job", NULL, f_opt); prt_job_err("qstat", connect, job_id_out); any_failed = pbs_errno; } else { ret = tcl_stat("job", NULL, f_opt); if (pbs_errno != PBSE_NONE) { prt_job_err("qstat", connect, job_id_out); any_failed = pbs_errno; } } } else { if (alt_opt != 0) { altdsp_statjob(p_status, p_server, alt_opt); } else if ((f_opt == 0) || tcl_stat("job", p_status, f_opt)) { display_statjob(p_status, p_header, f_opt); } p_header = FALSE; pbs_statfree(p_status); } pbs_disconnect(connect); break; case QUEUES: /* get status of batch queues */ strcpy(destination, operand); if (parse_destination_id(destination, &queue_name_out, &server_name_out)) { fprintf(stderr, "qstat: illegal 'destination' value\n"); ret = tcl_stat(error, NULL, f_opt); any_failed = 1; break; } else { if (notNULL(server_name_out)) { strcpy(server_out, server_name_out); } else server_out[0] = '\0'; } que_no_args: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qstat: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); ret = tcl_stat(error, NULL, f_opt); any_failed = connect; break; } p_status = pbs_statque(connect, queue_name_out, NULL, NULL); if (p_status == NULL) { if (pbs_errno) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "qstat: %s ", errmsg); } else fprintf(stderr, "qstat: Error (%d - %s) getting status of queue ", pbs_errno, pbs_strerror(pbs_errno)); fprintf(stderr, "%s\n", queue_name_out); ret = tcl_stat(error, NULL, f_opt); any_failed = pbs_errno; } } else { if (alt_opt & ALT_DISPLAY_q) { altdsp_statque(pbs_server, p_status, alt_opt); } else if (tcl_stat("queue", p_status, f_opt)) { display_statque(p_status, p_header, f_opt); } p_header = FALSE; pbs_statfree(p_status); } pbs_disconnect(connect); break; case SERVERS: /* get status of batch servers */ strcpy(server_out, operand); svr_no_args: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qstat: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); ret = tcl_stat(error, NULL, f_opt); any_failed = connect; break; } p_status = pbs_statserver(connect, NULL, NULL); if (p_status == NULL) { if (pbs_errno) { errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "qstat: %s ", errmsg); } else fprintf(stderr, "qstat: Error (%d - %s) getting status of server ", pbs_errno, pbs_strerror(pbs_errno)); fprintf(stderr, "%s\n", server_out); ret = tcl_stat(error, NULL, f_opt); any_failed = pbs_errno; } } else { if (tcl_stat("server", p_status, f_opt)) display_statserver(p_status, p_header, f_opt); p_header = FALSE; pbs_statfree(p_status); } pbs_disconnect(connect); break; } /* END switch (mode) */ } /* END for () */ tcl_run(f_opt); exit(any_failed); } /* END main() */ torque-2.4.16/src/cmds/pbsdsh.c0000664000113300011330000005645611442504364013223 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * pbs_dsh - a distribute task program using the Task Management API * */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "tm.h" #include "mcom.h" extern int *tm_conn; #ifndef PBS_MAXNODENAME #define PBS_MAXNODENAME 80 #endif #define RESCSTRLEN (PBS_MAXNODENAME+200) /* * a bit of code to map a tm_ error number to the symbol */ struct tm_errcode { int trc_code; char *trc_name; } tm_errcode[] = { { TM_ESYSTEM, "TM_ESYSTEM" }, { TM_ENOEVENT, "TM_ENOEVENT" }, { TM_ENOTCONNECTED, "TM_ENOTCONNECTED" }, { TM_EUNKNOWNCMD, "TM_EUNKNOWNCMD" }, { TM_ENOTIMPLEMENTED, "TM_ENOTIMPLEMENTED" }, { TM_EBADENVIRONMENT, "TM_EBADENVIRONMENT" }, { TM_ENOTFOUND, "TM_ENOTFOUND" }, { 0, "?" } }; int *ev; tm_event_t *events_spawn; tm_event_t *events_obit; int numnodes; tm_task_id *tid; int verbose = 0; sigset_t allsigs; char *id; int stdoutfd, stdoutport; fd_set permrfsd; int grabstdio = 0; char *get_ecname( int rc) { struct tm_errcode *p; for (p = &tm_errcode[0];p->trc_code;++p) { if (p->trc_code == rc) break; } return(p->trc_name); } int fire_phasers = 0; void bailout( int sig) { fire_phasers = sig; return; } /* * obit_submit - submit an OBIT request * FIXME: do we need to retry this multiple times? */ int obit_submit( int c) /* the task index number */ { int rc; if (verbose) { fprintf(stderr, "%s: sending obit for task %u\n", id, *(tid + c)); } rc = tm_obit(*(tid + c), ev + c, events_obit + c); if (rc == TM_SUCCESS) { if (*(events_obit + c) == TM_NULL_EVENT) { if (verbose) { fprintf(stderr, "%s: task already dead\n", id); } } else if (*(events_obit + c) == TM_ERROR_EVENT) { if (verbose) { fprintf(stderr, "%s: Error on Obit return\n", id); } } } else { fprintf(stderr, "%s: failed to register for task termination notice, task %d\n", id, c); } return(rc); } /* END obit_submit() */ /* * mom_reconnect - continually attempt to reconnect to mom * If we do reconnect, resubmit OBIT requests * * FIXME: there's an assumption that all tasks have already been * spawned and initial OBIT requests have been made. */ void mom_reconnect(void) { int c, rc; struct tm_roots rootrot; for (;;) { tm_finalize(); sigprocmask(SIG_UNBLOCK, &allsigs, NULL); sleep(2); sigprocmask(SIG_BLOCK, &allsigs, NULL); /* attempt to reconnect */ rc = tm_init(0, &rootrot); if (rc == TM_SUCCESS) { fprintf(stderr, "%s: reconnected\n", id); /* resend obit requests */ for (c = 0;c < numnodes;++c) { if (*(events_obit + c) != TM_NULL_EVENT) { rc = obit_submit(c); if (rc != TM_SUCCESS) { break; /* reconnect again */ } } else if (verbose) { fprintf(stderr, "%s: skipping obit resend for %u\n", id, *(tid + c)); } } break; } } return; } /* END mom_reconnect() */ void getstdout(void) { struct timeval tv = { 0, 10000 }; fd_set rfsd; int newfd, i; char buf[1024]; ssize_t bytes; int ret; static int maxfd = -1; int flags; if (maxfd == -1) { if (stdoutfd > *tm_conn) maxfd = stdoutfd; else maxfd = *tm_conn; } rfsd = permrfsd; if (maxfd < (int)FD_SETSIZE) FD_SET(stdoutfd, &rfsd); FD_SET(*tm_conn, &permrfsd); if ((ret = select(maxfd + 1, &rfsd, NULL, NULL, &tv)) > 0) { if (FD_ISSET(*tm_conn, &rfsd)) { return; } if (FD_ISSET(stdoutfd, &rfsd)) { newfd = accept(stdoutfd, NULL, NULL); if (newfd > maxfd) maxfd = newfd; flags = fcntl(newfd, F_GETFL); #if defined(FNDELAY) && !defined(__hpux) flags |= FNDELAY; #else flags |= O_NONBLOCK; #endif fcntl(newfd, F_SETFL, flags); FD_SET(newfd, &permrfsd); FD_CLR(stdoutfd, &rfsd); ret--; } if (ret) { for (i = 0; i <= maxfd; i++) { if (FD_ISSET(i, &rfsd)) { if ((bytes = read(i, &buf, 1023)) > 0) { buf[bytes] = '\0'; fprintf(stdout, "%s", buf); } else if (bytes == 0) { FD_CLR(i, &permrfsd); close(i); if (i == maxfd) { int j; maxfd = stdoutfd; for (j = 0; j < i; j++) if (FD_ISSET(j, &permrfsd)) if (j > maxfd) maxfd = j; } } else { fprintf(stderr, "%s: error in read\n", id); } ret--; if (ret <= 0) break; } } } } } /* * wait_for_task - wait for all spawned tasks to * a. have the spawn acknowledged, and * b. the task to terminate and return the obit with the exit status */ void wait_for_task( int *nspawned) /* number of tasks spawned */ { int c; tm_event_t eventpolled; int nobits = 0; int rc; int tm_errno; while (*nspawned || nobits) { if (grabstdio) getstdout(); if (verbose) { } if (fire_phasers) { tm_event_t event; for (c = 0;c < numnodes;c++) { if (*(tid + c) == TM_NULL_TASK) continue; fprintf(stderr, "%s: killing task %u signal %d\n", id, *(tid + c), fire_phasers); tm_kill(*(tid + c), fire_phasers, &event); } tm_finalize(); exit(1); } sigprocmask(SIG_UNBLOCK, &allsigs, NULL); rc = tm_poll(TM_NULL_EVENT, &eventpolled, !grabstdio, &tm_errno); sigprocmask(SIG_BLOCK, &allsigs, NULL); if (rc != TM_SUCCESS) { fprintf(stderr, "%s: Event poll failed, error %s\n", id, get_ecname(rc)); if (rc == TM_ENOTCONNECTED) { mom_reconnect(); } else { exit(2); } } if (eventpolled == TM_NULL_EVENT) continue; for (c = 0;c < numnodes;++c) { if (eventpolled == *(events_spawn + c)) { /* spawn event returned - register obit */ if (verbose) { fprintf(stderr, "%s: spawn event returned: %d (%d spawns and %d obits outstanding)\n", id, c, *nspawned, nobits); } (*nspawned)--; if (tm_errno) { fprintf(stderr, "%s: error %d on spawn\n", id, tm_errno); continue; } rc = obit_submit(c); if (rc == TM_SUCCESS) { if ((*(events_obit + c) != TM_NULL_EVENT) && (*(events_obit + c) != TM_ERROR_EVENT)) { nobits++; } } } else if (eventpolled == *(events_obit + c)) { /* obit event, let's check it out */ if (tm_errno == TM_ESYSTEM) { if (verbose) { fprintf(stderr, "%s: error TM_ESYSTEM on obit (resubmitting)\n", id); } sleep(2); /* Give the world a second to take a breath */ obit_submit(c); continue; /* Go poll again */ } if (tm_errno != 0) { fprintf(stderr, "%s: error %d on obit for task %d\n", id, tm_errno, c); } /* task exited */ if (verbose) { fprintf(stderr, "%s: obit event returned: %d (%d spawns and %d obits outstanding)\n", id, c, *nspawned, nobits); } nobits--; *(tid + c) = TM_NULL_TASK; *(events_obit + c) = TM_NULL_EVENT; if ((verbose != 0) || (*(ev + c) != 0)) { fprintf(stderr, "%s: task %d exit status %d\n", id, c, *(ev + c)); } } } } return; } /* END wait_for_task() */ /* ask TM for all node resc descriptions and parse the output * for hostnames */ char *gethostnames( tm_node_id *nodelist) { char *allnodes; char *rescinfo; tm_event_t *rescevent; tm_event_t resultevent; char *hoststart; int rc, tm_errno, i, j; allnodes = calloc(numnodes, PBS_MAXNODENAME + 1 + sizeof(char)); rescinfo = calloc(numnodes, RESCSTRLEN + 1 + sizeof(char)); rescevent = calloc(numnodes, sizeof(tm_event_t)); if (!allnodes || !rescinfo || !rescevent) { fprintf(stderr, "%s: malloc failed!\n", id); tm_finalize(); exit(1); } /* submit resource requests */ for (i = 0;i < numnodes;i++) { if (tm_rescinfo( nodelist[i], rescinfo + (i*RESCSTRLEN), RESCSTRLEN - 1, rescevent + i) != TM_SUCCESS) { fprintf(stderr, "%s: error from tm_rescinfo()\n", id); tm_finalize(); exit(1); } } /* read back resource requests */ for (j = 0, i = 0; i < numnodes; i++) { rc = tm_poll(TM_NULL_EVENT, &resultevent, 1, &tm_errno); if ((rc != TM_SUCCESS) || (tm_errno != TM_SUCCESS)) { fprintf(stderr, "%s: error from tm_poll() %d\n", id, rc); tm_finalize(); exit(1); } for (j = 0; j < numnodes; j++) { if (*(rescevent + j) == resultevent) break; } if (j == numnodes) { fprintf(stderr, "%s: unknown resource result\n", id); tm_finalize(); exit(1); } if (verbose) fprintf(stderr, "%s: rescinfo from %d: %s\n", id, j, rescinfo + (j*RESCSTRLEN)); strtok(rescinfo + (j*RESCSTRLEN), " "); hoststart = strtok(NULL, " "); if (hoststart == NULL) { fprintf(stderr, "%s: can't find a hostname in resource result\n", id); tm_finalize(); exit(1); } strcpy(allnodes + (j*PBS_MAXNODENAME), hoststart); } free(rescinfo); free(rescevent); return(allnodes); } /* return a vnode number matching targethost */ int findtargethost(char *allnodes, char *targethost) { int i; char *ptr; int vnode = 0; if ((ptr = strchr(targethost, '/')) != NULL) { *ptr = '\0'; ptr++; vnode = atoi(ptr); } for (i = 0; i < numnodes; i++) { if (!strcmp(allnodes + (i*PBS_MAXNODENAME), targethost)) { if (vnode == 0) return(i); vnode--; } } if (i == numnodes) { fprintf(stderr, "%s: %s not found\n", id, targethost); tm_finalize(); exit(1); } return(-1); } /* prune nodelist down to a unique list by comparing with * the hostnames in all nodes */ int uniquehostlist(tm_node_id *nodelist, char *allnodes) { int hole, i, j, umove = 0; for (hole = numnodes, i = 0, j = 1; j < numnodes; i++, j++) { if (strcmp(allnodes + (i*PBS_MAXNODENAME), allnodes + (j*PBS_MAXNODENAME)) == 0) { if (!umove) { umove = 1; hole = j; } } else if (umove) { nodelist[hole++] = nodelist[j]; } } return(hole); } static int build_listener( int *port) { int s; struct sockaddr_in addr; torque_socklen_t len = sizeof(addr); if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) fprintf(stderr, "%s: socket", id); if (listen(s, 1024) < 0) fprintf(stderr, "%s: listen", id); if (getsockname(s, (struct sockaddr *)&addr, &len) < 0) { fprintf(stderr, "%s: getsockname", id); } *port = ntohs(addr.sin_port); return (s); } int main( int argc, char *argv[]) { int c; int err = 0; int ncopies = -1; int onenode = -1; int rc; struct tm_roots rootrot; int nspawned = 0; tm_node_id *nodelist; int start; int stop; int sync = 0; int pernode = 0; char *targethost = NULL; char *allnodes; struct sigaction act; char **ioenv; extern int optind; extern char *optarg; int posixly_correct_set_by_caller = 0; char *envstr; id = malloc(60 * sizeof(char)); if (id == NULL) { fprintf(stderr, "%s: malloc failed, (%d)\n", id, errno); return(1); } sprintf(id, "pbsdsh%s", ((getenv("PBSDEBUG") != NULL) && (getenv("PBS_TASKNUM") != NULL)) ? getenv("PBS_TASKNUM") : ""); #ifdef __GNUC__ /* If it's already set, we won't unset it later */ if (getenv("POSIXLY_CORRECT") != NULL) posixly_correct_set_by_caller = 1; envstr = strdup("POSIXLY_CORRECT=1"); putenv(envstr); #endif while ((c = getopt(argc, argv, "c:n:h:osuv")) != EOF) { switch (c) { case 'c': ncopies = atoi(optarg); if (ncopies <= 0) { err = 1; } break; case 'h': targethost = strdup(optarg); /* run on this 1 hostname */ break; case 'n': onenode = atoi(optarg); if (onenode < 0) { err = 1; } break; case 'o': grabstdio = 1; break; case 's': sync = 1; /* force synchronous spawns */ break; case 'u': pernode = 1; /* run once per node (unique hostnames) */ break; case 'v': verbose = 1; /* turn on verbose output */ break; default: err = 1; break; } /* END switch (c) */ } /* END while ((c = getopt()) != EOF) */ if ((err != 0) || ((onenode >= 0) && (ncopies >= 1))) { fprintf(stderr, "Usage: %s [-c copies][-o][-s][-u][-v] program [args]...]\n", argv[0]); fprintf(stderr, " %s [-n nodenumber][-o][-s][-u][-v] program [args]...\n", argv[0]); fprintf(stderr, " %s [-h hostname][-o][-v] program [args]...\n", argv[0]); fprintf(stderr, "Where -c copies = run copy of \"args\" on the first \"copies\" nodes,\n"); fprintf(stderr, " -n nodenumber = run a copy of \"args\" on the \"nodenumber\"-th node,\n"); fprintf(stderr, " -o = capture stdout of processes,\n"); fprintf(stderr, " -s = forces synchronous execution,\n"); fprintf(stderr, " -u = run on unique hostnames,\n"); fprintf(stderr, " -h = run on this specific hostname,\n"); fprintf(stderr, " -v = forces verbose output.\n"); exit(1); } #ifdef __GNUC__ if (!posixly_correct_set_by_caller) { putenv("POSIXLY_CORRECT"); free(envstr); } #endif if (getenv("PBS_ENVIRONMENT") == NULL) { fprintf(stderr, "%s: not executing under PBS\n", id); return(1); } /* * Set up interface to the Task Manager */ if ((rc = tm_init(0, &rootrot)) != TM_SUCCESS) { fprintf(stderr, "%s: tm_init failed, rc = %s (%d)\n", id, get_ecname(rc), rc); return(1); } sigemptyset(&allsigs); sigaddset(&allsigs, SIGHUP); sigaddset(&allsigs, SIGINT); sigaddset(&allsigs, SIGTERM); act.sa_mask = allsigs; act.sa_flags = 0; /* We want to abort system calls and call a function. */ #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; #endif act.sa_handler = bailout; sigaction(SIGHUP, &act, NULL); sigaction(SIGINT, &act, NULL); sigaction(SIGTERM, &act, NULL); #ifdef DEBUG if (rootrot.tm_parent == TM_NULL_TASK) { fprintf(stderr, "%s: I am the mother of all tasks\n", id); } else { fprintf(stderr, "%s: I am but a child in the scheme of things\n", id); } #endif /* DEBUG */ if ((rc = tm_nodeinfo(&nodelist, &numnodes)) != TM_SUCCESS) { fprintf(stderr, "%s: tm_nodeinfo failed, rc = %s (%d)\n", id, get_ecname(rc), rc); return(1); } /* nifty unique/hostname code */ if (pernode || targethost) { allnodes = gethostnames(nodelist); if (targethost) { onenode = findtargethost(allnodes, targethost); } else { numnodes = uniquehostlist(nodelist, allnodes); } free(allnodes); if (targethost) free(targethost); } /* We already checked the lower bounds in the argument processing, now we check the upper bounds */ if ((onenode >= numnodes) || (ncopies > numnodes)) { fprintf(stderr, "%s: only %d nodes available\n", id, numnodes); return(1); } /* malloc space for various arrays based on number of nodes/tasks */ tid = (tm_task_id *)calloc(numnodes, sizeof(tm_task_id)); events_spawn = (tm_event_t *)calloc(numnodes, sizeof(tm_event_t)); events_obit = (tm_event_t *)calloc(numnodes, sizeof(tm_event_t)); ev = (int *)calloc(numnodes, sizeof(int)); if ((tid == NULL) || (events_spawn == NULL) || (events_obit == NULL) || (ev == NULL)) { /* FAILURE - cannot alloc memory */ fprintf(stderr, "%s: memory alloc of task ids failed\n", id); return(1); } for (c = 0;c < numnodes;c++) { *(tid + c) = TM_NULL_TASK; *(events_spawn + c) = TM_NULL_EVENT; *(events_obit + c) = TM_NULL_EVENT; *(ev + c) = 0; } /* END for (c) */ /* Now spawn the program to where it goes */ if (onenode >= 0) { /* Spawning one copy onto logical node "onenode" */ start = onenode; stop = onenode + 1; } else if (ncopies >= 0) { /* Spawn a copy of the program to the first "ncopies" nodes */ start = 0; stop = ncopies; } else { /* Spawn a copy on all nodes */ start = 0; stop = numnodes; } if ((ioenv = calloc(2, sizeof(char *)))==NULL) { /* FAILURE - cannot alloc memory */ fprintf(stderr,"%s: memory alloc of ioenv failed\n", id); return(1); } if (grabstdio != 0) { stdoutfd = build_listener(&stdoutport); if ((*ioenv = calloc(50,sizeof(char *))) == NULL) { /* FAILURE - cannot alloc memory */ fprintf(stderr,"%s: memory alloc of *ioenv failed\n", id); return(1); } snprintf(*ioenv,49,"TM_STDOUT_PORT=%d", stdoutport); FD_ZERO(&permrfsd); } sigprocmask(SIG_BLOCK, &allsigs, NULL); for (c = start; c < stop; ++c) { if ((rc = tm_spawn( argc - optind, argv + optind, ioenv, *(nodelist + c), tid + c, events_spawn + c)) != TM_SUCCESS) { fprintf(stderr, "%s: spawn failed on node %d err %s\n", id, c, get_ecname(rc)); } else { if (verbose) fprintf(stderr, "%s: spawned task %d\n", id, c); ++nspawned; if (sync) wait_for_task(&nspawned); /* one at a time */ } } /* END for (c) */ if (sync == 0) wait_for_task(&nspawned); /* wait for all to finish */ /* * Terminate interface with Task Manager */ tm_finalize(); return 0; } /* END main() */ /* END pbsdsh.c */ torque-2.4.16/src/cmds/pbspoe.c0000664000113300011330000004420211272401236013205 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * pbspoe * A general purpose replacement for POE commands like poe and pdbx * that usually reserve nodes through the job manager but can * also use -procs N -hostfile foo. * If running interactively, invokes these commands directly. * If running under PBS, looks at PBS hostfile, creates an argument * list with -hostfile, and runs job. * * Originally written 4/13/95 by Bill Saphir, NAS/CSC * Based on "pbspoe" program written by Tom Proett * Modified by Ed Hook for LaRC's SP2 system, July 1995 * * Modified 3/99 to support PBS 2.0 under IBM PSSP 3.1 software. */ #include #include #include #include #include #include #include #include #include #include #include "pbs_ifl.h" #define POE_PATH "/usr/lpp/ppe.poe/bin/poe" #define PDBX_PATH "/usr/lpp/ppe.poe/bin/pdbx" #define XPDBX_PATH "/usr/lpp/ppe.poe/bin/xpdbx" #define INTERACTIVE_FILE "/usr/local/pbs/etc/interactive" void set_if_undefined(char *name, char *val); void check_environment(); int is_pbs_job(); char **pbs_setup(char *command, int argc, char **argv); void run_command(char *command, char **argv); char *get_real_command(char *argv0); int is_interactive_ok(); void refuse_interactive(); /* global Data */ char *mcn; /* my command name, set in main for messages */ char ncmdfname[PATH_MAX+1]; char *nhfile = 0; char *ocmdfile = 0; char *pbsjobkey; int is_pbs_job(void) { char *val; val = getenv("PBS_JOBID"); if (val == NULL) return(0); if ((pbsjobkey = getenv("PBS_JOB_KEY")) == NULL) { fprintf(stderr, "%s: Unable to obtain Job Key for switch setup\n", mcn); exit(1); } return(1); } void set_if_undefined(char *name, char *val) { char *ret; int result; ret = getenv(name); if (ret != NULL) return; result = putenv(val); if (result != 0) { fprintf(stderr, "%s: Fatal Error: unable to set environment variable %s", mcn, name); exit(1); } fprintf(stderr, "%s: Warning: added variable %s to environment\n", mcn, name); } void check_environment(void) { set_if_undefined("MP_PULSE", "MP_PULSE=0"); set_if_undefined("MP_EUILIB", "MP_EUILIB=us"); set_if_undefined("MP_RESD", "MP_RESD=no"); } #define LINEBUFSIZ 1024 int fix_cmdfile(char *ocmd, char *ncmd) { FILE *new; FILE *old; int len; char linebuf[LINEBUFSIZ]; char *pl; if ((old = fopen(ocmd, "r")) == NULL) { fprintf(stderr, "%s: Unable to open command file: %s\n", mcn, ocmd); return (-1); } sprintf(ncmd, "/tmp/pbsCtemp.%s", getenv("PBS_JOBID")); if ((new = fopen(ncmd, "w")) == NULL) { fprintf(stderr, "%s: Unable to open %s for new command file\n", mcn, ncmd); return (-1); } strcpy(linebuf, PBSPD); /* prefix "command" with pbspd */ strcat(linebuf, " "); strcat(linebuf, pbsjobkey); /* and job key */ strcat(linebuf, " "); pl = linebuf + strlen(linebuf); len = LINEBUFSIZ - ((int)pl - (int)linebuf); while (fgets(pl, len, old) != NULL) { fputs(linebuf, new); } fclose(new); fclose(old); return (0); } /* * clean_up - dont leave files we created lying arround */ void clean_up(int exval) { if (nhfile) (void)unlink(nhfile); if (ocmdfile) (void) unlink(ncmdfname); exit(exval); } char **pbs_setup( char *command, int argc, char *argv[]) { char *jobid; int have_command = 0; static char hostfile[PATH_MAX+1]; static char nhoststring[10]; static char nodename[PATH_MAX+1]; FILE *nf; char **newargs; char *nodefile; int nhosts = 0, nprocs, i, j; int nprocs_specified; char **hfile_mem; int hfile_size = 16; int index; char *pcolon = NULL; char *pcomma; char *offset; /* print out this message to remind folks they're running under PBS. * Especially important for interactive users */ fprintf(stderr, "%s: Running job under PBS\n", mcn); jobid = getenv("PBS_JOBID"); if (jobid == NULL) { /* should be an impossible error since we've already checked for this */ fprintf(stderr, "%s: Fatal Error: can't get JOBID from environment\n", mcn); exit(1); } /* fetch list of nodes allocated to this job by pbs_mom */ nodefile = getenv("PBS_NODEFILE"); if (nodefile == NULL) { fprintf(stderr, "%s: PBS_NODEFILE not in the environment\n", mcn); exit(EXIT_FAILURE); } strcpy(hostfile, nodefile); nf = fopen(nodefile, "r"); if (nf == NULL) { fprintf(stderr, "%s: Can't open PBS hostfile %s\n", mcn, hostfile); exit(EXIT_FAILURE); } hfile_mem = (char **)malloc(hfile_size * sizeof(char *)); if (hfile_mem == NULL) { fprintf(stderr, "%s: Can't malloc memory", mcn); exit(EXIT_FAILURE); } while (fgets(nodename, PATH_MAX, nf) != NULL) { hfile_mem[nhosts++] = strdup(nodename); if (nhosts == hfile_size) { char **tmpHFileMem; hfile_size *= 2; tmpHFileMem = (char **)realloc(hfile_mem,hfile_size * sizeof(char *)); if (tmpHFileMem == NULL) { fprintf(stderr, "%s: Can't malloc memory", mcn); exit(EXIT_FAILURE); } hfile_mem = tmpHFileMem; } } /* END while (fgets() != NULL) */ fclose(nf); if (nhosts == 0) { fprintf(stderr, "%s: Fatal Error: malformed resource request(s)\n", mcn); exit(EXIT_FAILURE); } sprintf(nhoststring, "%d", nhosts); /* do we have an command file specified in the environment */ ocmdfile = getenv("MP_CMDFILE"); if (ocmdfile && (*ocmdfile == '\0')) ocmdfile = 0; /* if null file name, null the pointer */ /* make an argument list */ newargs = malloc((argc + 8) * sizeof(char *)); if (newargs == NULL) { perror("malloc"); fprintf(stderr, "%s: Unable to allocate space for argument list\n", mcn); exit(1); } /* Must pre-scan arguments to see if cmdfile specified */ for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-cmdfile") == 0) { if (i + 1 == argc) { fprintf(stderr, "%s: -cmdfile must have argument\n", mcn); exit(1); } ocmdfile = argv[i+1]; } } /* if first argument is not an option, or if first is -h and second arg */ /* is not an option, then user specified a program to run, this takes */ /* preceedent over any command file specified. */ if ((argc > 1) && ((*argv[1] != '-') || ((strcmp(argv[1], "-h") == 0) && (argc > 2) && (*argv[2] != '-')))) { /* have a command specified for poe to run */ have_command = 1; if (ocmdfile) { fprintf(stderr, "%s: Progam specified on command line overrides -cmdfile option\n", mcn); ocmdfile = 0; } } /* if neither command nor cmdfile, then cannot run */ if ((have_command == 0) && (ocmdfile == 0)) { fprintf(stderr, "%s: requires either command argument or -cmdfile option\n", mcn); exit(1); } newargs[0] = strrchr(command, '/'); if (newargs[0] == NULL) { fprintf(stderr, "%s:Impossible command error! Contact system administrator\n", mcn); exit(1); } else { /* advance past / character */ (newargs[0])++; } j = 1; if (ocmdfile == 0) { newargs[j++] = PBSPD; newargs[j++] = pbsjobkey; } /* copy user arguments to new array, taking note of certain ones */ nprocs_specified = 0; nprocs = nhosts; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-procs") == 0) { nprocs_specified = 1; newargs[j++] = argv[i++]; /* -procs */ if (i < argc) { newargs[j++] = argv[i]; /* num_of_procs */ nprocs = strtol(argv[i], &pcolon, 10); if (nprocs <= 0) { fprintf(stderr, "%s: Value specified by -procs must be greater than zero\n", mcn); exit(1); } /* pass along user's request */ sprintf(nhoststring, "%d", nprocs); } else { fprintf(stderr, "%s: Error, -procs must specify a value\n", mcn); exit(1); } } else if ((strcmp(argv[i], "-hostfile") == 0) || (strcmp(argv[i], "-hfile") == 0)) { /* skip it, will add our own */ i++; } else if (strcmp(argv[i], "-cmdfile") == 0) { /* skip over it this time, will add our own at end */ ++i; } else { newargs[j++] = argv[i]; } } if (ocmdfile) { /* have cmdfile specified, copy and modify it */ if (fix_cmdfile(ocmdfile, ncmdfname) == -1) { fprintf(stderr, "%s: unable to update command file\n", mcn); exit(1); } newargs[j++] = "-cmdfile"; newargs[j++] = ncmdfname; } if (nhosts < nprocs) { fprintf(stderr, "%s: Warning, (number of host nodes) < (number of procs)\n\t-- assigning multiple processes per node\n\t-- not using high-performance switch mode\n", mcn); putenv("MP_EUILIB=ip"); sprintf(hostfile, "/tmp/pbsHtemp.%s", getenv("PBS_JOBID")); nf = fopen(hostfile, "w"); if (nf == NULL) { fprintf(stderr, "%s: Can't open PBS hostfile %s\n", mcn, hostfile); exit(1); } /* build new hostfile */ for (i = index = 0; i < nprocs; i++) { fprintf(nf, "%s\n", hfile_mem[index++]); if (index == nhosts) index = 0; /* wrap around */ } fclose(nf); } else if (nhosts >= nprocs && pcolon && *pcolon) { /* wants a specific subset */ sprintf(hostfile, "/tmp/pbsTemp.%s", getenv("PBS_JOBID")); nf = fopen(hostfile, "w"); if (nf == NULL) { fprintf(stderr, "%s: Can't open PBS hostfile %s\n", mcn, hostfile); clean_up(1); } nhfile = hostfile; i = 0; /* counts current length of host list */ offset = pcolon + 1; /* point to first index */ while (1) { index = atoi(offset); /* index of current candidate */ /* can't be greater than the total number of nodes */ if (index >= nhosts) { fprintf(stderr, "%s: \"%s\": Index [%d] out-of-range\n", mcn, pcolon, index); clean_up(1); } /* can't specify more nodes than asked for by ":" */ if (++i > nprocs) { fprintf(stderr, "%s: \"%s\" specifies more than %d nodes\n", mcn, pcolon, nprocs); clean_up(1); } /* can't use any node more than once */ if (hfile_mem[index][0] == '@') { fprintf(stderr, "%s: \"%s\": duplicate index [%d]\n", mcn, pcolon, index); clean_up(1); } fprintf(nf, "%s\n", hfile_mem[index]); /* add to our hostfile */ hfile_mem[index][0] = '@'; /* remember using it */ pcomma = strchr(offset, ','); if (pcomma) /* still more in the list */ offset = pcomma + 1; else break; } /* did user specify as many nodes as processes ?? */ if (i < nprocs) { fprintf(stderr, "%s: \"%d%s\" has too few nodes listed\n", mcn, nprocs, pcolon); clean_up(1); } fclose(nf); } for (i = 0 ; i < nhosts ; ++i) free(hfile_mem[i]); free(hfile_mem); newargs[j++] = "-hostfile"; newargs[j++] = hostfile; if (! nprocs_specified) { newargs[j++] = "-procs"; newargs[j++] = nhoststring; }; newargs[j] = NULL; return(newargs); } void run_command( char *command, char *argv[]) { int i; char *psyscmd; int syssz; #ifdef DEBUG char **p; printf("pbspoe exec-ing: "); for (p = argv; *p; ++p) printf("%s ", *p); printf("\n"); #endif /* DEBUG */ fflush(stdout); fflush(stderr); if (ocmdfile || nhfile) { /* must use system() call to start real command so can remove files */ syssz = strlen(command) + 1; i = 1; while (argv[i]) syssz += strlen(argv[i++]) + 1; if ((psyscmd = (char *)malloc(syssz + 1)) == NULL) { fprintf(stderr, "%s: unable to malloc memory\n", mcn); clean_up(1); } strcpy(psyscmd, command); i = 1; while (argv[i]) { strcat(psyscmd, " "); strcat(psyscmd, argv[i++]); } (void)system(psyscmd); clean_up(0); } else { /* run real command directly */ execv(command, argv); /* not reached unless error */ fprintf(stderr, "%s: Error, exec of %s failed\n", mcn, command); perror("execv"); exit(1); } return; } /* END run_command() */ char *get_real_command( char *argv0) { char *command_name; command_name = strrchr(argv0, '/'); if (command_name != NULL) command_name++; /* advance past "/" */ else command_name = argv0; if (!strcmp(command_name, "poe")) return(POE_PATH); if (!strcmp(command_name, "pbspoe")) return(POE_PATH); if (!strcmp(command_name, "pdbx")) return(PDBX_PATH); if (!strcmp(command_name, "xpdbx")) return XPDBX_PATH; if (!strcmp(command_name, "newpoe")) return(POE_PATH); fprintf(stderr, "\"%s\" unknown to the PBS front end.\n", argv0); exit(1); } int is_interactive_ok(void) { struct stat sb; int status; status = stat(INTERACTIVE_FILE, &sb); if (status == -1) { return(0); } return(1); } void refuse_interactive(void) { char *nasty_gram = { "\n" " WARNING !\n" " To run a job on the SP2, you must use PBS. If you\n" " wish to run interactively, \"qsub -I\" is available.\n" " For further information, type \"man qsub\".\n" "\n" "\n" }; fputs(nasty_gram, stderr); exit(1); } int main( int argc, char *argv[]) { char **args, *command; char *hostfile; mcn = argv[0]; /* make sure certain environment variables are set */ check_environment(); /* determine if we're running poe or pdbx */ command = get_real_command(argv[0]); /* add extra arguments if pbs job */ if (is_pbs_job()) { args = pbs_setup(command, argc, argv); run_command(command, args); } else if (is_interactive_ok()) { run_command(command, argv); } else { refuse_interactive(); } return (0); } torque-2.4.16/src/cmds/qmgr.c0000664000113300011330000016563311413216777012712 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qmgr * The qmgr command provides an administrator interface to the batch * system. The command reads directives from standard input. The syntax * of each directive is checked and the appropriate request is sent to the * batch server or servers. * * Synopsis: * qmgr [-a] [-c command] [-e] [-n] [-z] [server...] * * Options: * -a Abort qmgr on any syntax errors or any requests rejected by a * server. * * -c command * Execute a single command and exit qmgr. * * -e Echo all commands to standard output. * * -n No commands are executed, syntax checking only is performed. * * -z No errors are written to standard error. * * Arguments: * server... * A list of servers to administer. If no servers are given, then * use the default server. * * * Exitcodes: * 0 - successful * 1 - error in parse * 2 - error in execute * 3 - error connect_servers * 4 - error set_active * 5 - memory allocation error * * * * * Written by: * Bruce Kelly * National Energy Research Supercomputer Center * Livermore, CA * March, 1993 * */ #include #include #include #include #include #include #ifdef HAVE_READLINE /* some versions have a buggy readline header */ #undef HAVE_CONFIG_H #include #define HAVE_CONFIG_H #include #include #endif /* END HAVE_READLINE */ /* PBS include files */ #include "cmds.h" #include "qmgr.h" /* Global Variables */ struct server *servers = NULL; /* Linked list of server structures */ int nservers = 0; /* Number of servers */ int zopt = FALSE; /* -z option */ /* active objects */ struct objname *active_servers; struct objname *active_queues; struct objname *active_nodes; int main( int argc, char **argv) { static char opts[] = "ac:enz"; /* See man getopt */ static char usage[] = "Usage: qmgr [-a] [-c command] [-e] [-n] [-z] [server...]\n"; int aopt = FALSE; /* -a option */ int eopt = FALSE; /* -e option */ int nopt = FALSE; /* -n option */ char *copt = NULL; /* -c command option */ int c; /* Individual option */ int errflg = 0; /* Error flag */ char request[MAX_LINE_LEN]; /* Current request */ int oper; /* Operation: create, delete, set, unset, list, print */ int type; /* Object type: server or queue */ char *name = NULL; /* Object name */ struct attropl *attribs = NULL; /* Pointer to attribute list */ struct objname *svrs; /* Command line options */ while ((c = getopt(argc, argv, opts)) != EOF) { switch (c) { case 'a': aopt = TRUE; break; case 'c': copt = optarg; break; case 'e': eopt = TRUE; break; case 'n': nopt = TRUE; break; case 'z': zopt = TRUE; break; case '?': default: errflg++; break; } /* END switch(c) */ } /* END while ((c = getopt(argc,argv,opts)) != EOF) */ if (errflg) { if (! zopt) fprintf(stderr,"%s", usage); exit(1); } if (argc > optind) svrs = strings2objname(&argv[optind], argc - optind, MGR_OBJ_SERVER); else svrs = default_server_name(); errflg = connect_servers(svrs, ALL_SERVERS); if ((aopt && errflg) || (nservers == 0)) clean_up_and_exit(3); errflg = set_active(MGR_OBJ_SERVER, svrs); if (errflg && aopt) clean_up_and_exit(4); /* * If no command was given on the command line, then read them from * stdin until end-of-file. Otherwise, execute the one command only. */ if (copt == NULL) { printf("Max open servers: %d\n", pbs_query_max_connections()); #ifdef HAVE_READLINE rl_bind_key('\t', rl_insert); #endif /* HAVE_READLINE */ while (get_request(request) != EOF) { if (eopt) printf("%s\n", request); errflg = parse(request, &oper, &type, &name, &attribs); if (errflg == -1) /* help */ continue; if (aopt && errflg) clean_up_and_exit(1); if (!nopt && !errflg) { errflg = execute( aopt, oper, type, name, attribs); if (aopt && errflg) clean_up_and_exit(2); } } } else { if (eopt) printf("%s\n", copt); errflg = parse(copt, &oper, &type, &name, &attribs); if (aopt && errflg) clean_up_and_exit(1); if (!nopt && !errflg) { errflg = execute( aopt, oper, type, name, attribs); if (aopt && errflg) clean_up_and_exit(2); } } clean_up_and_exit(0); return(0); } /* END main() */ /* * * attributes - parse attribute-value pairs in the format: * attribute OP value * which are on the qmgr input * * attrs Text of the attribute-value pairs. * OUT: attrlist Address of the attribute-value structure. * doper directive operation type (create, delete, set, ...) * * Returns: * This routine returns zero upon successful completion. If there is * a syntax error, it will return the index into attrs where the error * occurred. * * Note: * The following is an example of the text input and what the resulting * data structure should look like. * * a1 = v1, a2.r2 += v2 , a3-=v3 * * attrlist ---> struct attropl * * | * | * \/ * "a1" * "" * "v1" * SET * --------- * | * "a2" <- * "r2" * "v2" * INCR * --------- * | * "a3" <- * "" * "v3" * DECR * NULL */ int attributes( char *attrs, struct attropl **attrlist, int doper) { char *c; /* Pointer into the attrs text */ char *start; /* Pointer to the start of a word */ char q; /* Quote character */ int ltxt; /* Length of a word */ struct attropl *paol; /* Free the space from the previous structure */ freeattropl(*attrlist); *attrlist = NULL; /* Is there any thing to parse? */ c = attrs; while (White(*c)) c++; if (EOL(*c)) { return(0); } /* Parse the attribute-values */ while (TRUE) { /* Get the attribute and resource */ while (White(*c)) c++; if (!EOL(*c)) { start = c; while ((*c != '.') && (*c != ',') && !EOL(*c) && !Oper(c) && !White(*c)) c++; if (c == start) { /* No attribute */ if (start == attrs) start++; return(start - attrs); } /* Allocate storage for attribute structure */ Mstruct(paol, struct attropl); paol->name = NULL; paol->resource = NULL; paol->value = NULL; paol->next = *attrlist; *attrlist = paol; /* Copy attribute into structure */ ltxt = c - start; Mstring(paol->name, ltxt + 1); strncpy(paol->name, start, ltxt); paol->name[ltxt] = '\0'; /* Resource, if any */ if (*c == '.') { start = ++c; while (!White(*c) && !Oper(c) && !EOL(*c)) c++; ltxt = c - start; if (ltxt == 0) /* No resource */ { return(start - attrs); } Mstring(paol->resource, ltxt + 1); strncpy(paol->resource, start, ltxt); paol->resource[ltxt] = '\0'; } } else { return(c - attrs); } /* Get the operator */ while (White(*c)) c++; if (!EOL(*c)) { switch (*c) { case '=': paol->op = SET; c++; break; case '+': paol->op = INCR; c += 2; break; case '-': paol->op = DECR; c += 2; break; case ',': /* Attribute with no value */ Mstring(paol->value, 1); paol->value[0] = '\0'; goto next; /*NOTREACHED */ break; default: return(c - attrs); /*NOTREACHED*/ break; } /* The unset command must not have a operator or value */ if (doper == MGR_CMD_UNSET) { return(c - attrs); } } else if ((doper != MGR_CMD_CREATE) && (doper != MGR_CMD_SET)) { Mstring(paol->value, 1); paol->value[0] = '\0'; return(0); } else { return(c - attrs); } /* Get the value */ while (White(*c)) c++; if (!EOL(*c)) { start = c; if ((*c == '"') || (*c == '\'')) { q = *c; start = ++c; while ((*c != q) && !EOL(*c)) c++; if (EOL(*c)) { return(start - attrs); } ltxt = c - start; Mstring(paol->value, ltxt + 1); if (ltxt > 0) strncpy(paol->value, start, ltxt); paol->value[ltxt] = '\0'; c++; } else { while (!White(*c) && (*c != ',') && !EOL(*c)) c++; ltxt = c - start; Mstring(paol->value, ltxt + 1); strncpy(paol->value, start, ltxt); paol->value[ltxt] = '\0'; } } else { return(c - attrs); } /* See if there is another attribute-value pair */ next: while (White(*c)) c++; if (EOL(*c)) { return(0); } if (*c == ',') { c++; } else { return(c - attrs); } } /* END while (TRUE) */ /* NOTE: original code did not explicitly return, what should be returned at this point? */ return(0); } /* END attributes() */ /* * * attropl2attrl - convert an attropl struct to an attrl struct * * from - the attropl struct to convert * * returns newly converted attrl struct * */ struct attrl *attropl2attrl( struct attropl *from) { struct attrl *ap = NULL, *rattrl = NULL; while (from != NULL) { if (ap == NULL) { Mstruct(ap, struct attrl); rattrl = ap; } else { Mstruct(ap->next, struct attrl); ap = ap->next; } ap->name = NULL; ap->resource = NULL; ap->value = NULL; ap->next = NULL; if (from->name != NULL) { Mstring(ap->name, strlen(from->name) + 1); strcpy(ap->name, from->name); } if (from->resource != NULL) { Mstring(ap->resource, strlen(from->resource) + 1); strcpy(ap->resource, from->resource); } if (from->value != NULL) { Mstring(ap->value, strlen(from->value) + 1); strcpy(ap->value, from->value); } from = from->next; } /* END while (from != NULL) */ return(rattrl); } /* END attropl2attrl() */ /* * * make_connection - open a connection to the server and assign * server entry * * name - name of server to connect to * * returns server struct if connection can be made or NULL if not * */ struct server *make_connection( char *name) { int connection; struct server *svr = NULL; if ((connection = cnt2server(name)) > 0) { svr = new_server(); Mstring(svr->s_name, strlen(name) + 1); strcpy(svr->s_name, name); svr->s_connect = connection; } else { if (! zopt) fprintf(stderr, "qmgr: cannot connect to server %s (errno=%d) %s\n", name, pbs_errno, pbs_strerror(pbs_errno)); } return(svr); } /* * * connect_servers - call connect to connect to each server in list * and add then to the global server list * * server_names - list of objnames * numservers - the number of servers to connect to or -1 for all * the servers on the list * * returns: error if TRUE / success if FALSE */ int connect_servers( struct objname *server_names, int numservers) { int error = FALSE; struct server *cur_svr; struct objname *cur_obj; int i; int max_servers; max_servers = pbs_query_max_connections(); close_non_ref_servers(); if (nservers < max_servers) { cur_obj = server_names; /* if numservers == -1 (all servers) the var i will never equal zero */ for (i = numservers; i != 0 && cur_obj != NULL; i--, cur_obj = cur_obj -> next) { nservers++; if ((cur_svr = make_connection(cur_obj -> svr_name)) == NULL) { nservers--; error = TRUE; } if (cur_svr != NULL) { cur_obj -> svr = cur_svr; cur_svr -> ref++; cur_svr -> next = servers; servers = cur_svr; } } } else { if (! zopt) fprintf(stderr, "qmgr: max server connections reached.\n"); error = 1; } return error; } /* * blanks - print requested spaces * * number - The number spaces * * Returns: * Nothing */ void blanks( int number) { char spaces[1024]; int i; if (number < 1023) { for (i = 0;i < number;i++) spaces[i] = ' '; spaces[i] = '\0'; if (! zopt) fprintf(stderr, "%s", spaces); } else { if (! zopt) fprintf(stderr, "Too many blanks requested.\n"); } return; } /* * * check_list - check a comma delimited list for valid syntax * * list A comma delimited list. * * valid syntax: name[@server][,name] * example: batch@svr1,debug * * Returns: * 0 If the syntax of the list is correct for all commands. * >0 The number of chars into the list where the error occured */ int check_list( char *list) { char *foreptr, *backptr; backptr = list; while (!EOL(*backptr)) { foreptr = backptr; /* object names have to start with an alpha character or can be left off * if all objects of the same type are wanted */ if (!isalpha(*backptr) && (*backptr != '@') && (*backptr != ':')) { return(backptr - list ? backptr - list : 1); } while ((*foreptr != ',') && (*foreptr != '@') && !EOL(*foreptr)) foreptr++; if (*foreptr == '@') { foreptr++; /* error on "name@" or "name@," */ if (EOL(*foreptr) || *foreptr == ',') { return(foreptr - list); } while (!EOL(*foreptr) && *foreptr != ',') foreptr++; /* error on name@svr@blah */ if (*foreptr == '@') { return(foreptr - list); } } if (*foreptr == ',') { foreptr++; /* error on "name," */ if (EOL(*foreptr)) { return(foreptr - list ? foreptr - list : 1); } } backptr = foreptr; } /* SUCCESS */ return(0); } /* END check_list() */ /* * * disconnect_from_server - disconnect from one server and clean up * * svr - the server to disconnect from * * returns nothing * */ void disconnect_from_server(struct server *svr) { pbs_disconnect(svr -> s_connect); free_server(svr); nservers--; } /* * * clean_up_and_exit - disconnect from the servers and free memory used * by active object lists, flush output, and then exits * * exit_val - value to pass to exit * * Returns: Never * */ void clean_up_and_exit(int exit_val) { struct server *cur_svr, *next_svr; free_objname_list(active_servers); free_objname_list(active_queues); free_objname_list(active_nodes); cur_svr = servers; while (cur_svr) { next_svr = cur_svr -> next; disconnect_from_server(cur_svr); cur_svr = next_svr; } fflush(NULL); /* peter h IPSec+jan n NANCO 2009 * fix truncated output. */ exit(exit_val); } /* * display - print out all the information in a batch_status struct * in either readable or qmgr input format * * otype Object type * oname Object name * status Attribute list of the object * format True, if the output should be formatted to look like input * * Returns: * nothing */ void display( int otype, char *oname, struct batch_status *status, int format) { struct attrl *attr; char *c, *e; int l, comma, first, indent_len; if (format) { if (otype == MGR_OBJ_SERVER) printf("#\n# Set server attributes.\n#\n"); else if (otype == MGR_OBJ_QUEUE) printf("#\n# Create queues and set their attributes.\n#\n"); else if (otype == MGR_OBJ_NODE) printf("#\n# Create nodes and set their properties.\n#\n"); } while (status != NULL) { if (otype == MGR_OBJ_SERVER) { if (!format) printf("Server %s\n", status->name); } else if (otype == MGR_OBJ_QUEUE) { if (format) { printf("#\n# Create and define queue %s\n#\n", status->name); printf("create queue %s\n", status->name); } else { printf("Queue %s\n", status->name); } } else if (otype == MGR_OBJ_NODE) { if (format) { printf("#\n# Create and define node %s\n#\n", status->name); printf("create node %s\n", status->name); } else printf("Node %s\n", status->name); } attr = status->attribs; while (attr != NULL) { if (format) { if (is_attr(otype, attr->name, TYPE_ATTR_PUBLIC)) { comma = TRUE; first = TRUE; c = attr->value; e = c; while (comma) { printf("set "); if (otype == MGR_OBJ_SERVER) printf("server "); if (otype == MGR_OBJ_QUEUE) printf("queue %s ", status->name); if (otype == MGR_OBJ_NODE) printf("node %s ", status->name); if (attr->name != NULL) printf("%s", attr->name); if (attr->resource != NULL) printf(".%s", attr->resource); if (attr->value != NULL) { if (first) printf(" = "); else printf(" += "); first = FALSE; while (*e != ',' && *e != '\0') e++; comma = (*e == ','); *e = '\0'; printf("%s", c); e++; c = e; } else comma = FALSE; printf("\n"); } } } else { if (attr->name != NULL) printf("\t%s", attr->name); if (attr->resource != NULL) printf(".%s", attr->resource); if ((attr->value != NULL) && (attr->name != NULL) && !strcmp(attr->name, ATTR_mtime)) { time_t epoch; epoch = (time_t)atoi(attr->value); printf(" = %s", ctime(&epoch)); } else if (attr->value != NULL) { l = strlen(attr->name) + 8; if (attr->resource != NULL) l += strlen(attr->resource) + 1; l += 3; indent_len = l; printf(" = "); c = attr->value; e = c; comma = TRUE; first = TRUE; while (comma) { while (*e != ',' && *e != '\0') e++; comma = (*e == ','); *e = '\0'; l += strlen(c) + 1; if (!first && (l >= 80)) { printf("\n%*s", indent_len, " "); l = strlen(c) + indent_len; while (White(*c)) c++; } printf("%s", c); first = FALSE; if (comma) { printf(","); *e = ','; } e++; c = e; } printf("\n"); } } attr = attr->next; } if (!format) printf("\n"); status = status->next; } } /* * * set_active - sets active objects * * obj_type - the type of object - should be caller allocated space * obj_names - names of objects to set active * * returns 0 on success and non-zero on failure * */ int set_active(int obj_type, struct objname *obj_names) { struct objname *cur_obj = NULL; struct server *svr; int error = 0; if (obj_names != NULL) { switch (obj_type) { case MGR_OBJ_SERVER: cur_obj = obj_names; while (cur_obj != NULL && !error) { if (cur_obj -> svr == NULL) { svr = find_server(cur_obj -> obj_name); if (svr == NULL) error = connect_servers(cur_obj, 1); else { cur_obj -> svr = svr; svr -> ref++; } } cur_obj = cur_obj -> next; } if (!error) { free_objname_list(active_servers); active_servers = obj_names; } else free_objname_list(obj_names); break; case MGR_OBJ_QUEUE: cur_obj = obj_names; while (cur_obj != NULL && !error) { if (cur_obj -> svr_name != NULL) { if (cur_obj -> svr == NULL) if (connect_servers(cur_obj, 1) == TRUE) error = 1; } if (!is_valid_object(cur_obj, MGR_OBJ_QUEUE)) { if (! zopt) fprintf(stderr, "Queue does not exist: %s.\n", cur_obj -> obj_name); error = 1; } cur_obj = cur_obj -> next; } if (!error) { free_objname_list(active_queues); active_queues = obj_names; } break; case MGR_OBJ_NODE: cur_obj = obj_names; while (cur_obj != NULL && !error) { if (cur_obj -> svr_name != NULL) { if (cur_obj -> svr == NULL) if (connect_servers(cur_obj, 1) == TRUE) error = 1; } if (!is_valid_object(cur_obj, MGR_OBJ_NODE)) { if (! zopt) fprintf(stderr, "Node does not exist: %s.\n", cur_obj -> obj_name); error = 1; } cur_obj = cur_obj -> next; } if (!error) { free_objname_list(active_nodes); active_nodes = obj_names; } break; default: error = 1; } } else { switch (obj_type) { case MGR_OBJ_SERVER: printf("Active servers:\n"); cur_obj = active_servers; break; case MGR_OBJ_QUEUE: printf("Active queues:\n"); cur_obj = active_queues; break; case MGR_OBJ_NODE: printf("Active nodes:\n"); cur_obj = active_nodes; break; } while (cur_obj != NULL) { if (obj_type == MGR_OBJ_SERVER) printf("%s\n", Svrname(cur_obj -> svr)); else printf("%s@%s\n", cur_obj -> obj_name, Svrname(cur_obj -> svr)); cur_obj = cur_obj -> next; } } return error; } /* * execute - contact the server and execute the command * * aopt True, if the -a option was given. * oper The command, either create, delete, set, unset or list. * type The object type, either server or queue. * names The object name list. * attribs The attribute list with operators. * * Returns: * 0 for success non-zero for error * * Library: * libpbs * pbs_manager * pbs_statserver * pbs_statque * pbs_statfree * pbs_geterrmsg */ int execute( int aopt, int oper, /* I */ int type, char *names, struct attropl *attribs) { int len; /* Used for length of an err msg*/ int error; /* Error value returned */ int perr; /* Value returned from pbs_manager */ char *errmsg; /* Error message from pbs_errmsg */ char errnomsg[256]; /* Error message with pbs_errno */ struct objname *name; /* Pointer to a list of object names */ struct objname *pname = NULL; /* Pointer to current object name */ struct objname *sname = NULL; /* Pointer to current server name */ struct objname *svrs; /* servers to loop through */ struct attrl *sa; /* Argument needed for status routines */ /* Argument used to request queue names */ struct server *sp; /* Pointer to server structure */ /* Return structure from a list or print request */ struct batch_status *ss = NULL; error = 0; name = commalist2objname(names, type); if (oper == MGR_CMD_ACTIVE) { return(set_active(type, name)); } if (name == NULL) { switch (type) { /* There will always be an active server */ case MGR_OBJ_SERVER: pname = active_servers; break; case MGR_OBJ_QUEUE: if (active_queues != NULL) pname = active_queues; else if (! zopt) fprintf(stderr, "No Active Queues, nothing done.\n"); break; case MGR_OBJ_NODE: if (active_nodes != NULL) pname = active_nodes; else if (! zopt) fprintf(stderr, "No Active Nodes, nothing done.\n"); break; /* DIAGTODO: handle new diag type */ } } else { pname = name; } for (;pname != NULL;pname = pname->next) { if (pname -> svr_name != NULL) svrs = temp_objname(NULL, pname->svr_name, pname->svr); else svrs = active_servers; for (sname = svrs;sname != NULL;sname = sname->next) { if (sname->svr == NULL) { error = connect_servers(sname, 1); if (error) continue; } sp = sname -> svr; if ((oper == MGR_CMD_LIST)) { sa = attropl2attrl(attribs); switch (type) { case MGR_OBJ_SERVER: ss = pbs_statserver(sp -> s_connect, sa, NULL); break; case MGR_OBJ_QUEUE: ss = pbs_statque(sp -> s_connect, pname -> obj_name, sa, NULL); break; case MGR_OBJ_NODE: ss = pbs_statnode(sp -> s_connect, pname -> obj_name, sa, NULL); break; /* DIAGTODO: handle new diag type for list */ /* DIAGTODO: create a pbs_statdiag() */ } freeattrl(sa); perr = (ss == NULL); if (! perr) display(type, pname -> obj_name, ss, FALSE); pbs_statfree(ss); } else if ((oper == MGR_CMD_PRINT)) { sa = attropl2attrl(attribs); switch (type) { case MGR_OBJ_SERVER: if (sa == NULL) { ss = pbs_statque(sp -> s_connect, NULL, NULL, NULL); if (ss != NULL) display(MGR_OBJ_QUEUE, NULL, ss, TRUE); } ss = pbs_statserver(sp -> s_connect, sa, NULL); break; case MGR_OBJ_QUEUE: ss = pbs_statque(sp->s_connect, pname->obj_name, sa, NULL); break; case MGR_OBJ_NODE: ss = pbs_statnode(sp->s_connect, pname->obj_name, sa, NULL); break; /* DIAGTODO: handle new diag type for print */ } freeattrl(sa); perr = (ss == NULL); if (! perr) display(type, pname -> obj_name, ss, TRUE); pbs_statfree(ss); } else { perr = pbs_manager( sp->s_connect, oper, type, pname->obj_name, attribs, NULL); } if (perr) { errmsg = pbs_geterrmsg(sp -> s_connect); if (errmsg != NULL) { len = strlen(errmsg) + strlen(pname -> obj_name) + strlen(Svrname(sp)) + 20; if (len < 256) { sprintf(errnomsg, "qmgr obj=%s svr=%s: %s\n", pname -> obj_name, Svrname(sp), errmsg); if (! zopt) fprintf(stderr, "%s", errnomsg); } else { /*obviously, this is to cover a highly unlikely case*/ pstderr_big(pname -> obj_name, Svrname(sp), errmsg); } } else if (pbs_errno == PBSE_PROTOCOL) { if (! zopt) fprintf(stderr, "qmgr: Protocol error, server disconnected\n"); exit(1); } else if (! zopt) fprintf(stderr, "qmgr: Error (%d - %s) returned from server\n", pbs_errno, pbs_strerror(pbs_errno)); if (aopt) return perr; error = perr; } temp_objname(NULL, NULL, NULL); /* clears reference count */ } } if (name != NULL) free_objname_list(name); return(error); } /* END execute() */ /* * void freeattrl(struct attrl *attr) * * attr Pointer to the linked list of attrls to clean up. * * Returns: * None */ void freeattrl(struct attrl *attr) { struct attrl *ap; while (attr != NULL) { if (attr->name != NULL) free(attr->name); if (attr->resource != NULL) free(attr->resource); if (attr->value != NULL) free(attr->value); ap = attr->next; free(attr); attr = ap; } return; } /* * void freeattropl(struct attropl *attr) * * attr Pointer to the linked list of attropls to clean up. * * Returns: * None */ void freeattropl(struct attropl *attr) { struct attropl *ap; while (attr != NULL) { if (attr->name != NULL) free(attr->name); if (attr->resource != NULL) free(attr->resource); if (attr->value != NULL) free(attr->value); ap = attr->next; free(attr); attr = ap; } } /* * * commalist2objname - convert a comma separated list of strings to a * linked list of objname structs * * names - comma separated list of strings * type - the type of the objects * * returns linked list of objname structs * */ struct objname * commalist2objname(char *names, int type) { char *foreptr, *backptr; /* front and back of words */ struct objname *objs = NULL; /* the front of the name object list */ struct objname *cur_obj; /* the current name object */ struct objname *prev_obj = NULL; /* the previous name object */ int len; /* length of segment of string */ char error = 0; /* error flag */ if (names != NULL) { foreptr = backptr = names; while (!EOL(*foreptr) && !error) { while (White(*foreptr)) foreptr++; backptr = foreptr; while (*foreptr != ',' && *foreptr != '@' && !EOL(*foreptr)) foreptr++; cur_obj = new_objname(); cur_obj -> obj_type = type; if (*foreptr == '@') { len = foreptr - backptr; Mstring(cur_obj -> obj_name, len + 1); strncpy(cur_obj -> obj_name, backptr, len); cur_obj -> obj_name[len] = '\0'; foreptr++; backptr = foreptr; while (*foreptr != ',' && !EOL(*foreptr)) foreptr++; len = foreptr - backptr; if (strncmp(backptr, DEFAULT_SERVER, len) == 0) { Mstring(cur_obj -> svr_name, 1); cur_obj -> svr_name[0] = '\0'; } else if (strncmp(backptr, ACTIVE_SERVER, len) == 0) cur_obj -> svr_name = NULL; else { Mstring(cur_obj -> svr_name, len + 1); strncpy(cur_obj -> svr_name, backptr, len); cur_obj -> svr_name[len] = '\0'; } if (!EOL(*foreptr)) foreptr++; } else { len = foreptr - backptr; if (type == MGR_OBJ_SERVER && !strcmp(backptr, DEFAULT_SERVER)) { Mstring(cur_obj -> obj_name, 1); cur_obj -> obj_name[0] = '\0'; } else { Mstring(cur_obj -> obj_name, len + 1); strncpy(cur_obj -> obj_name, backptr, len); cur_obj -> obj_name[len] = '\0'; } if (type == MGR_OBJ_SERVER) cur_obj -> svr_name = cur_obj -> obj_name; if (!EOL(*foreptr)) foreptr++; } if ((cur_obj -> svr = find_server(cur_obj -> svr_name)) != NULL) cur_obj -> svr -> ref++; if (objs == NULL) objs = cur_obj; if (prev_obj == NULL) prev_obj = cur_obj; else if (cur_obj != NULL) { prev_obj -> next = cur_obj; prev_obj = cur_obj; } } } if (error) { free_objname_list(objs); return NULL; } return objs; } /* * get_request - get a qmgr request from the standard input * * OUT: request The buffer for the qmgr request * * Returns: * This routine returns zero if there is a command to execute. * Otherwise, it returns EOF. * * NOTE: * This routine has a static buffer it keeps lines of input in. * Since commands can be separated by semicolons, a line may contain * more than one command. In this case, the command is copied to * request and the rest of the line is moved up to overwrite the previous * command. Another line is retrieved from stdin only if the buffer is * empty. */ int get_request( char *request) /* O */ { static char line[MAX_LINE_LEN]; /* Stdin line */ static char prompt[] = "Qmgr: "; /* Prompt if input is from terminal */ static char contin[] = "Qmgr< "; /* Prompt if input is continued across lines */ static int empty = TRUE; /* Line has nothing in it */ int eol; /* End of line */ int ll; /* Length of line */ int i = 0; /* Index into line */ char *rp; /* Pointer into request */ char *lp; /* Pointer into line */ int eoc; /* End of command */ char quote; /* Either ' or " */ char *rlread = NULL; /* Make sure something is in the stdin line */ if (empty != 0) { eol = FALSE; lp = line; ll = 0; while (eol == FALSE) { #ifdef HAVE_READLINE if (rlread != NULL) { free(rlread); rlread = NULL; } if (isatty(0) && isatty(1)) { if (lp == line) rlread = readline(prompt); else rlread = readline(contin); } else { rlread = readline(""); } if (rlread == NULL) { return(EOF); } if ((*rlread != '\0') && (*rlread != '#')) { int blen = strlen(rlread); int bsize = sizeof(line) - (lp - line); add_history(rlread); /* copy string plus termination marker */ memcpy( lp, rlread, (blen < bsize) ? blen + 1 : bsize); } /* END if ((*rlread != '\0') ... ) */ line[sizeof(line) - 1] = '\0'; #else /* HAVE_READLINE */ if (isatty(0) && isatty(1)) { if (lp == line) printf("%s", prompt); else printf("%s", contin); } if (fgets(lp, sizeof(line) - ll, stdin) == NULL) { return(EOF); } #endif /* HAVE_READLINE */ ll = strlen(line); if (line[ll - 1] == '\n') { /* remove newline */ line[ll - 1] = '\0'; ll--; } lp = line; /* remove blank lines */ while (White(*lp)) lp++; if (strlen(lp) == 0) continue; if (line[ll - 1] == '\\') { line[ll - 1] = ' '; lp = &line[ll]; } else if (*lp != '#') { eol = TRUE; } } } /* END if (empty != 0) */ /* Move a command from line to request */ rp = request; lp = line; eoc = FALSE; while (!eoc) { switch (*lp) { /* End of command */ case ';': case '#': case '\0': eoc = TRUE; break; /* Quoted string */ case '"': case '\'': quote = *lp; *rp = *lp; rp++; lp++; while (*lp != quote && !EOL(*lp)) { *rp = *lp; rp++; lp++; } *rp = *lp; rp++; lp++; break; /* Move the character */ default: *rp = *lp; rp++; lp++; break; } } *rp = '\0'; /* Is there any thing left in the line? */ switch (*lp) { case '\0': case '#': i = 0; empty = TRUE; break; case ';': rp = line; lp++; while (White(*lp)) lp++; if (!EOL(*lp)) { strcpy(rp, lp); i = strlen(lp); empty = FALSE; } else { i = 0; empty = TRUE; } break; } for (;i < MAX_LINE_LEN;i++) line[i] = '\0'; if (rlread != NULL) free(rlread); return(0); } /* END get_request() */ /* * is_attr - is the name passed an attribute * * object Type of object * name Name of the attribute * attr_type Is the attribute a cirtain type * * Returns: * This routine returns True if the input is a attribute of the * given object and type. Otherwise, it returns False. */ int is_attr( int object, char *name, int attr_type) { static char *svr_public_attrs[] = { #include "qmgr_svr_public.h" #include "site_qmgr_svr_print.h" NULL }; static char *svr_readonly_attrs[] = { #include "qmgr_svr_readonly.h" NULL }; static char *que_public_attrs[] = { #include "qmgr_que_public.h" #include "site_qmgr_que_print.h" NULL }; static char *que_readonly_attrs[] = { #include "qmgr_que_readonly.h" NULL }; static char *node_public_attrs[] = { #include "qmgr_node_public.h" #include "site_qmgr_node_print.h" NULL }; static char *node_readonly_attrs[] = { #include "qmgr_node_readonly.h" NULL }; /* DIAGTODO: need a list of public and read-only diag attrs */ char **attr_public = NULL; char **attr_readonly = NULL; int ret = FALSE; char *name_ptr = NULL, *dupname = NULL; if (object == MGR_OBJ_SERVER) { attr_public = svr_public_attrs; attr_readonly = svr_readonly_attrs; } else if (object == MGR_OBJ_QUEUE) { attr_public = que_public_attrs; attr_readonly = que_readonly_attrs; } else if (object == MGR_OBJ_NODE) { attr_public = node_public_attrs; attr_readonly = node_readonly_attrs; } dupname = strdup(name); if(dupname == NULL) { return(FALSE); } name_ptr = strchr(dupname, '.'); if(name_ptr) { *name_ptr = 0; } if (attr_public != NULL && (attr_type & TYPE_ATTR_PUBLIC)) { while (*attr_public != NULL && ret == FALSE) { /* if (strncmp(name, *attr_public, strlen(*attr_public)) == 0) */ if (strcmp(dupname, *attr_public) == 0) ret = TRUE; attr_public++; } } if (attr_readonly != NULL && (attr_type & TYPE_ATTR_READONLY)) { while (*attr_readonly != NULL && ret == FALSE) { /* if (strncmp(name, *attr_readonly, strlen(*attr_readonly)) == 0) */ if (strcmp(dupname, *attr_readonly) == 0) ret = TRUE; attr_readonly++; } } if(dupname) { free(dupname); } return(ret); } /* END is_attr() */ /* * * show_help - show help for qmgr * * str - possible sub topic to show help on * * returns nothing * */ void show_help( char *str) { while (White(*str)) str++; if (str[0] == '\0') printf(HELP_DEFAULT); else if (strncmp(str, "active", 6) == 0) printf("%s%s", HELP_ACTIVE, HELP_ACTIVE2); else if (strncmp(str, "create", 6) == 0) printf(HELP_CREATE); else if (strncmp(str, "delete", 6) == 0) printf(HELP_DELETE); else if (strncmp(str, "set", 3) == 0) printf("%s%s", HELP_SET, HELP_SET2); else if (strncmp(str, "unset", 5) == 0) printf(HELP_UNSET); else if (strncmp(str, "list", 4) == 0) printf(HELP_LIST); else if (strncmp(str, "print", 5) == 0) printf(HELP_PRINT); else if (strncmp(str, "quit", 4) == 0) printf(HELP_QUIT); else if (strncmp(str, "exit", 4) == 0) printf(HELP_EXIT); else if (strncmp(str, "operator", 8) == 0) printf(HELP_OPERATOR); else if (strncmp(str, "value", 5) == 0) printf(HELP_VALUE); else if (strncmp(str, "name", 4) == 0) printf(HELP_NAME); else if (strncmp(str, "attribute", 9) == 0) printf(HELP_ATTRIBUTE); else if (strncmp(str, "serverpublic", 12) == 0) printf("%s%s%s", HELP_SERVERPUBLIC, HELP_SERVERPUBLIC2, HELP_SERVERPUBLIC3); else if (strncmp(str, "serverro", 8) == 0) printf(HELP_SERVERRO); else if (strncmp(str, "queuepublic", 11) == 0) printf("%s%s%s", HELP_QUEUEPUBLIC, HELP_QUEUEPUBLIC2, HELP_QUEUEPUBLIC3); else if (strncmp(str, "queueexec", 9) == 0) printf(HELP_QUEUEEXEC); else if (strncmp(str, "queueroute", 10) == 0) printf(HELP_QUEUEROUTE); else if (strncmp(str, "queuero", 7) == 0) printf(HELP_QUEUERO); else if (strncmp(str, "nodeattr", 8) == 0) printf(HELP_NODEATTR); else printf("No help available on: %s\nCheck the ERS for more help.\n", str); printf("\n"); return; } /* END show_help() */ /* * parse - parse the qmgr request * * request The text of a single qmgr command. * OUT: oper Indicates either create, delete, set, unset, or list * OUT: type Indicates either server or queue. * OUT: names The names of the objects. * OUT: attr The attribute list with operators. * * Returns: * This routine returns zero upon successful completion. If there is * a syntax error in the command a non-zero value is returned. * * Note: * The syntax of a qmgr directive is: * * operation type [namelist] [attributelist] * * where * operation create, delete, set, unset, list or print * type server or queue * namelist comma delimit list of names with no white space, * can only be defaulted if the type is server * attributelist comma delimit list of name or name-value pairs * * If the operation part is quit or exit, then the code will be stopped * now. */ int parse( char *request, int *oper, int *type, char **names, struct attropl **attr) { int error; int lp; /* Length of current string */ int len; /* ammount parsed by parse_request */ int i; /* loop var */ static char req[MAX_REQ_WORDS][MAX_REQ_WORD_LEN] = { {'\0'} }; /* clear old data in req */ for (i = IND_FIRST; i <= IND_LAST; i++) req[i][0] = '\0'; /* parse the request into parts */ len = parse_request(request, req); if (len != 0) /* error in parse_request */ { lp = strlen(req[IND_CMD]); if (strncmp(req[0], "create", lp) == 0) *oper = MGR_CMD_CREATE; else if (strncmp(req[0], "delete", lp) == 0) *oper = MGR_CMD_DELETE; else if (strncmp(req[0], "set", lp) == 0) *oper = MGR_CMD_SET; else if (strncmp(req[0], "unset", lp) == 0) *oper = MGR_CMD_UNSET; else if (strncmp(req[0], "list", lp) == 0) *oper = MGR_CMD_LIST; else if (strncmp(req[0], "print", lp) == 0) *oper = MGR_CMD_PRINT; else if (strncmp(req[0], "active", lp) == 0) *oper = MGR_CMD_ACTIVE; else if (strncmp(req[0], "help", lp) == 0) { show_help(req[1]); return(-1); } else if (strncmp(req[0], "quit", lp) == 0) clean_up_and_exit(0); else if (strncmp(req[0], "exit", lp) == 0) clean_up_and_exit(0); else { if (! zopt) fprintf(stderr, "qmgr: Illegal operation: %s\n" "Try 'help' if you are having trouble.\n", req[IND_CMD]); return(1); } if (EOL(req[IND_OBJ][0])) { if (! zopt) fprintf(stderr, "qmgr: No object type given\n"); return(2); } lp = strlen(req[IND_OBJ]); if (strncmp(req[1], "server", lp) == 0) *type = MGR_OBJ_SERVER; else if (strncmp(req[1], "queue", lp) == 0) *type = MGR_OBJ_QUEUE; else if (strncmp(req[1], "node", lp) == 0) *type = MGR_OBJ_NODE; /* DIAGTODO: allow new object type */ else { if (! zopt) fprintf(stderr, "qmgr: Illegal object type: %s.\n", req[IND_OBJ]); return(2); } if (!EOL(req[IND_NAME][0])) { if (is_attr(*type, req[IND_NAME], TYPE_ATTR_ALL)) { len -= strlen(req[IND_NAME]); req[IND_NAME][0] = '\0'; } else { error = check_list(req[IND_NAME]); if (error != 0) { if (! zopt) fprintf(stderr, "qmgr: syntax error - checklist failed\n"); CaretErr(request, len - (int)strlen(req[IND_NAME]) + error - 1); return(3); } } *names = req[IND_NAME]; } /* get attribute list/verify operation is feasible */ /* load remaining part of the request */ if ((error = attributes(request + len, attr, *oper)) != 0) { if (! zopt) fprintf(stderr, "qmgr: Syntax error - cannot locate attribute\n"); CaretErr(request, len + error); return(4); } if (((*oper == MGR_CMD_SET) || (*oper == MGR_CMD_UNSET)) && (*attr == NULL)) { if (! zopt) fprintf(stderr, "qmgr: Syntax error - attribute required for operation\n"); CaretErr(request, len + error); return(4); } if ((*oper == MGR_CMD_ACTIVE) && (*attr != NULL)) { if (! zopt) fprintf(stderr, "qmgr: Syntax error - operation does not allow attribute\n"); CaretErr(request, len); return(4); } } /* END if (len != 0) */ return(0); } /* END parse() */ /* * pstderr_big - prints error message to standard error. It handles * the highly unusual case where the error message * that's to be generated is too big to be placed in * the buffer that was allocated. In this case the * message is put out in pieces to stderr. Kind of * ugly, but one doesn't really expect this code to be * called except in the oddest of cases. * * svrname name of the server * objname name of the object * errmesg actual error message * * Returns: * Nothing. * * Global Variable: zopt */ void pstderr_big( char *svrname, char *objname, char *errmesg) { if (! zopt) { fprintf(stderr, "qmgr obj="); fprintf(stderr, "%s", objname); fprintf(stderr, " svr="); fprintf(stderr, "%s", svrname); fprintf(stderr, ": "); fprintf(stderr, "%s", errmesg); fprintf(stderr, "\n"); } return; } /* * * free_objname_list - frees an objname list * * list - objname list to free * * returns nothing * */ void free_objname_list(struct objname *list) { struct objname *cur, *tmp; cur = list; while (cur != NULL) { tmp = cur -> next; free_objname(cur); cur = tmp; } } /* * * find_server - find a server in the server list * * name - the name of the server * * returns a pointer to the specified server struct or NULL if not found * */ struct server *find_server(char *name) { struct server *s = NULL; if (name != NULL) { s = servers; while (s != NULL && strcmp(s -> s_name, name)) s = s -> next; } return s; } /* * * new_server - allocate new server objcet and initialize it * * returns new server object * */ struct server * new_server(void) { struct server *new; Mstruct(new, struct server); new -> s_connect = -1; new -> s_name = NULL; new -> ref = 0; new -> next = NULL; return new; } /* * * free_server - remove server from servers list and free it up * * svr - the server to free * * returns nothing * */ void free_server(struct server *svr) { struct server *cur_svr, *prev_svr = NULL; /* remove server from servers list */ cur_svr = servers; while (cur_svr != svr && cur_svr != NULL) { prev_svr = cur_svr; cur_svr = cur_svr -> next; } if (cur_svr != NULL) { if (prev_svr == NULL) servers = servers -> next; else prev_svr -> next = cur_svr -> next; if (svr -> s_name != NULL) free(svr -> s_name); svr -> s_name = NULL; svr -> s_connect = -1; svr -> next = NULL; free(svr); } } /* * * new_objname - allocate new object and initialize it * * returns newly allocated object * */ struct objname * new_objname(void) { struct objname *new; Mstruct(new, struct objname); new -> obj_type = MGR_OBJ_NONE; new -> obj_name = NULL; new -> svr_name = NULL; new -> svr = NULL; new -> next = NULL; return new; } /* * * free_objname - frees space used by an objname * * obj - objname to free * * returns nothing * */ void free_objname(struct objname *obj) { if (obj -> obj_name != NULL) free(obj -> obj_name); if (obj -> obj_type != MGR_OBJ_SERVER && obj -> svr_name != NULL) free(obj -> svr_name); if (obj -> svr != NULL) obj -> svr -> ref--; obj -> svr = NULL; obj -> obj_name = NULL; obj -> svr_name = NULL; obj -> next = NULL; free(obj); } /* * * strings2objname - convert an array of strings to a list of objnames * * str - array of strings * num - number of strings * type - type of objects * * returns newly allocated list of objnames * */ struct objname * strings2objname(char **str, int num, int type) { struct objname *objs = NULL; /* head of objname list */ struct objname *cur_obj; /* current object in objname list */ struct objname *prev_obj = NULL; /* previous object in objname list */ int i; int len; if (str != NULL) { for (i = 0; i < num; i++) { cur_obj = new_objname(); len = strlen(str[i]); Mstring(cur_obj -> obj_name, len + 1); strcpy(cur_obj -> obj_name, str[i]); cur_obj -> obj_type = type; if (type == MGR_OBJ_SERVER) cur_obj -> svr_name = cur_obj -> obj_name; if (prev_obj != NULL) prev_obj -> next = cur_obj; if (objs == NULL) objs = cur_obj; prev_obj = cur_obj; } } return objs; } /* * * is_valid_object - connects to the server to check if the object exists * on the server its connected. * * obj - object to check * type - type of object * * * returns 1 if its valid, 0 if its not * */ int is_valid_object( struct objname *obj, int type) { struct batch_status *batch_obj = NULL; /* we need something to make the pbs_stat* call. * Even if we only want the object name */ static struct attrl attrq = { NULL, ATTR_qtype, "", "", 0 }; static struct attrl attrn = { NULL, ATTR_NODE_state, "", "", 0 }; int valid = 1; char *errmsg; if ((obj != NULL) && (obj->svr != NULL)) { switch (type) { case MGR_OBJ_QUEUE: batch_obj = pbs_statque(obj->svr->s_connect, obj->obj_name, &attrq, NULL); break; case MGR_OBJ_NODE: batch_obj = pbs_statnode(obj->svr->s_connect, obj->obj_name, &attrn, NULL); break; default: valid = 0; break; } if (batch_obj == NULL) { errmsg = pbs_geterrmsg(obj->svr->s_connect); if (! zopt) fprintf(stderr, "qmgr: %s.\n", errmsg); valid = 0; } else { /* if pbs_stat*() returned something, then the object exists */ valid = 1; pbs_statfree(batch_obj); } } else { valid = 1; /* NULL server means all active servers */ } return(valid); } /* * * default_server_name - create an objname struct for the default server * * returns newly allocated objname with the default server assigned * */ struct objname * default_server_name(void) { struct objname *obj; obj = new_objname(); /* default server name is the NULL string */ Mstring(obj -> obj_name, 1); obj->obj_name[0] = '\0'; obj->svr_name = obj->obj_name; obj->obj_type = MGR_OBJ_SERVER; return(obj); } /* * * temp_objname - set up a temporary objname struct. This is meant for * a one time use. The memory is static. * * obj_name - name for temp struct * svr_name - name of the server for the temp struct * svr - server for temp struct * * returns temporary objname * */ struct objname *temp_objname( char *obj_name, char *svr_name, struct server *svr) { static struct objname temp = { 0, NULL, NULL, NULL, NULL }; if (temp.svr != NULL) temp.svr->ref--; temp.obj_name = NULL; temp.svr_name = NULL; temp.svr = NULL; temp.obj_name = obj_name; temp.svr_name = svr_name; temp.svr = svr; if (temp.svr != NULL) temp.svr->ref++; return(&temp); } /* * * close_non_ref_servers - close all nonreferenced servers * * returns nothing * */ void close_non_ref_servers(void) { struct server *svr, *tmp_svr; svr = servers; while (svr != NULL) { tmp_svr = svr -> next; if (svr -> ref == 0) disconnect_from_server(svr); svr = tmp_svr; } return; } /* END close_non_ref_servers() */ /* * * parse_request - parse out the command, object, and possible name * * cases: * FULL: command object name ... * command object ... * NOTE: there does not need to be whitespace around the operator * * request - the request to be processed * OUT: req - array to return data in * indicies: * IND_CMD : command * IND_OBJ : object * IND_NAME : name * * if any field is not there, it is left blank. * * returns The number of characters parsed. Note: 0 chars parsed is error * Data is passed back via the req variable. */ int parse_request( char *request, char req[][MAX_REQ_WORD_LEN]) { char *foreptr, *backptr; int len; int i = 0; int chars_parsed = 0; int error = 0; foreptr = request; for (i = 0;!EOL(*foreptr) && (i < MAX_REQ_WORDS) && (error == 0);) { while (White(*foreptr)) foreptr++; backptr = foreptr; while (!White(*foreptr) && !Oper(foreptr) && !EOL(*foreptr)) foreptr++; len = foreptr - backptr; if (len > MAX_REQ_WORD_LEN) { error = 1; chars_parsed = (int)(foreptr - request); if (! zopt) fprintf(stderr, "qmgr: max word length exceeded\n"); CaretErr(request, chars_parsed); } strncpy(req[i], backptr, len); req[i][len] = '\0'; i++; } /* END for (i) */ chars_parsed = foreptr - request; if (error == 0) { /* FAILURE */ return(chars_parsed); } /* SUCCESS */ return(0); } /* END qmgr.c */ torque-2.4.16/src/cmds/qdisable.c0000664000113300011330000001661111272401236013504 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qdisable * The qdisable command directs that a destination should no longer accept * batch jobs. * * Synopsis: * qdisable destination ... * * Arguments: * destination ... * A list of destinations. A destination has one of the following * three forms: * queue * @server * queue@server * If queue is specified, the request is to disable the queue at * the default server. If @server is given, the request is to * disable the default queue at the server. If queue@server is * used, the request is to disable the named queue at the named * server. * * Written by: * Bruce Kelly * National Energy Research Supercomputer Center * Livermore, CA * May, 1993 */ #include "cmds.h" #include /* the master config generated by configure */ int exitstatus = 0; /* Exit Status */ static void execute(char *, char *); int main(int argc, char **argv) { /* * This routine sends a Manage request to the batch server specified by * the destination. The ENABLED queue attribute is set to {False}. If the * batch request is accepted, the server will no longer accept Queue Job * requests for the specified queue. */ int dest; /* Index into the destination array (argv) */ char *queue; /* Queue name part of destination */ char *server; /* Server name part of destination */ if (argc == 1) { fprintf(stderr, "Usage: qdisable [queue][@server] ...\n"); exit(1); } else if (argc > 1 && argv[1][0] == '-') { /* make it look like some kind of help is available */ fprintf(stderr, "Usage: qdisable [queue][@server] ...\n"); exit(1); } for (dest = 1; dest < argc; dest++) if (parse_destination_id(argv[dest], &queue, &server) == 0) execute(queue, server); else { fprintf(stderr, "qdisable: illegally formed destination: %s\n", argv[dest]); exitstatus = 1; } exit(exitstatus); } /* * int execute( char *queue, char *server ) * * queue The name of the queue to disable. * server The name of the server that manages the queue. * * Returns: * None * * File Variables: * exitstatus Set to two if an error occurs. */ static void execute(char *queue, char *server) { int ct; /* Connection to the server */ int merr; /* Error return from pbs_manager */ char *errmsg; /* Error message from pbs_manager */ /* The disable request */ static struct attropl attr = { NULL, "enabled", NULL, "FALSE", SET }; if ((ct = cnt2server(server)) > 0) { merr = pbs_manager(ct, MGR_CMD_SET, MGR_OBJ_QUEUE, queue, &attr, NULL); if (merr != 0) { errmsg = pbs_geterrmsg(ct); if (errmsg != NULL) { fprintf(stderr, "qdisable: %s ", errmsg); } else { fprintf(stderr, "qdisable: Error (%d - %s) disabling queue ", pbs_errno, pbs_strerror(pbs_errno)); } if (notNULL(queue)) fprintf(stderr, "%s", queue); if (notNULL(server)) fprintf(stderr, "@%s", server); fprintf(stderr, "\n"); exitstatus = 2; } pbs_disconnect(ct); } else { fprintf(stderr, "qdisable: could not connect to server %s (%d) %s\n", server, pbs_errno, pbs_strerror(pbs_errno)); exitstatus = 2; } } torque-2.4.16/src/cmds/qrerun.c0000664000113300011330000001607711272401236013242 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qrerun - (PBS) rerun batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ int main( int argc, char **argv) /* qrerun */ { int any_failed = 0; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char job_id_out[PBS_MAXCLTJOBID]; char server_out[PBS_MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; char extend[1024]; int errflg = 0; int c; static char usage[] = "usage: qrerun [-f] [ ]...\n"; if (argc < 2) { fprintf(stderr,"%s", usage); exit(2); } #define GETOPT_ARGS "m:f" extend[0] = '\0'; while ((c = (char) getopt(argc, argv, GETOPT_ARGS)) != EOF) { switch (c) { case 'm': /* add delete message */ if (extend[0] != '\0') { /* extension option already specified */ errflg++; break; } if (strchr(optarg, '=')) { /* message cannot contain '=' character */ errflg++; break; } strncpy(extend, optarg, sizeof(extend)); break; case 'f': if (extend[0] != '\0') { errflg++; break; } strcpy(extend, RERUNFORCE); break; } /* END switch (c) */ } /* END while ((c = getopt(argc,argv,GETOPT_ARGS)) != EOF) */ if ((errflg != 0) || (optind >= argc)) { fprintf(stderr,"%s", usage); exit(2); } for (;optind < argc;optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qrerun: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qrerun: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } if (extend[0] != '\0') stat = pbs_rerunjob(connect, job_id_out, extend); else stat = pbs_rerunjob(connect, job_id_out, NULL); if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qrerun", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qrerun", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } exit(any_failed); } /* END main() */ /* END qrerun.c */ torque-2.4.16/src/cmds/qhold.c0000664000113300011330000001564711272401236013037 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qhold - (PBS) hold batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ int main(int argc, char **argv) /* qhold */ { int c; int errflg = 0; int any_failed = 0; int u_cnt, o_cnt, s_cnt; char *pc; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; #define MAX_HOLD_TYPE_LEN 32 char hold_type[MAX_HOLD_TYPE_LEN+1]; #define GETOPT_ARGS "h:" hold_type[0] = '\0'; while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) switch (c) { case 'h': while (isspace((int)*optarg)) optarg++; if (strlen(optarg) == 0) { fprintf(stderr, "qhold: illegal -h value\n"); errflg++; break; } pc = optarg; u_cnt = o_cnt = s_cnt = 0; while (*pc) { if (*pc == 'u') u_cnt++; else if (*pc == 'o') o_cnt++; else if (*pc == 's') s_cnt++; else { fprintf(stderr, "qhold: illegal -h value\n"); errflg++; break; } pc++; } strcpy(hold_type, optarg); break; default : errflg++; } if (errflg || optind >= argc) { static char usage[] = "usage: qhold [-h hold_list] job_identifier...\n"; fprintf(stderr,"%s", usage); exit(2); } for (; optind < argc; optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qhold: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qhold: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } stat = pbs_holdjob(connect, job_id_out, hold_type, NULL); if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qhold", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qhold", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } exit(any_failed); } torque-2.4.16/src/cmds/Makefile.in0000664000113300011330000011527611605403722013632 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(pbs_track_SOURCES) $(pbsdsh_SOURCES) $(pbsnodes_SOURCES) $(pbspd_SOURCES) $(pbspoe_SOURCES) $(qalter_SOURCES) $(qchkpt_SOURCES) $(qdel_SOURCES) $(qdisable_SOURCES) $(qenable_SOURCES) $(qhold_SOURCES) $(qmgr_SOURCES) $(qmove_SOURCES) $(qmsg_SOURCES) $(qorder_SOURCES) $(qrerun_SOURCES) $(qrls_SOURCES) $(qrun_SOURCES) $(qselect_SOURCES) $(qsig_SOURCES) $(qstart_SOURCES) $(qstat_SOURCES) $(qstop_SOURCES) $(qsub_SOURCES) $(qterm_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/buildutils/config.mk bin_PROGRAMS = qalter$(EXEEXT) qdel$(EXEEXT) qhold$(EXEEXT) \ qmove$(EXEEXT) qorder$(EXEEXT) qmsg$(EXEEXT) qrerun$(EXEEXT) \ qrls$(EXEEXT) qselect$(EXEEXT) qsig$(EXEEXT) qstat$(EXEEXT) \ qsub$(EXEEXT) pbsdsh$(EXEEXT) qdisable$(EXEEXT) \ qenable$(EXEEXT) qrun$(EXEEXT) qstart$(EXEEXT) qstop$(EXEEXT) \ qterm$(EXEEXT) pbsnodes$(EXEEXT) qmgr$(EXEEXT) qchkpt$(EXEEXT) \ pbs_track$(EXEEXT) @PBSPOE@ EXTRA_PROGRAMS = pbspd$(EXEEXT) pbspoe$(EXEEXT) subdir = src/cmds ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_pbs_track_OBJECTS = pbs_track.$(OBJEXT) pbs_track_OBJECTS = $(am_pbs_track_OBJECTS) pbs_track_LDADD = $(LDADD) am__DEPENDENCIES_1 = ../lib/Libpbs/libtorque.la \ ../lib/Libutils/libutils.a pbs_track_DEPENDENCIES = $(am__DEPENDENCIES_1) am_pbsdsh_OBJECTS = pbsdsh.$(OBJEXT) pbsdsh_OBJECTS = $(am_pbsdsh_OBJECTS) pbsdsh_LDADD = $(LDADD) pbsdsh_DEPENDENCIES = $(am__DEPENDENCIES_1) am_pbsnodes_OBJECTS = pbsnodes.$(OBJEXT) MXML.$(OBJEXT) pbsnodes_OBJECTS = $(am_pbsnodes_OBJECTS) pbsnodes_LDADD = $(LDADD) pbsnodes_DEPENDENCIES = $(am__DEPENDENCIES_1) am_pbspd_OBJECTS = pbspd.$(OBJEXT) pbspd_OBJECTS = $(am_pbspd_OBJECTS) pbspd_LDADD = $(LDADD) pbspd_DEPENDENCIES = $(am__DEPENDENCIES_1) am_pbspoe_OBJECTS = pbspoe-pbspoe.$(OBJEXT) pbspoe_OBJECTS = $(am_pbspoe_OBJECTS) pbspoe_LDADD = $(LDADD) pbspoe_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qalter_OBJECTS = qalter.$(OBJEXT) qalter_OBJECTS = $(am_qalter_OBJECTS) qalter_LDADD = $(LDADD) qalter_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qchkpt_OBJECTS = qchkpt.$(OBJEXT) qchkpt_OBJECTS = $(am_qchkpt_OBJECTS) qchkpt_LDADD = $(LDADD) qchkpt_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qdel_OBJECTS = qdel.$(OBJEXT) qdel_OBJECTS = $(am_qdel_OBJECTS) qdel_LDADD = $(LDADD) qdel_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qdisable_OBJECTS = qdisable.$(OBJEXT) qdisable_OBJECTS = $(am_qdisable_OBJECTS) qdisable_LDADD = $(LDADD) qdisable_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qenable_OBJECTS = qenable.$(OBJEXT) qenable_OBJECTS = $(am_qenable_OBJECTS) qenable_LDADD = $(LDADD) qenable_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qhold_OBJECTS = qhold.$(OBJEXT) qhold_OBJECTS = $(am_qhold_OBJECTS) qhold_LDADD = $(LDADD) qhold_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qmgr_OBJECTS = qmgr.$(OBJEXT) qmgr_OBJECTS = $(am_qmgr_OBJECTS) am__DEPENDENCIES_2 = qmgr_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) am_qmove_OBJECTS = qmove.$(OBJEXT) qmove_OBJECTS = $(am_qmove_OBJECTS) qmove_LDADD = $(LDADD) qmove_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qmsg_OBJECTS = qmsg.$(OBJEXT) qmsg_OBJECTS = $(am_qmsg_OBJECTS) qmsg_LDADD = $(LDADD) qmsg_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qorder_OBJECTS = qorder.$(OBJEXT) qorder_OBJECTS = $(am_qorder_OBJECTS) qorder_LDADD = $(LDADD) qorder_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qrerun_OBJECTS = qrerun.$(OBJEXT) qrerun_OBJECTS = $(am_qrerun_OBJECTS) qrerun_LDADD = $(LDADD) qrerun_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qrls_OBJECTS = qrls.$(OBJEXT) qrls_OBJECTS = $(am_qrls_OBJECTS) qrls_LDADD = $(LDADD) qrls_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qrun_OBJECTS = qrun.$(OBJEXT) qrun_OBJECTS = $(am_qrun_OBJECTS) qrun_LDADD = $(LDADD) qrun_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qselect_OBJECTS = qselect.$(OBJEXT) qselect_OBJECTS = $(am_qselect_OBJECTS) qselect_LDADD = $(LDADD) qselect_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qsig_OBJECTS = qsig.$(OBJEXT) qsig_OBJECTS = $(am_qsig_OBJECTS) qsig_LDADD = $(LDADD) qsig_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qstart_OBJECTS = qstart.$(OBJEXT) qstart_OBJECTS = $(am_qstart_OBJECTS) qstart_LDADD = $(LDADD) qstart_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qstat_OBJECTS = qstat-qstat.$(OBJEXT) qstat-MXML.$(OBJEXT) qstat_OBJECTS = $(am_qstat_OBJECTS) @USE_TCLQSTAT_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) qstat_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) am_qstop_OBJECTS = qstop.$(OBJEXT) qstop_OBJECTS = $(am_qstop_OBJECTS) qstop_LDADD = $(LDADD) qstop_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qsub_OBJECTS = qsub-qsub.$(OBJEXT) qsub_OBJECTS = $(am_qsub_OBJECTS) qsub_LDADD = $(LDADD) qsub_DEPENDENCIES = $(am__DEPENDENCIES_1) am_qterm_OBJECTS = qterm.$(OBJEXT) qterm_OBJECTS = $(am_qterm_OBJECTS) qterm_LDADD = $(LDADD) qterm_DEPENDENCIES = $(am__DEPENDENCIES_1) dist_binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(dist_bin_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pbs_track_SOURCES) $(pbsdsh_SOURCES) $(pbsnodes_SOURCES) \ $(pbspd_SOURCES) $(pbspoe_SOURCES) $(qalter_SOURCES) \ $(qchkpt_SOURCES) $(qdel_SOURCES) $(qdisable_SOURCES) \ $(qenable_SOURCES) $(qhold_SOURCES) $(qmgr_SOURCES) \ $(qmove_SOURCES) $(qmsg_SOURCES) $(qorder_SOURCES) \ $(qrerun_SOURCES) $(qrls_SOURCES) $(qrun_SOURCES) \ $(qselect_SOURCES) $(qsig_SOURCES) $(qstart_SOURCES) \ $(qstat_SOURCES) $(qstop_SOURCES) $(qsub_SOURCES) \ $(qterm_SOURCES) DIST_SOURCES = $(pbs_track_SOURCES) $(pbsdsh_SOURCES) \ $(pbsnodes_SOURCES) $(pbspd_SOURCES) $(pbspoe_SOURCES) \ $(qalter_SOURCES) $(qchkpt_SOURCES) $(qdel_SOURCES) \ $(qdisable_SOURCES) $(qenable_SOURCES) $(qhold_SOURCES) \ $(qmgr_SOURCES) $(qmove_SOURCES) $(qmsg_SOURCES) \ $(qorder_SOURCES) $(qrerun_SOURCES) $(qrls_SOURCES) \ $(qrun_SOURCES) $(qselect_SOURCES) $(qsig_SOURCES) \ $(qstart_SOURCES) $(qstat_SOURCES) $(qstop_SOURCES) \ $(qsub_SOURCES) $(qterm_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter PBS_LIBS = ../lib/Libpbs/libtorque.la \ ../lib/Libutils/libutils.a dist_bin_SCRIPTS = nqs2pbs EXTRA_DIST = nqs2pbs.in sample.qstatrc LDADD = $(PBS_LIBS) @USE_TCLQSTAT_TRUE@TCLQSTATLIBS = $(MY_TCL_LIBS) @USE_TCLQSTAT_TRUE@TCLQSTATCFLAGS = $(MY_TCL_INCS) qstat_LDADD = $(PBS_LIBS) $(TCLQSTATLIBS) qstat_CFLAGS = $(TCLQSTATCFLAGS) qmgr_LDADD = $(PBS_LIBS) $(READLINE_LIBS) pbspoe_CFLAGS = -DPBSPD=\"$(bindir)/pbspd\" qsub_CFLAGS = -DSUBMIT_FILTER_PATH=\"$(SUBMIT_FILTER_PATH)\" \ -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" pbsdsh_SOURCES = pbsdsh.c pbsnodes_SOURCES = pbsnodes.c MXML.c pbspd_SOURCES = pbspd.c pbspoe_SOURCES = pbspoe.c qalter_SOURCES = qalter.c qdel_SOURCES = qdel.c qdisable_SOURCES = qdisable.c qenable_SOURCES = qenable.c qhold_SOURCES = qhold.c qmgr_SOURCES = qmgr.c qmove_SOURCES = qmove.c qmsg_SOURCES = qmsg.c qorder_SOURCES = qorder.c qrerun_SOURCES = qrerun.c qrls_SOURCES = qrls.c qrun_SOURCES = qrun.c qselect_SOURCES = qselect.c qsig_SOURCES = qsig.c qstart_SOURCES = qstart.c qstat_SOURCES = qstat.c MXML.c qstop_SOURCES = qstop.c qsub_SOURCES = qsub.c qterm_SOURCES = qterm.c qchkpt_SOURCES = qchkpt.c pbs_track_SOURCES = pbs_track.c CLEANFILES = $(dist_bin_SCRIPTS) do_subst = sed -e 's,[@]AWK[@],$(AWK),g' all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/cmds/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/cmds/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done pbs_track$(EXEEXT): $(pbs_track_OBJECTS) $(pbs_track_DEPENDENCIES) @rm -f pbs_track$(EXEEXT) $(LINK) $(pbs_track_LDFLAGS) $(pbs_track_OBJECTS) $(pbs_track_LDADD) $(LIBS) pbsdsh$(EXEEXT): $(pbsdsh_OBJECTS) $(pbsdsh_DEPENDENCIES) @rm -f pbsdsh$(EXEEXT) $(LINK) $(pbsdsh_LDFLAGS) $(pbsdsh_OBJECTS) $(pbsdsh_LDADD) $(LIBS) pbsnodes$(EXEEXT): $(pbsnodes_OBJECTS) $(pbsnodes_DEPENDENCIES) @rm -f pbsnodes$(EXEEXT) $(LINK) $(pbsnodes_LDFLAGS) $(pbsnodes_OBJECTS) $(pbsnodes_LDADD) $(LIBS) pbspd$(EXEEXT): $(pbspd_OBJECTS) $(pbspd_DEPENDENCIES) @rm -f pbspd$(EXEEXT) $(LINK) $(pbspd_LDFLAGS) $(pbspd_OBJECTS) $(pbspd_LDADD) $(LIBS) pbspoe$(EXEEXT): $(pbspoe_OBJECTS) $(pbspoe_DEPENDENCIES) @rm -f pbspoe$(EXEEXT) $(LINK) $(pbspoe_LDFLAGS) $(pbspoe_OBJECTS) $(pbspoe_LDADD) $(LIBS) qalter$(EXEEXT): $(qalter_OBJECTS) $(qalter_DEPENDENCIES) @rm -f qalter$(EXEEXT) $(LINK) $(qalter_LDFLAGS) $(qalter_OBJECTS) $(qalter_LDADD) $(LIBS) qchkpt$(EXEEXT): $(qchkpt_OBJECTS) $(qchkpt_DEPENDENCIES) @rm -f qchkpt$(EXEEXT) $(LINK) $(qchkpt_LDFLAGS) $(qchkpt_OBJECTS) $(qchkpt_LDADD) $(LIBS) qdel$(EXEEXT): $(qdel_OBJECTS) $(qdel_DEPENDENCIES) @rm -f qdel$(EXEEXT) $(LINK) $(qdel_LDFLAGS) $(qdel_OBJECTS) $(qdel_LDADD) $(LIBS) qdisable$(EXEEXT): $(qdisable_OBJECTS) $(qdisable_DEPENDENCIES) @rm -f qdisable$(EXEEXT) $(LINK) $(qdisable_LDFLAGS) $(qdisable_OBJECTS) $(qdisable_LDADD) $(LIBS) qenable$(EXEEXT): $(qenable_OBJECTS) $(qenable_DEPENDENCIES) @rm -f qenable$(EXEEXT) $(LINK) $(qenable_LDFLAGS) $(qenable_OBJECTS) $(qenable_LDADD) $(LIBS) qhold$(EXEEXT): $(qhold_OBJECTS) $(qhold_DEPENDENCIES) @rm -f qhold$(EXEEXT) $(LINK) $(qhold_LDFLAGS) $(qhold_OBJECTS) $(qhold_LDADD) $(LIBS) qmgr$(EXEEXT): $(qmgr_OBJECTS) $(qmgr_DEPENDENCIES) @rm -f qmgr$(EXEEXT) $(LINK) $(qmgr_LDFLAGS) $(qmgr_OBJECTS) $(qmgr_LDADD) $(LIBS) qmove$(EXEEXT): $(qmove_OBJECTS) $(qmove_DEPENDENCIES) @rm -f qmove$(EXEEXT) $(LINK) $(qmove_LDFLAGS) $(qmove_OBJECTS) $(qmove_LDADD) $(LIBS) qmsg$(EXEEXT): $(qmsg_OBJECTS) $(qmsg_DEPENDENCIES) @rm -f qmsg$(EXEEXT) $(LINK) $(qmsg_LDFLAGS) $(qmsg_OBJECTS) $(qmsg_LDADD) $(LIBS) qorder$(EXEEXT): $(qorder_OBJECTS) $(qorder_DEPENDENCIES) @rm -f qorder$(EXEEXT) $(LINK) $(qorder_LDFLAGS) $(qorder_OBJECTS) $(qorder_LDADD) $(LIBS) qrerun$(EXEEXT): $(qrerun_OBJECTS) $(qrerun_DEPENDENCIES) @rm -f qrerun$(EXEEXT) $(LINK) $(qrerun_LDFLAGS) $(qrerun_OBJECTS) $(qrerun_LDADD) $(LIBS) qrls$(EXEEXT): $(qrls_OBJECTS) $(qrls_DEPENDENCIES) @rm -f qrls$(EXEEXT) $(LINK) $(qrls_LDFLAGS) $(qrls_OBJECTS) $(qrls_LDADD) $(LIBS) qrun$(EXEEXT): $(qrun_OBJECTS) $(qrun_DEPENDENCIES) @rm -f qrun$(EXEEXT) $(LINK) $(qrun_LDFLAGS) $(qrun_OBJECTS) $(qrun_LDADD) $(LIBS) qselect$(EXEEXT): $(qselect_OBJECTS) $(qselect_DEPENDENCIES) @rm -f qselect$(EXEEXT) $(LINK) $(qselect_LDFLAGS) $(qselect_OBJECTS) $(qselect_LDADD) $(LIBS) qsig$(EXEEXT): $(qsig_OBJECTS) $(qsig_DEPENDENCIES) @rm -f qsig$(EXEEXT) $(LINK) $(qsig_LDFLAGS) $(qsig_OBJECTS) $(qsig_LDADD) $(LIBS) qstart$(EXEEXT): $(qstart_OBJECTS) $(qstart_DEPENDENCIES) @rm -f qstart$(EXEEXT) $(LINK) $(qstart_LDFLAGS) $(qstart_OBJECTS) $(qstart_LDADD) $(LIBS) qstat$(EXEEXT): $(qstat_OBJECTS) $(qstat_DEPENDENCIES) @rm -f qstat$(EXEEXT) $(LINK) $(qstat_LDFLAGS) $(qstat_OBJECTS) $(qstat_LDADD) $(LIBS) qstop$(EXEEXT): $(qstop_OBJECTS) $(qstop_DEPENDENCIES) @rm -f qstop$(EXEEXT) $(LINK) $(qstop_LDFLAGS) $(qstop_OBJECTS) $(qstop_LDADD) $(LIBS) qsub$(EXEEXT): $(qsub_OBJECTS) $(qsub_DEPENDENCIES) @rm -f qsub$(EXEEXT) $(LINK) $(qsub_LDFLAGS) $(qsub_OBJECTS) $(qsub_LDADD) $(LIBS) qterm$(EXEEXT): $(qterm_OBJECTS) $(qterm_DEPENDENCIES) @rm -f qterm$(EXEEXT) $(LINK) $(qterm_LDFLAGS) $(qterm_OBJECTS) $(qterm_LDADD) $(LIBS) install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(dist_bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(dist_binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(dist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-dist_binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MXML.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_track.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsdsh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsnodes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbspd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbspoe-pbspoe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qalter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qchkpt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qdel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qdisable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qenable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qhold.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qmgr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qmove.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qmsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qorder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qrerun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qrls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qrun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qselect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qsig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qstart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qstat-MXML.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qstat-qstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qstop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qsub-qsub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qterm.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< pbspoe-pbspoe.o: pbspoe.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbspoe_CFLAGS) $(CFLAGS) -MT pbspoe-pbspoe.o -MD -MP -MF "$(DEPDIR)/pbspoe-pbspoe.Tpo" -c -o pbspoe-pbspoe.o `test -f 'pbspoe.c' || echo '$(srcdir)/'`pbspoe.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbspoe-pbspoe.Tpo" "$(DEPDIR)/pbspoe-pbspoe.Po"; else rm -f "$(DEPDIR)/pbspoe-pbspoe.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pbspoe.c' object='pbspoe-pbspoe.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbspoe_CFLAGS) $(CFLAGS) -c -o pbspoe-pbspoe.o `test -f 'pbspoe.c' || echo '$(srcdir)/'`pbspoe.c pbspoe-pbspoe.obj: pbspoe.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbspoe_CFLAGS) $(CFLAGS) -MT pbspoe-pbspoe.obj -MD -MP -MF "$(DEPDIR)/pbspoe-pbspoe.Tpo" -c -o pbspoe-pbspoe.obj `if test -f 'pbspoe.c'; then $(CYGPATH_W) 'pbspoe.c'; else $(CYGPATH_W) '$(srcdir)/pbspoe.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbspoe-pbspoe.Tpo" "$(DEPDIR)/pbspoe-pbspoe.Po"; else rm -f "$(DEPDIR)/pbspoe-pbspoe.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pbspoe.c' object='pbspoe-pbspoe.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pbspoe_CFLAGS) $(CFLAGS) -c -o pbspoe-pbspoe.obj `if test -f 'pbspoe.c'; then $(CYGPATH_W) 'pbspoe.c'; else $(CYGPATH_W) '$(srcdir)/pbspoe.c'; fi` qstat-qstat.o: qstat.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -MT qstat-qstat.o -MD -MP -MF "$(DEPDIR)/qstat-qstat.Tpo" -c -o qstat-qstat.o `test -f 'qstat.c' || echo '$(srcdir)/'`qstat.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/qstat-qstat.Tpo" "$(DEPDIR)/qstat-qstat.Po"; else rm -f "$(DEPDIR)/qstat-qstat.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='qstat.c' object='qstat-qstat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -c -o qstat-qstat.o `test -f 'qstat.c' || echo '$(srcdir)/'`qstat.c qstat-qstat.obj: qstat.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -MT qstat-qstat.obj -MD -MP -MF "$(DEPDIR)/qstat-qstat.Tpo" -c -o qstat-qstat.obj `if test -f 'qstat.c'; then $(CYGPATH_W) 'qstat.c'; else $(CYGPATH_W) '$(srcdir)/qstat.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/qstat-qstat.Tpo" "$(DEPDIR)/qstat-qstat.Po"; else rm -f "$(DEPDIR)/qstat-qstat.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='qstat.c' object='qstat-qstat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -c -o qstat-qstat.obj `if test -f 'qstat.c'; then $(CYGPATH_W) 'qstat.c'; else $(CYGPATH_W) '$(srcdir)/qstat.c'; fi` qstat-MXML.o: MXML.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -MT qstat-MXML.o -MD -MP -MF "$(DEPDIR)/qstat-MXML.Tpo" -c -o qstat-MXML.o `test -f 'MXML.c' || echo '$(srcdir)/'`MXML.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/qstat-MXML.Tpo" "$(DEPDIR)/qstat-MXML.Po"; else rm -f "$(DEPDIR)/qstat-MXML.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='MXML.c' object='qstat-MXML.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -c -o qstat-MXML.o `test -f 'MXML.c' || echo '$(srcdir)/'`MXML.c qstat-MXML.obj: MXML.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -MT qstat-MXML.obj -MD -MP -MF "$(DEPDIR)/qstat-MXML.Tpo" -c -o qstat-MXML.obj `if test -f 'MXML.c'; then $(CYGPATH_W) 'MXML.c'; else $(CYGPATH_W) '$(srcdir)/MXML.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/qstat-MXML.Tpo" "$(DEPDIR)/qstat-MXML.Po"; else rm -f "$(DEPDIR)/qstat-MXML.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='MXML.c' object='qstat-MXML.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qstat_CFLAGS) $(CFLAGS) -c -o qstat-MXML.obj `if test -f 'MXML.c'; then $(CYGPATH_W) 'MXML.c'; else $(CYGPATH_W) '$(srcdir)/MXML.c'; fi` qsub-qsub.o: qsub.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qsub_CFLAGS) $(CFLAGS) -MT qsub-qsub.o -MD -MP -MF "$(DEPDIR)/qsub-qsub.Tpo" -c -o qsub-qsub.o `test -f 'qsub.c' || echo '$(srcdir)/'`qsub.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/qsub-qsub.Tpo" "$(DEPDIR)/qsub-qsub.Po"; else rm -f "$(DEPDIR)/qsub-qsub.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='qsub.c' object='qsub-qsub.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qsub_CFLAGS) $(CFLAGS) -c -o qsub-qsub.o `test -f 'qsub.c' || echo '$(srcdir)/'`qsub.c qsub-qsub.obj: qsub.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qsub_CFLAGS) $(CFLAGS) -MT qsub-qsub.obj -MD -MP -MF "$(DEPDIR)/qsub-qsub.Tpo" -c -o qsub-qsub.obj `if test -f 'qsub.c'; then $(CYGPATH_W) 'qsub.c'; else $(CYGPATH_W) '$(srcdir)/qsub.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/qsub-qsub.Tpo" "$(DEPDIR)/qsub-qsub.Po"; else rm -f "$(DEPDIR)/qsub-qsub.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='qsub.c' object='qsub-qsub.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(qsub_CFLAGS) $(CFLAGS) -c -o qsub-qsub.obj `if test -f 'qsub.c'; then $(CYGPATH_W) 'qsub.c'; else $(CYGPATH_W) '$(srcdir)/qsub.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-dist_binSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_binSCRIPTS \ uninstall-info-am @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dist_binSCRIPTS install-exec install-exec-am \ install-exec-hook install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dist_binSCRIPTS uninstall-hook \ uninstall-info-am nqs2pbs: nqs2pbs.in Makefile $(do_subst) < $(srcdir)/nqs2pbs.in > nqs2pbs chmod +x nqs2pbs install-exec-hook: $(PBS_MKDIRS) aux || : $(PBS_MKDIRS) default rm -f $(DESTDIR)$(bindir)/$(program_prefix)qnodes$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbsnodes$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(bindir)/$(program_prefix)qnodes$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(PBS_DEFAULT_FILE) rm -f $(DESTDIR)$(bindir)/$(program_prefix)qnodes$(program_suffix)$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/cmds/qstart.c0000664000113300011330000001647111272401236013242 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qstart * The qstart command directs that a destination should start scheduling * or routing batch jobs. * * Synopsis: * qstart destination ... * * Arguments: * destination ... * A list of destinations. A destination has one of the following * three forms: * queue * @server * queue@server * If queue is specified, the request is to start the queue at * the default server. If @server is given, the request is to * start all queues at the server. If queue@server is used, * the request is to start the named queue at the named server. * * Written by: * Bruce Kelly * National Energy Research Supercomputer Center * Livermore, CA * May, 1993 */ #include "cmds.h" #include /* the master config generated by configure */ int exitstatus = 0; /* Exit Status */ static void execute(char *, char *); int main( int argc, char **argv) { /* * This routine sends a Manage request to the batch server specified by * the destination. The STARTED queue attribute is set to {True}. If the * batch request is accepted, the server will start scheduling or routing * requests in the specified queue. */ int dest; /* Index into the destination array (argv) */ char *queue; /* Queue name part of destination */ char *server; /* Server name part of destination */ if (argc == 1) { fprintf(stderr, "Usage: qstart [queue][@server] ...\n"); exit(1); } else if (argc > 1 && argv[1][0] == '-') { fprintf(stderr, "Usage: qstart [queue][@server] ...\n"); exit(1); } for (dest = 1; dest < argc; dest++) if (parse_destination_id(argv[dest], &queue, &server) == 0) execute(queue, server); else { fprintf(stderr, "qstart: illegally formed destination: %s\n", argv[dest]); exitstatus = 1; } exit(exitstatus); } /* * void execute( char *queue, char *server ) * * queue The name of the queue to disable. * server The name of the server that manages the queue. * * Returns: * None * * File Variables: * exitstatus Set to two if an error occurs. */ static void execute(char *queue, char *server) { int ct; /* Connection to the server */ int merr; /* Error return from pbs_manager */ char *errmsg; /* Error message from pbs_manager */ /* The disable request */ static struct attropl attr = { NULL, "started", NULL, "TRUE", SET }; if ((ct = cnt2server(server)) > 0) { merr = pbs_manager(ct, MGR_CMD_SET, MGR_OBJ_QUEUE, queue, &attr, NULL); if (merr != 0) { errmsg = pbs_geterrmsg(ct); if (errmsg != NULL) { fprintf(stderr, "qstart: %s ", errmsg); } else { fprintf(stderr, "qstart: Error (%d - %s) starting queue ", pbs_errno, pbs_strerror(pbs_errno)); } if (notNULL(queue)) fprintf(stderr, "%s", queue); if (notNULL(server)) fprintf(stderr, "@%s", server); fprintf(stderr, "\n"); exitstatus = 2; } pbs_disconnect(ct); } else { fprintf(stderr, "qstart: could not connect to server %s (%d) %s\n", server, pbs_errno, pbs_strerror(pbs_errno)); exitstatus = 2; } } torque-2.4.16/src/cmds/qenable.c0000664000113300011330000001636611272401236013336 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qenable * The qenable command directs that a destination should accept batch jobs. * * Synopsis: * qenable destination ... * * Arguments: * destination ... * A list of destinations. A destination has one of the following * three forms: * queue * @server * queue@server * If queue is specified, the request is to enable the queue at * the default server. If @server is given, the request is to * enable the default queue at the server. If queue@server is * used, the request is to enable the named queue at the named * server. * * Written by: * Bruce Kelly * National Energy Research Supercomputer Center * Livermore, CA * May, 1993 */ #include "cmds.h" #include /* the master config generated by configure */ int exitstatus = 0; /* Exit Status */ static void execute(char *, char *); int main( int argc, char **argv) { /* * This routine sends a Manage request to the batch server specified by * the destination. The ENABLED queue attribute is set to {True}. If the * batch request is accepted, the server will accept Queue Job requests for * the specified queue. */ int dest; /* Index into the destination array (argv) */ char *queue; /* Queue name part of destination */ char *server; /* Server name part of destination */ if (argc == 1) { fprintf(stderr, "Usage: qenable [queue][@server] ...\n"); exit(1); } else if (argc > 1 && argv[1][0] == '-') { /* make it look like some kind of help is available */ fprintf(stderr, "Usage: qenable [queue][@server] ...\n"); exit(1); } for (dest = 1; dest < argc; dest++) if (parse_destination_id(argv[dest], &queue, &server) == 0) execute(queue, server); else { fprintf(stderr, "qenable: illegally formed destination: %s\n", argv[dest]); exitstatus = 1; } exit(exitstatus); } /* * void execute( char *queue, char *server ) * * queue The name of the queue to disable. * server The name of the server that manages the queue. * * Returns: * None * * File Variables: * exitstatus Set to two if an error occurs. */ static void execute( char *queue, char *server) { int ct; /* Connection to the server */ int merr; /* Error return from pbs_manager */ char *errmsg; /* Error message from pbs_manager */ /* The disable request */ static struct attropl attr = { NULL, "enabled", NULL, "TRUE", SET }; if ((ct = cnt2server(server)) > 0) { merr = pbs_manager(ct, MGR_CMD_SET, MGR_OBJ_QUEUE, queue, &attr, NULL); if (merr != 0) { errmsg = pbs_geterrmsg(ct); if (errmsg != NULL) { fprintf(stderr, "qenable: %s ", errmsg); } else { fprintf(stderr, "qenable: Error (%d) enabling queue ", pbs_errno); } if (notNULL(queue)) fprintf(stderr, "%s", queue); if (notNULL(server)) fprintf(stderr, "@%s", server); fprintf(stderr, "\n"); exitstatus = 2; } pbs_disconnect(ct); } else { fprintf(stderr, "qenable: could not connect to server %s (%d)\n", server, pbs_errno); exitstatus = 2; } } torque-2.4.16/src/cmds/qmsg.c0000664000113300011330000001476711272401236012701 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qmsg - (PBS) send message to batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ int main(int argc, char **argv) /* qmsg */ { int c; int to_file; int errflg = 0; int any_failed = 0; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; #define MAX_MSG_STRING_LEN 256 char msg_string[MAX_MSG_STRING_LEN+1]; #define GETOPT_ARGS "EO" msg_string[0] = '\0'; to_file = 0; while ((c = getopt(argc, argv, GETOPT_ARGS)) != EOF) switch (c) { case 'E': to_file |= MSG_ERR; break; case 'O': to_file |= MSG_OUT; break; default : errflg++; } if (to_file == 0) to_file = MSG_ERR; /* default */ if (errflg || ((optind + 1) >= argc)) { static char usage[] = "usage: qmsg [-O] [-E] msg_string job_identifier...\n"; fprintf(stderr,"%s", usage); exit(2); } strcpy(msg_string, argv[optind]); for (optind++; optind < argc; optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qmsg: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qmsg: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } stat = pbs_msgjob(connect, job_id_out, to_file, msg_string, NULL); if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qmsg", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qmsg", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } exit(any_failed); } torque-2.4.16/src/cmds/qmove.c0000664000113300011330000001434311272401236013047 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * qmove - (PBS) move batch job * * Authors: * Terry Heidelberg * Livermore Computing * * Bruce Kelly * National Energy Research Supercomputer Center * * Lawrence Livermore National Laboratory * University of California */ #include "cmds.h" #include /* the master config generated by configure */ int main(int argc, char **argv) /* qmove */ { int any_failed = 0; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char destination[PBS_MAXSERVERNAME]; /* from the command line */ char *q_n_out, *s_n_out; char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; if (argc < 3) { static char usage[] = "usage: qmove destination job_identifier...\n"; fprintf(stderr,"%s", usage); exit(2); } strcpy(destination, argv[1]); if (parse_destination_id(destination, &q_n_out, &s_n_out)) { fprintf(stderr, "qmove: illegally formed destination: %s\n", destination); exit(2); } for (optind = 2; optind < argc; optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qmove: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qmove: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); any_failed = pbs_errno; continue; } stat = pbs_movejob(connect, job_id_out, destination, NULL); if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qmove", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qmove", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } exit(any_failed); } torque-2.4.16/src/cmds/qorder.c0000664000113300011330000001573711272401236013224 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * qorder - change the order of two batch jobs in a queue */ #include #include "cmds.h" #include "net_connect.h" #include /* the master config generated by configure */ int main( int argc, /* I */ char **argv) /* I */ { char job_id1[PBS_MAXCLTJOBID+1]; /* from the command line */ char job_id2[PBS_MAXCLTJOBID+1]; /* from the command line */ char job_id1_out[PBS_MAXCLTJOBID+1]; char job_id2_out[PBS_MAXCLTJOBID+1]; char *pn; int port1 = 0; int port2 = 0; char server_out1[MAXSERVERNAME+1]; char server_out2[MAXSERVERNAME+1]; char svrtmp[MAXSERVERNAME+1]; int connect; int stat = 0; int rc = 0; if (argc != 3) { static char usage[] = "usage: qorder job_identifier job_identifier\n"; fprintf(stderr, "%s", usage); exit(2); } strcpy(job_id1, argv[1]); strcpy(job_id2, argv[2]); svrtmp[0] = '\0'; if (get_server(job_id1, job_id1_out, svrtmp)) { fprintf(stderr, "qorder: illegally formed job identifier: %s\n", job_id1); exit(1); } if (*svrtmp == '\0') { if ((pn = pbs_default())) { strcpy(svrtmp, pn); } else { fprintf(stderr, "qorder: could not get default server: %s\n", job_id1); exit(1); } } if ((pn = strchr(svrtmp, (int)':')) != 0) { *pn = '\0'; port1 = atoi(pn + 1); } if (get_fullhostname(svrtmp, server_out1, MAXSERVERNAME, NULL) != 0) { fprintf(stderr, "qorder: invalid server name: %s\n", job_id1); exit(1); } svrtmp[0] = '\0'; if (get_server(job_id2, job_id2_out, svrtmp)) { fprintf(stderr, "qorder: illegally formed job identifier: %s\n", job_id2); exit(1); } if (*svrtmp == '\0') { if ((pn = pbs_default())) { strcpy(svrtmp, pn); } else { fprintf(stderr, "qorder: could not get default server: %s\n", job_id1); exit(1); } } if ((pn = strchr(svrtmp, (int)':')) != 0) { *pn = '\0'; port2 = atoi(pn + 1); } if (get_fullhostname(svrtmp, server_out2, MAXSERVERNAME, NULL) != 0) { fprintf(stderr, "qorder: invalid server name: %s\n", job_id2); exit(1); } if ((strcmp(server_out1, server_out2) != 0) || (port1 != port2)) { fprintf(stderr, "qorder: both jobs ids must specify the same server\n"); exit(1); } if (pn != NULL) *pn = ':'; /* restore : if it was present */ connect = cnt2server(svrtmp); if (connect <= 0) { fprintf(stderr, "qorder: cannot connect to server %s (errno=%d) %s\n", pbs_server, pbs_errno, pbs_strerror(pbs_errno)); exit(1); } stat = pbs_orderjob(connect, job_id1_out, job_id2_out, NULL); if (stat != 0) { prt_job_err("qorder", connect, ""); rc = pbs_errno; } pbs_disconnect(connect); exit(rc); } /* END main() */ /* END qorder.c */ torque-2.4.16/src/cmds/pbspd.c0000664000113300011330000001445711272401236013036 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include #include #include #include /* * Used by PBS on IBM SP systems to set environment for tasks spawned by poe as: * * pbspd job_key window_id_file cmd args * * This results in the execution of "cmd" with the arguments "args" * The environ variable MP_PARTITION is set to "job_key" * The environ variable MP_CHILD is used to index into the text file * window_id_file to obtain the window id which becomes the value of the * environ variable MP_MPI_NETWORK. */ #define SWLINELEN 5 char get_winid(char *winidfile, char *mpchild) { FILE *wf; int tid; char buf[SWLINELEN+1]; char swid = '\0'; if ((wf = fopen(winidfile, "r")) == NULL) return '\0'; tid = atoi(mpchild) + 1; while (tid--) { if (fgets(buf, SWLINELEN, wf) == NULL) { fclose(wf); return '\0'; } } fclose(wf); swid = buf[0]; return (swid); } main(int argc, char **argv) { int len; char *jk; char *mpchild; char winid; static char *job_key = "MP_PARTITION="; static char job_win[15+SWLINELEN] = "MP_MPI_NETWORK="; /* Check that calling args are correct */ if (argc < 4) { fprintf(stderr, "%s: insufficent arguments\n", argv[0]); return 1; } if ((mpchild = getenv("MP_CHILD")) == NULL) { fprintf(stderr, "%s: MP_CHILD not in environment\n", argv[0]); return 1; } /* * Build up job key and window variables and put into environment. * The job key is the first argument. * The switch window_id_file is the second argument. */ len = strlen(argv[1]) + strlen(job_key) + 1; if ((jk = (char *)malloc(len)) == 0) { fprintf(stderr, "%s: cannot allocate memory\n", argv[0]); return 1; } (void)strcpy(jk, job_key); (void)strcat(jk, argv[1]); putenv(jk); winid = get_winid(argv[2], mpchild); if (winid == '\0') { fprintf(stderr, "%s: unable to obtain switch window id\n", argv[0]); return 1; } len = strlen(job_win); job_win[len] = winid; job_win[len+1] = '\0'; putenv(job_win); /* now exec the real program with its args */ if (execvp(argv[3], &argv[3]) < 0) { fprintf(stderr, "%s: unable to exec %s\n", argv[0], argv[3]); perror("error:"); return 1; } return 0; } torque-2.4.16/src/cmds/pbsnodes.c0000664000113300011330000004607011272401236013537 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** This program exists to give a way to mark nodes ** Down, Offline, or Free in PBS. ** ** usage: pbsnodes [-s server][-{c|l|o|r}] node node ... ** ** where the node(s) are the names given in the node ** description file. ** ** pbsnodes clear "DOWN" from all nodes so marked ** ** pbsnodes node1 node2 set nodes node1, node2 "DOWN" ** unmark "DOWN" from any other node ** ** pbsnodes -a list all nodes ** ** pbsnodes -l list all nodes marked in any way ** ** pbsnodes -o node1 node2 mark nodes node1, node2 as OFF_LINE ** even if currently in use. ** ** pbsnodes -r node1 node2 clear OFF_LINE from listed nodes ** ** pbsnodes -c node1 node2 clear OFF_LINE or DOWN from listed nodes */ #include /* the master config generated by configure */ #include #include #include #include #include #include "portability.h" #include "pbs_ifl.h" #include "mcom.h" #include "cmds.h" #define LIST 1 #define CLEAR 2 #define OFFLINE 3 #define RESET 4 #define ALLI 5 #define PURGE 6 #define DIAG 7 #define NOTE 8 enum note_flags {unused, set, list}; int quiet = 0; char *progname; /* globals */ mbool_t DisplayXML = FALSE; /* END globals */ /* * set_note - set the note attribute for a node * */ static int set_note( int con, char *name, char *msg) { char *errmsg; struct attropl new; int rc; new.name = ATTR_NODE_note; new.resource = NULL; new.value = msg; new.op = SET; new.next = NULL; rc = pbs_manager( con, MGR_CMD_SET, MGR_OBJ_NODE, name, &new, NULL); if (rc && !quiet) { fprintf(stderr, "Error setting note attribute for %s - ", name); if ((errmsg = pbs_geterrmsg(con)) != NULL) { fprintf(stderr, "%s\n", errmsg); } else { fprintf(stderr, "(error %d) %s\n", pbs_errno, pbs_strerror(pbs_errno)); } } return(rc); } /* END set_note() */ static void prt_node_attr( struct batch_status *pbs, /* I */ int IsVerbose) /* I */ { struct attrl *pat; for (pat = pbs->attribs;pat;pat = pat->next) { if ((pat->value == NULL) || (pat->value[0] == '?')) { if (IsVerbose == 0) continue; } printf(" %s = %s\n", pat->name, pat->value); } /* END for (pat) */ return; } /* END prt_node_attr() */ static char *get_nstate( struct batch_status *pbs) /* I */ { struct attrl *pat; for (pat = pbs->attribs;pat != NULL;pat = pat->next) { if (strcmp(pat->name, ATTR_NODE_state) == 0) { return(pat->value); } } return(""); } /* returns a pointer to the note if there is one, otherwise NULL */ static char *get_note( struct batch_status *pbs) /* I */ { struct attrl *pat; for (pat = pbs->attribs;pat != NULL;pat = pat->next) { if (strcmp(pat->name, ATTR_NODE_note) == 0) { return(pat->value); } } return(NULL); } static int marknode( int con, char *name, char *state1, enum batch_op op1, char *state2, enum batch_op op2) { char *errmsg; struct attropl new[2]; int rc; new[0].name = ATTR_NODE_state; new[0].resource = NULL; new[0].value = state1; new[0].op = op1; if (state2 == NULL) { new[0].next = NULL; } else { new[0].next = &new[1]; new[1].next = NULL; new[1].name = ATTR_NODE_state; new[1].resource = NULL; new[1].value = state2; new[1].op = op2; } rc = pbs_manager( con, MGR_CMD_SET, MGR_OBJ_NODE, name, new, NULL); if (rc && !quiet) { fprintf(stderr, "Error marking node %s - ", name); if ((errmsg = pbs_geterrmsg(con)) != NULL) fprintf(stderr, "%s\n", errmsg); else fprintf(stderr, "error: %d (%s)\n", pbs_errno, pbs_strerror(pbs_errno)); } return(rc); } /* END marknode() */ struct batch_status *statnode( int con, char *nodearg) { struct batch_status *bstatus; char *errmsg; bstatus = pbs_statnode(con, nodearg, NULL, NULL); if (bstatus == NULL) { if (pbs_errno) { if (!quiet) { if ((errmsg = pbs_geterrmsg(con)) != NULL) { fprintf(stderr, "%s: %s\n", progname, errmsg); } else { fprintf(stderr, "%s: Error %d (%s)\n", progname, pbs_errno, pbs_strerror(pbs_errno)); } } exit(1); } if (!quiet) fprintf(stderr, "%s: No nodes found\n", progname); exit(2); } return bstatus; } /* END statnode() */ void addxmlnode( mxml_t *DE, struct batch_status *pbstat) { mxml_t *NE; mxml_t *AE; struct attrl *pat; NE = NULL; MXMLCreateE(&NE, "Node"); MXMLAddE(DE, NE); /* add nodeid */ AE = NULL; MXMLCreateE(&AE, "name"); MXMLSetVal(AE, pbstat->name, mdfString); MXMLAddE(NE, AE); for (pat = pbstat->attribs;pat;pat = pat->next) { AE = NULL; if (pat->value == NULL) continue; MXMLCreateE(&AE, pat->name); MXMLSetVal(AE, pat->value, mdfString); MXMLAddE(NE, AE); } return; } /* END addxmlnode() */ enum NStateEnum { tnsNONE = 0, /* default behavior - show down, offline, and unknown nodes */ tnsActive, /* one or more jobs running on node */ tnsAll, /* list all nodes */ tnsBusy, /* node cannot accept additional workload */ tnsDown, /* node is down */ tnsFree, /* node is idle/free */ tnsOffline, /* node is offline */ tnsUnknown, /* node is unknown - no contact recieved */ tnsUp, /* node is healthy */ tnsLAST }; const char *NState[] = { "NONE", "active", "all", "busy", "down", "free", "offline", "unknown", "up", NULL }; int filterbystate( struct batch_status *pbstat, enum NStateEnum ListType, char *S) { int Display; Display = 0; switch (ListType) { case tnsNONE: /* display down, offline, and unknown nodes */ default: if (strstr(S, ND_down) || strstr(S, ND_offline) || strstr(S, ND_state_unknown)) { Display = 1; } break; case tnsActive: /* one or more jobs running on node */ if (strstr(S, ND_busy) || strstr(S, ND_job_exclusive) || strstr(S, ND_job_sharing)) { Display = 1; } break; case tnsAll: /* list all nodes */ Display = 1; break; case tnsBusy: /* node cannot accept additional workload */ if (strstr(S, ND_busy)) { Display = 1; } break; case tnsDown: /* node is down or unknown */ if (strstr(S, ND_down) || strstr(S, ND_state_unknown)) { Display = 1; } break; case tnsFree: /* node is idle/free */ if (strstr(S, ND_free)) { Display = 1; } break; case tnsOffline: /* node is offline */ if (strstr(S, ND_offline)) { Display = 1; } break; case tnsUnknown: /* node is unknown - no contact recieved */ if (strstr(S, ND_state_unknown)) { Display = 1; } break; case tnsUp: /* node is healthy */ if (!strstr(S, ND_down) && !strstr(S, ND_offline) && !strstr(S, ND_state_unknown)) { Display = 1; } break; } /* END switch (ListType) */ return(Display); } int main( int argc, /* I */ char **argv) /* I */ { struct batch_status *bstatus = NULL; int con; char *specified_server = NULL; int errflg = 0; int i; extern char *optarg; extern int optind; char **pa; struct batch_status *pbstat; int flag = ALLI; char *note = NULL; enum note_flags note_flag = unused; char **nodeargs = NULL; int lindex; enum NStateEnum ListType = tnsNONE; /* get default server, may be changed by -s option */ progname = strdup(argv[0]); while ((i = getopt(argc, argv, "acdlopqrs:x-:N:n")) != EOF) { switch (i) { case 'a': flag = ALLI; break; case 'c': flag = CLEAR; break; case 'd': flag = DIAG; break; case 'l': flag = LIST; break; case 'o': flag = OFFLINE; break; case 'p': flag = PURGE; break; case 'q': quiet = 1; break; case 'r': flag = RESET; break; case 's': specified_server = optarg; break; case 'x': flag = ALLI; DisplayXML = TRUE; break; case 'N': /* preserve any previous option other than the default, * to allow -N to be combined with -o, -c, etc */ if (flag == ALLI) flag = NOTE; note = strdup(optarg); if (note == NULL) { perror("Error: strdup() returned NULL"); exit(1); } note_flag = set; /* -N n is the same as -N "" -- it clears the note */ if (!strcmp(note, "n")) *note = '\0'; if (strlen(note) > MAX_NOTE) { fprintf(stderr, "Warning: note exceeds length limit (%d) - server may reject it...\n", MAX_NOTE); } if (strchr(note, '\n') != NULL) fprintf(stderr, "Warning: note contains a newline - server may reject it...\n"); break; case 'n': note_flag = list; break; case '-': if ((optarg != NULL) && !strcmp(optarg, "version")) { fprintf(stderr, "version: %s\n", PACKAGE_VERSION); exit(0); } else if ((optarg != NULL) && !strcmp(optarg, "about")) { TShowAbout(); exit(0); } errflg = 1; break; case '?': default: errflg = 1; break; } /* END switch (i) */ } /* END while (i = getopt()) */ if ((note_flag == list) && (flag != LIST)) { fprintf(stderr, "Error: -n requires -l\n"); errflg = 1; } for (pa = argv + optind;*pa;pa++) { if (strlen(*pa) == 0) { errflg = 1; } } if (errflg != 0) { if (!quiet) { fprintf(stderr, "usage:\t%s [-{c|d|l|o|p|r}] [-s server] [-n] [-N \"note\"] [-q] node ...\n", progname); fprintf(stderr, "\t%s [-{a|x}] [-s server] [-q] [node]\n", progname); } exit(1); } con = cnt2server(specified_server); if (con <= 0) { if (!quiet) { fprintf(stderr, "%s: cannot connect to server %s, error=%d (%s)\n", progname, (specified_server) ? specified_server : pbs_default(), pbs_errno, pbs_strerror(pbs_errno)); } exit(1); } /* if flag is ALLI, LIST, get status of all nodes */ if ((flag == ALLI) || (flag == LIST) || (flag == DIAG)) { if ((flag == ALLI) || (flag == LIST) || (flag == DIAG)) { if (flag == LIST) { /* allow state specification */ if (argv[optind] != NULL) { for (lindex = 1;lindex < tnsLAST;lindex++) { if (!strcasecmp(NState[lindex], argv[optind])) { ListType = lindex; optind++; break; } } } } /* allow node specification (if none, then create an empty list) */ if (argv[optind] != NULL) { nodeargs = argv + optind; } else { nodeargs = malloc(2 * sizeof(char **)); nodeargs[0] = strdup(""); nodeargs[1] = '\0'; } } } if ((note_flag == set) && (note != NULL)) { /* set the note attrib string on specified nodes */ for (pa = argv + optind;*pa;pa++) { set_note(con, *pa, note); } } switch (flag) { case DIAG: /* NYI */ break; case CLEAR: /* clear OFFLINE from specified nodes */ for (pa = argv + optind;*pa;pa++) { marknode(con, *pa, ND_offline, DECR, NULL, DECR); } break; case RESET: /* clear OFFLINE, add DOWN to specified nodes */ for (pa = argv + optind;*pa;pa++) { marknode(con, *pa, ND_offline, DECR, ND_down, INCR); } break; case OFFLINE: /* set OFFLINE on specified nodes */ for (pa = argv + optind;*pa;pa++) { marknode(con, *pa, ND_offline, INCR, NULL, INCR); } break; case PURGE: /* remove node record */ /* NYI */ break; case ALLI: if (DisplayXML == TRUE) { char *tmpBuf = NULL, *tail = NULL; int bufsize; mxml_t *DE; DE = NULL; MXMLCreateE(&DE, "Data"); for (lindex = 0;nodeargs[lindex] != '\0';lindex++) { bstatus = statnode(con, nodeargs[lindex]); for (pbstat = bstatus;pbstat;pbstat = pbstat->next) { addxmlnode(DE, pbstat); } /* END for (pbstat) */ pbs_statfree(pbstat); } MXMLToXString(DE, &tmpBuf, &bufsize, INT_MAX, &tail, TRUE); MXMLDestroyE(&DE); fprintf(stdout, "%s\n", tmpBuf); } else { for (lindex = 0;nodeargs[lindex] != '\0';lindex++) { bstatus = statnode(con, nodeargs[lindex]); for (pbstat = bstatus;pbstat;pbstat = pbstat->next) { printf("%s\n", pbstat->name); prt_node_attr(pbstat, 0); putchar('\n'); } /* END for (bpstat) */ pbs_statfree(pbstat); } } break; case LIST: /* list any node that is DOWN, OFFLINE, or UNKNOWN */ for (lindex = 0;nodeargs[lindex] != '\0';lindex++) { bstatus = statnode(con, nodeargs[lindex]); for (pbstat = bstatus;pbstat != NULL;pbstat = pbstat->next) { char *S; S = get_nstate(pbstat); if (filterbystate(pbstat, ListType, S)) { char *n; if ((note_flag == list) && (n = get_note(pbstat))) { printf("%-20.20s %-26.26s %s\n", pbstat->name, S, n); } else { printf("%-20.20s %s\n", pbstat->name, S); } } } pbs_statfree(pbstat); } break; } /* END switch (flag) */ pbs_disconnect(con); return(0); } /* END main() */ /* END pbsnodes.c */ torque-2.4.16/src/cmds/nqs2pbs.in0000775000113300011330000004650411272401236013503 00000000000000#!/bin/sh # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. if [ \( $# -eq 0 \) -o \( $# -gt 2 \) ] then echo Usage: $0 NQSscript \[PBSscript\] exit 1 fi if [ $# -eq 2 ] then OUT=$2 else OUT=$1.new fi echo Converting NQS script \"$1\" into \"$OUT\" @AWK@ ' # # Rule 0 - Initialize a few variables # BEGIN { suffix = " kKmMgGtT" err_ct = 0 cvn_ct = 0 warn_ct = 0 line_ct = 1 } # # Rule 1 - Make copy of line # { copy_of_line = $0 } # # Rule 2 - if line starts with either #QSUB or #@$ , convert it # ($0 ~ /^[ \t]*#[ \t]*QSUB/) || ($0 ~ /^[ \t]*#[ \t]*\@\$/) { if (donedate == 0 ) { "date" | getline today_is print "# This script converted on " today_is donedate = 1 } i = 1 if ($1 ~ /#$/) i = 2 if (($i ~ /QSUB-/) || ($i ~ /\@\$-/)) { $i = substr($i, index($i, "-")) } else { ++i; } printf ("#PBS "); for ( ; i <= NF; ++i ) { if ($i ~ /-a/ ) { # -a date # treat multiple words from a quoted string as separate # words and process them as a date date["CC"] = "" date["YY"] = "" date["MM"] = "" date["DD"] = "" date["hh"] = "00" date["mm"] = "00" date["ss"] = "" should_be_date = 0 if ($(++i) ~ /^["\047]/) quote = 1 else quote = 0 do { start = 1 if ($i ~ /^["\047]/ ) start = 2 len = length($i) + 1 - start if ($i ~ /["\047]$/ ) { --len quote = 0 } word = substr($i, start, len) # process the date word here... crackdate(word) } while (quote && (++i <= NF)) if (date["ss"] == "") printf("-a %s%s%s%s%s%s ",date["CC"],date["YY"],date["MM"],date["DD"],date["hh"],date["mm"] ) else printf("-a %s%s%s%s%s%s.%s ", date["CC"],date["YY"],date["MM"],date["DD"],date["hh"],date["mm"],date["ss"]) } else if ($i ~ /-A/ ) { # -A account printf("-A %s ",$(++i)) } else if ($i ~ /-C/ ) { # -C compartment prt_warning(sprintf("NQS %s option not supported", $i)) ++i } else if ($i ~ /-e$/ ) { # -e file printf("-e %s ",$(++i)) } else if ($i ~ /-eo/ ) { # -eo printf("-j oe ") } else if ($i ~ /-j|J/ ) { # -j prt_warning("NQS joblog options not supported") ++i } else if ($i ~ /-ke/ ) { # -ke if (have_ke == 0) { if (have_ko == 1) printf("-keo ") else printf("-ke ") have_ke = 1 } } else if ($i ~ /-ko/ ) { # -ke if (have_ko == 0) { if (have_ke == 1) printf("-keo ") else printf("-ko ") have_ko = 1 } } else if ($i ~ /-kj/ ) { # -kj prt_warning("NQS joblog options not supported") } else if ($i ~ /-l$/ ) { # -l ++i if ($i ~ /^"/ ) { word = cat_qstring() } else { word = $i } sub(/mpp_p/, "mppe", word) sub(/p_mpp_t/, "pmppt", word) sub(/mpp_t/, "mppt", word) printf("-l \"%s\"", word) } else if ($i ~ /-l[acdsw]/ ) { # -la -lc -ld -ls -lw prt_warning(sprintf("NQS %s options not supported",$i)) ++i } else if ($i ~ /-lf/ ) { # -lf limit printf("-l ppf=") cnv_limit($(++i)) } else if ($i ~ /-lF/ ) { # -lF limit printf("-l pf=") cnv_limit($(++i)) } else if ($i ~ /-lm/ ) { # -lm limit printf("-l pmem=") cnv_limit($(++i)) } else if ($i ~ /-lM/ ) { # -lM limit printf("-l mem=") cnv_limit($(++i)) } else if ($i ~ /-ln/ ) { # -ln nice printf("-l nice=%s ",$(++i)) } else if ($i ~ /-lr/ ) { # -lr srfs ++i cnv_srfs() } else if ($i ~ /-lQ/ ) { # -lQ sds printf("-l sds=") cnv_limit($(++i)) } else if ($i ~ /-lt/ ) { # -lt time printf("-l pcput=%s ",$(++i)) } else if ($i ~ /-lT/ ) { # -lT time printf("-l cput=%s ",$(++i)) } else if ($i ~ /-lU[a-h]/ ) { # -lUmttype printf("-l mt%s=%s ", substr($(i), 4, 1), $(++i)) } else if ($i ~ /-L/ ) { # -L level prt_warning(sprintf("NQS %s option not supported", $i)) ++i } else if ($i ~ /-mb/ ) { # -mb if (have_mb == 0) { if (have_me == 0) printf("-mb ") else printf("-mbe ") have_mb = 1 } } else if ($i ~ /-me/ ) { # -mb if (have_me == 0) { if (have_mb == 0) printf("-me ") else printf("-mbe ") have_me = 1 } } else if ($i ~ /-m[rt]/ ) { # -mr -mt prt_warning(sprintf("NQS %s option not supported", $i)) } else if ($i ~ /-mu/ ) { #-mu user printf("-M %s ", $(++i)) } else if ($i ~ /-nc/ ) { # -nc printf("-cn ") } else if ($i ~ /-nr/ ) { # -nr printf("-rn ") } else if ($i ~ /-o/ ) { # -o file printf("-o %s ",$(++i)) } else if ($i ~ /-p/ ) { # -p priority prior = $(++i) if (prior > 1023) prior = 1023 else if (prior < -1024) prior = -1024 printf("-p %s ", prior) } else if ($i ~ /-q/ ) { # -q queue printf("-q %s ",$(++i)) } else if ($i ~ /-r$/ ) { # -r name printf("-N %s ",$(++i)) } else if ($i ~ /-r[eo]/ ) { # -re -ro prt_warning(sprintf("NQS %s option not supported, you may wish to use -k%c", $i, substr($i, 3, 3))) } else if ($i ~ /-Rf/ ) { # -Rf prt_warning("NQS -Rf option not supported") ++i } else if ($i ~ /^-s$/ ) { # -s shell printf("-S %s ",$(++i)) } else if ($i ~ /-u/ ) { # -u user printf("-u %s ",$(++i)) } else if ($i ~ /-x/ ) { # -x printf("-V ") } else if ($i ~ /-z/ ) { # -z printf("-z ") } else if ($i ~ /^#/ ) { # #comment break } else if ($i ~ /^-/ ) { # -any_thing_else prt_warning(sprintf("Unknown NQS option \"%s\"\n\tabove option was not converted", $i)) } else { prt_error("unknown option/parameter ", $i) } } printf("\n"); } # # Rule 3 - for every line, print it # { print copy_of_line ++line_ct } # # END Rule - print number of warnings and errors, if errors exit non-zero # END { if ( cvn_ct > 0 ) { printf("\nFractional size values, i.e. \"23.4mw\" are not supported in PBS.\n") > "/dev/tty" printf("In %d occurrence in this conversion, a fractonal size value was converted\nto the corresponding integeral value of the next small unit.\n", cvn_ct) > "/dev/tty" printf("For example, \"23.4mw\" converted to \"23962kw\"\n") > "/dev/tty" } printf("\nIn converting the script, %d errors and %d warnings occurred\n", err_ct, warn_ct) > "/dev/tty" exit err_ct } # # function prt_warning - print a warning message and the script line causing it # function prt_warning(text) { print "\nWarning on line #" line_ct " of NQS script" > "/dev/tty" print "\t" text > "/dev/tty" print "\tinput line: " substr($0, 1, 40) > "/dev/tty" ++warn_ct } # # function prt_error - print a error message and the script line causing it # function prt_error(text, word) { print "\nError on line #" line_ct " of NQS script" > "/dev/tty" print "\t" text " \""word "\"" > "/dev/tty" print "\tinput line: " substr($0, 1, 40) > "/dev/tty" ++err_ct } # # function crackdate - convert NQS complex date/time to PBSs # [[[[YY]CC]MM]DD]hhmm[.ss] # function crackdate(word) { # noon if (word ~ /noon$/) { date["hh"] = "12" date["mm"] = "00" # midnight } else if (word ~ /midnight$/) { date["hh"] = "00" date["mm"] = "00" # day of week, today, tomorrow - all bad news } else if ( (word ~ /^[Mm][Oo][Nn][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Tt][Uu][Ee][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ww][Ee][Dd][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Tt][Hh][Uu][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ff][Rr][Ii][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ss][Aa][Tt][a-zA-Z]*[.,]*$/ ) || (word ~ /^[Ss][Uu][Nn][a-zA-Z]*[.,]*$/ ) || (word ~ /^today,*$/ ) || (word ~ /^Today,*$/ ) || (word ~ /^TODAY,*$/ ) || (word ~ /^tomorrow,*$/ ) || (word ~ /^Tomorrow,*$/ ) || (word ~ /^TOMORROW,*$/ ) ) { prt_warning(sprintf("PBS does not support a date form of \"%s\".\n\Recommend use of -a option on command line rather than in the script.", word)) # Time Zone specifier } else if ( word ~ /^[ACEGMP][DMPS]T,?$/ ) { prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # MM/DD } else if ( word ~ /^[01][0-9]\/[0-3][0-9]$/ ) { date["MM"] = substr(word, 1, 2) date["DD"] = substr(word, 4, 2) # MM/DD/YY }else if (word ~ /^[01][0-9]\/[0-3][0-9]\/[0-9][0-9]$/ ) { date["MM"] = substr(word, 1, 2) date["DD"] = substr(word, 4, 5) date["YY"] = substr(word, 7, 2) # MM/DD/YYYY } else if (word ~ /^[01][0-9]\/[0-3][0-9]\/[0-9][0-9][0-9][0-9]$/ ) { date["MM"] = substr(word, 1, 2) date["DD"] = substr(word, 4, 2) date["YY"] = substr(word, 9, 2) date["CC"] = substr(word, 7, 2) # YYYY }else if (word ~ /^[0-9][0-9][0-9][0-9]$/ ) { date["CC"] = substr(word, 1, 2) date["YY"] = substr(word, 3, 2) should_be_date = 1 # YYYY-MM-DD } else if (word ~ /^[0-9][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]$/ ) { date["CC"] = substr(word, 1, 2) date["YY"] = substr(word, 3, 2) date["MM"] = substr(word, 6, 2) date["DD"] = substr(word, 9, 2) # month } else if (word ~ /^[a-zA-Z][a-zA-Z][a-zA-Z]*$/ ) { get_month(word) should_be_date = 1 # either DD or HH } else if (word ~ /^[0-3][0-9],?$/ ) { if (should_be_date == 1) { date["DD"] = substr(word, 1, 2) should_be_date = 0 } else { date["hh"] = substr(word, 1, 2) date["mm"] = "00" } # either D or H } else if (word ~ /^[0-9],?$/) { if (should_be_date == 1) { date["DD"] = "0" substr(word, 1, 1) should_be_date = 0 } else { date["hh"] = "0" substr(word, 1, 1) date["mm"] = "00" } # H[[a|p]m] } else if (word ~ /^[0-9][ap]?m?,?$/ ) { date["hh"] = "0" substr(word, 1, 1) adj_hour(word) # HH[[a|p]m] } else if (word ~ /^[0-2][0-9][ap]?m?,?$/ ) { date["hh"] = substr(word, 1, 2) adj_hour(word) # HHtimezone } else if (word ~ /^[0-2][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # H:MM[[a|p]m] } else if (word ~ /^[0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) adj_hour(word) # H:MMtimezone } else if (word ~ /^[0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # HH:MM[[a|p]m] } else if (word ~ /^[0-2][0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) adj_hour(word) # HH:MMtimezone } else if (word ~ /^[0-2][0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # H:MM:SS[[a|p]m] } else if (word ~ /^[0-9]:[0-5][0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) date["ss"] = substr(word, 6, 2) adj_hour(word) # H:MM:SStimezone } else if (word ~ /^[0-9]:[0-5][0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 1) date["mm"] = substr(word, 3, 2) date["ss"] = substr(word, 6, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # HH:MM:SS[[a|p]m] } else if (word ~ /^[0-2][0-9]:[0-5][0-9]:[0-5][0-9][ap]?m?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) date["ss"] = substr(word, 7, 2) adj_hour(word) # HH:MM:SStimezone } else if (word ~ /^[0-2][0-9]:[0-5][0-9]:[0-5][0-9][ACEGMP][DMPS]T,?$/ ) { date["hh"] = substr(word, 1, 2) date["mm"] = substr(word, 4, 2) date["ss"] = substr(word, 7, 2) adj_hour(word) prt_warning("PBS does not support time zone in a date specification,\n\tdefaulting to local time.") # DD-month } else if (word ~ /^[0-3][0-9]-[a-zA-Z][a-zA-Z][a-zA-Z]*$/ ) { date["DD"] = substr(word, 1, 2) get_month(substr(word, 4)) # DD-month-YY DD-month-YYYY } else if (word ~ /^[0-3][0-9]-[a-zA-Z][a-zA-Z][a-zA-Z]*-[0-9][0-9]*$/) { date["DD"] = substr(word, 1, 2) get_month(substr(word, 4, 3)) if (word ~ /.*-[0-9][0-9]$/ ) { # -YY date["YY"] = substr(word, length(word)-1, 2) } else { # -YYYY date["CC"] = substr(word, length(word)-3, 2) date["YY"] = substr(word, length(word)-1, 2) } } else { prt_error("unrecognized date syntax: ", word) > "/dev/tty" } } # # function get_month - convert abbrev of a month to numerical index 01-12 # function get_month(word) { if (word ~ /[Jj][Aa][Nn].*/ ) date["MM"] = "01" else if (word ~ /[Ff][Ee][Bb].*/ ) date["MM"] = "02" else if (word ~ /[Mm][Aa][Rr].*/ ) date["MM"] = "03" else if (word ~ /[Aa][Pp][Rr].*/ ) date["MM"] = "04" else if (word ~ /[Mm][Aa][Yy]/ ) date["MM"] = "05" else if (word ~ /[Jj][Uu][Nn].*/ ) date["MM"] = "06" else if (word ~ /[Jj][Uu][Ll].*/ ) date["MM"] = "07" else if (word ~ /[Aa][Uu][Gg].*/ ) date["MM"] = "08" else if (word ~ /[Ss][Ee][Pp].*/ ) date["MM"] = "09" else if (word ~ /[Oo][Cc][Tt].*/ ) date["MM"] = "10" else if (word ~ /[Nn][Oo][Vv].*/ ) date["MM"] = "11" else if (word ~ /[Dd][Ee][Cc].*/ ) date["MM"] = "12" else { prt_error("Bad month specification ", word) > "/dev/tty" } } # # function adj_hour - adjust 12 hour clock to 24 hour # function adj_hour(word) { if (((word ~ /pm,?$/ ) || (word ~ /[0-9]m,?$/)) && (date["hh"] < 12)) { date["hh"] = substr(word, 1, 2) + 12; } else if (word ~ /am,?$/) { if (date["hh"] == 12) { date["hh"] = "00" } } } # # function cnv_srfs - convert NQS srfs request to PBS srfs request # function cnv_srfs() { if ($i ~ /^[\047"]/) val = cat_qstring() # pull parameters into one string else val = $i nele = split(val, parts, ",") # split into 2,3,or 4 parts if (nele < 2) { prt_error("incorrect SRFS syntax in ", $0) return } if (parts[1] ~ /\$FASTDIR/) { # $FASTDIR dir = "srfs_fast" } else if (parts[1] ~ /\/fast/) { dir = "srfs_fast" } else if (parts[1] ~ /\$BIGDIR/) { # $BIGDIR dir = "srfs_big" } else if (parts[1] ~ /\$TMPDIR/) { # $TMPDIR dir = "srfs_tmp" } else if (parts[1] ~ /\$WRKDIR/) { # $WRKDIR dir = "srfs_wrk" } else { prt_error("cannot convert this srfs request\n\t", $0) return } printf("-l %s=", dir) cnv_limit(parts[2]) if (nele > 2) { prt_warning("GID/ACID not supported on SRFS request") } } # # function cat_qstring - concat quoted words into a single string # "abc def ghi " -> abcdefghi # function cat_qstring() { if ($i ~ /^[\047"]..*/) { # start of quoted words tmp = $i while ( tmp !~ /[\047"]$/) tmp = tmp $(++i) } else if ($i ~ /^[\047"]$/ ) { tmp = $i $(++i) while ( tmp !~ /[\047"]$/) tmp = tmp $(++i) } tmp = substr(tmp, 2, length(tmp)-2) return tmp } # # function cnv_limit - convert NQS limit value ###[.###][[kmg]wb] to # PBSs ###[kmgt][wb] # # if NQS has fraction, mutiple by 1024 and drop suffix to next lower # magnitude, e.g "4.5MW" -> "4608KW" # function cnv_limit(word) { len = length(word) # nnn if (word ~ /^[0-9][0-9]*$/) { val = word suf = "" byte= "b" # nnnMB } else if (word ~ /^[0-9][0-9]*[kKmMgGtT][wWbB]$/) { val = substr(word, 1, len-2) suf = substr(word, len-1, 1) byte = substr(word, len, 1) # nnnW } else if (word ~ /^[0-9][0-9]*[wWbB]$/) { val = substr(word, 1, len-1) suf = "" byte = substr(word, len, 1) # nnn.nnMW } else if (word ~ /^[0-9]*\.[0-9]*[kKmMgGtT][wWbB]$/) { ++cvn_ct val = sprintf("%.0f", (substr(word, 1, len-2) * 1024)+1) ind = index(suffix, substr(word, length(word)-1, 1)) suf = substr(suffix, ind-2, 1) if (suf == " ") suf = "" byte = substr(word, length(word), 1) } else { prt_error("unrecognized limit ", word) } printf("%s%s%s ", val, suf, byte) } ' < $1 > $OUT if [ $? -ne 0 ] then echo Because of errors in converting the script, echo $OUT is being removed. rm $OUT exit 1 else echo Script conversion complete, new PBS script in $OUT exit 0 fi torque-2.4.16/src/cmds/qchkpt.c0000664000113300011330000000341611272401236013211 00000000000000/* * Copyright ClusterResources 2008 * * qchkpt - checkpoint a batch job * * Author: * Steven Snelgrove * Cluster Resources */ #include "cmds.h" #include /* the master config generated by configure */ int main(int argc, char **argv) /* qchkpt */ { int any_failed = 0; static char usage[] = "Usage: qchkpt job_id ...\n"; char job_id[PBS_MAXCLTJOBID]; /* from the command line */ char job_id_out[PBS_MAXCLTJOBID]; char server_out[MAXSERVERNAME]; char rmt_server[MAXSERVERNAME]; if (argc == 1) { fprintf(stderr, "%s", usage); return 1; } for (optind = 1; optind < argc; optind++) { int connect; int stat = 0; int located = FALSE; strcpy(job_id, argv[optind]); if (get_server(job_id, job_id_out, server_out)) { fprintf(stderr, "qchkpt: illegally formed job identifier: %s\n", job_id); any_failed = 1; continue; } cnt: connect = cnt2server(server_out); if (connect <= 0) { fprintf(stderr, "qchkpt: cannot connect to server %s (errno=%d)\n", pbs_server, pbs_errno); any_failed = pbs_errno; continue; } stat = pbs_checkpointjob(connect, job_id_out, NULL); if (stat && (pbs_errno != PBSE_UNKJOBID)) { prt_job_err("qchkpt", connect, job_id_out); any_failed = pbs_errno; } else if (stat && (pbs_errno == PBSE_UNKJOBID) && !located) { located = TRUE; if (locate_job(job_id_out, server_out, rmt_server)) { pbs_disconnect(connect); strcpy(server_out, rmt_server); goto cnt; } prt_job_err("qchkpt", connect, job_id_out); any_failed = pbs_errno; } pbs_disconnect(connect); } return any_failed; } torque-2.4.16/src/cmds/Makefile.am0000664000113300011330000000374311272401236013612 00000000000000include $(top_srcdir)/buildutils/config.mk PBS_LIBS = ../lib/Libpbs/libtorque.la \ ../lib/Libutils/libutils.a dist_bin_SCRIPTS = nqs2pbs bin_PROGRAMS = qalter qdel qhold qmove qorder qmsg qrerun qrls qselect qsig \ qstat qsub pbsdsh qdisable qenable qrun qstart qstop qterm \ pbsnodes qmgr qchkpt pbs_track @PBSPOE@ EXTRA_PROGRAMS = pbspd pbspoe EXTRA_DIST = nqs2pbs.in sample.qstatrc LDADD = $(PBS_LIBS) if USE_TCLQSTAT TCLQSTATLIBS = $(MY_TCL_LIBS) TCLQSTATCFLAGS = $(MY_TCL_INCS) endif qstat_LDADD = $(PBS_LIBS) $(TCLQSTATLIBS) qstat_CFLAGS = $(TCLQSTATCFLAGS) qmgr_LDADD = $(PBS_LIBS) $(READLINE_LIBS) pbspoe_CFLAGS = -DPBSPD=\"$(bindir)/pbspd\" qsub_CFLAGS = -DSUBMIT_FILTER_PATH=\"$(SUBMIT_FILTER_PATH)\" \ -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" pbsdsh_SOURCES = pbsdsh.c pbsnodes_SOURCES = pbsnodes.c MXML.c pbspd_SOURCES = pbspd.c pbspoe_SOURCES = pbspoe.c qalter_SOURCES = qalter.c qdel_SOURCES = qdel.c qdisable_SOURCES = qdisable.c qenable_SOURCES = qenable.c qhold_SOURCES = qhold.c qmgr_SOURCES = qmgr.c qmove_SOURCES = qmove.c qmsg_SOURCES = qmsg.c qorder_SOURCES = qorder.c qrerun_SOURCES = qrerun.c qrls_SOURCES = qrls.c qrun_SOURCES = qrun.c qselect_SOURCES = qselect.c qsig_SOURCES = qsig.c qstart_SOURCES = qstart.c qstat_SOURCES = qstat.c MXML.c qstop_SOURCES = qstop.c qsub_SOURCES = qsub.c qterm_SOURCES = qterm.c qchkpt_SOURCES = qchkpt.c pbs_track_SOURCES = pbs_track.c CLEANFILES = $(dist_bin_SCRIPTS) do_subst = sed -e 's,[@]AWK[@],$(AWK),g' nqs2pbs: nqs2pbs.in Makefile $(do_subst) < $(srcdir)/nqs2pbs.in > nqs2pbs chmod +x nqs2pbs install-exec-hook: $(PBS_MKDIRS) aux || : $(PBS_MKDIRS) default rm -f $(DESTDIR)$(bindir)/$(program_prefix)qnodes$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbsnodes$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(bindir)/$(program_prefix)qnodes$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(PBS_DEFAULT_FILE) rm -f $(DESTDIR)$(bindir)/$(program_prefix)qnodes$(program_suffix)$(EXEEXT) torque-2.4.16/src/include/0000777000113300011330000000000011614035202012322 500000000000000torque-2.4.16/src/include/qmgr_svr_readonly.h0000664000113300011330000001057311272401235016157 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: qmgr_svr_readonly.h 2367 2008-09-03 17:17:34Z josh $ */ /* * This is a list of read only server attributes * * FORMAT: * attr1, * attr2, <--- important the last has a comma after it * * This file will be used for the initialization of an array * */ ATTR_rescassn, ATTR_count, ATTR_status, ATTR_total, ATTR_netcounter, ATTR_pbsversion, torque-2.4.16/src/include/csv.h0000664000113300011330000000066011272401235013211 00000000000000/* Copyright 2008 Cluster Resources */ /* A small library of functions dealing with comma separated variable lists */ #ifndef _CSV_H_ #define _CSV_H_ extern int csv_length(char *csv_str); extern char *csv_nth(char *csv_str, int n); extern char *csv_find_string(char *csv_str, char *search_str); extern char *csv_find_value(char *csv_str, char *search_str); /* Note that csv_nth returns a pointer to a static buffer */ #endif torque-2.4.16/src/include/tracking.h0000664000113300011330000001155211272401235014222 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: tracking.h 2367 2008-09-03 17:17:34Z josh $ */ /* * tracking.h - header file for maintaining job tracking records * * These are linked into the server structure. Entries are added or * updated upon the receipt of Track Job Requests and are used to * satisfy Locate Job requests. * * The main data is kept in the form of the track batch request so * that copying is easy. * * Other required header files: * "server_limits.h" */ #define PBS_TRACK_MINSIZE 100 /* mininum size of buffer in records */ #define PBS_SAVE_TRACK_TM 300 /* time interval between saves of track data */ struct tracking { time_t tk_mtime; /* time this entry modified */ int tk_hopcount; char tk_jobid[PBS_MAXSVRJOBID+1]; char tk_location[PBS_MAXDEST+1]; char tk_state; }; extern void track_save A_((struct work_task *)); torque-2.4.16/src/include/batch_request.h0000664000113300011330000003510111413216777015261 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Definition of basic batch request and reply strutures * * The basic batch request structure holds certain useful information * and a union of the "encode method" independent batch request data. * * This data is obtained by the encode dependent routine. * * Other required header files: * "list_link.h" * "server_limits.h" * "attributes.h" * "credential.h" * "BATCH-types.h" - for protocol definition of request numbers * * First we define the reply structure as it is contained within the * request structure. */ #include "libpbs.h" #include "attribute.h" #include "credential.h" #ifndef BATCH_REQUEST_H #define BATCH_REQUEST_H 1 /* * The rest of this stuff is for the Batch Request Structure */ #define PBS_SIGNAMESZ 16 /* * The following strutures make up the union of encode independent * request data. * * The list of attributes, used in QueueJob, SelectJobs, PullJobs, and * Manager is an svrattrlist structure defined in "attribute.h" */ /* QueueJob */ struct rq_queuejob { char rq_destin[PBS_MAXDEST+1]; char rq_jid[PBS_MAXSVRJOBID+1]; tlist_head rq_attr; /* svrattrlist */ }; /* JobCredential */ struct rq_jobcred { int rq_type; long rq_size; char *rq_data; }; /* Job File */ struct rq_jobfile { int rq_sequence; int rq_type; long rq_size; char rq_jobid[PBS_MAXSVRJOBID+1]; char *rq_data; }; /* * job or destination id - used by RdyToCommit, Commit, RerunJob, * status ..., locate job, and run job - is just a char * * * Manage - used by Manager, DeleteJob, ReleaseJob, ModifyJob */ struct rq_manage { int rq_cmd; int rq_objtype; char rq_objname[PBS_MAXSVRJOBID+1]; tlist_head rq_attr; /* svrattrlist */ }; /* HoldJob - plus preference flag */ struct rq_hold { struct rq_manage rq_orig; int rq_hpref; }; /* MessageJob */ struct rq_message { int rq_file; char rq_jid[PBS_MAXSVRJOBID+1]; char *rq_text; }; /* MoveJob */ struct rq_move { char rq_jid[PBS_MAXSVRJOBID+1]; char rq_destin[(PBS_MAXSVRJOBID > PBS_MAXDEST ? PBS_MAXSVRJOBID:PBS_MAXDEST)+1]; }; /* Resource Query/Reserve/Free */ struct rq_rescq { int rq_rhandle; int rq_num; char **rq_list; }; /* RunJob */ struct rq_runjob { char rq_jid[PBS_MAXSVRJOBID + 1]; /* requested job id */ char *rq_destin; /* destination hostlist */ unsigned int rq_resch; }; /* SignalJob */ struct rq_signal { char rq_jid[PBS_MAXSVRJOBID+1]; char rq_signame[PBS_SIGNAMESZ+1]; }; /* Status (job, queue, server) */ struct rq_status { char rq_id[(PBS_MAXSVRJOBID > PBS_MAXDEST ? PBS_MAXSVRJOBID:PBS_MAXDEST)+1]; tlist_head rq_attr; }; /* TrackJob */ struct rq_track { int rq_hopcount; char rq_jid[PBS_MAXSVRJOBID+1]; char rq_location[PBS_MAXDEST+1]; char rq_state[2]; }; /* RegisterDependentJob */ struct rq_register { char rq_owner[PBS_MAXUSER + 1]; char rq_svr[PBS_MAXSERVERNAME + 1]; char rq_parent[PBS_MAXSVRJOBID + 1]; char rq_child[PBS_MAXCLTJOBID + 1]; /* need separate entry for */ int rq_dependtype; /* from server_name:port */ int rq_op; long rq_cost; }; /* Authenticate User */ struct rq_authen { unsigned int rq_port; }; /* Copy/Delete Files (Server -> MOM Only) */ #define STDJOBFILE 1 #define JOBCKPFILE 2 #define STAGEFILE 3 #define STAGE_DIR_IN 0 #define STAGE_DIR_OUT 1 #define CKPT_DIR_IN 2 #define CKPT_DIR_OUT 3 struct rq_cpyfile { char rq_jobid[PBS_MAXSVRJOBID + 1]; /* Not used for stage-in */ char rq_owner[PBS_MAXUSER + 1]; /* used in Copy only */ char rq_user[PBS_MAXUSER + 1]; /* used in Copy & Delete */ char rq_group[PBS_MAXGRPN + 1]; /* used in Copy only */ int rq_dir; /* used in Copy & checkpoint restart delete */ tlist_head rq_pair; /* list of rqfpair, used in Copy & Delete */ }; struct rqfpair { list_link fp_link; int fp_flag; /* 1 for std[out|err] 2 for stageout */ char *fp_local; /* used in Copy & Delete */ char *fp_rmt; /* used in Copy only */ }; struct rq_returnfiles { char rq_jobid[PBS_MAXSVRJOBID + 1]; int rq_return_stdout; int rq_return_stderr; }; /* Job Obituary (MOM -> Server Only) */ struct rq_jobobit { char rq_jid[PBS_MAXSVRJOBID+1]; int rq_status; tlist_head rq_attr; /* svrattrlist */ }; /* * ok we now have all the individual request structures defined, * so here is the union ... */ struct batch_request { list_link rq_link; /* linkage of all requests */ int rq_type; /* type of request */ int rq_perm; /* access permissions for the user */ int rq_fromsvr; /* true if request from another server */ int rq_conn; /* socket connection to client/server */ int rq_orgconn; /* original socket if relayed to MOM */ int rq_extsz; /* size of "extension" data */ long rq_time; /* time batch request created */ char rq_user[PBS_MAXUSER+1]; /* user name request is from */ char rq_host[PBS_MAXHOSTNAME+1]; /* name of host sending request */ int rq_XXXX; void *rq_extra; /* optional ptr to extra info */ int rq_noreply; /* Set true if no reply is required */ char *rq_extend; /* request "extension" data */ struct batch_reply rq_reply; /* the reply area for this request */ union indep_request { struct rq_authen rq_authen; int rq_connect; struct rq_queuejob rq_queuejob; struct rq_jobcred rq_jobcred; struct rq_jobfile rq_jobfile; char rq_rdytocommit[PBS_MAXSVRJOBID+1]; char rq_commit[PBS_MAXSVRJOBID+1]; struct rq_manage rq_delete; struct rq_hold rq_hold; char rq_locate[PBS_MAXSVRJOBID+1]; struct rq_manage rq_manager; struct rq_message rq_message; struct rq_manage rq_modify; struct rq_move rq_move; struct rq_register rq_register; struct rq_manage rq_release; char rq_rerun[PBS_MAXSVRJOBID+1]; struct rq_rescq rq_rescq; struct rq_runjob rq_run; tlist_head rq_select; /* svrattrlist */ int rq_shutdown; struct rq_signal rq_signal; struct rq_status rq_status; struct rq_track rq_track; struct rq_cpyfile rq_cpyfile; struct rq_returnfiles rq_returnfiles; struct rq_jobobit rq_jobobit; } rq_ind; }; extern struct batch_request *alloc_br A_((int type)); extern void reply_ack A_((struct batch_request *)); extern void req_reject A_((int code, int aux, struct batch_request *, char *, char *)); extern void reply_badattr A_((int code, int aux, svrattrl *, struct batch_request *)); extern void reply_text A_((struct batch_request *, int code, char *text)); extern int reply_send A_((struct batch_request *)); extern int reply_jobid A_((struct batch_request *, char *, int)); extern void reply_free A_((struct batch_reply *)); extern int authenticate_user A_((struct batch_request *, struct credential *)); extern void dispatch_request A_((int, struct batch_request *)); extern void free_br A_((struct batch_request *)); extern int isode_request_read A_((int, struct batch_request *)); extern void req_stat_job A_((struct batch_request *)); #ifndef PBS_MOM extern void req_authenuser A_((struct batch_request *req)); extern void req_connect A_((struct batch_request *req)); extern void req_locatejob A_((struct batch_request *req)); extern void req_manager A_((struct batch_request *req)); extern void req_movejob A_((struct batch_request *req)); extern void req_register A_((struct batch_request *req)); extern void req_releasejob A_((struct batch_request *req)); extern void req_rescq A_((struct batch_request *req)); extern void req_rerunjob A_((struct batch_request *req)); extern void req_runjob A_((struct batch_request *req)); extern void req_selectjobs A_((struct batch_request *req)); extern void req_stat_que A_((struct batch_request *req)); extern void req_stat_svr A_((struct batch_request *req)); /* DIAGTODO: declr req_stat_diag() */ extern void req_trackjob A_((struct batch_request *req)); #else extern void req_cpyfile A_((struct batch_request *req)); extern void req_delfile A_((struct batch_request *req)); extern void req_returnfiles A_((struct batch_request *req)); #endif #ifdef SERVER_LIMITS_H extern int relay_to_mom A_((pbs_net_t, struct batch_request *, void (*)())); #endif /* SERVER_LIMITS_H */ /* PBS Batch Request Decode/Encode routines */ /* udp decode and encode routines */ extern int decode_DIS_Authen A_((int socket, struct batch_request *)); extern int decode_DIS_CopyFiles A_((int socket, struct batch_request *)); extern int decode_DIS_JobCred A_((int socket, struct batch_request *)); extern int decode_DIS_JobFile A_((int socket, struct batch_request *)); extern int decode_DIS_JobObit A_((int socket, struct batch_request *)); extern int decode_DIS_Manage A_((int socket, struct batch_request *)); extern int decode_DIS_MoveJob A_((int socket, struct batch_request *)); extern int decode_DIS_MessageJob A_((int socket, struct batch_request *)); extern int decode_DIS_QueueJob A_((int socket, struct batch_request *)); extern int decode_DIS_Register A_((int socket, struct batch_request *)); extern int decode_DIS_ReturnFiles A_((int socket, struct batch_request *)); extern int decode_DIS_ReqExtend A_((int socket, struct batch_request *)); extern int decode_DIS_ReqHdr A_((int socket, struct batch_request *, int *tp, int *pv)); extern int decode_DIS_Rescl A_((int socket, struct batch_request *)); extern int decode_DIS_Rescq A_((int socket, struct batch_request *)); extern int decode_DIS_RunJob A_((int socket, struct batch_request *)); extern int decode_DIS_ShutDown A_((int socket, struct batch_request *)); extern int decode_DIS_SignalJob A_((int socket, struct batch_request *)); extern int decode_DIS_Status A_((int socket, struct batch_request *)); extern int decode_DIS_TrackJob A_((int socket, struct batch_request *)); extern int decode_DIS_replySvr A_((int socket, struct batch_reply *)); extern int decode_DIS_svrattrl A_((int socket, tlist_head *)); extern int encode_DIS_CopyFiles A_((int socket, struct batch_request *)); extern int encode_DIS_JobObit A_((int socket, struct batch_request *)); extern int encode_DIS_Register A_((int socket, struct batch_request *)); extern int encode_DIS_ReturnFiles A_((int socket, struct batch_request *)); extern int encode_DIS_TrackJob A_((int socket, struct batch_request *)); extern int encode_DIS_reply A_((int socket, struct batch_reply *)); extern int encode_DIS_svrattrl A_((int socket, svrattrl *)); extern int dis_request_read A_((int socket, struct batch_request *)); extern int dis_reply_read A_((int socket, struct batch_reply *)); #endif /* BATCH_REQUEST_H */ torque-2.4.16/src/include/tm_.h0000664000113300011330000001575711272401235013212 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: tm_.h 2367 2008-09-03 17:17:34Z josh $ */ /* ** Header file defineing the datatypes and library visiable ** variables for paralell awareness. */ #include typedef int tm_host_id; /* physical node index */ typedef int tm_node_id; /* job-relative node id */ #define TM_ERROR_NODE ((tm_node_id)-1) typedef int tm_event_t; /* event handle, > 0 for real events */ #define TM_NULL_EVENT ((tm_event_t)0) #define TM_ERROR_EVENT ((tm_event_t)-1) typedef unsigned int tm_task_id; #define TM_NULL_TASK (tm_task_id)0 /* ** Protocol message type defines */ #define TM_INIT 100 /* tm_init request */ #define TM_TASKS 101 /* tm_taskinfo request */ #define TM_SPAWN 102 /* tm_spawn request */ #define TM_SIGNAL 103 /* tm_signal request */ #define TM_OBIT 104 /* tm_obit request */ #define TM_RESOURCES 105 /* tm_rescinfo request */ #define TM_POSTINFO 106 /* tm_publish request */ #define TM_GETINFO 107 /* tm_subscribe request */ #define TM_GETTID 108 /* tm_gettasks request */ #define TM_REGISTER 109 /* tm_register request */ #define TM_RECONFIG 110 /* tm_register deferred reply */ #define TM_ACK 111 /* tm_register event acknowledge */ #define TM_FINALIZE 112 /* tm_finalize request, there is no reply */ #define TM_OKAY 0 #define TM_ERROR 999 /* ** Error numbers returned from library */ #define TM_SUCCESS 0 #define TM_ESYSTEM 17000 #define TM_ENOEVENT 17001 #define TM_ENOTCONNECTED 17002 #define TM_EUNKNOWNCMD 17003 #define TM_ENOTIMPLEMENTED 17004 #define TM_EBADENVIRONMENT 17005 #define TM_ENOTFOUND 17006 #define TM_BADINIT 17007 #define TM_TODO_NOP 5000 /* Do nothing (the nodes value may be new) */ #define TM_TODO_CKPT 5001 /* Checkpoint and continue it */ #define TM_TODO_MOVE 5002 /* Move to */ #define TM_TODO_QUIT 5003 /* Terminate */ #define TM_TODO_STOP 5004 /* Suspend execution of */ /* ** Features of this TM library */ #define TM_MULTIPLE_CONNS 1 #define TM_SPAWN_EXEC_ERROR 1 /* * DJH 27 Feb 2002. Task ids for adopted tasks start at this number * (local to each mom). The filenames for saved task info are the task * id sprintf()ed into a 10 digit number, so pick something less than * 9999999999. */ #define TM_ADOPTED_TASKID_BASE 900000000 #define IS_ADOPTED_TASK(taskid) ((taskid) >= TM_ADOPTED_TASKID_BASE) /* * DJH 16 Nov 2001. tm_adopt request. Used instead of tm_init when a * non-PBS process wants PBS to adopt it as the nucleus of a job task * * DJH 4 March 2002. Now have two styles of task adoption. * TM_ADOPT_ALTID identifies task using an identfier provided * by the alternative task spawning system * Assumes PBS is configured to work with one * and only one alternative task spawning/ * management system * . TM_ADOPT_JOBID identifies task directly by PBS jobid */ #define TM_ADOPT_ALTID 113 /* tm_adopt request with alternative management system task id */ #define TM_ADOPT_JOBID 114 /* tm_adopt with jobid */ torque-2.4.16/src/include/pbs_cpuset.h0000664000113300011330000000052211272401235014562 00000000000000#ifndef PBS_CPUSET_H #define PBS_CPUSET_H 1 #include #include #include "pbs_job.h" extern void initialize_root_cpuset(); extern int create_jobset(job *); extern int cpuset_delete(char *); extern int move_to_jobset(pid_t, job *); extern int move_to_taskset(pid_t, job *, char *); #endif /* END PBS_CPUSET_H */ torque-2.4.16/src/include/port_forwarding.h0000664000113300011330000000151011272401235015617 00000000000000#ifndef PORT_FORWARDING_H #define PORT_FORWARDING_H 1 #define BUF_SIZE 1024 #define NUM_SOCKS 100 #define MAX_DISPLAYS 500 #define X11OFFSET 50 /* derived from XF4/xc/lib/dps/Xlibnet.h */ #ifndef X_UNIX_PATH # ifdef __hpux # define X_UNIX_PATH "/var/spool/sockets/X11/%u" # else # define X_UNIX_PATH "/tmp/.X11-unix/X%u" # endif #endif /* X_UNIX_PATH */ #ifndef NI_MAXSERV # define NI_MAXSERV 32 #endif /* !NI_MAXSERV */ struct pfwdsock { int sock; int listening; int remotesock; int bufavail; int bufwritten; int active; int peer; char buff[BUF_SIZE]; }; void port_forwarder(struct pfwdsock *, int(*connfunc)(char *phost, int pport, char *), char*, int, char *); void set_nodelay(int); int connect_local_xsocket(u_int); int x11_connect_display(char *, int, char *); #endif /* END PORT_FORWARDING_H */ torque-2.4.16/src/include/site_que_attr_def.ht0000664000113300011330000001101511272401235016264 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: site_que_attr_def.ht 12 2005-02-22 20:59:54Z dev $ */ /* * Place holder for site supplied additions to the array of * site queue attribute definitions, see server/queue_attr_def.c * * Array elements must be of the form: * { "name", * decode_Func, * encode_Func, * set_Func, * comp_Func, * free_Func, * action_routine, * permissions, * ATR_TYPE_*, * PARENT_TYPE_QUE_[ALL|EXC|RTE] * }, * * Matching entry must be added in site_que_attr_enum.h */ torque-2.4.16/src/include/pbs_config.h.in0000664000113300011330000003273611403757170015155 00000000000000/* src/include/pbs_config.h.in. Generated from configure.ac by autoheader. */ #ifndef _PBS_CONFIG_H_ #define _PBS_CONFIG_H_ /* Define to add x attributes to accounting log */ #undef ATTR_X_ACCT /* turns on the compilation of AUTORUN_JOBS code */ #undef AUTORUN_JOBS /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ #undef BYTEORDER /* turns on the compilation of DEBUG code */ #undef DEBUG /* Alternate directory for MOM logs */ #undef DEFAULT_MOMLOGDIR /* Alternate suffix for MOM logs */ #undef DEFAULT_MOMLOGSUFFIX /* Define to enable BLCR support */ #undef ENABLE_BLCR /* Define to enable Cray's CPA support */ #undef ENABLE_CPA /* Define to enable Cray's CSA support */ #undef ENABLE_CSA /* Define to enable unix domain sockets */ #undef ENABLE_UNIX_SOCKETS /* are FD_SET and friends defined in sys/select.h */ #undef FD_SET_IN_SYS_SELECT_H /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #undef GETGROUPS_T /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_CPALIB_H /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERR_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `fstat' function. */ #undef HAVE_FSTAT /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if your system has a working `getgroups' function. */ #undef HAVE_GETGROUPS /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `elf' library (-lelf). */ #undef HAVE_LIBELF /* Define to 1 if you have the `job' library (-ljob). */ #undef HAVE_LIBJOB /* Define to 1 if you have the `kvm' library (-lkvm). */ #undef HAVE_LIBKVM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define if lseek64() is available */ #undef HAVE_LSEEK64 /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `on_exit' function. */ #undef HAVE_ON_EXIT /* Define if open64() is available */ #undef HAVE_OPEN64 /* Define to 1 if you have the header file. */ #undef HAVE_PAM_PAM_MODULES_H /* Define to 1 if you have the `poll' function. */ #undef HAVE_POLL /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* include readline support */ #undef HAVE_READLINE /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the header file. */ #undef HAVE_SECURITY_PAM_APPL_H /* Define to 1 if you have the header file. */ #undef HAVE_SECURITY_PAM_MODULES_H /* Define to 1 if you have the `setegid' function. */ #undef HAVE_SETEGID /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID /* Define to 1 if you have the `setresgid' function. */ #undef HAVE_SETRESGID /* Define to 1 if you have the `setresuid' function. */ #undef HAVE_SETRESUID /* Define if stat64() is available */ #undef HAVE_STAT64 /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define if struct stat64 is available */ #undef HAVE_STRUCT_STAT64 /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATVFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TTY_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UCRED_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* Define to 1 if you have the va_copy function. */ #undef HAVE_VA_COPY /* Define to 1 if you have the `wordexp' function. */ #undef HAVE_WORDEXP /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if you have the __va_copy function. */ #undef HAVE___VA_COPY /* is the global int h_errno declared in netdb.h */ #undef H_ERRNO_DECLARED /* defined if this is an SP2 */ #undef IBM_SP2 /* the machine specific resc_def_* file name */ #undef MACH_RESC_DEFS /* Define to error if spool is full on MOM */ #undef MOMCHECKLOCALSPOOL /* whether checkpointing is supported */ #undef MOM_CHECKPOINT /* force creation of nodefile */ #undef MOM_FORCENODEFILE #ifndef NEED_BLOCKING_CONNECTIONS #define write(a,b,c) write_nonblocking_socket(a,b,c) #define read(a,b,c) read_nonblocking_socket(a,b,c) #endif /* use nodemask-based scheduling on O2k */ #undef NODEMASK /* Define to disable mlockall */ #undef NOPOSIXMEMLOCK /* Define to disable privileged ports */ #undef NOPRIVPORTS /* turns on the compilation of NO_SIGCHLD code */ #undef NO_SIGCHLD /* directly use homedirs instead of $TORQUEHOME/spool */ #undef NO_SPOOL_OUTPUT /* Define if ntohl() is declared in arpa/inet.h */ #undef NTOHL_NEEDS_ARPA_INET_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to the build date */ #undef PBS_BUILD_DATE /* Define to the build directory */ #undef PBS_BUILD_DIR /* Define to the build hostname */ #undef PBS_BUILD_HOST /* Define to the building username */ #undef PBS_BUILD_USER /* Define to the install directory */ #undef PBS_CFLAGS /* Define to the install directory */ #undef PBS_CONFIG_ARGS /* Define to the name of the default PBS server */ #undef PBS_DEFAULT_SERVER /* Define to the install directory */ #undef PBS_INSTALL_DIR /* the PBS style machine type name */ #undef PBS_MACH /* Define to the source directory */ #undef PBS_SOURCE_DIR /* Define to enable Linux 2.6 cpusets */ #undef PENABLE_LINUX26_CPUSETS /* use pemask-based scheduling on Cray T3e */ #undef PE_MASK /* Select which daemons plock themselves, a bit pattern */ #undef PLOCK_DAEMONS /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define if you are on a solaris box */ #undef PUSH_STREAM /* Define to the path of the qstat init file */ #undef QSTATRC_PATH /* turns on the QSUB_KEEP_NO_OVERRIDE flag */ #undef QSUB_KEEP_NO_OVERRIDE /* turns on the compilation of QUICKCOMMIT code */ #undef QUICKCOMMIT /* turns on the compilation of RESOURCEMAXDEFAULT code */ #undef RESOURCEMAXDEFAULT /* Define to enable RPP resource queries */ #undef RPP /* set the type of scheduler to use */ #undef SCHD_TYPE /* full pathname of sendmail */ #undef SENDMAIL_CMD /* Define to set the controlling tty */ #undef SETCONTROLLINGTTY /* set whether job scripts use a pipe */ #undef SHELL_INVOKE /* job script name passed as the shell's arg */ #undef SHELL_USE_ARGV /* The size of a `double', as computed by sizeof. */ #undef SIZEOF_DOUBLE /* The size of a `float', as computed by sizeof. */ #undef SIZEOF_FLOAT /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of a `long double', as computed by sizeof. */ #undef SIZEOF_LONG_DOUBLE /* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* The size of a `signed char', as computed by sizeof. */ #undef SIZEOF_SIGNED_CHAR /* The size of a `unsigned', as computed by sizeof. */ #undef SIZEOF_UNSIGNED /* The size of a `unsigned char', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_CHAR /* The size of a `unsigned int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_INT /* The size of a `unsigned long', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG /* The size of a `unsigned short', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_SHORT /* include support for SRFS on Cray */ #undef SRFS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to enable syslog */ #undef SYSLOG /* Define if PBS should use Tcl in its tools */ #undef TCL /* Define if PBS should use TclX in its tools */ #undef TCLX /* the seperator for Tcl attribute parsing */ #undef TCL_ATRSEP /* Define if PBS should build qstat with Tcl */ #undef TCL_QSTAT /* Define to prevent sync writes */ #undef TDISABLEFILESYNC /* Define if PBS should use Tk in its tools */ #undef TK /* Define if PBS should use Tkx in its tools */ #undef TKX /* override the default domain for outgoing mail messages */ #undef TMAILDOMAIN /* The pathname of the Cray temporary directory for mom */ #undef TMP_DIR /* Define if building on unsupported OS */ #undef UNSUPPORTED_MACH /* Define on ancient linux distros */ #undef USEOLDTTY /* Version number of package */ #undef VERSION /* whether byteorder is bigendian */ #undef WORDS_BIGENDIAN /* Define to the path of xauth */ #undef XAUTH_PATH /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to 1 if type `char' is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif /* Define to `int' if doesn't define. */ #undef gid_t /* type to use for 2nd arg of pam_get_user */ #undef pam_get_user_2nd_arg_t /* Define to `unsigned' if does not define. */ #undef size_t /* type to use in place of socklen_t if not defined */ #undef torque_socklen_t /* Define to `int' if doesn't define. */ #undef uid_t #ifndef HAVE_VA_COPY # define va_copy(a,b) __va_copy(a,b) #endif #ifndef __GNUC__ # define __attribute__ /* nothing */ #endif #endif /* _PBS_CONFIG_H_ */ torque-2.4.16/src/include/site_job_attr_enum.ht0000664000113300011330000001054011272401235016454 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: site_job_attr_enum.ht 2248 2008-07-10 20:52:54Z garrick $ */ /* * Place holder for site supplied additions to the job's enumerated * list of attributes, see pbs_job.h. * * List should be of the form: * JOB_SITE_ATR_name, * * Matching entry must be added in site_job_attr_def.h */ JOB_SITE_ATR_x, torque-2.4.16/src/include/resource.h0000664000113300011330000001445211272401235014251 00000000000000#ifndef RESOURCE_H #define RESOURCE_H /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * This header file contains the definitions for resources. * * Other required header files: * "portability.h" * "attribute.h" * "list_link.h" * * Resources are "a special case" of attributes. Resources use similiar * structures as attributes. Certain types, type related functions, * and flags may differ between the two. * * Within the resource structure, the value is contained in an attribute * substructure, this is done so the various attribute decode and encode * routines can be "reused". * * For any server, queue or job attribute which is a set of resources, * the attribute points to an list of "resource" structures. * The value of the resource is contained in these structures. * * Unlike "attributes" which are typically identical between servers * within an administrative domain, resources vary between systems. * Hence, the resource instance has a pointer to the resource definition * rather than depending on a predefined index. */ typedef struct resource { list_link rs_link; /* link to other resources in list */ struct resource_def *rs_defin; /* pointer to definition entry */ attribute rs_value; /* attribute struct holding value */ } resource; typedef struct resource_def { char *rs_name; int (*rs_decode)A_((attribute *, char *, char *, char *)); int (*rs_encode)A_((attribute *, tlist_head *, char *, char *, int)); int (*rs_set)A_((attribute *, attribute *, enum batch_op)); int (*rs_comp)A_((attribute *, attribute *)); void (*rs_free)A_((attribute *)); int (*rs_action)A_((resource *, attribute *, int)); unsigned int rs_flags: ATRFLAG; /* flags: R/O, ..., see attribute.h */ unsigned int rs_type: ATRTYPE; /* type of resource,see attribute.h */ } resource_def; /* the resource definition array, only the fixed resources */ extern resource_def svr_resc_def_const[]; /* svr_resc_def_const + resources in "extra_resc" server attr */ extern resource_def *svr_resc_def; /* size (num elements) in above */ extern int svr_resc_size; extern resource *add_resource_entry A_((attribute *, resource_def *)); extern resource_def *find_resc_def A_((resource_def *, char *, int)); extern resource *find_resc_entry A_((attribute *, resource_def *)); /* END resource.h */ #endif torque-2.4.16/src/include/pbs_proto.h0000664000113300011330000000005411272401235014422 00000000000000/* pbs_proto.h */ /* END pbs_proto.h */ torque-2.4.16/src/include/pbs_batchreqtype_db.h0000664000113300011330000001024411334071076016426 00000000000000/** @file This file contains the database of PBS Batch request type ids and * their text representations * * HOWTO USE THIS * * Add new batch request type: * - add new line before the endif * * Remove batch request type: * - rewrite the request into a gap (PBS_BATCH_GAPxxx) with (const char*)0 * as text part (see PBS_BATCH_GAP029-47 for example) * * @see pbs_messages.c and libpbs.h for more information */ #ifdef PbsBatchReqType PbsBatchReqType(PBS_BATCH_Connect = 0, "Connect") PbsBatchReqType(PBS_BATCH_QueueJob, "QueueJob") PbsBatchReqType(PBS_BATCH_JobCred, "JobCred") PbsBatchReqType(PBS_BATCH_jobscript, "JobScript") PbsBatchReqType(PBS_BATCH_RdytoCommit, "ReadyToCommit") PbsBatchReqType(PBS_BATCH_Commit, "Commit") PbsBatchReqType(PBS_BATCH_DeleteJob, "DeleteJob") PbsBatchReqType(PBS_BATCH_HoldJob, "HoldJob") PbsBatchReqType(PBS_BATCH_LocateJob, "LocateJob") PbsBatchReqType(PBS_BATCH_Manager, "Manager") PbsBatchReqType(PBS_BATCH_MessJob, "MessageJob") /* = 10 */ PbsBatchReqType(PBS_BATCH_ModifyJob, "ModifyJob") PbsBatchReqType(PBS_BATCH_MoveJob, "MoveJob") PbsBatchReqType(PBS_BATCH_ReleaseJob, "ReleaseJob") PbsBatchReqType(PBS_BATCH_Rerun, "RerunJob") PbsBatchReqType(PBS_BATCH_RunJob, "RunJob") PbsBatchReqType(PBS_BATCH_SelectJobs, "SelectJobs") PbsBatchReqType(PBS_BATCH_Shutdown, "Shutdown") PbsBatchReqType(PBS_BATCH_SignalJob, "SignalJob") PbsBatchReqType(PBS_BATCH_StatusJob, "StatusJob") PbsBatchReqType(PBS_BATCH_StatusQue, "StatusQueue") /* = 20 */ PbsBatchReqType(PBS_BATCH_StatusSvr, "StatusServer") PbsBatchReqType(PBS_BATCH_TrackJob, "TrackJob") PbsBatchReqType(PBS_BATCH_AsyrunJob, "AsyncRunJob") PbsBatchReqType(PBS_BATCH_Rescq, "ResourceQuery") PbsBatchReqType(PBS_BATCH_ReserveResc, "ReserveResource") PbsBatchReqType(PBS_BATCH_ReleaseResc, "ReleaseResource") PbsBatchReqType(PBS_BATCH_CheckpointJob, "CheckpointJob") PbsBatchReqType(PBS_BATCH_AsyModifyJob, "AsyncModifyJob") PbsBatchReqType(PBS_BATCH_GAP029, "NONE") PbsBatchReqType(PBS_BATCH_GAP030, "NONE") /* = 30 */ PbsBatchReqType(PBS_BATCH_GAP031, "NONE") PbsBatchReqType(PBS_BATCH_GAP032, "NONE") PbsBatchReqType(PBS_BATCH_GAP033, "NONE") PbsBatchReqType(PBS_BATCH_GAP034, "NONE") PbsBatchReqType(PBS_BATCH_GAP035, "NONE") PbsBatchReqType(PBS_BATCH_GAP036, "NONE") PbsBatchReqType(PBS_BATCH_GAP037, "NONE") PbsBatchReqType(PBS_BATCH_GAP038, "NONE") PbsBatchReqType(PBS_BATCH_GAP039, "NONE") PbsBatchReqType(PBS_BATCH_GAP040, "NONE") /* = 40 */ PbsBatchReqType(PBS_BATCH_GAP041, "NONE") PbsBatchReqType(PBS_BATCH_GAP042, "NONE") PbsBatchReqType(PBS_BATCH_GAP043, "NONE") PbsBatchReqType(PBS_BATCH_GAP044, "NONE") PbsBatchReqType(PBS_BATCH_GAP045, "NONE") PbsBatchReqType(PBS_BATCH_GAP046, "NONE") PbsBatchReqType(PBS_BATCH_GAP047, "NONE") PbsBatchReqType(PBS_BATCH_StageIn, "StageIn") PbsBatchReqType(PBS_BATCH_AuthenUser, "AuthenticateUser") PbsBatchReqType(PBS_BATCH_OrderJob, "OrderJob") /* = 50 */ PbsBatchReqType(PBS_BATCH_SelStat, "SelStat") PbsBatchReqType(PBS_BATCH_RegistDep, "RegisterDependency") PbsBatchReqType(PBS_BATCH_ReturnFiles, "ReturnFiles") PbsBatchReqType(PBS_BATCH_CopyFiles, "CopyFiles") PbsBatchReqType(PBS_BATCH_DelFiles, "DeleteFiles") PbsBatchReqType(PBS_BATCH_JobObit, "JobObituary") PbsBatchReqType(PBS_BATCH_MvJobFile, "MoveJobFile") PbsBatchReqType(PBS_BATCH_StatusNode, "StatusNode") PbsBatchReqType(PBS_BATCH_Disconnect, "Disconnect") PbsBatchReqType(PBS_BATCH_AsySignalJob, "AsyncSignalJob") /* = 60 */ #endif torque-2.4.16/src/include/site_qmgr_svr_print.ht0000664000113300011330000001043111272401235016677 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: site_qmgr_svr_print.ht 12 2005-02-22 20:59:54Z dev $ */ /* * list of site defined server attribute names which qmgr should * include in its "print server" output * * format is (do include the quote marks): * "attribute_name", */ torque-2.4.16/src/include/mcom.h0000664000113300011330000001131111272401235013344 00000000000000/* HEADER MODULE moab */ #ifndef __MCOM_H #define __MCOM_H /* core defines */ #ifndef NULL # define NULL (void *)0 #endif /* NULL */ #ifndef MIN # define MIN(x,y) (((x) < (y)) ? (x) : (y)) #endif /* MIN */ #ifndef MAX # define MAX(x,y) (((x) > (y)) ? (x) : (y)) #endif /* MAX */ #ifndef TRUE # define TRUE 1 #endif /* TRUE */ #ifndef FALSE # define FALSE 0 #endif /* FALSE */ #ifndef NONE # define NONE "[NONE]" #endif /* NONE */ #ifndef ALL # define ALL "[ALL]" #endif /* ALL */ #ifndef DEFAULT # define DEFAULT "[DEFAULT]" #endif /* DEFAULT */ #ifndef SUCCESS # define SUCCESS 1 #endif /* SUCCESS */ #ifndef FAILURE # define FAILURE 0 #endif /* FAILURE */ #ifndef MMAX_NAME #define MMAX_NAME 64 #endif /* MMAX_NAME */ #ifndef MMAX_LINE #define MMAX_LINE 1024 #endif /* MMAX_LINE */ #ifndef MMAX_BUFFER #define MMAX_BUFFER 65536 #endif /* MMAX_BUFFER */ #ifndef mbool_t # define mbool_t unsigned char #endif /* mbool_t */ /* enumerations */ enum MDataFormatEnum { mdfNONE = 0, mdfString, mdfInt, mdfLong, mdfDouble, mdfStringArray, mdfIntArray, mdfLongArray, mdfDoubleArray, mdfOther }; enum MSocketProtocolEnum { mspNONE = 0, mspSingleUseTCP, mspHalfSocket, mspHTTPClient, mspHTTP, mspSSSChallenge }; enum MWireProtocolEnum { mwpNONE = 0, mwpAVP, mwpXML, mwpHTML, mwpSSS2 }; /* sync w/MSSSAction[] */ enum MSSSActionEnum { msssaNONE, msssaCancel, msssaCreate, msssaDestroy, msssaInitialize, msssaList, msssaModify, msssaNotify, msssaQuery, msssaStart, msssaLAST }; /* sync w/MCSAlgoType[] */ enum MChecksumAlgoEnum { mcsaNONE = 0, mcsaDES, mcsaHMAC, mcsaHMAC64, mcsaMD5, mcsaPasswd, mcsaRemote }; /* sync w/MSSSCName[] */ enum MPeerServiceEnum { mpstNONE = 0, mpstNM, /* system monitor */ mpstQM, /* queue manager */ mpstSC, /* scheduler */ mpstMS, /* meta scheduler */ mpstPM, /* process manager */ mpstAM, /* allocation manager */ mpstEM, /* event manager */ mpstSD, /* service directory */ mpstWWW }; /* web */ /* sync w/XXX */ enum MSSSVEnum { msssV0_2 = 0, msssV2_0, msssV3_0 }; /* const defines */ #define MMAX_SBUFFER 65536 #define MCONST_SSSXPATH 3 #define MCONST_SSSURI "SSSRMAP3" #define MMAX_SSSATTR 256 #define MMAX_SSSVERS 4 #define MMAX_SSSJACTION 64 /* default defines */ #define MDEF_CSALGO mcsaDES #define MMAX_SOCKETWAIT 5000000 #define MMAX_XMLATTR 64 #define MDEF_XMLICCOUNT 16 /* structures */ typedef struct mxml_s { char *Name; char *Val; int ACount; int ASize; int CCount; int CSize; char **AName; char **AVal; struct mxml_s **C; } mxml_t; /* failure codes */ /* sync w/MFC[] */ enum MSFC { msfENone = 0, /* success */ msfGWarning = 100, /* general warning */ msfEGWireProtocol = 200, /* general wireprotocol/network failure */ msfEBind = 218, /* cannot bind socket */ msfEGConnect = 220, /* general connection failure */ msfCannotConnect = 222, /* cannot connect */ msfCannotSend = 224, /* cannot send data */ msfCannotRecv = 226, /* cannot receive data */ msfConnRejected = 230, /* connection rejected */ msfETimedOut = 232, /* connection timed out */ msfEFraming = 240, /* general framing failure */ msfEEOF = 246, /* unexpected end of file */ msfEGMessage = 300, /* general message format error */ msfEGSecurity = 400, /* general security failure */ msfESecClientAuth = 442, /* security - client auth failure */ msfEGEvent = 500, /* general event failure */ msfEGServer = 700, /* general server error */ msfEGServerBus = 720, /* general server business logic failure */ msfEGClient = 800, /* general client error */ msfECInternal = 820, /* client internal error */ msfECResUnavail = 830, /* client resource unavailable */ msfECPolicy = 840, /* client policy failure */ msfEGMisc = 900, /* general miscellaneous error */ msfUnknownError = 999 }; /* unknown failure */ /* sync w/MSockAttr[] */ enum MSocketAttrEnum { msockaNONE = 0, msockaLocalHost, msockaLocalPort, msockaRemoteHost, msockaRemotePort, msockaLAST }; extern int MXMLCreateE(mxml_t **, char *); extern int MXMLAddE(mxml_t *, mxml_t *); extern int MXMLSetVal(mxml_t *, void *, enum MDataFormatEnum); extern int MXMLDestroyE(mxml_t **); extern int MXMLToXString(mxml_t *, char **, int *, int, char **, mbool_t); #ifdef __M32COMPAT #define mlog_t dlog_t #endif /* __M32COMPAT */ #endif /* __MCOM_H */ /* END mcom.h */ torque-2.4.16/src/include/qmgr_que_readonly.h0000664000113300011330000001053311272401235016133 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: qmgr_que_readonly.h 2367 2008-09-03 17:17:34Z josh $ */ /* * This is a list of read only queue attributes * * FORMAT: * attr1, * attr2, <--- important the last has a comma after it * * This file will be used for the initialization of an array * */ ATTR_total, ATTR_count, ATTR_rescassn, ATTR_mtime, torque-2.4.16/src/include/rm.h0000664000113300011330000001060011272401235013027 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** Header file defineing the library calls for connecting ** to the resource monitor. */ int openrm A_((char *, unsigned int)); int closerm A_((int)); int downrm A_((int)); int configrm A_((int, char *)); int addreq A_((int, char *)); int allreq A_((char *)); char* getreq A_((int)); int flushreq A_((void)); int activereq A_((void)); void fullresp A_((int)); torque-2.4.16/src/include/qmgr.h0000664000113300011330000004556711272401235013403 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: qmgr.h 2367 2008-09-03 17:17:34Z josh $ */ /* $I$ */ /* symbolic constants */ #define ALL_SERVERS -1 /* all servers for connect_servers() */ /* server name used for the default PBS server ("") */ #define DEFAULT_SERVER "default" /* server name used for all the active servers */ #define ACTIVE_SERVER "active" /* max word length in the reqest */ #define MAX_REQ_WORD_LEN 32768 /* increased from 1024 */ /* there can be three words before the attribute list * command object name */ #define MAX_REQ_WORDS 3 #define IND_CMD 0 #define IND_OBJ 1 #define IND_NAME 2 #define IND_FIRST IND_CMD #define IND_LAST IND_NAME /* types of attributes: read only, public, all */ #define TYPE_ATTR_READONLY 1 #define TYPE_ATTR_PUBLIC 2 #define TYPE_ATTR_ALL TYPE_ATTR_READONLY | TYPE_ATTR_PUBLIC /* Macros */ /* This macro will determine if the char it is passed is a qmgr operator. */ #define Oper(x) ( ( *(x) == '=') || \ ( *(x) == '+' && *( (x) + 1 ) == '=' ) || \ ( *(x) == '-' && *( (x) + 1 ) == '=' ) \ ) /* This macro will determine if the char it is passed is white space. */ #define White(x) ( isspace( (int) (x) ) ) /* This macro will determine if the char is the end of a line. */ #define EOL(x) (x == '\0') /* This macro will allocate memory for a character string */ #define Mstring(x,y) if ( (x=(char *)malloc(y)) == NULL ) { \ if( ! zopt ) fprintf(stderr,"qmgr: Out of memory\n"); \ clean_up_and_exit(5); \ } /* This macro will allocate memory for some fixed size object */ #define Mstruct(x,y) if ( (x=(y *)malloc(sizeof(y))) == NULL ) { \ if( ! zopt ) fprintf(stderr,"qmgr: Out of memory\n"); \ clean_up_and_exit(5); \ } /* server name: "" is the default server and NULL is all active servers */ #define Svrname(x) ( ( (x) == NULL ) ? ACTIVE_SERVER : \ ( ( strlen((x) -> s_name) ) ? \ (x) -> s_name : DEFAULT_SERVER) ) /* print an input line and then a caret under where the error has occured */ #define CaretErr(x, y) if( ! zopt ) fprintf(stderr,"%s\n", (x)); blanks((y)); if( ! zopt ) fprintf(stderr,"^\n"); /* structures */ /* this struct is for the open servers */ struct server { char *s_name; /* name of server */ int s_connect; /* PBS connection descriptor to server */ int ref; /* number of references to server */ struct server *next; /* next server in list */ }; /* objname - name of an object with a possible server associated with it * i.e. batch@server1 -> queue batch at server server1 */ struct objname { int obj_type; /* type of object */ char *obj_name; /* name of object */ char *svr_name; /* name of server associated with object */ struct server *svr; /* short cut to server associated with object */ struct objname *next; /* next object in list */ }; /* prototypes */ struct objname *commalist2objname(char *, int); struct server *find_server(char *); struct server *make_connection(); struct server *new_server(); struct objname *new_objname(); struct objname *strings2objname(char **, int, int); struct objname *default_server_name(); struct objname *temp_objname(char *, char *, struct server *); int parse_request(char *, char [][MAX_REQ_WORD_LEN]); void clean_up_and_exit(int); void freeattrl(struct attrl *); void freeattropl(struct attropl *); void pstderr_big(char *, char*, char *); void free_objname_list(struct objname *); void free_server(struct server *); void free_objname(struct objname *); void close_non_ref_servers(); int connect_servers(struct objname *, int); int set_active(int, struct objname *); int get_request(char *); int parse(char *, int *, int *, char **, struct attropl **); int execute(int, int, int, char *, struct attropl *); int is_attr(int, char *, int); int is_valid_object(struct objname *, int); void disconnect_from_server(); /* help messages */ /* some of these are split into multiple strings to keep the string within * the 509 character ISO C89 limit */ #define HELP_DEFAULT \ "General syntax: command [object][@server] [name attribute[.resource] OP value]\n" \ "To get help on any topic or subtopic, type help \n" \ "Help is available on all commands and topics.\n" \ "Available commands: active, create, delete, set, unset, list, print, quit\n" \ "Other topics are attributes, operators, names, and values .\n" #define HELP_ACTIVE \ "Syntax active object [name [,name...]]\n" \ "Objects can be \"server\" \"queue\" or \"node\"\n" \ "The active command will set the active objects. The active objects are used\n" \ "when no name is specified for different commands.\n" \ "If no server is specified for nodes or queues, the command will be sent\n" \ "to all active servers.\n" #define HELP_ACTIVE2 \ "Examples:\n" \ "active queue q1,batch@server1\n" \ "active server server2,server3\n" \ "Now if the following command is typed:\n" \ "set queue max_running = 10\n" \ "The attribute max_running will be set to ten on the batch queue on server1\n" \ "and the q1 queue on server2 and server3.\n\n" \ "active server s1, s2\n" \ "active node @active\n" \ "This would specify all nodes at all servers.\n\n" \ "active queue @s2\n" \ "This would specify all queues at server s2\n" #define HELP_CREATE \ "Syntax: create object name[,name...] \n" \ "Objects can be \"queue\" or \"node\"\n" \ "The create command will create the specified object on the PBS server(s).\n" \ "For multiple names, use a comma separated list with no intervening whitespace.\n" \ "Examples:\n" \ "create queue q1,q2,q3\n" #define HELP_DELETE \ "Syntax: delete object name[,name...]\n" \ "Objects can be \"queue\" or \"node\"\n" \ "The delete command will delete the specified object from the PBS server(s)." \ "\nExamples:\n" \ "delete queue q1\n" #define HELP_SET \ "Syntax: set object [name,][,name...] attribute[.resource] OP value\n" \ "Objects can be \"server\" or \"queue\", \"node\"\n" \ "The \"set\" command sets the value for an attribute on the specified object.\n" \ "If the object is \"server\" and name is not specified, the attribute will be\n" \ "set on all the servers specified on the command line.\n" \ "For multiple names, use a comma separated list with no intervening whitespace.\n" #define HELP_SET2 \ "Examples:\n" \ "set server s1 max_running = 5\n" \ "set server managers = root\n" \ "set server managers += susan\n" \ "set node n1,n2 state=down\n" \ "set queue q1@s3 resources_max.mem += 5mb\n" \ "set queue @s3 default_queue = batch\n" #define HELP_UNSET \ "Syntax: unset object [name][,name...]\n" \ "Objects can be \"server\" or \"queue\", \"node\"\n" \ "The unset command will unset an attribute on the specified object.\n" \ "If the object is \"server\" and name is not specified, the attribute will be\n" \ "unset on all the servers specified on the command line.\n" \ "For multiple names, use a comma separated list with no intervening whitespace.\n" \ "Examples:\n" \ "unset server s1 max_running\n" \ "unset server managers\n" \ "unset queue enabled\n" #define HELP_LIST \ "Syntax: list object [name][,name...]\n" \ "Object can be \"server\" or \"queue\" or \"node\"\n" \ "The list command will list out all the attributes for the specified object.\n" \ "If the object is \"server\" and name is not specified, all the servers\n" \ "specified on the command line will be listed.\n" \ "For multiple names, use a comma separated list with no intervening whitespace.\n" \ "Examples:\n" \ "list server\n" \ "list queue q1\n" \ "list node n1,n2,n3\n" #define HELP_PRINT \ "Syntax: print object [name][,...]\n" \ "Object can be \"server\", or \"queue\", or \"node\"\n" \ "The print command's output can be fed back into qmgr as input.\n" \ "If the object is \"server\", all the queues and nodes associated \n" \ "with the server are printed as well as the server information.\n" \ "For multiple names, use a comma separated list with no intervening whitespace.\n" \ "Examples:\n" \ "print server\n" \ "print node n1\n" \ "print queue q3\n" \ #define HELP_QUIT \ "Syntax: quit\n" \ "The quit command will exit from qmgr.\n" #define HELP_EXIT \ "Syntax: exit\n" \ "The exit command will exit from qmgr.\n" #define HELP_OPERATOR \ "Syntax: ... attribute OP new value\n" \ "Qmgr accepts three different operators for its commands.\n" \ "\t=\tAssign value into attribute.\n" \ "\t+=\tAdd new value and old value together and assign into attribute.\n" \ "\t-=\tSubtract new value from old value and assign into attribute.\n" \ "These operators are used in the \"set\" and the \"unset\" commands\n" #define HELP_VALUE \ "Syntax ... OP value[multiplier]\n" \ "A multipler can be added to the end of a size in bytes or words.\n" \ "The multipliers are: tb, gb, mb, kb, b, tw, gw, mw, kw, w. The second letter\n" \ "stands for bytes or words. b or w is the default multiplier.\n" \ "The multipliers are case insensitive i.e. gw is the same as GW.\n" \ "Examples:\n" \ "100mb\n" \ "2gw\n" \ "10\n" #define HELP_NAME \ "Syntax: [name][@server]\n" \ "Names can be in several parts. There can be the name of an object, \n" \ "the name of an object at a server, or just at a server.\n" \ "The name of an object specifys a name. A name of an object at a server\n" \ "specifys the name of an object at a specific server. Lastly, at a server\n" \ "specifys all objects of a type at a server\n" \ "Examples:\n" \ "batch - An object called batch\n" \ "batch@s1 - An object called batch at the server s1\n" \ "@s1 - All the objects of a cirtain type at the server s1\n" #define HELP_ATTRIBUTE \ "The help for attributes are broken up into the following help subtopics:\n" \ "\tserverpublic\t- Public server attributes\n" \ "\tserverro\t- Read only server attributes\n" \ "\tqueuepublic\t- Public queue attributes\n" \ "\tqueueexec\t- Attributes specific to execution queues\n" \ "\tqueueroute\t- Attributes specified to routing queues\n" \ "\tqueuero \t- Read only queue attributes\n" \ "\tnodeattr\t- Node Attributes\n" #define HELP_SERVERPUBLIC \ "Server Public Attributes:\n" \ "acl_host_enable - enables host level access control\n" \ "acl_user_enable - enables user level access control\n" \ "acl_users - list of users allowed/denied access to server\n" \ "comment - informational text string about the server\n" \ "default_queue - default queue used when a queue is not specified\n" \ "log_events - a bit string which specfiies what is logged\n" #define HELP_SERVERPUBLIC2 \ "mail_uid - uid of sender of mail which is sent by the server\n" \ "managers - list of users granted administrator privledges\n" \ "max_running - maximum number of jobs that can run on the server\n" \ "max_user_run - maximum number of jobs that a user can run on the server\n" \ "max_grou_run - maximum number of jobs a UNIX group can run on the server\n" \ "operators - list of users granted operator privledges\n" \ "query_other_jobs - when true users can query jobs owned by other users\n" #define HELP_SERVERPUBLIC3 \ "resources_available - amount of resources which are available to the server\n" \ "resources_cost - the cost factors of resources. Used for sync. job starting\n" \ "resources_default - the default resource value when the job does not specify\n" \ "resource_max - the maximum amount of resources that are on the system\n" \ "scheduler_iteration - the amount of seconds between timed scheduler iterations\n" \ "scheduling - when true the server should tell the scheduler to run\n" \ "system_cost - arbitirary value factored into resource costs\n" \ #define HELP_SERVERRO \ "Server Read Only Attributes:\n" \ "resources_assigned - total amount of resources allocated to running jobs\n" \ "server_name - the name of the server and possibly a port number\n" \ "server_state - the current state of the server\n" \ "state_count - total number of jobs in each state\n" \ "total_jobs - total number of jobs managed by the server\n" \ "PBS_version - the release version of PBS\n" \ #define HELP_QUEUEPUBLIC \ "Queue Public Attributes:\n" \ "acl_group_enable - enables group level access control on the queue\n" \ "acl_groups - list of groups which have been allowed or denied access\n" \ "acl_host_enable - enables host level access control on the queue\n" \ "acl_hosts - list of hosts which have been allowed or denied access\n" \ "acl_user_enable - enables user level access control on the queue\n" #define HELP_QUEUEPUBLIC2 \ "acl_users - list of users which have been allowed or denied access\n" \ "enabled - when true users can enqueue jobs\n" \ "from_route_only - when true queue only accepts jobs when routed by servers\n" \ "max_queueable - maximum number of jobs allowed to reside in the queue\n" \ "max_running - maximum number of jobs in the queue that can be routed or running\n" \ "priority - the priority of the queue\n" #define HELP_QUEUEPUBLIC3 \ "queue_type - type of queue: execution or routing\n" \ "resources_max - maximum amount of a resource which can be requested by a job\n" \ "resources_min - minimum amount of a resource which can be requested by a job\n" \ "resources_default - the default resource value when the job does not specify\n" \ "started - when true jobs can be scheduled for execution\n" #define HELP_QUEUEEXEC \ "Attributes for Execution queues only:\n" \ "checkpoint_min - min. number of mins. of CPU time allowed bwtween checkpointing\n" \ "resources_available - amount of resources which are available to the queue\n" \ "kill_delay - amount of time between SIGTERM and SIGKILL when deleting a job\n" \ "max_user_run - maximum number of jobs a user can run in the queue\n" \ "max_group_run - maximum number of jobs a UNIX group can run in a queue\n" #define HELP_QUEUEROUTE \ "Attributes for Routing queues only:\n" \ "route_destinations - list of destinations which jobs may be routed to\n" \ "alt_router - when true a alternate routing function is used to route jobs\n" \ "route_held_jobs - when true held jobs may be routed from this queue\n" \ "route_waiting_jobs - when true waiting jobs may be routed from this queue\n" \ "route_retry_time - time delay between route retries.\n" \ "route_lifetime - maximum amount of time a job can be in this routing queue\n" #define HELP_QUEUERO \ "Queue read only attributes:\n" \ "total_jobs - total number of jobs in queue\n" \ "state_count - total number of jobs in each state in the queue\n" \ "resources_assigned - amount of resources allocated to jobs running in queue\n" #define HELP_NODEATTR \ "Node attributes:\n" \ "state - the current state of a node\n" \ "properties - the properties the node has\n" torque-2.4.16/src/include/assertions.h0000664000113300011330000000176511301310217014607 00000000000000#ifndef ASSERTIONS_H_ #define ASSERTIONS_H_ #ifndef NDEBUG #include "log.h" #include "pbs_error.h" #include static char whereami[120]; #define dbg_precondition(expr, comment) \ { if (!(expr)) { \ sprintf(whereami,"%s:%d",__func__,__LINE__);\ sprintf(log_buffer,"%s is false -> \"%s\"",#expr,comment);\ log_err(PBSE_PRECONDITION,whereami,log_buffer); abort(); } } #define dbg_postcondition(expr, comment) \ { if (!(expr)) { \ sprintf(whereami,"%s:%d",__func__,__LINE__);\ sprintf(log_buffer,"%s is false -> \"%s\"",#expr,comment);\ log_err(PBSE_POSTCONDITION,whereami,log_buffer); abort(); } } #define dbg_consistency(expr, comment) \ { if (!(expr)) { \ sprintf(whereami,"%s:%d",__func__,__LINE__);\ sprintf(log_buffer,"%s is false -> \"%s\"",#expr,comment);\ log_err(PBSE_CONSISTENCY,whereami,log_buffer); abort(); } } #else #define dbg_precondition(expr, comment) {} #define dbg_postcondition(expr, comment) {} #define dbg_consistency(expr, comment) {} #endif #endif torque-2.4.16/src/include/md5.h0000664000113300011330000000610311272401235013101 00000000000000/* *********************************************************************** ** md5.h -- header file for implementation of MD5 ** ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** ** Created: 2/17/90 RLR ** ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** ** Revised (for MD5): RLR 4/27/91 ** ** -- G modified to have y&~z instead of y&z ** ** -- FF, GG, HH modified to add in last register done ** ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** ** -- distinct additive constant for each step ** ** -- round 4 added, working mod 7 ** *********************************************************************** */ /* *********************************************************************** ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** ** ** ** License to copy and use this software is granted provided that ** ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** ** Digest Algorithm" in all material mentioning or referencing this ** ** software or this function. ** ** ** ** License is also granted to make and use derivative works ** ** provided that such works are identified as "derived from the RSA ** ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** ** material mentioning or referencing the derived work. ** ** ** ** RSA Data Security, Inc. makes no representations concerning ** ** either the merchantability of this software or the suitability ** ** of this software for any particular purpose. It is provided "as ** ** is" without express or implied warranty of any kind. ** ** ** ** These notices must be retained in any copies of any part of this ** ** documentation and/or software. ** *********************************************************************** */ /* * PBS specific revision: @(#) $Id: md5.h 2367 2008-09-03 17:17:34Z josh $ */ #ifndef __MD5_INCLUDE__ /* typedef a 32-bit type */ typedef unsigned long int UINT4; /* Data structure for MD5 (Message-Digest) computation */ typedef struct { UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ UINT4 buf[4]; /* scratch buffer */ unsigned char in[64]; /* input buffer */ unsigned char digest[16]; /* actual digest after MD5Final call */ } MD5_CTX; void MD5Init(MD5_CTX *); void MD5Update(MD5_CTX *, unsigned char *, unsigned int); void MD5Final(MD5_CTX *); #define __MD5_INCLUDE__ #endif /* __MD5_INCLUDE__ */ torque-2.4.16/src/include/credential.h0000664000113300011330000001310711272401235014530 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * credential.h - header file for default authentication system provided * with PBS. * * Other Requrired Header Files: * "portability.h" * "libpbs.h" * */ #ifndef CREDENTIAL_H #define CREDENTIAL_H /* the credential as decrypted by the server */ #include struct credential { time_t timestamp; int type; /* see BATCH-types.h */ char username[PBS_MAXUSER]; char hostname[PBS_MAXHOSTNAME]; }; /* * a full ticket (credential) as passed from the client to the server * is of the following size: 8 for the pbs_iff key + 8 for the timestamp + * space for user and host name rounded up to multiple of 8 which is the * sub-credential size */ #define PBS_KEY_SIZE 8 #define PBS_TIMESTAMP_SZ 8 #define PBS_SUBCRED_SIZE ((PBS_MAXUSER + PBS_MAXHOSTNAME + 7) / 8 * 8) #define PBS_SEALED_SIZE (PBS_SUBCRED_SIZE + PBS_TIMESTAMP_SZ) #define PBS_TICKET_SIZE (PBS_KEY_SIZE + PBS_SEALED_SIZE) /* * a sealed ticket as produced by the server */ struct sealed_ticket { char timestamp[PBS_TIMESTAMP_SZ]; char subcred[PBS_SUBCRED_SIZE]; }; #define CREDENTIAL_LIFETIME 3600 #define CREDENTIAL_TIME_DELTA 300 extern void break_cred A_((char key[PBS_KEY_SIZE], char *ticket, int size, struct credential *pcred)); extern int get_credent A_((char *server, unsigned int port, char **credential)); extern int make_sealed A_((char key[PBS_KEY_SIZE], char *subcred, int size, char **ticket)); extern void make_svr_key A_((char key[PBS_KEY_SIZE])); extern int make_subcred A_((char key[PBS_KEY_SIZE], char *user, char **subcred)); #endif /* CREDENTIAL_H */ torque-2.4.16/src/include/site_job_attr_def.ht0000664000113300011330000001112311272401235016244 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Place holder for site supplied additions to the array of * site job attribute definitions, see server/job_attr_def.c * * Array elements must be of the form: * { "name", * decode_Func, * encode_Func, * set_Func, * comp_Func, * free_Func, * action_routine, * permissions, * ATR_TYPE_*, * PARENT_TYPE_JOB * }, * * Matching entry must be added in site_job_attr_enum.h */ { "x", decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, READ_WRITE, ATR_TYPE_STR, PARENT_TYPE_JOB }, torque-2.4.16/src/include/qmgr_node_readonly.h0000664000113300011330000001046511272401235016272 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: qmgr_node_readonly.h 2367 2008-09-03 17:17:34Z josh $ */ /* * This is a list of read only node attributes * * FORMAT: * attr1, * attr2, <--- important the last has a comma after it * * This file will be used for the initialization of an array * */ ATTR_NODE_jobs, torque-2.4.16/src/include/attribute.h0000664000113300011330000005105611272401235014426 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #ifndef _PBS_IFL_DEF #include "pbs_ifl.h" #endif #ifndef lONG_H #include "Long.h" #endif /* * This header file contains the definitions for attributes * * Other required header files: * "list_link.h" * "portability.h" * * Attributes are represented in one or both of two forms, external and * internal. When an attribute is moving external to the server, either * to the network or to disk (for saving), it is represented in the * external form, a "svrattropl" structure. This structure holds the * attribute name as a string. If the attribute is a resource type, the * resource name and resource value are encoded as strings, a total of three * strings. If the attribute is not a resource, then the attribute value is * coded into a string for a total of two strings. * * Internally, attributes exist in two separate structures. The * attribute type is defined by a "definition structure" which contains * the name of the attribute, flags, and pointers to the functions used * to access the value. This info is "hard coded". There is one * "attribute definition" per (attribute name, parent object type) pair. * * The attribute value is contained in another struture which contains * the value and flags. Both the attribute value and definition are in * arrays and share the same index. When an * object is created, the attributes associated with that object * are created with default values. */ #ifndef ATTRIBUTE_H #define ATTRIBUTE_H 1 /* define the size of fields in the structures */ #define ATRFLAG 16 #define ATRTYPE 6 /* sync w/ATR_TYPE_* (see #defines below) */ #define ATRPART 3 /* * The svrattrl structure is used to hold the external form of attributes. */ struct svrattrl { list_link al_link; struct attropl al_atopl; /* name,resource,value, see pbs_ifl.h */ int al_tsize; /* size of this structure (variable) */ int al_nameln; /* len of name string (including null) */ int al_rescln; /* len of resource name string (+ null) */ int al_valln; /* len of value, may contain many nulls */ unsigned int al_flags: ATRFLAG; /* copy of attribute value flags */ /* data follows directly after */ }; typedef struct svrattrl svrattrl; #define al_name al_atopl.name #define al_resc al_atopl.resource #define al_value al_atopl.value #define al_op al_atopl.op /* * The value of an attribute is contained in the following structure. * * The length field specifies the amount of memory that has been * malloc-ed for the value (used for at_str, at_array, and at_resrc). * If zero, no space has been malloc-ed. * * The union member is selected based on the value type given in the * flag field of the definition. */ struct size_value { unsigned long atsv_num; /* numeric part of a size value */ unsigned int atsv_shift: 8; /* binary shift count, K=10, g=20 */ unsigned int atsv_units: 1; /* units (size in words or bytes) */ }; #define ATR_SV_BYTESZ 0 /* size is in bytes */ #define ATR_SV_WORDSZ 1 /* size is in words */ union attr_val /* the attribute value */ { long at_long; /* long integer */ Long at_ll; /* largest long integer */ char at_char; /* single character */ char *at_str; /* char string (alloc) */ struct array_strings *at_arst; /* array of strings (alloc) */ struct size_value at_size; /* size value */ tlist_head at_list; /* list of resources, ... (alloc) */ struct pbsnode *at_jinfo; /* ptr to node's job info */ short at_short; /* short int; node's state */ }; struct attribute { unsigned int at_flags: ATRFLAG; /* attribute flags */ unsigned int at_type: ATRTYPE; /* type of attribute */ union attr_val at_val; /* the attribute value */ }; typedef struct attribute attribute; /* * The following structure is used to define an attribute for any parent * object. The structure declares the attribute's name, value type, and * access methods. This information is "built into" the server in an array * of attribute_def structures. The definition occurs once for a given name. */ struct attribute_def { char *at_name; int (*at_decode)A_((attribute *patr, char *name, char *rn, char *val)); int (*at_encode)A_((attribute *pattr, tlist_head *phead, char *aname, char *rsname, int mode)); int (*at_set)A_((attribute *pattr, attribute *new, enum batch_op)); int (*at_comp)A_((attribute *pattr, attribute *with)); void (*at_free)A_((attribute *pattr)); int (*at_action)A_((attribute *pattr, void *pobject, int actmode)); unsigned int at_flags: ATRFLAG; /* flags: perms, ... */ unsigned int at_type: ATRTYPE; /* type of attribute */ unsigned int at_parent: ATRPART; /* type of parent object */ }; typedef struct attribute_def attribute_def; /* Defines for type of Attribute based on data type */ #define ATR_TYPE_LONG 1 /* Long integer, also Boolean */ #define ATR_TYPE_CHAR 2 /* single character */ #define ATR_TYPE_STR 3 /* string, null terminated */ #define ATR_TYPE_ARST 4 /* Array of strings (char **) */ #define ATR_TYPE_SIZE 5 /* size (integer + suffix) */ #define ATR_TYPE_RESC 6 /* list type: resources only */ #define ATR_TYPE_LIST 7 /* list type: dependencies, unkn, etc */ #define ATR_TYPE_ACL 8 /* Access Control Lists */ #define ATR_TYPE_LL 9 /* Long (64 bit) integer */ #define ATR_TYPE_SHORT 10 /* short integer */ #define ATR_TYPE_JINFOP 13 /* struct jobinfo* */ /* Defines for Flag field in attribute_def */ #define ATR_DFLAG_USRD 0x01 /* User client can read (status) attribute */ #define ATR_DFLAG_USWR 0x02 /* User client can write (set) attribute */ #define ATR_DFLAG_OPRD 0x04 /* Operator client can read attribute */ #define ATR_DFLAG_OPWR 0x08 /* Operator client can write attribute */ #define ATR_DFLAG_MGRD 0x10 /* Manager client can read attribute */ #define ATR_DFLAG_MGWR 0x20 /* Manager client can write attribute */ #define ATR_DFLAG_PRIVR 0x40 /* Private (only owner, oper, manager can read) */ #define ATR_DFLAG_Creat 0x80 /* Can be set on create only */ #define ATR_DFLAG_SvRD 0x100 /* job attribute is sent to server on move */ #define ATR_DFLAG_SvWR 0x200 /* job attribute is settable by server/Sch */ #define ATR_DFLAG_MOM 0x400 /* attr/resc sent to MOM "iff" set */ #define ATR_DFLAG_RDACC 0x515 /* Read access mask */ #define ATR_DFLAG_WRACC 0x6AA /* Write access mask */ #define ATR_DFLAG_ACCESS 0x7ff /* Mask access flags */ #define ATR_DFLAG_ALTRUN 0x0800 /* (job) attr/resc is alterable in Run state */ #define ATR_DFLAG_NOSTAT 0x1000 /* attribute sent on status by request only */ #define ATR_DFLAG_SELEQ 0x2000 /* attribute is only selectable eq/ne */ #define ATR_DFLAG_RASSN 0x4000 /* resc to be summed in resources_used */ #define ATR_DFLAG_RMOMIG 0x8000 /* resource to be ignored by mom */ /* combination defines for permission field */ #define READ_ONLY ATR_DFLAG_USRD | ATR_DFLAG_OPRD | ATR_DFLAG_MGRD #define READ_WRITE ATR_DFLAG_USRD | ATR_DFLAG_OPRD | ATR_DFLAG_MGRD | ATR_DFLAG_USWR | ATR_DFLAG_OPWR | ATR_DFLAG_MGWR #define NO_USER_SET ATR_DFLAG_USRD | ATR_DFLAG_OPRD | ATR_DFLAG_MGRD | ATR_DFLAG_OPWR | ATR_DFLAG_MGWR #define MGR_ONLY_SET ATR_DFLAG_USRD | ATR_DFLAG_OPRD | ATR_DFLAG_MGRD | ATR_DFLAG_MGWR /* Defines for Flag field in attribute (value) */ #define ATR_VFLAG_SET 0x01 /* has specifed value (is set) */ #define ATR_VFLAG_MODIFY 0x02 /* value has been modified */ #define ATR_VFLAG_DEFLT 0x04 /* value is default value */ #define ATR_VFLAG_SEND 0x08 /* value to be sent to server */ #define ATR_TRUE "True" #define ATR_FALSE "False" /* Defines for Parent Object type field in the attribute definition */ /* really only used for telling queue types apart */ #define PARENT_TYPE_JOB 1 #define PARENT_TYPE_QUE_ALL 2 #define PARENT_TYPE_QUE_EXC 3 #define PARENT_TYPE_QUE_RTE 4 #define PARENT_TYPE_QUE_PULL 5 #define PARENT_TYPE_SERVER 6 #define PARENT_TYPE_NODE 7 /* DIAGTODO: define PARENT_TYPE_DIAG, but atrpart field isn't wide enough */ /* * values for the "actmode" parameter to at_action() */ #define ATR_ACTION_NOOP 0 #define ATR_ACTION_NEW 1 #define ATR_ACTION_ALTER 2 #define ATR_ACTION_RECOV 3 #define ATR_ACTION_FREE 4 /* * values for the mode parameter to at_encode(), determines: * - list separater character for encode_arst() * - which resources are encoded (see attr_fn_resc.c[encode_resc] */ #define ATR_ENCODE_CLIENT 0 /* encode for sending to client + sched */ #define ATR_ENCODE_SVR 1 /* encode for sending to another server */ #define ATR_ENCODE_MOM 2 /* encode for sending to MOM */ #define ATR_ENCODE_SAVE 3 /* encode for saving to disk */ /* * structure to hold array of pointers to character strings */ struct array_strings { int as_npointers; /* number of pointer slots in this block */ int as_usedptr; /* number of used pointer slots */ int as_bufsize; /* size of buffer holding strings */ char *as_buf; /* address of buffer */ char *as_next; /* first available byte in buffer */ char *as_string[1]; /* first string pointer */ }; /* * specific attribute value function prototypes */ extern void clear_attr A_((attribute *pattr, attribute_def *pdef)); extern int find_attr A_((attribute_def *attrdef, char *name, int limit)); extern int recov_attr A_((int fd, void *parent, attribute_def *padef, attribute *pattr, int limit, int unknown, int do_actions)); extern long attr_ifelse_long A_((attribute *, attribute *, long)); extern void free_null A_((attribute *attr)); extern void free_noop A_((attribute *attr)); extern svrattrl *attrlist_alloc A_((int szname, int szresc, int szval)); extern svrattrl *attrlist_create A_((char *aname, char *rname, int szval)); extern void free_attrlist A_((tlist_head *attrhead)); extern int attr_atomic_set A_((svrattrl *plist, attribute *old, attribute *new, attribute_def *pdef, int limit, int unkn, int privil, int *badattr)); extern int attr_atomic_node_set A_((svrattrl *plist, attribute *old, attribute *new, attribute_def *pdef, int limit, int unkn, int privil, int *badattr)); extern void attr_atomic_kill A_((attribute *temp, attribute_def *pdef, int)); extern int decode_b A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_c A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_l A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_ll A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_size A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_str A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_time A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_arst A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_arst_direct A_((attribute *patr, char *val)); extern int decode_arst_merge A_((attribute *,char *,char *,char *)); extern int decode_resc A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_depend A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_hold A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_uacl A_((attribute *patr, char *name, char *rn, char *val)); extern int decode_unkn A_((attribute *patr, char *name, char *rn, char *val)); extern int encode_b A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_c A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_l A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_ll A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_size A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_str A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_time A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_arst A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_resc A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_inter A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_unkn A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_depend A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int encode_hold A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int set_b A_((attribute *attr, attribute *new, enum batch_op)); extern int set_c A_((attribute *attr, attribute *new, enum batch_op)); extern int set_l A_((attribute *attr, attribute *new, enum batch_op)); extern int set_ll A_((attribute *attr, attribute *new, enum batch_op)); extern int set_size A_((attribute *attr, attribute *new, enum batch_op)); extern int set_str A_((attribute *attr, attribute *new, enum batch_op)); extern int set_arst A_((attribute *attr, attribute *new, enum batch_op)); extern int set_resc A_((attribute *attr, attribute *new, enum batch_op)); extern int set_hostacl A_((attribute *attr, attribute *new, enum batch_op)); extern int set_uacl A_((attribute *attr, attribute *new, enum batch_op)); extern int set_unkn A_((attribute *attr, attribute *new, enum batch_op)); extern int set_depend A_((attribute *attr, attribute *new, enum batch_op)); extern int comp_b A_((attribute *, attribute *)); extern int comp_c A_((attribute *, attribute *)); extern int comp_l A_((attribute *, attribute *)); extern int comp_ll A_((attribute *, attribute *)); extern int comp_size A_((attribute *, attribute *)); extern int comp_str A_((attribute *, attribute *)); extern int comp_arst A_((attribute *, attribute *)); extern int comp_resc A_((attribute *, attribute *)); extern int comp_resc2 A_((attribute *, attribute *, int, char *)); extern int comp_unkn A_((attribute *, attribute *)); extern int comp_depend A_((attribute *, attribute *)); extern int comp_hold A_((attribute *, attribute *)); extern int action_depend A_((attribute *, void *, int)); extern void free_str A_((attribute *)); extern void free_arst A_((attribute *)); extern void free_resc A_((attribute *)); extern void free_depend A_((attribute *)); extern void free_unkn A_((attribute *)); extern int parse_equal_string A_((char *, char **, char **)); extern char *parse_comma_string A_((char *)); #define NULL_FUNC (int (*)())0 /* other associated funtions */ extern int acl_check A_((attribute *, char *canidate, int type)); extern char *arst_string A_((char *str, attribute *pattr)); extern void attrl_fixlink A_((tlist_head *svrattrl)); extern void recov_acl A_((attribute *, attribute_def *, char *, char *)); extern int save_acl A_((attribute *, attribute_def *, char *, char *)); extern int save_attr A_((attribute_def *, attribute *, int)); extern int encode_state A_((attribute *, tlist_head *, char *, char *, int)); extern int encode_props A_((attribute*, tlist_head*, char*, char*, int)); extern int encode_jobs A_((attribute*, tlist_head*, char*, char*, int)); extern int encode_ntype A_((attribute*, tlist_head*, char*, char*, int)); extern int decode_state A_((attribute*, char*, char*, char*)); extern int decode_props A_((attribute*, char*, char*, char*)); extern int decode_ntype A_((attribute*, char*, char*, char*)); extern int decode_null A_((attribute*, char*, char*, char*)); extern int comp_null A_((attribute*, attribute*)); extern int count_substrings A_((char*, int*)); extern int set_node_state A_((attribute*, attribute*, enum batch_op)); extern int set_node_ntype A_((attribute*, attribute*, enum batch_op)); extern int set_node_props A_((attribute*, attribute*, enum batch_op)); extern int set_null A_((attribute*, attribute*, enum batch_op)); extern int node_state A_((attribute*, void*, int)); extern int node_np_action A_((attribute*, void*, int)); extern int node_ntype A_((attribute*, void*, int)); extern int node_prop_list A_((attribute*, void*, int)); extern int node_status_list A_((attribute*, void*, int)); extern int node_note A_((attribute*, void*, int)); extern int set_note_str A_((attribute *attr, attribute *new, enum batch_op)); extern void replace_attr_string A_((attribute*, char*)); /* Token manipulation functions */ extern int decode_tokens A_((attribute *, char *, char *, char *)); /* "type" to pass to acl_check() */ #define ACL_Host 1 #define ACL_User 2 #define ACL_Group 3 #define ACL_Gid 4 #endif /* ATTRIBUTE_H */ torque-2.4.16/src/include/list_link.h0000664000113300011330000001312611272401235014407 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: list_link.h 2367 2008-09-03 17:17:34Z josh $ */ /* * list_link.h - header file for general linked list routines * see list_link.c * * A user defined linked list can be managed by these routines if * the first element of the user structure is the list_link struct * defined below. */ #ifndef LIST_LINK_H #define LIST_LINK_H 1 /* list entry list sub-structure */ typedef struct list_link { struct list_link *ll_prior; struct list_link *ll_next; void *ll_struct; } list_link; typedef list_link tlist_head; /* macros to clear list head or link */ #define CLEAR_HEAD(e) e.ll_next = &e, e.ll_prior = &e, e.ll_struct = (void *)0 #define CLEAR_LINK(e) e.ll_next = &e, e.ll_prior = &e #define LINK_INSET_BEFORE 0 #define LINK_INSET_AFTER 1 #ifdef NDEBUG #define GET_NEXT(pe) (pe).ll_next->ll_struct #define GET_PRIOR(pe) (pe).ll_prior->ll_struct #else #define GET_NEXT(pe) get_next(pe, __FILE__, __LINE__) #define GET_PRIOR(pe) get_prior(pe, __FILE__, __LINE__) #endif /* function prototypes */ extern void insert_link A_((list_link *old, list_link *new, void *pobj, int pos)); extern void append_link A_((tlist_head *head, list_link *new, void *pnewobj)); extern void delete_link A_((list_link *old)); extern void swap_link A_((list_link *, list_link *)); extern int is_linked A_((list_link *head, list_link *old)); extern void list_move A_((tlist_head *old, tlist_head *new)); #ifndef NDEBUG extern void *get_next A_((list_link, char *file, int line)); extern void *get_prior A_((list_link, char *file, int line)); #endif /* NDEBUG */ #endif /* LIST_LINK_H */ torque-2.4.16/src/include/log.h0000664000113300011330000001606011272401235013200 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * include file for error/event logging */ #ifndef LOG_H #define LOG_H #define LOG_BUF_SIZE 16384 /* The following macro assist in sharing code between the Server and Mom */ #define LOG_EVENT log_event /* ** Set up a debug print macro. */ #ifdef NDEBUG #define DBPRT(x) #else #define DBPRT(x) printf x; #endif /* END NDEBUG */ #if SYSLOG #include #endif /* SYSLOG */ #if !SYSLOG /* define syslog constants that can be used in code regardless of whether we * are using syslog or not! */ #ifndef LOG_EMERG #define LOG_EMERG 1 #endif #ifndef LOG_ALERT #define LOG_ALERT 2 #endif #ifndef LOG_CRIT #define LOG_CRIT 3 #endif #ifndef LOG_ERR #define LOG_ERR 4 #endif #ifndef LOG_ERR #define LOG_ERR 5 #endif #ifndef LOG_WARNING #define LOG_WARNING 6 #endif #ifndef LOG_NOTICE #define LOG_NOTICE 7 #endif #ifndef LOG_INFO #define LOG_INFO 8 #endif #ifndef LOG_DEBUG #define LOG_DEBUG 9 #endif #endif /* SYSLOG */ extern long *log_event_mask; /* set this to non-zero in calling app if errors go to stderr */ extern int chk_file_sec_stderr; extern void log_close A_((int)); extern void log_err A_((int, char *, char *)); extern void log_ext A_((int,char *,char *,int)); extern void log_event A_((int, int, char *, char *)); extern int log_open A_((char *, char *)); extern void log_record A_((int, int, char *, char *)); extern void log_roll A_((int)); extern long log_size A_((void)); extern int log_remove_old A_((char *,unsigned long)); extern char log_buffer[LOG_BUF_SIZE]; int log_init A_((char *, char *)); extern int chk_file_sec A_((char *, int, int, int, int, char *)); extern int setup_env A_((char *)); /* Event types */ #define PBSEVENT_ERROR 0x0001 /* internal errors */ #define PBSEVENT_SYSTEM 0x0002 /* system (server) events */ #define PBSEVENT_ADMIN 0x0004 /* admin events */ #define PBSEVENT_JOB 0x0008 /* job related events */ #define PBSEVENT_JOB_USAGE 0x0010 /* End of Job accounting */ #define PBSEVENT_SECURITY 0x0020 /* security violation events */ #define PBSEVENT_SCHED 0x0040 /* scheduler events */ #define PBSEVENT_DEBUG 0x0080 /* common debug messages */ #define PBSEVENT_DEBUG2 0x0100 /* less needed debug messages */ #define PBSEVENT_FORCE 0x8000 /* set to force a messag */ /* Event Object Classes, see array class_names[] in ../lib/Liblog/pbs_log.c */ #define PBS_EVENTCLASS_SERVER 1 /* The server itself */ #define PBS_EVENTCLASS_QUEUE 2 /* Queues */ #define PBS_EVENTCLASS_JOB 3 /* Jobs */ #define PBS_EVENTCLASS_REQUEST 4 /* Batch Requests */ #define PBS_EVENTCLASS_FILE 5 /* A Job related File */ #define PBS_EVENTCLASS_ACCT 6 /* Accounting info */ #define PBS_EVENTCLASS_NODE 7 /* Nodes */ /* Logging Masks */ #define PBSEVENT_MASK 0x01ff /* definition's for pbs_log.c's log_remove_old() function */ #define MAX_PATH_LEN 1024 /* maximum possible length of any path */ #define SECS_PER_DAY 86400 #if !defined(TRUE) || !defined(FALSE) #define TRUE 1 #define FALSE 0 #endif /* !defined(TRUE) || !defined(FALSE) */ #endif /* ifndef LOG_H */ torque-2.4.16/src/include/rpp.h0000664000113300011330000001122511305006373013217 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ int rpp_open(char *, unsigned int, char *); int rpp_bind(unsigned int); int rpp_poll(void); int rpp_io(void); int rpp_read(int, void *, int); int rpp_write(int, void *, int); int rpp_close(int); struct sockaddr_in* rpp_getaddr(int); int rpp_flush(int); void rpp_shutdown(void); void rpp_terminate(void); int rpp_rcommit(int, int); int rpp_wcommit(int, int); int rpp_skip(int, int); int rpp_eom(int); int rpp_getc(int); int rpp_putc(int, int); char * netaddr(struct sockaddr_in *); int rpp_get_stream_state(int index); unsigned long crc(unsigned char *, unsigned long); extern int rpp_fd; extern int rpp_dbprt; torque-2.4.16/src/include/dis.h0000664000113300011330000002400411306021356013173 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #ifndef DATA_IS_STRINGS_ #define DATA_IS_STRINGS_ #include #include #include #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif /* * Integer function return values from Data-is-Strings reading calls */ /* sync w/dis_emsg[] (lib/Libdis/dis.c) */ #define DIS_SUCCESS 0 /* No error */ #define DIS_OVERFLOW 1 /* Value too large to convert */ #define DIS_HUGEVAL 2 /* Tried to write floating point infinity */ #define DIS_BADSIGN 3 /* Negative sign on an unsigned datum */ #define DIS_LEADZRO 4 /* Input count or value has leading zero */ #define DIS_NONDIGIT 5 /* Non-digit found where a digit was expected */ #define DIS_NULLSTR 6 /* String read has an embedded ASCII NUL */ #define DIS_EOD 7 /* Premature end of message */ #define DIS_NOMALLOC 8 /* Unable to malloc space for string */ #define DIS_PROTO 9 /* Supporting protocol failure */ #define DIS_NOCOMMIT 10 /* Protocol failure in commit */ #define DIS_EOF 11 /* End of File */ #ifdef __STDC__ #define A_(x) x #else #define A_(x) () #define const #define volatile #endif unsigned long disrul A_((int stream, int *retval)); /*#if UINT_MAX == ULONG_MAX*/ #if SIZEOF_UNSIGNED == SIZEOF_LONG #define disrui(stream, retval) (unsigned)disrul(stream, (retval)) #else unsigned disrui A_((int stream, int *retval)); #endif /*#if USHRT_MAX == UINT_MAX*/ #if SIZEOF_UNSIGNED_SHORT == SIZEOF_UNSIGNED_INT #define disrus(strea, retval) (unsigned short)disrui(stream, (retval)) #else unsigned short disrus A_((int stream, int *retval)); #endif /*#if UCHAR_MAX == USHRT_MAX*/ #if SIZEOF_UNSIGNED_CHAR == SIZEOF_UNSIGNED_SHORT #define disruc(stream, retval) (unsigned char)disrus(stream, (retval)) #else unsigned char disruc A_((int stream, int *retval)); #endif long disrsl A_((int stream, int *retval)); /*#if INT_MIN == LONG_MIN && INT_MAX == LONG_MAX*/ #if SIZEOF_INT == SIZEOF_LONG #define disrsi(stream, retval) (int)disrsl(stream, (retval)) #else int disrsi A_((int stream, int *retval)); #endif /*#if SHRT_MIN == INT_MIN && SHRT_MAX == INT_MAX*/ #if SIZEOF_SHORT == SIZEOF_INT #define disrss(stream, retval) (short)disrsi(stream, (retval)) #else short disrss A_((int stream, int *retval)); #endif /*#if CHAR_MIN == SHRT_MIN && CHAR_MAX == SHRT_MAX*/ #if SIZEOF_SIGNED_CHAR == SIZEOF_SHORT #define disrsc(stream, retval) (signed char)disrss(stream, (retval)) #else signed char disrsc A_((int stream, int *retval)); #endif /*#if CHAR_MIN, i.e. if chars are signed*/ /* also, flip the order of statements */ #ifdef __CHAR_UNSIGNED__ #define disrc(retval, stream) (char)disruc(stream, (retval)) #else #define disrc(stream, retval) (char)disrsc(stream, (retval)) #endif char *disrcs A_((int stream, size_t *nchars, int *retval)); int disrfcs A_((int stream, size_t *nchars, size_t achars, char *value)); char *disrst A_((int stream, int *retval)); int disrfst A_((int stream, size_t achars, char *value)); /* * some compilers do not like long doubles, if long double is the same * as a double, just use a double. */ #if SIZEOF_DOUBLE == SIZEOF_LONG_DOUBLE typedef double dis_long_double_t; #else typedef long double dis_long_double_t; #endif dis_long_double_t disrl A_((int stream, int *retval)); /*#if DBL_MANT_DIG == LDBL_MANT_DIG && DBL_MAX_EXP == LDBL_MAX_EXP*/ #if SIZEOF_DOUBLE == SIZEOF_LONG_DOUBLE #define disrd(stream, retval) (double)disrl(stream, (retval)) #else double disrd A_((int stream, int *retval)); #endif /*#if FLT_MANT_DIG == DBL_MANT_DIG && FLT_MAX_EXP == DBL_MAX_EXP*/ #if SIZEOF_FLOAT == SIZEOF_DOUBLE #define disrf(stream, retval) (float)disrd(stream, (retval)) #else float disrf A_((int stream, int *retval)); #endif int diswul A_((int stream, unsigned long value)); /*#if UINT_MAX == ULONG_MAX*/ #if SIZEOF_UNSIGNED_INT == SIZEOF_UNSIGNED_LONG #define diswui(stream, value) diswul(stream, (unsigned long)(value)) #else int diswui A_((int stream, unsigned value)); #endif #define diswus(stream, value) diswui(stream, (unsigned)(value)) #define diswuc(stream, value) diswui(stream, (unsigned)(value)) int diswsl A_((int stream, long value)); /*#if INT_MIN == LONG_MIN && INT_MAX == LONG_MAX*/ #if SIZEOF_INT == SIZEOF_LONG #define diswsi(stream, value) diswsl(stream, (long)(value)) #else int diswsi A_((int stream, int value)); #endif #define diswss(stream, value) diswsi(stream, (int)(value)) #define diswsc(stream, value) diswsi(stream, (int)(value)) /*#if CHAR_MIN*/ #ifdef __CHAR_UNSIGNED__ #define diswc(stream, value) diswui(stream, (unsigned)(value)) #else #define diswc(stream, value) diswsi(stream, (int)(value)) #endif int diswcs A_((int stream, const char *value, size_t nchars)); #define diswst(stream, value) diswcs(stream, value, strlen(value)) int diswl_ A_((int stream, dis_long_double_t value, unsigned int ndigs)); #define diswl(stream, value) diswl_(stream, (value), LDBL_DIG) #define diswd(stream, value) diswl_(stream, (dis_long_double_t)(value), DBL_DIG) /*#if FLT_MANT_DIG == DBL_MANT_DIG || DBL_MANT_DIG == LDBL_MANT_DIG*/ #if SIZEOF_FLOAT == SIZEOF_DOUBLE #define diswf(stream,value) diswl_(stream,(dis_long_double_t)(value),FLT_DIG) #else int diswf A_((int stream, double value)); #endif extern const char *dis_emsg[]; /* the following routines set/control DIS over tcp */ extern void DIS_tcp_reset A_((int fd, int rw)); extern void DIS_tcp_setup A_((int fd)); extern int DIS_tcp_wflush A_((int fd)); extern void DIS_tcp_settimeout A_((long timeout)); extern int DIS_tcp_istimeout A_((int fd)); extern int PConnTimeout(int); /* NOTE: increase THE_BUF_SIZE to 131072 for systems > 5k nodes */ /* NOTE: THE_BUF_SZIE will be similar in size to PBS_ACCT_MAX_RCD in acct.h */ #define THE_BUF_SIZE 262144 /* max size of tcp send buffer (must be big enough to contain all job attributes) */ struct tcpdisbuf { unsigned long tdis_bufsize; char *tdis_leadp; char *tdis_trailp; char *tdis_eod; char *tdis_thebuf; }; struct tcp_chan { struct tcpdisbuf readbuf; struct tcpdisbuf writebuf; int IsTimeout; /* (boolean) 1 - true */ int ReadErrno; int SelectErrno; }; #endif /* DATA_IS_STRINGS_ */ torque-2.4.16/src/include/server.h0000664000113300011330000002126511375011546013736 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* DIAGTODO: write diag.h and fill out new attrs */ /* * server.h - definitions for the server object (structure) * * Other include files required: * * "attribute.h" * "list_link.h" * "server_limits.h" * * The server object (structure) contains the parameters which * control the operation of the server itself. This includes * the server attributes and resource (limits). */ #ifndef SERVER_H #define SERVER_H #include "server_limits.h" enum srv_atr { SRV_ATR_State, /* 0 */ SRV_ATR_scheduling, SRV_ATR_max_running, SRV_ATR_MaxUserRun, SRV_ATR_MaxGrpRun, SRV_ATR_TotalJobs, SRV_ATR_JobsByState, SRV_ATR_acl_host_enable, SRV_ATR_acl_hosts, SRV_ATR_AclUserEnabled, SRV_ATR_AclUsers, /* 10 */ SRV_ATR_AclRoot, SRV_ATR_managers, SRV_ATR_operators, SRV_ATR_dflt_que, SRV_ATR_log_events, SRV_ATR_mailfrom, SRV_ATR_query_others, SRV_ATR_resource_avail, SRV_ATR_resource_deflt, SRV_ATR_ResourceMax, /* 20 */ SRV_ATR_resource_assn, SRV_ATR_resource_cost, SRV_ATR_sys_cost, SRV_ATR_schedule_iteration, SRV_ATR_ping_rate, SRV_ATR_check_rate, SRV_ATR_tcp_timeout, SRV_ATR_Comment, SRV_ATR_DefNode, SRV_ATR_NodePack, /* 30 */ SRV_ATR_NodeSuffix, SRV_ATR_JobStatRate, SRV_ATR_PollJobs, SRV_ATR_LogLevel, SRV_ATR_DownOnError, SRV_ATR_DisableServerIdCheck, SRV_ATR_JobNanny, SRV_ATR_OwnerPurge, SRV_ATR_QCQLimits, SRV_ATR_MomJobSync, /* 40 */ SRV_ATR_MailDomain, SRV_ATR_version, SRV_ATR_KillDelay, SRV_ATR_AclLogic, SRV_ATR_AclGroupSloppy, SRV_ATR_KeepCompleted, SRV_ATR_SubmitHosts, SRV_ATR_AllowNodeSubmit, SRV_ATR_AllowProxyUser, SRV_ATR_AutoNodeNP, /* 50 */ SRV_ATR_LogFileMaxSize, SRV_ATR_LogFileRollDepth, SRV_ATR_LogKeepDays, SRV_ATR_NextJobNumber, SRV_ATR_tokens, SRV_ATR_NetCounter, SRV_ATR_ExtraResc, SRV_ATR_ServerName, SRV_ATR_SchedVersion, SRV_ATR_AcctKeepDays, /* 60 */ SRV_ATR_lockfile, SRV_ATR_LockfileUpdateTime, SRV_ATR_LockfileCheckTime, SRV_ATR_CredentialLifetime, SRV_ATR_JobMustReport, SRV_ATR_checkpoint_dir, SRV_ATR_display_job_server_suffix, SRV_ATR_job_suffix_alias, SRV_ATR_MailSubjectFmt, SRV_ATR_MailBodyFmt, /* 70 */ SRV_ATR_NPDefault, SRV_ATR_JobStartTimeout, SRV_ATR_JobForceCancelTime, #include "site_svr_attr_enum.h" /* This must be last */ SRV_ATR_LAST }; extern attribute_def svr_attr_def[]; struct server { struct server_qs { int sv_numjobs; /* number of job owned by server */ int sv_numque; /* nuber of queues managed */ int sv_jobidnumber; /* next number to use in new jobid */ /* the server struct must be saved */ /* whenever this value is updated */ time_t sv_savetm; /* time of server db update */ } sv_qs; time_t sv_started; /* time server started */ time_t sv_hotcycle; /* if RECOV_HOT,time of last restart */ time_t sv_next_schedule; /* when to next run scheduler cycle */ int sv_jobstates[PBS_NUMJOBSTATE]; /* # of jobs per state */ char sv_jobstbuf[100]; attribute sv_attr[SRV_ATR_LAST]; /* the server attributes */ int sv_trackmodifed; /* 1 if tracking list modified */ int sv_tracksize; /* total number of sv_track entries */ struct tracking *sv_track; /* array of track job records */ }; extern struct server server; /* * server state values */ #define SV_STATE_DOWN 0 #define SV_STATE_INIT 1 #define SV_STATE_HOT 2 #define SV_STATE_RUN 3 #define SV_STATE_SHUTDEL 4 #define SV_STATE_SHUTIMM 5 #define SV_STATE_SHUTSIG 6 /* * Other misc defines */ #define SVR_HOSTACL "svr_hostacl" #define PBS_DEFAULT_NODE "1#shared" #define SVR_SAVE_QUICK 0 #define SVR_SAVE_FULL 1 #define SVR_HOT_CYCLE 15 /* retry mom every n sec on hot start */ #define SVR_HOT_LIMIT 300 /* after n seconds, drop out of hot start */ /* function prototypes */ extern int svr_recov A_((char *, int)); extern int svr_save A_((struct server *, int)); /* ** Macros for fast min/max. */ #ifndef MIN #define MIN(a,b) (((a)<(b))?(a):(b)) #endif /* END MIN */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* END MAX */ #ifndef JobStatRate #define JobStatRate MAX(PBS_JOBSTAT_MIN,server.sv_attr[(int)SRV_ATR_JobStatRate].at_val.at_long) #endif /* maintain a list of new nodes */ typedef struct new_node { list_link nn_link; /* link to other resources in list */ char *nn_name; /* name of new node */ } new_node; /* Threaded-HA code */ #ifdef USE_HA_THREADS typedef pthread_mutex_t mutex_t; #else typedef int mutex_t; #endif /* USE_HA_THREADS */ /* END server.h */ #endif /* ifndef SERVER_H */ torque-2.4.16/src/include/Makefile.in0000664000113300011330000004446611605403727014336 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/pbs_config.h.in $(top_srcdir)/buildutils/config.mk subdir = src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter include_HEADERS = pbs_error.h pbs_error_db.h pbs_ifl.h tm.h tm_.h rpp.h rm.h noinst_HEADERS = acct.h array.h assertions.h attribute.h batch_request.h \ cmds.h credential.h csv.h \ dis.h dis_init.h pbs_job.h libpbs.h list_link.h log.h Long_.h \ Long.h mcom.h md5.h mom_func.h net_connect.h pbs_assert.h \ pbs_nodes.h pbs_proto.h portability.h qmgr.h \ qmgr_node_public.h qmgr_node_readonly.h qmgr_que_public.h \ qmgr_que_readonly.h qmgr_svr_public.h qmgr_svr_readonly.h \ queue.h resmon.h resource.h sched_cmds.h server.h \ server_limits.h svrfunc.h tracking.h work_task.h \ port_forwarding.h pbs_cpa.h pbs_cpuset.h \ pbs_batchreqtype_db.h utils.h BUILT_SOURCES = site_job_attr_def.h site_job_attr_enum.h \ site_qmgr_node_print.h site_qmgr_que_print.h \ site_qmgr_svr_print.h site_que_attr_def.h \ site_que_attr_enum.h site_svr_attr_def.h \ site_svr_attr_enum.h EXTRA_DIST = site_job_attr_def.ht site_job_attr_enum.ht \ site_qmgr_node_print.ht site_qmgr_que_print.ht \ site_qmgr_svr_print.ht site_que_attr_def.ht \ site_que_attr_enum.ht site_svr_attr_def.ht \ site_svr_attr_enum.ht CLEANFILES = $(BUILT_SOURCES) SUFFIXES = .ht .h all: $(BUILT_SOURCES) pbs_config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .ht .h $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/include/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh pbs_config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/pbs_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/include/pbs_config.h $(srcdir)/pbs_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f pbs_config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) pbs_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) pbs_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) pbs_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) pbs_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(HEADERS) pbs_config.h installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags dist-hook distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-includeHEADERS install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am .ht.h: cp $< $@ dist-hook: (cd $(distdir) && rm -f $(BUILT_SOURCES)) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/include/server_limits.h0000664000113300011330000002023511272401235015305 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: server_limits.h 3138 2009-09-29 21:43:58Z knielson $ */ /* * This section contains size limit definitions * * BEWARE OF CHANGING THESE */ #ifndef SERVER_LIMITS_H #define SERVER_LIMITS_H /* removing outdated 14 char filename limit */ #define PBS_JOBBASE 61 /* basename size for job file, 61 = 64 - 3 */ #define PBS_NUMJOBSTATE 6 #define PBS_MAX_HOPCOUNT 10 /* limit on number of routing hops per job */ #define PBS_SEQNUMTOP 99999999 /* top number for job sequence number, reset */ /* to zero when reached, see req_quejob.c */ #define TORQUE_LISTENQUEUE 10 /* used for X11 and stdout/stderr forwarding */ #define PBS_NET_RETRY_TIME 30 /* retry time between re-sending requests */ #define PBS_NET_RETRY_LIMIT 14400 /* max retry time */ #define PBS_SCHEDULE_CYCLE 600 /* re-schedule even if no change, 10 min */ #define PBS_RESTAT_JOB 45 /* ask mom for status only once in 45 sec */ #define PBS_STAGEFAIL_WAIT 1800 /* retry time after stage in failure */ #define PBS_NORMAL_PING_RATE 300 /* how often to ping the nodes */ #define PBS_TCPTIMEOUT 6 /* timeout for pbs-mom tcp connections */ #define PBS_JOBSTAT_MIN 4 /* minimum time between job stats */ #define PBS_POLLJOBS TRUE /* enable pbs_server job polling */ #define PBS_LOG_CHECK_RATE 300 /* check log size (and log age) every 5 min if log_file_max_size is set */ #define PBS_ACCT_CHECK_RATE 60*60 /* check accounting files every hour if accounting_keep_days is set */ #define PBS_LOCKFILE_UPDATE_TIME 3 /* how often TORQUE updates HA lock file */ #define PBS_LOCKFILE_CHECK_TIME 9 /* how often secondary TORQUE checks HA lock file */ /* Server Database information - path names */ #define PBS_SVR_PRIVATE "server_priv" #define PBS_ACCT "accounting" #define PBS_ARRAYDIR "arrays" #define PBS_JOBDIR "jobs" #define PBS_SPOOLDIR "spool" #define PBS_CHKPTDIR "checkpoint" #define PBS_QUEDIR "queues" #define PBS_LOGFILES "server_logs" #define PBS_ACTFILES "accounting" #define PBS_SERVERDB "serverdb" #define PBS_SVRACL "acl_svr" #define PBS_TRACKING "tracking" #define NODE_DESCRIP "nodes" #define NODE_STATUS "node_status" #define NODE_NOTE "node_note" #ifndef PBS_NET_MAX_CONNECTIONS /* * PBS_NET_MAX_CONNECTIONS is used to limit both socket descriptors and socket * handles. Tests show that often socket handles are used up much faster than * socket descriptors (is there a leak of socket handles???). In the future, we * should probably break out handle size and socket descriptor size and the * socket descriptor size should equal getdtablesize(). For now, however, * PBS_NET_MAX_CONNECTIONS should be larger than ulimit -n due to more socket * handles being handed out than sockets are available. */ #define PBS_NET_MAX_CONNECTIONS 10240 /* increased from 256--should be larger than ulimit -n */ #endif /* PBS_NET_MAX_CONNECTIONS */ #define PBS_LOCAL_CONNECTION PBS_NET_MAX_CONNECTIONS /* * Security, Authentication, Authorization Control: * * - What account is PBS mail from * - Who is the default administrator (when none defined) * - Is "root" always an batch adminstrator (manager) (YES/no) */ #define PBS_DEFAULT_MAIL "adm" #define PBS_DEFAULT_ADMIN "root" #define PBS_ROOT_ALWAYS_ADMIN 1 /* #define NO_SPOOL_OUTPUT 1 User output in home directory,not spool */ /* "simplified" network address structure */ #ifndef PBS_NET_TYPE typedef unsigned long pbs_net_t; /* for holding host addresses */ #define PBS_NET_TYPE #endif /* PBS_NET_TYPE */ /* defines for job moving (see net_move() ) */ #define MOVE_TYPE_Move 1 /* Move by user request */ #define MOVE_TYPE_Route 2 /* Route from routing queue */ #define MOVE_TYPE_Exec 3 /* Execution (move to MOM) */ #define MOVE_TYPE_MgrMv 4 /* Mover by privileged user, a manager */ #define MOVE_TYPE_Order 5 /* qorder command by user */ /* * server initialization modes */ #define RECOV_HOT 0 /* restart prior running jobs */ #define RECOV_WARM 1 /* requeue/reschedule all jobs */ #define RECOV_COLD 2 /* discard all jobs */ #define RECOV_CREATE 4 /* discard all info */ #define RECOV_Invalid 5 #endif /* SERVER_LIMITS_H */ torque-2.4.16/src/include/work_task.h0000664000113300011330000001320211272401235014416 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: work_task.h 2367 2008-09-03 17:17:34Z josh $ */ /* * Server Work Tasks * * This structure is used by the server to track deferred work tasks. * * This information need not be preserved. * * Other Required Header Files * "list_link.h" */ #ifndef WORK_TASK_H #define WORK_TASK_H 1 enum work_type { WORK_Immed, /* immediate action: see state */ WORK_Timed, /* action at certain time */ WORK_Deferred_Child, /* On Death of a Child */ WORK_Deferred_Reply, /* On reply to an outgoing service request */ WORK_Deferred_Local, /* On reply to a local service request */ WORK_Deferred_Other, /* various other events */ WORK_Deferred_Cmp /* Never set directly, used to indicate that */ /* a WORK_Deferred_Child is ready */ }; struct work_task { list_link wt_linkall; /* link to event type work list */ list_link wt_linkobj; /* link to others of same object */ long wt_event; /* event id: time, pid, socket, ... */ enum work_type wt_type; /* type of event */ void (*wt_func) A_((struct work_task *)); /* function to perform task */ void *wt_parm1; /* obj pointer for use by func */ void *wt_parm2; /* optional pointer for use by func */ void (*wt_parmfunc) A_((struct work_task *)); /* used in reissue_to_svr to store wt_func */ int wt_aux; /* optional info: e.g. child status */ }; extern struct work_task *set_task A_((enum work_type, long event, void (*func)(), void *param)); extern void clear_task A_((struct work_task *ptask)); extern void dispatch_task A_((struct work_task *)); extern void delete_task A_((struct work_task *ptask)); #endif /* WORK_TASK_H */ torque-2.4.16/src/include/resmon.h0000664000113300011330000001226211272401235013722 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ struct rm_attribute { char *a_qualifier; char *a_value; }; /* ** The config structure is used to save a name to be used as a key ** for searching and a value or function call to provide an "answer" ** for the name in question. */ typedef char *(*confunc) A_((struct rm_attribute *)); struct config { char *c_name; union { confunc c_func; char *c_value; } c_u; }; #define RM_NPARM 32 /* max number of parameters for child */ #define RM_CMD_CLOSE 1 #define RM_CMD_REQUEST 2 #define RM_CMD_CONFIG 3 #define RM_CMD_SHUTDOWN 4 #define RM_RSP_OK 100 #define RM_RSP_ERROR 999 #define PBS_MAXSERVER 4 #define TMAX_NSDCOUNT 32 #define TMAX_RCDCOUNT 32 /* Checkpoint system type, return values from the mach_dep function mom_does_checkpoint. */ #define CST_NONE 0 /* There is no checkpointing in this environment/system. */ #define CST_MACH_DEP 1 /* Use the checkpointing system defined in the mom_mach code. */ #define CST_BLCR 2 /* Use the BLCR checkpointing system. */ /* ** Macros for fast min/max. */ #ifndef MIN #define MIN(a,b) (((a)<(b))?(a):(b)) #endif /* !MIN */ #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif torque-2.4.16/src/include/pbs_error_db.h0000664000113300011330000002462311272401235015065 00000000000000/** @file This file contains the database of PBS error ids and messages * * HOWTO USE THIS * * Add new error: * - choose the appropriate section (client errors, rm errors) * - add new line before the ceiling, the error will be automatically numbered * * Remove error: * - rewrite the error into a gap (PBSE_GAPxxx or PBSE_RMGAPxxx) with (char*)0 * as text part (see PBSE_GAP017 for example) * * Add new category: * - use the same structure for the new category * - create new name PbsErrSomething * - don't forget the ceiling and floor (and don't forget to give floor a value) * - create respective generators in pbs_error.h and pbs_messages.c * * @see pbs_error.h and pbs_messages.c for additional info * * @note NULL strings should be (const char*)0, but that is not possible right now */ #ifdef PbsErrClient /* pbs client errors floor (min_client_err - 1) */ PbsErrClient(PBSE_FLOOR = 15000, "no error") /* also works as no error */ /* Unknown Job Identifier */ PbsErrClient(PBSE_UNKJOBID, "Unknown Job Id") /* Undefined Attribute */ PbsErrClient(PBSE_NOATTR, "Undefined attribute ") /* attempt to set READ ONLY attribute */ PbsErrClient(PBSE_ATTRRO, "Cannot set attribute, read only or insufficient permission ") /* Invalid request */ PbsErrClient(PBSE_IVALREQ, "Invalid request") /* Unknown batch request */ PbsErrClient(PBSE_UNKREQ, "Unknown request") /* Too many submit retries */ PbsErrClient(PBSE_TOOMANY, "Too many submit retries") /* No permission */ PbsErrClient(PBSE_PERM, "Unauthorized Request ") /* access from host not allowed */ PbsErrClient(PBSE_BADHOST, "Access from host not allowed, or unknown host") /* job already exists */ PbsErrClient(PBSE_JOBEXIST, "Job with requested ID already exists") /* system error occurred */ PbsErrClient(PBSE_SYSTEM, " System error: ") /* = 15010 */ /* internal server error occurred */ PbsErrClient(PBSE_INTERNAL, "PBS server internal error") /* parent job of dependent in rte que */ PbsErrClient(PBSE_REGROUTE, "Dependent parent job currently in routing queue") /* unknown signal name */ PbsErrClient(PBSE_UNKSIG, "Unknown/illegal signal name") /* bad attribute value */ PbsErrClient(PBSE_BADATVAL, "Illegal attribute or resource value for ") /* Cannot modify attrib in run state */ PbsErrClient(PBSE_MODATRRUN, "Cannot modify attribute while job running ") /* request invalid for job state */ PbsErrClient(PBSE_BADSTATE, "Request invalid for state of job") /* gap filler */ PbsErrClient(PBSE_GAP017, (char*)0) /* Unknown queue name */ PbsErrClient(PBSE_UNKQUE, "Unknown queue") /* Invalid Credential in request */ PbsErrClient(PBSE_BADCRED, "Invalid credential") /* Expired Credential in request */ PbsErrClient(PBSE_EXPIRED, "Expired credential") /* = 15020 */ /* Queue not enabled */ PbsErrClient(PBSE_QUNOENB, "Queue is not enabled") /* No access permission for queue */ PbsErrClient(PBSE_QACESS, "Access to queue is denied") /* Bad user - no password entry */ PbsErrClient(PBSE_BADUSER, "Bad UID for job execution") /* Max hop count exceeded */ PbsErrClient(PBSE_HOPCOUNT, "Job routing over too many hops") /* Queue already exists */ PbsErrClient(PBSE_QUEEXIST, "Queue already exists") /* incompatable queue attribute type */ PbsErrClient(PBSE_ATTRTYPE, "Incompatible type") /* Queue Busy (not empty) */ PbsErrClient(PBSE_QUEBUSY, "Cannot delete busy queue") /* Queue name too long */ PbsErrClient(PBSE_QUENBIG, "Queue name too long") /* Feature/function not supported */ PbsErrClient(PBSE_NOSUP, "No support for requested service") /* Cannot enable queue,needs add def */ PbsErrClient(PBSE_QUENOEN, "Cannot enable queue, incomplete definition")/* = 15030 */ /* Protocol error */ PbsErrClient(PBSE_PROTOCOL, "Batch protocol error") /* Bad attribute list structure */ PbsErrClient(PBSE_BADATLST, "Bad attribute list structure") /* No free connections */ PbsErrClient(PBSE_NOCONNECTS, "No free connections") /* No server to connect to */ PbsErrClient(PBSE_NOSERVER, "No server specified") /* Unknown resource */ PbsErrClient(PBSE_UNKRESC, "Unknown resource type ") /* Job exceeds Queue resource limits */ PbsErrClient(PBSE_EXCQRESC, "Job exceeds queue resource limits") /* No Default Queue Defined */ PbsErrClient(PBSE_QUENODFLT, "No default queue specified") /* Job Not Rerunnable */ PbsErrClient(PBSE_NORERUN, "job is not rerunnable") /* Route rejected by all destinations */ PbsErrClient(PBSE_ROUTEREJ, "Job rejected by all possible destinations") /* Time in Route Queue Expired */ PbsErrClient(PBSE_ROUTEEXPD, "Time in Route Queue Expired") /* = 15040 */ /* Request to MOM failed */ PbsErrClient(PBSE_MOMREJECT, "Execution server rejected request") /* (qsub) cannot access script file */ PbsErrClient(PBSE_BADSCRIPT, "(qsub) cannot access script file") /* Stage In of files failed */ PbsErrClient(PBSE_STAGEIN, "Stage In of files failed") /* Resources temporarily unavailable */ PbsErrClient(PBSE_RESCUNAV, "Resource temporarily unavailable") /* Bad Group specified */ PbsErrClient(PBSE_BADGRP, "Bad GID for job execution") /* Max number of jobs in queue */ PbsErrClient(PBSE_MAXQUED, "Maximum number of jobs already in queue") /* Checkpoint Busy, may be retries */ PbsErrClient(PBSE_CKPBSY, "Checkpoint busy, may retry") /* Limit exceeds allowable */ PbsErrClient(PBSE_EXLIMIT, "Resource limit exceeds allowable") /* Bad Account attribute value */ PbsErrClient(PBSE_BADACCT, "Invalid Account") /* Job already in exit state */ PbsErrClient(PBSE_ALRDYEXIT, "Job already in exit state") /* = 15050 */ /* Job files not copied */ PbsErrClient(PBSE_NOCOPYFILE, "Job files not copied") /* unknown job id after clean init */ PbsErrClient(PBSE_CLEANEDOUT, "unknown job id after clean init") /* No Master in Sync Set */ PbsErrClient(PBSE_NOSYNCMSTR, "No master found for sync job set") /* Invalid dependency */ PbsErrClient(PBSE_BADDEPEND, "Invalid Job Dependency") /* Duplicate entry in List */ PbsErrClient(PBSE_DUPLIST, "Duplicate entry in list ") /* Bad DIS based Request Protocol */ PbsErrClient(PBSE_DISPROTO, "Bad DIS based Request Protocol") /* cannot execute there */ PbsErrClient(PBSE_EXECTHERE, "Cannot execute at specified host because of checkpoint or stagein files") /* sister rejected */ PbsErrClient(PBSE_SISREJECT, "sister rejected") /* sister could not communicate */ PbsErrClient(PBSE_SISCOMM, "sister could not communicate") /* req rejected -server shutting down */ PbsErrClient(PBSE_SVRDOWN, "Request not allowed: Server shutting down") /* = 15060 */ /* not all tasks could checkpoint */ PbsErrClient(PBSE_CKPSHORT, "not all tasks could checkpoint") /* Named node is not in the list */ PbsErrClient(PBSE_UNKNODE, "Unknown node ") /* node-attribute not recognized */ PbsErrClient(PBSE_UNKNODEATR, "Unknown node-attribute ") /* Server has no node list */ PbsErrClient(PBSE_NONODES, "Server has no node list") /* Node name is too big */ PbsErrClient(PBSE_NODENBIG, "Node name is too big") /* Node name already exists */ PbsErrClient(PBSE_NODEEXIST, "Node name already exists") /* Bad node-attribute value */ PbsErrClient(PBSE_BADNDATVAL, "Illegal value for ") /* State values are mutually exclusive */ PbsErrClient(PBSE_MUTUALEX, "Mutually exclusive values for ") /* Error(s) during global modification of nodes */ PbsErrClient(PBSE_GMODERR, "Modification failed for ") /* could not contact Mom */ PbsErrClient(PBSE_NORELYMOM, "Server could not connect to MOM") /* = 15070 */ /* no time-shared nodes */ PbsErrClient(PBSE_NOTSNODE, "No time-share node available") /* wrong job type (batch or interactive) */ PbsErrClient(PBSE_JOBTYPE, "Wrong job type") /* bad entry in ACL host list */ PbsErrClient(PBSE_BADACLHOST, "Bad ACL entry in host list") /* max number of jobs queued for user */ PbsErrClient(PBSE_MAXUSERQUED, "Maximum number of jobs already in queue for user") /* bad type in disallowed_types queue attribute */ PbsErrClient(PBSE_BADDISALLOWTYPE, "Bad type in disallowed_types list") /* interactive jobs not allowed in queue */ PbsErrClient(PBSE_NOINTERACTIVE, "Queue does not allow interactive jobs") /* batch jobs not allowed in queue */ PbsErrClient(PBSE_NOBATCH, "Queue does not allow batch jobs") /* rerunable jobs not allowed in queue */ PbsErrClient(PBSE_NORERUNABLE, "Queue does not allow rerunable jobs") /* nonrerunable jobs not allowed in queue */ PbsErrClient(PBSE_NONONRERUNABLE, "Queue does not allow nonrerunable jobs") /* unknown array id */ PbsErrClient(PBSE_UNKARRAYID, "Unknown Array ID") /* = 15080 */ /* bad array request */ PbsErrClient(PBSE_BAD_ARRAY_REQ, "Bad Job Array Request") /* Time out */ PbsErrClient(PBSE_TIMEOUT, "Time out") /* fault tolerant jobs not allowed in queue */ PbsErrClient(PBSE_NOFAULTTOLERANT, "Queue does not allow fault tolerant jobs") /* only fault tolerant jobs allowed in queue */ PbsErrClient(PBSE_NOFAULTINTOLERANT, "Queue does not allow fault intolerant jobs") PbsErrClient(PBSE_NOJOBARRAYS, "Queue does not allow job arrays") /* pbs client errors ceiling (max_client_err + 1) */ PbsErrClient(PBSE_CEILING, (char*)0) #endif #ifdef PbsErrRm /* pbs rm errors floor (min_rm_err - 1) */ PbsErrRm(PBSE_RMFLOOR = 15200, (char*)0) /* resource unknown */ PbsErrRm(PBSE_RMUNKNOWN, "resource unknown") /* parameter could not be used */ PbsErrRm(PBSE_RMBADPARAM, "parameter could not be used") /* a parameter needed did not exist */ PbsErrRm(PBSE_RMNOPARAM, "a parameter needed did not exist") /* something specified didn't exist */ PbsErrRm(PBSE_RMEXIST, "something specified didn't exist") /* a system error occured */ PbsErrRm(PBSE_RMSYSTEM, "a system error occured") /* only part of reservation made */ PbsErrRm(PBSE_RMPART, "only part of reservation made") /* pbs rm errors ceiling (max_rm_err + 1) */ PbsErrRm(PBSE_RMCEILING, (char*)0) #endif torque-2.4.16/src/include/pbs_cpa.h0000664000113300011330000000050111272401235014017 00000000000000#ifndef PBS_CPA_H #define PBS_CPA_H 1 #include "pbs_job.h" int CPACreatePartition(job *pjob, struct var_table *vtab); int CPADestroyPartition(job *pjob); int CPASetJobEnv( unsigned long ParID, /* I */ unsigned long AllocCookie, /* I */ char *JobID) /* I */ ; #endif /* PBS_CPA_H */ torque-2.4.16/src/include/utils.h0000664000113300011330000001326411272401235013562 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #ifndef UTILS_H #define UTILS_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "portability.h" #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "pbs_nodes.h" #include "libpbs.h" #include "pbs_ifl.h" #include "resource.h" #include "svrfunc.h" #include "pbs_error.h" #include "log.h" #include "mcom.h" /* Function declarations */ /* group functions in u_groups.c */ extern struct group *getgrnam_ext A_((char *)); /* tree functions in u_tree.c */ extern void tinsert A_((const u_long, struct pbsnode *, tree **)); extern void *tdelete A_((const u_long, tree **)); extern struct pbsnode *tfind A_((const u_long, tree **)); extern int tlist A_((tree *, char *, int)); extern void tfree A_((tree **)); /* moab-like utility functions in u_mu.c */ extern int MUSNPrintF A_((char **, int *, char *, ...)); extern int MUStrNCat A_((char **, int *, char *)); extern int MUSleep A_((long)); extern int MUReadPipe A_((char *, char *, int)); /* MXML functions from u_MXML.c */ extern int MXMLGetChild A_((mxml_t *, char *, int *, mxml_t **)); extern int MXMLAddE A_((mxml_t *, mxml_t *)); extern int MXMLGetAttrF A_((mxml_t *, char *, int *, void *, enum MDataFormatEnum, int)); extern int MXMLGetAttr A_((mxml_t *, char *, int *, char *, int)); extern int MXMLToString A_((mxml_t *, char *, int, char **, mbool_t)); #endif /* END #ifndef UTILS_H */ torque-2.4.16/src/include/Long_.h0000664000113300011330000001022211272401235013447 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: Long_.h 2367 2008-09-03 17:17:34Z josh $ */ #include extern int Long_neg; extern const char Long_dig[]; torque-2.4.16/src/include/array.h0000664000113300011330000000317711272401235013542 00000000000000#ifndef ARRAY_H #define ARRAY_H /* these are required if you include array.h */ #include "pbs_ifl.h" #include "log.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "pbs_error.h" #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif #define ARRAY_FILE_SUFFIX ".AR" typedef struct { list_link request_tokens_link; int start; int end; } array_request_node; #define ARRAY_QS_STRUCT_VERSION 2 /* pbs_server will keep a list of these structs, with one struct per job array*/ struct job_array { list_link all_arrays; /* node in server's linked list of all arrays */ tlist_head array_alljobs; /* head of linked list of all jobs in this array */ tlist_head request_tokens; /* head of linked list of request tokens, used during cloning */ int jobs_recovered; /* on server restart we track the number of array tasks that have been recovered */ /* this info is saved in the array file */ struct array_info { int struct_version; int array_size; int num_cloned; /* max user name, server name, 1 for the @, and one for the NULL */ char owner[PBS_MAXUSER + PBS_MAXSERVERNAME + 2]; char parent_id[PBS_MAXSVRJOBID + 1]; char fileprefix[PBS_JOBBASE + 1]; char submit_host[PBS_MAXSERVERNAME +1]; } ai_qs; }; typedef struct job_array job_array; int is_array(char *id); int array_delete(job_array *pa); int array_save(job_array *); int array_save(job_array *pa); void array_get_parent_id(char *job_id, char *parent_id); job_array *get_array(char *id); job_array *array_recov(char *path); #endif torque-2.4.16/src/include/pbs_ifl.h0000664000113300011330000005231611375011546014047 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * pbs_ifl.h * */ #ifndef _PBS_IFL_DEF #define _PBS_IFL_DEF #ifdef __STDC__ /* * The following macro definations take affect when compiling under ansi C * * The A_ macro is provided for function prototype declarations. It allows * ANSI C prototypes to be complied under K&R C */ #define A_(x) x #else /* The following macro definations take affect when compiling under K&R C */ #define A_(x) () #define const #define volatile #endif /* __STDC__ */ /* Attribute Names used by user commands */ #define ATTR_a "Execution_Time" #define ATTR_c "Checkpoint" #define ATTR_e "Error_Path" #define ATTR_f "fault_tolerant" #define ATTR_g "group_list" #define ATTR_h "Hold_Types" #define ATTR_j "Join_Path" #define ATTR_k "Keep_Files" #define ATTR_l "Resource_List" #define ATTR_m "Mail_Points" #define ATTR_o "Output_Path" #define ATTR_p "Priority" #define ATTR_q "destination" #define ATTR_r "Rerunable" #define ATTR_t "job_array_request" #define ATTR_array_id "job_array_id" #define ATTR_u "User_List" #define ATTR_v "Variable_List" #define ATTR_A "Account_Name" #define ATTR_M "Mail_Users" #define ATTR_N "Job_Name" #define ATTR_S "Shell_Path_List" #define ATTR_depend "depend" #define ATTR_inter "interactive" #define ATTR_stagein "stagein" #define ATTR_stageout "stageout" #define ATTR_jobtype "jobtype" /* additional job and general attribute names */ #define ATTR_ctime "ctime" #define ATTR_exechost "exec_host" #define ATTR_mtime "mtime" #define ATTR_qtime "qtime" #define ATTR_session "session_id" #define ATTR_euser "euser" #define ATTR_egroup "egroup" #define ATTR_hashname "hashname" #define ATTR_hopcount "hop_count" #define ATTR_security "security" #define ATTR_sched_hint "sched_hint" #define ATTR_substate "substate" #define ATTR_name "Job_Name" #define ATTR_owner "Job_Owner" #define ATTR_used "resources_used" #define ATTR_state "job_state" #define ATTR_queue "queue" #define ATTR_server "server" #define ATTR_maxrun "max_running" #define ATTR_maxreport "max_report" #define ATTR_total "total_jobs" #define ATTR_comment "comment" #define ATTR_cookie "cookie" #define ATTR_qrank "queue_rank" #define ATTR_altid "alt_id" #define ATTR_etime "etime" #define ATTR_exitstat "exit_status" #define ATTR_forwardx11 "forward_x11" #define ATTR_submit_args "submit_args" #define ATTR_tokens "tokens" #define ATTR_netcounter "net_counter" #define ATTR_umask "umask" #define ATTR_start_time "start_time" #define ATTR_start_count "start_count" #define ATTR_checkpoint_dir "checkpoint_dir" /* user specified directory for checkpoint files */ #define ATTR_checkpoint_name "checkpoint_name" /* user specified name of checkpoint file */ #define ATTR_checkpoint_time "checkpoint_time" /* timestamp of start of last checkpoint */ #define ATTR_checkpoint_restart_status "checkpoint_restart_status" /* checkpoint restart status */ #define ATTR_restart_name "restart_name" /* saved name of checkpoint restart file */ #define ATTR_comp_time "comp_time" #define ATTR_reported "reported" #define ATTR_intcmd "inter_cmd" #define ATTR_P "proxy_user" #ifdef USEJOBCREATE #define ATTR_pagg "pagg_id" #endif /* USEJOBCREATE */ /* additional queue attributes names */ #define ATTR_aclgren "acl_group_enable" #define ATTR_aclgroup "acl_groups" #define ATTR_aclhten "acl_host_enable" #define ATTR_aclhost "acl_hosts" #define ATTR_acluren "acl_user_enable" #define ATTR_acluser "acl_users" #define ATTR_altrouter "alt_router" #define ATTR_checkpoint_min "checkpoint_min" #define ATTR_enable "enabled" #define ATTR_fromroute "from_route_only" #define ATTR_hostlist "hostlist" /* TORQUE only */ #define ATTR_killdelay "kill_delay" #define ATTR_maxgrprun "max_group_run" #define ATTR_maxque "max_queuable" #define ATTR_maxuserque "max_user_queuable" #define ATTR_maxuserrun "max_user_run" #define ATTR_qtype "queue_type" #define ATTR_rescassn "resources_assigned" #define ATTR_rescdflt "resources_default" #define ATTR_rescmax "resources_max" #define ATTR_rescmin "resources_min" #define ATTR_rerunnable "restartable" /* TORQUE only */ #define ATTR_rndzretry "rendezvous_retry" #define ATTR_routedest "route_destinations" #define ATTR_routeheld "route_held_jobs" #define ATTR_routewait "route_waiting_jobs" #define ATTR_routeretry "route_retry_time" #define ATTR_routelife "route_lifetime" #define ATTR_rsvexpdt "reserved_expedite" #define ATTR_rsvsync "reserved_sync" #define ATTR_start "started" #define ATTR_count "state_count" #define ATTR_number "number_jobs" #define ATTR_acllogic "acl_logic_or" #define ATTR_aclgrpslpy "acl_group_sloppy" #define ATTR_keepcompleted "keep_completed" #define ATTR_disallowedtypes "disallowed_types" #define ATTR_is_transit "is_transit" /* additional server attributes names */ /* NOTE: steps for adding new attribute described in ??? */ /* - create #define ATTR_* in include/pbs_ifl.h - insert SRV_ATR_* in include/server.h - add ATTR_* in include/qmgr_svr_public.h - insert structure in server/svr_attr_def.c NOTE: structure must be in same relative position as SRV_ATR_* - insert usage code in proper location */ #define ATTR_aclroot "acl_roots" #define ATTR_managers "managers" #define ATTR_dfltque "default_queue" #define ATTR_dispsvrsuffix "display_job_server_suffix" #define ATTR_jobsuffixalias "job_suffix_alias" #define ATTR_defnode "default_node" #define ATTR_locsvrs "location_servers" #define ATTR_logevents "log_events" #define ATTR_logfile "log_file" #define ATTR_loglevel "log_level" #define ATTR_mailfrom "mail_from" #define ATTR_nodepack "node_pack" #define ATTR_nodesuffix "node_suffix" #define ATTR_operators "operators" #define ATTR_queryother "query_other_jobs" #define ATTR_resccost "resources_cost" #define ATTR_rescavail "resources_available" #define ATTR_schedit "scheduler_iteration" #define ATTR_scheduling "scheduling" #define ATTR_status "server_state" #define ATTR_syscost "system_cost" #define ATTR_pingrate "node_ping_rate" #define ATTR_ndchkrate "node_check_rate" #define ATTR_tcptimeout "tcp_timeout" #define ATTR_jobstatrate "job_stat_rate" #define ATTR_polljobs "poll_jobs" #define ATTR_downonerror "down_on_error" #define ATTR_disableserveridcheck "disable_server_id_check" #define ATTR_jobnanny "job_nanny" #define ATTR_ownerpurge "owner_purge" #define ATTR_qcqlimits "queue_centric_limits" #define ATTR_momjobsync "mom_job_sync" #define ATTR_maildomain "mail_domain" #define ATTR_pbsversion "pbs_version" #define ATTR_submithosts "submit_hosts" #define ATTR_allownodesubmit "allow_node_submit" #define ATTR_allowproxyuser "allow_proxy_user" #define ATTR_autonodenp "auto_node_np" #define ATTR_servername "server_name" #define ATTR_logfilemaxsize "log_file_max_size" #define ATTR_logfilerolldepth "log_file_roll_depth" #define ATTR_logkeepdays "log_keep_days" #define ATTR_nextjobnum "next_job_number" #define ATTR_extraresc "extra_resc" #define ATTR_schedversion "sched_version" #define ATTR_acctkeepdays "accounting_keep_days" #define ATTR_lockfile "lock_file" #define ATTR_credentiallifetime "credential_lifetime" #define ATTR_jobmustreport "job_must_report" #define ATTR_LockfileUpdateTime "lock_file_update_time" #define ATTR_LockfileCheckTime "lock_file_check_time" #define ATTR_npdefault "np_default" #define ATTR_jobstarttimeout "job_start_timeout" #define ATTR_jobforcecanceltime "job_force_cancel_time" /* additional node "attributes" names */ #define ATTR_NODE_state "state" #define ATTR_NODE_np "np" #define ATTR_NODE_properties "properties" #define ATTR_NODE_ntype "ntype" #define ATTR_NODE_jobs "jobs" #define ATTR_NODE_status "status" #define ATTR_NODE_note "note" /* notification email formating */ #define ATTR_mailsubjectfmt "mail_subject_fmt" #define ATTR_mailbodyfmt "mail_body_fmt" /* various attribute values */ #define CHECKPOINT_UNSPECIFIED "u" #define NO_HOLD "n" #define NO_JOIN "n" #define NO_KEEP "n" #define MAIL_AT_ABORT "a" #define DELDELAY "deldelay=" /* see qdel.c */ #define DELPURGE "delpurge=" /* see qdel.c */ #define PURGECOMP "purgecomplete=" /* see req_delete.c */ #define EXECQUEONLY "exec_queue_only" /* see req_stat.c */ #define RERUNFORCE "force" #define USER_HOLD "u" #define OTHER_HOLD "o" #define SYSTEM_HOLD "s" /* node-attribute values (state,ntype) */ #define ND_free "free" #define ND_offline "offline" #define ND_down "down" #define ND_reserve "reserve" #define ND_job_exclusive "job-exclusive" #define ND_job_sharing "job-sharing" #define ND_busy "busy" #define ND_state_unknown "state-unknown" #define ND_timeshared "time-shared" #define ND_cluster "cluster" /* queue disallowed types */ #define Q_DT_batch "batch" #define Q_DT_interactive "interactive" #define Q_DT_rerunable "rerunable" #define Q_DT_nonrerunable "nonrerunable" #define Q_DT_fault_tolerant "fault_tolerant" #define Q_DT_fault_intolerant "fault_intolerant" #define Q_DT_job_array "job_array" /*constant related to sum of string lengths for above strings*/ #define MAX_ENCODE_BFR 100 #define MGR_CMD_CREATE 0 #define MGR_CMD_DELETE 1 #define MGR_CMD_SET 2 #define MGR_CMD_UNSET 3 #define MGR_CMD_LIST 4 #define MGR_CMD_PRINT 5 #define MGR_CMD_ACTIVE 6 #define MGR_OBJ_NONE -1 #define MGR_OBJ_SERVER 0 #define MGR_OBJ_QUEUE 1 #define MGR_OBJ_JOB 2 #define MGR_OBJ_NODE 3 /* Misc defines for various requests */ #define MSG_OUT 1 #define MSG_ERR 2 #define SHUT_SIG -1 #define SHUT_IMMEDIATE 0 #define SHUT_DELAY 1 #define SHUT_QUICK 2 #define SIG_RESUME "resume" #define SIG_SUSPEND "suspend" /* WARNING: be careful changing these PBS_MAX* values. They can result in a change in the structure of the .JB file, and binary incompatibilities between versions of TORQUE. Do not change in a -fixes branch */ #define PBS_MAXHOSTNAME 1024 /* max host name length */ #ifndef MAXPATHLEN #define MAXPATHLEN 1024 /* max path name length */ #endif #ifndef MAXNAMLEN #define MAXNAMLEN 255 #endif #define MAX_NOTE 256 /* max node note length */ #define MAX_NOTE_STR "256" /* max node note length as a string literal (this MUST match MAX_NOTE) */ #define PBS_MAXUSER 32 /* max user name length */ #define PBS_MAXGRPN 16 /* max group name length */ #define PBS_MAXQUEUENAME 15 /* max queue name length */ #define PBS_MAXSERVERNAME PBS_MAXHOSTNAME /* max server name length */ #define PBS_MAXJOBARRAYLEN 6 /* number of characters allowed in jobarray portion of job id, including '-' */ #define PBS_MAXSEQNUM 8 /* max sequence number length */ #define PBS_MAXPORTNUM 5 /* udp/tcp port numbers max=16 bits */ #define PBS_MAXJOBARRAY 99999 #define PBS_MAXSVRJOBID (PBS_MAXSEQNUM + PBS_MAXSERVERNAME + PBS_MAXPORTNUM + PBS_MAXJOBARRAYLEN + 2 ) /* server job id size */ #define PBS_MAXCLTJOBID (PBS_MAXSVRJOBID + PBS_MAXSERVERNAME + PBS_MAXPORTNUM + PBS_MAXJOBARRAYLEN + 2) /* client job id size */ #define PBS_MAXDEST 1024 /* destination size -- increased from 256 */ #define PBS_MAXROUTEDEST (PBS_MAXQUEUENAME + PBS_MAXSERVERNAME + PBS_MAXPORTNUM + 2) /* destination size */ #define PBS_USE_IFF 1 /* pbs_connect() to call pbs_iff */ #define PBS_INTERACTIVE 1 /* Support of Interactive jobs */ #define PBS_TERM_BUF_SZ 80 /* Interactive term buffer size */ #define PBS_TERM_CCA 6 /* Interactive term cntl char array */ /* constants used to indicate version of job ji_qs struct written to disk. starting with 2.4.0 we stopped encoding the torque version number into the hex value e.g. 0x00020300 for torque v2.3.0. Now we just increment a value which is added to the last version encoded that way */ #define PBS_QS_VERSION_BASE 0x00020300 /* magic number do not change */ #define PBS_QS_VERSION_INT 1 /* increment this version number with every change to the ji_qs struct */ #define PBS_QS_VERSION (PBS_QS_VERSION_BASE + PBS_QS_VERSION_INT) /* version number saved in the ji_qs struct */ /* someday the PBS_*_PORT definition will go away and only the */ /* PBS_*_SERVICE_NAME form will be used, maybe */ #define PBS_BATCH_SERVICE_NAME "pbs" #ifndef PBS_BATCH_SERVICE_PORT #define PBS_BATCH_SERVICE_PORT 15001 #endif /* PBS_BATCH_SERVICE_PORT */ #define PBS_BATCH_SERVICE_NAME_DIS "pbs_dis" /* new DIS port */ #ifndef PBS_BATCH_SERVICE_PORT_DIS #define PBS_BATCH_SERVICE_PORT_DIS 15001 /* new DIS port */ #endif /* PBS_BATCH_SERVICE_PORT_DIS */ #define PBS_MOM_SERVICE_NAME "pbs_mom" #ifndef PBS_MOM_SERVICE_PORT #define PBS_MOM_SERVICE_PORT 15002 #endif /* PBS_MOM_SERVICE_PORT */ #define PBS_MANAGER_SERVICE_NAME "pbs_resmon" #ifndef PBS_MANAGER_SERVICE_PORT #define PBS_MANAGER_SERVICE_PORT 15003 #endif /* PBS_MANAGER_SERVICE_PORT */ #define PBS_SCHEDULER_SERVICE_NAME "pbs_sched" #ifndef PBS_SCHEDULER_SERVICE_PORT #define PBS_SCHEDULER_SERVICE_PORT 15004 #endif /* PBS_SCHEDULER_SERVICE_PORT */ /* * Other misc checkpoint defines */ #define CHECKPOINTHOLD "checkpoint_hold" #define CHECKPOINTCONT "checkpoint_cont" #define MOM_DEFAULT_CHECKPOINT_DIR "$MOMDEFAULTCHECKPOINTDIR$" enum batch_op { SET, UNSET, INCR, DECR, EQ, NE, GE, GT, LE, LT, DFLT, MERGE }; /* ** This structure is identical to attropl so they can be used ** interchangably. The op field is not used. */ struct attrl { struct attrl *next; char *name; char *resource; char *value; enum batch_op op; /* not used */ }; struct attropl { struct attropl *next; char *name; char *resource; char *value; enum batch_op op; }; struct batch_status { struct batch_status *next; char *name; struct attrl *attribs; char *text; }; /* Resource Reservation Information */ typedef int resource_t; /* resource reservation handle */ #define RESOURCE_T_NULL (resource_t)0 #define RESOURCE_T_ALL (resource_t)-1 extern int pbs_errno; /* error number */ extern char *pbs_server; /* server attempted to connect | connected to */ /* see pbs_connect(3B) */ extern char *avail A_((int connect, char *resc)); extern int pbs_asyrunjob A_((int c, char *jobid, char *location, char *extend)); extern int pbs_alterjob_async A_((int connect, char *job_id, struct attrl *attrib, char *extend)); extern int pbs_alterjob A_((int connect, char *job_id, struct attrl *attrib, char *extend)); extern int pbs_connect A_((char *server)); extern int pbs_query_max_connections(); extern char *pbs_default A_((void)); extern char *pbs_fbserver A_((void)); extern char *pbs_get_server_list A_((void)); extern int pbs_deljob A_((int connect, char *job_id, char *extend)); extern int pbs_disconnect A_((int connect)); extern char *pbs_geterrmsg A_((int connect)); extern int pbs_holdjob A_((int connect, char *job_id, char *hold_type, char *extend)); extern int pbs_checkpointjob A_((int connect, char *job_id, char *extend)); extern char *pbs_locjob A_((int connect, char *job_id, char *extend)); extern int pbs_manager A_((int connect, int command, int obj_type, char *obj_name, struct attropl *attrib, char *extend)); extern int pbs_movejob A_((int connect, char *job_id, char *destination, char *extend)); extern int pbs_msgjob A_((int connect, char *job_id, int file, char *message, char *extend)); extern int pbs_orderjob A_((int connect, char *job1, char *job2, char *extend)); extern int pbs_rescquery A_((int connect, char **rlist, int nresc, int *avail, int *alloc, int *resv, int *down)); extern int pbs_rescreserve A_((int connect, char **rlist, int nresc, resource_t *phandle)); extern int pbs_rescrelease A_((int connect, resource_t rhandle)); extern int pbs_rerunjob A_((int connect, char *job_id, char *extend)); extern int pbs_rlsjob A_((int connect, char *job_id, char *hold_type, char *extend)); extern int pbs_runjob A_((int connect, char *jobid, char *loc, char *extend)); extern char ** pbs_selectjob A_((int connect, struct attropl *select_list, char *extend)); extern int pbs_sigjob A_((int connect, char *job_id, char *signal, char *extend)); extern int pbs_sigjobasync A_((int connect, char *job_id, char *signal, char *extend)); extern void pbs_statfree A_((struct batch_status *stat)); extern struct batch_status * pbs_statdest A_((int connect, char *id, char *extend)); extern struct batch_status * pbs_statjob A_((int connect, char *id, struct attrl *attrib, char *extend)); extern struct batch_status * pbs_selstat A_((int connect, struct attropl *select_list, char *extend)); extern struct batch_status * pbs_statque A_((int connect, char *id, struct attrl *attrib, char *extend)); extern struct batch_status * pbs_statserver A_((int connect, struct attrl *attrib, char *extend)); extern struct batch_status * pbs_statnode A_((int connect, char *id, struct attrl *attrib, char *extend)); extern char * pbs_submit A_((int connect, struct attropl *attrib, char *script, char *destination, char *extend)); extern int pbs_terminate A_((int connect, int manner, char *extend)); extern int totpool A_((int connect, int update)); extern int usepool A_((int connect, int update)); #endif /* _PBS_IFL_DEF */ /* end of pbs_ifl.h */ torque-2.4.16/src/include/site_svr_attr_enum.ht0000664000113300011330000001051211272401235016513 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: site_svr_attr_enum.ht 12 2005-02-22 20:59:54Z dev $ */ /* * Place holder for site supplied additions to the server's enumerated * list of attributes, see server.h. * * List should be of the form: * SVR_SITE_ATR_name, * * Matching entry must be added in site_sv_attr_def.h */ torque-2.4.16/src/include/qmgr_que_public.h0000664000113300011330000001163311272401235015576 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * This is a list of public queue attributes * * FORMAT: * attr1, * attr2, <--- important the last has a comma after it * * This file will be used for the initialization of an array * * @see que_public_attrs[] in cmds/qmgr.c */ ATTR_aclgren, ATTR_aclgroup, ATTR_aclhten, ATTR_aclhost, ATTR_acluren, ATTR_acluser, ATTR_checkpoint_dir, ATTR_checkpoint_min, ATTR_enable, ATTR_fromroute, ATTR_killdelay, ATTR_maxque, ATTR_maxuserque, ATTR_maxgrprun, ATTR_maxreport, ATTR_maxrun, ATTR_maxuserrun, ATTR_p, ATTR_qtype, ATTR_rescavail, ATTR_rescdflt, ATTR_rescmax, ATTR_rescmin, ATTR_rerunnable, ATTR_rndzretry, ATTR_routedest, ATTR_altrouter, ATTR_routeheld, ATTR_routewait, ATTR_routeretry, ATTR_routelife, ATTR_rsvexpdt, ATTR_rsvsync, ATTR_start, ATTR_acllogic, /* contributed by USC */ ATTR_aclgrpslpy, ATTR_keepcompleted, ATTR_disallowedtypes, ATTR_hostlist, ATTR_rerunnable, ATTR_is_transit, torque-2.4.16/src/include/qmgr_svr_public.h0000664000113300011330000001272711455674146015643 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * This is a list of public server attributes * * FORMAT: * attr1, * attr2, <--- important the last has a comma after it * * This file will be used for the initialization of an array * */ /* sync w/SRV_ATR_* in server.h, server/svr_attr_def.c, and ATTR_* in pbs_ifl.h */ ATTR_aclhten, ATTR_aclhost, ATTR_acluren, ATTR_acluser, ATTR_aclroot, ATTR_comment, ATTR_defnode, ATTR_dfltque, ATTR_locsvrs, ATTR_logevents, ATTR_loglevel, ATTR_managers, ATTR_mailfrom, ATTR_maxrun, ATTR_maxuserrun, ATTR_maxgrprun, ATTR_nodepack, ATTR_nodesuffix, ATTR_operators, ATTR_queryother, ATTR_rescavail, ATTR_resccost, ATTR_rescdflt, ATTR_rescmax, ATTR_schedit, ATTR_scheduling, ATTR_syscost, ATTR_pingrate, ATTR_ndchkrate, ATTR_tcptimeout, ATTR_jobstatrate, ATTR_polljobs, ATTR_downonerror, ATTR_disableserveridcheck, ATTR_jobnanny, ATTR_ownerpurge, ATTR_qcqlimits, ATTR_momjobsync, ATTR_maildomain, ATTR_killdelay, ATTR_acllogic, ATTR_aclgrpslpy, ATTR_keepcompleted, ATTR_submithosts, ATTR_allownodesubmit, ATTR_allowproxyuser, ATTR_servername, ATTR_autonodenp, ATTR_logfilemaxsize, ATTR_logfilerolldepth, ATTR_logkeepdays, ATTR_nextjobnum, ATTR_tokens, ATTR_extraresc, ATTR_schedversion, ATTR_acctkeepdays, ATTR_lockfile, ATTR_LockfileUpdateTime, ATTR_LockfileCheckTime, ATTR_credentiallifetime, ATTR_jobmustreport, ATTR_checkpoint_dir, ATTR_dispsvrsuffix, ATTR_jobsuffixalias, ATTR_mailsubjectfmt, ATTR_mailbodyfmt, ATTR_npdefault, ATTR_jobstarttimeout, ATTR_jobforcecanceltime, torque-2.4.16/src/include/queue.h0000664000113300011330000001456011272401235013546 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * queue.h - structure definitions for queue objects * * Include Files Required: * * * "attribute.h" * "list_link.h" * "server_limits.h" * "resource.h" * * Queue Types */ #ifndef QUEUE_H #define QUEUE_H #define QTYPE_Unset 0 #define QTYPE_Execution 1 #define QTYPE_RoutePush 2 #define QTYPE_RoutePull 3 /** * Attributes, including the various resource-lists are maintained in an * array in a "decoded or parsed" form for quick access to the value. * * The following enum defines the index into the array. * * @see src/server/queue_attr_def.c */ enum queueattr { QA_ATR_QType, QA_ATR_Priority, QA_ATR_Hostlist, QA_ATR_Rerunnable, QA_ATR_MaxJobs, QA_ATR_MaxUserJobs, QA_ATR_TotalJobs, QA_ATR_JobsByState, QA_ATR_MaxReport, QA_ATR_MaxRun, QA_ATR_AclHostEnabled, QA_ATR_AclHost, QA_ATR_AclUserEnabled, QA_ATR_AclUsers, QA_ATR_FromRouteOnly, QA_ATR_ResourceMax, QA_ATR_ResourceMin, QA_ATR_ResourceDefault, QA_ATR_AclGroupEnabled, QA_ATR_AclGroup, /* 19 */ QA_ATR_AclLogic, QA_ATR_AclGroupSloppy, QA_ATR_MTime, QA_ATR_DisallowedTypes, /* The following attributes apply only to execution queues */ QE_ATR_checkpoint_dir, QE_ATR_checkpoint_min, QE_ATR_RendezvousRetry, QE_ATR_ReservedExpedite, QE_ATR_ReservedSync, QE_ATR_ResourceAvail, QE_ATR_ResourceAssn, QE_ATR_KillDelay, QE_ATR_MaxUserRun, QE_ATR_MaxGrpRun, QE_ATR_KeepCompleted, QE_ATR_is_transit, /* The following attribute apply only to routing queues... */ QR_ATR_RouteDestin, QR_ATR_AltRouter, QR_ATR_RouteHeld, QR_ATR_RouteWaiting, QR_ATR_RouteRetryTime, QR_ATR_RouteLifeTime, #include "site_que_attr_enum.h" QA_ATR_Enabled, /* these are last for qmgr print function */ QA_ATR_Started, QA_ATR_LAST}; /* WARNING: Must be the highest valued enum */ extern attribute_def que_attr_def[]; #define QE_ATR_ChkptDir QE_ATR_checkpoint_dir #define QE_ATR_ChkptMim QE_ATR_checkpoint_min /* at last we come to the queue definition itself */ struct pbs_queue { list_link qu_link; /* forward/backward links */ tlist_head qu_jobs; /* jobs in this queue */ struct queuefix { int qu_modified; /* != 0 => update disk file */ int qu_type; /* queue type: exec, route */ time_t qu_ctime; /* time queue created */ time_t qu_mtime; /* time queue last modified */ char qu_name[PBS_MAXQUEUENAME]; /* queue name */ } qu_qs; int qu_numjobs; /* current numb jobs in queue */ int qu_numcompleted; /* current numb completed jobs in queue */ int qu_njstate[PBS_NUMJOBSTATE]; /* # of jobs per state */ char qu_jobstbuf[100]; /* the queue attributes */ attribute qu_attr[QA_ATR_LAST]; }; typedef struct pbs_queue pbs_queue; extern pbs_queue *find_queuebyname A_((char *)); extern pbs_queue *get_dfltque(); extern pbs_queue *que_alloc A_((char *name)); extern void que_free A_((pbs_queue *)); extern pbs_queue *que_recov A_((char *)); extern int que_save A_((pbs_queue *)); #endif /* QUEUE_H */ torque-2.4.16/src/include/Long.h0000664000113300011330000002120111272401235013307 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: Long.h 2367 2008-09-03 17:17:34Z josh $ */ #ifndef lONG_H #define lONG_H #include #ifndef A_ #if __STDC__ == 1 #define A_(x) x #else /* STDC */ #define const #define volatile #define A_(x) () #endif /* STDC */ #endif /* A_ */ /* * Define Long and u_Long to be the largest integer types supported by the * native compiler. They need not be supported by printf or scanf or their * ilk. Ltostr, uLtostr, strtoL, strtouL, and atoL provide conversion to and * from character string form. * * The following sections are listed in decreasing order of brain damage. */ /****************************************************************************/ #if defined(__hpux) /* HP-UX */ /* Under HP-UX, the compiler supports 64-bit signed integers as long longs */ /* but it is only capable of supporting 63-bit unsigned integers as */ /* unsigned long longs. As a consequence, the most negative Long is one */ /* closer to zero than it would otherwise be. HP-UX also seems to provide */ /* neither defined constant support nor library support. */ typedef long long Long; typedef unsigned long long u_Long; #define lONG_MIN -0x7FFFFFFFFFFFFFFFLL #define lONG_MAX 0x7FFFFFFFFFFFFFFFLL #define UlONG_MAX 0x7FFFFFFFFFFFFFFFULL Long strToL A_((const char *nptr, char **endptr, int base)); u_Long strTouL A_((const char *nptr, char **endptr, int base)); #define atoL(nptr) strToL((nptr), (char **)NULL, 10) /****************************************************************************/ #elif defined(__GNUC__) || /* SunOS, FreeBSD, NetBSD, BSDI */\ defined(_AIX) && defined(__EXTENDED__) /* AIX */ /* On these systems, the compiler supports 64-bit integers as long longs but */ /* there seems to be neither defined constant support nor library support. */ typedef long long Long; typedef unsigned long long u_Long; #define lONG_MIN (-0x7FFFFFFFFFFFFFFFLL-1) #define lONG_MAX 0x7FFFFFFFFFFFFFFFLL #define UlONG_MAX 0xFFFFFFFFFFFFFFFFULL Long strToL A_((const char *nptr, char **endptr, int base)); u_Long strTouL A_((const char *nptr, char **endptr, int base)); #define atoL(nptr) strToL((nptr), (char **)NULL, 10) /****************************************************************************/ #elif defined(__sgi) && defined(_LONGLONG) && _MIPS_SZLONG == 32 /* Irix */\ /* On Irix, the compiler supports 64-bit integers as long longs with defined */ /* constant support and with some library support. The library has nothing */ /* like LTostr or uLTostr. */ typedef long long Long; typedef unsigned long long u_Long; #define lONG_MIN LONGLONG_MIN #define lONG_MAX LONGLONG_MAX #define UlONG_MAX ULONGLONG_MAX #define strToL(n, e, b) strtoll(n, e, (b)) #define strTouL(n, e, b) strtoull(n, e, (b)) #define atoL(nptr) atoll((nptr)) /****************************************************************************/ #elif defined(sun) && defined(sparc) && defined(LLONG_MAX) /* Solaris */ /* Under Solaris, the compiler supports 64-bit integers as long longs with */ /* defined constant support and library support, but with some strange */ /* aspects to its library support. This package ignores the Solaris */ /* definitions of lltostr and ulltostr. They aren't anything close to being */ /* the functionally symetric equivalents of strtoll and strtoull. The */ /* LTostr and uLTostr functions in this package are much closer. */ typedef long long Long; typedef unsigned long long u_Long; #define lONG_MIN LLONG_MIN #define lONG_MAX LLONG_MAX #define UlONG_MAX ULLONG_MAX #define strToL(n, e, b) strtoll(n, e, (b)) #define strTouL(n, e, b) strtoull(n, e, (b)) #define atoL(nptr) atoll((nptr)) /****************************************************************************/ #else /* Unicos, SunOS cc */ /* On this machine, longs are as long as it gets. With luck, at least 64 */ /* bits (SunOS cc users have no luck). Naturally, defined constant support */ /* and some library support are both present. The library has nothing like */ /* LTostr or uLTostr. */ /* What an amazing concept, long as the longest supported integer data type! */ /* Congratulations Cray, for being the only ones so far to get it right! */ typedef long Long; typedef unsigned long u_Long; #define lONG_MIN LONG_MIN #define lONG_MAX LONG_MAX #define UlONG_MAX (u_Long)ULONG_MAX /* Cast for SunOS cc */ #define strToL(n, e, b) strtol(n, e, (b)) #define strTouL(n, e, b) strtoul(n, e, (b)) #define atoL(nptr) atol((nptr)) /****************************************************************************/ #endif const char *LTostr A_((Long value, int base)); const char *uLTostr A_((u_Long value, int base)); #endif /* lONG_H */ torque-2.4.16/src/include/svrfunc.h0000664000113300011330000001616311272401235014111 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * misc server function prototypes */ extern int chk_hold_priv A_((long hold, int priv)); extern void get_jobowner A_((char *from, char *to)); extern char *parse_servername A_((char *, unsigned int *)); extern void process_Areply A_((int)); extern void process_Dreply A_((int)); extern void process_request A_((int)); extern void process_dis_request A_((int)); extern int save_flush(); extern void save_setup A_((int)); extern int save_struct A_((char *, unsigned int)); extern void schedule_job A_((void)); extern char *site_map_user A_((char *, char *)); extern int socket_to_handle A_((int)); extern void svr_disconnect A_((int)); extern int svr_get_privilege A_((char *, char *)); extern int srv_shutdown A_((int)); extern void write_node_state A_((void)); extern int write_node_note A_((void)); extern int setup_nodes A_((void)); extern int node_avail A_((char *spec, int *navail, int *nalloc, int *nreserved, int *ndown)); extern void node_unreserve A_((resource_t handle)); extern int node_reserve A_((char *speclist, resource_t tag)); extern int init_resc_defs A_((void)); #ifdef PBS_JOB_H extern int set_nodes A_((job *, char *, char **, char *, char *)); extern int is_ts_node A_((char *)); extern char *find_ts_node A_((void)); extern void free_nodes A_((job *)); #endif /* PBS_JOB_H */ #ifdef ATTRIBUTE_H extern int check_que_enable A_((attribute *, void *, int)); extern int set_queue_type A_((attribute *, void *, int)); #ifdef QUEUE_H extern int chk_resc_limits A_((attribute *, pbs_queue *, char *)); #endif /* QUEUE_H */ #endif /* ATTRIBUTE_H */ #ifdef PBS_NET_H extern int svr_connect A_((pbs_net_t, unsigned int, void (*)(int), enum conn_type)); #endif /* PBS_NET_H */ #ifdef WORK_TASK_H extern void release_req A_((struct work_task *)); #ifdef BATCH_REQUEST_H extern int issue_Drequest A_((int, struct batch_request *, void (*)(), struct work_task **)); #endif /* BATCH_REQUEST_H */ #endif /* WORK_TASK_H */ /* The following is used in req_stat.c and req_select.c */ #ifdef STAT_CNTL struct select_list { struct select_list *sl_next; /* ptr to next in list */ enum batch_op sl_op; /* comparison operator */ attribute_def *sl_def; /* ptr to attr definition,for at_comp */ int sl_atindx; /* index into attribute_def, for type */ attribute sl_attr; /* the attribute (value) */ }; struct stat_cntl /* used in req_stat_job */ { int sc_XXXX; int sc_type; int sc_XXXY; int sc_conn; pbs_queue *sc_pque; struct batch_request *sc_origrq; struct select_list *sc_select; void (*sc_post) A_((struct stat_cntl *)); char sc_jobid[PBS_MAXSVRJOBID+1]; }; extern int stat_to_mom A_((job *, struct stat_cntl *)); #endif /* STAT_CNTL */ /* * the following defines are due to the fact that O_SYNC was not * POSIX standard (TDISABLEFILESYNC managed w/configure --enable-filesync) */ #if TDISABLEFILESYNC #define O_Sync 0 #else #ifdef O_SYNC #define O_Sync O_SYNC #elif _FSYNC #define O_Sync _FSYNC #else #define O_Sync 0 #endif /* O_SYNC */ #endif /* TDISABLEFILESYNC */ torque-2.4.16/src/include/acct.h0000664000113300011330000001216611272401235013334 00000000000000#ifndef ACCT_H #define ACCT_H /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: acct.h 3102 2009-08-26 20:29:23Z ataufer $ */ /* * header file supporting PBS accounting information */ /* NOTE: PBS_ACCT_MAX_RCD must be large enought to handle full job accounting record - this is usually ~1KB + * ( #endif /* _STDLIB_H */ #ifndef _STRING_H #include #endif /* _STRING_H */ #ifndef _MEMORY_H #include #endif /* _MEMORY_H */ #include "pbs_ifl.h" #include "list_link.h" #include "pbs_error.h" #ifndef LIBPBS_H #define LIBPBS_H #define PBS_BATCH_PROT_TYPE 2 #define PBS_BATCH_PROT_VER 1 /* #define PBS_REQUEST_MAGIC (56) */ /* #define PBS_REPLY_MAGIC (57) */ #define SCRIPT_CHUNK_Z (4096) #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif #ifndef EOF #define EOF -1 #endif /* enums for standard job files (sync w/TJobFileType[]) */ enum job_file { JScript, StdIn, StdOut, StdErr, Checkpoint }; #define MH(type) (type *)malloc(sizeof(type)) #define M(var,type) if( (var = MH(type)) == (type *)NULL ) \ { return PBSE_SYSTEM; } #define STRLEN(s) ((s==(char *)NULL)?0:strlen(s)) #define Str2QB(s) ((s==(char *)NULL)?(struct qbuf *)NULL:str2qb(s,strlen(s),0)) #define QB2Str(q) ((q==(struct qbuf *)NULL)?(char *)NULL:qb2str(q)) extern char pbs_current_user[]; extern char pbs_current_group[]; /* set ENABLE_TRUSTED_AUTH to "TRUE" to bypass using pbs_iff for authentication */ #define ENABLE_TRUSTED_AUTH FALSE #define NCONNECTS 10 struct connect_handle { int ch_inuse; /* 1 if in use, 0 otherwise */ int ch_socket; /* file descriptor for the open socket */ void *ch_stream; int ch_errno; /* last error on this connection */ char *ch_errtxt; /* pointer to last server error text */ }; extern struct connect_handle connection[]; /* PBS Batch Reply Structure */ /* structures that make up the reply union */ struct brp_select /* reply to Select Job Request */ { struct brp_select *brp_next; char brp_jobid[PBS_MAXSVRJOBID+1]; }; struct brp_status /* reply to Status Job/Queue/Server Request */ { list_link brp_stlink; int brp_objtype; char brp_objname[(PBS_MAXSVRJOBID > PBS_MAXDEST ? PBS_MAXSVRJOBID:PBS_MAXDEST)+1]; tlist_head brp_attr; /* head of svrattrlist */ }; struct brp_cmdstat { struct brp_cmdstat * brp_stlink; int brp_objtype; char brp_objname[(PBS_MAXSVRJOBID > PBS_MAXDEST ? PBS_MAXSVRJOBID:PBS_MAXDEST)+1]; struct attrl *brp_attrl; }; struct brp_rescq /* reply to Resource Query Request */ { int brq_number; /* number of items in following arrays */ int *brq_avail; int *brq_alloc; int *brq_resvd; int *brq_down; }; /* * the following is the basic Batch Reply structure */ #define BATCH_REPLY_CHOICE_NULL 1 /* no reply choice, just code */ #define BATCH_REPLY_CHOICE_Queue 2 /* Job ID, see brp_jid */ #define BATCH_REPLY_CHOICE_RdytoCom 3 /* select, see brp_jid */ #define BATCH_REPLY_CHOICE_Commit 4 /* commit, see brp_jid */ #define BATCH_REPLY_CHOICE_Select 5 /* select, see brp_select */ #define BATCH_REPLY_CHOICE_Status 6 /* status, see brp_status */ #define BATCH_REPLY_CHOICE_Text 7 /* text, see brp_txt */ #define BATCH_REPLY_CHOICE_Locate 8 /* locate, see brp_locate */ #define BATCH_REPLY_CHOICE_RescQuery 9 /* Resource Query */ struct batch_reply { int brp_code; int brp_auxcode; int brp_choice; /* the union discriminator */ union { char brp_jid[PBS_MAXSVRJOBID+1]; struct brp_select *brp_select; /* select replies */ tlist_head brp_status; /* status (svr) replies */ struct brp_cmdstat *brp_statc; /* status (cmd) replies) */ struct { size_t brp_txtlen; char *brp_str; } brp_txt; /* text and credential reply */ char brp_locate[PBS_MAXDEST+1]; struct brp_rescq brp_rescq; /* query resource reply */ } brp_un; }; /* This construct pulls the constant parts from the batch types definitions * * @note dis_request_read() is using the PBS_BATCH_CEILING for valid message testing * @see pbs_batchreqtype_db.h for more info */ #define PbsBatchReqType(id,text) id, enum PBatchReqTypeEnum { #include "pbs_batchreqtype_db.h" PBS_BATCH_CEILING }; #undef PbsBatchReqType /* DIAGTODO: define PBS_BATCH_StatusDiag */ #define PBS_BATCH_FileOpt_Default 0 #define PBS_BATCH_FileOpt_OFlg 1 #define PBS_BATCH_FileOpt_EFlg 2 #define PBS_credentialtype_none 0 const char *reqtype_to_txt(int); void PBS_free_aopl A_((struct attropl * aoplp)); int PBSD_commit A_((int connect, char *jobid)); int PBSD_jcred A_((int connect, char *buf, int len)); int PBSD_jscript A_((int connect, char *script_file, char *jobid)); int PBSD_mgr_put A_((int connect, int func, int cmd, int objtype, char *objname, struct attropl *al, char *extend)); int PBSD_manager A_((int connect, int func, int cmd, int objtype, char *objname, struct attropl *al, char *extend)); int PBSD_msg_put A_((int connect, char *jobid, int fileopt, char *msg, char *extend)); int PBSD_rdytocmt A_((int connect, char *jobid)); int PBSD_sig_put A_((int connect, char *jobid, char *signal, char *extend)); int PBSD_async_sig_put A_((int connect, char *jobid, char *signal, char *extend)); int PBSD_term_put A_((int connect, int manner, char *extend)); int PBSD_jobfile A_((int connect, int req_type, char *path, char *jobid, enum job_file which)); int PBSD_status_put A_((int c, int func, char *id, struct attrl *attrib, char *extend)); struct batch_reply *PBSD_rdrpy A_((int connect)); void PBSD_FreeReply A_((struct batch_reply *)); struct batch_status *PBSD_status A_((int c, int function, char *id, struct attrl *attrib, char *extend)); struct batch_status *PBSD_status_get A_((int c)); char * PBSD_queuejob A_((int c, char *j, char *d, struct attropl *a, char *ex)); extern int decode_DIS_JobId A_((int socket, char *jobid)); extern int decode_DIS_replyCmd A_((int socket, struct batch_reply *)); extern int encode_DIS_JobCred A_((int socket, int type, char *cred, int len)); extern int encode_DIS_JobFile A_((int socket, int, char *, int, char *, int)); extern int encode_DIS_JobId A_((int socket, char *)); extern int encode_DIS_Manage A_((int socket, int cmd, int objt, char *, struct attropl *)); extern int encode_DIS_MoveJob A_((int socket, char *jid, char *dest)); extern int encode_DIS_MessageJob A_((int socket, char *jid, int fopt, char *m)); extern int encode_DIS_QueueJob A_((int socket, char *jid, char *dest, struct attropl *)); extern int encode_DIS_ReqExtend A_((int socket, char *extend)); extern int encode_DIS_ReqHdr A_((int socket, int reqt, char *user)); extern int encode_DIS_Rescq A_((int socket, char **rlist, int num)); extern int encode_DIS_RunJob A_((int socket, char *jid, char *where, unsigned int resch)); extern int encode_DIS_ShutDown A_((int socket, int manner)); extern int encode_DIS_SignalJob A_((int socket, char *jid, char *sig)); extern int encode_DIS_Status A_((int socket, char *objid, struct attrl *)); extern int encode_DIS_attrl A_((int socket, struct attrl *)); extern int encode_DIS_attropl A_((int socket, struct attropl *)); extern int DIS_reply_read A_((int socket, struct batch_reply *preply)); #endif /* LIBPBS_H */ torque-2.4.16/src/include/pbs_job.h0000664000113300011330000007577211435257364014071 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * job.h - structure definations for job objects * * Include Files Required: * * "list_link.h" * "attribute.h" * "server_limits.h" */ #ifndef PBS_JOB_H #define PBS_JOB_H 1 /* anything including job.h also needs array.h so lets just include it this way*/ #include "array.h" /* * Dependent Job Structures * * This set of structures are used by the server to track job * dependency. * * The depend (parent) structure is used to record the type of * dependency. It also heads the list of depend_job related via this type. * For a type of "sycnto", the number of jobs expected, registered and * ready are also recorded. */ struct depend { list_link dp_link; /* link to next dependency, if any */ short dp_type; /* type of dependency (all) */ short dp_numexp; /* num jobs expected (on or syncct only) */ short dp_numreg; /* num jobs registered (syncct only) */ short dp_released; /* This job released to run (syncwith) */ tlist_head dp_jobs; /* list of related jobs (all) */ }; /* * The depend_job structure is used to record the name and location * of each job which is involved with the dependency */ struct depend_job { list_link dc_link; short dc_state; /* released / ready to run (syncct) */ long dc_cost; /* cost of this child (syncct) */ char dc_child[PBS_MAXSVRJOBID+1]; /* child (dependent) job */ char dc_svr[PBS_MAXSERVERNAME+1]; /* server owning job */ }; /* * Warning: the relation between the numbers assigned to after* and before* * is critical. */ #define JOB_DEPEND_TYPE_AFTERSTART 0 #define JOB_DEPEND_TYPE_AFTEROK 1 #define JOB_DEPEND_TYPE_AFTERNOTOK 2 #define JOB_DEPEND_TYPE_AFTERANY 3 #define JOB_DEPEND_TYPE_BEFORESTART 4 #define JOB_DEPEND_TYPE_BEFOREOK 5 #define JOB_DEPEND_TYPE_BEFORENOTOK 6 #define JOB_DEPEND_TYPE_BEFOREANY 7 #define JOB_DEPEND_TYPE_ON 8 #define JOB_DEPEND_TYPE_SYNCWITH 9 #define JOB_DEPEND_TYPE_SYNCCT 10 #define JOB_DEPEND_NUMBER_TYPES 11 #define JOB_DEPEND_OP_REGISTER 1 #define JOB_DEPEND_OP_RELEASE 2 #define JOB_DEPEND_OP_READY 3 #define JOB_DEPEND_OP_DELETE 4 #define JOB_DEPEND_OP_UNREG 5 /* Job recovery levels. Options used to start pbs_mom */ #define JOB_RECOV_REQUE 0 /* -q option */ #define JOB_RECOV_TERM_REQUE 1 /* -r option */ #define JOB_RECOV_RUNNING 2 /* -p option */ #define JOB_RECOV_DELETE 3 /* -P option */ /* * The badplace structure is used to keep track of destinations * which have been tried by a route queue and given a "reject" * status back, see svr_movejob.c. */ typedef struct badplace { list_link bp_link; char bp_dest[PBS_MAXROUTEDEST + 1]; } badplace; /* * The grpcache structure defined here is used by MOM to maintain the * home directory and supplementary group list of the user name under * which the job is running. This information is needed to set up the * groups when running the job and returning output and staged-out files. * The information is keep here rather than make repeated hits on the * password and group files. */ #ifdef NGROUPS_MAX struct grpcache { int gc_ngroup; /* number of active supplementary groups */ int gc_groups[NGROUPS_MAX]; char gc_homedir[1]; /* more space allocated as part of this */ /* structure following here */ }; #endif /* END NGROUPS_MAX */ /* * Job attributes/resources are maintained in one of two ways. * Most of the attributes are maintained in a decoded or parsed form. * This allows quick access to the attribute and resource values * when making decisions about the job (scheduling, routing, ...), * see ji_wattr[]. * * Any attribute or resource which is not recognized on this server * are kept in an "attrlist", a linked list of the "external" * form (attr_extern, see attribute.h). These are maintained because * the job may be passed on to another server (route or qmove) that * does recognize them. * See the job structure entry ji_attrlist and the attrlist structure. */ /* * The following job_atr enum provide an index into the array of * decoded job attributes, ji_wattr[], for quick access. * Most of the attributes here are "public", but some are Read Only, * Private, or even Internal data items; maintained here because of * their variable size. * * "JOB_ATR_LAST" must be the last value as its number is used to * define the size of the array. */ /* * sync w/job_attr_def[] (NOTE: must maintain same ordering between enum and * job_attr_def[] table in src/server/job_attr_def.c) * sync w/TJobAttr[] table in src/resmom/request.c * * @see struct job */ enum job_atr { JOB_ATR_jobname, /* this set appears first as they show */ JOB_ATR_job_owner, /* in a basic job status display */ JOB_ATR_resc_used, JOB_ATR_state, JOB_ATR_in_queue, JOB_ATR_at_server, /* (5) */ JOB_ATR_account, /* the bulk of the attributes are in */ JOB_ATR_checkpoint, /* alphabetic order for no good reason */ JOB_ATR_ctime, JOB_ATR_depend, JOB_ATR_errpath, JOB_ATR_exec_host, JOB_ATR_exectime, JOB_ATR_grouplst, JOB_ATR_hold, JOB_ATR_interactive, JOB_ATR_join, JOB_ATR_keep, JOB_ATR_mailpnts, JOB_ATR_mailuser, JOB_ATR_mtime, /* what triggers modification of mtime? (20) */ JOB_ATR_outpath, JOB_ATR_priority, JOB_ATR_qtime, JOB_ATR_rerunable, JOB_ATR_resource, JOB_ATR_session_id, JOB_ATR_shell, JOB_ATR_stagein, JOB_ATR_stageout, JOB_ATR_substate, JOB_ATR_userlst, JOB_ATR_variables, /* (32) */ /* this set contains private attributes, */ /* as such not sent to clients (status) */ JOB_ATR_euser, /* execution user name for MOM */ JOB_ATR_egroup, /* execution group name for MOM */ JOB_ATR_hashname, /* job name hashed into 14 characters */ JOB_ATR_hopcount, JOB_ATR_qrank, JOB_ATR_queuetype, JOB_ATR_sched_hint, /* 39 */ JOB_ATR_security, JOB_ATR_Comment, JOB_ATR_Cookie, JOB_ATR_altid, /* alternate job id, for irix6 = array id */ JOB_ATR_etime, /* time job became eligible to run */ JOB_ATR_exitstat, /* exit status of job */ JOB_ATR_forwardx11, JOB_ATR_submit_args, JOB_ATR_job_array_id, JOB_ATR_job_array_request, JOB_ATR_umask, /* 50 */ JOB_ATR_start_time, /* time when job was first started */ JOB_ATR_start_count, /* number of times the job has been started */ JOB_ATR_checkpoint_dir, /* directory where job checkpoint file is stored */ JOB_ATR_checkpoint_name, /* name of checkpoint file */ JOB_ATR_checkpoint_time, /* timestamp of start of last checkpoint */ JOB_ATR_checkpoint_restart_status, /* checkpoint restart status */ JOB_ATR_restart_name, /* name of checkpoint restart file */ JOB_ATR_fault_tolerant, /* indicates if a job should keep going if it looses a sister */ JOB_ATR_comp_time, /* time when job was completed */ JOB_ATR_reported, /* tracks whether job has been reported to scheduler */ JOB_ATR_jobtype, /* opaque job type string */ JOB_ATR_inter_cmd, /* command for interactive job */ JOB_ATR_proxy_user, #ifdef USEJOBCREATE JOB_ATR_pagg_id, #endif /* USEJOBCREATE */ #include "site_job_attr_enum.h" JOB_ATR_UNKN, /* the special "unknown" type */ JOB_ATR_LAST /* This MUST be LAST */ }; /* * The "definitions" for the job attributes are in job_attr_def[], * it is also indexed by the JOB_ATR_... enums. */ extern attribute_def job_attr_def[]; #ifdef PBS_MOM #include "tm_.h" /* ** Track nodes with an array of structures which each ** point to a list of events */ typedef struct hnodent { int hn_node; /* host (node) identifier (index) */ char *hn_host; /* hostname of node */ int hn_stream; /* stream to MOM on node */ int hn_sister; /* save error for KILL_JOB event */ tlist_head hn_events; /* pointer to list of events */ } hnodent; typedef struct vnodent { tm_node_id vn_node; /* user's vnode identifier */ hnodent *vn_host; /* parent (host) nodeent entry */ int vn_index; /* index (window) */ } vnodent; /* ** Mother Superior gets to hold an array of information from each ** of the other nodes for resource usage. */ typedef struct noderes { long nr_cput; /* cpu time */ long nr_mem; /* memory */ long nr_vmem; /* virtual memory */ } noderes; /* mother superior to sister communication */ /* (sync w/TSisterFailure[] in resmom/mom_main.c) */ #define SISTER_OKAY 0 #define SISTER_KILLDONE 1000 #define SISTER_BADPOLL 1001 #define SISTER_EOF 1099 /* Flags for ji_flags (mom only) */ #define MOM_CHECKPOINT_ACTIVE 1 /* checkpoint in progress */ #define MOM_CHECKPOINT_POST 2 /* post checkpoint call returned */ #define MOM_HAS_NODEFILE 4 /* Mom wrote job PBS_NODEFILE */ #define MOM_NO_PROC 8 /* no procs found for job */ #define MOM_HAS_TMPDIR 16 /* Mom made a tmpdir */ #ifdef USESAVEDRESOURCES #define MOM_JOB_RECOVERY 32 /* recovering dead job on restart */ #endif /* USESAVEDRESOURCES */ #endif /* MOM */ typedef struct { void *pjob; void *ptask; char sjr[2048]; /* provide buffer space for struct startjob_rtn */ /* struct startjob_rtn defined in resmom/{OS}/mom_mach.h */ int ReadRC; /* return code from read of child pipe */ int ReadCount; /* number of bytes read from child pipe */ int ptc; /* NOTE: change ptc_name to alloc to prevent race conditions */ char *ptc_name; /* (ptr, no-alloc) */ int is_interactive; int port_out; int port_err; void *pwdp; int pipe_script[2]; int jsmpipe[2]; /* job starter to MOM for sid */ int upfds; int mjspipe[2]; /* MOM to job starter for ack */ int downfds; } pjobexec_t; /** * THE JOB * * This structure is used by the server to maintain internal * quick access to the state and status of each job. * There is one instance of this structure per job known by the server. * * This information must be PRESERVED and is done so by updating the * job file in the jobs subdirectory which corresponds to this job. * * ji_state is the state of the job. It is kept up front to provide for a * "quick" update of the job state with minimum rewritting of the job file. * Which is why the sub-struct ji_qs exists, that is the part which is * written on the "quick" save. * * The unparsed string set forms of the attributes (including resources) * are maintained in the struct attrlist as discussed above. * * @see job_alloc() - creates new job * @see job_free() - free job structure */ struct job { /* Note: these members, up to ji_qs, are not saved to disk (except for ji_stdout, ji_stderr) */ list_link ji_alljobs; /* link to next job in server job list */ list_link ji_jobque; /* SVR: link to next job in queue list */ /* MOM: links to polled jobs */ time_t ji_momstat; /* SVR: time of last status from MOM */ /* MOM: time job suspend (Cray) */ int ji_modified; /* struct changed, needs to be saved */ int ji_momhandle; /* open connection handle to MOM */ #ifdef PBS_MOM /* MOM ONLY */ struct grpcache *ji_grpcache; /* cache of user's groups */ time_t ji_checkpoint_time; /* periodic checkpoint time */ time_t ji_checkpoint_next; /* next checkpoint time */ time_t ji_sampletim; /* last usage sample time, irix only */ pid_t ji_momsubt; /* pid of mom subtask */ int (*ji_mompost)(); /* ptr to post processing func */ struct batch_request *ji_preq; /* hold request until finish_exec */ int ji_numnodes; /* number of nodes (at least 1) */ int ji_numvnod; /* number of virtual nodes */ tm_node_id ji_nodeid; /* my node id */ tm_task_id ji_taskid; /* generate task id's for job */ char ji_altid[PBS_MAXSVRJOBID + 1]; tm_event_t ji_obit; /* event for end-of-job */ hnodent *ji_hosts; /* ptr to job host management stuff */ vnodent *ji_vnods; /* ptr to job vnode management stuff */ noderes *ji_resources; /* ptr to array of node resources */ tlist_head ji_tasks; /* list of task structs */ tm_node_id ji_nodekill; /* set to nodeid requesting job die */ int ji_flags; /* mom only flags */ char *ji_globid; /* global job id */ int ji_stdout; /* port for stdout */ int ji_stderr; /* port for stderr */ #else /* END MOM ONLY */ tlist_head ji_svrtask; /* links to svr work_task list */ struct pbs_queue *ji_qhdr; /* current queue header */ int ji_lastdest; /* last destin tried by route */ int ji_retryok; /* ok to retry, some reject was temp */ tlist_head ji_rejectdest; /* list of rejected destinations */ list_link ji_arrayjobs; /* links to all jobs in same array */ job_array *ji_arraystruct; /* pointer to job_array for this array */ int ji_isparent; /* set to TRUE if this is a "parent job"*/ #endif/* PBS_MOM */ /* END SERVER ONLY */ /* * fixed size internal data - maintained via "quick save" * some of the items are copies of attributes, if so this * internal version takes precendent */ struct jobfix { int qs_version; /* quick save version */ int ji_state; /* internal copy of state */ int ji_substate; /* job sub-state */ int ji_svrflags; /* server flags */ int ji_numattr; /* number of attributes in list */ int ji_ordering; /* special scheduling ordering */ int ji_priority; /* internal priority */ time_t ji_stime; /* time job started execution */ char ji_jobid[PBS_MAXSVRJOBID + 1]; /* job identifier */ char ji_fileprefix[PBS_JOBBASE + 1]; /* job file prefix */ char ji_queue[PBS_MAXQUEUENAME + 1]; /* name of current queue */ char ji_destin[PBS_MAXROUTEDEST + 1]; /* dest from qmove/route */ /* * ji_destin gets set when we assign hosts and gets * cleared on failure to run job on mom or at obit_reply */ int ji_un_type; /* type of ji_un union */ union /* depends on type of queue currently in */ { struct /* if in execution queue .. */ { pbs_net_t ji_momaddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ } ji_exect; struct { time_t ji_quetime; /* time entered queue */ time_t ji_rteretry; /* route retry time */ } ji_routet; struct { pbs_net_t ji_fromaddr; /* host job coming from */ int ji_fromsock; /* socket job coming over */ int ji_scriptsz; /* script size */ } ji_newt; struct { pbs_net_t ji_svraddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ uid_t ji_exuid; /* execution uid */ gid_t ji_exgid; /* execution gid */ } ji_momt; } ji_un; } ji_qs; /* * The following array holds the decode format of the attributes. * Its presence is for rapid acces to the attributes. */ attribute ji_wattr[JOB_ATR_LAST]; /* decoded attributes */ int maxAdoptedTaskId; /* DJH 27 Feb 2002. Keep track of the task ids the local mom allocates to adopted tasks; */ }; typedef struct job job; #ifdef PBS_MOM /* ** Tasks are sessions belonging to a job, running on one of the ** nodes assigned to the job. */ typedef struct task { job *ti_job; /* pointer to owning job */ list_link ti_jobtask; /* links to tasks for this job */ int ti_fd; /* DIS file descriptor to task */ int ti_flags; /* task internal flags */ tm_event_t ti_register; /* event if task registers */ tlist_head ti_obits; /* list of obit events */ tlist_head ti_info; /* list of named info */ struct taskfix { char ti_parentjobid[PBS_MAXSVRJOBID+1]; tm_node_id ti_parentnode; tm_task_id ti_parenttask; tm_task_id ti_task; /* task's taskid */ int ti_status; /* status of task */ pid_t ti_sid; /* session id */ int ti_exitstat; /* exit status */ union { int ti_hold[16]; /* reserved space */ } ti_u; } ti_qs; } task; /* ** Events need to be linked to either a task or another event ** waiting at another MOM. This is the information needed so ** we can forward the event to another MOM. */ typedef struct fwdevent { tm_node_id fe_node; /* where does notification go */ tm_event_t fe_event; /* event number */ tm_task_id fe_taskid; /* which task id */ } fwdevent; /* ** A linked list of eventent structures is maintained for all events ** for which we are waiting for another MOM to report back. */ typedef struct eventent { int ee_command; /* command event is for */ tm_event_t ee_event; /* event number */ tm_task_id ee_taskid; /* which task id */ fwdevent ee_forward; /* event to get notified */ char **ee_argv; /* save args for spawn */ char **ee_envp; /* save env for spawn */ list_link ee_next; /* link to next one */ } eventent; /* ** A task can have events which are triggered when it exits. ** These are tracked by obitent structures linked to the task. */ typedef struct obitent { fwdevent oe_info; /* who gets the event */ list_link oe_next; /* link to next one */ } obitent; /* ** A task can have a list of named infomation which it makes ** available to other tasks in the job. */ typedef struct infoent { char *ie_name; /* published name */ void *ie_info; /* the glop */ size_t ie_len; /* how much glop */ list_link ie_next; /* link to next one */ } infoent; #define TI_FLAGS_INIT 1 /* task has called tm_init */ #define TI_FLAGS_CHECKPOINT 2 /* task has checkpointed */ #define TI_STATE_EMBRYO 0 #define TI_STATE_RUNNING 1 /* includes suspended jobs */ #define TI_STATE_EXITED 2 /* ti_exitstat valid */ #define TI_STATE_DEAD 3 /* ** Here is the set of commands for InterMOM (IM) requests. */ /* sync w/PMOMCommand[] */ #define IM_ALL_OKAY 0 #define IM_JOIN_JOB 1 #define IM_KILL_JOB 2 #define IM_SPAWN_TASK 3 #define IM_GET_TASKS 4 #define IM_SIGNAL_TASK 5 #define IM_OBIT_TASK 6 #define IM_POLL_JOB 7 #define IM_GET_INFO 8 #define IM_GET_RESC 9 #define IM_ABORT_JOB 10 #define IM_GET_TID 11 #define IM_ERROR 99 #define IM_MAX 12 eventent *event_alloc A_(( int command, hnodent *pnode, tm_event_t event, tm_task_id taskid)); task *pbs_task_create A_(( job *pjob, tm_task_id taskid)); task *task_find A_(( job *pjob, tm_task_id taskid)); #endif /* MOM */ /* * server flags (in ji_svrflags) */ #define JOB_SVFLG_HERE 0x01 /* SERVER: job created here */ /* MOM: set for Mother Superior */ #define JOB_SVFLG_HASWAIT 0x02 /* job has timed task entry for wait time */ #define JOB_SVFLG_HASRUN 0x04 /* job has been run before (being rerun */ #define JOB_SVFLG_HOTSTART 0x08 /* job was running, if hot init, restart */ #define JOB_SVFLG_CHECKPOINT_FILE 0x10 /* job has checkpoint file for restart */ #define JOB_SVFLG_SCRIPT 0x20 /* job has a Script file */ #define JOB_SVFLG_OVERLMT1 0x40 /* job over limit first time, MOM only */ #define JOB_SVFLG_OVERLMT2 0x80 /* job over limit second time, MOM only */ #define JOB_SVFLG_CHECKPOINT_MIGRATEABLE 0x100 /* job has migratable checkpoint */ #define JOB_SVFLG_Suspend 0x200 /* job suspended (signal suspend) */ #define JOB_SVFLG_StagedIn 0x400 /* job has files that have been staged in */ #define JOB_SVFLG_HasNodes 0x1000 /* job has nodes allocated to it */ #define JOB_SVFLG_RescAssn 0x2000 /* job resources accumulated in server/que */ #define JOB_SVFLG_CHECKPOINT_COPIED 0x4000 /* job checkpoint file that has been copied */ /* * Related defines */ #define SAVEJOB_QUICK 0 #define SAVEJOB_FULL 1 #define SAVEJOB_NEW 2 #define MAIL_NONE (int)'n' #define MAIL_ABORT (int)'a' #define MAIL_BEGIN (int)'b' #define MAIL_DEL (int)'d' #define MAIL_END (int)'e' #define MAIL_OTHER (int)'o' #define MAIL_STAGEIN (int)'s' #define MAIL_CHKPTCOPY (int)'c' #define MAIL_NORMAL 0 #define MAIL_FORCE 1 #define JOB_FILE_COPY ".JC" /* tmp copy while updating */ #define JOB_FILE_SUFFIX ".JB" /* job control file */ #define JOB_FILE_BACKUP ".BK" /* job file backup */ #define JOB_SCRIPT_SUFFIX ".SC" /* job script file */ #define JOB_STDOUT_SUFFIX ".OU" /* job standard out */ #define JOB_STDERR_SUFFIX ".ER" /* job standard error */ #define JOB_CHECKPOINT_SUFFIX ".CK" /* job checkpoint file */ #define JOB_TASKDIR_SUFFIX ".TK" /* job task directory */ #define JOB_BAD_SUFFIX ".BD" /* save bad job file */ #define JOB_FILE_TMP_SUFFIX ".TA" /* temporary job array parent file suffix */ /* * Job states are defined by POSIX as: */ /* sync w/PJobState[] */ #define JOB_STATE_TRANSIT 0 #define JOB_STATE_QUEUED 1 #define JOB_STATE_HELD 2 #define JOB_STATE_WAITING 3 #define JOB_STATE_RUNNING 4 #define JOB_STATE_EXITING 5 #define JOB_STATE_COMPLETE 6 /* * job sub-states are defined by PBS (more detailed) as: */ /* sync w/PJobSubState[] */ #define JOB_SUBSTATE_TRANSIN 00 /* Transit in, wait for commit */ #define JOB_SUBSTATE_TRANSICM 01 /* Transit in, wait for commit */ #define JOB_SUBSTATE_TRNOUT 02 /* transiting job outbound */ #define JOB_SUBSTATE_TRNOUTCM 03 /* transiting outbound, rdy to commit */ #define JOB_SUBSTATE_QUEUED 10 /* job queued and ready for selection */ #define JOB_SUBSTATE_PRESTAGEIN 11 /* job queued, has files to stage in */ #define JOB_SUBSTATE_SYNCRES 13 /* job waiting on sync start ready */ #define JOB_SUBSTATE_STAGEIN 14 /* job staging in files then wait */ #define JOB_SUBSTATE_STAGEGO 15 /* job staging in files and then run */ #define JOB_SUBSTATE_STAGECMP 16 /* job stage in complete */ #define JOB_SUBSTATE_CHKPTGO 17 /* job copy checkpoint file and then run */ #define JOB_SUBSTATE_CHKPTCMP 18 /* job copy checkpoint file complete */ #define JOB_SUBSTATE_HELD 20 /* job held - user or operator */ #define JOB_SUBSTATE_SYNCHOLD 21 /* job held - waiting on sync regist */ #define JOB_SUBSTATE_DEPNHOLD 22 /* job held - waiting on dependency */ #define JOB_SUBSTATE_WAITING 30 /* job waiting on execution time */ #define JOB_SUBSTATE_STAGEFAIL 37 /* job held - file stage in failed */ #define JOB_SUBSTATE_PRERUN 40 /* job sent to MOM to run */ #define JOB_SUBSTATE_STARTING 41 /* job sent to MOM - job start finalizing */ #define JOB_SUBSTATE_RUNNING 42 /* job running */ #define JOB_SUBSTATE_SUSPEND 43 /* job suspended, CRAY only */ #define JOB_SUBSTATE_EXITING 50 /* Start of job exiting processing */ #define JOB_SUBSTATE_STAGEOUT 51 /* job staging out (other) files */ #define JOB_SUBSTATE_STAGEDEL 52 /* job deleteing staged out files */ #define JOB_SUBSTATE_EXITED 53 /* job exit processing completed */ #define JOB_SUBSTATE_ABORT 54 /* job is being aborted by server */ #define JOB_SUBSTATE_NOTERM_REQUE 55 /* (MOM) on mom initialization. Requeue job but do not terminate any running process */ #define JOB_SUBSTATE_PREOBIT 57 /* (MOM) preobit jobstat sent */ #define JOB_SUBSTATE_OBIT 58 /* (MOM) job obit notice sent */ #define JOB_SUBSTATE_COMPLETE 59 /* job is complete */ #define JOB_SUBSTATE_RERUN 60 /* job is rerun, recover output stage */ #define JOB_SUBSTATE_RERUN1 61 /* job is rerun, stageout phase */ #define JOB_SUBSTATE_RERUN2 62 /* job is rerun, delete files stage */ #define JOB_SUBSTATE_RERUN3 63 /* job is rerun, mom delete job */ #define JOB_SUBSTATE_RETURNSTD 70 /* job has checkpoint file, return stdout / stderr files to server spool dir so that job can be restarted */ /* decriminator for ji_un union type */ #define JOB_UNION_TYPE_NEW 0 #define JOB_UNION_TYPE_EXEC 1 #define JOB_UNION_TYPE_ROUTE 2 #define JOB_UNION_TYPE_MOM 3 /* job hold (internal) types */ #define HOLD_n 0 #define HOLD_u 1 #define HOLD_o 2 #define HOLD_s 4 /* jobs in a job array are held until the whole array is ready for now this is * a system hold, but it may be a special hold in the future */ #define HOLD_a HOLD_s /* Special Job Exit Values, Set by the job starter (child of MOM) */ /* see server/req_jobobit() & mom/start_exec.c */ #define JOB_EXEC_OK 0 /* job exec successful */ #define JOB_EXEC_FAIL1 -1 /* job exec failed, before files, no retry */ #define JOB_EXEC_FAIL2 -2 /* job exec failed, after files, no retry */ #define JOB_EXEC_RETRY -3 /* job execution failed, do retry */ #define JOB_EXEC_INITABT -4 /* job aborted on MOM initialization */ #define JOB_EXEC_INITRST -5 /* job aborted on MOM init, checkpoint, no migrate */ #define JOB_EXEC_INITRMG -6 /* job aborted on MOM init, checkpoint, ok migrate */ #define JOB_EXEC_BADRESRT -7 /* job restart failed */ #define JOB_EXEC_CMDFAIL -8 /* exec() of user command failed */ #define JOB_EXEC_STDOUTFAIL -9 /* could not create/open stdout stderr files */ extern void add_dest A_((job *)); extern void depend_clrrdy A_((job *)); extern int depend_on_que A_((attribute *, void *, int)); extern int depend_on_exec A_((job *)); extern int depend_on_term A_((job *)); extern job *find_job A_((char *)); extern char *get_egroup A_((job *)); extern char *get_variable A_((job *, char *)); extern int init_chkmom A_((job *)); extern void issue_track A_((job *)); extern int job_abt A_((job **, char *)); extern job *job_alloc(); extern int job_unlink_file(job *pjob, const char *name); extern job *job_clone A_((job *, int)); extern void job_free A_((job *)); extern void job_purge A_((job *)); extern job *job_recov A_((char *)); extern int job_save A_((job *, int)); extern int modify_job_attr A_((job *, svrattrl *, int, int *)); extern char *prefix_std_file A_((job *, int)); extern char *add_std_filename A_((job *, char *, int)); extern int set_jobexid A_((job *, attribute *, char *)); extern int site_check_user_map A_((job *, char *, char *)); extern void svr_dequejob A_((job *)); extern int svr_enquejob A_((job *)); extern void svr_evaljobstate A_((job *, int *, int *, int)); extern void svr_mailowner A_((job *, int, int, char *)); extern void set_resc_deflt A_((job *, attribute *)); extern void set_statechar A_((job *)); extern int svr_setjobstate A_((job *, int, int)); #ifdef BATCH_REQUEST_H extern job *chk_job_request A_((char *, struct batch_request *)); extern int net_move A_((job *, struct batch_request *)); extern int svr_chk_owner A_((struct batch_request *, job *)); extern struct batch_request *cpy_stage A_((struct batch_request *, job *, enum job_atr, int)); extern struct batch_request *setup_cpyfiles A_((struct batch_request *, job *, char *, char *, int, int)); extern struct batch_request *cpy_checkpoint A_((struct batch_request *, job *, enum job_atr, int)); #endif /* BATCH_REQUEST_H */ #ifdef QUEUE_H extern int svr_chkque A_((job *, pbs_queue *, char *, int, char *)); extern int default_router A_((job *, pbs_queue *, long)); extern int site_alt_router A_((job *, pbs_queue *, long)); extern int site_acl_check A_((job *, pbs_queue *)); #endif /* QUEUE_H */ #ifdef WORK_TASK_H extern void job_clone_wt A_((struct work_task *)); extern int issue_signal A_((job *, char *, void(*)(struct work_task *), void *)); extern void on_job_exit A_((struct work_task *)); #endif /* WORK_TASK_H */ #endif /* PBS_JOB_H */ torque-2.4.16/src/include/mom_func.h0000664000113300011330000001732611345253626014242 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include "libpbs.h" #ifndef MOM_MACH #include "mom_mach.h" #endif /* MOM_MACH */ /* struct var_table = used to hold environment variables for the job */ struct var_table { char *v_block; char **v_envp; int v_bsize; int v_ensize; int v_used; }; /* struct sig_tbl = used to hold map of local signal names to values */ struct sig_tbl { char *sig_name; int sig_val; }; #define NUM_LCL_ENV_VAR 10 #define MOM_OBIT_RETRY -5 /* used by mom_main.c and requests.c for $usecp */ struct cphosts { char *cph_hosts; char *cph_from; char *cph_to; }; extern int cphosts_num; /* holds the varattrs */ struct varattr { list_link va_link; int va_ttl; char *va_cmd; char *va_value; time_t va_lasttime; }; /* public funtions within MOM */ #ifdef _CRAY #define WJSIGNAL 46 extern void post_suspend A_((job *, int)); extern void post_resume A_((job *, int)); #endif /* _CRAY */ extern void bld_env_variables A_((struct var_table *, char *, char *)); extern int expand_path (job *,char *,int,char *); extern pid_t fork_me A_((int sock)); extern int get_la A_((double *)); extern void init_abort_jobs A_((int)); extern int init_groups A_((char *, int, int, int *)); extern int kill_job A_((job *, int sig, char *killer_id_name, char *why_killed_reason)); extern void mom_deljob A_((job *)); extern void mom_freenodes A_((job *)); extern void scan_for_exiting(); extern void scan_for_terminated(); extern void scan_non_child_tasks(void); extern int set_job A_((job *, struct startjob_rtn *)); extern void set_globid A_((job *, struct startjob_rtn *)); extern int set_mach_vars A_((job *, struct var_table *)); extern char *set_shell A_((job *, struct passwd *)); extern void start_exec A_((job *)); extern int open_master(char **); extern int open_slave(); extern char *rcvttype A_((int)); extern int rcvwinsize A_((int)); extern int remtree A_((char *)); extern int setwinsize A_((int)); extern void set_termcc A_((int)); extern int site_job_setup A_((job *)); extern int site_mom_chkuser A_((job *)); extern int site_mom_postchk A_((job *, int)); extern int site_mom_prerst A_((job *)); extern int reader A_((int, int)); extern int writer A_((int, int)); extern int conn_qsub A_((char *, unsigned int, char *)); /* NOTE: should be moved out of here to job_func proto header */ extern int run_pelog A_((int, char *, job *, int)); extern int is_joined A_((job *)); extern void check_busy A_((double)); extern void state_to_server A_((int, int)); extern void dep_main_loop_cycle(void); extern int message_job(job *, enum job_file, char *); extern void term_job(job *); extern struct passwd *check_pwd(job *); extern int send_sisters(job *, int); extern int task_save(task *) ; extern void DIS_rpp_reset A_((void)); extern void checkret A_((char **, int)); extern char *get_job_envvar A_((job *, char *)); extern int mom_open_socket_to_jobs_server A_((job* pjob, char *id, void (*message_hander) A_((int)))); /* defined in mach-dependant mom_mach.c */ extern int kill_task A_((struct task *, int, int)); /* Defines for pe_io_type, see run_pelog() */ #define PE_IO_TYPE_NULL -1 #define PE_IO_TYPE_ASIS 0 #define PE_IO_TYPE_STD 1 #define PE_PROLOG 1 #define PE_EPILOG 2 #define PE_PROLOGUSER 3 #define PE_EPILOGUSER 4 #define PE_PROLOGUSERJOB 5 /* per job prologue script */ #define PE_EPILOGUSERJOB 6 /* per job epilogue script */ #ifdef LIBPBS_H extern int open_std_file A_((job *, enum job_file, int, gid_t)); extern char *std_file_name A_((job *, enum job_file, int *)); #endif /* LIBPBS_H */ #ifdef BATCH_REQUEST_H extern int start_checkpoint A_((job *, int, struct batch_request *)); #endif /* BATCH_REQUEST_H */ torque-2.4.16/src/include/pbs_nodes.h0000664000113300011330000002377011272401235014401 00000000000000#ifndef PBS_NODES_H #define PBS_NODES_H /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** Header file used for the node tracking routines. */ /* NOTE: requires server_limits.h */ #define BM_ERROR -20 enum psit { okay, thinking, conflict, ignore }; struct prop { char *name; short mark; struct prop *next; }; struct jobinfo { struct job *job; struct jobinfo *next; }; struct pbssubn { struct pbsnode *host; struct pbssubn *next; struct jobinfo *jobs; /* list of jobs allocating resources within subnode */ /* does this include suspended jobs? */ resource_t allocto; enum psit flag; /* XXX */ unsigned short inuse; short index; /* subnode index */ }; struct pbsnode { char *nd_name; /* node's host name */ struct pbssubn *nd_psn; /* ptr to list of subnodes */ struct prop *nd_first; /* first and last property */ struct prop *nd_last; struct prop *nd_f_st; /* first and last status */ struct prop *nd_l_st; u_long *nd_addrs; /* IP addresses of host */ struct array_strings *nd_prop; /* array of properities */ struct array_strings *nd_status; char *nd_note; /* note set by administrator */ int nd_stream; /* RPP stream to Mom on host */ enum psit nd_flag; short nd_nprops; /* number of properties */ short nd_nstatus; /* number of status items */ short nd_nsn; /* number of VPs */ short nd_nsnfree; /* number of VPs free */ short nd_nsnshared; /* number of VPs shared */ short nd_needed; /* number of VPs needed */ unsigned short nd_state; /* node state (see INUSE_* #defines below) */ unsigned short nd_ntype; /* node type */ short nd_order; /* order of user's request */ time_t nd_warnbad; time_t nd_lastupdate; /* time of last update. */ }; struct howl { char *name; int order; int index; struct howl *next; }; typedef struct tree_t { u_long key; struct pbsnode *nodep; struct tree_t *left; struct tree_t *right; } tree; /* NOTE: should remove all node references and replace with 'tree' objects (NYI) */ /* typedef struct node_t { u_long key; struct node_t *left; struct node_t *right; } node; */ struct pbsnode *tfind(const u_long, tree **); int tlist(tree *, char *, int); /* * The following INUSE_ are used in both subnode.inuse and in node.nd_state */ #define INUSE_FREE 0x00 /* Node/VP is available */ #define INUSE_OFFLINE 0x01 /* Node was removed by administrator */ #define INUSE_DOWN 0x02 /* Node is down/unresponsive */ #define INUSE_DELETED 0x04 /* Node is "deleted" */ #define INUSE_RESERVE 0x08 /* VP being reserved by scheduler */ #define INUSE_JOB 0x10 /* VP in use by job (exclusive use) */ #define INUSE_JOBSHARE 0x20 /* VP is use by job(s) (time shared) */ #define INUSE_BUSY 0x40 /* Node is busy (high loadave) */ #define INUSE_UNKNOWN 0x100 /* Node has not been heard from yet */ #define INUSE_NEEDS_HELLO_PING 0x200 /*node needs to be informed of a*/ /*new qmgr created node */ #define INUSE_SUBNODE_MASK 0xff /* bits both in nd_state and inuse */ #define INUSE_COMMON_MASK (INUSE_OFFLINE|INUSE_DOWN) /* state bits that go from node to subn */ /* * NTYPE_ are used in node.nd_type */ #define NTYPE_CLUSTER 0x00 /* Node is normal allocatable node */ #define NTYPE_TIMESHARED 0x01 /* Node is Time Shared Node */ #define TIMESHARED_SUFFIX "ts" #define PBS_MAXNODENAME 80 /* upper bound on the node name size */ #define PBSNODE_STATE 0x1 /* characteristic code */ #define PBSNODE_PROPERTIES 0x2 /* characteristic code */ #define PBSNODE_NTYPE 0x3 /* characteristic code */ #define PBSNODE_NTYPE_MASK 0xf /* relevant ntype bits */ #define WRITENODE_STATE 0x1 /*associated w/ offline*/ #define WRITE_NEW_NODESFILE 0x2 /*changed: deleted,ntype,or properties*/ #define WRITENODE_NOTE 0x4 /*associated w/ note*/ /* * Although at the present time a struct pbssnode doesn't have an array of * attributes associated with it, it is convenient for the server's req_manager * function to use as much of the existing attribute processing functions and * philosophy as practical to carry out any node modification requests sent via * "qmgr". For this reason, and for the fact that some day struct pbssnodes * may be redefined to possess attributes, it is convenient to pretend that * nodes have an associated attributes array just as a server or a queue or * a job would have. * * The following enum defines the index into the node_attr_def[] array. */ enum nodeattr { ND_ATR_state, ND_ATR_np, ND_ATR_properties, ND_ATR_ntype, ND_ATR_jobs, ND_ATR_status, ND_ATR_note, ND_ATR_LAST }; /* WARNING: Must be the highest valued enum */ extern struct pbsnode **pbsndmast; /* array of ptr to nodes */ extern struct pbsnode **pbsndlist; /* array of ptr to nodes */ extern int svr_totnodes; /* number of nodes (hosts) */ extern int svr_tsnodes; /* number of timeshared nodes */ extern int svr_clnodes; /* number of cluster nodes */ extern struct tree_t *ipaddrs; extern struct tree_t *streams; extern int update_nodes_file A_((void)); extern void bad_node_warning(pbs_net_t); extern int addr_ok(pbs_net_t); #ifdef BATCH_REQUEST_H extern void initialize_pbssubn A_((struct pbsnode *, struct pbssubn *, struct prop *)); extern void effective_node_delete A_((struct pbsnode *)); extern void setup_notification A_((char *)); extern struct pbssubn *find_subnodebyname A_((char *)); extern struct pbsnode *find_nodebyname A_((char *)); extern void free_prop_list A_((struct prop*)); extern void free_prop_attr A_((attribute*)); extern void recompute_ntype_cnts A_(()); extern int create_pbs_node A_((char *, svrattrl *, int, int *)); extern int mgr_set_node_attr A_((struct pbsnode *, attribute_def *, int, svrattrl *, int, int *, void *, int)); struct prop *init_prop A_((char *pname)); #endif /* BATCH_REQUEST_H */ #endif /* PBS_NODES_H */ torque-2.4.16/src/include/site_qmgr_node_print.ht0000664000113300011330000001043011272401235017011 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: site_qmgr_node_print.ht 12 2005-02-22 20:59:54Z dev $ */ /* * list of site defined queue attribute names which qmgr should * include in its "print node" output * * format is (do include the quote marks): * "attribute_name", */ torque-2.4.16/src/include/site_svr_attr_def.ht0000664000113300011330000001100011272401235016276 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: site_svr_attr_def.ht 12 2005-02-22 20:59:54Z dev $ */ /* * Place holder for site supplied additions to the array of site * server attribute definitions, see server/svr_attr_def.c * * Array elements must be of the form: * { "name", * decode_Func, * encode_Func, * set_Func, * comp_Func, * free_Func, * action_routine, * permissions, * ATR_TYPE_*, * PARENT_TYPE_SERVER * }, * * Matching entry must be added in site_sv_attr_enum.h */ torque-2.4.16/src/include/sched_cmds.h0000664000113300011330000001120111272401235014503 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: sched_cmds.h 2367 2008-09-03 17:17:34Z josh $ */ /* server to scheduler commands: */ #define SCH_ERROR -1 #define SCH_SCHEDULE_NULL 0 #define SCH_SCHEDULE_NEW 1 /* New job queued or eligible */ #define SCH_SCHEDULE_TERM 2 /* Running job terminated */ #define SCH_SCHEDULE_TIME 3 /* Scheduler interval reached */ #define SCH_SCHEDULE_RECYC 4 /* Recycle scheduler after 1 run */ #define SCH_SCHEDULE_CMD 5 /* Schedule on command */ #define SCH_CONFIGURE 7 #define SCH_QUIT 8 #define SCH_RULESET 9 #define SCH_SCHEDULE_FIRST 10 /* First schedule after server starts */ torque-2.4.16/src/include/pbs_assert.h0000664000113300011330000001040211272401235014556 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: pbs_assert.h 2367 2008-09-03 17:17:34Z josh $ */ # ifndef NDEBUG # define assert(as) {if (!(as)){(void)fprintf(stderr,"Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}} # else # define assert(ex) # endif torque-2.4.16/src/include/qmgr_node_public.h0000664000113300011330000001060211272401235015724 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * This is a list of public node attributes * * FORMAT: * attr1, * attr2, <--- important the last has a comma after it * * This file will be used for the initialization of an array * * * @(#) $Id: qmgr_node_public.h 2367 2008-09-03 17:17:34Z josh $ */ ATTR_NODE_state, ATTR_NODE_properties, ATTR_NODE_np, ATTR_NODE_ntype, ATTR_NODE_status, ATTR_NODE_note, torque-2.4.16/src/include/cmds.h0000664000113300011330000001273211375011546013355 00000000000000#ifndef CMDS_H #define CMDS_H /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: cmds.h 3609 2010-05-17 21:08:44Z dbeer $ */ /* * cmds.h * * Header file for the PBS utilities. */ #include #include #include #include #include #include #include "pbs_error.h" #include "pbs_ifl.h" #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif #define notNULL(x) (((x)!=NULL) && (strlen(x)>(size_t)0)) #define NULLstr(x) (((x)==NULL) || (strlen(x)==0)) #define MAX_LINE_LEN 32768 /* increased from 2048 */ #define MAXSERVERNAME PBS_MAXSERVERNAME+PBS_MAXPORTNUM+2 #define PBS_DEPEND_LEN 65528 /* increased from 2040 */ extern int optind, opterr; extern char *optarg; int check_job_name A_((char *name, int)); time_t cvtdate A_((char *)); int get_server A_((char *, char *, char *)); int locate_job A_((char *, char *, char *)); int parse_destination_id A_((char *, char **, char **)); int parse_equal_string A_((char *, char **, char **)); int parse_jobid A_((char *, char **, char **, char **)); int prepare_path A_((char *, char *,char *)); void prt_error A_((char *, char *, int)); void set_attr A_((struct attrl **, char *, char *)); int set_resources A_((struct attrl **, char *, int)); int cnt2server A_((char *server)); void prt_job_err A_((char *, int, char *)); int parse_at_list A_((char *, int, int)); int parse_depend_list A_((char *, char *, int)); int parse_stage_list A_((char *)); int cnt2server_conf A_((long)); int TShowAbout(void); #endif torque-2.4.16/src/include/Makefile.am0000664000113300011330000000244211301310217014271 00000000000000include $(top_srcdir)/buildutils/config.mk include_HEADERS = pbs_error.h pbs_error_db.h pbs_ifl.h tm.h tm_.h rpp.h rm.h noinst_HEADERS = acct.h array.h assertions.h attribute.h batch_request.h \ cmds.h credential.h csv.h \ dis.h dis_init.h pbs_job.h libpbs.h list_link.h log.h Long_.h \ Long.h mcom.h md5.h mom_func.h net_connect.h pbs_assert.h \ pbs_nodes.h pbs_proto.h portability.h qmgr.h \ qmgr_node_public.h qmgr_node_readonly.h qmgr_que_public.h \ qmgr_que_readonly.h qmgr_svr_public.h qmgr_svr_readonly.h \ queue.h resmon.h resource.h sched_cmds.h server.h \ server_limits.h svrfunc.h tracking.h work_task.h \ port_forwarding.h pbs_cpa.h pbs_cpuset.h \ pbs_batchreqtype_db.h utils.h BUILT_SOURCES = site_job_attr_def.h site_job_attr_enum.h \ site_qmgr_node_print.h site_qmgr_que_print.h \ site_qmgr_svr_print.h site_que_attr_def.h \ site_que_attr_enum.h site_svr_attr_def.h \ site_svr_attr_enum.h EXTRA_DIST = site_job_attr_def.ht site_job_attr_enum.ht \ site_qmgr_node_print.ht site_qmgr_que_print.ht \ site_qmgr_svr_print.ht site_que_attr_def.ht \ site_que_attr_enum.ht site_svr_attr_def.ht \ site_svr_attr_enum.ht CLEANFILES = $(BUILT_SOURCES) SUFFIXES = .ht .h .ht.h: cp $< $@ dist-hook: (cd $(distdir) && rm -f $(BUILT_SOURCES)) torque-2.4.16/src/include/net_connect.h0000664000113300011330000001727711605403053014731 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Other Include Files Required * */ #define PBS_NET_H #ifndef PBS_NET_TYPE typedef unsigned long pbs_net_t; /* for holding host addresses */ #define PBS_NET_TYPE #endif #define PBS_NET_MAXCONNECTIDLE 900 #define PBS_NET_CONN_AUTHENTICATED 1 #define PBS_NET_CONN_FROM_PRIVIL 2 #define PBS_NET_CONN_NOTIMEOUT 4 #define PBS_SOCK_UNIX 1 #define PBS_SOCK_INET 2 /* ** Protocol numbers and versions for PBS communications. */ #define RM_PROTOCOL 1 /* resource monitor protocol number */ #define RM_PROTOCOL_VER 1 /* resmon protocol version number */ #define TM_PROTOCOL 2 /* task manager protocol number */ #define TM_PROTOCOL_VER 1 /* task manager protocol version number */ #define IM_PROTOCOL 3 /* inter-manager protocol number */ #define IM_PROTOCOL_VER 1 /* inter-manager protocol version number */ #define IS_PROTOCOL 4 /* inter-server protocol number */ #define IS_PROTOCOL_VER 1 /* inter-server protocol version number */ /* ** Types of Inter Server messages. */ /* sync w/PBSServerCmds[] in resmom/mom_main.c and PBSServerCmds2[] in server/node_manager.c */ #define IS_NULL 0 #define IS_HELLO 1 #define IS_CLUSTER_ADDRS 2 #define IS_UPDATE 3 #define IS_STATUS 4 /* return codes for client_to_svr() */ #define PBS_NET_RC_FATAL -1 #define PBS_NET_RC_RETRY -2 /* defines for unix sockets and creds */ #ifndef TSOCK_PATH #define TSOCK_PATH "/tmp/.torque-unix" #endif #ifndef SCM_CREDS #define SCM_CREDS SCM_CREDENTIALS #endif #ifndef linux # ifndef __NetBSD__ # define SPC_PEER_UID(c) ((c)->cr_uid) # define SPC_PEER_GID(c) ((c)->cr_groups[0]) # else # define SPC_PEER_UID(c) ((c)->sc_uid) # define SPC_PEER_GID(c) ((c)->sc_gid) # endif #else # define SPC_PEER_UID(c) ((c)->uid) # define SPC_PEER_GID(c) ((c)->gid) #endif #ifdef __NetBSD__ typedef struct sockcred ucreds; #else typedef struct ucred ucreds; #endif enum conn_type { Primary = 0, Secondary, FromClientASN, FromClientDIS, ToServerASN, ToServerDIS, TaskManagerDIS, Idle }; /* functions available in libnet.a */ void add_conn A_((int, enum conn_type, pbs_net_t, unsigned int, unsigned int, void (*func) A_((int)))); int find_conn A_((pbs_net_t)); int client_to_svr A_((pbs_net_t, unsigned int, int, char *)); void close_conn A_((int)); pbs_net_t get_connectaddr A_((int)); int get_connecthost A_((int sock, char *, int)); pbs_net_t get_hostaddr A_((char *)); int get_fullhostname A_((char *, char *, int, char *)); unsigned int get_svrport A_((char *, char *, unsigned int)); int init_network A_((unsigned int, void (*readfunc)())); void net_close A_((int)); int wait_request(time_t waittime, long *); void net_add_close_func A_((int, void(*)())); int get_max_num_descriptors(void); int get_fdset_size(void); char * netaddr_pbs_net_t A_((pbs_net_t)); struct connection { pbs_net_t cn_addr; /* internet address of client */ int cn_handle; /* handle for API, see svr_connect() */ unsigned int cn_port; /* internet port number of client */ unsigned short cn_authen; /* authentication flags */ unsigned short cn_socktype; /* authentication flags */ enum conn_type cn_active; /* idle or type if active */ time_t cn_lasttime; /* time last active */ void (*cn_func) A_((int)); /* read function when data rdy */ void (*cn_oncl) A_((int)); /* func to call on close */ }; struct netcounter { time_t time; int counter; }; int *netcounter_get(); #define MAXLISTENERS 3 typedef struct listener_connection { pbs_net_t address; /* internet address of listener */ unsigned int port; /* internet port number of listener */ int sock; /* socket for this connection */ int first_time; } listener_connection; torque-2.4.16/src/include/tm.h0000664000113300011330000001555211272401235013044 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: tm.h 2367 2008-09-03 17:17:34Z josh $ */ /* ** Header file defineing the datatypes and library visiable ** variables for paralell awareness. */ #include "tm_.h" /* ** The tm_roots structure contains data for the last ** tm_init call whose event has been polled. is the ** caller's identity. is the identity of the task that ** spawned the caller. If is the TM_NULL_TASK, the caller ** is the initial task of the job, running on job-relative ** node 0. */ struct tm_roots { tm_task_id tm_me; tm_task_id tm_parent; int tm_nnodes; int tm_ntasks; int tm_taskpoolid; tm_task_id *tm_tasklist; }; /* ** The tm_whattodo structure contains data for the last ** tm_register event polled. This is not implemented yet. */ typedef struct tm_whattodo { int tm_todo; tm_task_id tm_what; tm_node_id tm_where; } tm_whattodo_t; /* ** Prototypes for all the TM API calls. */ int tm_init(void *info, struct tm_roots *roots); int tm_poll(tm_event_t poll_event, tm_event_t *result_event, int wait, int *tm_errno); int tm_notify(int tm_signal); int tm_spawn(int argc, char *argv[], char *envp[], tm_node_id where, tm_task_id *tid, tm_event_t *event); int tm_kill(tm_task_id tid, int sig, tm_event_t *event); int tm_obit(tm_task_id tid, int *obitval, tm_event_t *event); int tm_nodeinfo(tm_node_id **list, int *nnodes); int tm_taskinfo(tm_node_id node, tm_task_id *list, int lsize, int *ntasks, tm_event_t *event); int tm_atnode(tm_task_id tid, tm_node_id *node); int tm_rescinfo(tm_node_id node, char *resource, int len, tm_event_t *event); int tm_publish(char *name, void *info, int nbytes, tm_event_t *event); int tm_subscribe(tm_task_id tid, char *name, void *info, int len, int *amount, tm_event_t *event); int tm_finalize(void); int tm_alloc(char *resources, tm_event_t *event); int tm_dealloc(tm_node_id node, tm_event_t *event); int tm_create_event(tm_event_t *event); int tm_destroy_event(tm_event_t *event); int tm_register(tm_whattodo_t *what, tm_event_t *event); /* * DJH 15 Nov 2001. * Generic "out-of-band" task adoption call for tasks parented by * another job management system. Minor security hole? * Cannot be called with any other tm call. * 26 Feb 2002. Allows id to be jobid (adoptCmd = TM_ADOPT_JOBID) * or some altid (adoptCmd = TM_ADOPT_ALTID) */ int tm_adopt(char *id, int adoptCmd, pid_t pid); torque-2.4.16/src/include/dis_init.h0000664000113300011330000001101611272401235014215 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @(#) $Id: dis_init.h 2367 2008-09-03 17:17:34Z josh $ */ #ifdef __STDC__ #define A_(x) x #else #define const #define volatile #define A_(x) () #endif extern int (*dis_getc) A_((int stream)); extern int (*dis_puts) A_((int stream, const char *string, size_t count)); extern int (*dis_gets) A_((int stream, char *string, size_t count)); extern int (*disr_skip) A_((int stream, size_t nskips)); extern int (*disw_commit) A_((int stream, int commit)); extern int (*disr_commit) A_((int stream, int commit)); torque-2.4.16/src/Makefile.in0000664000113300011330000004745111605403721012702 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter DIST_SUBDIRS = cmds iff lib resmom scheduler.cc server \ gui scheduler.basl include mom_rcp scheduler.tcl tools pam drmaa momctl @INCLUDE_SERVER_TRUE@SERVER_DIRS = server @SCHD_TYPE_SUBDIR@ @INCLUDE_MOM_TRUE@RESMOM_DIR = resmom momctl @INCLUDE_MOM_RCP_TRUE@@INCLUDE_MOM_TRUE@MOMRCP_DIR = mom_rcp @INCLUDE_MOM_TRUE@MOM_DIRS = $(RESMOM_DIR) $(MOMRCP_DIR) @INCLUDE_CLIENTS_TRUE@CLIENTS_DIRS = iff cmds tools momctl @INCLUDE_GUI_TRUE@GUI_DIRS = gui tools @INCLUDE_PAM_TRUE@PAM_DIRS = pam @INCLUDE_DRMAA_TRUE@DRMAA_DIRS = drmaa SUBDIRS = include lib $(SERVER_DIRS) $(MOM_DIRS) $(CLIENTS_DIRS) $(GUI_DIRS) $(PAM_DIRS) $(DRMAA_DIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am install_mom: for dir in $(MOM_DIRS) lib ;do (cd $$dir && $(MAKE) install);done install_server: for dir in $(SERVER_DIRS) lib ;do (cd $$dir && $(MAKE) install);done install_clients: for dir in $(CLIENTS_DIRS) lib ;do (cd $$dir && $(MAKE) install);done install_gui: for dir in $(GUI_DIRS) ;do (cd $$dir && $(MAKE) install_gui);done install_devel: for dir in include lib ;do (cd $$dir && $(MAKE) install);done install_lib: for dir in lib ;do (cd $$dir && $(MAKE) install);done install_pam: for dir in $(PAM_DIRS) ;do (cd $$dir && $(MAKE) install);done install_drmaa: for dir in $(DRMAA_DIRS) ;do (cd $$dir && $(MAKE) install);done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/0000777000113300011330000000000011614035170011451 500000000000000torque-2.4.16/src/lib/Libpbs/0000777000113300011330000000000011614035166012671 500000000000000torque-2.4.16/src/lib/Libpbs/Makefile.in0000664000113300011330000053765311605403737014702 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libtorque_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libpbs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libtorque_la_LIBADD = am_libtorque_la_OBJECTS = csv.lo dis.lo discui_.lo discul_.lo \ disi10d_.lo disi10l_.lo disiui_.lo disp10d_.lo disp10l_.lo \ disrcs.lo disrd.lo disrf.lo disrfcs.lo disrfst.lo disrl_.lo \ disrl.lo disrsc.lo disrsi_.lo disrsi.lo disrsl_.lo disrsl.lo \ disrss.lo disrst.lo disruc.lo disrui.lo disrul.lo disrus.lo \ diswcs.lo diswf.lo diswl_.lo diswsi.lo diswsl.lo diswui_.lo \ diswui.lo diswul.lo dec_attrl.lo dec_attropl.lo dec_Authen.lo \ dec_CpyFil.lo dec_JobCred.lo dec_JobFile.lo dec_JobId.lo \ dec_JobObit.lo dec_Manage.lo dec_MoveJob.lo dec_MsgJob.lo \ dec_QueueJob.lo dec_Reg.lo dec_ReqExt.lo dec_ReqHdr.lo \ dec_Resc.lo dec_ReturnFile.lo dec_rpyc.lo dec_rpys.lo \ dec_RunJob.lo dec_Shut.lo dec_Sig.lo dec_Status.lo \ dec_svrattrl.lo dec_Track.lo enc_attrl.lo enc_attropl.lo \ enc_CpyFil.lo enc_JobCred.lo enc_JobFile.lo enc_JobId.lo \ enc_JobObit.lo enc_Manage.lo enc_MoveJob.lo enc_MsgJob.lo \ enc_QueueJob.lo enc_Reg.lo enc_reply.lo enc_ReturnFile.lo \ enc_ReqExt.lo enc_ReqHdr.lo enc_RunJob.lo enc_Shut.lo \ enc_Sig.lo enc_Status.lo enc_svrattrl.lo enc_Track.lo \ get_svrport.lo nonblock.lo PBS_attr.lo pbsD_alterjo.lo \ pbsD_asyrun.lo PBS_data.lo pbsD_connect.lo pbsD_deljob.lo \ pbsD_holdjob.lo pbsD_chkptjob.lo pbsD_locjob.lo \ PBSD_manage2.lo pbsD_manager.lo pbsD_movejob.lo \ PBSD_manager_caps.lo PBSD_msg2.lo pbsD_msgjob.lo \ pbsD_orderjo.lo PBSD_rdrpy.lo pbsD_rerunjo.lo pbsD_resc.lo \ pbsD_rlsjob.lo pbsD_runjob.lo pbsD_selectj.lo PBSD_sig2.lo \ pbsD_sigjob.lo pbsD_stagein.lo pbsD_statjob.lo \ pbsD_statnode.lo pbsD_statque.lo pbsD_statsrv.lo \ PBSD_status2.lo PBSD_status.lo pbsD_submit.lo \ PBSD_submit_caps.lo pbsD_termin.lo pbs_geterrmg.lo \ pbs_statfree.lo rpp.lo tcp_dis.lo tm.lo list_link.lo \ ck_job_name.lo cnt2server.lo cvtdate.lo get_server.lo \ locate_job.lo parse_at.lo parse_depend.lo parse_destid.lo \ parse_equal.lo parse_jobid.lo parse_stage.lo prepare_path.lo \ prt_job_err.lo set_attr.lo set_resource.lo chk_file_sec.lo \ log_event.lo pbs_log.lo pbs_messages.lo setup_env.lo \ get_hostaddr.lo get_hostname.lo md5.lo net_client.lo \ net_server.lo net_set_clse.lo rm.lo port_forwarding.lo libtorque_la_OBJECTS = $(am_libtorque_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libtorque_la_SOURCES) DIST_SOURCES = $(libtorque_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/lib/Libdis -DIFF_PATH=\"$(IFF_PATH)\" \ -DPBS_DEFAULT_FILE=\"$(PBS_DEFAULT_FILE)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter EXTRA_DIST = ../Libdis/dis_.h lib_LTLIBRARIES = libtorque.la libtorque_la_LDFLAGS = -version-info 2:0:0 libtorque_la_SOURCES = ../Libcsv/csv.c ../Libdis/dis.c \ ../Libdis/discui_.c ../Libdis/discul_.c \ ../Libdis/disi10d_.c ../Libdis/disi10l_.c \ ../Libdis/disiui_.c ../Libdis/disp10d_.c \ ../Libdis/disp10l_.c ../Libdis/disrcs.c \ ../Libdis/disrd.c ../Libdis/disrf.c ../Libdis/disrfcs.c \ ../Libdis/disrfst.c ../Libdis/disrl_.c ../Libdis/disrl.c \ ../Libdis/disrsc.c ../Libdis/disrsi_.c \ ../Libdis/disrsi.c ../Libdis/disrsl_.c \ ../Libdis/disrsl.c ../Libdis/disrss.c ../Libdis/disrst.c \ ../Libdis/disruc.c ../Libdis/disrui.c ../Libdis/disrul.c \ ../Libdis/disrus.c ../Libdis/diswcs.c ../Libdis/diswf.c \ ../Libdis/diswl_.c ../Libdis/diswsi.c ../Libdis/diswsl.c \ ../Libdis/diswui_.c ../Libdis/diswui.c \ ../Libdis/diswul.c \ ../Libifl/dec_attrl.c ../Libifl/dec_attropl.c \ ../Libifl/dec_Authen.c ../Libifl/dec_CpyFil.c \ ../Libifl/dec_JobCred.c ../Libifl/dec_JobFile.c \ ../Libifl/dec_JobId.c ../Libifl/dec_JobObit.c \ ../Libifl/dec_Manage.c ../Libifl/dec_MoveJob.c \ ../Libifl/dec_MsgJob.c ../Libifl/dec_QueueJob.c \ ../Libifl/dec_Reg.c ../Libifl/dec_ReqExt.c \ ../Libifl/dec_ReqHdr.c ../Libifl/dec_Resc.c \ ../Libifl/dec_ReturnFile.c \ ../Libifl/dec_rpyc.c ../Libifl/dec_rpys.c \ ../Libifl/dec_RunJob.c ../Libifl/dec_Shut.c \ ../Libifl/dec_Sig.c ../Libifl/dec_Status.c \ ../Libifl/dec_svrattrl.c ../Libifl/dec_Track.c \ ../Libifl/enc_attrl.c ../Libifl/enc_attropl.c \ ../Libifl/enc_CpyFil.c ../Libifl/enc_JobCred.c \ ../Libifl/enc_JobFile.c ../Libifl/enc_JobId.c \ ../Libifl/enc_JobObit.c ../Libifl/enc_Manage.c \ ../Libifl/enc_MoveJob.c ../Libifl/enc_MsgJob.c \ ../Libifl/enc_QueueJob.c ../Libifl/enc_Reg.c \ ../Libifl/enc_reply.c ../Libifl/enc_ReturnFile.c \ ../Libifl/enc_ReqExt.c \ ../Libifl/enc_ReqHdr.c ../Libifl/enc_RunJob.c \ ../Libifl/enc_Shut.c ../Libifl/enc_Sig.c \ ../Libifl/enc_Status.c ../Libifl/enc_svrattrl.c \ ../Libifl/enc_Track.c ../Libifl/get_svrport.c \ ../Libifl/nonblock.c ../Libifl/PBS_attr.c \ ../Libifl/pbsD_alterjo.c ../Libifl/pbsD_asyrun.c \ ../Libifl/PBS_data.c ../Libifl/pbsD_connect.c \ ../Libifl/pbsD_deljob.c ../Libifl/pbsD_holdjob.c \ ../Libifl/pbsD_chkptjob.c ../Libifl/pbsD_locjob.c \ ../Libifl/PBSD_manage2.c ../Libifl/pbsD_manager.c \ ../Libifl/pbsD_movejob.c ../Libifl/PBSD_manager_caps.c \ ../Libifl/PBSD_msg2.c ../Libifl/pbsD_msgjob.c \ ../Libifl/pbsD_orderjo.c ../Libifl/PBSD_rdrpy.c \ ../Libifl/pbsD_rerunjo.c ../Libifl/pbsD_resc.c \ ../Libifl/pbsD_rlsjob.c ../Libifl/pbsD_runjob.c \ ../Libifl/pbsD_selectj.c ../Libifl/PBSD_sig2.c \ ../Libifl/pbsD_sigjob.c ../Libifl/pbsD_stagein.c \ ../Libifl/pbsD_statjob.c ../Libifl/pbsD_statnode.c \ ../Libifl/pbsD_statque.c ../Libifl/pbsD_statsrv.c \ ../Libifl/PBSD_status2.c ../Libifl/PBSD_status.c \ ../Libifl/pbsD_submit.c ../Libifl/PBSD_submit_caps.c \ ../Libifl/pbsD_termin.c ../Libifl/pbs_geterrmg.c \ ../Libifl/pbs_statfree.c ../Libifl/rpp.c \ ../Libifl/tcp_dis.c ../Libifl/tm.c ../Libifl/list_link.c \ ../Libcmds/ck_job_name.c ../Libcmds/cnt2server.c \ ../Libcmds/cvtdate.c ../Libcmds/get_server.c \ ../Libcmds/locate_job.c ../Libcmds/parse_at.c \ ../Libcmds/parse_depend.c ../Libcmds/parse_destid.c \ ../Libcmds/parse_equal.c ../Libcmds/parse_jobid.c \ ../Libcmds/parse_stage.c \ ../Libcmds/prepare_path.c ../Libcmds/prt_job_err.c \ ../Libcmds/set_attr.c ../Libcmds/set_resource.c \ ../Liblog/chk_file_sec.c ../Liblog/log_event.c \ ../Liblog/pbs_log.c ../Liblog/pbs_messages.c \ ../Liblog/setup_env.c \ ../Libnet/get_hostaddr.c ../Libnet/get_hostname.c \ ../Libnet/md5.c ../Libnet/net_client.c \ ../Libnet/net_server.c ../Libnet/net_set_clse.c \ ../Libnet/rm.c ../Libnet/port_forwarding.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libpbs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libpbs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtorque.la: $(libtorque_la_OBJECTS) $(libtorque_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libtorque_la_LDFLAGS) $(libtorque_la_OBJECTS) $(libtorque_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_manage2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_manager_caps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_msg2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_rdrpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_sig2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_status2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBSD_submit_caps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBS_attr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PBS_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chk_file_sec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck_job_name.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnt2server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvtdate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Authen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_CpyFil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_JobCred.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_JobFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_JobId.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_JobObit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Manage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_MoveJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_MsgJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_QueueJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Reg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_ReqExt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_ReqHdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Resc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_ReturnFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_RunJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Shut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Sig.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_Track.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_attrl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_attropl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_rpyc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_rpys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_svrattrl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/discui_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/discul_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disi10d_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disi10l_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disiui_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disp10d_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disp10l_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrcs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrfcs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrfst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrl_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrsc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrsi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrsi_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrsl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrsl_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disruc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrui.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrul.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disrus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswcs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswl_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswsi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswsl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswui.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswui_.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diswul.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_CpyFil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_JobCred.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_JobFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_JobId.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_JobObit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_Manage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_MoveJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_MsgJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_QueueJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_Reg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_ReqExt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_ReqHdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_ReturnFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_RunJob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_Shut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_Sig.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_Status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_Track.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_attrl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_attropl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_reply.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_svrattrl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_hostaddr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_hostname.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_svrport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_link.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locate_job.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log_event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_set_clse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonblock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_at.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_depend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_destid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_equal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_jobid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_stage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_alterjo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_asyrun.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_chkptjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_deljob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_holdjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_locjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_movejob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_msgjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_orderjo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_rerunjo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_resc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_rlsjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_runjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_selectj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_sigjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_stagein.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_statjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_statnode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_statque.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_statsrv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_submit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbsD_termin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_geterrmg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_messages.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_statfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/port_forwarding.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prepare_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prt_job_err.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_attr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_resource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setup_env.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcp_dis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tm.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< csv.lo: ../Libcsv/csv.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT csv.lo -MD -MP -MF "$(DEPDIR)/csv.Tpo" -c -o csv.lo `test -f '../Libcsv/csv.c' || echo '$(srcdir)/'`../Libcsv/csv.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/csv.Tpo" "$(DEPDIR)/csv.Plo"; else rm -f "$(DEPDIR)/csv.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcsv/csv.c' object='csv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o csv.lo `test -f '../Libcsv/csv.c' || echo '$(srcdir)/'`../Libcsv/csv.c dis.lo: ../Libdis/dis.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dis.lo -MD -MP -MF "$(DEPDIR)/dis.Tpo" -c -o dis.lo `test -f '../Libdis/dis.c' || echo '$(srcdir)/'`../Libdis/dis.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dis.Tpo" "$(DEPDIR)/dis.Plo"; else rm -f "$(DEPDIR)/dis.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/dis.c' object='dis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dis.lo `test -f '../Libdis/dis.c' || echo '$(srcdir)/'`../Libdis/dis.c discui_.lo: ../Libdis/discui_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT discui_.lo -MD -MP -MF "$(DEPDIR)/discui_.Tpo" -c -o discui_.lo `test -f '../Libdis/discui_.c' || echo '$(srcdir)/'`../Libdis/discui_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/discui_.Tpo" "$(DEPDIR)/discui_.Plo"; else rm -f "$(DEPDIR)/discui_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/discui_.c' object='discui_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o discui_.lo `test -f '../Libdis/discui_.c' || echo '$(srcdir)/'`../Libdis/discui_.c discul_.lo: ../Libdis/discul_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT discul_.lo -MD -MP -MF "$(DEPDIR)/discul_.Tpo" -c -o discul_.lo `test -f '../Libdis/discul_.c' || echo '$(srcdir)/'`../Libdis/discul_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/discul_.Tpo" "$(DEPDIR)/discul_.Plo"; else rm -f "$(DEPDIR)/discul_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/discul_.c' object='discul_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o discul_.lo `test -f '../Libdis/discul_.c' || echo '$(srcdir)/'`../Libdis/discul_.c disi10d_.lo: ../Libdis/disi10d_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disi10d_.lo -MD -MP -MF "$(DEPDIR)/disi10d_.Tpo" -c -o disi10d_.lo `test -f '../Libdis/disi10d_.c' || echo '$(srcdir)/'`../Libdis/disi10d_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disi10d_.Tpo" "$(DEPDIR)/disi10d_.Plo"; else rm -f "$(DEPDIR)/disi10d_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disi10d_.c' object='disi10d_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disi10d_.lo `test -f '../Libdis/disi10d_.c' || echo '$(srcdir)/'`../Libdis/disi10d_.c disi10l_.lo: ../Libdis/disi10l_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disi10l_.lo -MD -MP -MF "$(DEPDIR)/disi10l_.Tpo" -c -o disi10l_.lo `test -f '../Libdis/disi10l_.c' || echo '$(srcdir)/'`../Libdis/disi10l_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disi10l_.Tpo" "$(DEPDIR)/disi10l_.Plo"; else rm -f "$(DEPDIR)/disi10l_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disi10l_.c' object='disi10l_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disi10l_.lo `test -f '../Libdis/disi10l_.c' || echo '$(srcdir)/'`../Libdis/disi10l_.c disiui_.lo: ../Libdis/disiui_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disiui_.lo -MD -MP -MF "$(DEPDIR)/disiui_.Tpo" -c -o disiui_.lo `test -f '../Libdis/disiui_.c' || echo '$(srcdir)/'`../Libdis/disiui_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disiui_.Tpo" "$(DEPDIR)/disiui_.Plo"; else rm -f "$(DEPDIR)/disiui_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disiui_.c' object='disiui_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disiui_.lo `test -f '../Libdis/disiui_.c' || echo '$(srcdir)/'`../Libdis/disiui_.c disp10d_.lo: ../Libdis/disp10d_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disp10d_.lo -MD -MP -MF "$(DEPDIR)/disp10d_.Tpo" -c -o disp10d_.lo `test -f '../Libdis/disp10d_.c' || echo '$(srcdir)/'`../Libdis/disp10d_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disp10d_.Tpo" "$(DEPDIR)/disp10d_.Plo"; else rm -f "$(DEPDIR)/disp10d_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disp10d_.c' object='disp10d_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disp10d_.lo `test -f '../Libdis/disp10d_.c' || echo '$(srcdir)/'`../Libdis/disp10d_.c disp10l_.lo: ../Libdis/disp10l_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disp10l_.lo -MD -MP -MF "$(DEPDIR)/disp10l_.Tpo" -c -o disp10l_.lo `test -f '../Libdis/disp10l_.c' || echo '$(srcdir)/'`../Libdis/disp10l_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disp10l_.Tpo" "$(DEPDIR)/disp10l_.Plo"; else rm -f "$(DEPDIR)/disp10l_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disp10l_.c' object='disp10l_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disp10l_.lo `test -f '../Libdis/disp10l_.c' || echo '$(srcdir)/'`../Libdis/disp10l_.c disrcs.lo: ../Libdis/disrcs.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrcs.lo -MD -MP -MF "$(DEPDIR)/disrcs.Tpo" -c -o disrcs.lo `test -f '../Libdis/disrcs.c' || echo '$(srcdir)/'`../Libdis/disrcs.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrcs.Tpo" "$(DEPDIR)/disrcs.Plo"; else rm -f "$(DEPDIR)/disrcs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrcs.c' object='disrcs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrcs.lo `test -f '../Libdis/disrcs.c' || echo '$(srcdir)/'`../Libdis/disrcs.c disrd.lo: ../Libdis/disrd.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrd.lo -MD -MP -MF "$(DEPDIR)/disrd.Tpo" -c -o disrd.lo `test -f '../Libdis/disrd.c' || echo '$(srcdir)/'`../Libdis/disrd.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrd.Tpo" "$(DEPDIR)/disrd.Plo"; else rm -f "$(DEPDIR)/disrd.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrd.c' object='disrd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrd.lo `test -f '../Libdis/disrd.c' || echo '$(srcdir)/'`../Libdis/disrd.c disrf.lo: ../Libdis/disrf.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrf.lo -MD -MP -MF "$(DEPDIR)/disrf.Tpo" -c -o disrf.lo `test -f '../Libdis/disrf.c' || echo '$(srcdir)/'`../Libdis/disrf.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrf.Tpo" "$(DEPDIR)/disrf.Plo"; else rm -f "$(DEPDIR)/disrf.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrf.c' object='disrf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrf.lo `test -f '../Libdis/disrf.c' || echo '$(srcdir)/'`../Libdis/disrf.c disrfcs.lo: ../Libdis/disrfcs.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrfcs.lo -MD -MP -MF "$(DEPDIR)/disrfcs.Tpo" -c -o disrfcs.lo `test -f '../Libdis/disrfcs.c' || echo '$(srcdir)/'`../Libdis/disrfcs.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrfcs.Tpo" "$(DEPDIR)/disrfcs.Plo"; else rm -f "$(DEPDIR)/disrfcs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrfcs.c' object='disrfcs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrfcs.lo `test -f '../Libdis/disrfcs.c' || echo '$(srcdir)/'`../Libdis/disrfcs.c disrfst.lo: ../Libdis/disrfst.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrfst.lo -MD -MP -MF "$(DEPDIR)/disrfst.Tpo" -c -o disrfst.lo `test -f '../Libdis/disrfst.c' || echo '$(srcdir)/'`../Libdis/disrfst.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrfst.Tpo" "$(DEPDIR)/disrfst.Plo"; else rm -f "$(DEPDIR)/disrfst.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrfst.c' object='disrfst.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrfst.lo `test -f '../Libdis/disrfst.c' || echo '$(srcdir)/'`../Libdis/disrfst.c disrl_.lo: ../Libdis/disrl_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrl_.lo -MD -MP -MF "$(DEPDIR)/disrl_.Tpo" -c -o disrl_.lo `test -f '../Libdis/disrl_.c' || echo '$(srcdir)/'`../Libdis/disrl_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrl_.Tpo" "$(DEPDIR)/disrl_.Plo"; else rm -f "$(DEPDIR)/disrl_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrl_.c' object='disrl_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrl_.lo `test -f '../Libdis/disrl_.c' || echo '$(srcdir)/'`../Libdis/disrl_.c disrl.lo: ../Libdis/disrl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrl.lo -MD -MP -MF "$(DEPDIR)/disrl.Tpo" -c -o disrl.lo `test -f '../Libdis/disrl.c' || echo '$(srcdir)/'`../Libdis/disrl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrl.Tpo" "$(DEPDIR)/disrl.Plo"; else rm -f "$(DEPDIR)/disrl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrl.c' object='disrl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrl.lo `test -f '../Libdis/disrl.c' || echo '$(srcdir)/'`../Libdis/disrl.c disrsc.lo: ../Libdis/disrsc.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrsc.lo -MD -MP -MF "$(DEPDIR)/disrsc.Tpo" -c -o disrsc.lo `test -f '../Libdis/disrsc.c' || echo '$(srcdir)/'`../Libdis/disrsc.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrsc.Tpo" "$(DEPDIR)/disrsc.Plo"; else rm -f "$(DEPDIR)/disrsc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrsc.c' object='disrsc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrsc.lo `test -f '../Libdis/disrsc.c' || echo '$(srcdir)/'`../Libdis/disrsc.c disrsi_.lo: ../Libdis/disrsi_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrsi_.lo -MD -MP -MF "$(DEPDIR)/disrsi_.Tpo" -c -o disrsi_.lo `test -f '../Libdis/disrsi_.c' || echo '$(srcdir)/'`../Libdis/disrsi_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrsi_.Tpo" "$(DEPDIR)/disrsi_.Plo"; else rm -f "$(DEPDIR)/disrsi_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrsi_.c' object='disrsi_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrsi_.lo `test -f '../Libdis/disrsi_.c' || echo '$(srcdir)/'`../Libdis/disrsi_.c disrsi.lo: ../Libdis/disrsi.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrsi.lo -MD -MP -MF "$(DEPDIR)/disrsi.Tpo" -c -o disrsi.lo `test -f '../Libdis/disrsi.c' || echo '$(srcdir)/'`../Libdis/disrsi.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrsi.Tpo" "$(DEPDIR)/disrsi.Plo"; else rm -f "$(DEPDIR)/disrsi.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrsi.c' object='disrsi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrsi.lo `test -f '../Libdis/disrsi.c' || echo '$(srcdir)/'`../Libdis/disrsi.c disrsl_.lo: ../Libdis/disrsl_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrsl_.lo -MD -MP -MF "$(DEPDIR)/disrsl_.Tpo" -c -o disrsl_.lo `test -f '../Libdis/disrsl_.c' || echo '$(srcdir)/'`../Libdis/disrsl_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrsl_.Tpo" "$(DEPDIR)/disrsl_.Plo"; else rm -f "$(DEPDIR)/disrsl_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrsl_.c' object='disrsl_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrsl_.lo `test -f '../Libdis/disrsl_.c' || echo '$(srcdir)/'`../Libdis/disrsl_.c disrsl.lo: ../Libdis/disrsl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrsl.lo -MD -MP -MF "$(DEPDIR)/disrsl.Tpo" -c -o disrsl.lo `test -f '../Libdis/disrsl.c' || echo '$(srcdir)/'`../Libdis/disrsl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrsl.Tpo" "$(DEPDIR)/disrsl.Plo"; else rm -f "$(DEPDIR)/disrsl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrsl.c' object='disrsl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrsl.lo `test -f '../Libdis/disrsl.c' || echo '$(srcdir)/'`../Libdis/disrsl.c disrss.lo: ../Libdis/disrss.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrss.lo -MD -MP -MF "$(DEPDIR)/disrss.Tpo" -c -o disrss.lo `test -f '../Libdis/disrss.c' || echo '$(srcdir)/'`../Libdis/disrss.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrss.Tpo" "$(DEPDIR)/disrss.Plo"; else rm -f "$(DEPDIR)/disrss.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrss.c' object='disrss.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrss.lo `test -f '../Libdis/disrss.c' || echo '$(srcdir)/'`../Libdis/disrss.c disrst.lo: ../Libdis/disrst.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrst.lo -MD -MP -MF "$(DEPDIR)/disrst.Tpo" -c -o disrst.lo `test -f '../Libdis/disrst.c' || echo '$(srcdir)/'`../Libdis/disrst.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrst.Tpo" "$(DEPDIR)/disrst.Plo"; else rm -f "$(DEPDIR)/disrst.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrst.c' object='disrst.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrst.lo `test -f '../Libdis/disrst.c' || echo '$(srcdir)/'`../Libdis/disrst.c disruc.lo: ../Libdis/disruc.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disruc.lo -MD -MP -MF "$(DEPDIR)/disruc.Tpo" -c -o disruc.lo `test -f '../Libdis/disruc.c' || echo '$(srcdir)/'`../Libdis/disruc.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disruc.Tpo" "$(DEPDIR)/disruc.Plo"; else rm -f "$(DEPDIR)/disruc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disruc.c' object='disruc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disruc.lo `test -f '../Libdis/disruc.c' || echo '$(srcdir)/'`../Libdis/disruc.c disrui.lo: ../Libdis/disrui.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrui.lo -MD -MP -MF "$(DEPDIR)/disrui.Tpo" -c -o disrui.lo `test -f '../Libdis/disrui.c' || echo '$(srcdir)/'`../Libdis/disrui.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrui.Tpo" "$(DEPDIR)/disrui.Plo"; else rm -f "$(DEPDIR)/disrui.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrui.c' object='disrui.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrui.lo `test -f '../Libdis/disrui.c' || echo '$(srcdir)/'`../Libdis/disrui.c disrul.lo: ../Libdis/disrul.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrul.lo -MD -MP -MF "$(DEPDIR)/disrul.Tpo" -c -o disrul.lo `test -f '../Libdis/disrul.c' || echo '$(srcdir)/'`../Libdis/disrul.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrul.Tpo" "$(DEPDIR)/disrul.Plo"; else rm -f "$(DEPDIR)/disrul.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrul.c' object='disrul.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrul.lo `test -f '../Libdis/disrul.c' || echo '$(srcdir)/'`../Libdis/disrul.c disrus.lo: ../Libdis/disrus.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT disrus.lo -MD -MP -MF "$(DEPDIR)/disrus.Tpo" -c -o disrus.lo `test -f '../Libdis/disrus.c' || echo '$(srcdir)/'`../Libdis/disrus.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/disrus.Tpo" "$(DEPDIR)/disrus.Plo"; else rm -f "$(DEPDIR)/disrus.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/disrus.c' object='disrus.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o disrus.lo `test -f '../Libdis/disrus.c' || echo '$(srcdir)/'`../Libdis/disrus.c diswcs.lo: ../Libdis/diswcs.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswcs.lo -MD -MP -MF "$(DEPDIR)/diswcs.Tpo" -c -o diswcs.lo `test -f '../Libdis/diswcs.c' || echo '$(srcdir)/'`../Libdis/diswcs.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswcs.Tpo" "$(DEPDIR)/diswcs.Plo"; else rm -f "$(DEPDIR)/diswcs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswcs.c' object='diswcs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswcs.lo `test -f '../Libdis/diswcs.c' || echo '$(srcdir)/'`../Libdis/diswcs.c diswf.lo: ../Libdis/diswf.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswf.lo -MD -MP -MF "$(DEPDIR)/diswf.Tpo" -c -o diswf.lo `test -f '../Libdis/diswf.c' || echo '$(srcdir)/'`../Libdis/diswf.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswf.Tpo" "$(DEPDIR)/diswf.Plo"; else rm -f "$(DEPDIR)/diswf.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswf.c' object='diswf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswf.lo `test -f '../Libdis/diswf.c' || echo '$(srcdir)/'`../Libdis/diswf.c diswl_.lo: ../Libdis/diswl_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswl_.lo -MD -MP -MF "$(DEPDIR)/diswl_.Tpo" -c -o diswl_.lo `test -f '../Libdis/diswl_.c' || echo '$(srcdir)/'`../Libdis/diswl_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswl_.Tpo" "$(DEPDIR)/diswl_.Plo"; else rm -f "$(DEPDIR)/diswl_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswl_.c' object='diswl_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswl_.lo `test -f '../Libdis/diswl_.c' || echo '$(srcdir)/'`../Libdis/diswl_.c diswsi.lo: ../Libdis/diswsi.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswsi.lo -MD -MP -MF "$(DEPDIR)/diswsi.Tpo" -c -o diswsi.lo `test -f '../Libdis/diswsi.c' || echo '$(srcdir)/'`../Libdis/diswsi.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswsi.Tpo" "$(DEPDIR)/diswsi.Plo"; else rm -f "$(DEPDIR)/diswsi.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswsi.c' object='diswsi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswsi.lo `test -f '../Libdis/diswsi.c' || echo '$(srcdir)/'`../Libdis/diswsi.c diswsl.lo: ../Libdis/diswsl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswsl.lo -MD -MP -MF "$(DEPDIR)/diswsl.Tpo" -c -o diswsl.lo `test -f '../Libdis/diswsl.c' || echo '$(srcdir)/'`../Libdis/diswsl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswsl.Tpo" "$(DEPDIR)/diswsl.Plo"; else rm -f "$(DEPDIR)/diswsl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswsl.c' object='diswsl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswsl.lo `test -f '../Libdis/diswsl.c' || echo '$(srcdir)/'`../Libdis/diswsl.c diswui_.lo: ../Libdis/diswui_.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswui_.lo -MD -MP -MF "$(DEPDIR)/diswui_.Tpo" -c -o diswui_.lo `test -f '../Libdis/diswui_.c' || echo '$(srcdir)/'`../Libdis/diswui_.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswui_.Tpo" "$(DEPDIR)/diswui_.Plo"; else rm -f "$(DEPDIR)/diswui_.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswui_.c' object='diswui_.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswui_.lo `test -f '../Libdis/diswui_.c' || echo '$(srcdir)/'`../Libdis/diswui_.c diswui.lo: ../Libdis/diswui.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswui.lo -MD -MP -MF "$(DEPDIR)/diswui.Tpo" -c -o diswui.lo `test -f '../Libdis/diswui.c' || echo '$(srcdir)/'`../Libdis/diswui.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswui.Tpo" "$(DEPDIR)/diswui.Plo"; else rm -f "$(DEPDIR)/diswui.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswui.c' object='diswui.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswui.lo `test -f '../Libdis/diswui.c' || echo '$(srcdir)/'`../Libdis/diswui.c diswul.lo: ../Libdis/diswul.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT diswul.lo -MD -MP -MF "$(DEPDIR)/diswul.Tpo" -c -o diswul.lo `test -f '../Libdis/diswul.c' || echo '$(srcdir)/'`../Libdis/diswul.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diswul.Tpo" "$(DEPDIR)/diswul.Plo"; else rm -f "$(DEPDIR)/diswul.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libdis/diswul.c' object='diswul.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o diswul.lo `test -f '../Libdis/diswul.c' || echo '$(srcdir)/'`../Libdis/diswul.c dec_attrl.lo: ../Libifl/dec_attrl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_attrl.lo -MD -MP -MF "$(DEPDIR)/dec_attrl.Tpo" -c -o dec_attrl.lo `test -f '../Libifl/dec_attrl.c' || echo '$(srcdir)/'`../Libifl/dec_attrl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_attrl.Tpo" "$(DEPDIR)/dec_attrl.Plo"; else rm -f "$(DEPDIR)/dec_attrl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_attrl.c' object='dec_attrl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_attrl.lo `test -f '../Libifl/dec_attrl.c' || echo '$(srcdir)/'`../Libifl/dec_attrl.c dec_attropl.lo: ../Libifl/dec_attropl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_attropl.lo -MD -MP -MF "$(DEPDIR)/dec_attropl.Tpo" -c -o dec_attropl.lo `test -f '../Libifl/dec_attropl.c' || echo '$(srcdir)/'`../Libifl/dec_attropl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_attropl.Tpo" "$(DEPDIR)/dec_attropl.Plo"; else rm -f "$(DEPDIR)/dec_attropl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_attropl.c' object='dec_attropl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_attropl.lo `test -f '../Libifl/dec_attropl.c' || echo '$(srcdir)/'`../Libifl/dec_attropl.c dec_Authen.lo: ../Libifl/dec_Authen.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Authen.lo -MD -MP -MF "$(DEPDIR)/dec_Authen.Tpo" -c -o dec_Authen.lo `test -f '../Libifl/dec_Authen.c' || echo '$(srcdir)/'`../Libifl/dec_Authen.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Authen.Tpo" "$(DEPDIR)/dec_Authen.Plo"; else rm -f "$(DEPDIR)/dec_Authen.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Authen.c' object='dec_Authen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Authen.lo `test -f '../Libifl/dec_Authen.c' || echo '$(srcdir)/'`../Libifl/dec_Authen.c dec_CpyFil.lo: ../Libifl/dec_CpyFil.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_CpyFil.lo -MD -MP -MF "$(DEPDIR)/dec_CpyFil.Tpo" -c -o dec_CpyFil.lo `test -f '../Libifl/dec_CpyFil.c' || echo '$(srcdir)/'`../Libifl/dec_CpyFil.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_CpyFil.Tpo" "$(DEPDIR)/dec_CpyFil.Plo"; else rm -f "$(DEPDIR)/dec_CpyFil.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_CpyFil.c' object='dec_CpyFil.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_CpyFil.lo `test -f '../Libifl/dec_CpyFil.c' || echo '$(srcdir)/'`../Libifl/dec_CpyFil.c dec_JobCred.lo: ../Libifl/dec_JobCred.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_JobCred.lo -MD -MP -MF "$(DEPDIR)/dec_JobCred.Tpo" -c -o dec_JobCred.lo `test -f '../Libifl/dec_JobCred.c' || echo '$(srcdir)/'`../Libifl/dec_JobCred.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_JobCred.Tpo" "$(DEPDIR)/dec_JobCred.Plo"; else rm -f "$(DEPDIR)/dec_JobCred.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_JobCred.c' object='dec_JobCred.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_JobCred.lo `test -f '../Libifl/dec_JobCred.c' || echo '$(srcdir)/'`../Libifl/dec_JobCred.c dec_JobFile.lo: ../Libifl/dec_JobFile.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_JobFile.lo -MD -MP -MF "$(DEPDIR)/dec_JobFile.Tpo" -c -o dec_JobFile.lo `test -f '../Libifl/dec_JobFile.c' || echo '$(srcdir)/'`../Libifl/dec_JobFile.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_JobFile.Tpo" "$(DEPDIR)/dec_JobFile.Plo"; else rm -f "$(DEPDIR)/dec_JobFile.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_JobFile.c' object='dec_JobFile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_JobFile.lo `test -f '../Libifl/dec_JobFile.c' || echo '$(srcdir)/'`../Libifl/dec_JobFile.c dec_JobId.lo: ../Libifl/dec_JobId.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_JobId.lo -MD -MP -MF "$(DEPDIR)/dec_JobId.Tpo" -c -o dec_JobId.lo `test -f '../Libifl/dec_JobId.c' || echo '$(srcdir)/'`../Libifl/dec_JobId.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_JobId.Tpo" "$(DEPDIR)/dec_JobId.Plo"; else rm -f "$(DEPDIR)/dec_JobId.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_JobId.c' object='dec_JobId.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_JobId.lo `test -f '../Libifl/dec_JobId.c' || echo '$(srcdir)/'`../Libifl/dec_JobId.c dec_JobObit.lo: ../Libifl/dec_JobObit.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_JobObit.lo -MD -MP -MF "$(DEPDIR)/dec_JobObit.Tpo" -c -o dec_JobObit.lo `test -f '../Libifl/dec_JobObit.c' || echo '$(srcdir)/'`../Libifl/dec_JobObit.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_JobObit.Tpo" "$(DEPDIR)/dec_JobObit.Plo"; else rm -f "$(DEPDIR)/dec_JobObit.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_JobObit.c' object='dec_JobObit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_JobObit.lo `test -f '../Libifl/dec_JobObit.c' || echo '$(srcdir)/'`../Libifl/dec_JobObit.c dec_Manage.lo: ../Libifl/dec_Manage.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Manage.lo -MD -MP -MF "$(DEPDIR)/dec_Manage.Tpo" -c -o dec_Manage.lo `test -f '../Libifl/dec_Manage.c' || echo '$(srcdir)/'`../Libifl/dec_Manage.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Manage.Tpo" "$(DEPDIR)/dec_Manage.Plo"; else rm -f "$(DEPDIR)/dec_Manage.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Manage.c' object='dec_Manage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Manage.lo `test -f '../Libifl/dec_Manage.c' || echo '$(srcdir)/'`../Libifl/dec_Manage.c dec_MoveJob.lo: ../Libifl/dec_MoveJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_MoveJob.lo -MD -MP -MF "$(DEPDIR)/dec_MoveJob.Tpo" -c -o dec_MoveJob.lo `test -f '../Libifl/dec_MoveJob.c' || echo '$(srcdir)/'`../Libifl/dec_MoveJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_MoveJob.Tpo" "$(DEPDIR)/dec_MoveJob.Plo"; else rm -f "$(DEPDIR)/dec_MoveJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_MoveJob.c' object='dec_MoveJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_MoveJob.lo `test -f '../Libifl/dec_MoveJob.c' || echo '$(srcdir)/'`../Libifl/dec_MoveJob.c dec_MsgJob.lo: ../Libifl/dec_MsgJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_MsgJob.lo -MD -MP -MF "$(DEPDIR)/dec_MsgJob.Tpo" -c -o dec_MsgJob.lo `test -f '../Libifl/dec_MsgJob.c' || echo '$(srcdir)/'`../Libifl/dec_MsgJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_MsgJob.Tpo" "$(DEPDIR)/dec_MsgJob.Plo"; else rm -f "$(DEPDIR)/dec_MsgJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_MsgJob.c' object='dec_MsgJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_MsgJob.lo `test -f '../Libifl/dec_MsgJob.c' || echo '$(srcdir)/'`../Libifl/dec_MsgJob.c dec_QueueJob.lo: ../Libifl/dec_QueueJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_QueueJob.lo -MD -MP -MF "$(DEPDIR)/dec_QueueJob.Tpo" -c -o dec_QueueJob.lo `test -f '../Libifl/dec_QueueJob.c' || echo '$(srcdir)/'`../Libifl/dec_QueueJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_QueueJob.Tpo" "$(DEPDIR)/dec_QueueJob.Plo"; else rm -f "$(DEPDIR)/dec_QueueJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_QueueJob.c' object='dec_QueueJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_QueueJob.lo `test -f '../Libifl/dec_QueueJob.c' || echo '$(srcdir)/'`../Libifl/dec_QueueJob.c dec_Reg.lo: ../Libifl/dec_Reg.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Reg.lo -MD -MP -MF "$(DEPDIR)/dec_Reg.Tpo" -c -o dec_Reg.lo `test -f '../Libifl/dec_Reg.c' || echo '$(srcdir)/'`../Libifl/dec_Reg.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Reg.Tpo" "$(DEPDIR)/dec_Reg.Plo"; else rm -f "$(DEPDIR)/dec_Reg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Reg.c' object='dec_Reg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Reg.lo `test -f '../Libifl/dec_Reg.c' || echo '$(srcdir)/'`../Libifl/dec_Reg.c dec_ReqExt.lo: ../Libifl/dec_ReqExt.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_ReqExt.lo -MD -MP -MF "$(DEPDIR)/dec_ReqExt.Tpo" -c -o dec_ReqExt.lo `test -f '../Libifl/dec_ReqExt.c' || echo '$(srcdir)/'`../Libifl/dec_ReqExt.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_ReqExt.Tpo" "$(DEPDIR)/dec_ReqExt.Plo"; else rm -f "$(DEPDIR)/dec_ReqExt.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_ReqExt.c' object='dec_ReqExt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_ReqExt.lo `test -f '../Libifl/dec_ReqExt.c' || echo '$(srcdir)/'`../Libifl/dec_ReqExt.c dec_ReqHdr.lo: ../Libifl/dec_ReqHdr.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_ReqHdr.lo -MD -MP -MF "$(DEPDIR)/dec_ReqHdr.Tpo" -c -o dec_ReqHdr.lo `test -f '../Libifl/dec_ReqHdr.c' || echo '$(srcdir)/'`../Libifl/dec_ReqHdr.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_ReqHdr.Tpo" "$(DEPDIR)/dec_ReqHdr.Plo"; else rm -f "$(DEPDIR)/dec_ReqHdr.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_ReqHdr.c' object='dec_ReqHdr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_ReqHdr.lo `test -f '../Libifl/dec_ReqHdr.c' || echo '$(srcdir)/'`../Libifl/dec_ReqHdr.c dec_Resc.lo: ../Libifl/dec_Resc.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Resc.lo -MD -MP -MF "$(DEPDIR)/dec_Resc.Tpo" -c -o dec_Resc.lo `test -f '../Libifl/dec_Resc.c' || echo '$(srcdir)/'`../Libifl/dec_Resc.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Resc.Tpo" "$(DEPDIR)/dec_Resc.Plo"; else rm -f "$(DEPDIR)/dec_Resc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Resc.c' object='dec_Resc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Resc.lo `test -f '../Libifl/dec_Resc.c' || echo '$(srcdir)/'`../Libifl/dec_Resc.c dec_ReturnFile.lo: ../Libifl/dec_ReturnFile.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_ReturnFile.lo -MD -MP -MF "$(DEPDIR)/dec_ReturnFile.Tpo" -c -o dec_ReturnFile.lo `test -f '../Libifl/dec_ReturnFile.c' || echo '$(srcdir)/'`../Libifl/dec_ReturnFile.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_ReturnFile.Tpo" "$(DEPDIR)/dec_ReturnFile.Plo"; else rm -f "$(DEPDIR)/dec_ReturnFile.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_ReturnFile.c' object='dec_ReturnFile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_ReturnFile.lo `test -f '../Libifl/dec_ReturnFile.c' || echo '$(srcdir)/'`../Libifl/dec_ReturnFile.c dec_rpyc.lo: ../Libifl/dec_rpyc.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_rpyc.lo -MD -MP -MF "$(DEPDIR)/dec_rpyc.Tpo" -c -o dec_rpyc.lo `test -f '../Libifl/dec_rpyc.c' || echo '$(srcdir)/'`../Libifl/dec_rpyc.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_rpyc.Tpo" "$(DEPDIR)/dec_rpyc.Plo"; else rm -f "$(DEPDIR)/dec_rpyc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_rpyc.c' object='dec_rpyc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_rpyc.lo `test -f '../Libifl/dec_rpyc.c' || echo '$(srcdir)/'`../Libifl/dec_rpyc.c dec_rpys.lo: ../Libifl/dec_rpys.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_rpys.lo -MD -MP -MF "$(DEPDIR)/dec_rpys.Tpo" -c -o dec_rpys.lo `test -f '../Libifl/dec_rpys.c' || echo '$(srcdir)/'`../Libifl/dec_rpys.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_rpys.Tpo" "$(DEPDIR)/dec_rpys.Plo"; else rm -f "$(DEPDIR)/dec_rpys.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_rpys.c' object='dec_rpys.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_rpys.lo `test -f '../Libifl/dec_rpys.c' || echo '$(srcdir)/'`../Libifl/dec_rpys.c dec_RunJob.lo: ../Libifl/dec_RunJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_RunJob.lo -MD -MP -MF "$(DEPDIR)/dec_RunJob.Tpo" -c -o dec_RunJob.lo `test -f '../Libifl/dec_RunJob.c' || echo '$(srcdir)/'`../Libifl/dec_RunJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_RunJob.Tpo" "$(DEPDIR)/dec_RunJob.Plo"; else rm -f "$(DEPDIR)/dec_RunJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_RunJob.c' object='dec_RunJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_RunJob.lo `test -f '../Libifl/dec_RunJob.c' || echo '$(srcdir)/'`../Libifl/dec_RunJob.c dec_Shut.lo: ../Libifl/dec_Shut.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Shut.lo -MD -MP -MF "$(DEPDIR)/dec_Shut.Tpo" -c -o dec_Shut.lo `test -f '../Libifl/dec_Shut.c' || echo '$(srcdir)/'`../Libifl/dec_Shut.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Shut.Tpo" "$(DEPDIR)/dec_Shut.Plo"; else rm -f "$(DEPDIR)/dec_Shut.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Shut.c' object='dec_Shut.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Shut.lo `test -f '../Libifl/dec_Shut.c' || echo '$(srcdir)/'`../Libifl/dec_Shut.c dec_Sig.lo: ../Libifl/dec_Sig.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Sig.lo -MD -MP -MF "$(DEPDIR)/dec_Sig.Tpo" -c -o dec_Sig.lo `test -f '../Libifl/dec_Sig.c' || echo '$(srcdir)/'`../Libifl/dec_Sig.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Sig.Tpo" "$(DEPDIR)/dec_Sig.Plo"; else rm -f "$(DEPDIR)/dec_Sig.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Sig.c' object='dec_Sig.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Sig.lo `test -f '../Libifl/dec_Sig.c' || echo '$(srcdir)/'`../Libifl/dec_Sig.c dec_Status.lo: ../Libifl/dec_Status.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Status.lo -MD -MP -MF "$(DEPDIR)/dec_Status.Tpo" -c -o dec_Status.lo `test -f '../Libifl/dec_Status.c' || echo '$(srcdir)/'`../Libifl/dec_Status.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Status.Tpo" "$(DEPDIR)/dec_Status.Plo"; else rm -f "$(DEPDIR)/dec_Status.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Status.c' object='dec_Status.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Status.lo `test -f '../Libifl/dec_Status.c' || echo '$(srcdir)/'`../Libifl/dec_Status.c dec_svrattrl.lo: ../Libifl/dec_svrattrl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_svrattrl.lo -MD -MP -MF "$(DEPDIR)/dec_svrattrl.Tpo" -c -o dec_svrattrl.lo `test -f '../Libifl/dec_svrattrl.c' || echo '$(srcdir)/'`../Libifl/dec_svrattrl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_svrattrl.Tpo" "$(DEPDIR)/dec_svrattrl.Plo"; else rm -f "$(DEPDIR)/dec_svrattrl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_svrattrl.c' object='dec_svrattrl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_svrattrl.lo `test -f '../Libifl/dec_svrattrl.c' || echo '$(srcdir)/'`../Libifl/dec_svrattrl.c dec_Track.lo: ../Libifl/dec_Track.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_Track.lo -MD -MP -MF "$(DEPDIR)/dec_Track.Tpo" -c -o dec_Track.lo `test -f '../Libifl/dec_Track.c' || echo '$(srcdir)/'`../Libifl/dec_Track.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dec_Track.Tpo" "$(DEPDIR)/dec_Track.Plo"; else rm -f "$(DEPDIR)/dec_Track.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/dec_Track.c' object='dec_Track.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_Track.lo `test -f '../Libifl/dec_Track.c' || echo '$(srcdir)/'`../Libifl/dec_Track.c enc_attrl.lo: ../Libifl/enc_attrl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_attrl.lo -MD -MP -MF "$(DEPDIR)/enc_attrl.Tpo" -c -o enc_attrl.lo `test -f '../Libifl/enc_attrl.c' || echo '$(srcdir)/'`../Libifl/enc_attrl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_attrl.Tpo" "$(DEPDIR)/enc_attrl.Plo"; else rm -f "$(DEPDIR)/enc_attrl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_attrl.c' object='enc_attrl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_attrl.lo `test -f '../Libifl/enc_attrl.c' || echo '$(srcdir)/'`../Libifl/enc_attrl.c enc_attropl.lo: ../Libifl/enc_attropl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_attropl.lo -MD -MP -MF "$(DEPDIR)/enc_attropl.Tpo" -c -o enc_attropl.lo `test -f '../Libifl/enc_attropl.c' || echo '$(srcdir)/'`../Libifl/enc_attropl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_attropl.Tpo" "$(DEPDIR)/enc_attropl.Plo"; else rm -f "$(DEPDIR)/enc_attropl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_attropl.c' object='enc_attropl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_attropl.lo `test -f '../Libifl/enc_attropl.c' || echo '$(srcdir)/'`../Libifl/enc_attropl.c enc_CpyFil.lo: ../Libifl/enc_CpyFil.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_CpyFil.lo -MD -MP -MF "$(DEPDIR)/enc_CpyFil.Tpo" -c -o enc_CpyFil.lo `test -f '../Libifl/enc_CpyFil.c' || echo '$(srcdir)/'`../Libifl/enc_CpyFil.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_CpyFil.Tpo" "$(DEPDIR)/enc_CpyFil.Plo"; else rm -f "$(DEPDIR)/enc_CpyFil.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_CpyFil.c' object='enc_CpyFil.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_CpyFil.lo `test -f '../Libifl/enc_CpyFil.c' || echo '$(srcdir)/'`../Libifl/enc_CpyFil.c enc_JobCred.lo: ../Libifl/enc_JobCred.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_JobCred.lo -MD -MP -MF "$(DEPDIR)/enc_JobCred.Tpo" -c -o enc_JobCred.lo `test -f '../Libifl/enc_JobCred.c' || echo '$(srcdir)/'`../Libifl/enc_JobCred.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_JobCred.Tpo" "$(DEPDIR)/enc_JobCred.Plo"; else rm -f "$(DEPDIR)/enc_JobCred.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_JobCred.c' object='enc_JobCred.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_JobCred.lo `test -f '../Libifl/enc_JobCred.c' || echo '$(srcdir)/'`../Libifl/enc_JobCred.c enc_JobFile.lo: ../Libifl/enc_JobFile.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_JobFile.lo -MD -MP -MF "$(DEPDIR)/enc_JobFile.Tpo" -c -o enc_JobFile.lo `test -f '../Libifl/enc_JobFile.c' || echo '$(srcdir)/'`../Libifl/enc_JobFile.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_JobFile.Tpo" "$(DEPDIR)/enc_JobFile.Plo"; else rm -f "$(DEPDIR)/enc_JobFile.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_JobFile.c' object='enc_JobFile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_JobFile.lo `test -f '../Libifl/enc_JobFile.c' || echo '$(srcdir)/'`../Libifl/enc_JobFile.c enc_JobId.lo: ../Libifl/enc_JobId.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_JobId.lo -MD -MP -MF "$(DEPDIR)/enc_JobId.Tpo" -c -o enc_JobId.lo `test -f '../Libifl/enc_JobId.c' || echo '$(srcdir)/'`../Libifl/enc_JobId.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_JobId.Tpo" "$(DEPDIR)/enc_JobId.Plo"; else rm -f "$(DEPDIR)/enc_JobId.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_JobId.c' object='enc_JobId.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_JobId.lo `test -f '../Libifl/enc_JobId.c' || echo '$(srcdir)/'`../Libifl/enc_JobId.c enc_JobObit.lo: ../Libifl/enc_JobObit.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_JobObit.lo -MD -MP -MF "$(DEPDIR)/enc_JobObit.Tpo" -c -o enc_JobObit.lo `test -f '../Libifl/enc_JobObit.c' || echo '$(srcdir)/'`../Libifl/enc_JobObit.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_JobObit.Tpo" "$(DEPDIR)/enc_JobObit.Plo"; else rm -f "$(DEPDIR)/enc_JobObit.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_JobObit.c' object='enc_JobObit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_JobObit.lo `test -f '../Libifl/enc_JobObit.c' || echo '$(srcdir)/'`../Libifl/enc_JobObit.c enc_Manage.lo: ../Libifl/enc_Manage.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_Manage.lo -MD -MP -MF "$(DEPDIR)/enc_Manage.Tpo" -c -o enc_Manage.lo `test -f '../Libifl/enc_Manage.c' || echo '$(srcdir)/'`../Libifl/enc_Manage.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_Manage.Tpo" "$(DEPDIR)/enc_Manage.Plo"; else rm -f "$(DEPDIR)/enc_Manage.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_Manage.c' object='enc_Manage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_Manage.lo `test -f '../Libifl/enc_Manage.c' || echo '$(srcdir)/'`../Libifl/enc_Manage.c enc_MoveJob.lo: ../Libifl/enc_MoveJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_MoveJob.lo -MD -MP -MF "$(DEPDIR)/enc_MoveJob.Tpo" -c -o enc_MoveJob.lo `test -f '../Libifl/enc_MoveJob.c' || echo '$(srcdir)/'`../Libifl/enc_MoveJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_MoveJob.Tpo" "$(DEPDIR)/enc_MoveJob.Plo"; else rm -f "$(DEPDIR)/enc_MoveJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_MoveJob.c' object='enc_MoveJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_MoveJob.lo `test -f '../Libifl/enc_MoveJob.c' || echo '$(srcdir)/'`../Libifl/enc_MoveJob.c enc_MsgJob.lo: ../Libifl/enc_MsgJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_MsgJob.lo -MD -MP -MF "$(DEPDIR)/enc_MsgJob.Tpo" -c -o enc_MsgJob.lo `test -f '../Libifl/enc_MsgJob.c' || echo '$(srcdir)/'`../Libifl/enc_MsgJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_MsgJob.Tpo" "$(DEPDIR)/enc_MsgJob.Plo"; else rm -f "$(DEPDIR)/enc_MsgJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_MsgJob.c' object='enc_MsgJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_MsgJob.lo `test -f '../Libifl/enc_MsgJob.c' || echo '$(srcdir)/'`../Libifl/enc_MsgJob.c enc_QueueJob.lo: ../Libifl/enc_QueueJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_QueueJob.lo -MD -MP -MF "$(DEPDIR)/enc_QueueJob.Tpo" -c -o enc_QueueJob.lo `test -f '../Libifl/enc_QueueJob.c' || echo '$(srcdir)/'`../Libifl/enc_QueueJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_QueueJob.Tpo" "$(DEPDIR)/enc_QueueJob.Plo"; else rm -f "$(DEPDIR)/enc_QueueJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_QueueJob.c' object='enc_QueueJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_QueueJob.lo `test -f '../Libifl/enc_QueueJob.c' || echo '$(srcdir)/'`../Libifl/enc_QueueJob.c enc_Reg.lo: ../Libifl/enc_Reg.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_Reg.lo -MD -MP -MF "$(DEPDIR)/enc_Reg.Tpo" -c -o enc_Reg.lo `test -f '../Libifl/enc_Reg.c' || echo '$(srcdir)/'`../Libifl/enc_Reg.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_Reg.Tpo" "$(DEPDIR)/enc_Reg.Plo"; else rm -f "$(DEPDIR)/enc_Reg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_Reg.c' object='enc_Reg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_Reg.lo `test -f '../Libifl/enc_Reg.c' || echo '$(srcdir)/'`../Libifl/enc_Reg.c enc_reply.lo: ../Libifl/enc_reply.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_reply.lo -MD -MP -MF "$(DEPDIR)/enc_reply.Tpo" -c -o enc_reply.lo `test -f '../Libifl/enc_reply.c' || echo '$(srcdir)/'`../Libifl/enc_reply.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_reply.Tpo" "$(DEPDIR)/enc_reply.Plo"; else rm -f "$(DEPDIR)/enc_reply.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_reply.c' object='enc_reply.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_reply.lo `test -f '../Libifl/enc_reply.c' || echo '$(srcdir)/'`../Libifl/enc_reply.c enc_ReturnFile.lo: ../Libifl/enc_ReturnFile.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_ReturnFile.lo -MD -MP -MF "$(DEPDIR)/enc_ReturnFile.Tpo" -c -o enc_ReturnFile.lo `test -f '../Libifl/enc_ReturnFile.c' || echo '$(srcdir)/'`../Libifl/enc_ReturnFile.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_ReturnFile.Tpo" "$(DEPDIR)/enc_ReturnFile.Plo"; else rm -f "$(DEPDIR)/enc_ReturnFile.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_ReturnFile.c' object='enc_ReturnFile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_ReturnFile.lo `test -f '../Libifl/enc_ReturnFile.c' || echo '$(srcdir)/'`../Libifl/enc_ReturnFile.c enc_ReqExt.lo: ../Libifl/enc_ReqExt.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_ReqExt.lo -MD -MP -MF "$(DEPDIR)/enc_ReqExt.Tpo" -c -o enc_ReqExt.lo `test -f '../Libifl/enc_ReqExt.c' || echo '$(srcdir)/'`../Libifl/enc_ReqExt.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_ReqExt.Tpo" "$(DEPDIR)/enc_ReqExt.Plo"; else rm -f "$(DEPDIR)/enc_ReqExt.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_ReqExt.c' object='enc_ReqExt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_ReqExt.lo `test -f '../Libifl/enc_ReqExt.c' || echo '$(srcdir)/'`../Libifl/enc_ReqExt.c enc_ReqHdr.lo: ../Libifl/enc_ReqHdr.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_ReqHdr.lo -MD -MP -MF "$(DEPDIR)/enc_ReqHdr.Tpo" -c -o enc_ReqHdr.lo `test -f '../Libifl/enc_ReqHdr.c' || echo '$(srcdir)/'`../Libifl/enc_ReqHdr.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_ReqHdr.Tpo" "$(DEPDIR)/enc_ReqHdr.Plo"; else rm -f "$(DEPDIR)/enc_ReqHdr.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_ReqHdr.c' object='enc_ReqHdr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_ReqHdr.lo `test -f '../Libifl/enc_ReqHdr.c' || echo '$(srcdir)/'`../Libifl/enc_ReqHdr.c enc_RunJob.lo: ../Libifl/enc_RunJob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_RunJob.lo -MD -MP -MF "$(DEPDIR)/enc_RunJob.Tpo" -c -o enc_RunJob.lo `test -f '../Libifl/enc_RunJob.c' || echo '$(srcdir)/'`../Libifl/enc_RunJob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_RunJob.Tpo" "$(DEPDIR)/enc_RunJob.Plo"; else rm -f "$(DEPDIR)/enc_RunJob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_RunJob.c' object='enc_RunJob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_RunJob.lo `test -f '../Libifl/enc_RunJob.c' || echo '$(srcdir)/'`../Libifl/enc_RunJob.c enc_Shut.lo: ../Libifl/enc_Shut.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_Shut.lo -MD -MP -MF "$(DEPDIR)/enc_Shut.Tpo" -c -o enc_Shut.lo `test -f '../Libifl/enc_Shut.c' || echo '$(srcdir)/'`../Libifl/enc_Shut.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_Shut.Tpo" "$(DEPDIR)/enc_Shut.Plo"; else rm -f "$(DEPDIR)/enc_Shut.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_Shut.c' object='enc_Shut.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_Shut.lo `test -f '../Libifl/enc_Shut.c' || echo '$(srcdir)/'`../Libifl/enc_Shut.c enc_Sig.lo: ../Libifl/enc_Sig.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_Sig.lo -MD -MP -MF "$(DEPDIR)/enc_Sig.Tpo" -c -o enc_Sig.lo `test -f '../Libifl/enc_Sig.c' || echo '$(srcdir)/'`../Libifl/enc_Sig.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_Sig.Tpo" "$(DEPDIR)/enc_Sig.Plo"; else rm -f "$(DEPDIR)/enc_Sig.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_Sig.c' object='enc_Sig.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_Sig.lo `test -f '../Libifl/enc_Sig.c' || echo '$(srcdir)/'`../Libifl/enc_Sig.c enc_Status.lo: ../Libifl/enc_Status.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_Status.lo -MD -MP -MF "$(DEPDIR)/enc_Status.Tpo" -c -o enc_Status.lo `test -f '../Libifl/enc_Status.c' || echo '$(srcdir)/'`../Libifl/enc_Status.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_Status.Tpo" "$(DEPDIR)/enc_Status.Plo"; else rm -f "$(DEPDIR)/enc_Status.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_Status.c' object='enc_Status.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_Status.lo `test -f '../Libifl/enc_Status.c' || echo '$(srcdir)/'`../Libifl/enc_Status.c enc_svrattrl.lo: ../Libifl/enc_svrattrl.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_svrattrl.lo -MD -MP -MF "$(DEPDIR)/enc_svrattrl.Tpo" -c -o enc_svrattrl.lo `test -f '../Libifl/enc_svrattrl.c' || echo '$(srcdir)/'`../Libifl/enc_svrattrl.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_svrattrl.Tpo" "$(DEPDIR)/enc_svrattrl.Plo"; else rm -f "$(DEPDIR)/enc_svrattrl.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_svrattrl.c' object='enc_svrattrl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_svrattrl.lo `test -f '../Libifl/enc_svrattrl.c' || echo '$(srcdir)/'`../Libifl/enc_svrattrl.c enc_Track.lo: ../Libifl/enc_Track.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_Track.lo -MD -MP -MF "$(DEPDIR)/enc_Track.Tpo" -c -o enc_Track.lo `test -f '../Libifl/enc_Track.c' || echo '$(srcdir)/'`../Libifl/enc_Track.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/enc_Track.Tpo" "$(DEPDIR)/enc_Track.Plo"; else rm -f "$(DEPDIR)/enc_Track.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/enc_Track.c' object='enc_Track.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_Track.lo `test -f '../Libifl/enc_Track.c' || echo '$(srcdir)/'`../Libifl/enc_Track.c get_svrport.lo: ../Libifl/get_svrport.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT get_svrport.lo -MD -MP -MF "$(DEPDIR)/get_svrport.Tpo" -c -o get_svrport.lo `test -f '../Libifl/get_svrport.c' || echo '$(srcdir)/'`../Libifl/get_svrport.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/get_svrport.Tpo" "$(DEPDIR)/get_svrport.Plo"; else rm -f "$(DEPDIR)/get_svrport.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/get_svrport.c' object='get_svrport.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o get_svrport.lo `test -f '../Libifl/get_svrport.c' || echo '$(srcdir)/'`../Libifl/get_svrport.c nonblock.lo: ../Libifl/nonblock.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nonblock.lo -MD -MP -MF "$(DEPDIR)/nonblock.Tpo" -c -o nonblock.lo `test -f '../Libifl/nonblock.c' || echo '$(srcdir)/'`../Libifl/nonblock.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/nonblock.Tpo" "$(DEPDIR)/nonblock.Plo"; else rm -f "$(DEPDIR)/nonblock.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/nonblock.c' object='nonblock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nonblock.lo `test -f '../Libifl/nonblock.c' || echo '$(srcdir)/'`../Libifl/nonblock.c PBS_attr.lo: ../Libifl/PBS_attr.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBS_attr.lo -MD -MP -MF "$(DEPDIR)/PBS_attr.Tpo" -c -o PBS_attr.lo `test -f '../Libifl/PBS_attr.c' || echo '$(srcdir)/'`../Libifl/PBS_attr.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBS_attr.Tpo" "$(DEPDIR)/PBS_attr.Plo"; else rm -f "$(DEPDIR)/PBS_attr.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBS_attr.c' object='PBS_attr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBS_attr.lo `test -f '../Libifl/PBS_attr.c' || echo '$(srcdir)/'`../Libifl/PBS_attr.c pbsD_alterjo.lo: ../Libifl/pbsD_alterjo.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_alterjo.lo -MD -MP -MF "$(DEPDIR)/pbsD_alterjo.Tpo" -c -o pbsD_alterjo.lo `test -f '../Libifl/pbsD_alterjo.c' || echo '$(srcdir)/'`../Libifl/pbsD_alterjo.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_alterjo.Tpo" "$(DEPDIR)/pbsD_alterjo.Plo"; else rm -f "$(DEPDIR)/pbsD_alterjo.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_alterjo.c' object='pbsD_alterjo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_alterjo.lo `test -f '../Libifl/pbsD_alterjo.c' || echo '$(srcdir)/'`../Libifl/pbsD_alterjo.c pbsD_asyrun.lo: ../Libifl/pbsD_asyrun.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_asyrun.lo -MD -MP -MF "$(DEPDIR)/pbsD_asyrun.Tpo" -c -o pbsD_asyrun.lo `test -f '../Libifl/pbsD_asyrun.c' || echo '$(srcdir)/'`../Libifl/pbsD_asyrun.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_asyrun.Tpo" "$(DEPDIR)/pbsD_asyrun.Plo"; else rm -f "$(DEPDIR)/pbsD_asyrun.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_asyrun.c' object='pbsD_asyrun.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_asyrun.lo `test -f '../Libifl/pbsD_asyrun.c' || echo '$(srcdir)/'`../Libifl/pbsD_asyrun.c PBS_data.lo: ../Libifl/PBS_data.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBS_data.lo -MD -MP -MF "$(DEPDIR)/PBS_data.Tpo" -c -o PBS_data.lo `test -f '../Libifl/PBS_data.c' || echo '$(srcdir)/'`../Libifl/PBS_data.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBS_data.Tpo" "$(DEPDIR)/PBS_data.Plo"; else rm -f "$(DEPDIR)/PBS_data.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBS_data.c' object='PBS_data.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBS_data.lo `test -f '../Libifl/PBS_data.c' || echo '$(srcdir)/'`../Libifl/PBS_data.c pbsD_connect.lo: ../Libifl/pbsD_connect.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_connect.lo -MD -MP -MF "$(DEPDIR)/pbsD_connect.Tpo" -c -o pbsD_connect.lo `test -f '../Libifl/pbsD_connect.c' || echo '$(srcdir)/'`../Libifl/pbsD_connect.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_connect.Tpo" "$(DEPDIR)/pbsD_connect.Plo"; else rm -f "$(DEPDIR)/pbsD_connect.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_connect.c' object='pbsD_connect.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_connect.lo `test -f '../Libifl/pbsD_connect.c' || echo '$(srcdir)/'`../Libifl/pbsD_connect.c pbsD_deljob.lo: ../Libifl/pbsD_deljob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_deljob.lo -MD -MP -MF "$(DEPDIR)/pbsD_deljob.Tpo" -c -o pbsD_deljob.lo `test -f '../Libifl/pbsD_deljob.c' || echo '$(srcdir)/'`../Libifl/pbsD_deljob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_deljob.Tpo" "$(DEPDIR)/pbsD_deljob.Plo"; else rm -f "$(DEPDIR)/pbsD_deljob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_deljob.c' object='pbsD_deljob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_deljob.lo `test -f '../Libifl/pbsD_deljob.c' || echo '$(srcdir)/'`../Libifl/pbsD_deljob.c pbsD_holdjob.lo: ../Libifl/pbsD_holdjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_holdjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_holdjob.Tpo" -c -o pbsD_holdjob.lo `test -f '../Libifl/pbsD_holdjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_holdjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_holdjob.Tpo" "$(DEPDIR)/pbsD_holdjob.Plo"; else rm -f "$(DEPDIR)/pbsD_holdjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_holdjob.c' object='pbsD_holdjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_holdjob.lo `test -f '../Libifl/pbsD_holdjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_holdjob.c pbsD_chkptjob.lo: ../Libifl/pbsD_chkptjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_chkptjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_chkptjob.Tpo" -c -o pbsD_chkptjob.lo `test -f '../Libifl/pbsD_chkptjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_chkptjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_chkptjob.Tpo" "$(DEPDIR)/pbsD_chkptjob.Plo"; else rm -f "$(DEPDIR)/pbsD_chkptjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_chkptjob.c' object='pbsD_chkptjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_chkptjob.lo `test -f '../Libifl/pbsD_chkptjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_chkptjob.c pbsD_locjob.lo: ../Libifl/pbsD_locjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_locjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_locjob.Tpo" -c -o pbsD_locjob.lo `test -f '../Libifl/pbsD_locjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_locjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_locjob.Tpo" "$(DEPDIR)/pbsD_locjob.Plo"; else rm -f "$(DEPDIR)/pbsD_locjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_locjob.c' object='pbsD_locjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_locjob.lo `test -f '../Libifl/pbsD_locjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_locjob.c PBSD_manage2.lo: ../Libifl/PBSD_manage2.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_manage2.lo -MD -MP -MF "$(DEPDIR)/PBSD_manage2.Tpo" -c -o PBSD_manage2.lo `test -f '../Libifl/PBSD_manage2.c' || echo '$(srcdir)/'`../Libifl/PBSD_manage2.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_manage2.Tpo" "$(DEPDIR)/PBSD_manage2.Plo"; else rm -f "$(DEPDIR)/PBSD_manage2.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_manage2.c' object='PBSD_manage2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_manage2.lo `test -f '../Libifl/PBSD_manage2.c' || echo '$(srcdir)/'`../Libifl/PBSD_manage2.c pbsD_manager.lo: ../Libifl/pbsD_manager.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_manager.lo -MD -MP -MF "$(DEPDIR)/pbsD_manager.Tpo" -c -o pbsD_manager.lo `test -f '../Libifl/pbsD_manager.c' || echo '$(srcdir)/'`../Libifl/pbsD_manager.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_manager.Tpo" "$(DEPDIR)/pbsD_manager.Plo"; else rm -f "$(DEPDIR)/pbsD_manager.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_manager.c' object='pbsD_manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_manager.lo `test -f '../Libifl/pbsD_manager.c' || echo '$(srcdir)/'`../Libifl/pbsD_manager.c pbsD_movejob.lo: ../Libifl/pbsD_movejob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_movejob.lo -MD -MP -MF "$(DEPDIR)/pbsD_movejob.Tpo" -c -o pbsD_movejob.lo `test -f '../Libifl/pbsD_movejob.c' || echo '$(srcdir)/'`../Libifl/pbsD_movejob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_movejob.Tpo" "$(DEPDIR)/pbsD_movejob.Plo"; else rm -f "$(DEPDIR)/pbsD_movejob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_movejob.c' object='pbsD_movejob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_movejob.lo `test -f '../Libifl/pbsD_movejob.c' || echo '$(srcdir)/'`../Libifl/pbsD_movejob.c PBSD_manager_caps.lo: ../Libifl/PBSD_manager_caps.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_manager_caps.lo -MD -MP -MF "$(DEPDIR)/PBSD_manager_caps.Tpo" -c -o PBSD_manager_caps.lo `test -f '../Libifl/PBSD_manager_caps.c' || echo '$(srcdir)/'`../Libifl/PBSD_manager_caps.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_manager_caps.Tpo" "$(DEPDIR)/PBSD_manager_caps.Plo"; else rm -f "$(DEPDIR)/PBSD_manager_caps.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_manager_caps.c' object='PBSD_manager_caps.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_manager_caps.lo `test -f '../Libifl/PBSD_manager_caps.c' || echo '$(srcdir)/'`../Libifl/PBSD_manager_caps.c PBSD_msg2.lo: ../Libifl/PBSD_msg2.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_msg2.lo -MD -MP -MF "$(DEPDIR)/PBSD_msg2.Tpo" -c -o PBSD_msg2.lo `test -f '../Libifl/PBSD_msg2.c' || echo '$(srcdir)/'`../Libifl/PBSD_msg2.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_msg2.Tpo" "$(DEPDIR)/PBSD_msg2.Plo"; else rm -f "$(DEPDIR)/PBSD_msg2.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_msg2.c' object='PBSD_msg2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_msg2.lo `test -f '../Libifl/PBSD_msg2.c' || echo '$(srcdir)/'`../Libifl/PBSD_msg2.c pbsD_msgjob.lo: ../Libifl/pbsD_msgjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_msgjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_msgjob.Tpo" -c -o pbsD_msgjob.lo `test -f '../Libifl/pbsD_msgjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_msgjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_msgjob.Tpo" "$(DEPDIR)/pbsD_msgjob.Plo"; else rm -f "$(DEPDIR)/pbsD_msgjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_msgjob.c' object='pbsD_msgjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_msgjob.lo `test -f '../Libifl/pbsD_msgjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_msgjob.c pbsD_orderjo.lo: ../Libifl/pbsD_orderjo.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_orderjo.lo -MD -MP -MF "$(DEPDIR)/pbsD_orderjo.Tpo" -c -o pbsD_orderjo.lo `test -f '../Libifl/pbsD_orderjo.c' || echo '$(srcdir)/'`../Libifl/pbsD_orderjo.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_orderjo.Tpo" "$(DEPDIR)/pbsD_orderjo.Plo"; else rm -f "$(DEPDIR)/pbsD_orderjo.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_orderjo.c' object='pbsD_orderjo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_orderjo.lo `test -f '../Libifl/pbsD_orderjo.c' || echo '$(srcdir)/'`../Libifl/pbsD_orderjo.c PBSD_rdrpy.lo: ../Libifl/PBSD_rdrpy.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_rdrpy.lo -MD -MP -MF "$(DEPDIR)/PBSD_rdrpy.Tpo" -c -o PBSD_rdrpy.lo `test -f '../Libifl/PBSD_rdrpy.c' || echo '$(srcdir)/'`../Libifl/PBSD_rdrpy.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_rdrpy.Tpo" "$(DEPDIR)/PBSD_rdrpy.Plo"; else rm -f "$(DEPDIR)/PBSD_rdrpy.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_rdrpy.c' object='PBSD_rdrpy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_rdrpy.lo `test -f '../Libifl/PBSD_rdrpy.c' || echo '$(srcdir)/'`../Libifl/PBSD_rdrpy.c pbsD_rerunjo.lo: ../Libifl/pbsD_rerunjo.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_rerunjo.lo -MD -MP -MF "$(DEPDIR)/pbsD_rerunjo.Tpo" -c -o pbsD_rerunjo.lo `test -f '../Libifl/pbsD_rerunjo.c' || echo '$(srcdir)/'`../Libifl/pbsD_rerunjo.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_rerunjo.Tpo" "$(DEPDIR)/pbsD_rerunjo.Plo"; else rm -f "$(DEPDIR)/pbsD_rerunjo.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_rerunjo.c' object='pbsD_rerunjo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_rerunjo.lo `test -f '../Libifl/pbsD_rerunjo.c' || echo '$(srcdir)/'`../Libifl/pbsD_rerunjo.c pbsD_resc.lo: ../Libifl/pbsD_resc.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_resc.lo -MD -MP -MF "$(DEPDIR)/pbsD_resc.Tpo" -c -o pbsD_resc.lo `test -f '../Libifl/pbsD_resc.c' || echo '$(srcdir)/'`../Libifl/pbsD_resc.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_resc.Tpo" "$(DEPDIR)/pbsD_resc.Plo"; else rm -f "$(DEPDIR)/pbsD_resc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_resc.c' object='pbsD_resc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_resc.lo `test -f '../Libifl/pbsD_resc.c' || echo '$(srcdir)/'`../Libifl/pbsD_resc.c pbsD_rlsjob.lo: ../Libifl/pbsD_rlsjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_rlsjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_rlsjob.Tpo" -c -o pbsD_rlsjob.lo `test -f '../Libifl/pbsD_rlsjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_rlsjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_rlsjob.Tpo" "$(DEPDIR)/pbsD_rlsjob.Plo"; else rm -f "$(DEPDIR)/pbsD_rlsjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_rlsjob.c' object='pbsD_rlsjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_rlsjob.lo `test -f '../Libifl/pbsD_rlsjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_rlsjob.c pbsD_runjob.lo: ../Libifl/pbsD_runjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_runjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_runjob.Tpo" -c -o pbsD_runjob.lo `test -f '../Libifl/pbsD_runjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_runjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_runjob.Tpo" "$(DEPDIR)/pbsD_runjob.Plo"; else rm -f "$(DEPDIR)/pbsD_runjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_runjob.c' object='pbsD_runjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_runjob.lo `test -f '../Libifl/pbsD_runjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_runjob.c pbsD_selectj.lo: ../Libifl/pbsD_selectj.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_selectj.lo -MD -MP -MF "$(DEPDIR)/pbsD_selectj.Tpo" -c -o pbsD_selectj.lo `test -f '../Libifl/pbsD_selectj.c' || echo '$(srcdir)/'`../Libifl/pbsD_selectj.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_selectj.Tpo" "$(DEPDIR)/pbsD_selectj.Plo"; else rm -f "$(DEPDIR)/pbsD_selectj.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_selectj.c' object='pbsD_selectj.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_selectj.lo `test -f '../Libifl/pbsD_selectj.c' || echo '$(srcdir)/'`../Libifl/pbsD_selectj.c PBSD_sig2.lo: ../Libifl/PBSD_sig2.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_sig2.lo -MD -MP -MF "$(DEPDIR)/PBSD_sig2.Tpo" -c -o PBSD_sig2.lo `test -f '../Libifl/PBSD_sig2.c' || echo '$(srcdir)/'`../Libifl/PBSD_sig2.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_sig2.Tpo" "$(DEPDIR)/PBSD_sig2.Plo"; else rm -f "$(DEPDIR)/PBSD_sig2.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_sig2.c' object='PBSD_sig2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_sig2.lo `test -f '../Libifl/PBSD_sig2.c' || echo '$(srcdir)/'`../Libifl/PBSD_sig2.c pbsD_sigjob.lo: ../Libifl/pbsD_sigjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_sigjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_sigjob.Tpo" -c -o pbsD_sigjob.lo `test -f '../Libifl/pbsD_sigjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_sigjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_sigjob.Tpo" "$(DEPDIR)/pbsD_sigjob.Plo"; else rm -f "$(DEPDIR)/pbsD_sigjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_sigjob.c' object='pbsD_sigjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_sigjob.lo `test -f '../Libifl/pbsD_sigjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_sigjob.c pbsD_stagein.lo: ../Libifl/pbsD_stagein.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_stagein.lo -MD -MP -MF "$(DEPDIR)/pbsD_stagein.Tpo" -c -o pbsD_stagein.lo `test -f '../Libifl/pbsD_stagein.c' || echo '$(srcdir)/'`../Libifl/pbsD_stagein.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_stagein.Tpo" "$(DEPDIR)/pbsD_stagein.Plo"; else rm -f "$(DEPDIR)/pbsD_stagein.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_stagein.c' object='pbsD_stagein.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_stagein.lo `test -f '../Libifl/pbsD_stagein.c' || echo '$(srcdir)/'`../Libifl/pbsD_stagein.c pbsD_statjob.lo: ../Libifl/pbsD_statjob.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_statjob.lo -MD -MP -MF "$(DEPDIR)/pbsD_statjob.Tpo" -c -o pbsD_statjob.lo `test -f '../Libifl/pbsD_statjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_statjob.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_statjob.Tpo" "$(DEPDIR)/pbsD_statjob.Plo"; else rm -f "$(DEPDIR)/pbsD_statjob.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_statjob.c' object='pbsD_statjob.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_statjob.lo `test -f '../Libifl/pbsD_statjob.c' || echo '$(srcdir)/'`../Libifl/pbsD_statjob.c pbsD_statnode.lo: ../Libifl/pbsD_statnode.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_statnode.lo -MD -MP -MF "$(DEPDIR)/pbsD_statnode.Tpo" -c -o pbsD_statnode.lo `test -f '../Libifl/pbsD_statnode.c' || echo '$(srcdir)/'`../Libifl/pbsD_statnode.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_statnode.Tpo" "$(DEPDIR)/pbsD_statnode.Plo"; else rm -f "$(DEPDIR)/pbsD_statnode.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_statnode.c' object='pbsD_statnode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_statnode.lo `test -f '../Libifl/pbsD_statnode.c' || echo '$(srcdir)/'`../Libifl/pbsD_statnode.c pbsD_statque.lo: ../Libifl/pbsD_statque.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_statque.lo -MD -MP -MF "$(DEPDIR)/pbsD_statque.Tpo" -c -o pbsD_statque.lo `test -f '../Libifl/pbsD_statque.c' || echo '$(srcdir)/'`../Libifl/pbsD_statque.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_statque.Tpo" "$(DEPDIR)/pbsD_statque.Plo"; else rm -f "$(DEPDIR)/pbsD_statque.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_statque.c' object='pbsD_statque.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_statque.lo `test -f '../Libifl/pbsD_statque.c' || echo '$(srcdir)/'`../Libifl/pbsD_statque.c pbsD_statsrv.lo: ../Libifl/pbsD_statsrv.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_statsrv.lo -MD -MP -MF "$(DEPDIR)/pbsD_statsrv.Tpo" -c -o pbsD_statsrv.lo `test -f '../Libifl/pbsD_statsrv.c' || echo '$(srcdir)/'`../Libifl/pbsD_statsrv.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_statsrv.Tpo" "$(DEPDIR)/pbsD_statsrv.Plo"; else rm -f "$(DEPDIR)/pbsD_statsrv.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_statsrv.c' object='pbsD_statsrv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_statsrv.lo `test -f '../Libifl/pbsD_statsrv.c' || echo '$(srcdir)/'`../Libifl/pbsD_statsrv.c PBSD_status2.lo: ../Libifl/PBSD_status2.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_status2.lo -MD -MP -MF "$(DEPDIR)/PBSD_status2.Tpo" -c -o PBSD_status2.lo `test -f '../Libifl/PBSD_status2.c' || echo '$(srcdir)/'`../Libifl/PBSD_status2.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_status2.Tpo" "$(DEPDIR)/PBSD_status2.Plo"; else rm -f "$(DEPDIR)/PBSD_status2.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_status2.c' object='PBSD_status2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_status2.lo `test -f '../Libifl/PBSD_status2.c' || echo '$(srcdir)/'`../Libifl/PBSD_status2.c PBSD_status.lo: ../Libifl/PBSD_status.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_status.lo -MD -MP -MF "$(DEPDIR)/PBSD_status.Tpo" -c -o PBSD_status.lo `test -f '../Libifl/PBSD_status.c' || echo '$(srcdir)/'`../Libifl/PBSD_status.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_status.Tpo" "$(DEPDIR)/PBSD_status.Plo"; else rm -f "$(DEPDIR)/PBSD_status.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_status.c' object='PBSD_status.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_status.lo `test -f '../Libifl/PBSD_status.c' || echo '$(srcdir)/'`../Libifl/PBSD_status.c pbsD_submit.lo: ../Libifl/pbsD_submit.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_submit.lo -MD -MP -MF "$(DEPDIR)/pbsD_submit.Tpo" -c -o pbsD_submit.lo `test -f '../Libifl/pbsD_submit.c' || echo '$(srcdir)/'`../Libifl/pbsD_submit.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_submit.Tpo" "$(DEPDIR)/pbsD_submit.Plo"; else rm -f "$(DEPDIR)/pbsD_submit.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_submit.c' object='pbsD_submit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_submit.lo `test -f '../Libifl/pbsD_submit.c' || echo '$(srcdir)/'`../Libifl/pbsD_submit.c PBSD_submit_caps.lo: ../Libifl/PBSD_submit_caps.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT PBSD_submit_caps.lo -MD -MP -MF "$(DEPDIR)/PBSD_submit_caps.Tpo" -c -o PBSD_submit_caps.lo `test -f '../Libifl/PBSD_submit_caps.c' || echo '$(srcdir)/'`../Libifl/PBSD_submit_caps.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/PBSD_submit_caps.Tpo" "$(DEPDIR)/PBSD_submit_caps.Plo"; else rm -f "$(DEPDIR)/PBSD_submit_caps.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/PBSD_submit_caps.c' object='PBSD_submit_caps.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o PBSD_submit_caps.lo `test -f '../Libifl/PBSD_submit_caps.c' || echo '$(srcdir)/'`../Libifl/PBSD_submit_caps.c pbsD_termin.lo: ../Libifl/pbsD_termin.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbsD_termin.lo -MD -MP -MF "$(DEPDIR)/pbsD_termin.Tpo" -c -o pbsD_termin.lo `test -f '../Libifl/pbsD_termin.c' || echo '$(srcdir)/'`../Libifl/pbsD_termin.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbsD_termin.Tpo" "$(DEPDIR)/pbsD_termin.Plo"; else rm -f "$(DEPDIR)/pbsD_termin.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbsD_termin.c' object='pbsD_termin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbsD_termin.lo `test -f '../Libifl/pbsD_termin.c' || echo '$(srcdir)/'`../Libifl/pbsD_termin.c pbs_geterrmg.lo: ../Libifl/pbs_geterrmg.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbs_geterrmg.lo -MD -MP -MF "$(DEPDIR)/pbs_geterrmg.Tpo" -c -o pbs_geterrmg.lo `test -f '../Libifl/pbs_geterrmg.c' || echo '$(srcdir)/'`../Libifl/pbs_geterrmg.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_geterrmg.Tpo" "$(DEPDIR)/pbs_geterrmg.Plo"; else rm -f "$(DEPDIR)/pbs_geterrmg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbs_geterrmg.c' object='pbs_geterrmg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbs_geterrmg.lo `test -f '../Libifl/pbs_geterrmg.c' || echo '$(srcdir)/'`../Libifl/pbs_geterrmg.c pbs_statfree.lo: ../Libifl/pbs_statfree.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbs_statfree.lo -MD -MP -MF "$(DEPDIR)/pbs_statfree.Tpo" -c -o pbs_statfree.lo `test -f '../Libifl/pbs_statfree.c' || echo '$(srcdir)/'`../Libifl/pbs_statfree.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_statfree.Tpo" "$(DEPDIR)/pbs_statfree.Plo"; else rm -f "$(DEPDIR)/pbs_statfree.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/pbs_statfree.c' object='pbs_statfree.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbs_statfree.lo `test -f '../Libifl/pbs_statfree.c' || echo '$(srcdir)/'`../Libifl/pbs_statfree.c rpp.lo: ../Libifl/rpp.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rpp.lo -MD -MP -MF "$(DEPDIR)/rpp.Tpo" -c -o rpp.lo `test -f '../Libifl/rpp.c' || echo '$(srcdir)/'`../Libifl/rpp.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rpp.Tpo" "$(DEPDIR)/rpp.Plo"; else rm -f "$(DEPDIR)/rpp.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/rpp.c' object='rpp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rpp.lo `test -f '../Libifl/rpp.c' || echo '$(srcdir)/'`../Libifl/rpp.c tcp_dis.lo: ../Libifl/tcp_dis.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tcp_dis.lo -MD -MP -MF "$(DEPDIR)/tcp_dis.Tpo" -c -o tcp_dis.lo `test -f '../Libifl/tcp_dis.c' || echo '$(srcdir)/'`../Libifl/tcp_dis.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tcp_dis.Tpo" "$(DEPDIR)/tcp_dis.Plo"; else rm -f "$(DEPDIR)/tcp_dis.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/tcp_dis.c' object='tcp_dis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tcp_dis.lo `test -f '../Libifl/tcp_dis.c' || echo '$(srcdir)/'`../Libifl/tcp_dis.c tm.lo: ../Libifl/tm.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tm.lo -MD -MP -MF "$(DEPDIR)/tm.Tpo" -c -o tm.lo `test -f '../Libifl/tm.c' || echo '$(srcdir)/'`../Libifl/tm.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/tm.Tpo" "$(DEPDIR)/tm.Plo"; else rm -f "$(DEPDIR)/tm.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/tm.c' object='tm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tm.lo `test -f '../Libifl/tm.c' || echo '$(srcdir)/'`../Libifl/tm.c list_link.lo: ../Libifl/list_link.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT list_link.lo -MD -MP -MF "$(DEPDIR)/list_link.Tpo" -c -o list_link.lo `test -f '../Libifl/list_link.c' || echo '$(srcdir)/'`../Libifl/list_link.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/list_link.Tpo" "$(DEPDIR)/list_link.Plo"; else rm -f "$(DEPDIR)/list_link.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libifl/list_link.c' object='list_link.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o list_link.lo `test -f '../Libifl/list_link.c' || echo '$(srcdir)/'`../Libifl/list_link.c ck_job_name.lo: ../Libcmds/ck_job_name.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ck_job_name.lo -MD -MP -MF "$(DEPDIR)/ck_job_name.Tpo" -c -o ck_job_name.lo `test -f '../Libcmds/ck_job_name.c' || echo '$(srcdir)/'`../Libcmds/ck_job_name.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/ck_job_name.Tpo" "$(DEPDIR)/ck_job_name.Plo"; else rm -f "$(DEPDIR)/ck_job_name.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/ck_job_name.c' object='ck_job_name.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ck_job_name.lo `test -f '../Libcmds/ck_job_name.c' || echo '$(srcdir)/'`../Libcmds/ck_job_name.c cnt2server.lo: ../Libcmds/cnt2server.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cnt2server.lo -MD -MP -MF "$(DEPDIR)/cnt2server.Tpo" -c -o cnt2server.lo `test -f '../Libcmds/cnt2server.c' || echo '$(srcdir)/'`../Libcmds/cnt2server.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cnt2server.Tpo" "$(DEPDIR)/cnt2server.Plo"; else rm -f "$(DEPDIR)/cnt2server.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/cnt2server.c' object='cnt2server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cnt2server.lo `test -f '../Libcmds/cnt2server.c' || echo '$(srcdir)/'`../Libcmds/cnt2server.c cvtdate.lo: ../Libcmds/cvtdate.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cvtdate.lo -MD -MP -MF "$(DEPDIR)/cvtdate.Tpo" -c -o cvtdate.lo `test -f '../Libcmds/cvtdate.c' || echo '$(srcdir)/'`../Libcmds/cvtdate.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cvtdate.Tpo" "$(DEPDIR)/cvtdate.Plo"; else rm -f "$(DEPDIR)/cvtdate.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/cvtdate.c' object='cvtdate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cvtdate.lo `test -f '../Libcmds/cvtdate.c' || echo '$(srcdir)/'`../Libcmds/cvtdate.c get_server.lo: ../Libcmds/get_server.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT get_server.lo -MD -MP -MF "$(DEPDIR)/get_server.Tpo" -c -o get_server.lo `test -f '../Libcmds/get_server.c' || echo '$(srcdir)/'`../Libcmds/get_server.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/get_server.Tpo" "$(DEPDIR)/get_server.Plo"; else rm -f "$(DEPDIR)/get_server.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/get_server.c' object='get_server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o get_server.lo `test -f '../Libcmds/get_server.c' || echo '$(srcdir)/'`../Libcmds/get_server.c locate_job.lo: ../Libcmds/locate_job.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT locate_job.lo -MD -MP -MF "$(DEPDIR)/locate_job.Tpo" -c -o locate_job.lo `test -f '../Libcmds/locate_job.c' || echo '$(srcdir)/'`../Libcmds/locate_job.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/locate_job.Tpo" "$(DEPDIR)/locate_job.Plo"; else rm -f "$(DEPDIR)/locate_job.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/locate_job.c' object='locate_job.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o locate_job.lo `test -f '../Libcmds/locate_job.c' || echo '$(srcdir)/'`../Libcmds/locate_job.c parse_at.lo: ../Libcmds/parse_at.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parse_at.lo -MD -MP -MF "$(DEPDIR)/parse_at.Tpo" -c -o parse_at.lo `test -f '../Libcmds/parse_at.c' || echo '$(srcdir)/'`../Libcmds/parse_at.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/parse_at.Tpo" "$(DEPDIR)/parse_at.Plo"; else rm -f "$(DEPDIR)/parse_at.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/parse_at.c' object='parse_at.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parse_at.lo `test -f '../Libcmds/parse_at.c' || echo '$(srcdir)/'`../Libcmds/parse_at.c parse_depend.lo: ../Libcmds/parse_depend.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parse_depend.lo -MD -MP -MF "$(DEPDIR)/parse_depend.Tpo" -c -o parse_depend.lo `test -f '../Libcmds/parse_depend.c' || echo '$(srcdir)/'`../Libcmds/parse_depend.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/parse_depend.Tpo" "$(DEPDIR)/parse_depend.Plo"; else rm -f "$(DEPDIR)/parse_depend.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/parse_depend.c' object='parse_depend.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parse_depend.lo `test -f '../Libcmds/parse_depend.c' || echo '$(srcdir)/'`../Libcmds/parse_depend.c parse_destid.lo: ../Libcmds/parse_destid.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parse_destid.lo -MD -MP -MF "$(DEPDIR)/parse_destid.Tpo" -c -o parse_destid.lo `test -f '../Libcmds/parse_destid.c' || echo '$(srcdir)/'`../Libcmds/parse_destid.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/parse_destid.Tpo" "$(DEPDIR)/parse_destid.Plo"; else rm -f "$(DEPDIR)/parse_destid.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/parse_destid.c' object='parse_destid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parse_destid.lo `test -f '../Libcmds/parse_destid.c' || echo '$(srcdir)/'`../Libcmds/parse_destid.c parse_equal.lo: ../Libcmds/parse_equal.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parse_equal.lo -MD -MP -MF "$(DEPDIR)/parse_equal.Tpo" -c -o parse_equal.lo `test -f '../Libcmds/parse_equal.c' || echo '$(srcdir)/'`../Libcmds/parse_equal.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/parse_equal.Tpo" "$(DEPDIR)/parse_equal.Plo"; else rm -f "$(DEPDIR)/parse_equal.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/parse_equal.c' object='parse_equal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parse_equal.lo `test -f '../Libcmds/parse_equal.c' || echo '$(srcdir)/'`../Libcmds/parse_equal.c parse_jobid.lo: ../Libcmds/parse_jobid.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parse_jobid.lo -MD -MP -MF "$(DEPDIR)/parse_jobid.Tpo" -c -o parse_jobid.lo `test -f '../Libcmds/parse_jobid.c' || echo '$(srcdir)/'`../Libcmds/parse_jobid.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/parse_jobid.Tpo" "$(DEPDIR)/parse_jobid.Plo"; else rm -f "$(DEPDIR)/parse_jobid.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/parse_jobid.c' object='parse_jobid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parse_jobid.lo `test -f '../Libcmds/parse_jobid.c' || echo '$(srcdir)/'`../Libcmds/parse_jobid.c parse_stage.lo: ../Libcmds/parse_stage.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parse_stage.lo -MD -MP -MF "$(DEPDIR)/parse_stage.Tpo" -c -o parse_stage.lo `test -f '../Libcmds/parse_stage.c' || echo '$(srcdir)/'`../Libcmds/parse_stage.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/parse_stage.Tpo" "$(DEPDIR)/parse_stage.Plo"; else rm -f "$(DEPDIR)/parse_stage.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/parse_stage.c' object='parse_stage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parse_stage.lo `test -f '../Libcmds/parse_stage.c' || echo '$(srcdir)/'`../Libcmds/parse_stage.c prepare_path.lo: ../Libcmds/prepare_path.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT prepare_path.lo -MD -MP -MF "$(DEPDIR)/prepare_path.Tpo" -c -o prepare_path.lo `test -f '../Libcmds/prepare_path.c' || echo '$(srcdir)/'`../Libcmds/prepare_path.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/prepare_path.Tpo" "$(DEPDIR)/prepare_path.Plo"; else rm -f "$(DEPDIR)/prepare_path.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/prepare_path.c' object='prepare_path.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o prepare_path.lo `test -f '../Libcmds/prepare_path.c' || echo '$(srcdir)/'`../Libcmds/prepare_path.c prt_job_err.lo: ../Libcmds/prt_job_err.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT prt_job_err.lo -MD -MP -MF "$(DEPDIR)/prt_job_err.Tpo" -c -o prt_job_err.lo `test -f '../Libcmds/prt_job_err.c' || echo '$(srcdir)/'`../Libcmds/prt_job_err.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/prt_job_err.Tpo" "$(DEPDIR)/prt_job_err.Plo"; else rm -f "$(DEPDIR)/prt_job_err.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/prt_job_err.c' object='prt_job_err.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o prt_job_err.lo `test -f '../Libcmds/prt_job_err.c' || echo '$(srcdir)/'`../Libcmds/prt_job_err.c set_attr.lo: ../Libcmds/set_attr.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT set_attr.lo -MD -MP -MF "$(DEPDIR)/set_attr.Tpo" -c -o set_attr.lo `test -f '../Libcmds/set_attr.c' || echo '$(srcdir)/'`../Libcmds/set_attr.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/set_attr.Tpo" "$(DEPDIR)/set_attr.Plo"; else rm -f "$(DEPDIR)/set_attr.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/set_attr.c' object='set_attr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o set_attr.lo `test -f '../Libcmds/set_attr.c' || echo '$(srcdir)/'`../Libcmds/set_attr.c set_resource.lo: ../Libcmds/set_resource.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT set_resource.lo -MD -MP -MF "$(DEPDIR)/set_resource.Tpo" -c -o set_resource.lo `test -f '../Libcmds/set_resource.c' || echo '$(srcdir)/'`../Libcmds/set_resource.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/set_resource.Tpo" "$(DEPDIR)/set_resource.Plo"; else rm -f "$(DEPDIR)/set_resource.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libcmds/set_resource.c' object='set_resource.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o set_resource.lo `test -f '../Libcmds/set_resource.c' || echo '$(srcdir)/'`../Libcmds/set_resource.c chk_file_sec.lo: ../Liblog/chk_file_sec.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chk_file_sec.lo -MD -MP -MF "$(DEPDIR)/chk_file_sec.Tpo" -c -o chk_file_sec.lo `test -f '../Liblog/chk_file_sec.c' || echo '$(srcdir)/'`../Liblog/chk_file_sec.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/chk_file_sec.Tpo" "$(DEPDIR)/chk_file_sec.Plo"; else rm -f "$(DEPDIR)/chk_file_sec.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Liblog/chk_file_sec.c' object='chk_file_sec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chk_file_sec.lo `test -f '../Liblog/chk_file_sec.c' || echo '$(srcdir)/'`../Liblog/chk_file_sec.c log_event.lo: ../Liblog/log_event.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log_event.lo -MD -MP -MF "$(DEPDIR)/log_event.Tpo" -c -o log_event.lo `test -f '../Liblog/log_event.c' || echo '$(srcdir)/'`../Liblog/log_event.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/log_event.Tpo" "$(DEPDIR)/log_event.Plo"; else rm -f "$(DEPDIR)/log_event.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Liblog/log_event.c' object='log_event.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log_event.lo `test -f '../Liblog/log_event.c' || echo '$(srcdir)/'`../Liblog/log_event.c pbs_log.lo: ../Liblog/pbs_log.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbs_log.lo -MD -MP -MF "$(DEPDIR)/pbs_log.Tpo" -c -o pbs_log.lo `test -f '../Liblog/pbs_log.c' || echo '$(srcdir)/'`../Liblog/pbs_log.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_log.Tpo" "$(DEPDIR)/pbs_log.Plo"; else rm -f "$(DEPDIR)/pbs_log.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Liblog/pbs_log.c' object='pbs_log.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbs_log.lo `test -f '../Liblog/pbs_log.c' || echo '$(srcdir)/'`../Liblog/pbs_log.c pbs_messages.lo: ../Liblog/pbs_messages.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pbs_messages.lo -MD -MP -MF "$(DEPDIR)/pbs_messages.Tpo" -c -o pbs_messages.lo `test -f '../Liblog/pbs_messages.c' || echo '$(srcdir)/'`../Liblog/pbs_messages.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pbs_messages.Tpo" "$(DEPDIR)/pbs_messages.Plo"; else rm -f "$(DEPDIR)/pbs_messages.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Liblog/pbs_messages.c' object='pbs_messages.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pbs_messages.lo `test -f '../Liblog/pbs_messages.c' || echo '$(srcdir)/'`../Liblog/pbs_messages.c setup_env.lo: ../Liblog/setup_env.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT setup_env.lo -MD -MP -MF "$(DEPDIR)/setup_env.Tpo" -c -o setup_env.lo `test -f '../Liblog/setup_env.c' || echo '$(srcdir)/'`../Liblog/setup_env.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/setup_env.Tpo" "$(DEPDIR)/setup_env.Plo"; else rm -f "$(DEPDIR)/setup_env.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Liblog/setup_env.c' object='setup_env.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o setup_env.lo `test -f '../Liblog/setup_env.c' || echo '$(srcdir)/'`../Liblog/setup_env.c get_hostaddr.lo: ../Libnet/get_hostaddr.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT get_hostaddr.lo -MD -MP -MF "$(DEPDIR)/get_hostaddr.Tpo" -c -o get_hostaddr.lo `test -f '../Libnet/get_hostaddr.c' || echo '$(srcdir)/'`../Libnet/get_hostaddr.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/get_hostaddr.Tpo" "$(DEPDIR)/get_hostaddr.Plo"; else rm -f "$(DEPDIR)/get_hostaddr.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/get_hostaddr.c' object='get_hostaddr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o get_hostaddr.lo `test -f '../Libnet/get_hostaddr.c' || echo '$(srcdir)/'`../Libnet/get_hostaddr.c get_hostname.lo: ../Libnet/get_hostname.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT get_hostname.lo -MD -MP -MF "$(DEPDIR)/get_hostname.Tpo" -c -o get_hostname.lo `test -f '../Libnet/get_hostname.c' || echo '$(srcdir)/'`../Libnet/get_hostname.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/get_hostname.Tpo" "$(DEPDIR)/get_hostname.Plo"; else rm -f "$(DEPDIR)/get_hostname.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/get_hostname.c' object='get_hostname.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o get_hostname.lo `test -f '../Libnet/get_hostname.c' || echo '$(srcdir)/'`../Libnet/get_hostname.c md5.lo: ../Libnet/md5.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.lo -MD -MP -MF "$(DEPDIR)/md5.Tpo" -c -o md5.lo `test -f '../Libnet/md5.c' || echo '$(srcdir)/'`../Libnet/md5.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/md5.Tpo" "$(DEPDIR)/md5.Plo"; else rm -f "$(DEPDIR)/md5.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/md5.c' object='md5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.lo `test -f '../Libnet/md5.c' || echo '$(srcdir)/'`../Libnet/md5.c net_client.lo: ../Libnet/net_client.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net_client.lo -MD -MP -MF "$(DEPDIR)/net_client.Tpo" -c -o net_client.lo `test -f '../Libnet/net_client.c' || echo '$(srcdir)/'`../Libnet/net_client.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/net_client.Tpo" "$(DEPDIR)/net_client.Plo"; else rm -f "$(DEPDIR)/net_client.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/net_client.c' object='net_client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net_client.lo `test -f '../Libnet/net_client.c' || echo '$(srcdir)/'`../Libnet/net_client.c net_server.lo: ../Libnet/net_server.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net_server.lo -MD -MP -MF "$(DEPDIR)/net_server.Tpo" -c -o net_server.lo `test -f '../Libnet/net_server.c' || echo '$(srcdir)/'`../Libnet/net_server.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/net_server.Tpo" "$(DEPDIR)/net_server.Plo"; else rm -f "$(DEPDIR)/net_server.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/net_server.c' object='net_server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net_server.lo `test -f '../Libnet/net_server.c' || echo '$(srcdir)/'`../Libnet/net_server.c net_set_clse.lo: ../Libnet/net_set_clse.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net_set_clse.lo -MD -MP -MF "$(DEPDIR)/net_set_clse.Tpo" -c -o net_set_clse.lo `test -f '../Libnet/net_set_clse.c' || echo '$(srcdir)/'`../Libnet/net_set_clse.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/net_set_clse.Tpo" "$(DEPDIR)/net_set_clse.Plo"; else rm -f "$(DEPDIR)/net_set_clse.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/net_set_clse.c' object='net_set_clse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net_set_clse.lo `test -f '../Libnet/net_set_clse.c' || echo '$(srcdir)/'`../Libnet/net_set_clse.c rm.lo: ../Libnet/rm.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rm.lo -MD -MP -MF "$(DEPDIR)/rm.Tpo" -c -o rm.lo `test -f '../Libnet/rm.c' || echo '$(srcdir)/'`../Libnet/rm.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/rm.Tpo" "$(DEPDIR)/rm.Plo"; else rm -f "$(DEPDIR)/rm.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/rm.c' object='rm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rm.lo `test -f '../Libnet/rm.c' || echo '$(srcdir)/'`../Libnet/rm.c port_forwarding.lo: ../Libnet/port_forwarding.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT port_forwarding.lo -MD -MP -MF "$(DEPDIR)/port_forwarding.Tpo" -c -o port_forwarding.lo `test -f '../Libnet/port_forwarding.c' || echo '$(srcdir)/'`../Libnet/port_forwarding.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/port_forwarding.Tpo" "$(DEPDIR)/port_forwarding.Plo"; else rm -f "$(DEPDIR)/port_forwarding.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../Libnet/port_forwarding.c' object='port_forwarding.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o port_forwarding.lo `test -f '../Libnet/port_forwarding.c' || echo '$(srcdir)/'`../Libnet/port_forwarding.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils $(distdir)/../Libdis @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libpbs/Makefile.am0000664000113300011330000001042511272401246014641 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -I$(top_srcdir)/src/lib/Libdis -DIFF_PATH=\"$(IFF_PATH)\" -DPBS_DEFAULT_FILE=\"$(PBS_DEFAULT_FILE)\" EXTRA_DIST = ../Libdis/dis_.h lib_LTLIBRARIES = libtorque.la libtorque_la_LDFLAGS = -version-info 2:0:0 libtorque_la_SOURCES = ../Libcsv/csv.c ../Libdis/dis.c \ ../Libdis/discui_.c ../Libdis/discul_.c \ ../Libdis/disi10d_.c ../Libdis/disi10l_.c \ ../Libdis/disiui_.c ../Libdis/disp10d_.c \ ../Libdis/disp10l_.c ../Libdis/disrcs.c \ ../Libdis/disrd.c ../Libdis/disrf.c ../Libdis/disrfcs.c \ ../Libdis/disrfst.c ../Libdis/disrl_.c ../Libdis/disrl.c \ ../Libdis/disrsc.c ../Libdis/disrsi_.c \ ../Libdis/disrsi.c ../Libdis/disrsl_.c \ ../Libdis/disrsl.c ../Libdis/disrss.c ../Libdis/disrst.c \ ../Libdis/disruc.c ../Libdis/disrui.c ../Libdis/disrul.c \ ../Libdis/disrus.c ../Libdis/diswcs.c ../Libdis/diswf.c \ ../Libdis/diswl_.c ../Libdis/diswsi.c ../Libdis/diswsl.c \ ../Libdis/diswui_.c ../Libdis/diswui.c \ ../Libdis/diswul.c \ ../Libifl/dec_attrl.c ../Libifl/dec_attropl.c \ ../Libifl/dec_Authen.c ../Libifl/dec_CpyFil.c \ ../Libifl/dec_JobCred.c ../Libifl/dec_JobFile.c \ ../Libifl/dec_JobId.c ../Libifl/dec_JobObit.c \ ../Libifl/dec_Manage.c ../Libifl/dec_MoveJob.c \ ../Libifl/dec_MsgJob.c ../Libifl/dec_QueueJob.c \ ../Libifl/dec_Reg.c ../Libifl/dec_ReqExt.c \ ../Libifl/dec_ReqHdr.c ../Libifl/dec_Resc.c \ ../Libifl/dec_ReturnFile.c \ ../Libifl/dec_rpyc.c ../Libifl/dec_rpys.c \ ../Libifl/dec_RunJob.c ../Libifl/dec_Shut.c \ ../Libifl/dec_Sig.c ../Libifl/dec_Status.c \ ../Libifl/dec_svrattrl.c ../Libifl/dec_Track.c \ ../Libifl/enc_attrl.c ../Libifl/enc_attropl.c \ ../Libifl/enc_CpyFil.c ../Libifl/enc_JobCred.c \ ../Libifl/enc_JobFile.c ../Libifl/enc_JobId.c \ ../Libifl/enc_JobObit.c ../Libifl/enc_Manage.c \ ../Libifl/enc_MoveJob.c ../Libifl/enc_MsgJob.c \ ../Libifl/enc_QueueJob.c ../Libifl/enc_Reg.c \ ../Libifl/enc_reply.c ../Libifl/enc_ReturnFile.c \ ../Libifl/enc_ReqExt.c \ ../Libifl/enc_ReqHdr.c ../Libifl/enc_RunJob.c \ ../Libifl/enc_Shut.c ../Libifl/enc_Sig.c \ ../Libifl/enc_Status.c ../Libifl/enc_svrattrl.c \ ../Libifl/enc_Track.c ../Libifl/get_svrport.c \ ../Libifl/nonblock.c ../Libifl/PBS_attr.c \ ../Libifl/pbsD_alterjo.c ../Libifl/pbsD_asyrun.c \ ../Libifl/PBS_data.c ../Libifl/pbsD_connect.c \ ../Libifl/pbsD_deljob.c ../Libifl/pbsD_holdjob.c \ ../Libifl/pbsD_chkptjob.c ../Libifl/pbsD_locjob.c \ ../Libifl/PBSD_manage2.c ../Libifl/pbsD_manager.c \ ../Libifl/pbsD_movejob.c ../Libifl/PBSD_manager_caps.c \ ../Libifl/PBSD_msg2.c ../Libifl/pbsD_msgjob.c \ ../Libifl/pbsD_orderjo.c ../Libifl/PBSD_rdrpy.c \ ../Libifl/pbsD_rerunjo.c ../Libifl/pbsD_resc.c \ ../Libifl/pbsD_rlsjob.c ../Libifl/pbsD_runjob.c \ ../Libifl/pbsD_selectj.c ../Libifl/PBSD_sig2.c \ ../Libifl/pbsD_sigjob.c ../Libifl/pbsD_stagein.c \ ../Libifl/pbsD_statjob.c ../Libifl/pbsD_statnode.c \ ../Libifl/pbsD_statque.c ../Libifl/pbsD_statsrv.c \ ../Libifl/PBSD_status2.c ../Libifl/PBSD_status.c \ ../Libifl/pbsD_submit.c ../Libifl/PBSD_submit_caps.c \ ../Libifl/pbsD_termin.c ../Libifl/pbs_geterrmg.c \ ../Libifl/pbs_statfree.c ../Libifl/rpp.c \ ../Libifl/tcp_dis.c ../Libifl/tm.c ../Libifl/list_link.c \ ../Libcmds/ck_job_name.c ../Libcmds/cnt2server.c \ ../Libcmds/cvtdate.c ../Libcmds/get_server.c \ ../Libcmds/locate_job.c ../Libcmds/parse_at.c \ ../Libcmds/parse_depend.c ../Libcmds/parse_destid.c \ ../Libcmds/parse_equal.c ../Libcmds/parse_jobid.c \ ../Libcmds/parse_stage.c \ ../Libcmds/prepare_path.c ../Libcmds/prt_job_err.c \ ../Libcmds/set_attr.c ../Libcmds/set_resource.c \ ../Liblog/chk_file_sec.c ../Liblog/log_event.c \ ../Liblog/pbs_log.c ../Liblog/pbs_messages.c \ ../Liblog/setup_env.c \ ../Libnet/get_hostaddr.c ../Libnet/get_hostname.c \ ../Libnet/md5.c ../Libnet/net_client.c \ ../Libnet/net_server.c ../Libnet/net_set_clse.c \ ../Libnet/rm.c ../Libnet/port_forwarding.c torque-2.4.16/src/lib/Liblog/0000777000113300011330000000000011614035170012661 500000000000000torque-2.4.16/src/lib/Liblog/chk_file_sec.c0000664000113300011330000002420511272401246015345 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include "portability.h" #include "log.h" #ifndef S_ISLNK #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif int chk_file_sec_stderr = 0; /* * chk_file_sec() - Check file/directory security * Part of the PBS System Security "Feature" * * To be secure, all directories (and final file) in path must be: * owned by uid < 10 * owned by group < 10 if group writable * not have world writable unless stick bit set & this is allowed. * * Returns 0 if ok * errno value if not ok, including: * EPERM if not owned by root * ENOTDIR if not file/directory as specified * EACCESS if permissions are not ok */ int chk_file_sec( char *path, /* path to check */ int isdir, /* 1 = path is directory, 0 = file */ int sticky, /* allow write on directory if sticky set */ int disallow, /* perm bits to disallow */ int fullpath, /* recursively check full path */ char *SEMsg) /* O (optional,minsize=1024) */ { int i; char *error_buf; char *pc; int rc = 0; struct stat sbuf; char shorter[_POSIX_PATH_MAX]; char symlink[_POSIX_PATH_MAX]; char tmpLine[1024]; char *EMsg; if (SEMsg != NULL) EMsg = SEMsg; else EMsg = tmpLine; EMsg[0] = '\0'; if ((*path == '/') && fullpath) { /* check full path starting at root */ strcpy(shorter, path); pc = strrchr(shorter, '/'); if ((pc != NULL) && (pc != shorter)) { /* * push "dirname" onto stack, stack will pop back from * root to the given file/directory */ *pc = '\0'; if ((rc = chk_file_sec(shorter, 1, sticky, S_IWGRP | S_IWOTH, 1, EMsg)) != 0) { return(rc); } } } if (lstat(path, &sbuf) == -1) { rc = errno; /* FAILURE */ if (EMsg != NULL) snprintf(EMsg, 1024, "%s cannot be lstat'd - errno=%d, %s", path, rc, strerror(rc)); goto chkerr; } if (S_ISLNK(sbuf.st_mode) != 0) { i = readlink( path, symlink, /* O */ _POSIX_PATH_MAX); if (i < 0) { rc = errno; /* FAILURE */ snprintf(EMsg, 1024, "%s cannot be read as link, errno=%d, %s", path, rc, strerror(rc)); goto chkerr; } symlink[i] = '\0'; if (symlink[0] == '/') { return(chk_file_sec(symlink, isdir, sticky, disallow, fullpath, EMsg)); } strcpy(shorter, path); /* terminate string after final directory delimiter */ pc = strrchr(shorter, '/'); if (pc != NULL) { pc[1] = '\0'; } /* now figure out how to follow the symlink */ if (stat(path, &sbuf) == -1) { rc = errno; /* FAILURE */ snprintf(EMsg, 1024, "%s cannot be stat'd - errno=%d, %s", path, rc, strerror(rc)); goto chkerr; } if (S_ISDIR(sbuf.st_mode) != 0) { strcat(shorter, symlink); } else { strcpy(shorter, symlink); } return(chk_file_sec(shorter, isdir, sticky, disallow, fullpath, EMsg)); } i = sbuf.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); if (sbuf.st_uid > 10) { rc = EPERM; /* FAILURE */ snprintf(EMsg, 1024, "%s is not owned by admin user", path); } else if (((isdir == 1) && (S_ISDIR(sbuf.st_mode) == 0)) || ((isdir == 0) && (S_ISREG(sbuf.st_mode) == 0))) { /* FAILURE */ snprintf(EMsg, 1024, "%s is not directory", path); rc = ENOTDIR; } else if (isdir && sticky && !fullpath) { if ((S_ISDIR(sbuf.st_mode) == 0) || ((sbuf.st_mode & S_ISVTX) == 0) || (i != (S_IRWXU | S_IRWXG | S_IRWXO))) { /* FAILURE */ snprintf(EMsg, 1024, "%s cannot be accessed", path); rc = EACCES; } } else if (i & disallow) { /* if group write, gid must be less than 10 */ if ((i & disallow & S_IWGRP) && (sbuf.st_gid > 9)) { /* FAILURE */ snprintf(EMsg, 1024, "%s is group writable", path); rc = EPERM; } /* if world write, sticky bit must be set and "sticky" ok */ if (i & disallow & S_IWOTH) { if ((S_ISDIR(sbuf.st_mode) == 0) || (((sbuf.st_mode & S_ISVTX) == 0) || (sticky != 1))) { /* FAILURE */ snprintf(EMsg, 1024, "%s is world writable and not sticky", path); rc = EACCES; } } /* check any remaining bits */ if (i & disallow & ~(S_IWGRP | S_IWOTH)) { /* FAILURE */ snprintf(EMsg, 1024, "%s is writable by group or other", path); rc = EACCES; } } chkerr: if (rc != 0) { if ((error_buf = malloc(LOG_BUF_SIZE)) == NULL) { if (chk_file_sec_stderr) { fprintf(stdout, "chk_tree: Malloc failed: error #%d: (%s)\n", rc, strerror(rc) ? strerror(rc) : "UNKNOWN"); } else { log_err(rc, "chk_file_sec", "Malloc failed"); } } else { if (EMsg[0] != '\0') { sprintf(error_buf, "Security violation with \"%s\" - %s", path, EMsg); } else { sprintf(error_buf, "Security violation with \"%s\", errno=%d, %s", path, rc, strerror(rc)); } if (chk_file_sec_stderr) { fprintf(stdout, "chk_tree: %s: error #%d: (%s)\n", error_buf, rc, strerror(rc) ? strerror(rc) : "UNKNOWN"); } else { log_err(rc, "chk_file_sec", error_buf); } free(error_buf); } } /* END if (rc != 0) */ return(rc); } /* END chk_sec_file.c */ /* END chk_file_sec.c */ torque-2.4.16/src/lib/Liblog/log_event.c0000664000113300011330000001310011272401246014721 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * log_event.c - contains functions to log event messages to the log file. * * This is specific to the PBS Server. * * Functions included are: * log_event() * log_change() */ #include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" #include #include #include #include "log.h" #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "server.h" /* private data */ static long log_event_lvl_priv = PBSEVENT_ERROR | PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_JOB | PBSEVENT_JOB_USAGE | PBSEVENT_SECURITY | PBSEVENT_SCHED | PBSEVENT_DEBUG | PBSEVENT_DEBUG2; /* external global data */ extern char *path_home; long *log_event_mask = &log_event_lvl_priv; /* * log_event - log a server event to the log file * * Checks to see if the event type is being recorded. If they are, * pass off to log_record(). * * The caller should ensure proper formating of the message if "text" * is to contain "continuation lines". */ void log_event( int eventtype, int objclass, char *objname, char *text) { if (((eventtype & PBSEVENT_FORCE) == 0) && ((*log_event_mask & eventtype) == 0)) { return; /* not logging this type of event */ } log_record(eventtype, objclass, objname, text); return; } /* END log_event() */ /* END log_event.c */ torque-2.4.16/src/lib/Liblog/pbs_messages.c0000664000113300011330000002641411272401246015426 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include "portability.h" #include "pbs_error.h" /* * Messages issued by the server. They are kept here in one place * to make translation a bit easier. * * WARNING - there are places where a message and other info is stuffed * into a buffer, keep the messages short! * * This first set of messages are recorded by the server or mom to the log. */ char *msg_abt_err = "Unable to abort Job %s which was in substate %d"; char *msg_badexit = "Abnormal exit status 0x%x: "; char *msg_badwait = "Invalid time in work task for waiting, job = %s"; char *msg_deletejob = "Job deleted"; char *msg_delrunjobsig = "Job sent signal %s on delete"; char *msg_err_malloc = "malloc failed"; char *msg_err_noqueue = "Unable to requeue job, queue is not defined"; char *msg_err_purgejob = "Unlink of job file failed"; char *msg_err_unlink = "Unlink of %s file %s failed"; char *msg_illregister = "Illegal op in register request received for job %s"; char *msg_info_server = "Torque Server Version = %s, loglevel = %d"; char *msg_info_mom = "Torque Mom Version = %s, loglevel = %d"; char *msg_init_abt = "Job aborted on PBS Server initialization"; char *msg_init_baddb = "Unable to read server database"; char *msg_init_badjob = "Recover of job %s failed"; char *msg_init_chdir = "unable to change to directory %s"; char *msg_init_expctq = "Expected %d, recovered %d queues"; char *msg_init_exptjobs = "Expected %d, recovered %d jobs"; char *msg_init_nojobs = "No jobs to open"; char *msg_init_noqueues = "No queues to open"; char *msg_init_norerun = "Unable to rerun job at Server initialization"; char *msg_init_queued = "Requeued in queue: "; char *msg_init_recovque = "Recovered queue %s"; char *msg_init_substate = "Requeueing job, substate: %d "; char *msg_init_unkstate = "Unable to recover job in strange substate: %d"; char *msg_isodedecode = "Decode of request failed"; char *msg_issuebad = "attempt to issue invalid request of type %d"; char *msg_job_abort = "Aborted by PBS Server "; char *msg_job_del = "job deleted"; char *msg_jobholdset = "Holds %s set at request of %s@%s"; char *msg_jobholdrel = "Holds %s released at request of %s@%s"; char *msg_job_end = "Execution terminated"; char *msg_job_end_stat = "Exit_status=%d"; char *msg_job_end_sig = "Terminated on signal %d"; char *msg_jobmod = "Job Modified"; char *msg_jobnew = "Job Queued at request of %s@%s, owner = %s, job name = %s, queue = %s"; char *msg_jobrerun = "Job Rerun"; char *msg_jobrun = "Job Run"; char *msg_job_start = "Begun execution"; char *msg_job_stageinfail = "File stage in failed, see below.\nJob will be retried later, please investigate and correct problem."; char *msg_job_copychkptfail = "Checkpoint file copy failed, see below.\nJob will be retried later, please investigate and correct problem."; char *msg_job_otherfail = "An error has occurred processing your job, see below."; char *msg_leftrunning = "job running on at Server shutdown"; char *msg_manager = "%s at request of %s@%s"; char *msg_man_cre = "created"; char *msg_man_del = "deleted"; char *msg_man_set = "attributes set: "; char *msg_man_uns = "attributes unset: "; char *msg_messagejob = "Message request to job status %d"; char *msg_mombadhold = "MOM rejected hold request: %d"; char *msg_mombadmodify = "MOM rejected modify request, error: %d"; char *msg_momsetlim = "Job start failed. Can't set \"%s\" limit: %s.\n"; char *msg_momnoexec1 = "Job cannot be executed\nSee Administrator for help"; char *msg_momnoexec2 = "Job cannot be executed\nSee job standard error file"; char *msg_movejob = "Job moved to "; char *msg_norelytomom = "Server could not connect to MOM"; char *msg_obitnojob = "Job Obit notice received from %s has error %d"; char *msg_obitnocpy = "Post job file processing error; job %s on host %s"; char *msg_obitnodel = "Unable to delete files for job %s, on host %s"; char *msg_on_shutdown = " on Server shutdown"; char *msg_orighost = "Job missing PBS_O_HOST value"; char *msg_permlog = "Unauthorized Request, request type: %d, Object: %s, Name: %s, request from: %s@%s"; char *msg_postmomnojob = "Job not found after hold reply from MOM"; char *msg_request = "Type %s request received from %s@%s, sock=%d"; char *msg_regrej = "Dependency request for job rejected by "; char *msg_registerdel = "Job deleted as result of dependency on job %s"; char *msg_registerrel = "Dependency on job %s released."; char *msg_routexceed = "Route queue lifetime exceeded"; char *msg_script_open = "Unable to open script file"; char *msg_script_write = "Unable to write script file"; char *msg_shutdown_op = "Shutdown request from %s@%s "; char *msg_shutdown_start = "Starting to shutdown the server, type is "; char *msg_startup1 = "Server %s started, initialization type = %d"; char *msg_startup2 = "Server Ready, pid = %d, loglevel=%d"; char *msg_startup3 = "%s %s: %s mode and %s exists, \ndo you wish to continue y/(n)?"; char *msg_svdbopen = "Unable to open server data base"; char *msg_svdbnosv = "Unable to save server data base"; char *msg_svrdown = "Server shutdown completed"; /* This construct pulls the text parts from the batch types definitions * * @see pbs_batchreqtype_db.h for more info */ #define PbsBatchReqType(id,text) text, static const char *PBatchReqType[] = { #include "pbs_batchreqtype_db.h" NULL }; #undef PbsBatchReqType #define NPBatchReqType (sizeof(PBatchReqType)/sizeof(PBatchReqType[0])) /* used by server/req_manager.c */ char *msg_attrtype = "Warning: type of queue %s incompatible with attribute %s"; /* used by server/run_sched.c */ char *msg_sched_called = "Scheduler was sent the command %s"; char *msg_sched_nocall = "Could not contact Scheduler"; char *msg_listnr_called = "Listener %d sent event %s"; char *msg_listnr_nocall = "Could not contact Listener"; /* pbs_err_db generators * * @see pbs_error_db.h * * @note this constant should be const char*, but the current state of code * doesn't allow this */ /* this construct generates array of text representations for error constants */ #define PbsErrClient(id, txt) txt, static char * pbs_err_client_txt[] = { #include "pbs_error_db.h" (char*)0 }; #undef PbsErrClient #define PbsErrRm(id, txt) txt, static char * pbs_err_rm_txt[] = { #include "pbs_error_db.h" (char*)0 }; #undef PbsErrRm /*END: pbs_err_db generators */ /* * pbse_to_txt() - return a text message for an PBS error number * if it exists */ char *pbse_to_txt( int err) /* I */ { if (err == 0) return pbs_err_client_txt[0]; if (err > PBSE_FLOOR && err < PBSE_CEILING) return pbs_err_client_txt[err - PBSE_FLOOR]; if (err > PBSE_RMFLOOR && err < PBSE_RMCEILING) return pbs_err_rm_txt[err - PBSE_RMFLOOR]; return (char*)0; } /* END pbse_to_txt() */ /* * pbs_strerror() - return a pbs text message for an PBS error number * if it exists or return strerror results */ char *pbs_strerror( int err) /* I */ { if (err > PBSE_) { return (pbse_to_txt(err)); } return (strerror(err)); } /* END pbs_strerror() */ /* * rqtype_to_txt() - Return the printable name of a request type */ const char *reqtype_to_txt( int reqtype) { if (reqtype >= 0 && reqtype < (int)NPBatchReqType && PBatchReqType[reqtype]) return(PBatchReqType[reqtype]); else return("NONE"); } /* END reqtype_to_txt() */ torque-2.4.16/src/lib/Liblog/Makefile.in0000664000113300011330000003271611605403732014660 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Liblog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Liblog/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Liblog/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all compilation happens in lib/Libpbs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Liblog/Makefile.am0000664000113300011330000000012411272401246014631 00000000000000include $(top_srcdir)/buildutils/config.mk # all compilation happens in lib/Libpbs torque-2.4.16/src/lib/Liblog/setup_env.c0000664000113300011330000001523311272401246014760 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "portability.h" #include "log.h" extern char **environ; /* * setup_env - setup the daemon's environment * * To provide a "safe and secure" environment, the daemons replace their * inherited one with one from a file. Each line in the file is * either a comment line, starting with '#' or ' ', or is a line of * the forms: variable=value * variable * In the second case the value is obtained from the current environment. * * Returns: number of variables placed or -1 on error */ #define PBS_ENVP_STR 64 #define PBS_ENV_CHUNCK 1024 int setup_env( char *filen) { char buf[256]; int evbufsize = 0; FILE *efile; char *envbuf = NULL; static char *envp[PBS_ENVP_STR + 1]; int len; int nstr = 0; char *pequal; char *pval = NULL; envp[0] = NULL; if ((filen == NULL) || (*filen == '\0')) { environ = envp; return(0); } efile = fopen(filen, "r"); if (efile != NULL) { while (fgets(buf, 255, efile)) { if ((buf[0] != '#') && (buf[0] != ' ') && (buf[0] != '\n')) { /* remove newline */ len = strlen(buf); buf[len - 1] = '\0'; if ((pequal = strchr(buf, (int)'=')) == NULL) { if ((pval = getenv(buf)) == NULL) continue; len += strlen(pval) + 1; } if (evbufsize < len) { if ((envbuf = malloc(PBS_ENV_CHUNCK)) == NULL) goto err; evbufsize = PBS_ENV_CHUNCK; } (void)strcpy(envbuf, buf); if (pequal == NULL) { (void)strcat(envbuf, "="); (void)strcat(envbuf, pval); } envp[nstr++] = envbuf; if (nstr == PBS_ENVP_STR) goto err; envp[nstr] = NULL; envbuf += len; evbufsize -= len; } /* END if (Buf[0]) */ } /* END while (fgets(buf,255,efile)) */ /* copy local environment */ if ((pval = getenv("PBSDEBUG")) != NULL) { sprintf(envbuf, "PBSDEBUG=%s", pval); len = strlen(envbuf); envp[nstr++] = envbuf; if (nstr == PBS_ENVP_STR) goto err; envp[nstr] = NULL; envbuf += len; evbufsize -= len; } fclose(efile); environ = envp; } /* END if (efile != NULL) */ else if (errno != ENOENT) { goto err; } return (nstr); err: log_err(-1, "setup_env", "could not set up the environment"); return(-1); } /* END setup_env() */ torque-2.4.16/src/lib/Liblog/pbs_log.c0000664000113300011330000004662211272401246014403 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * pbs_log.c - contains functions to log error and event messages to * the log file. * * Functions included are: * log_open() * log_err() * log_ext() * log_record() * log_close() * log_roll() * log_size() */ #include /* the master config generated by configure */ #include "portability.h" #include "pbs_error.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "log.h" #if SYSLOG #include #endif /* Global Data */ char log_buffer[LOG_BUF_SIZE]; char log_directory[_POSIX_PATH_MAX/2]; char log_host[1024]; char log_suffix[1024]; char *msg_daemonname = "unset"; /* Local Data */ static int log_auto_switch = 0; static int log_open_day; static FILE *logfile; /* open stream for log file */ static char *logpath = NULL; static volatile int log_opened = 0; #if SYSLOG static int syslogopen = 0; #endif /* SYSLOG */ /* * the order of these names MUST match the defintions of * PBS_EVENTCLASS_* in log.h */ static char *class_names[] = { "n/a", "Svr", "Que", "Job", "Req", "Fil", "Act", "node" }; /* External functions called */ /* local prototypes */ const char *log_get_severity_string(int); /* * mk_log_name - make the log name used by MOM * based on the date: yyyymmdd */ static char *mk_log_name( char *pbuf) /* O (minsize=1024) */ { struct tm *ptm; struct tm tmpPtm; time_t time_now; time_now = time((time_t *)0); ptm = localtime_r(&time_now,&tmpPtm); if (log_suffix[0] != '\0') { if (!strcasecmp(log_suffix, "%h")) { sprintf(pbuf, "%s/%04d%02d%02d.%s", log_directory, ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, (log_host[0] != '\0') ? log_host : "localhost"); } else { sprintf(pbuf, "%s/%04d%02d%02d.%s", log_directory, ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, log_suffix); } } else { sprintf(pbuf, "%s/%04d%02d%02d", log_directory, ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday); } log_open_day = ptm->tm_yday; /* Julian date log opened */ return(pbuf); } /* END mk_log_name() */ int log_init( char *suffix, /* I (optional) */ char *hostname) /* I (optional) */ { if (suffix != NULL) strncpy(log_suffix, suffix, sizeof(log_suffix)); if (hostname != NULL) strncpy(log_host, hostname, sizeof(log_host)); return(0); } /* END log_init() */ /* * log_open() - open the log file for append. * * Opens a (new) log file. * If a log file is already open, and the new file is successfully opened, * the old file is closed. Otherwise the old file is left open. */ int log_open( char *filename, /* abs filename or NULL */ char *directory) /* normal log directory */ { char buf[_POSIX_PATH_MAX]; int fds; if (log_opened > 0) { return(-1); /* already open */ } if (log_directory != directory) /* some calls pass in log_directory */ { strncpy(log_directory, directory, (_POSIX_PATH_MAX) / 2 - 1); } if ((filename == NULL) || (*filename == '\0')) { filename = mk_log_name(buf); log_auto_switch = 1; } else if (*filename != '/') { return(-1); /* must be absolute path */ } if ((fds = open(filename, O_CREAT | O_WRONLY | O_APPEND, 0644)) < 0) { log_opened = -1; /* note that open failed */ return(-1); } if (fds < 3) { log_opened = fcntl(fds, F_DUPFD, 3); /* overload variable */ if (log_opened < 0) { return(-1); } close(fds); fds = log_opened; } /* save the path of the last opened logfile for log_roll */ if (logpath != filename) { if (logpath != NULL) free(logpath); logpath = strdup(filename); } logfile = fdopen(fds, "a"); setvbuf(logfile, NULL, _IOLBF, 0); /* set line buffering */ log_opened = 1; /* note that file is open */ log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "Log", "Log opened"); return(0); } /* END log_open() */ /* * log_err - log an internal error * The error is recorded to the pbs log file and to syslogd if it is * available. If the error file has not been opened and if syslog is * not defined, then the console is opened. */ void log_err( int errnum, /* I (errno or PBSErrno) */ char *routine, /* I */ char *text) /* I */ { log_ext(errnum,routine,text,LOG_ERR); return; } /* END log_err() */ /* * log_ext (log extended) - log message to syslog (if available) and to the TORQUE log. * * The error is recorded to the TORQUE log file and to syslogd if it is * available. If the error file has not been opened and if syslog is * not defined, then the console is opened. * Note that this function differs from log_err in that you can specify a severity * level that will accompany the message in the syslog (see 'manpage syslog' for a list * of severity/priority levels). This function, is in fact, used by log_err--it just uses * a severity level of LOG_ERR */ void log_ext( int errnum, /* I (errno or PBSErrno) */ char *routine, /* I */ char *text, /* I */ int severity) /* I */ { char buf[LOG_BUF_SIZE]; char *EPtr = NULL; char EBuf[1024]; char tmpLine[2048]; const char *SeverityText = NULL; tmpLine[0] = '\0'; EBuf[0] = '\0'; if (errnum == -1) { buf[0] = '\0'; } else { /* NOTE: some strerror() routines return "Unknown error X" w/bad errno */ if (errnum >= 15000) { EPtr = pbse_to_txt(errnum); } else { EPtr = strerror(errnum); } if (EPtr == NULL) { sprintf(EBuf, "unexpected error %d", errnum); EPtr = EBuf; } sprintf(tmpLine,"%s (%d) in ", EPtr, errnum); } SeverityText = log_get_severity_string(severity); snprintf(buf,sizeof(buf),"%s::%s%s, %s", SeverityText, tmpLine, routine, text); buf[LOG_BUF_SIZE - 1] = '\0'; if (log_opened == 0) { #if !SYSLOG log_open("/dev/console", log_directory); #endif /* not SYSLOG */ } if (isatty(2)) { fprintf(stderr, "%s: %s\n", msg_daemonname, buf); } if (log_opened > 0) { log_record( PBSEVENT_ERROR | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, buf); } #if SYSLOG if (syslogopen == 0) { openlog(msg_daemonname, LOG_NOWAIT, LOG_DAEMON); syslogopen = 1; } syslog(severity|LOG_DAEMON,"%s",buf); #endif /* SYSLOG */ return; } /* END log_ext() */ /** * Returns a string to represent the syslog severity-level given. */ const char *log_get_severity_string( int severity) { const char *result = NULL; /* We can't just index into an array to get the strings, as we don't always * have control over what the value of the LOG_* consts are */ switch (severity) { case LOG_EMERG: result = "LOG_EMERGENCY"; break; case LOG_ALERT: result = "LOG_ALERT"; break; case LOG_CRIT: result = "LOG_CRITICAL"; break; case LOG_ERR: result = "LOG_ERROR"; break; case LOG_WARNING: result = "LOG_WARNING"; break; case LOG_NOTICE: result = "LOG_NOTICE"; break; case LOG_DEBUG: result = "LOG_DEBUG"; break; case LOG_INFO: default: result = "LOG_INFO"; break; } return(result); } /* END log_get_severity_string() */ /* * log_record - log a message to the log file * The log file must have been opened by log_open(). * * NOTE: do not use in pbs_mom spawned children - does not write to syslog!!! * * The caller should ensure proper formating of the message if "text" * is to contain "continuation lines". */ void log_record( int eventtype, /* I */ int objclass, /* I */ char *objname, /* I */ char *text) /* I */ { int tryagain = 2; time_t now; struct tm *ptm; struct tm tmpPtm; int rc = 0; FILE *savlog; char *start = NULL, *end = NULL; size_t nchars; if (log_opened < 1) { return; } now = time((time_t *)0); /* get time for message */ ptm = localtime_r(&now,&tmpPtm); /* Do we need to switch the log? */ if (log_auto_switch && (ptm->tm_yday != log_open_day)) { log_close(1); log_open(NULL, log_directory); if (log_opened < 1) { return; } } /* * Looking for the newline characters and splitting the output message * on them. Sequence "\r\n" is mapped to the single newline. */ start = text; while (1) { for (end = start; *end != '\n' && *end != '\r' && *end != '\0'; end++) ; nchars = end - start; if (*end == '\r' && *(end + 1) == '\n') end++; while (tryagain) { rc = fprintf(logfile, "%02d/%02d/%04d %02d:%02d:%02d;%04x;%10.10s;%s;%s;%s%.*s\n", ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_year + 1900, ptm->tm_hour, ptm->tm_min, ptm->tm_sec, (eventtype & ~PBSEVENT_FORCE), msg_daemonname, class_names[objclass], objname, (text == start ? "" : "[continued]"), (int)nchars, start); if ((rc < 0) && (errno == EPIPE) && (tryagain == 2)) { /* the log file descriptor has been changed--it now points to a socket! * reopen log and leave the previous file descriptor alone--do not close it */ log_opened = 0; log_open(NULL, log_directory); tryagain--; } else { tryagain = 0; } } if (rc < 0) break; if (*end == '\0') break; start = end + 1; } /* END while (1) */ fflush(logfile); if (rc < 0) { rc = errno; clearerr(logfile); savlog = logfile; logfile = fopen("/dev/console", "w"); log_err(rc, "log_record", "PBS cannot write to its log"); fclose(logfile); logfile = savlog; } return; } /* END log_record() */ /* * log_close - close the current open log file */ void log_close( int msg) /* BOOLEAN - write close message */ { if (log_opened == 1) { log_auto_switch = 0; if (msg) { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "Log", "Log closed"); } fclose(logfile); log_opened = 0; } #if SYSLOG if (syslogopen) closelog(); #endif /* SYSLOG */ return; } /* END log_close() */ /** * log_remove_old - Removes log files older than a given time. * This function removes files from the given path if they were last modified after ExpireTime. * * Note that this function will skip over special filenames like '.' and '..'. * * @param DirPath (I) * @param ExpireTime (I, how old the file must be to be removed, in seconds) * if (Expiretime == 0), nothing will be removed * @return 0 on success, non-zero otherwise */ int log_remove_old( char *DirPath, /* I (path in which we're removing files)*/ unsigned long ExpireTime) /* I (how old the file must be to be removed, in seconds) */ { char tmpPath[MAX_PATH_LEN]; DIR *DirHandle; struct dirent *FileHandle; struct stat sbuf; unsigned long FMTime; unsigned long TTime; int IsDir = FALSE; TTime = time((time_t *)NULL); /* check the input for an empty path */ if ((DirPath == NULL) || (DirPath[0] == '\0')) { return(-1); } if (ExpireTime == 0) { return(0); } /* open directory for reading */ DirHandle = opendir(DirPath); /* fail if path couldn't be opened */ if (DirHandle == (DIR *)NULL) { return(-1); } FileHandle = readdir(DirHandle); while (FileHandle != (struct dirent *)NULL) { /* attempt to delete old files */ if (!strcmp(FileHandle->d_name,".") || !strcmp(FileHandle->d_name,"..")) { /* skip special file names */ FileHandle = readdir(DirHandle); continue; } snprintf(tmpPath,sizeof(tmpPath),"%s/%s", DirPath, FileHandle->d_name); if (stat(tmpPath,&sbuf) == -1) { /* -1 is the failure value for stat */ FMTime = 0; FileHandle = readdir(DirHandle); continue; } /* set FMTime's value */ FMTime = (unsigned long)sbuf.st_mtime; if ((IsDir == FALSE) && (TTime - FMTime) > ExpireTime) { /* file is too old - delete it */ remove(tmpPath); } FileHandle = readdir(DirHandle); } /* end file checking while loop */ closedir(DirHandle); return(0); } /* END log_remove_ld() */ void log_roll( int max_depth) { int i, suffix_size, file_buf_len, as; int err = 0; char *source = NULL; char *dest = NULL; if (!log_opened) { return; } /* save value of log_auto_switch */ as = log_auto_switch; log_close(1); /* find out how many characters the suffix could be. (save in suffix_size) start at 1 to account for the "." */ for (i = max_depth, suffix_size = 1;i > 0;suffix_size++, i /= 10); /* allocate memory for rolling */ file_buf_len = sizeof(char) * (strlen(logpath) + suffix_size + 1); source = (char*)malloc(file_buf_len); dest = (char*)malloc(file_buf_len); if ((source == NULL) || (dest == NULL)) { err = errno; goto done_roll; } /* call unlink to delete logname.max_depth - it doesn't matter if it doesn't exist, so we'll ignore ENOENT */ sprintf(dest, "%s.%d", logpath, max_depth); if ((unlink(dest) != 0) && (errno != ENOENT)) { err = errno; goto done_roll; } /* logname.max_depth is gone, so roll the rest of the log files */ for (i = max_depth - 1;i >= 0;i--) { if (i == 0) { strcpy(source, logpath); } else { sprintf(source, "%s.%d", logpath, i); } sprintf(dest, "%s.%d", logpath, i + 1); /* rename file if it exists */ if ((rename(source, dest) != 0) && (errno != ENOENT)) { err = errno; goto done_roll; } } /* END for (i) */ done_roll: if (as) { log_open(NULL, log_directory); } else { log_open(logpath, log_directory); } if (source != NULL) free(source); if (dest != NULL) free(dest); if (err != 0) { log_err(err, "log_roll", "error while rollng logs"); } else { log_record( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "Log", "Log Rolled"); } return; } /* END log_roll() */ /* return size of log file in kilobytes */ long log_size(void) { #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) struct stat64 file_stat; #else struct stat file_stat; #endif #if defined(HAVE_STRUCT_STAT64) && defined(HAVE_STAT64) if (log_opened && (fstat64(fileno(logfile), &file_stat) != 0)) #else if (log_opened && (fstat(fileno(logfile), &file_stat) != 0)) #endif { /* FAILURE */ log_err(errno, "log_size", "PBS cannot fstat logfile"); return(0); } return(file_stat.st_size / 1024); } /* END pbs_log.c */ torque-2.4.16/src/lib/Libcmds/0000777000113300011330000000000011614035170013026 500000000000000torque-2.4.16/src/lib/Libcmds/parse_jobid.c0000664000113300011330000001507511272401247015403 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * parse_jobid * * takes a job_id string as input, parses it to separate the * 'current_server[:port]' part, and returns this in the return * argument 'server'; if things go OK, the function value is * set to 0, if errors, it is set to 1. The 'current_server[:port]' * part of 'job_id' is removed, if it was present. * * Full legal syntax is: * seq_number[.parent_server[:port]][@current_server[:port]] */ #include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" #define MAXSERVERNAME PBS_MAXSERVERNAME+PBS_MAXPORTNUM+2 #define ISNAMECHAR(x) ( (isgraph(x)) && ((x) != '#') && ( (x) != '@') ) static char seq_number[PBS_MAXSEQNUM+PBS_MAXJOBARRAYLEN+1]; static int s_pos; static char parent_server[MAXSERVERNAME]; static int p_pos; static char current_server[MAXSERVERNAME]; static int c_pos; int parse_jobid(char *job_id, char **arg_seq_number, char **arg_parent_server, char **arg_current_server) { int i; char *c; /* initialize static data for this parsing call */ for (i = 0; i < PBS_MAXSEQNUM + PBS_MAXJOBARRAYLEN + 1; i++) seq_number[i] = '\0'; s_pos = 0; for (i = 0; i < MAXSERVERNAME; i++) parent_server[i] = '\0'; p_pos = 0; for (i = 0; i < MAXSERVERNAME; i++) current_server[i] = '\0'; c_pos = 0; /* Begin the parse */ c = job_id; while (isspace(*c)) c++; /* Looking for a seq_number */ while (*c != '\0') { if (isdigit(*c) || *c == '-') { if (s_pos >= PBS_MAXSEQNUM + PBS_MAXJOBARRAYLEN) return 3; seq_number[s_pos++] = *c; } else break; c++; } if (s_pos == 0) return 1; /* Looking for a parent_server */ if (*c == '.') { c++; while (*c != '\0') { if (ISNAMECHAR(*c)) { if (p_pos >= MAXSERVERNAME) return 3; parent_server[p_pos++] = *c; } else break; c++; } if (p_pos == 0) return 1; } /* Looking for a current_server */ if (*c == '@') { c++; while (*c != '\0') { if (ISNAMECHAR(*c)) { if (c_pos >= MAXSERVERNAME) return 3; current_server[c_pos++] = *c; } else break; c++; } if (c_pos == 0) return 1; } if (*c != '\0') return 2; /* set char * pointers to static data, to arguments */ if (arg_seq_number != NULL) *arg_seq_number = seq_number; if (arg_parent_server != NULL) *arg_parent_server = parent_server; if (arg_current_server != NULL) *arg_current_server = current_server; return 0; } torque-2.4.16/src/lib/Libcmds/set_attr.c0000664000113300011330000001304511443476375014760 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * set_attr * * Add an entry to an attribute list. First, create the entry and set * the fields. If the attribute list is empty, then just point it at the * new entry. Otherwise, append the new entry to the list. */ #include /* the master config generated by configure */ #include #include #include #include "pbs_ifl.h" void set_attr( struct attrl **attrib, /* I */ char *attrib_name, /* I */ char *attrib_value) /* I */ { struct attrl *attr, *ap; attr = (struct attrl *)malloc(sizeof(struct attrl)); if (attr == NULL) { fprintf(stderr, "Out of memory\n"); exit(2); } if (attrib_name == NULL) { attr->name = NULL; } else { attr->name = (char *)malloc(strlen(attrib_name) + 1); if (attr->name == NULL) { fprintf(stderr, "out of memory\n"); exit(2); } strcpy(attr->name, attrib_name); } attr->resource = NULL; if (attrib_value == NULL) { attr->value = NULL; } else { attr->value = (char *)malloc(strlen(attrib_value) + 1); if (attr->value == NULL) { fprintf(stderr, "out of memory\n"); exit(2); } strcpy(attr->value, attrib_value); } attr->next = NULL; /* always set op to set */ attr->op = SET; if (*attrib == NULL) { *attrib = attr; } else { ap = *attrib; while (ap->next != NULL) ap = ap->next; ap->next = attr; } return; } /* END set_attr() */ torque-2.4.16/src/lib/Libcmds/cnt2server.c0000664000113300011330000002075711403757171015230 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * cnt2server * * Connect to the server, and if there is an error, print a more * descriptive message. * * Synopsis: * * int cnt2server(char *server) * * server The name of the server to connect to. A NULL or null string * for the default server. * * Returns: * * The connection returned by pbs_connect(). */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "pbs_error.h" #define CNTRETRYDELAY 5 /* >0 is number of seconds to retry, -1 is infinity */ static long cnt2server_retry = 0; int cnt2server_conf( long retry) /* I */ { cnt2server_retry = retry; return(0); } /* END cnt2server_conf() */ int cnt2server( char *SpecServer) /* I (optional) */ { int connect; time_t firsttime = 0, thistime = 0; char Server[1024]; if (cnt2server_retry > 0) { firsttime = time(NULL); } memset(Server, 0, sizeof(Server)); if ((SpecServer != NULL) && (SpecServer[0] != '\0')) { strncpy(Server, SpecServer, sizeof(Server)); Server[sizeof(Server) - 1] = '\0'; } /* NOTE: env vars PBS_DEFAULT and PBS_SERVER will be checked and applied w/in pbs_connect() */ start: connect = pbs_connect(Server); if (connect <= 0) { if (pbs_errno > PBSE_) { switch (pbs_errno) { case PBSE_BADHOST: if (Server[0] == '\0') { fprintf(stderr, "Cannot resolve default server host '%s' - check server_name file.\n", pbs_default()); } else { fprintf(stderr, "Cannot resolve specified server host '%s'.\n", Server); } break; case PBSE_NOCONNECTS: if (thistime == 0) fprintf(stderr, "Too many open connections.\n"); if (cnt2server_retry != 0) goto retry; break; case PBSE_NOSERVER: fprintf(stderr, "No default server name - check server_name file.\n"); break; case PBSE_SYSTEM: if (thistime == 0) fprintf(stderr, "System call failure.\n"); if (cnt2server_retry != 0) goto retry; break; case PBSE_PERM: if (thistime == 0) fprintf(stderr, "No Permission.\n"); if (cnt2server_retry != 0) goto retry; break; case PBSE_PROTOCOL: default: if (thistime == 0) fprintf(stderr, "Communication failure.\n"); if (cnt2server_retry != 0) goto retry; break; } } /* END if (pbs_errno > PBSE_) */ else { if (thistime == 0) { if (errno == ECONNREFUSED) { if (Server[0] == '\0') { char *fbserver; fbserver = pbs_fbserver(); if ((fbserver != NULL) && (fbserver[0] != '\0')) { strncpy(Server, fbserver, sizeof(Server)); Server[sizeof(Server) - 1] = '\0'; if (getenv("PBSDEBUG") != NULL) { fprintf(stderr, "attempting fallback server %s\n", fbserver); } goto start; } fprintf(stderr, "Cannot connect to default server host '%s' - check pbs_server daemon.\n", pbs_default()); } else { fprintf(stderr, "Cannot connect to specified server host '%s'.\n", Server); } } else { perror(NULL); } } if (cnt2server_retry != 0) goto retry; } } /* END if (connect <= 0) */ return(connect); retry: if (thistime == 0) { fprintf(stderr, "Retrying for %d seconds\n", (int)cnt2server_retry); } thistime = time(NULL); if (cnt2server_retry > 0) /* negative is infinite */ { if ((thistime - firsttime) > cnt2server_retry) { return(connect); } if (getenv("PBSDEBUG") != NULL) { fprintf(stderr, "seconds remaining: %d\n", (int)(cnt2server_retry - (thistime - firsttime))); } } else { if (getenv("PBSDEBUG") != NULL) fprintf(stderr, "retrying...\n"); } sleep(CNTRETRYDELAY); goto start; } /* END cnt2server() */ /* END cnt2server.c */ torque-2.4.16/src/lib/Libcmds/prt_job_err.c0000664000113300011330000001115011272401247015417 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * prt_job_err * * Print the error message returned by the server, if supplied. Otherwise, * print a default error message. */ #include /* the master config generated by configure */ #include #include "pbs_error.h" #include "pbs_ifl.h" void prt_job_err( char *cmd, int connect, char *id) { char *errmsg; errmsg = pbs_geterrmsg(connect); if (errmsg != NULL) { fprintf(stderr, "%s: %s ", cmd, errmsg); } else { fprintf(stderr, "%s: Server returned error %d for job ", cmd, pbs_errno); } fprintf(stderr, "%s\n", id); } torque-2.4.16/src/lib/Libcmds/parse_at.c0000664000113300011330000001727011272401247014717 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "pbs_ifl.h" #define ISNAMECHAR(x) ( (isgraph(x)) && ((x) != '#') && ( (x) != '@') ) #ifndef NULL #define NULL 0 #endif /* * * parse_at_item * * syntax: * * at_name[@host] * */ int parse_at_item(char *at_item, char **at_name_out, char **host_name_out) { int i; char *c; static char at_name[MAXPATHLEN+1]; static int a_pos; static char host_name[PBS_MAXSERVERNAME]; static int h_pos; /* initialize static data for this parsing call */ for (i = 0; i < MAXPATHLEN + 1; i++) at_name[i] = '\0'; a_pos = 0; for (i = 0; i < PBS_MAXSERVERNAME; i++) host_name[i] = '\0'; h_pos = 0; /* Begin the parse */ c = at_item; while (isspace(*c)) c++; /* Looking for something before the @ sign */ while (*c != '\0') { if (ISNAMECHAR(*c)) { if (a_pos >= MAXPATHLEN) return 1; at_name[a_pos++] = *c; } else break; c++; } if (a_pos == 0) return 1; /* Looking for a server */ if (*c == '@') { c++; while (*c != '\0') { if (ISNAMECHAR(*c)) { if (h_pos >= PBS_MAXSERVERNAME) return 1; host_name[h_pos++] = *c; } else break; c++; } if (h_pos == 0) return 1; } if (*c != '\0') return 1; /* set char * pointers to static data, to arguments */ if (at_name_out != NULL) *at_name_out = at_name; if (host_name_out != NULL) *host_name_out = host_name; return 0; } /* * * parse_at_list * * syntax: * * at_name[@host] [,at_name[@host],...] * * Arguments: * * list List of at_name[@host] items. * use_count If true, make sure no host is repeated in the list, * and host is defaulted only once. * abs_path If true, make sure host starts with a '/'. * */ struct hostlist { char host[PBS_MAXHOSTNAME]; struct hostlist *next; }; int parse_at_list(char *list, int use_count, int abs_path) { char *b, *c, *s, *l; int comma = 0; char *user, *host; struct hostlist *ph, *nh, *hostlist = (struct hostlist *)0; if (strlen(list) == 0) return (1); if ((l = (char *)malloc(strlen(list) + 1)) == (char *)0) { fprintf(stderr, "Out of memory.\n"); exit(1); } strcpy(l, list); c = l; while (*c != '\0') { /* Drop leading white space */ while (isspace((int)*c)) c++; /* Find the next comma */ s = c; while (*c != ',' && *c) c++; /* If requested, is this an absolute path */ if (abs_path && *s != '/') return 1; /* Drop any trailing blanks */ comma = (*c == ','); *c = '\0'; b = c - 1; while (isspace((int)*b)) *b-- = '\0'; /* Parse the individual list item */ if (parse_at_item(s, &user, &host)) { return 1; } /* The user part must be given */ if (strcmp(user, "") == 0) return 1; /* If requested, make sure the host name is not repeated */ if (use_count) { ph = hostlist; while (ph) { if (strcmp(ph->host, host) == 0) return 1; ph = ph->next; } nh = (struct hostlist *) malloc(sizeof(struct hostlist)); if (!nh) { fprintf(stderr, "Out of memory\n"); exit(1); } nh->next = hostlist; strcpy(nh->host, host); hostlist = nh; } if (comma) { c++; } } /* Release memory for hostlist and argument list */ ph = hostlist; while (ph) { nh = ph->next; free(ph); ph = nh; } free(l); /* Make sure the list does not end with a comma */ if (comma) return 1; return 0; } torque-2.4.16/src/lib/Libcmds/ck_job_name.c0000664000113300011330000001203011272401247015335 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include /* * check_job_name = job name must be <= 15 "printable" characters with * first alphabetic, maybe. The POSIX Batch standard calls for only * alphanumeric, but then conflicts with itself to default to the * script base-name which may have non-alphanumeric characters and * the first character not alphabetic. * * We check for visible, printable characters and the first being * alphabetic if comining from a -N option (chk_alpha = 1). */ #define PBS_MAXJOBNAMELEN 256 int check_job_name( char *name, int chk_alpha) /* I (boolean) */ { if ((strlen(name) > (size_t)PBS_MAXJOBNAMELEN) || ((chk_alpha == 1) && (isalpha((int)*name) == 0))) { /* FAILURE */ return(-1); } while (*name != '\0') { if (isgraph((int)*name++) == 0) /* disallow any non-printing */ { /* FAILURE */ return(-1); } } return(0); } /* END check_job_name() */ torque-2.4.16/src/lib/Libcmds/set_resource.c0000664000113300011330000002162211556046067015631 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * set_resources * * Append a entries to the attribute list that are from the resource list. * If the add flag is set, append the resource regardless. Otherwise, append * it only if it is not already on the list. * */ #include /* the master config generated by configure */ #define TRUE 1 #define FALSE 0 #include #include #include #include #include "pbs_ifl.h" int set_resources( struct attrl **attrib, /* I/O */ char *resources, /* I */ int add) /* I */ { char *r, *eq, *v, *e = NULL; char *str; struct attrl *attr, *ap, *aplast; int found, len; char *qptr = NULL; r = resources; while (*r != '\0') { /* skip leading whitespace */ while (isspace((int)*r)) r++; /* get resource name */ eq = r; while ((*eq != '=') && (*eq != ',') && (*eq != '\0')) eq++; /* make sure there is a resource name */ if (r == eq) { /* FAILURE */ return(1); } /* * Count the number of non-space characters that make up the * resource name. Count only up to the last character before the * separator ('\0', ',' or '='). */ for (str = r, len = 0;(str < eq) && !isspace((int)*str);str++) len++; /* if separated by an equal sign, get the value */ if (*eq == '=') { char *ptr; v = eq + 1; while (isspace((int)*v)) v++; /* FORMAT: =[{'"}],[{'"}][,=...]... */ ptr = strchr(v, ','); if (((qptr = strchr(v, '\'')) != NULL) && (ptr != NULL) && (qptr < ptr)) { v = qptr + 1; } else if (((qptr = strchr(v, '\"')) != NULL) && (ptr != NULL) && (qptr < ptr)) { v = qptr + 1; } else { qptr = NULL; } e = v; while (*e != '\0') { /* FORMAT: =[{'"}],[{'"}][,=...]... */ /* NOTE already tokenized by getopt() which will support quoted whitespace, do not fail on spaces */ if (qptr != NULL) { /* value contains quote - only terminate with quote */ if ((*e == '\'') || (*e == '\"')) break; } else { if (*e == ',') break; } #ifdef TNOT if (isspace((int)*e)) { /* FAILURE */ return(1); } #endif /* TNOT */ e++; } /* END while (*e != '\0') */ } /* END if (*eq == '=') */ else { v = NULL; } /* Allocate memory for the attrl structure */ attr = (struct attrl *)malloc(sizeof(struct attrl)); if (attr == NULL) { fprintf(stderr, "Out of memory\n"); /* FAILURE */ exit(2); } /* Allocate memory for the attribute name and copy */ str = (char *)malloc(strlen(ATTR_l) + 1); if (str == NULL) { fprintf(stderr, "Out of memory\n"); exit(2); } strcpy(str, ATTR_l); attr->name = str; /* Allocate memory for the resource name and copy */ str = (char *)malloc(len + 1); if (str == NULL) { fprintf(stderr, "Out of memory\n"); exit(2); } strncpy(str, r, len); str[len] = '\0'; attr->resource = str; /* Allocate memory for the value and copy */ if (v != NULL) { str = (char *)malloc(e - v + 1); if (str == NULL) { fprintf(stderr, "Out of memory\n"); exit(2); } strncpy(str, v, e - v); str[e - v] = '\0'; attr->value = str; } else { str = (char *)malloc(1); if (str == NULL) { fprintf(stderr, "Out of memory\n"); exit(2); } str[0] = '\0'; attr->value = str; } /* Put it on the attribute list */ /* If the argument add is true, add to the list regardless. * Otherwise, add it to the list only if the resource name * is not already on the list. */ attr->next = NULL; if (*attrib == NULL) { *attrib = attr; } else { aplast = ap = *attrib; found = FALSE; while (ap != NULL) { if (!strcmp(ap->name, ATTR_l) && !strcmp(ap->resource, attr->resource)) found = TRUE; aplast = ap; ap = ap->next; } if (add || !found) aplast->next = attr; } /* Get ready for next resource/value pair */ if (qptr != NULL) { /* skip quotes looking for ',' */ while ((*e == '\'') || (*e == '\"')) e++; } if (v != NULL) r = e; else r = eq; if (*r == ',') { r++; if (*r == '\0') { return(1); } } } /* END while (*r != '\0') */ /* SUCCESS */ return(0); } /* END set_resources() */ torque-2.4.16/src/lib/Libcmds/locate_job.c0000664000113300011330000001214711272401247015220 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * locate_job * * Connect to the server the job was submitted to, and issue a * Locate Job command. The result should be the server that the job * is currently at. */ #include /* the master config generated by configure */ #define TRUE 1 #define FALSE 0 #define notNULL(x) (((x)!=NULL) && (strlen(x)>(size_t)0)) #include #include #include "pbs_ifl.h" int locate_job( char *job_id, char *parent_server, char *located_server) { int connect; char jid_server[PBS_MAXCLTJOBID + 1]; char *location; if ((connect = pbs_connect(parent_server)) >= 0) { /* SUCCESS */ strcpy(jid_server, job_id); if (notNULL(parent_server)) { strcat(jid_server, "@"); strcat(jid_server, parent_server); } location = pbs_locjob(connect, jid_server, NULL); if (location == NULL) { pbs_disconnect(connect); return(FALSE); } strcpy(located_server, location); free(location); pbs_disconnect(connect); return(TRUE); } /* FAILURE */ return(-1); } /* END locate_job() */ torque-2.4.16/src/lib/Libcmds/Makefile.in0000664000113300011330000003272111605403730015017 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libcmds ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libcmds/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libcmds/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all compilation happens in lib/Libpbs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libcmds/get_server.c0000664000113300011330000002345611272401247015271 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * get_server * * ------------------------------------ * As specified in section 5 of the ERS: * * 5.1.2. Directing Requests to Correct Server * * A command shall perform its function by sending the * corresponding request for service to the a batch server. * The choice of batch servers to which to send the request is * governed by the following ordered set of rules: * * 1. For those commands which require or accept a job identif- * ier operand, if the server is specified in the job iden- * tifier operand as @server, then the batch requests will * be sent to the server named by server. * * 2. For those commands which require or accept a job identif- * ier operand and the @server is not specified, then the * command will attempt to determine the current location of * the job by sending a Locate Job batch request to the * server which created the job. * * 3. If a server component of a destination is supplied via * the -q option, such as on qsub and qselect, but not * qalter, then the server request is sent to that server. * * 4. The server request is sent to the server identified as * the default server, see section 2.6.3. * [pbs_connect() implements this] * * 2.6.3. Default Server * * When a server is not specified to a client, the client will * send batch requests to the server identified as the default * server. A client identifies the default server by (a) the * setting of the environment variable PBS_DEFAULT which con- * tains a destination, or (b) the destination in the batch * administrator established file {PBS_DIR}/server_name. * ------------------------------------ * * Takes a job_id_in string as input, calls parse_jobid to separate * the pieces, then applies the above rules in order * If things go OK, the function value is set to 0, * if errors, it is set to 1. * * Full legal syntax is: * seq_number[.parent_server[:port]][@current_server[:port]] * */ #include /* the master config generated by configure */ #include #include #include #include #include #include "pbs_ifl.h" #include "net_connect.h" #define notNULL(x) (((x)!=NULL) && (strlen(x)>(size_t)0)) extern int parse_jobid A_((char *, char **, char **, char **)); int TShowAbout(void) { char *dserver; char *servervar; char tmpLine[1024]; dserver = pbs_default(); servervar = getenv("PBS_DEFAULT"); strcpy(tmpLine, PBS_DEFAULT_FILE); tmpLine[strlen(tmpLine) - strlen("/pbs_server") - 1] = '\0'; fprintf(stderr, "HomeDir: %s InstallDir: %s Server: %s%s\n", tmpLine, PBS_INSTALL_DIR, dserver, (servervar != NULL) ? " (PBS_DEFAULT is set)" : ""); fprintf(stderr, "BuildDir: %s\n", PBS_SOURCE_DIR); fprintf(stderr, "BuildUser: %s\n", PBS_BUILD_USER); fprintf(stderr, "BuildHost: %s\n", PBS_BUILD_HOST); fprintf(stderr, "BuildDate: %s\n", PBS_BUILD_DATE); fprintf(stderr, "Version: %s\n", PACKAGE_VERSION); return(0); } /* END TShowAbout() */ /** * Take a job ID string and parse it into * job ID and server name parts. * * @param job_id_in Input string of the form [.][@] * @param job_id_out Output string containing only the job ID part of the input specification. * @param server_out Output string containing nothing or a host url if specified. */ int get_server( char *job_id_in, /* read only */ char *job_id_out, /* write only */ char *server_out) /* write only */ { char *seq_number; char *parent_server; char *current_server; char def_server[PBS_MAXSERVERNAME + 1]; char host_server[PBS_MAXSERVERNAME + 1]; char *c; /* parse the job_id_in into components */ if (parse_jobid(job_id_in, &seq_number, &parent_server, ¤t_server)) { return(1); } /* Apply the above rules, in order, except for the locate job request. That request is only sent if the job is not found on the local server. */ if (notNULL(current_server)) { /* @server found */ strcpy(server_out, current_server); } else if (notNULL(parent_server)) { /* .server found */ strcpy(server_out, parent_server); } else { /* can't locate a server, so return a NULL to tell pbs_connect to use default */ server_out[0] = '\0'; } /* Make a fully qualified name of the job id. */ strcpy(job_id_out, seq_number); strcat(job_id_out, "."); if (notNULL(parent_server)) { if (notNULL(current_server)) { /* parent_server might not be resolvable if current_server specified */ strcat(job_id_out, parent_server); } else { if (get_fullhostname(parent_server, host_server, PBS_MAXSERVERNAME, NULL) != 0) { /* FAILURE */ return(1); } strcat(job_id_out, host_server); } if ((c = strchr(parent_server, ':')) != 0) { if (*(c - 1) == '\\') c--; strcat(job_id_out, c); } } else { parent_server = pbs_default(); if ((parent_server == (char *)NULL) || (*parent_server == '\0')) { return(1); } strncpy(def_server, parent_server, PBS_MAXSERVERNAME); c = def_server; while ((*c != '\n') && (*c != '\0')) c++; *c = '\0'; if (get_fullhostname(def_server, host_server, PBS_MAXSERVERNAME, NULL) != 0) { /* FAILURE */ return(1); } strcat(job_id_out, host_server); if ((c = strchr(def_server, ':')) != 0) { if (*(c - 1) == '\\') c--; strcat(job_id_out, c); } } /* END else */ return(0); } /* END get_server() */ /* END get_server.c */ torque-2.4.16/src/lib/Libcmds/prepare_path.c0000664000113300011330000002100411605403055015560 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * perpare_path * * Perpare a full path name to give to the server. * */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "net_connect.h" int prepare_path( char *path_in, /* I */ char *path_out, /* O */ char *host) /* I */ { int i; char *c; char host_name[PBS_MAXSERVERNAME+1]; int h_pos; char path_name[MAXPATHLEN+1]; int p_pos; char cwd[MAXPATHLEN+1]; char *host_given; struct stat statbuf; dev_t dev; ino_t ino; if (path_out != NULL) path_out[0] = '\0'; if ((path_in == NULL) || (path_out == NULL)) { return(1); } /* initialize data for this parsing call */ for (i = 0;i <= PBS_MAXSERVERNAME;i++) host_name[i] = '\0'; h_pos = 0; for (i = 0;i <= MAXPATHLEN;i++) path_name[i] = '\0'; p_pos = 0; cwd[MAXPATHLEN] = '\0'; /* Begin the parse */ c = path_in; while ((int)isspace(*c)) c++; if (strlen(c) == 0) { return(1); } /* Looking for a hostname : */ if ((host_given = strchr(path_in, ':')) != NULL) { while ((*c != ':') && (*c != '\0')) { if (isalnum(*c) || (*c == '.') || (*c == '-') || (*c == '_')) host_name[h_pos++] = *c; else break; c++; } } /* Looking for a posix path */ if ((*c == ':') || (c == path_in)) { if (*c == ':') c++; while (*c != '\0') { if (!isgraph(*c)) break; path_name[p_pos++] = *c; c++; } } if (*c != '\0') { /* FAILURE - we had trailing trash, or a parse error */ return(1); } if (strlen(path_name) == 0) { /* Accept just host name for path */ if (host_given != NULL) { strcpy(path_out, host_name); strcat(path_out, ":"); } return(3); } /* get full host name */ if (host_name[0] == '\0') { if (host != NULL) snprintf(host_name,sizeof(host_name),"%s",host); else if (gethostname(host_name, PBS_MAXSERVERNAME) != 0) { /* FAILURE */ return(2); } } /* This is obnoxious. If you are submitting from outside of the cluster, you tend to get the wrong hostname. Instead, just stop surprising the user and just do what they said. if (get_fullhostname(host_name,host_name,PBS_MAXSERVERNAME,NULL) != 0) return(2); */ /* prepare complete path name */ strcpy(path_out, host_name); strcat(path_out, ":"); if ((path_name[0] != '/') && (strncmp(path_name,"$HOME",strlen("$HOME")) != 0) && (strncmp(path_name,"${HOME}",strlen("${HOME}")) != 0) && (host_given == NULL)) { c = getenv("PWD"); /* PWD carries a name that will cause */ if (c != NULL) { /* the NFS to mount */ if (stat(c, &statbuf) < 0) { /* can't stat PWD */ c = NULL; } else { dev = statbuf.st_dev; ino = statbuf.st_ino; if (stat(".", &statbuf) < 0) { /* FAILURE */ perror("prepare_path: cannot stat current directory:"); return(1); } } if ((!memcmp(&dev, &statbuf.st_dev, sizeof(dev_t))) && (!memcmp(&ino, &statbuf.st_ino, sizeof(ino_t)))) { if (c != NULL) strcpy(cwd, c); } else { c = NULL; } } if (c == NULL) { c = getcwd(cwd, MAXPATHLEN); if (c == NULL) { /* FAILURE */ perror("prepare_path: getcwd failed: "); return(1); } } strcat(path_out, cwd); strcat(path_out, "/"); } /* try to determine if this is a directory, if it is end it with a '/' */ if ((host_given == NULL) && (path_name[strlen(path_name) - 1] != '/')) { if ((stat(path_name, &statbuf) == 0) && (S_ISDIR(statbuf.st_mode))) { strcat(path_name, "/"); } } if (strncmp(path_name,"$HOME",strlen("$HOME")) == 0) { /* get the actual value for $HOME */ char *HomeVal = getenv("HOME"); char *NamePtr = path_name+strlen("$HOME"); /* add the string to the path correctly */ strcat(path_out,HomeVal); strcat(path_out,NamePtr); } else { strcat(path_out, path_name); } /* SUCCESS */ return(0); } /* END prepare_path() */ /* END prepare_path.c */ torque-2.4.16/src/lib/Libcmds/parse_stage.c0000664000113300011330000001707711272401247015423 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "pbs_ifl.h" #ifndef NULL #define NULL 0 #endif #define ISNAMECHAR(x) ( (isgraph(x)) && ((x) != '@') && ((x) != ':') ) /* * * parse_stage_name * * syntax: * * locat_file@hostname:remote_file * * Arguments: * * pair A staged file name pair. * local Local file name. * host Remote host. * remote Remote file name. * */ int parse_stage_name(char *pair, char **local, char **host, char **remote) { int i; char *c; static char local_name[MAXPATHLEN+1]; static int l_pos; static char host_name[PBS_MAXSERVERNAME]; static int h_pos; static char remote_name[MAXPATHLEN+1]; static int r_pos; /* initialize static data for this parsing call */ for (i = 0; i < MAXPATHLEN + 1; i++) local_name[i] = '\0'; l_pos = 0; for (i = 0; i < PBS_MAXSERVERNAME; i++) host_name[i] = '\0'; h_pos = 0; for (i = 0; i < MAXPATHLEN + 1; i++) remote_name[i] = '\0'; r_pos = 0; /* Begin the parse */ c = pair; while (isspace(*c)) c++; /* Looking for something before the @ sign */ while (*c != '\0') { if (ISNAMECHAR(*c)) { if (l_pos >= MAXPATHLEN) return 1; local_name[l_pos++] = *c; } else break; c++; } if (l_pos == 0) return 1; /* Looking for something between the @ and the : */ if (*c == '@') { c++; while (*c != '\0') { if (ISNAMECHAR(*c)) { if (h_pos >= PBS_MAXSERVERNAME) return 1; host_name[h_pos++] = *c; } else break; c++; } } if (h_pos == 0) return 1; /* Looking for something after the : */ if (*c == ':') { c++; while (*c != '\0') { if (ISNAMECHAR(*c)) { if (r_pos >= MAXPATHLEN) return 1; remote_name[r_pos++] = *c; } else break; c++; } } if (r_pos == 0) return 1; if (*c != '\0') return 1; /* set char * pointers to static data, to arguments */ if (local != NULL) *local = local_name; if (host != NULL) *host = host_name; if (remote != NULL) *remote = remote_name; return (0); } /* * * parse_stage_list * * syntax: * * local_file@hostname:remote_file [,...] * * Arguments: * * list List of staged file name pairs. * */ int parse_stage_list(char *list) { char *b, *c, *s, *l; int comma = 0; char *local, *host, *remote; if (strlen(list) == 0) return (1); if ((l = (char *)malloc(strlen(list) + 1)) == (char *)0) { fprintf(stderr, "Out of memory.\n"); exit(1); } strcpy(l, list); c = l; while (*c != '\0') { /* Drop leading white space */ while (isspace((int)*c)) c++; /* Find the next comma */ s = c; while (*c != '\0' && *c != ',') c++; /* Drop any trailing blanks */ comma = (*c == ','); *c = '\0'; b = c - 1; while (isspace((int)*b)) *b-- = '\0'; /* Parse the individual list item */ if (parse_stage_name(s, &local, &host, &remote)) { (void)free(l); return 1; } /* Make sure all parts of the item are present */ if (strlen(local) == 0) { (void)free(l); return 1; } if (strlen(host) == 0) { (void)free(l); return 1; } if (strlen(remote) == 0) { (void)free(l); return 1; } if (comma) { c++; } } if (comma) { (void)free(l); return 1; } (void)free(l); return 0; } torque-2.4.16/src/lib/Libcmds/parse_equal.c0000664000113300011330000001613111272401247015415 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include /* * parse_equal_string - parse a string of the form: * name1 = value1[, value2 ...][, name2 = value3 [, value4 ...]] * into * * * On the first call, * *name will point to "name1" * *value will point to "value1 ..." upto but not * including the comma before "name2". * On a second call, with start = (char *)0, * *name will point to "name2" * *value will point t0 "value3 ..." * Arguments: * start is the start of the string to parse. If called again with * start being a null pointer, it will resume parsing where it stoped * on the prior call. * * Returns: * integer function return = 1 if name and value are found, * 0 if nothing (more) is parsed (null input) * -1 if a syntax error was detected. * *name is set to point to the name string * *value is set to point to the value string * each string is null terminated. */ int parse_equal_string(start, name, value) char *start; char **name; char **value; { static char *pc; /* where prior call left off */ char *backup; int quoting = 0; if (start != (char *)0) pc = start; if (*pc == '\0') { *name = (char *)0; return (0); /* already at end, return no strings */ } /* strip leading spaces */ while (isspace((int)*pc) && *pc) pc++; if (*pc == '\0') { *name = (char *)0; /* null name */ return (0); } else if ((*pc == '=') || (*pc == ',')) return (-1); /* no name, return error */ *name = pc; /* have found start of name, look for end of it */ while (!isspace((int)*pc) && (*pc != '=') && *pc) pc++; /* now look for =, while stripping blanks between end of name and = */ while (isspace((int)*pc) && *pc) *pc++ = '\0'; if (*pc != '=') return (-1); /* should have found a = as first non blank */ *pc++ = '\0'; /* that follows is the value string, skip leading white space */ while (isspace((int)*pc) && *pc) pc++; /* is the value string to be quoted ? */ if ((*pc == '"') || (*pc == '\'')) quoting = (int) * pc++; *value = pc; /* * now go to first equal sign, or if quoted, the first equal sign * after the close quote */ if (quoting) { while ((*pc != (char)quoting) && *pc) /* look for matching */ pc++; if (*pc) *pc = ' '; /* change close quote to space */ else return (-1); } while ((*pc != '=') && *pc) pc++; if (*pc == '\0') { while (isspace((int)*--pc)); if (*pc == ',') /* trailing comma is a no no */ return (-1); pc++; return (1); /* no equal, just end of line, stop here */ } /* back up to the first comma found prior to the equal sign */ while (*--pc != ',') if (pc <= *value) /* gone back too far, no comma, error */ return (-1); backup = pc++; *backup = '\0'; /* null the comma */ /* strip off any trailing white space */ while (isspace((int)*--backup)) *backup = '\0'; return (1); } torque-2.4.16/src/lib/Libcmds/parse_destid.c0000664000113300011330000001335611272401247015570 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * * parse_destination_id * * full syntax permitted; * * queue_name[@server_name[:port_number]] * @server_name[:port_number] * */ #include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" #define ISNAMECHAR(x) ( (isgraph(x)) && ((x) != '#') && ( (x) != '@') ) #define MAXSERVERNAME PBS_MAXSERVERNAME+PBS_MAXPORTNUM+2 static char queue_name[PBS_MAXQUEUENAME+1]; static int q_pos; static char server_name[MAXSERVERNAME]; static int c_pos; int parse_destination_id( char *destination_in, /* I */ char **queue_name_out, /* O */ char **server_name_out) /* O */ { /* FORMAT: @: */ int i; char *c; /* initialize static data for this parsing call */ for (i = 0; i < PBS_MAXQUEUENAME + 1; i++) queue_name[i] = '\0'; q_pos = 0; for (i = 0; i < MAXSERVERNAME; i++) server_name[i] = '\0'; c_pos = 0; /* Begin the parse */ c = destination_in; while (isspace(*c)) c++; /* Looking for a queue */ while (*c != '\0') { if (ISNAMECHAR(*c)) { if (q_pos >= PBS_MAXQUEUENAME) return 1; queue_name[q_pos++] = *c; } else break; c++; } /* Looking for a server */ if (*c == '@') { c++; while (*c != '\0') { if (ISNAMECHAR(*c)) { if (c_pos >= MAXSERVERNAME) return 1; server_name[c_pos++] = *c; } else break; c++; } if (c_pos == 0) return 1; } if (*c != '\0') return 1; /* set char * pointers to static data, to arguments */ if (queue_name_out != NULL) *queue_name_out = queue_name; if (server_name_out != NULL) *server_name_out = server_name; return 0; } torque-2.4.16/src/lib/Libcmds/parse_depend.c0000664000113300011330000001672311310544011015542 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "pbs_ifl.h" #include "cmds.h" static char *deptypes[] = { "on", /* "on" and "synccount" must be first two */ "synccount", "after", "afterok", "afternotok", "afterany", "before", "beforeok", "beforenotok", "beforeany", "syncwith", (char *)0 }; /* * * parse_depend_item * * syntax: * * jobid[:jobid...] * * return 0 on okay, 1 if error, 2 if length will be too long * */ int parse_depend_item( char *depend_list, char *rtn_list, /* expanded jobids appended here */ int rtn_size /* size of above */ ) { char *at; int i = 0; int first = 1; char *s = NULL, *c; char full_job_id[PBS_MAXCLTJOBID+1]; char server_out[PBS_MAXSERVERNAME + PBS_MAXPORTNUM + 2]; /* Begin the parse */ c = depend_list; /* Loop on strings between colons */ while (*c != '\0') { s = c; while (((*c != ':') || (*(c - 1) == '\\')) && *c) c++; if (s == c) return 1; if (*c == ':') { *c++ = '\0'; } if (first) { first = 0; for (i = 0; deptypes[i]; ++i) { if (strcmp(s, deptypes[i]) == 0) break; } if (deptypes[i] == (char *)0) return 1; (void)strcat(rtn_list, deptypes[i]); } else { if (i < 2) /* for "on" and "synccount", number */ { (void)strcat(rtn_list, s); } else /* for others, job id */ { at = strchr(s, (int)'@'); if (get_server(s, full_job_id, server_out) != 0) return 1; /* check if we will exceed the length of the return string size */ if (strlen(rtn_list) + strlen(full_job_id) > (size_t)rtn_size) { return 2; } (void)strcat(rtn_list, full_job_id); if (at) { /* check if we will exceed the length of the return string size */ if (strlen(rtn_list) + strlen(server_out) + 1 > (size_t)rtn_size) { return 2; } (void)strcat(rtn_list, "@"); (void)strcat(rtn_list, server_out); } } } if (*c) (void)strcat(rtn_list, ":"); } if (s == c) return 1; return 0; } /* * * parse_depend_list * * syntax: * * depend_list[,depend_list...] * * Arguments: * * list List of colon delimited lists. * */ int parse_depend_list( char *list, char *rtn_list, /* expanded list returned here */ int rtn_size /* size of above array */ ) { char *b, *c, *s, *lc; int comma = 0; int rtn = 0; if (strlen(list) == 0) return (1); if ((lc = (char *)malloc(strlen(list) + 1)) == (char *)0) { fprintf(stderr, "Out of memory.\n"); exit(1); } strcpy(lc, list); c = lc; *rtn_list = '\0'; while (*c != '\0') { /* Drop leading white space */ while (isspace(*c)) c++; /* Find the next comma */ s = c; while (*c != ',' && *c) c++; /* Drop any trailing blanks */ comma = (*c == ','); *c = '\0'; b = c - 1; while (isspace((int)*b)) *b-- = '\0'; /* Parse the individual list item */ rtn = parse_depend_item(s, rtn_list, rtn_size); if (rtn) { return (rtn); } if (comma) { c++; (void)strcat(rtn_list, ","); } } free(lc); if (comma) return 1; return 0; } torque-2.4.16/src/lib/Libcmds/Makefile.am0000664000113300011330000000012411272401247014777 00000000000000include $(top_srcdir)/buildutils/config.mk # all compilation happens in lib/Libpbs torque-2.4.16/src/lib/Libcmds/cvtdate.c0000664000113300011330000001725411272401247014555 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * cvtdate - convert POSIX touch date/time to seconds since epoch time * * datestr is a date/time string in the form: [[[[CC]YY]MM]DD]hhmm[.SS] * as defined by POSIX. * CC = centry, ie 19 or 20 * YY = year, if CC is not provided and YY is < 69, then * CC is assumed to be 20, else 19. * MM = Month, [1,12], if YY is not provided and MM is less than * the current month, YY is next year, else it is the * current year. * DD = Day of month, [1,31], if MM is not provided and DD is less * than the current day, MM is next month, else it is the * next month. * hh = hour, [00, 23], if DD is not provided and hh is less than * the current hour, DD is tomorrow, else it is today. * mm = minute, [00, 59] * SS = seconds, [00, 59] * * Returns: time_t number of seconds since epoch (Coordinated Univ. Time) * -1 if error. */ #include /* the master config generated by configure */ #include #include #include #include time_t cvtdate(datestr) char *datestr; { char buf[3]; time_t clock; int i; struct tm *ptm; struct tm tmpPtm; char *pc; struct tm tm; int year = 0; int month = -1; int day = 0; if ((pc = strchr(datestr, (int)'.'))) { *pc++ = '\0'; if ((strlen(pc) != 2) || (isdigit((int)*pc) == 0) || (isdigit((int)*(pc + 1)) == 0)) return (-1); tm.tm_sec = atoi(pc); if (tm.tm_sec > 59) return (-1); } else tm.tm_sec = 0; for (pc = datestr; *pc; ++pc) if (isdigit((int)*pc) == 0) return (-1); buf[2] = '\0'; clock = time((time_t *)0); ptm = localtime_r(&clock,&tmpPtm); tm.tm_year = ptm->tm_year; /* default year to current */ tm.tm_mon = ptm->tm_mon; /* default month to current */ tm.tm_mday = ptm->tm_mday; /* default day to current */ switch (strlen(datestr)) { case 12: /* CCYYMMDDhhmm */ buf[0] = datestr[0]; buf[1] = datestr[1]; year = atoi(buf) * 100; datestr += 2; /* no break, fall into next case */ case 10: /* YYMMDDhhmm */ buf[0] = datestr[0]; buf[1] = datestr[1]; i = atoi(buf); if (year == 0) if (i > 68) year = 1900 + i; else year = 2000 + i; else year += i; tm.tm_year = year - 1900; datestr += 2; /* no break, fall into next case */ case 8: /* MMDDhhmm */ buf[0] = datestr[0]; buf[1] = datestr[1]; i = atoi(buf); if (i < 1 || i > 12) return (-1); if (year == 0) if (i <= ptm->tm_mon) tm.tm_year++; month = i - 1; tm.tm_mon = month; datestr += 2; /* no break, fall into next case */ case 6: /* DDhhmm */ buf[0] = datestr[0]; buf[1] = datestr[1]; day = atoi(buf); if (day < 1 || day > 31) return (-1); if (month == -1) if (day < ptm->tm_mday) tm.tm_mon++; tm.tm_mday = day; datestr += 2; /* no break, fall into next case */ case 4: /* hhmm */ buf[0] = datestr[0]; buf[1] = datestr[1]; tm.tm_hour = atoi(buf); if (tm.tm_hour > 23) return (-1); tm.tm_min = atoi(&datestr[2]); /* mm - minute portion */ if (tm.tm_min > 59) return (-1); if (day == 0) /* day not specified */ if ((tm.tm_hour < ptm->tm_hour) || ((tm.tm_hour == ptm->tm_hour) && (tm.tm_min <= ptm->tm_min))) tm.tm_mday++; /* time for tomorrow */ break; default: return (-1); } tm.tm_isdst = -1; return (mktime(&tm)); } torque-2.4.16/src/lib/Libutils/0000777000113300011330000000000011614035171013241 500000000000000torque-2.4.16/src/lib/Libutils/u_groups.c0000664000113300011330000000144711272401246015174 00000000000000#include "utils.h" /** * getgrnam_ext - first calls getgrnam, and if this call doesn't return * anything, then it checks if the name is actually a group id by calling getgrgid * * @param grp_name (I) - a string containing either the group's name or id * @return a pointer to the group, or NULL if the string represents neither * a valid group name nor a valid group id, or is NULL itself. **/ struct group * getgrnam_ext( char * grp_name ) /* I */ { struct group * grp; /* bad argument check */ if (grp_name == NULL) return NULL; grp = getgrnam( grp_name ); /* if the group wasn't found by name, check if the name */ /* was the group's id */ if (grp == NULL) { if (isdigit(grp_name[0])) grp = getgrgid(atoi(grp_name)); } return grp; } torque-2.4.16/src/lib/Libutils/u_mu.c0000664000113300011330000000715611272401246014301 00000000000000#include "utils.h" /** * similar to MUSNPrintF in moab */ int MUSNPrintF( char **BPtr, /* I */ int *BSpace, /* I */ char *Format, /* I */ ...) /* I */ { int len; va_list Args; if ((BPtr == NULL) || (BSpace == NULL) || (Format == NULL) || (*BSpace <= 0)) { return(FAILURE); } va_start(Args, Format); len = vsnprintf(*BPtr, *BSpace, Format, Args); va_end(Args); if (len <= 0) { return(FAILURE); } *BPtr += len; *BSpace -= len; return(SUCCESS); } /* END MUSNPrintF() */ char *MUStrTok( char *Line, /* I (optional) */ char *DList, /* I */ char **Ptr) /* O point to termination character of returned token */ { static char *Head = NULL; int dindex; mbool_t ignchar; /* NOTE: no handling if Line is NULL and Ptr is uninitialized */ if (Ptr == NULL) { /* tokPtr not specified */ return(NULL); } if (Line != NULL) { *Ptr = Line; if (Line[0] == '\0') { /* line is empty */ if (Ptr != NULL) *Ptr = NULL; return(NULL); } } else if (*Ptr == NULL) { return(NULL); } ignchar = FALSE; Head = NULL; while (**Ptr != '\0') { for (dindex = 0;DList[dindex] != '\0';dindex++) { if (**Ptr == DList[dindex]) { **Ptr = '\0'; (*Ptr)++; if (Head != NULL) { return(Head); } else { ignchar = TRUE; break; } } } /* END for (dindex) */ if ((ignchar != TRUE) && (**Ptr != '\0')) { if (Head == NULL) Head = *Ptr; (*Ptr)++; } ignchar = FALSE; } /* END while (**Ptr != '\0') */ return(Head); } /* END MUStrTok() */ /** * similar to MUStrNCat in moab */ int MUStrNCat( char **BPtr, /* I (modified) */ int *BSpace, /* I (modified) */ char *Src) /* I */ { int index; if ((BPtr == NULL) || (BSpace == NULL) || (*BSpace <= 0)) { return(FAILURE); } if ((Src == NULL) || (Src[0] == '\0')) { return(SUCCESS); } for (index = 0;index < *BSpace - 1;index++) { if (Src[index] == '\0') break; (*BPtr)[index] = Src[index]; } /* END for (index) */ (*BPtr)[index] = '\0'; *BPtr += index; *BSpace -= index; return(SUCCESS); } /* END MUStrNCat() */ /** * similar to MUSleep in moab */ int MUSleep( long SleepDuration) /* I (in us) */ { struct timeval timeout; timeout.tv_sec = SleepDuration / 1000000; timeout.tv_usec = SleepDuration % 1000000; select(0, (fd_set *)NULL, (fd_set *)NULL, (fd_set *)NULL, &timeout); return(0); } /* END MUSleep() */ /** * similar to MUReadPipe in moab */ int MUReadPipe( char *Command, /* I */ char *Buffer, /* O */ int BufSize) /* I */ { FILE *fp; int rc; int rcount; int ccount; if ((Command == NULL) || (Buffer == NULL)) { return(1); } if ((fp = popen(Command, "r")) == NULL) { return(1); } ccount = 0; rcount = 0; do { rc = fread(Buffer + ccount, 1, BufSize - ccount, fp); /* NOTE: ferror may create false failures */ if (rc > 0) { ccount += rc; } if ((ccount >= BufSize) || (rcount++ > 10)) { /* full buffer loaded or too many attempts */ break; } } while (!feof(fp)); if (ferror(fp)) { /* FAILURE */ pclose(fp); return(1); } /* SUCCESS - terminate buffer */ Buffer[MIN(BufSize - 1,ccount)] = '\0'; pclose(fp); return(0); } /* END MUReadPipe() */ torque-2.4.16/src/lib/Libutils/Makefile.in0000664000113300011330000004375211605403740015240 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libutils_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libutils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libutils_a_AR = $(AR) $(ARFLAGS) libutils_a_LIBADD = am_libutils_a_OBJECTS = u_groups.$(OBJEXT) u_tree.$(OBJEXT) \ u_mu.$(OBJEXT) u_MXML.$(OBJEXT) libutils_a_OBJECTS = $(am_libutils_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libutils_a_SOURCES) DIST_SOURCES = $(libutils_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libutils.a libutils_a_SOURCES = u_groups.c u_tree.c u_mu.c u_MXML.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libutils/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libutils/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libutils.a: $(libutils_a_OBJECTS) $(libutils_a_DEPENDENCIES) -rm -f libutils.a $(libutils_a_AR) libutils.a $(libutils_a_OBJECTS) $(libutils_a_LIBADD) $(RANLIB) libutils.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u_MXML.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u_groups.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u_mu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u_tree.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libutils/u_MXML.c0000664000113300011330000006152511272401246014435 00000000000000/* HEADER */ /* * * Contains: * * * * */ #include "utils.h" #include #include #include #include int MXMLExtractE( mxml_t *E, /* I */ mxml_t *C, /* I */ mxml_t **CP) /* O (optional) */ { int cindex; if ((E == NULL) || (C == NULL)) { return(FAILURE); } for (cindex = 0;cindex < E->CCount;cindex++) { if (C != E->C[cindex]) { if (MXMLExtractE(E->C[cindex], C, CP) == SUCCESS) { return(SUCCESS); } continue; } if (CP != NULL) *CP = E->C[cindex]; E->C[cindex] = NULL; return(SUCCESS); } /* END for (cindex) */ return(FAILURE); } /* MXMLExtractE() */ int MXMLSetChild( mxml_t *E, /* I */ char *CName, /* I */ mxml_t **CE) /* O */ { if (CE != NULL) *CE = NULL; if ((E == NULL) || (CName == NULL)) { return(FAILURE); } if (MXMLGetChild(E, CName, NULL, CE) == SUCCESS) { /* located existing child */ return(SUCCESS); } /* create new child */ if ((*CE = (mxml_t *)calloc(1, sizeof(mxml_t))) == NULL) { return(FAILURE); } MXMLAddE(E, *CE); if (CName != NULL) { (*CE)->Name = strdup(CName); if ((*CE)->Name == NULL) { return(FAILURE); } } return(SUCCESS); } /* END MXMLSetChild() */ int MXMLCreateE( mxml_t **E, /* O */ char *Name) /* I (optional) */ { /* NOTE: should 'Name' be mandatory? */ if (E == NULL) { return(FAILURE); } if ((*E = (mxml_t *)calloc(1,sizeof(mxml_t))) == NULL) { return(FAILURE); } if ((Name != NULL) && (Name[0] != '\0')) { (*E)->Name = strdup(Name); if ((*E)->Name == NULL) { return(FAILURE); } } return(SUCCESS); } /* END MXMLCreateE() */ int MXMLDestroyE( mxml_t **EP) /* I (modified) */ { int index; mxml_t *E; if (EP == NULL) { return(FAILURE); } E = *EP; if (E == NULL) { return(SUCCESS); } if (E->C != NULL) { /* destroy children */ for (index = 0;index < E->CCount;index++) { if (E->C[index] == NULL) continue; MXMLDestroyE(&E->C[index]); } /* END for (index) */ free(E->C); } /* END if (E->C != NULL) */ /* free attributes */ if (E->AName != NULL) { for (index = 0;index < E->ACount;index++) { if (E->AName[index] == NULL) break; free(E->AName[index]); if ((E->AVal != NULL) && (E->AVal[index] != NULL)) free(E->AVal[index]); } /* END for (index) */ if (E->AVal != NULL) { free(E->AVal); } if (E->AName != NULL) { free(E->AName); } } /* END if (E->AName != NULL) */ /* free name */ if (E->Name != NULL) free(E->Name); if (E->Val != NULL) free(E->Val); free(E); *EP = NULL; return(SUCCESS); } /* END MXMLDestroyE() */ int MXMLSetAttr( mxml_t *E, /* I (modified) */ char *A, /* I */ void *V, /* I */ enum MDataFormatEnum Format) /* I */ { int aindex; int iindex; int rc; char tmpLine[MMAX_LINE]; char *ptr; /* NOTE: overwrite existing attr if found */ if ((E == NULL) || (A == NULL) || (V == NULL)) { return(FAILURE); } switch (Format) { case mdfString: default: ptr = (char *)V; break; case mdfInt: sprintf(tmpLine, "%d", *(int *)V); ptr = tmpLine; break; case mdfLong: sprintf(tmpLine, "%ld", *(long *)V); ptr = tmpLine; break; case mdfDouble: sprintf(tmpLine, "%f", *(double *)V); ptr = tmpLine; break; } /* END switch (Format) */ /* initialize attribute table */ if (E->AName == NULL) { if ((E->AName = (char **)calloc(1, sizeof(char *) * MMAX_XMLATTR)) == NULL) { fprintf(stderr,"ERROR: calloc() failed!\n"); return(FAILURE); } if ((E->AVal = (char **)calloc(1, sizeof(char *) * MMAX_XMLATTR)) == NULL) { fprintf(stderr,"ERROR: calloc() failed!\n"); return(FAILURE); } E->ASize = MMAX_XMLATTR; E->ACount = 0; } /* END if (E->AName == NULL) */ /* insert in alphabetical order */ /* overwrite existing attribute if found */ iindex = 0; rc = 0; for (aindex = 0;aindex < E->ACount;aindex++) { rc = strcmp(E->AName[aindex],A); if (rc > 0) break; if (rc == 0) { iindex = aindex; break; } iindex = aindex + 1; } /* END for (aindex) */ if (aindex >= E->ACount) { iindex = aindex; if (aindex >= E->ASize) { char **tmpAName; char **tmpAVal; /* allocate memory */ tmpAName = (char **)realloc(E->AName,sizeof(char *) * MAX(16,E->ASize << 1)); if (tmpAName == NULL) { /* FAILURE - cannot allocate memory */ return(FAILURE); } E->AName = tmpAName; tmpAVal = (char **)realloc(E->AVal,sizeof(char *) * MAX(16,E->ASize << 1)); if (tmpAVal == NULL) { /* FAILURE - cannot allocate memory */ return(FAILURE); } E->AVal = tmpAVal; E->ASize <<= 1; } /* END if (aindex >= E->ASize) */ } /* END if (aindex >= E->ACount) */ if ((ptr == NULL) && (aindex >= E->ACount)) { /* no action required for empty attribute */ return(SUCCESS); } /* prepare insertion point */ if (rc != 0) { for (aindex = E->ACount - 1;aindex >= iindex;aindex--) { E->AVal[aindex + 1] = E->AVal[aindex]; E->AName[aindex + 1] = E->AName[aindex]; } /* END for (aindex) */ E->AVal[aindex + 1] = NULL; E->AName[aindex + 1] = NULL; } /* END if (rc != 0) */ if (E->AVal[iindex] != NULL) free(E->AVal[iindex]); E->AVal[iindex] = strdup((ptr != NULL) ? ptr : ""); if (E->AVal[iindex] == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } if ((rc != 0) || (E->AName[iindex] == NULL)) { E->AName[iindex] = strdup(A); if (E->AName[iindex] == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } E->ACount++; } return(SUCCESS); } /* END MXMLSetAttr() */ int MXMLAppendAttr( mxml_t *E, /* I root element */ char *AName, /* I */ char *AVal, /* I */ char Delim) /* I */ { int ATok; int len; char VBuf[MMAX_LINE]; if ((E == NULL) || (AName == NULL) || (AVal == NULL)) { return(FAILURE); } ATok = -1; if (MXMLGetAttr(E,AName,&ATok,VBuf,sizeof(VBuf)) == SUCCESS) { char DString[2]; char *tmpAVal; len = strlen(E->AVal[ATok]) + strlen(AVal) + 2; tmpAVal = realloc( E->AVal[ATok], len); if (tmpAVal == NULL) { return(FAILURE); } E->AVal[ATok] = tmpAVal; DString[0] = Delim; DString[1] = '\0'; /* just allocated adequate space, should not be able to overflow */ strcat(E->AVal[ATok], DString); strcat(E->AVal[ATok], AVal); } else if (MXMLSetAttr(E, AName, AVal, mdfString) == FAILURE) { return(FAILURE); } return(SUCCESS); } /* END MXMLAppendAttr() */ int MXMLSetVal( mxml_t *E, /* I (modified) */ void *V, /* I */ enum MDataFormatEnum Format) /* I */ { char tmpLine[MMAX_LINE]; char *ptr; if ((E == NULL) || (V == NULL)) { return(FAILURE); } if (E->Val != NULL) { free(E->Val); E->Val = NULL; } switch (Format) { case mdfString: default: ptr = (char *)V; break; case mdfInt: sprintf(tmpLine, "%d", *(int *)V); ptr = tmpLine; break; case mdfLong: sprintf(tmpLine, "%ld", *(long *)V); ptr = tmpLine; break; case mdfDouble: sprintf(tmpLine, "%f", *(double *)V); ptr = tmpLine; break; } /* END switch(Format) */ E->Val = strdup(ptr); /* strip '<' symbols NOTE: ignore '<' symbol in attrs */ /* NOTE: must replace temp hack 14 w/ < */ for (ptr = strchr(E->Val, '<');ptr != NULL;ptr = strchr(ptr, '<')) * ptr = (char)14; return(SUCCESS); } /* END MXMLSetVal() */ int MXMLAddE( mxml_t *E, /* I (modified) */ mxml_t *C) /* I (required) */ { if ((E == NULL) || (C == NULL)) { return(FAILURE); } if (E->CCount >= E->CSize) { if (E->C == NULL) { E->C = (mxml_t **)calloc(1, sizeof(mxml_t *) * MDEF_XMLICCOUNT); E->CSize = MDEF_XMLICCOUNT; } else { mxml_t **tmpC; tmpC = (mxml_t **)realloc(E->C,sizeof(mxml_t *) * MAX(16,E->CSize << 1)); if (tmpC == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } E->C = tmpC; E->CSize <<= 1; } if (E->C == NULL) { /* FAILURE - cannot alloc memory */ return(FAILURE); } /* END if (E->C == NULL) */ } /* END if (E->CCount >= E->CSize) */ E->C[E->CCount] = C; E->CCount++; return(SUCCESS); } /* END MXMLAddE() */ /** * NOTE: Buf may be allocated on FAILURE */ int MXMLToXString( mxml_t *E, /* I */ char **Buf, /* O (alloc/populated/modified) */ int *BufSize, /* I/O */ int MaxBufSize, /* I */ char **Tail, /* O */ mbool_t IsRootElement) /* I */ { int NewSize; /* NOTE: MXMLToString() only fails due to lack of space */ if ((E == NULL) || (Buf == NULL)) { return(FAILURE); } /* allocate initial memory if required */ if (*Buf == NULL) { NewSize = MMAX_BUFFER; if ((*Buf = (char *)malloc(NewSize)) == NULL) { /* cannot allocate buffer */ return(FAILURE); } if (BufSize != NULL) *BufSize = MMAX_BUFFER; } else { if (BufSize == NULL) { return(FAILURE); } NewSize = *BufSize; } while (MXMLToString( E, *Buf, NewSize, Tail, IsRootElement) == FAILURE) { char *tmpBuf; if (NewSize >= MaxBufSize) { return(FAILURE); } NewSize = MIN(NewSize << 1, MaxBufSize); tmpBuf = (char *)realloc(*Buf,NewSize); if (tmpBuf == NULL) { /* cannot allocate buffer */ return(FAILURE); } *Buf = tmpBuf; if (BufSize != NULL) *BufSize = NewSize; } /* END while (MXMLToString() == FAILURE) */ return(SUCCESS); } /* END MXMLToXString() */ int MXMLToString( mxml_t *E, /* I */ char *Buf, /* O */ int BufSize, /* I */ char **Tail, /* O */ mbool_t IsRootElement) /* I */ { int index; int BSpace; char *BPtr; char *tail; int len; if (Buf != NULL) { Buf[0] = '\0'; } if ((E == NULL) || (Buf == NULL)) { return(FAILURE); } if (BufSize < MMAX_NAME) { return(FAILURE); } BPtr = Buf; BSpace = BufSize; /* display header */ BPtr[0] = '<'; BPtr++; BSpace--; if (E->Name != NULL) { len = strlen(E->Name); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->Name); BSpace -= len; BPtr += len; } else { strcpy(BPtr, "NA"); len = strlen("NA"); BPtr += len; BSpace -= len; } /* display attributes */ for (index = 0;index < E->ACount;index++) { /* FORMAT: ="" */ BPtr[0] = ' '; BPtr++; BSpace--; len = strlen(E->AName[index]); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->AName[index]); BSpace -= len; BPtr += len; BPtr[0] = '='; BPtr++; BSpace--; BPtr[0] = '"'; BPtr++; BSpace--; len = strlen(E->AVal[index]); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->AVal[index]); BSpace -= len; BPtr += len; BPtr[0] = '"'; BPtr++; BSpace--; } /* END for (index) */ BPtr[0] = '>'; BPtr++; BSpace--; if (E->Val != NULL) { len = strlen(E->Val); if (len >= BSpace) { /* insufficient space */ return(FAILURE); } strcpy(BPtr, E->Val); BSpace -= len; BPtr += len; } /* display children */ for (index = 0;index < E->CCount;index++) { if (E->C[index] == NULL) continue; if (MXMLToString(E->C[index], BPtr, BSpace, &tail, FALSE) == FAILURE) { return(FAILURE); } len = strlen(BPtr); BSpace -= len; BPtr += len; } /* END for (index) */ /* display footer */ if (E->Name != NULL) { len = strlen(E->Name); } else { len = strlen("NA"); } if (BSpace < len + 4) { return(FAILURE); } BPtr[0] = '<'; BPtr++; BSpace--; BPtr[0] = '/'; BPtr++; BSpace--; if (E->Name != NULL) { strcpy(BPtr, E->Name); } else { strcpy(BPtr, "NA"); } BSpace -= len; BPtr += len; BPtr[0] = '>'; BPtr++; BSpace--; /* terminate string */ BPtr[0] = '\0'; if (Tail != NULL) *Tail = BPtr; return(SUCCESS); } /* END MXMLToString() */ int MXMLGetAttrF( mxml_t *E, /* I */ char *AName, /* I/O */ int *ATok, /* I (optional) */ void *AVal, /* O */ enum MDataFormatEnum DFormat, /* I */ int VSize) /* I */ { char tmpLine[MMAX_LINE]; int rc; if (AVal == NULL) { return(FAILURE); } switch (DFormat) { case mdfString: rc = MXMLGetAttr( E, AName, ATok, (char *)AVal, VSize); return(rc); /* NOTREACHED*/ break; case mdfInt: case mdfLong: case mdfDouble: if (MXMLGetAttr( E, AName, ATok, tmpLine, sizeof(tmpLine)) == FAILURE) { /* clear response */ switch (DFormat) { case mdfInt: *(int *)AVal = 0; break; case mdfLong: *(long *)AVal = 0; break; case mdfDouble: *(double *)AVal = 0.0; break; default: break; } /* END switch(DFormat) */ return(FAILURE); } break; default: return(FAILURE); /*NOTREACHED*/ break; } /* END switch(DFormat) */ switch (DFormat) { case mdfInt: *(int *)AVal = (int)strtol(tmpLine, NULL, 10); break; case mdfLong: *(long *)AVal = strtol(tmpLine, NULL, 10); break; case mdfDouble: *(double *)AVal = strtod(tmpLine, NULL); break; default: *(char **)AVal = NULL; return(FAILURE); /*NOTREACHED*/ break; } /* END switch (DFormat) */ return(SUCCESS); } /* END MXMLGetAttrF() */ int MXMLGetAttr( mxml_t *E, /* I */ char *AName, /* I/O */ int *ATok, /* I (optional) */ char *AVal, /* O (optional) */ int VSize) /* I */ { /* NOTE: set AName to empty string to get Name */ int aindex; int astart; int EVSize; if (AVal != NULL) AVal[0] = '\0'; if (E == NULL) { return(FAILURE); } EVSize = (VSize > 0) ? VSize : MMAX_LINE; if (ATok != NULL) astart = *ATok; else astart = -1; for (aindex = astart + 1;aindex < E->ACount;aindex++) { if ((AName == NULL) || (AName[0] == '\0') || !strcmp(AName, E->AName[aindex])) { if ((AName != NULL) && (AName[0] == '\0')) { strncpy(AName, E->AName[aindex], MMAX_NAME); AName[MMAX_NAME - 1] = '\0'; } if (AVal != NULL) { strncpy(AVal, E->AVal[aindex], EVSize); AVal[EVSize - 1] = '\0'; } if (ATok != NULL) *ATok = aindex; return(SUCCESS); } } /* END for (aindex) */ return(FAILURE); } /* END MXMLGetAttr() */ int MXMLGetChild( mxml_t *E, /* I */ char *CName, /* I (optional) */ int *CTok, /* I (optional) */ mxml_t **C) /* O */ { int cindex; int cstart; if (C != NULL) *C = NULL; if ((E == NULL) || (C == NULL)) { return(FAILURE); } if (CTok != NULL) cstart = *CTok; else cstart = -1; for (cindex = cstart + 1;cindex < E->CCount;cindex++) { if (E->C[cindex] == NULL) continue; if ((CName == NULL) || !strcmp(CName, E->C[cindex]->Name)) { *C = E->C[cindex]; if (CTok != NULL) *CTok = cindex; return(SUCCESS); } } /* END for (cindex) */ return(FAILURE); } /* END MXMLGetChild() */ int MXMLGetChildCI( mxml_t *E, /* I */ char *CName, /* I (optional) */ int *CTok, /* I (optional) */ mxml_t **CP) /* O (optional) */ { int cindex; int cstart; int SLen; if (CP != NULL) *CP = NULL; #ifndef __MOPT if (E == NULL) { return(FAILURE); } #endif /* __MOPT */ if (CTok != NULL) cstart = *CTok; else cstart = -1; if (CName != NULL) SLen = strlen(CName) + 1; else SLen = 0; for (cindex = cstart + 1;cindex < E->CCount;cindex++) { if (E->C[cindex] == NULL) continue; if ((CName == NULL) || !strncasecmp(CName, E->C[cindex]->Name, SLen)) { if (CP != NULL) *CP = E->C[cindex]; if (CTok != NULL) *CTok = cindex; return(SUCCESS); } } /* END for (cindex) */ return(FAILURE); } /* END MXMLGetChildCI() */ #define MMAX_XBUFFER 131072 int MXMLFromString( mxml_t **EP, /* O (populate or create) */ char *XMLString, /* I */ char **Tail, /* O (optional) */ char *EMsg) /* O (optional) */ { mxml_t *E; char *ptr; char *tail; int index; mbool_t ElementIsClosed = FALSE; mbool_t DoAppend = FALSE; char tmpNLine[MMAX_LINE + 1]; char tmpVLine[MMAX_XBUFFER + 1]; if (EP != NULL) *EP = NULL; if (EMsg != NULL) EMsg[0] = '\0'; if ((XMLString == NULL) || (EP == NULL)) { if (EMsg != NULL) strcpy(EMsg, "invalid arguments"); return(FAILURE); } if ((ptr = strchr(XMLString, '<')) == NULL) { if (EMsg != NULL) strcpy(EMsg, "no XML in string"); return(FAILURE); } if (ptr[1] == '/') { /* located tail marker */ if (EMsg != NULL) strcpy(EMsg, "premature termination marker"); return(FAILURE); } /* NOTE: should support append/overlay parameter (NYI) */ /* ignore 'meta' elements */ while ((ptr[1] == '?') || (ptr[1] == '!')) { ptr++; /* ignore 'meta' elements */ if (*ptr == '?') { ptr++; if ((ptr = strstr(ptr, "?>")) == NULL) { /* cannot locate end of meta element */ return(FAILURE); } if ((ptr = strchr(ptr, '<')) == NULL) { /* cannot locate next element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate post-meta XML"); return(FAILURE); } } /* END if (*ptr == '?') */ /* ignore 'comment' element */ if (!strncmp(ptr, "!--", 3)) { ptr += 3; if ((ptr = strstr(ptr, "-->")) == NULL) { /* cannot locate end of comment element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate comment termination marker"); return(FAILURE); } if ((ptr = strchr(ptr, '<')) == NULL) { /* cannot locate next element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate post-comment XML"); return(FAILURE); } } /* END if (!strncmp(ptr,"!--",3)) */ } /* END while ((ptr[1] == '?') || (ptr[1] == '!')) */ /* remove whitespace */ while (isspace(*ptr)) ptr++; /* extract root element */ if (*ptr != '<') { /* cannot located start of element */ if (EMsg != NULL) strcpy(EMsg, "cannot locate start of root element"); return(FAILURE); } ptr++; /* ignore '<' */ index = 0; while ((*ptr != ' ') && (*ptr != '>')) { if ((ptr[0] == '/') && (ptr[1] == '>')) { ElementIsClosed = TRUE; break; } tmpNLine[index++] = *(ptr++); if ((index >= MMAX_LINE) || (ptr[0] == '\0')) { if (EMsg != NULL) sprintf(EMsg, "element name is too long - %.10s", tmpNLine); return(FAILURE); } } tmpNLine[index] = '\0'; if ((*EP == NULL) && (MXMLCreateE(EP, tmpNLine) == FAILURE)) { if (EMsg != NULL) sprintf(EMsg, "cannot create XML element '%s'", tmpNLine); return(FAILURE); } E = *EP; if ((E->ACount > 0) || (E->CCount > 0)) { DoAppend = TRUE; } if (ElementIsClosed == TRUE) { ptr += 2; /* skip '/>' */ if (Tail != NULL) *Tail = ptr; return(SUCCESS); } while (*ptr == ' ') ptr++; while (*ptr != '>') { /* extract attributes */ /* FORMAT: ="" */ index = 0; while ((*ptr != '=') && (*ptr != '\0')) { tmpNLine[index++] = *(ptr++); if (index >= MMAX_LINE) break; } tmpNLine[index] = '\0'; if (*ptr != '\0') ptr++; /* skip '=' */ if (*ptr != '\0') ptr++; /* skip '"' */ if (*ptr == '\0') { if (EMsg != NULL) sprintf(EMsg, "string is corrupt - early termination"); return(FAILURE); } index = 0; while ((*ptr != '"') || ((ptr > XMLString) && (*(ptr - 1) == '\\'))) { tmpVLine[index++] = *(ptr++); if ((index >= MMAX_XBUFFER) || (*ptr == '\0')) { MXMLDestroyE(EP); /* locate tail */ if (Tail != NULL) *Tail = ptr + strlen(ptr); if (EMsg != NULL) { sprintf(EMsg, "attribute name is too long - %.10s", tmpVLine); } return(FAILURE); } } tmpVLine[index] = '\0'; MXMLSetAttr(E,tmpNLine,(void *)tmpVLine,mdfString); ptr++; /* ignore '"' */ while (*ptr == ' ') ptr++; if ((ptr[0] == '/') && (ptr[1] == '>')) { /* element terminator reached */ ptr += 2; /* skip '/>' */ if (Tail != NULL) *Tail = ptr; return(SUCCESS); } } /* END while (*ptr != '>') */ ptr++; /* ignore '>' */ /* skip whitespace */ while (isspace(*ptr)) ptr++; /* extract value */ if (*ptr != '<') { char *ptr2; index = 0; while (*ptr != '<') { tmpVLine[index++] = *(ptr++); if (index >= MMAX_XBUFFER) break; } tmpVLine[index] = '\0'; E->Val = strdup(tmpVLine); if (E->Val == NULL) { if (EMsg != NULL) { sprintf(EMsg,"cannot alloc memory for value - %.10s", tmpVLine); } return(FAILURE); } /* restore '<' symbols */ for (ptr2 = strchr(E->Val,(char)14);ptr2 != NULL;ptr2 = strchr(ptr2,(char)14)) *ptr2 = '<'; } /* END if (*ptr != '<') */ /* extract children */ while (ptr[1] != '/') { mxml_t *C; C = NULL; if (DoAppend == TRUE) { char *ptr2; char tmpCName[MMAX_NAME]; int index; /* FORMAT: ... */ /* locate name */ ptr2 = ptr + 1; /* ignore '<' */ index = 0; while ((*ptr2 != ' ') && (*ptr2 != '>')) { if ((ptr2[0] == '/') && (ptr2[1] == '>')) { break; } tmpCName[index++] = *(ptr2++); if ((index >= MMAX_LINE) || (ptr2[0] == '\0')) { if (EMsg != NULL) { sprintf(EMsg,"element name is too long - %.10s", tmpCName); } return(FAILURE); } } tmpCName[index] = '\0'; MXMLGetChild(E, tmpCName, NULL, &C); } if ((MXMLFromString(&C, ptr, &tail, EMsg) == FAILURE) || (MXMLAddE(E, C) == FAILURE)) { break; } ptr = tail; if ((ptr == NULL) || (ptr[0] == '\0')) { /* XML is corrupt */ if (Tail != NULL) *Tail = ptr; if ((EMsg != NULL) && (EMsg[0] == '\0')) strcpy(EMsg, "cannot extract child"); return(FAILURE); } } /* END while (ptr[1] != '/') */ /* ignore whitespace */ while (isspace(*ptr)) ptr++; /* process tail */ if (*ptr == '/') { /* process '/>' */ ptr++; /* ignore '/' */ } else { ptr++; /* ignore '<' */ ptr++; /* ignore '/' */ ptr += strlen(E->Name); } ptr++; /* ignore '>' */ if (Tail != NULL) *Tail = ptr; return(SUCCESS); } /* END MXMLFromString() */ /* END MXML.c */ torque-2.4.16/src/lib/Libutils/u_tree.c0000664000113300011330000001357311272401246014617 00000000000000#include "utils.h" extern int LOGLEVEL; /** * inserts the key into the tree if it isn't there already * @param key - the key we are inserting (input) * @param nodep - what the new node's nodep should be (optional input) * @param rootp - the address of the tree's root * NOTE: tinsert cannot report failure */ void tinsert( const u_long key, /* I */ struct pbsnode *nodep, /* I (optional) */ tree **rootp) /* I */ { register tree *q; if (rootp == NULL) { /* invalid tree address - failure */ return; } while (*rootp != NULL) { /* Knuth's T1: */ if (key == (*rootp)->key) /* T2: */ { /* key already exists */ return; /* we found it! */ } rootp = (key < (*rootp)->key) ? &(*rootp)->left : /* T3: follow left branch */ &(*rootp)->right; /* T4: follow right branch */ } /* create new tree node */ q = (tree *)malloc(sizeof(tree)); /* T5: key not found */ if (q == NULL) { /* cannot allocate memory - failure */ return; } /* make new tree */ /* link new node to old */ *rootp = q; /* initialize new tree node */ q->key = key; q->left = NULL; q->right = NULL; /* if nodep is null then this doesn't do anything */ q->nodep = nodep; /* success */ return; } /* END tinsert() */ /** * delete the node with the given key * @param key - the key of the node to be deleted * @param rootp - the address of the root of the tree */ void *tdelete( const u_long key, /* I */ tree **rootp) /* I */ { tree *p; register tree *q; register tree *r; if (LOGLEVEL >= 6) { sprintf(log_buffer, "deleting key %lu", key); log_record( PBSEVENT_SCHED, PBS_EVENTCLASS_REQUEST, "tdelete", log_buffer); } if ((rootp == NULL) || ((p = *rootp) == NULL)) { return(NULL); } while (key != (*rootp)->key) { p = *rootp; rootp = (key < (*rootp)->key) ? &(*rootp)->left : /* left branch */ &(*rootp)->right; /* right branch */ if (*rootp == NULL) { return(NULL); /* key not found */ } } r = (*rootp)->right; /* D1: */ if ((q = (*rootp)->left) == NULL) /* Left */ { q = r; } else if (r != NULL) { /* Right is null? */ if (r->left == NULL) { /* D2: Find successor */ r->left = q; q = r; } else { /* D3: Find (struct tree_t *)0 link */ for (q = r->left;q->left != NULL;q = r->left) { r = q; } r->left = q->right; q->left = (*rootp)->left; q->right = (*rootp)->right; } } free((struct tree_t *)*rootp); /* D4: Free node */ *rootp = q; /* link parent to new node */ return(p); } /* END tdelete() */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like * the AT&T man page says. * * The tree_t structure is for internal use only, lint doesn't grok it. * * Written by reading the System V Interface Definition, not the code. * * Totally public domain. */ /*LINTLIBRARY*/ /** * finds a pointer to the specified node in the tree * @param key - the key of the node to find * @param rootp - the address of the tree's root * @return a pointer to the node with the specified key or NULL if not found * * NOTE: on the mom nodep is never used, but it expects a non-NULL value or * else it thinks the key wasn't found * WARNING: this means that pointer can't be used on the mom and that you * should always use */ struct pbsnode *tfind( const u_long key, /* I */ tree **rootp) /* I / O */ { if (rootp == NULL) { return(NULL); } while (*rootp != NULL) { /* Knuth's T1: */ if (key == (*rootp)->key) /* T2: */ { /* found */ /* this if logic prevents mom errors, see above note */ if ((*rootp)->nodep != NULL) return((*rootp)->nodep); else return((struct pbsnode *)1); } rootp = (key < (*rootp)->key) ? &(*rootp)->left : /* T3: follow left branch */ &(*rootp)->right; /* T4: follow right branch */ } return(NULL); } /* END tfind() */ /** * lists all of the keys in the tree * NOTE: recursive. Buf not initialized * @param rootp - the root node of the tree * @param Buf - the output buffer * @param BufSize - the size of the output buffer * @return 1 if rootp or Buf are NULL, -1 if the buffer is too small, -1 otherwise */ int tlist( tree *rootp, /* I */ char *Buf, /* O (modified) */ int BufSize) /* I */ { char tmpLine[32]; int BSize; /* check for bad inputs */ if ((rootp == NULL) || (Buf == NULL)) { /* empty tree - failure */ return(1); } if (BufSize <= 16) { /* inadequate space to append data */ return(-1); } BSize = BufSize; if (rootp->left != NULL) { tlist(rootp->left, Buf, BSize); BSize -= strlen(Buf); } if (rootp->right != NULL) { tlist(rootp->right, Buf, BSize); BSize -= strlen(Buf); } if (BSize <= 16) { /* inadequate space to append data */ return(-1); } sprintf(tmpLine, "%ld.%ld.%ld.%ld", (rootp->key & 0xff000000) >> 24, (rootp->key & 0x00ff0000) >> 16, (rootp->key & 0x0000ff00) >> 8, (rootp->key & 0x000000ff)); if ((Buf[0] != '\0') && (BSize > 1)) { strcat(Buf, ","); BSize--; } if (BSize > (int)strlen(tmpLine)) { strcat(Buf, tmpLine); } return(-1); } /* END tlist() */ /** * frees the tree from memory * @param rootp - the address of the root of the tree */ void tfree( tree **rootp) /* I */ { if (rootp == NULL || *rootp == NULL) { return; } tfree(&(*rootp)->left); tfree(&(*rootp)->right); free(*rootp); *rootp = NULL; return; } torque-2.4.16/src/lib/Libutils/Makefile.am0000664000113300011330000000020711272401246015212 00000000000000 include $(top_srcdir)/buildutils/config.mk noinst_LIBRARIES = libutils.a libutils_a_SOURCES = u_groups.c u_tree.c u_mu.c u_MXML.c torque-2.4.16/src/lib/Libattr/0000777000113300011330000000000011614035165013056 500000000000000torque-2.4.16/src/lib/Libattr/attr_fn_time.c0000664000113300011330000002123211442504365015615 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type * time: [[hh:]mm:]ss[.sss] * * Each set has functions for: * Decoding the value string to the machine representation. * Encoding the internal attribute to external form * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * -------------------------------------------------- * The Set of Attribute Functions for attributes with * value type "long" * -------------------------------------------------- */ /* * decode_time - decode time into into attribute structure of type ATR_TYPE_LONG * * Returns: 0 if ok * >0 error number if error * *patr elements set */ #define PBS_MAX_TIME (LONG_MAX - 1) int decode_time( struct attribute *patr, /* I/O (modified) */ char *name, /* I - attribute name (not used) */ char *rescn, /* I - resource name (not used) */ char *val) /* I - attribute value */ { int i; char msec[4]; int ncolon = 0; int use_days = 0; int days = 0; char *pc; long rv = 0; char *workval; char *workvalsv; if ((val == NULL) || (strlen(val) == 0)) { patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; patr->at_val.at_long = 0; /* SUCCESS */ return(0); } /* FORMAT: [DD]:HH:MM:SS[.MS] */ workval = strdup(val); workvalsv = workval; if (workvalsv == NULL) { /* FAILURE - cannot alloc memory */ goto badval; } for (i = 0;i < 3;++i) msec[i] = '0'; msec[i] = '\0'; for (pc = workval;*pc;++pc) { if (*pc == ':') { if (++ncolon > 3) goto badval; /* are days specified? */ if (ncolon > 2) use_days = 1; } } for (pc = workval;*pc;++pc) { if (*pc == ':') { *pc = '\0'; if (use_days) { days = atoi(workval); use_days = 0; } else { rv = (rv * 60) + atoi(workval); } workval = pc + 1; } else if (*pc == '.') { *pc++ = '\0'; for (i = 0; (i < 3) && *pc; ++i) msec[i] = *pc++; break; } else if (!isdigit((int)*pc)) { goto badval; /* bad value */ } } rv = (rv * 60) + atoi(workval); if (days > 0) rv = rv + (days * 24 * 3600); if (rv > PBS_MAX_TIME) goto badval; if (atoi(msec) >= 500) rv++; patr->at_val.at_long = rv; patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; free(workvalsv); /* SUCCESS */ return(0); badval: free(workvalsv); return(PBSE_BADATVAL); } /* END decode_time() */ /* * encode_time - encode attribute of type long into attr_extern * with value in form of [[hh:]mm:]ss * * Returns: >0 if ok * =0 if no value, no attrlist link added * <0 if error */ /*ARGSUSED*/ /* NOTE: if phead not specified, report output via atname (minsize=1024) */ #define CVNBUFSZ 21 int encode_time( attribute *attr, /* ptr to attribute (value in attr->at_val.at_long) */ tlist_head *phead, /* head of attrlist list (optional) */ char *atname, /* attribute name */ char *rsname, /* resource name (optional) */ int mode) /* encode mode (not used) */ { size_t ct; char cvnbuf[CVNBUFSZ]; int hr; int min; long n; svrattrl *pal; int sec; char *pv; if (attr == NULL) { /* FAILURE */ return(-1); } if (!(attr->at_flags & ATR_VFLAG_SET)) { return(0); } n = attr->at_val.at_long; hr = n / 3600; n = n % 3600; min = n / 60; n = n % 60; sec = n; pv = cvnbuf; sprintf(pv, "%02d:%02d:%02d", hr, min, sec); pv += strlen(pv); ct = strlen(cvnbuf) + 1; if (phead != NULL) { pal = attrlist_create(atname, rsname, ct); if (pal == NULL) { /* FAILURE */ return(-1); } memcpy(pal->al_value, cvnbuf, ct); pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); } else { strcpy(atname, cvnbuf); } /* SUCCESS */ return(1); } /* * set_time - use the function set_l() * * comp_time - use the funttion comp_l() * * free_l - use free_null to (not) free space */ torque-2.4.16/src/lib/Libattr/attr_fn_c.c0000664000113300011330000001712211272401245015076 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes * character, a single * * Each set has functions for: * Decoding the value string to the machine representation. * Encoding the machine representation of the attribute to external form * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * -------------------------------------------------- * The Set of Attribute Functions for attributes with * value type "char" * -------------------------------------------------- */ /* * decode_c - decode first character of string into attribute structure * * Returns: 0 if ok * >0 error number if error * *patr elements set */ int decode_c( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val /* attribute value */ ) { if ((val == (char *)0) || (strlen(val) == 0)) { patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; patr->at_val.at_char = '\0'; } else { patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; patr->at_val.at_char = *val; } return (0); } /* * encode_c - encode attribute of type character into attr_extern * * Returns: >0 if ok * =0 if no value, no link entry created * <0 if error */ /*ARGSUSED*/ int encode_c( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attrlist list */ char *atname, /* attribute name */ char *rsname, /* resource name or null */ int mode /* encode mode, unused here */ ) { svrattrl *pal; if (!attr) return (-1); if (!(attr->at_flags & ATR_VFLAG_SET)) return (0); pal = attrlist_create(atname, rsname, 2); if (pal == (svrattrl *)0) return (-1); *pal->al_value = attr->at_val.at_char; *(pal->al_value + 1) = '\0'; pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); return (1); } /* * set_c - set attribute A to attribute B, * either A=B, A += B, or A -= B * * Returns: 0 if ok * >0 if error */ int set_c(struct attribute *attr, struct attribute *new, enum batch_op op) { assert(attr && new && (new->at_flags & ATR_VFLAG_SET)); switch (op) { case SET: attr->at_val.at_char = new->at_val.at_char; break; case INCR: attr->at_val.at_char = (char)((int)attr->at_val.at_char + (int)new->at_val.at_char); break; case DECR: attr->at_val.at_char = (char)((int)attr->at_val.at_char - (int)new->at_val.at_char); break; default: return (PBSE_INTERNAL); } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * comp_c - compare two attributes of type character * * Returns: +1 if 1st > 2nd * 0 if 1st == 2nd * -1 if 1st < 2nd */ int comp_c(struct attribute *attr, struct attribute *with) { if (!attr || !with) return (-1); if (attr->at_val.at_char < with->at_val.at_char) return (-1); else if (attr->at_val.at_char > with->at_val.at_char) return (1); else return (0); } /* * free_c - use free_null() to (not) free space */ torque-2.4.16/src/lib/Libattr/attr_fn_intr.c0000664000113300011330000001361011272401245015626 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type * interactive * * Each set has functions for: * Decoding the value string to the machine representation. * Encoding the machine representation of the value to a string * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * Freeing the space malloc-ed to the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * ----------------------------------------------------------- * Set of General functions for attributes of type interactive * ----------------------------------------------------------- * * This attribute contains the port number to which an Interactive qsub is * listening. */ /* decode_interactive - use decode_l() */ /* * encode_inter - encode attribute of type ATR_TYPE_STR to attr_extern * * Special case for "interactive" attribute, decode into TRUE/FALSE * for client, decode into port number for all others. * * Returns: >0 size of data returned to buffer * =0 if not value, no link added * <0 if error */ /*ARGSUSED*/ int encode_inter( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attribute list */ char *atname, /* attribute name */ char *rsname, /* resource name or null */ int mode /* encode mode, unused here */ ) { if (mode == ATR_ENCODE_CLIENT) return (encode_b(attr, phead, atname, rsname, mode)); else return (encode_l(attr, phead, atname, rsname, mode)); } torque-2.4.16/src/lib/Libattr/LTostr.c0000664000113300011330000001165111272401245014367 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include "Long.h" /* * LTostr - returns a pointer to the character string representation of the * Long number, value, represented in base, base. * * If base is outside its domain of 2 through the number of characters in * the Long_dig array, uLTostr returns a zero-length string and sets errno * to EDOM. * * The string is stored in a static array and will be clobbered the next * time either LTostr or uLTostr is called. The price of eliminating the * possibility of memory leaks is the necessity to copy the string * immediately to a safe place if it must last. */ const char * LTostr(Long value, int base) { if (value < 0) { char *bp; bp = (char *)uLTostr((u_Long) - value, base); if (*bp == '\0') return (bp); *--bp = '-'; return (bp); } return (uLTostr((u_Long)value, base)); } torque-2.4.16/src/lib/Libattr/attr_fn_ll.c0000664000113300011330000001741311272401245015266 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type * Long integer, where "Long" is defined as the largest integer * available. * * Each set has functions for: * Decoding the value string to the machine representation. * Encoding the internal attribute to external form * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * -------------------------------------------------- * The Set of Attribute Functions for attributes with * value type "Long" (_ll) * -------------------------------------------------- */ #define CVNBUFSZ 23 /* * decode_ll - decode Long integer into attribute structure * Unlike decode_long, this function will decode octal (leading zero) and * hex (leading 0x or 0X) data as well as decimal * * Returns: 0 if ok * >0 error number if error * *patr elements set */ int decode_ll( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val /* attribute value */ ) { char *pc; if ((val != (char *)0) && (strlen(val) != 0)) { patr->at_val.at_ll = (Long)strTouL(val, &pc, 0); if (*pc != '\0') return (PBSE_BADATVAL); /* invalid string */ patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; } else { patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; patr->at_val.at_ll = 0; } return (0); } /* * encode_ll - encode attribute of type Long into attr_extern * * Returns: >0 if ok * =0 if no value, no attrlist link added * <0 if error */ /*ARGSUSED*/ int encode_ll( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attrlist list */ char *atname, /* attribute name */ char *rsname, /* resource name or null */ int mode /* encode mode, unused here */ ) { size_t ct; const char *cvn; svrattrl *pal; if (!attr) return (-1); if (!(attr->at_flags & ATR_VFLAG_SET)) return (0); cvn = uLTostr(attr->at_val.at_ll, 10); ct = strlen(cvn) + 1; pal = attrlist_create(atname, rsname, ct); if (pal == (svrattrl *)0) return (-1); (void)memcpy(pal->al_value, cvn, ct); pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); return (1); } /* * set_ll - set attribute A to attribute B, * either A=B, A += B, or A -= B * * Returns: 0 if ok * >0 if error */ int set_ll(struct attribute *attr, struct attribute *new, enum batch_op op) { assert(attr && new && (new->at_flags & ATR_VFLAG_SET)); switch (op) { case SET: attr->at_val.at_ll = new->at_val.at_ll; break; case INCR: attr->at_val.at_ll += new->at_val.at_ll; break; case DECR: attr->at_val.at_ll -= new->at_val.at_ll; break; default: return (PBSE_INTERNAL); } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * comp_ll - compare two attributes of type Long * * Returns: +1 if 1st > 2nd * 0 if 1st == 2nd * -1 if 1st < 2nd */ int comp_ll(struct attribute *attr, struct attribute *with) { if (!attr || !with) return (-1); if (attr->at_val.at_ll < with->at_val.at_ll) return (-1); else if (attr->at_val.at_ll > with->at_val.at_ll) return (1); else return (0); } /* * free_ll - use free_null to (not) free space */ torque-2.4.16/src/lib/Libattr/attr_fn_acl.c0000664000113300011330000005434011417372214015422 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains general functions for attributes of type * User/Group/Hosts Acess Control List. * * The following functions should be used for the 3 types of ACLs: * * User ACL Group ACL Host ACL * (+ mgrs + ops) * --------------------------------------------- * decode_arst decode_arst decode_arst * encode_arst encode_arst encode_arst * set_uacl set_arst set_hostacl * comp_arst comp_arst comp_arst * free_arst free_arst free_arst * * The "encoded" or external form of the value is a string with the orginial * strings separated by commas (or new-lines) and terminated by a null. * * The "decoded" form is a set of strings pointed to by an array_strings struct * * These forms are identical to ATR_TYPE_ARST, and in fact encode_arst(), * comp_arst(), and free_arst() are used for those functions. * * set_ugacl() is different because of the special sorting required. */ /* External Functions called */ /* Private Functions */ static int hacl_match A_((const char *can, const char *master)); static int user_match A_((const char *can, const char *master)); static int gid_match A_((const char *can, const char *master)); static int host_order A_((char *old, char *new)); static int user_order A_((char *old, char *new)); static int set_allacl A_((attribute *, attribute *, enum batch_op, int (*order_func)())); /* for all decode_*acl() - use decode_arst() */ /* for all encode_*acl() - use encode_arst() */ /* * set_uacl - set value of one User ACL attribute to another * with special sorting. * * A=B --> set of strings in A replaced by set of strings in B * A+B --> set of strings in B appended to set of strings in A * A-B --> any string in B found is A is removed from A * * Returns: 0 if ok * >0 if error */ int set_uacl(struct attribute *attr, struct attribute *new, enum batch_op op) { return (set_allacl(attr, new, op, user_order)); } /* * set_hostacl - set value of one Host ACL attribute to another * with special sorting. * * A=B --> set of strings in A replaced by set of strings in B * A+B --> set of strings in B appended to set of strings in A * A-B --> any string in B found is A is removed from A * * Returns: 0 if ok * >0 if error */ int set_hostacl( struct attribute *attr, struct attribute *new, enum batch_op op) { return(set_allacl(attr, new, op, host_order)); } /* * acl_check - check a name: * user or [user@]full_host_name * group_name * full_host_name * against the entries in an access control list. * Match is done by calling the approprate comparison function * with the name and each string from the list in turn. * * Returns: 1 if access is allowed; 0 if not allowed */ int acl_check( attribute *pattr, char *name, /* I (optional) */ int type) { int i; #ifdef HOST_ACL_DEFAULT_ALL int default_rtn = 1; #else /* HOST_ACL_DEFAULT_ALL */ int default_rtn = 0; #endif /* HOST_ACL_DEFAULT_ALL */ struct array_strings *pas; char *pstr; int (*match_func) A_((const char *, const char *)); extern char server_host[]; switch (type) { case ACL_Host: match_func = hacl_match; break; case ACL_User: match_func = user_match; break; case ACL_Gid: match_func = gid_match; break; case ACL_Group: default: match_func = (int (*)())strcmp; break; } if (!(pattr->at_flags & ATR_VFLAG_SET) || ((pas = pattr->at_val.at_arst) == NULL) || (pas->as_usedptr == 0)) { #ifdef HOST_ACL_DEFAULT_ALL /* no list, default to everybody is allowed */ return(1); #else if (type != ACL_Host) { /* FAILURE - deny */ return(0); } /* if there is no list set, allow only from my host */ return(!hacl_match(name, server_host)); #endif } for (i = 0; i < pas->as_usedptr;i++) { pstr = pas->as_string[i]; if ((*pstr == '+') || (*pstr == '-')) { if (*(pstr + 1) == '\0') /* "+" or "-" sets default */ { if (*pstr == '+') default_rtn = 1; /* allow by default */ else default_rtn = 0; /* deny by default */ } pstr++; /* skip over +/- if present */ } if ((name != NULL) && !match_func(name, pstr)) { /* acl matches */ if (*pas->as_string[i] == '-') { /* deny */ return(0); } /* allow */ return(1); } } /* END for (i) */ return(default_rtn); } /* END acl_check() */ /* * chk_dup_acl - check for duplicate in list (array_strings) * Return 0 if no duplicate, 1 if duplicate within the new list or * between the new and old list. */ static int chk_dup_acl( struct array_strings *old, struct array_strings *new) { int i; int j; for (i = 0;i < new->as_usedptr;++i) { /* first check against self */ for (j = 0; j < new->as_usedptr; ++j) { if (i != j) { if (strcmp(new->as_string[i], new->as_string[j]) == 0) return 1; } } /* next check new against existing (old) strings */ for (j = 0; j < old->as_usedptr; ++j) { if (strcmp(new->as_string[i], old->as_string[j]) == 0) return 1; } } return 0; } /* * set_allacl - general set function for all types of acls * This function is private to this file. It is called * by the public set function which is specific to the * ACL type. The public function passes an extra * parameter which indicates the ACL type. */ static int set_allacl(attr, new, op, order_func) struct attribute *attr; struct attribute *new; enum batch_op op; int (*order_func) A_((char *, char *)); { int i; int j; int k; int nsize; int need; long offset; char *pc; char *where; int used; struct array_strings *tmppas; struct array_strings *pas; struct array_strings *newpas; assert(attr && new && (new->at_flags & ATR_VFLAG_SET)); pas = attr->at_val.at_arst; /* array of strings control struct */ newpas = new->at_val.at_arst; /* array of strings control struct */ if (!newpas) return (PBSE_INTERNAL); if (!pas) { /* no array_strings control structure, make one */ i = newpas->as_npointers; pas = (struct array_strings *)malloc((i - 1) * sizeof(char *) + sizeof(struct array_strings)); if (!pas) return (PBSE_SYSTEM); pas->as_npointers = i; pas->as_usedptr = 0; pas->as_bufsize = 0; pas->as_buf = (char *)0; pas->as_next = (char *)0; attr->at_val.at_arst = pas; } /* * At this point we know we have a array_strings struct initialized */ switch (op) { case SET: /* * Replace old array of strings with new array, this is * simply done by deleting old strings and adding the * new strings one at a time via Incr */ for (i = 0; i < pas->as_usedptr; i++) pas->as_string[i] = (char *)0; /* clear all pointers */ pas->as_usedptr = 0; pas->as_next = pas->as_buf; if (newpas->as_usedptr == 0) break; /* none to set */ nsize = newpas->as_next - newpas->as_buf; /* space needed */ if (nsize > pas->as_bufsize) /* new won't fit */ { if (pas->as_buf) free(pas->as_buf); nsize += nsize / 2; /* alloc extra space */ if (!(pas->as_buf = malloc((size_t)nsize))) { pas->as_bufsize = 0; return (PBSE_SYSTEM); } pas->as_bufsize = nsize; } else /* str does fit, clear buf */ { (void)memset(pas->as_buf, 0, pas->as_bufsize); } pas->as_next = pas->as_buf; /* No break, "Set" falls into "Incr" to add strings */ case INCR: /* check for duplicates within new and between new and old */ if (chk_dup_acl(pas, newpas)) return (PBSE_DUPLIST); nsize = newpas->as_next - newpas->as_buf; /* space needed */ used = pas->as_next - pas->as_buf; /* space used */ if (nsize > (pas->as_bufsize - used)) { /* need to make more room for sub-strings */ need = pas->as_bufsize + 2 * nsize; /* alloc new buf */ if (pas->as_buf) pc = realloc(pas->as_buf, (size_t)need); else pc = malloc((size_t)need); if (pc == (char *)0) return (PBSE_SYSTEM); offset = pc - pas->as_buf; pas->as_buf = pc; pas->as_next = pc + used; pas->as_bufsize = need; for (j = 0; j < pas->as_usedptr; j++) /* adjust points */ pas->as_string[j] += offset; } j = pas->as_usedptr + newpas->as_usedptr; if (j > pas->as_npointers) { /* need more pointers */ j = 3 * j / 2; /* allocate extra */ need = (int)sizeof(struct array_strings) + (j - 1) * sizeof(char *); tmppas = (struct array_strings *)realloc((char *)pas, (size_t)need); if (tmppas == (struct array_strings *)0) return (PBSE_SYSTEM); tmppas->as_npointers = j; pas = tmppas; attr->at_val.at_arst = pas; } /* now put in new strings in special ugacl sorted order */ for (i = 0; i < newpas->as_usedptr; i++) { for (j = 0; j < pas->as_usedptr; j++) { if (order_func(pas->as_string[j], newpas->as_string[i]) > 0) break; } /* push up rest of old strings to make room for new */ offset = strlen(newpas->as_string[i]) + 1; if (j < pas->as_usedptr) { where = pas->as_string[j]; /* where to put in new */ pc = pas->as_next - 1; while (pc >= pas->as_string[j]) /* shift data up */ { *(pc + offset) = *pc; pc--; } for (k = pas->as_usedptr; k > j; k--) /* re adjust pointrs */ pas->as_string[k] = pas->as_string[k-1] + offset; } else { where = pas->as_next; } (void)strcpy(where, newpas->as_string[i]); pas->as_string[j] = where; pas->as_usedptr++; pas->as_next += offset; } break; case DECR: /* decrement (remove) string from array */ for (j = 0; j < newpas->as_usedptr; j++) { for (i = 0; i < pas->as_usedptr; i++) { if (!strcmp(pas->as_string[i], newpas->as_string[j])) { /* compact buffer */ nsize = (int)strlen(pas->as_string[i]) + 1; pc = pas->as_string[i] + nsize; need = pas->as_next - pc; memmove(pas->as_string[i], pc, (size_t)need); pas->as_next -= nsize; /* compact pointers */ for (++i; i < pas->as_npointers; i++) pas->as_string[i-1] = pas->as_string[i] - nsize; pas->as_string[i-1] = (char *)0; pas->as_usedptr--; break; } } } break; default: return (PBSE_INTERNAL); } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * user_match - User order match * Match two strings by user, then from the tail end first * * Canidate string (first parameter) is a single user@host string. * * Master string (2nd parameter) is an entry from a user/group acl. * It should have a leading + or - which is ignored. Next is the user name * which is compared first. If the user name matches, then the host name is * checked. The host name may be a wild carded or null (including no '@'). * If the hostname is null, it is treated the same as "@*", a fully wild * carded hostname that matches anything. * * Returns 0 if strings match, 1 if not - to match strcmp() */ static int user_match(const char *can, const char *master) { /* match user name first */ do { if (*master != *can) return (1); /* doesn't match */ master++; can++; } while ((*master != '@') && (*master != '\0')); if (*master == '\0') { /* if full match or if master has no host (=wildcard) */ if ((*can == '\0') || (*can == '@')) return (0); else return (1); } else if (*can != '@') return (1); /* ok, now compare host/domain name working backwards */ /* if hit wild card in master ok to stop and report match */ return (hacl_match(can + 1, master + 1)); } /* * user_order - user order compare * compare: * (1) the user names, if they are equal, then * (2) two host entrys from the tail end first * * Returns -1 if entry s1 sorts before s2 * 0 if equal * 1 if s1 sorts after s2 */ static int user_order( char *s1, char *s2) { int d; /* skip over the + or - prefix */ if ((*s1 == '+') || (*s1 == '-')) s1++; if ((*s2 == '+') || (*s2 == '-')) s2++; /* compare user names first, stop with '@' */ while (1) { if ((d = (int) * s1 - (int) * s2) != 0) return (d); if ((*s1 == '@') || (*s1 == '\0')) return (host_order(s1 + 1, s2 + 1)); /* order host names */ s1++; s2++; } return(0); } /* END user_order() */ /* * group acl match - match 2 groups by gid */ static int gid_match(const char *group1, const char *group2) { struct group *pgrp; gid_t gid1, gid2; if (!strcmp(group1, group2)) { return(0); /* match */ } pgrp = getgrnam(group1); if (pgrp == NULL) return(1); gid1 = pgrp->gr_gid; pgrp = getgrnam(group2); if (pgrp == NULL) return(1); gid2 = pgrp->gr_gid; return (!(gid1 == gid2)); } /* * checks if the range portion of a hostname matches the range in an acl * if they match, moves the pointers past this portion * should receive things like pm_ptr->->[0-4] and pc_ptr->->3 * * @param pm_ptr - pointer to the pointer to the acl * @param pc_ptr - pointer to the pointer to the hostname we're checking * @return 0 if match, 1 otherwise */ int acl_check_range( const char **pm_ptr, /* I/O */ const char **pc_ptr) /* I/O */ { const char *pm = *pm_ptr; const char *pc = *pc_ptr; int low; int high; int num; if (*pm == '[') pm++; low = atoi(pm); /* find the dash */ while ((pm != NULL) && (*pm != '-')) pm++; /* move past the dash */ pm++; high = atoi(pm); /* find the closing bracket */ while ((pm != NULL) && (*pm != ']')) pm++; /* move past the ] */ pm++; num = atoi(pc); if ((num < low) || (num > high)) return(1); /* it matches, now update the pointers */ /* move pc past the digits */ while (isdigit(*pc)) pc++; *pc_ptr = pc; *pm_ptr = pm; return(0); } /* END acl_check_range() */ int acl_wildcard_check( const char **pm_ptr, /* I/O */ const char **pc_ptr, /* I/O */ const char *master_end, /* I */ const char *can_end) /* I */ { const char *pm = *pm_ptr; const char *pc = *pc_ptr; if (*pm != '*') return(1); pm++; /* we only have to do more if this isn't the end */ if (pm < master_end) { /* search through the "can" string to find a match for the rest of * the acl */ while ((strcasecmp(pm,pc) != 0) && (pc < can_end)) { pc++; } if (pc >= can_end) return(1); } /* we're matching */ *pm_ptr = master_end; *pc_ptr = can_end; return(0); } /* END acl_wildcard_check() */ /* * host acl order match - match two strings from the tail end first * * Master string (2nd parameter) is an entry from a host acl. It may have a * leading + or - which is ignored. It may also have an '*' as a leading * name segment to be a wild card - match anything. * * Strings match if identical, or if match up to leading '*' on master which * like a wild card, matches any prefix string on canidate domain name * * Returns 0 if strings match, 1 if not - to match strcmp() */ static int hacl_match( const char *can, const char *master) { const char *pc; const char *pm; const char *can_end; const char *master_end; if ((can == NULL) || (!strcmp(can, "LOCAL"))) { return(0); } pc = can; pm = master; can_end = can + strlen(can); master_end = master + strlen(master); while ((pc < can_end) && (pm < master_end)) { switch (*pm) { case '[': if (acl_check_range(&pm,&pc) != 0) return(1); break; case '*': if (acl_wildcard_check(&pm,&pc,master_end,can_end) != 0) return(1); break; default: if (tolower(*pc) != tolower(*pm)) return(1); /* only advance pointers here, other functions advance properly */ pc++; pm++; break; } } /* make sure both strings have terminated or the master has a wildcard */ if (pc < can_end) return(1); else if (pm < master_end) { if ((*pm != '*') || (pm+1 < master_end)) return(1); } /* if we haven't failed by now, we're golden */ return (0); } /* * host reverse order compare - compare two host entrys from the tail end first * domain name segment at at time. * * Returns -1 if entry s1 sorts before s2 * 0 if equal * 1 if s1 sorts after s2 */ static int host_order( char *s1, char *s2) { int d; char *p1; char *p2; if ((*s1 == '+') || (*s1 == '-')) s1++; if ((*s2 == '+') || (*s2 == '-')) s2++; p1 = s1 + strlen(s1) - 1; p2 = s2 + strlen(s2) - 1; while (1) { d = (int) * p2 - (int) * p1; if ((p1 > s1) && (p2 > s2)) { if (d != 0) return (d); else { p1--; p2--; } } else if ((p1 == s1) && (p2 == s2)) { if (*p1 == '*') return (1); else if (*p2 == '*') return (-1); else return (d); } else if (p1 == s1) { return (1); } else { return (-1); } } return(0); } torque-2.4.16/src/lib/Libattr/attr_fn_unkn.c0000664000113300011330000002347411272401245015636 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of an * unknown (unrecognized) name (and therefore unknown type). * It is a collection point for all "other" attributes, other than * the types with specific definition and meaning. * * Because the type is unknown, it cannot be decoded into a native * form. Thus the attribute is maintained in the attrlist form. * Any attribute/value located here will be sent to the Scheduler and it * within its rules may do as it choses with them. * * The prototypes are declared in "attribute.h" * * ---------------------------------------------------------------------------- * Attribute functions for attributes with value type "unknown" * ---------------------------------------------------------------------------- */ /* External Global Items */ /* private functions */ /* * decode_unkn - decode a pair of strings (name and value) into the Unknown * type attribute/resource which is maintained as a "svrattrl", a * linked list of structures containing strings. * * Returns: 0 if ok, * >0 error number if error, * *patr members set */ int decode_unkn( struct attribute *patr, /* May be Modified on Return */ char *name, char *rescn, char *value ) { svrattrl *entry; size_t valln; if (patr == (attribute *)0) return (PBSE_INTERNAL); if (!(patr->at_flags & ATR_VFLAG_SET)) CLEAR_HEAD(patr->at_val.at_list); if (name == (char *)0) return (PBSE_INTERNAL); if (value == (char *)0) valln = 0; else valln = strlen(value) + 1; entry = attrlist_create(name, rescn, valln); if (entry == (svrattrl *)0) return (PBSE_SYSTEM); if (valln) memcpy(entry->al_value, value, valln); append_link(&patr->at_val.at_list, &entry->al_link, entry); patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * encode_unkn - encode attr of unknown type into attrlist form * * Here things are different from the typical attribute. Most have a * single value to be encoded. But "the unknown" attribute may have a whole * list. * * This function does not use the parent attribute name, after all "_other_" * is rather meaningless. In addition, each unknown already is in an * attrlist form. * * Thus for each entry in the list, encode_unkn duplicates the existing * attrlist struct and links the copy into the list. * * Returns:>=0 if ok, the total encoded size of all resources. * -1 if encoded value would not fit into buffer * -2 if error */ /*ARGSUSED*/ int encode_unkn( attribute *attr, /* ptr to attribute to encode */ tlist_head *phead, /* list to place entry in */ char *atname, /* attribute name, not used here */ char *rsname, /* resource name, not used here */ int mode /* encode mode, unused here */ ) { svrattrl *plist; svrattrl *pnew; if (!attr) return (-2); plist = (svrattrl *)GET_NEXT(attr->at_val.at_list); if (plist == (svrattrl *)0) return (0); while (plist != (svrattrl *)0) { pnew = (svrattrl *)malloc(plist->al_tsize); if (pnew == (svrattrl *)0) return (-1); CLEAR_LINK(pnew->al_link); pnew->al_tsize = plist->al_tsize; pnew->al_nameln = plist->al_nameln; pnew->al_rescln = plist->al_rescln; pnew->al_valln = plist->al_valln; pnew->al_flags = plist->al_flags; pnew->al_name = (char *)pnew + sizeof(svrattrl); (void)memcpy(pnew->al_name, plist->al_name, plist->al_nameln); if (plist->al_rescln) { pnew->al_resc = pnew->al_name + pnew->al_nameln; (void)memcpy(pnew->al_resc, plist->al_resc, plist->al_rescln); } else { pnew->al_resc = (char *)0; } if (plist->al_valln) { pnew->al_value = pnew->al_name + pnew->al_nameln + pnew->al_rescln; (void)memcpy(pnew->al_value, plist->al_value, pnew->al_valln); } append_link(phead, &pnew->al_link, pnew); plist = (svrattrl *)GET_NEXT(plist->al_link); } return (1); } /* * set_unkn - set value of attribute of unknown type to another * * Each entry in the list headed by the "new" attribute is appended * to the list headed by "old". * * All operations, set, incr, and decr, map to append. * Returns: 0 if ok * >0 if error */ /*ARGSUSED*/ int set_unkn(struct attribute *old, struct attribute *new, enum batch_op op) { svrattrl *plist; svrattrl *pnext; assert(old && new && (new->at_flags & ATR_VFLAG_SET)); plist = (svrattrl *)GET_NEXT(new->at_val.at_list); while (plist != (svrattrl *)0) { pnext = (svrattrl *)GET_NEXT(plist->al_link); delete_link(&plist->al_link); append_link(&old->at_val.at_list, &plist->al_link, plist); plist = pnext; } old->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * comp_unkn - compare two attributes of type ATR_TYPE_RESR * * How do you compare something when you don't know what it is... * So, always returns +1 * */ int comp_unkn(struct attribute *attr, struct attribute *with) { return (1); } /* * free_unkn - free space associated with attribute value * * For each entry in the list, it is delinked, and freed. */ void free_unkn(attribute *pattr) { svrattrl *plist; if (pattr->at_flags & ATR_VFLAG_SET) { while ((plist = (svrattrl *)GET_NEXT(pattr->at_val.at_list)) != (svrattrl *)0) { delete_link(&plist->al_link); (void)free(plist); } } CLEAR_HEAD(pattr->at_val.at_list); pattr->at_flags &= ~ATR_VFLAG_SET; } torque-2.4.16/src/lib/Libattr/attr_fn_tokens.c0000664000113300011330000000174411272401245016162 00000000000000#include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" #include "log.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "pbs_error.h" /* * decode_tokens - validate the token request * * Returns: 0 if ok * >0 error number if error * *patr elements set */ int decode_tokens( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val /* attribute value */ ) { int ret = 0; char * colon; float count; if (val != NULL) { ret = PBSE_BADATVAL; /* Assume bad until proven otherwise */ colon = strstr(val, ":"); if (colon != NULL) { count = atof(++colon); if (count > 0.0 && count < 1000.0) { ret = 0; } } } if (ret == 0) { ret = decode_str(patr, name, rescn, val); } return ret; } torque-2.4.16/src/lib/Libattr/attr_fn_resc.c0000664000113300011330000005302511556046067015626 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "log.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type * resource * * A "resource" is similiar to an attribute but with two levels of * names. The first name is the attribute name, e.g. "resource-list", * the second name is the resource name, e.g. "mem". * * Each resource_def has functions for: * Decoding the value string to the internal representation. * Encoding the internal attribute to external form * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * freeing the resource value space (if extra memory is allocated) * * Some or all of the functions for an resource type may be shared with * other resource types or even attributes. * * The prototypes are declared in "attribute.h", also see resource.h * * ---------------------------------------------------------------------------- * Attribute functions for attributes with value type resource * ---------------------------------------------------------------------------- */ /* Global Variables */ int resc_access_perm; /* External Global Items */ int comp_resc_gt; /* count of resources compared > */ int comp_resc_eq; /* count of resources compared = */ int comp_resc_lt; /* count of resources compared < */ int comp_resc_nc; /* count of resources not compared */ /* * decode_resc - decode a "attribute name/resource name/value" triplet into * a resource type attribute * * Returns: 0 if ok, * >0 error number if error, * *patr members set */ int decode_resc( struct attribute *patr, /* Modified on Return */ char *name, /* attribute name */ char *rescn, /* I resource name - is used here */ char *val) /* resource value */ { resource *prsc; resource_def *prdef; int rc = 0; int rv; if (patr == NULL) { return(PBSE_INTERNAL); } if (rescn == NULL) { return(PBSE_UNKRESC); } if (!(patr->at_flags & ATR_VFLAG_SET)) CLEAR_HEAD(patr->at_val.at_list); prdef = find_resc_def(svr_resc_def, rescn, svr_resc_size); if (prdef == NULL) { /* * didn't find resource with matching name, use unknown; * but return PBSE_UNKRESC in case caller doesn`t wish to * accept unknown resources */ rc = PBSE_UNKRESC; prdef = svr_resc_def + (svr_resc_size - 1); } prsc = find_resc_entry(patr, prdef); if (prsc == NULL) /* no current resource entry, add it */ if ((prsc = add_resource_entry(patr, prdef)) == NULL) { return(PBSE_SYSTEM); } /* note special use of ATR_DFLAG_ACCESS, see server/attr_recov() */ if (((prsc->rs_defin->rs_flags & resc_access_perm & ATR_DFLAG_WRACC) == 0) && (resc_access_perm != ATR_DFLAG_ACCESS)) { return(PBSE_ATTRRO); } patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; rv = prdef->rs_decode(&prsc->rs_value, name, rescn, val); if (rv == 0) { /* FAILURE */ return(rc); } /* SUCCESS */ return(rv); } /* * encode_resc - encode attr of type ATR_TYPE_RESR into attr_extern form * * Here we are a little different from the typical attribute. Most have a * single value to be encoded. But resource attribute may have a whole bunch. * First get the name of the parent attribute (typically "resource-list"). * Then for each resource in the list, call the individual resource decode * routine with "aname" set to the parent attribute name. * * If mode is either ATR_ENCODE_SAVE or ATR_ENCODE_SVR, then any resource * currently set to the default value is not encoded. This allows it to be * reset if the default changes or it is moved. * * If the mode is ATR_ENCODE_CLIENT or ATR_ENCODE_MOM, the client permission * passed in the global variable resc_access_perm is checked against each * definition. This allows a resource by resource access setting, not just * on the attribute. * * Returns: >0 if ok * =0 if no value to encode, no entries added to list * <0 if some resource entry had an encode error. */ int encode_resc( attribute *attr, /* ptr to attribute to encode */ tlist_head *phead, /* head of attrlist list */ char *atname, /* attribute name */ char *rsname, /* resource name, null on call */ int mode) /* encode mode */ { int dflt; resource *prsc; int rc; int grandtotal = 0; int perm; if (attr == NULL) { return(-1); } if (!(attr->at_flags & ATR_VFLAG_SET)) { return(0); /* no resources at all */ } /* ok now do each separate resource */ prsc = (resource *)GET_NEXT(attr->at_val.at_list); while (prsc != NULL) { /* * encode if sending to client or MOM with permission * encode if saving and not default value * encode if sending to server and not default and have permission */ perm = prsc->rs_defin->rs_flags & resc_access_perm ; dflt = prsc->rs_value.at_flags & ATR_VFLAG_DEFLT; if (((mode == ATR_ENCODE_CLIENT) && perm) || ((mode == ATR_ENCODE_MOM) && perm) || ((mode == ATR_ENCODE_SAVE) && (dflt == 0)) || ((mode == ATR_ENCODE_SVR) && (dflt == 0) && perm)) { rsname = prsc->rs_defin->rs_name; rc = prsc->rs_defin->rs_encode(&prsc->rs_value, phead, atname, rsname, mode); if (rc < 0) return (rc); grandtotal += rc; } prsc = (resource *)GET_NEXT(prsc->rs_link); } return(grandtotal); } /* * set_resc - set value of attribute of type ATR_TYPE_RESR to another * * For each resource in the list headed by the "new" attribute, * the correspondingly name resource in the list headed by "old" * is modified. * * The mapping of the operations incr and decr depend on the type * of each individual resource. * Returns: 0 if ok * >0 if error */ int set_resc( struct attribute *old, struct attribute *new, enum batch_op op) { enum batch_op local_op; resource *newresc; resource *oldresc; int rc; assert(old && new); newresc = (resource *)GET_NEXT(new->at_val.at_list); while (newresc != NULL) { local_op = op; /* search for old that has same definition as new */ oldresc = find_resc_entry(old, newresc->rs_defin); if (oldresc == NULL) { /* add new resource to list */ oldresc = add_resource_entry(old, newresc->rs_defin); if (oldresc == NULL) { return(PBSE_SYSTEM); } } /* * unlike other attributes, resources can be "unset" * if new is "set" to a value, the old one is set to that * value; if the new resource is unset (no value), then the * old resource is unset by freeing it. */ if (newresc->rs_value.at_flags & ATR_VFLAG_SET) { /* call resource type dependent set routine */ if ((rc = oldresc->rs_defin->rs_set(&oldresc->rs_value, &newresc->rs_value, local_op)) != 0) return (rc); } else { oldresc->rs_defin->rs_free(&oldresc->rs_value); } newresc = (resource *)GET_NEXT(newresc->rs_link); } old->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return(0); } /* * comp_resc - compare two attributes of type ATR_TYPE_RESR * * DANGER Will Robinson, DANGER * * As you can see from the returns, this is different from the * at_comp model... * * Returns: 0 if compare successful: * sets comp_resc_gt to count of "greater than" compares * attr > with * sets comp_resc_eq to count of "equal to" compares * attr == with * sets comp_resc_lt to count of "less than" compares * attr < with * -1 if error */ /* NOTE: if IsQueueCentric is 0, enforce for every job attr set, if IsQueueCentric is 1, enforce for every queue attr set old default behavior was '1' */ int comp_resc( struct attribute *attr, /* I queue's min/max attributes */ struct attribute *with) /* I job's current requirements/attributes */ { resource *atresc; resource *wiresc; int rc; comp_resc_gt = 0; comp_resc_eq = 0; comp_resc_lt = 0; comp_resc_nc = 0; if ((attr == NULL) || (with == NULL)) { /* FAILURE */ return(-1); } /* comparison is job centric */ /* NOTE: this check only enforces attributes if the job specifies the attribute. If the queue has a min requirement of resource X and the job has no value set for this resource, this routine will not trigger comp_resc_lt */ wiresc = (resource *)GET_NEXT(with->at_val.at_list); while (wiresc != NULL) { if ((wiresc->rs_value.at_flags & ATR_VFLAG_SET) && ((wiresc->rs_value.at_flags & ATR_VFLAG_DEFLT) == 0)) { atresc = find_resc_entry(attr, wiresc->rs_defin); if (atresc != NULL) { if (atresc->rs_value.at_flags & ATR_VFLAG_SET) { if ((rc = atresc->rs_defin->rs_comp( &atresc->rs_value, &wiresc->rs_value)) > 0) { comp_resc_gt++; } else if (rc < 0) { comp_resc_lt++; } else { comp_resc_eq++; } } } else { comp_resc_nc++; } } wiresc = (resource *)GET_NEXT(wiresc->rs_link); } /* END while() */ return(0); } /* END comp_resc() */ /* * comp_resc2 - compare two attributes of type ATR_TYPE_RESR * * DANGER Will Robinson, DANGER * * As you can see from the returns, this is different from the * at_comp model... * * Returns: 0 if compare successful: * sets comp_resc_gt to count of "greater than" compares * attr > with * sets comp_resc_eq to count of "equal to" compares * attr == with * sets comp_resc_lt to count of "less than" compares * attr < with * -1 if error */ /* NOTE: if IsQueueCentric is 0, enforce for every job attr set, if IsQueueCentric is 1, enforce for every queue attr set old default behavior was '1' */ int comp_resc2( struct attribute *attr, /* I queue's min/max attributes */ struct attribute *with, /* I job's current requirements/attributes */ int IsQueueCentric, /* I */ char *EMsg) /* O (optional,minsize=1024) */ { resource *atresc; resource *wiresc; int rc; char *LimitName; comp_resc_gt = 0; comp_resc_eq = 0; comp_resc_lt = 0; comp_resc_nc = 0; if (EMsg != NULL) EMsg[0] = '\0'; if ((attr == NULL) || (with == NULL)) { /* FAILURE */ return(-1); } if (IsQueueCentric == 1) { /* comparison is queue centric */ atresc = (resource *)GET_NEXT(attr->at_val.at_list); while (atresc != NULL) { if (atresc->rs_value.at_flags & ATR_VFLAG_SET) { wiresc = find_resc_entry(with, atresc->rs_defin); if (wiresc != NULL) { if ((wiresc->rs_value.at_flags & ATR_VFLAG_SET) || (wiresc->rs_value.at_flags & ATR_VFLAG_DEFLT)) { if ((rc = atresc->rs_defin->rs_comp( &atresc->rs_value, &wiresc->rs_value)) > 0) { if ((EMsg != NULL) && (EMsg[0] == '\0')) { LimitName = atresc->rs_defin->rs_name; sprintf(EMsg, "cannot satisfy queue min %s requirement", (LimitName != NULL) ? LimitName : "resource"); } comp_resc_gt++; } else if (rc < 0) { comp_resc_lt++; } else { comp_resc_eq++; } } } else { comp_resc_nc++; } } atresc = (resource *)GET_NEXT(atresc->rs_link); } } else { /* comparison is job centric */ /* NOTE: this check only enforces attributes if the job specifies the attribute. If the queue has a min requirement of resource X and the job has no value set for this resource, this routine will not trigger comp_resc_lt */ wiresc = (resource *)GET_NEXT(with->at_val.at_list); while (wiresc != NULL) { if ((wiresc->rs_value.at_flags & ATR_VFLAG_SET) && ((wiresc->rs_value.at_flags & ATR_VFLAG_DEFLT) == 0)) { atresc = find_resc_entry(attr, wiresc->rs_defin); if (atresc != NULL) { if (atresc->rs_value.at_flags & ATR_VFLAG_SET) { if ((rc = atresc->rs_defin->rs_comp( &atresc->rs_value, &wiresc->rs_value)) > 0) { if ((EMsg != NULL) && (EMsg[0] == '\0')) { LimitName = atresc->rs_defin->rs_name; sprintf(EMsg, "cannot satisfy queue min %s requirement", (LimitName != NULL) ? LimitName : "resource"); } comp_resc_gt++; } else if (rc < 0) { comp_resc_lt++; } else { comp_resc_eq++; } } } else { comp_resc_nc++; } } wiresc = (resource *)GET_NEXT(wiresc->rs_link); } /* END while() */ } return(0); } /* END comp_resc2() */ /* * free_resc - free space associated with attribute value * * For each entry in the resource list, the entry is delinked, * the resource entry value space freed (by calling the resource * free routine), and then the resource structure is freed. */ void free_resc( attribute *pattr) { resource *next; resource *pr; pr = (resource *)GET_NEXT(pattr->at_val.at_list); while (pr != NULL) { next = (resource *)GET_NEXT(pr->rs_link); delete_link(&pr->rs_link); pr->rs_defin->rs_free(&pr->rs_value); free(pr); pr = next; } CLEAR_HEAD(pattr->at_val.at_list); pattr->at_flags &= ~ATR_VFLAG_SET; return; } /* END free_resc() */ /* * find_resc_def - find the resource_def structure for a resource with * a given name * * Returns: pointer to the structure or NULL */ resource_def *find_resc_def( resource_def *rscdf, /* address of array of resource_def structs */ char *name, /* name of resource */ int limit) /* number of members in resource_def array */ { while (limit--) { if (!strcmp(rscdf->rs_name, name)) { /* SUCCESS */ return(rscdf); } rscdf++; } return(NULL); } /* END find_resc_def() */ /* * find_resc_entry - find a resource (value) entry in a list headed in an * an attribute that points to the specified resource_def structure * * Returns: pointer to struct resource or NULL */ resource *find_resc_entry( attribute *pattr, /* I */ resource_def *rscdf) /* I */ { resource *pr; pr = (resource *)GET_NEXT(pattr->at_val.at_list); while (pr != NULL) { if (!strcmp(pr->rs_defin->rs_name, rscdf->rs_name)) break; pr = (resource *)GET_NEXT(pr->rs_link); } return(pr); } /* END find_resc_entry() */ /* * add_resource_entry - add and "unset" entry for a resource type to a * list headed in an attribute. Just for later displaying, the * resource list is maintained in an alphabetic order. * The parent attribute is marked with ATR_VFLAG_SET and ATR_VFLAG_MODIFY * * Returns: pointer to the newly added entry or NULL if unable * to add it (malloc failed). If the resource already * exists (it shouldn't) then that one is returned. */ resource *add_resource_entry( attribute *pattr, resource_def *prdef) { int i; resource *new; resource *pr; pr = (resource *)GET_NEXT(pattr->at_val.at_list); while (pr != NULL) { i = strcmp(pr->rs_defin->rs_name, prdef->rs_name); if (i == 0) /* found an matching entry */ return (pr); else if (i > 0) break; pr = (resource *)GET_NEXT(pr->rs_link); } new = (resource *)malloc(sizeof(resource)); if (new == (resource *)0) { return ((resource *)0); } CLEAR_LINK(new->rs_link); new->rs_defin = prdef; new->rs_value.at_type = prdef->rs_type; new->rs_value.at_flags = 0; prdef->rs_free(&new->rs_value); if (pr != (resource *)0) { insert_link(&pr->rs_link, &new->rs_link, new, LINK_INSET_BEFORE); } else { append_link(&pattr->at_val.at_list, &new->rs_link, new); } pattr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return(new); } /* * action_resc - the at_action for the resource_list attribute * For each resource in the list, if it has its own action routine, * call it. */ int action_resc( attribute *pattr, void *pobject, int actmode) { resource *pr; pr = (resource *)GET_NEXT(pattr->at_val.at_list); while (pr != NULL) { if ((pr->rs_value.at_flags & ATR_VFLAG_MODIFY) && (pr->rs_defin->rs_action)) pr->rs_defin->rs_action(pr, pattr, actmode); pr->rs_value.at_flags &= ~ATR_VFLAG_MODIFY; pr = (resource *)GET_NEXT(pr->rs_link); } return(0); } torque-2.4.16/src/lib/Libattr/attr_fn_hold.c0000664000113300011330000001602011272401245015576 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "pbs_job.h" #include "pbs_error.h" #define HOLD_ENCODE_SIZE 3 /* * This file contains special decode and encode functions for the hold-types * attribute. All other functions for this attribute are the standard * _b (boolean) routines. * * decode_hold - decode string into hold attribute * * Returns: 0 if 0k * >0 error number if error * *patr members set */ int decode_hold( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name - unused here */ char *val /* attribute value */ ) { char *pc; patr->at_val.at_long = 0; if ((val != (char *)0) && (strlen(val) > (size_t)0)) { for (pc = val; *pc != '\0'; pc++) { switch (*pc) { case 'n': patr->at_val.at_long = HOLD_n; break; case 'u': patr->at_val.at_long |= HOLD_u; break; case 'o': patr->at_val.at_long |= HOLD_o; break; case 's': patr->at_val.at_long |= HOLD_s; break; default: return (PBSE_BADATVAL); } } patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; } else { patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; } return (0); } /* * encode_str - encode attribute of type ATR_TYPE_STR into attr_extern * * Returns: >0 if ok * =0 if no value, so no link added to list * <0 if error */ /*ARGSUSED*/ int encode_hold( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attrlist */ char *atname, /* name of attribute */ char *rsname, /* resource name or null */ int mode /* encode mode, unused here */ ) { int i; svrattrl *pal; if (!attr) return (-1); if (!(attr->at_flags & ATR_VFLAG_SET)) return (0); pal = attrlist_create(atname, rsname, HOLD_ENCODE_SIZE + 1); if (pal == (svrattrl *)0) return (-1); i = 0; if (attr->at_val.at_long == 0) *(pal->al_value + i++) = 'n'; else { if (attr->at_val.at_long & HOLD_s) *(pal->al_value + i++) = 's'; if (attr->at_val.at_long & HOLD_o) *(pal->al_value + i++) = 'o'; if (attr->at_val.at_long & HOLD_u) *(pal->al_value + i++) = 'u'; } while (i < HOLD_ENCODE_SIZE + 1) *(pal->al_value + i++) = '\0'; pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); return (1); } /* * comp_hold - compare two attributes of type hold * * Returns: +1 if 1st != 2nd * 0 if 1st == 2nd */ int comp_hold(struct attribute *attr, struct attribute *with) { if (!attr || !with) return -1; if (attr->at_val.at_long == with->at_val.at_long) return 0; else return 1; } torque-2.4.16/src/lib/Libattr/attr_node_func.c0000664000113300011330000006566311272401245016146 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "net_connect.h" #include "pbs_job.h" #include "pbs_nodes.h" #include "pbs_error.h" #include "log.h" #if SYSLOG #include #endif extern int LOGLEVEL; /* * This file contains functions for deriving attribute values from a pbsnode * and for updating the "state" (inuse), "node type" (ntype) or "properties" * list using the "value" carried in an attribute. * * Included are: * * global: * decode_state() "functions for at_decode func pointer" * decode_ntype() * decode_props() * * encode_state() "functions for at_encode func pointer" * encode_ntype() * encode_props() * encode_jobs() * * set_node_state() "functions for at_set func pointer" * set_node_ntype() * * node_state() "functions for at_action func pointer" * node_ntype() * node_prop_list() * * free_prop_list() * free_prop_attr() "function for at_free func pointer" * * local: * load_prop() * set_nodeflag() * * The prototypes are declared in "attr_func.h" */ /* * Set of forward declarations for functions used before defined * keeps the compiler happy */ static int set_nodeflag A_((char*, short*)); /* static int load_prop A_(( char*, struct prop* )); */ static struct node_state { short bit; char *name; } ns[] = { {INUSE_UNKNOWN, ND_state_unknown}, {INUSE_DOWN, ND_down}, {INUSE_OFFLINE, ND_offline}, {INUSE_RESERVE, ND_reserve}, {INUSE_JOB, ND_job_exclusive}, {INUSE_JOBSHARE, ND_job_sharing}, {INUSE_BUSY, ND_busy}, {0, NULL} }; int PNodeStateToString( int SBM, /* I (state bitmap) */ char *Buf, /* O */ int BufSize) /* I */ { if (Buf == NULL) { return(-1); } BufSize--; Buf[0] = '\0'; if (SBM & (INUSE_DOWN)) { if (Buf[0] != '\0') strncat(Buf, ",", BufSize - strlen(Buf)); strncat(Buf, ND_down, BufSize - strlen(Buf)); } if (SBM & (INUSE_OFFLINE)) { if (Buf[0] != '\0') strncat(Buf, ",", BufSize - strlen(Buf)); strncat(Buf, ND_offline, BufSize - strlen(Buf)); } if (SBM & (INUSE_JOB)) { if (Buf[0] != '\0') strncat(Buf, ",", BufSize - strlen(Buf)); strncat(Buf, ND_job_exclusive, BufSize - strlen(Buf)); } if (SBM & (INUSE_JOBSHARE)) { if (Buf[0] != '\0') strncat(Buf, ",", BufSize - strlen(Buf)); strncat(Buf, ND_job_sharing, BufSize - strlen(Buf)); } if (SBM & (INUSE_BUSY)) { if (Buf[0] != '\0') strncat(Buf, ",", BufSize - strlen(Buf)); strncat(Buf, ND_busy, BufSize - strlen(Buf)); } if (SBM & (INUSE_RESERVE)) { if (Buf[0] != '\0') strncat(Buf, ",", BufSize - strlen(Buf)); strncat(Buf, ND_reserve, BufSize - strlen(Buf)); } if (SBM & (INUSE_UNKNOWN)) { if (Buf[0] != '\0') strncat(Buf, ",", BufSize - strlen(Buf)); strncat(Buf, ND_state_unknown, BufSize - strlen(Buf)); } if (Buf[0] == '\0') { strncpy(Buf, ND_free, BufSize); } return(0); } /* * encode_state * Once the node's "inuse" field is converted to an attribute, * the attribute can be passed to this function for encoding into * an svrattrl structure * Returns <0 an error encountered; value is negative of an error code * 0 ok, encode happened and svrattrl created and linked in, * or nothing to encode */ int encode_state( attribute *pattr, /*struct attribute being encoded */ tlist_head *ph, /*head of a list of "svrattrl" */ /*structs which are to be returned*/ char *aname, /*attribute's name */ char *rname, /*resource's name (null if none) */ int mode) /*mode code, unused here */ { int i; svrattrl *pal; short state; static char state_str[MAX_ENCODE_BFR]; if (!pattr) { return -(PBSE_INTERNAL); } if (!(pattr->at_flags & ATR_VFLAG_SET)) { /* SUCCESS - attribute not set */ return(0); } state = pattr->at_val.at_short & (INUSE_SUBNODE_MASK | INUSE_UNKNOWN); if (!state) { strcpy(state_str, ND_free); } else { state_str[0] = '\0'; for (i = 0;ns[i].name;i++) { if (state & ns[i].bit) { if (state_str[0] != '\0') strcat(state_str, ","); strcat(state_str, ns[i].name); } } } pal = attrlist_create(aname, rname, (int)strlen(state_str) + 1); if (pal == NULL) { return -(PBSE_SYSTEM); } strcpy(pal->al_value, state_str); pal->al_flags = ATR_VFLAG_SET; append_link(ph, &pal->al_link, pal); /* SUCCESS */ return(0); } /* END encode_state */ /* * encode_ntype * Once the node's "ntype" field is converted to an attribute, * the attribute can be passed to this function for encoding into * an svrattrl structure * Returns <0 an error encountered; value is negative of an error code * 0 ok, encode happened and svrattrl created and linked in, * or nothing to encode */ int encode_ntype( attribute *pattr, /*struct attribute being encoded */ tlist_head *ph, /*head of a list of "svrattrl" */ char *aname, /*attribute's name */ char *rname, /*resource's name (null if none) */ int mode /*mode code, unused here */ ) { svrattrl *pal; short ntype; static char ntype_str[ MAX_ENCODE_BFR ]; if (!pattr) return -(PBSE_INTERNAL); if (!(pattr->at_flags & ATR_VFLAG_SET)) return (0); /*nothing to report back*/ ntype = pattr->at_val.at_short & PBSNODE_NTYPE_MASK; if (!ntype) strcpy(ntype_str, ND_cluster); else strcpy(ntype_str, ND_timeshared); pal = attrlist_create(aname, rname, (int)strlen(ntype_str) + 1); if (pal == (svrattrl *)0) return -(PBSE_SYSTEM); (void)strcpy(pal->al_value, ntype_str); pal->al_flags = ATR_VFLAG_SET; append_link(ph, &pal->al_link, pal); return (0); /*success*/ } /* * encode_jobs * Once the node's struct jobinfo pointer is put in the data area of * temporary attribute containing a pointer to the parent node, this * function will walk the list of jobs and generate the comma separated * list to send back via an svrattrl structure. * Returns <0 an error encountered; value is negative of an error code * 0 ok, encode happened and svrattrl created and linked in, * or nothing to encode */ /* FORMAT for PCONST_ENCOVERHEAD -> '/, ' ... */ /* overhead supports ',', ' ', '/', and TID <= 99999 */ #define PCONST_ENCOVERHEAD 8 int encode_jobs( attribute *pattr, /*struct attribute being encoded */ tlist_head *ph, /*head of a list of "svrattrl" */ /*structs which are to be returned*/ char *aname, /*attribute's name */ char *rname, /*resource's name (null if none) */ int mode) /*mode code, unused here */ { svrattrl *pal; struct jobinfo *jip; struct pbsnode *pnode; struct pbssubn *psubn; int i; int jobcnt; /*number of jobs using the node */ int strsize; /*computed string size */ char *job_str; /*holds comma separated list of jobs*/ if (pattr == NULL) { return (-1); } if (!(pattr->at_flags & ATR_VFLAG_SET) || !pattr->at_val.at_jinfo) { return(0); /* nothing to report back */ } /* cnt number of jobs and estimate size of string buffer required */ jobcnt = 0; strsize = 1; /*allow for terminating null char*/ pnode = pattr->at_val.at_jinfo; for (psubn = pnode->nd_psn;psubn != NULL;psubn = psubn->next) { for (jip = psubn->jobs;jip != NULL;jip = jip->next) { jobcnt++; strsize += strlen(jip->job->ji_qs.ji_jobid) + PCONST_ENCOVERHEAD; } } /* END for (psubn) */ if (jobcnt == 0) { /* no jobs currently on this node */ return(0); } if (!(job_str = (char *)malloc(strsize))) { return -(PBSE_SYSTEM); } job_str[0] = '\0'; i = 0; for (psubn = pnode->nd_psn;psubn != NULL;psubn = psubn->next) { for (jip = psubn->jobs;jip != NULL;jip = jip->next) { if (i != 0) strcat(job_str, ", "); else i++; sprintf(job_str + strlen(job_str), "%d/%s", psubn->index, jip->job->ji_qs.ji_jobid); } } /* END for (psubn) */ pal = attrlist_create(aname, rname, (int)strlen(job_str) + 1); if (pal == NULL) { free(job_str); return -(PBSE_SYSTEM); } strcpy(pal->al_value, job_str); pal->al_flags = ATR_VFLAG_SET; free(job_str); append_link(ph, &pal->al_link, pal); return(0); /* success */ } /* END encode_jobs() */ /* * decode_state * In this case, the two arguments that get used are * pattr-- it points to an attribute whose value is a short, * and the argument "val". * Once the "value" argument, val, is decoded from its form * as a string of comma separated substrings, the component * values are used to set the appropriate bits in the attribute's * value field. */ int decode_state( attribute *pattr, /* I (modified) */ char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val) /* attribute value */ { int rc = 0; /*return code; 0==success*/ short flag, currflag; char *str; char strbuf[512]; /*should handle most vals*/ char *sbufp; int slen; if (val == NULL) { return(PBSE_BADNDATVAL); } /* * determine string storage requirement and copy the string "val" * to a work buffer area */ slen = strlen(val); /*bufr either on stack or heap*/ if (slen - 512 < 0) { sbufp = strbuf; } else { if (!(sbufp = (char *)malloc(slen + 1))) { return(PBSE_SYSTEM); } } strcpy(sbufp, val); if ((str = parse_comma_string(sbufp)) == NULL) { if (slen >= 512) free(sbufp); return(rc); } flag = 0; if ((rc = set_nodeflag(str, &flag)) != 0) { if (slen >= 512) free(sbufp); return(rc); } currflag = flag; /*calling parse_comma_string with a null ptr continues where*/ /*last call left off. The initial comma separated string */ /*copy pointed to by sbufp is modified with each func call */ while ((str = parse_comma_string(NULL)) != NULL) { if ((rc = set_nodeflag(str, &flag)) != 0) break; if (((currflag == 0) && flag) || (currflag && (flag == 0))) { rc = PBSE_MUTUALEX; /*free is mutually exclusive*/ break; } currflag = flag; } if (!rc) { pattr->at_val.at_short = flag; pattr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; } if (slen >= 512) /* buffer on heap, not stack */ free(sbufp); return(rc); } /* END decode_state() */ /* * decode_ntype * In this case, the two arguments that get used are * pattr-- it points to an attribute whose value is a short, * and the argument "val". * Although we have only "time-shared" and "cluster" at this * point in PBS's evolution, there may come a time when other * ntype values are needed. The one thing that is assumed is * that the types are going to be mutually exclusive */ int decode_ntype( attribute *pattr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val /* attribute value */ ) { int rc = 0; /*return code; 0==success*/ short tmp = 0; if (val == (char *)0) rc = (PBSE_BADNDATVAL); else if (!strcmp(val, ND_timeshared)) tmp = NTYPE_TIMESHARED; else if (!strcmp(val, ND_cluster)) tmp = NTYPE_CLUSTER; else rc = (PBSE_BADNDATVAL); if (!rc) { pattr->at_val.at_short = tmp; pattr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; } return rc; } /* * free_prop_list * For each element of a null terminated prop list call free * to clean up any string buffer that hangs from the element. * After this, call free to remove the struct prop. */ void free_prop_list(struct prop *prop) { struct prop *pp; while (prop) { pp = prop->next; free(prop); prop = pp; } } /* * set_node_state - the information in the "short" attribute, *new, is used to * update the information in the "short" attribute, *pattr. * the mode of the update is goverened by the argument "op" * (SET,INCR,DECR) */ int set_node_state( attribute *pattr, /*attribute gets modified */ attribute *new, /*carries new, modifying info*/ /*that got decoded into 'new"*/ enum batch_op op) { int rc = 0; assert((pattr != NULL) && (new != NULL) && (new->at_flags & ATR_VFLAG_SET)); switch (op) { case SET: pattr->at_val.at_short = new->at_val.at_short; break; case INCR: if (pattr->at_val.at_short && new->at_val.at_short == 0) { rc = PBSE_BADNDATVAL; /*"free" mutually exclusive*/ break; } pattr->at_val.at_short |= new->at_val.at_short; break; case DECR: if (pattr->at_val.at_short && new->at_val.at_short == 0) { rc = PBSE_BADNDATVAL; /*"free" mutually exclusive*/ break; } pattr->at_val.at_short &= ~new->at_val.at_short; break; default: rc = PBSE_INTERNAL; } if (!rc) pattr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return rc; } /* * set_node_ntype - the value entry in attribute "new" is a short. It was * generated by the decode routine is used to update the * value portion of the attribute *pattr * the mode of the update is goverened by the argument "op" * (SET,INCR,DECR) */ int set_node_ntype( attribute *pattr, /*attribute gets modified */ attribute *new, /*carries new, modifying info*/ enum batch_op op ) { int rc = 0; assert(pattr && new && (new->at_flags & ATR_VFLAG_SET)); switch (op) { case SET: pattr->at_val.at_short = new->at_val.at_short; break; case INCR: if (pattr->at_val.at_short != new->at_val.at_short) { rc = PBSE_MUTUALEX; /*types are mutually exclusive*/ } break; case DECR: if (pattr->at_val.at_short != new->at_val.at_short) rc = PBSE_MUTUALEX; /*types are mutually exclusive*/ else if (pattr->at_val.at_short == NTYPE_TIMESHARED) pattr->at_val.at_short = NTYPE_CLUSTER; else pattr->at_val.at_short = NTYPE_TIMESHARED; break; default: rc = PBSE_INTERNAL; } if (!rc) pattr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return rc; } /* * set_nodeflag - Use the input string's value to set a bit in * the "flags" variable pointed to by pflags * Each call sets one more bit in the flags * variable or it clears the flags variable * in the case where *str is the value "free" */ static int set_nodeflag( char *str, short *pflag) { int rc = 0; if (*str == '\0') { return(PBSE_BADNDATVAL); } if (!strcmp(str, ND_free)) *pflag = 0; else if (!strcmp(str, ND_offline)) *pflag = *pflag | INUSE_OFFLINE; else if (!strcmp(str, ND_down)) *pflag = *pflag | INUSE_DOWN; else if (!strcmp(str, ND_reserve)) *pflag = *pflag | INUSE_RESERVE; else { rc = PBSE_BADNDATVAL; } return(rc); } /* * node_state - Either derive a "state" attribute from the node * or update node's "inuse" field using the "state" * attribute. */ int node_state( attribute *new, /*derive state into this attribute*/ void *pnode, /*pointer to a pbsnode struct */ int actmode) /*action mode; "NEW" or "ALTER" */ { int rc = 0; struct pbsnode* np; np = (struct pbsnode*)pnode; /*because of def of at_action args*/ switch (actmode) { case ATR_ACTION_NEW: /*derive attribute*/ new->at_val.at_short = np->nd_state; break; case ATR_ACTION_ALTER: np->nd_state = new->at_val.at_short; break; default: rc = PBSE_INTERNAL; break; } return(rc); } /* * node_ntype - Either derive an "ntype" attribute from the node * or update node's "ntype" field using the * attribute's data */ int node_ntype( attribute *new, /*derive ntype into this attribute*/ void *pnode, /*pointer to a pbsnode struct */ int actmode /*action mode; "NEW" or "ALTER" */ ) { int rc = 0; struct pbsnode* np; np = (struct pbsnode*)pnode; /*because of def of at_action args*/ switch (actmode) { case ATR_ACTION_NEW: /*derive attribute*/ new->at_val.at_short = np->nd_ntype; break; case ATR_ACTION_ALTER: np->nd_ntype = new->at_val.at_short; break; default: rc = PBSE_INTERNAL; } return rc; } /* * node_prop_list - Either derive a "prop list" attribute from the node * or update node's prop list from attribute's prop list. */ int node_prop_list( attribute *new, /*derive props into this attribute*/ void *pnode, /*pointer to a pbsnode struct */ int actmode) /*action mode; "NEW" or "ALTER" */ { int rc = 0; struct pbsnode *np; attribute temp; np = (struct pbsnode*)pnode; /*because of at_action arg type*/ switch (actmode) { case ATR_ACTION_NEW: /* if node has a property list, then copy array_strings */ /* into temp to use to setup a copy, otherwise setup empty */ if (np->nd_prop != NULL) { /* setup temporary attribute with the array_strings */ /* from the node */ temp.at_val.at_arst = np->nd_prop; temp.at_flags = ATR_VFLAG_SET; temp.at_type = ATR_TYPE_ARST; rc = set_arst(new, &temp, SET); } else { /* Node has no properties, setup empty attribute */ new->at_val.at_arst = 0; new->at_flags = 0; new->at_type = ATR_TYPE_ARST; } break; case ATR_ACTION_ALTER: /* update node with new attr_strings */ np->nd_prop = new->at_val.at_arst; /* update number of properties listed in node */ /* does not include name and subnode property */ if (np->nd_prop) np->nd_nprops = np->nd_prop->as_usedptr; else np->nd_nprops = 0; break; default: rc = PBSE_INTERNAL; break; } /* END switch(actmode) */ return(rc); } /* END node_prop_list() */ /* * node_status_list - Either derive a "status list" attribute from the node * or update node's status list from attribute's status list. */ int node_status_list( attribute *new, /*derive status into this attribute*/ void *pnode, /*pointer to a pbsnode struct */ int actmode) /*action mode; "NEW" or "ALTER" */ { int rc = 0; struct pbsnode *np; attribute temp; np = (struct pbsnode *)pnode; /* because of at_action arg type */ switch (actmode) { case ATR_ACTION_NEW: /* if node has a status list, then copy array_strings */ /* into temp to use to setup a copy, otherwise setup empty */ if (np->nd_status != NULL) { /* setup temporary attribute with the array_strings */ /* from the node */ temp.at_val.at_arst = np->nd_status; temp.at_flags = ATR_VFLAG_SET; temp.at_type = ATR_TYPE_ARST; rc = set_arst(new, &temp, SET); } else { /* node has no properties, setup empty attribute */ new->at_val.at_arst = NULL; new->at_flags = 0; new->at_type = ATR_TYPE_ARST; } break; case ATR_ACTION_ALTER: if (np->nd_status != NULL) { free(np->nd_status->as_buf); free(np->nd_status); np->nd_status = NULL; } /* update node with new attr_strings */ np->nd_status = new->at_val.at_arst; new->at_val.at_arst = NULL; /* update number of status items listed in node */ /* does not include name and subnode property */ if (np->nd_status != NULL) np->nd_nstatus = np->nd_status->as_usedptr; else np->nd_nstatus = 0; break; default: rc = PBSE_INTERNAL; break; } /* END switch(actmode) */ return(rc); } /* END node_status_list() */ /* * node_note - Either derive a note attribute from the node * or update node's note from attribute's list. */ int node_note( attribute *new, /*derive status into this attribute*/ void *pnode, /*pointer to a pbsnode struct */ int actmode) /*action mode; "NEW" or "ALTER" */ { int rc = 0; struct pbsnode *np; attribute temp; np = (struct pbsnode *)pnode; /* because of at_action arg type */ switch (actmode) { case ATR_ACTION_NEW: /* if node has a note, then copy string into temp */ /* to use to setup a copy, otherwise setup empty */ if (np->nd_note != NULL) { /* setup temporary attribute with the string from the node */ temp.at_val.at_str = np->nd_note; temp.at_flags = ATR_VFLAG_SET; temp.at_type = ATR_TYPE_STR; rc = set_note_str(new, &temp, SET); } else { /* node has no properties, setup empty attribute */ new->at_val.at_str = NULL; new->at_flags = 0; new->at_type = ATR_TYPE_STR; } break; case ATR_ACTION_ALTER: if (np->nd_note != NULL) { free(np->nd_note); np->nd_note = NULL; } /* update node with new string */ np->nd_note = new->at_val.at_str; new->at_val.at_str = NULL; break; default: rc = PBSE_INTERNAL; break; } /* END switch(actmode) */ return(rc); } /* END node_note() */ /* * a set_str() wrapper with sanity checks for notes */ int set_note_str( struct attribute *attr, struct attribute *new, enum batch_op op) { static char id[] = "set_note_str"; size_t nsize; int rc = 0; assert(attr && new && new->at_val.at_str && (new->at_flags & ATR_VFLAG_SET)); nsize = strlen(new->at_val.at_str); /* length of new note */ if (nsize > MAX_NOTE) { sprintf(log_buffer, "Warning: Client attempted to set note with len (%d) > MAX_NOTE (%d)", (int)nsize, MAX_NOTE); log_record( PBSEVENT_SECURITY, PBS_EVENTCLASS_REQUEST, id, log_buffer); rc = PBSE_BADNDATVAL; } if (strchr(new->at_val.at_str, '\n') != NULL) { sprintf(log_buffer, "Warning: Client attempted to set note with a newline char"); log_record( PBSEVENT_SECURITY, PBS_EVENTCLASS_REQUEST, id, log_buffer); rc = PBSE_BADNDATVAL; } if (rc != 0) return(rc); rc = set_str(attr, new, op); return(rc); } /* END set_note_str() */ /* END attr_node_func.c */ torque-2.4.16/src/lib/Libattr/attr_fn_l.c0000664000113300011330000001735211272401245015114 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type * long integer * * Each set has functions for: * Decoding the value string to the machine representation. * Encoding the internal attribute to external form * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * -------------------------------------------------- * The Set of Attribute Functions for attributes with * value type "long" * -------------------------------------------------- */ /* * decode_l - decode long integer into attribute structure * * Returns: 0 if ok * >0 error number if error * *patr elements set */ int decode_l( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val /* attribute value */ ) { char *pc; if ((val != (char *)0) && (strlen(val) != 0)) { pc = val; if ((*pc == '+') || (*pc == '-')) pc++; while (*pc != '\0') { if (isdigit((int)*pc) == 0) return (PBSE_BADATVAL); /* invalid string */ pc++; } patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; patr->at_val.at_long = atol(val); } else { patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; patr->at_val.at_long = 0; } return (0); } /* * encode_l - encode attribute of type long into attr_extern * * Returns: >0 if ok * =0 if no value, no attrlist link added * <0 if error */ /*ARGSUSED*/ #define CVNBUFSZ 21 int encode_l( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attrlist list */ char *atname, /* attribute name */ char *rsname, /* resource name or null */ int mode /* encode mode, unused here */ ) { size_t ct; char cvnbuf[CVNBUFSZ]; svrattrl *pal; if (!attr) return (-1); if (!(attr->at_flags & ATR_VFLAG_SET)) return (0); (void)sprintf(cvnbuf, "%ld", attr->at_val.at_long); ct = strlen(cvnbuf) + 1; pal = attrlist_create(atname, rsname, ct); if (pal == (svrattrl *)0) return (-1); (void)memcpy(pal->al_value, cvnbuf, ct); pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); return (1); } /* * set_l - set attribute A to attribute B, * either A=B, A += B, or A -= B * * Returns: 0 if ok * >0 if error */ int set_l(struct attribute *attr, struct attribute *new, enum batch_op op) { assert(attr && new && (new->at_flags & ATR_VFLAG_SET)); switch (op) { case SET: attr->at_val.at_long = new->at_val.at_long; break; case INCR: attr->at_val.at_long += new->at_val.at_long; break; case DECR: attr->at_val.at_long -= new->at_val.at_long; break; default: return (PBSE_INTERNAL); } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * comp_l - compare two attributes of type long * * Returns: +1 if 1st > 2nd * 0 if 1st == 2nd * -1 if 1st < 2nd */ int comp_l(struct attribute *attr, struct attribute *with) { if (!attr || !with) return (-1); if (attr->at_val.at_long < with->at_val.at_long) return (-1); else if (attr->at_val.at_long > with->at_val.at_long) return (1); else return (0); } /* * free_l - use free_null to (not) free space */ torque-2.4.16/src/lib/Libattr/attr_atomic.c0000664000113300011330000002662111605403054015451 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include "portability.h" #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "pbs_error.h" /* * This file contains general functions for manipulating an attribute array. * Included is: * attr_atomic_set() * attr_atomic_node_set() * attr_atomic_kill() * * The prototypes are declared in "attr_func.h" */ /* Global Variables */ extern int resc_access_perm; /* see lib/Libattr/attr_fn_resc.c */ /* * attr_atomic_set - atomically set a attribute array with values from * an svrattrl */ int attr_atomic_set( struct svrattrl *plist, attribute *old, attribute *new, attribute_def *pdef, int limit, int unkn, int privil, int *badattr) { int acc; int index; int listidx; resource *prc; int rc; attribute temp; for (index = 0;index < limit;index++) clear_attr(new + index, pdef + index); resc_access_perm = privil; /* set privilege for decode_resc() */ listidx = 0; rc = PBSE_NONE; while (plist != NULL) { listidx++; if ((index = find_attr(pdef, plist->al_name, limit)) < 0) { if (unkn < 0) { /*unknown attr isn't allowed*/ rc = PBSE_NOATTR; break; } else { index = unkn; /* if unknown attr are allowed */ } } /* have we privilege to set the attribute ? */ acc = (pdef + index)->at_flags & ATR_DFLAG_ACCESS; if ((acc & privil & ATR_DFLAG_WRACC) == 0) { if (privil & ATR_DFLAG_SvWR) { /* from a daemon, just ignore this attribute */ plist = (struct svrattrl *)GET_NEXT(plist->al_link); continue; } /* from user, error if can't write attribute */ rc = PBSE_ATTRRO; break; } /* decode new value */ clear_attr(&temp, pdef + index); if ((rc = (pdef + index)->at_decode(&temp, plist->al_name, plist->al_resc, plist->al_value)) != 0) { if ((rc == PBSE_UNKRESC) && (unkn > 0)) rc = 0; /* ignore the "error" */ else break; } /* duplicate current value, if set AND not already dup-ed */ if (((old + index)->at_flags & ATR_VFLAG_SET) && !((new + index)->at_flags & ATR_VFLAG_SET)) { if ((rc = (pdef + index)->at_set(new + index, old + index, SET)) != 0) break; /* * we need to know if the value is changed during * the next step, so clear MODIFY here; including * within resources. */ (new + index)->at_flags &= ~ATR_VFLAG_MODIFY; if ((new + index)->at_type == ATR_TYPE_RESC) { prc = (resource *)GET_NEXT((new + index)->at_val.at_list); while (prc) { prc->rs_value.at_flags &= ~ATR_VFLAG_MODIFY; prc = (resource *)GET_NEXT(prc->rs_link); } } } /* update new copy with temp, MODIFY is set on ones changed */ if ((plist->al_op != INCR) && (plist->al_op != DECR) && (plist->al_op != SET)) { plist->al_op = SET; } if (temp.at_flags & ATR_VFLAG_SET) { if ((rc = (pdef + index)->at_set(new + index, &temp, plist->al_op)) != 0) { (pdef + index)->at_free(&temp); break; } } else if (temp.at_flags & ATR_VFLAG_MODIFY) { (pdef + index)->at_free(new + index); (new + index)->at_flags |= ATR_VFLAG_MODIFY; } (pdef + index)->at_free(&temp); if (plist->al_link.ll_next == NULL) break; plist = (struct svrattrl *)GET_NEXT(plist->al_link); } /* END while (plist != NULL) */ if (rc != 0) { *badattr = listidx; for (index = 0; index < limit; index++) (pdef + index)->at_free(new + index); return(rc); } return(0); } /* END attr_atomic_set() */ /* * attr_atomic_node_set - atomically set an attribute array with * values from an svrattrl */ int attr_atomic_node_set( struct svrattrl *plist, /*list of attribute modif structs*/ attribute *old, /*unused*/ attribute *new, /*new attribute array begins here*/ attribute_def *pdef, /*begin array definition structs*/ int limit, /*number elts in definition array*/ int unkn, /*<0 unknown attrib not permitted*/ int privil, /*requester's access privileges */ int *badattr /*return list position wher bad */ ) { int acc; int index; int listidx; int rc = 0; attribute temp; listidx = 0; while (plist) { /*Traverse loop for each client entered attribute*/ listidx++; if ((index = find_attr(pdef, plist->al_name, limit)) < 0) { if (unkn < 0) /*if unknown attr not allowed*/ { rc = PBSE_NOATTR; break; } else index = unkn; /*if unknown attr are allowed*/ } /* The name of the attribute is in the definitions list*/ /* Now, have we privilege to set the attribute ? */ /* Check access capabilities specified in the attrdef */ /* against the requestor's privilege level */ acc = (pdef + index)->at_flags & ATR_DFLAG_ACCESS; if ((acc & privil & ATR_DFLAG_WRACC) == 0) { if (privil & ATR_DFLAG_SvWR) { /* from a daemon, just ignore this attribute */ plist = (struct svrattrl *)GET_NEXT(plist->al_link); continue; } else { /*from user, no write access to attribute */ rc = PBSE_ATTRRO; break; } } /*decode new value*/ clear_attr(&temp, pdef + index); if ((rc = (pdef + index)->at_decode(&temp, plist->al_name, plist->al_resc, plist->al_value) != 0)) { if ((rc == PBSE_UNKRESC) && (unkn > 0)) rc = 0; /*ignore the "error"*/ else break; } /*update "new" with "temp", MODIFY is set on "new" if changed*/ (new + index)->at_flags &= ~ATR_VFLAG_MODIFY; if ((plist->al_op != INCR) && (plist->al_op != DECR) && (plist->al_op != SET)) plist->al_op = SET; if (temp.at_flags & ATR_VFLAG_SET) { /* "temp" has a data value, use it to update "new" */ if ((rc = (pdef + index)->at_set(new + index, &temp, plist->al_op)) != 0) { (pdef + index)->at_free(&temp); break; } } else if (temp.at_flags & ATR_VFLAG_MODIFY) { (pdef + index)->at_free(new + index); (new + index)->at_flags |= ATR_VFLAG_MODIFY; } (pdef + index)->at_free(&temp); plist = (struct svrattrl *)GET_NEXT(plist->al_link); } if (rc != 0) { /*"at_free" functions get invoked by upstream caller*/ /*invoking attr_atomic_kill() on the array of */ /*node-attribute structs-- any hanging structs are */ /*freed and then the node-attribute array is freed */ *badattr = listidx; /*the svrattrl that gave a problem*/ } return (rc); } /* * attr_atomic_kill - kill (free) a temporary attribute array which * was set up by attr_atomic_set(). * * at_free() is called on each element on the array, then * the array itself is freed. */ void attr_atomic_kill(attribute *temp, attribute_def *pdef, int limit) { int i; for (i = 0; i < limit; i++) (pdef + i)->at_free(temp + i); (void)free(temp); } torque-2.4.16/src/lib/Libattr/Makefile.in0000664000113300011330000004775011605403730015053 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libattr_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libattr ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libattr_a_AR = $(AR) $(ARFLAGS) libattr_a_LIBADD = am_libattr_a_OBJECTS = attr_atomic.$(OBJEXT) attr_fn_acl.$(OBJEXT) \ attr_fn_arst.$(OBJEXT) attr_fn_b.$(OBJEXT) attr_fn_c.$(OBJEXT) \ attr_fn_hold.$(OBJEXT) attr_fn_intr.$(OBJEXT) \ attr_fn_l.$(OBJEXT) attr_fn_ll.$(OBJEXT) \ attr_fn_resc.$(OBJEXT) attr_fn_size.$(OBJEXT) \ attr_fn_str.$(OBJEXT) attr_fn_time.$(OBJEXT) \ attr_fn_unkn.$(OBJEXT) attr_func.$(OBJEXT) \ attr_node_func.$(OBJEXT) Long_.$(OBJEXT) LTostr.$(OBJEXT) \ strToL.$(OBJEXT) strTouL.$(OBJEXT) uLTostr.$(OBJEXT) \ attr_fn_tokens.$(OBJEXT) libattr_a_OBJECTS = $(am_libattr_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libattr_a_SOURCES) DIST_SOURCES = $(libattr_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libattr.a libattr_a_SOURCES = attr_atomic.c attr_fn_acl.c attr_fn_arst.c attr_fn_b.c \ attr_fn_c.c attr_fn_hold.c attr_fn_intr.c attr_fn_l.c \ attr_fn_ll.c attr_fn_resc.c attr_fn_size.c \ attr_fn_str.c attr_fn_time.c attr_fn_unkn.c \ attr_func.c attr_node_func.c Long_.c LTostr.c strToL.c \ strTouL.c uLTostr.c attr_fn_tokens.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libattr/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libattr/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libattr.a: $(libattr_a_OBJECTS) $(libattr_a_DEPENDENCIES) -rm -f libattr.a $(libattr_a_AR) libattr.a $(libattr_a_OBJECTS) $(libattr_a_LIBADD) $(RANLIB) libattr.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LTostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Long_.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_atomic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_acl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_arst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_b.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_hold.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_intr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_l.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_ll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_resc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_size.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_str.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_time.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_tokens.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_fn_unkn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_func.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attr_node_func.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strToL.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strTouL.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uLTostr.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libattr/strTouL.c0000664000113300011330000002105111272401245014547 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "Long.h" #include "Long_.h" #undef strTouL #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif static unsigned x_val; static const char letters[] = "abcdefghijklmnopqrstuvwxyz"; static char table[UCHAR_MAX + 1]; /* * strTouL - returns the unsigned Long value representing the string whose * first character is *nptr, when interpreted as an integer in base, * base. * * If base is zero, the base of the integer is determined by the way the * string starts. The string is interpreted as decimal if the first * character after leading white space and an optional sign is a digit * between 1 and 9, inclusive. The string is interpreted as octal if the * first character after leading white space and an optional sign is the * digit "0" and the next character is not an "X" (either upper or lower * case). The string is interpreted as hexidecimal if the first character * after leading white space and an optional sign is the digit "0", * followed by an "X" (either upper or lower case). * * If base is greater than 1 and less than the number of characters in the * Long_dig array, it represents the base in which the number will be * interpreted. Characters for digits beyond 9 are represented by the * letters of the alphabet, either upper case or lower case. */ u_Long strTouL(nptr, endptr, base) const char *nptr; char **endptr; int base; { unsigned digit; u_Long limit = 0, value; enum { unknown1, unknown2, hex1, hex2, hex3, known, working, overflow } state; if (table[(unsigned char)'1'] != 1) { int i; /* Initialize conversion table */ (void)memset(table, CHAR_MAX, sizeof(table)); for (i = (int)strlen(Long_dig) - 1; i >= 0; i--) table[(unsigned char)Long_dig[i]] = i; for (i = (int)strlen(letters) - 1; i >= 0; i--) table[(unsigned char)letters[i]] = i + 10; x_val = table[(unsigned char)'x']; } if (nptr == NULL) { if (endptr != NULL) *endptr = (char *)nptr; return (0); } if (base < 0 || base == 1 || (size_t)base > strlen(Long_dig)) { errno = EDOM; if (endptr != NULL) *endptr = (char *)nptr; return (0); } switch (base) { case 0: state = unknown1; break; case 16: state = hex1; break; default: state = known; } while (isspace(*nptr++)); Long_neg = FALSE; switch (*--nptr) { case '-': Long_neg = TRUE; case '+': nptr++; } value = 0; while ((digit = table[(unsigned char)*nptr++]) != CHAR_MAX) { switch (state) { case unknown1: if (digit >= 10) goto done; if (digit == 0) { state = unknown2; break; } base = 10; state = working; limit = UlONG_MAX / 10; value = digit; break; case unknown2: if (digit >= 8) { if (digit != x_val) goto done; base = 16; state = hex3; break; } base = 8; state = working; limit = UlONG_MAX / 8; value = digit; break; case hex1: if ((int)digit >= base) goto done; if (digit == 0) { state = hex2; break; } state = working; limit = UlONG_MAX / 16; value = digit; break; case hex2: if (digit == x_val) { state = hex3; break; } case hex3: case known: if ((int)digit >= base) goto done; state = working; limit = UlONG_MAX / base; value = digit; break; case working: if ((int)digit >= base) goto done; if (value < limit) { value = value * base + digit; break; } if (value > limit || UlONG_MAX - (value *= base) < digit) { state = overflow; value = UlONG_MAX; errno = ERANGE; break; } value += digit; break; case overflow: if ((int)digit >= base) goto done; } } done: if (endptr != NULL) { if (state == hex3) nptr--; *endptr = (char *)--nptr; } if (Long_neg) return (-value); return (value); } torque-2.4.16/src/lib/Libattr/attr_fn_size.c0000664000113300011330000003143011272401245015624 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type * size, which is an integer optionally followed by k,K,m,M,g, * G,t, or T, optionally followed by w,W,b,B. * If 'w' or 'W' is not specified, b for bytes is assumed. * * The attribute has functions for: * Decoding the value string to the machine representation. * Encoding the internal attribute to external form * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * -------------------------------------------------- * The Set of Attribute Functions for attributes with * value type "size" * -------------------------------------------------- */ int to_size A_((char *, struct size_value *)); void from_size A_((struct size_value *, char *)); int normalize_size A_((struct size_value *a, struct size_value *b, struct size_value *c, struct size_value *d)); /* * decode_size - decode size into attribute structure * * Returns: 0 if ok * >0 error number if error * *patr elements set */ int decode_size( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val) /* attribute value */ { patr->at_val.at_size.atsv_num = 0; patr->at_val.at_size.atsv_shift = 0; if ((val != NULL) && (val[0] != '\0')) { if (to_size(val, &patr->at_val.at_size) != 0) { return(PBSE_BADATVAL); } patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; } else { patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; } return(0); } /* * encode_size - encode attribute of type size into attr_extern * * Returns: >0 if ok * =0 if no value, no attrlist link added * <0 if error */ /*ARGSUSED*/ #define CVNBUFSZ 23 int encode_size( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attrlist list */ char *atname, /* attribute name */ char *rsname, /* resource name (optional) */ int mode) /* encode mode (not used) */ { size_t ct; char cvnbuf[CVNBUFSZ]; svrattrl *pal; if (attr == NULL) { /* FAILURE */ return(-1); } if (!(attr->at_flags & ATR_VFLAG_SET)) { return(0); } from_size(&attr->at_val.at_size, cvnbuf); ct = strlen(cvnbuf) + 1; pal = attrlist_create(atname, rsname, ct); if (pal == NULL) { /* FAILURE */ return(-1); } memcpy(pal->al_value, cvnbuf, ct); pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); /* SUCCESS */ return(1); } /* * set_size - set attribute A to attribute B, * either A=B, A += B, or A -= B * * Returns: 0 if ok * >0 if error */ int set_size(struct attribute *attr, struct attribute *new, enum batch_op op) { unsigned long old; struct size_value tmpa; /* the two temps are used to insure that the */ struct size_value tmpn; /* real attributes are not changed if error */ assert(attr && new && (new->at_flags & ATR_VFLAG_SET)); switch (op) { case SET: attr->at_val.at_size.atsv_num = new->at_val.at_size.atsv_num; attr->at_val.at_size.atsv_shift = new->at_val.at_size.atsv_shift; attr->at_val.at_size.atsv_units = new->at_val.at_size.atsv_units; break; case INCR: if (normalize_size(&attr->at_val.at_size, &new->at_val.at_size, &tmpa, &tmpn) < 0) return (PBSE_BADATVAL); old = tmpa.atsv_num; tmpa.atsv_num += tmpn.atsv_num; if (tmpa.atsv_num < old) return (PBSE_BADATVAL); attr->at_val.at_size = tmpa; break; case DECR: if (normalize_size(&attr->at_val.at_size, &new->at_val.at_size, &tmpa, &tmpn) < 0) return (PBSE_BADATVAL); old = tmpa.atsv_num; tmpa.atsv_num -= tmpn.atsv_num; if (tmpa.atsv_num > old) return (PBSE_BADATVAL); attr->at_val.at_size = tmpa; break; default: return (PBSE_INTERNAL); } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * comp_size - compare two attributes of type size * * Returns: +1 if 1st > 2nd * 0 if 1st == 2nd * -1 if 1st < 2nd */ int comp_size(struct attribute *attr, struct attribute *with) { struct size_value tmpa; struct size_value tmpw; if (normalize_size(&attr->at_val.at_size, &with->at_val.at_size, &tmpa, &tmpw) != 0) { if (tmpa.atsv_shift > tmpw.atsv_shift) return (1); else if (tmpa.atsv_shift < tmpw.atsv_shift) return (-1); else return (0); } else if (tmpa.atsv_num > tmpw.atsv_num) return (1); else if (tmpa.atsv_num < tmpw.atsv_num) return (-1); else return (0); } /* * free_size - use free_null to (not) free space */ /* * normalize_size - normalize two size values, adjust so the shift * counts are the same. */ int normalize_size(struct size_value *a, struct size_value *b, struct size_value *ta, struct size_value *tb) { int adj; unsigned long temp; /* * we do the work in copies of the original attributes * to preserve the original (in case of error) */ *ta = *a; *tb = *b; /* if either unit is in bytes, then both must be */ if ((ta->atsv_units == ATR_SV_WORDSZ) && (tb->atsv_units != ATR_SV_WORDSZ)) { ta->atsv_num *= sizeof(int); ta->atsv_units = ATR_SV_BYTESZ; } else if ((ta->atsv_units != ATR_SV_WORDSZ) && (tb->atsv_units == ATR_SV_WORDSZ)) { tb->atsv_num *= sizeof(int); tb->atsv_units = ATR_SV_BYTESZ; } adj = ta->atsv_shift - tb->atsv_shift; if (adj > 0) { temp = ta->atsv_num; if ((adj > (int)sizeof(int) * 8) || (((temp << adj) >> adj) != ta->atsv_num)) return (-1); /* would overflow */ ta->atsv_shift = tb->atsv_shift; ta->atsv_num = ta->atsv_num << adj; } else if (adj < 0) { adj = -adj; temp = tb->atsv_num; if ((adj > (int)sizeof(int) * 8) || (((temp << adj) >> adj) != tb->atsv_num)) return (-1); /* would overflow */ tb->atsv_shift = ta->atsv_shift; tb->atsv_num = tb->atsv_num << adj; } return (0); } /* * to_size - decode the value string TO a size_value structure * * This function decodes a value string into a size_value struct. */ int to_size( char *val, /* I */ struct size_value *psize) /* O */ { int havebw = 0; char *pc; psize->atsv_units = ATR_SV_BYTESZ; psize->atsv_num = strtol(val, &pc, 0); if (pc == val) /* no numeric part */ { return(PBSE_BADATVAL); } switch (*pc) { case '\0': psize->atsv_shift = 0; break; case 'k': case 'K': psize->atsv_shift = 10; break; case 'm': case 'M': psize->atsv_shift = 20; break; case 'g': case 'G': psize->atsv_shift = 30; break; case 't': case 'T': psize->atsv_shift = 40; break; case 'p': case 'P': psize->atsv_shift = 50; break; case 'b': case 'B': havebw = 1; break; case 'w': case 'W': havebw = 1; psize->atsv_units = ATR_SV_WORDSZ; break; default: return (PBSE_BADATVAL); /* invalid string */ break; } if (*pc != '\0') pc++; if (*pc != '\0') { if (havebw) { return(PBSE_BADATVAL); /* invalid string */ } switch (*pc) { case 'b': case 'B': break; case 'w': case 'W': psize->atsv_units = ATR_SV_WORDSZ; break; default: return (PBSE_BADATVAL); } } return(0); } /* * from_size - encode a string FROM a size_value structure */ void from_size( struct size_value *psize, /* I */ char *cvnbuf) /* O (minsize=CVNBUFSZ) */ { sprintf(cvnbuf, "%lu", psize->atsv_num); switch (psize->atsv_shift) { case 0: /*NO-OP*/ break; case 10: strcat(cvnbuf, "k"); break; case 20: strcat(cvnbuf, "m"); break; case 30: strcat(cvnbuf, "g"); break; case 40: strcat(cvnbuf, "t"); break; case 50: strcat(cvnbuf, "p"); break; } if (psize->atsv_units & ATR_SV_WORDSZ) strcat(cvnbuf, "w"); else strcat(cvnbuf, "b"); return; } torque-2.4.16/src/lib/Libattr/Long_.c0000664000113300011330000001023711272401245014175 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ int Long_neg; char Long_dig[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; torque-2.4.16/src/lib/Libattr/attr_func.c0000664000113300011330000003755511272401245015140 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains general functions for manipulating attributes. * Included are: * clear_attr() * find_attr() * free_null() * attrlist_alloc() * attrlist_create() * parse_equal_string() * parse_comma_string() * count_substrings() * * The prototypes are declared in "attr_func.h" */ /* * clear_attr - clear an attribute value structure and clear ATR_VFLAG_SET */ void clear_attr( attribute *pattr, /* O */ attribute_def *pdef) /* I */ { #ifndef NDEBUG if (pdef == NULL) { fprintf(stderr, "Assertion failed, bad pdef in clear_attr\n"); abort(); } #endif /* NDEBUG */ memset((char *)pattr, 0, sizeof(struct attribute)); pattr->at_type = pdef->at_type; if ((pattr->at_type == ATR_TYPE_RESC) || (pattr->at_type == ATR_TYPE_LIST)) { CLEAR_HEAD(pattr->at_val.at_list); } return; } /*END clear_attr() */ /* * str_nc_cmp - string no-case comparision */ static int str_nc_cmp( char *s1, /* I */ char *s2) /* I */ { do { if (tolower((int)*s1) != tolower((int)*s2)) { return(-1); } } while (*s1++ && *s2++); return(0); } /* END str_nc_cmp() */ /* * find_attr - find attribute definition by name * * Searches array of attribute definition strutures to find one * whose name matches the requested name. * * Returns: >= 0 index into definition struture array * -1 if didn't find matching name */ int find_attr( struct attribute_def *attr_def, /* ptr to attribute definitions */ char *name, /* attribute name to find */ int limit) /* limit on size of def array */ { int index; if (attr_def != NULL) { for (index = 0;index < limit;index++) { if (!str_nc_cmp(attr_def->at_name, name)) { return(index); } attr_def++; } /* END for (index) */ } return(-1); } /* * attr_ifelse_long - if attr1 is set, return it, else * if attr2 is set, return it, else * return the default */ long attr_ifelse_long( attribute *attr1, attribute *attr2, long deflong) { if (attr1->at_flags & ATR_VFLAG_SET) return (attr1->at_val.at_long); else if (attr2->at_flags & ATR_VFLAG_SET) return (attr2->at_val.at_long); else return (deflong); } /* * free_null - A free routine for attributes which do not * have malloc-ed space ( boolean, char, long ). */ /*ARGSUSED*/ void free_null( struct attribute *attr) { /* * a bit of a kludge here, clear out the value (for unset) * the at_size is the larger of the union that does not have * additional allocated space, so we use it here */ attr->at_val.at_size.atsv_num = 0; attr->at_val.at_size.atsv_shift = 0; attr->at_val.at_size.atsv_units = 0; attr->at_flags &= ~ATR_VFLAG_SET; return; } /* END free_null() */ /* * free_noop - A free routine for attrs that are too important * to be unset. */ void free_noop( struct attribute *attr) { /* no nothing */ return; } /* END free_noop() */ /* * comp_null - A do nothing, except return 0, attribute comparison * function. */ int comp_null( struct attribute *attr, /* I */ struct attribute *with) /* I */ { /* SUCCESS */ return(0); } /* * attrlist_alloc - allocate space for an svrattrl structure entry * * The space required for the entry is calculated and allocated. * The total size and three string lengths are set in the entry, * but no values are placed in it. * * Return: ptr to entry or NULL if error */ svrattrl *attrlist_alloc( int szname, /* I */ int szresc, /* I */ int szval) /* I */ { register size_t tsize; svrattrl *pal; /* alloc memory block */ tsize = sizeof(svrattrl) + szname + szresc + szval; pal = (svrattrl *)calloc(1, tsize); if (pal == NULL) { return(NULL); } CLEAR_LINK(pal->al_link); /* clear link */ pal->al_atopl.next = 0; pal->al_tsize = tsize; /* set various string sizes */ pal->al_nameln = szname; pal->al_rescln = szresc; pal->al_valln = szval; pal->al_flags = 0; pal->al_op = SET; /* point ptrs to name, resc, and val strings to memory after svrattrl struct */ pal->al_name = (char *)pal + sizeof(svrattrl); if (szresc > 0) pal->al_resc = pal->al_name + szname; else pal->al_resc = NULL; pal->al_value = pal->al_name + szname + szresc; return(pal); } /* END attrlist_alloc() */ /* * attrlist_create - create an svrattrl structure entry * * The space required for the entry is calculated and allocated. * The attribute and resource name is copied into the entry. * Note, the value string should be inserted by the caller after this returns. * * Return: ptr to entry or NULL if error */ svrattrl *attrlist_create( char *aname, /* I - attribute name */ char *rname, /* I - resource name if needed or null */ int vsize) /* I - size of resource value */ { svrattrl *pal; size_t asz; size_t rsz; asz = strlen(aname) + 1; /* attribute name,allow for null term */ if (rname == NULL) /* resource name only if type resource */ rsz = 0; else rsz = strlen(rname) + 1; pal = attrlist_alloc(asz, rsz, vsize); strcpy(pal->al_name, aname); /* copy name right after struct */ if (rsz > 0) strcpy(pal->al_resc, rname); return(pal); } /* * free_attrlist - free the space allocated to a list of svrattrl * structures */ void free_attrlist(tlist_head *pattrlisthead) { svrattrl *pal; svrattrl *nxpal; if (pattrlisthead == NULL) { return; } if (pattrlisthead->ll_next == NULL) { return; } pal = (svrattrl *)GET_NEXT(*pattrlisthead); while (pal != (svrattrl *)0) { nxpal = (struct svrattrl *)GET_NEXT(pal->al_link); delete_link(&pal->al_link); (void)free(pal); pal = nxpal; } } #if 0 /* This code is not used, but is too good to delete */ /* * parse_equal_string - parse a string of the form: * name1 = value1[, value2 ...][, name2 = value3 [, value4 ...]] * into * * * On the first call, * *name will point to "name1" * *value will point to "value1 ..." upto but not * including the comma before "name2". * On a second call, with start = (char *)0, * *name will point to "name2" * *value will point t0 "value3 ..." * Arguments: * start is the start of the string to parse. If called again with * start being a null pointer, it will resume parsing where it stoped * on the prior call. * * Returns: * integer function return = 1 if name and value are found, * 0 if nothing (more) is parsed (null input) * -1 if a syntax error was detected. * *name is set to point to the name string * *value is set to point to the value string * each string is null terminated. */ int parse_equal_string(char *start, char **name, char **value) { static char *pc; /* where prior call left off */ char *backup; int quoting = 0; if (start != (char *)0) pc = start; if (*pc == '\0') { *name = (char *)0; return (0); /* already at end, return no strings */ } /* strip leading spaces */ while (isspace((int)*pc) && *pc) pc++; if (*pc == '\0') { *name = (char *)0; /* null name */ return (0); } else if ((*pc == '=') || (*pc == ',')) return (-1); /* no name, return error */ *name = pc; /* have found start of name, look for end of it */ while (!isspace((int)*pc) && (*pc != '=') && *pc) pc++; /* now look for =, while stripping blanks between end of name and = */ while (isspace((int)*pc) && *pc) *pc++ = '\0'; if (*pc != '=') return (-1); /* should have found a = as first non blank */ *pc++ = '\0'; /* that follows is the value string, skip leading white space */ while (isspace((int)*pc) && *pc) pc++; /* is the value string to be quoted ? */ if ((*pc == '"') || (*pc == '\'')) quoting = (int) * pc++; *value = pc; /* * now go to first equal sign, or if quoted, the first equal sign * after the close quote */ if (quoting) { while ((*pc != (char)quoting) && *pc) /* look for matching */ pc++; if (*pc) *pc = ' '; /* change close quote to space */ else return (-1); } while ((*pc != '=') && *pc) pc++; if (*pc == '\0') return (1); /* no equal, just end of line, stop here */ /* back up to the first comma found prior to the equal sign */ while (*--pc != ',') if (pc <= *value) /* gone back too far, no comma, error */ return (-1); backup = pc++; *backup = '\0'; /* null the comma */ /* strip off any trailing white space */ while (isspace((int)*--backup)) *backup = '\0'; return (1); } #endif /* * parse_comma_string() - parse a string of the form: * value1 [, value2 ...] * * On the first call, start is non null, a pointer to the first value * element upto a comma, new-line, or end of string is returned. * Commas escaped by a back-slash '\' are ignored. * * On any following calls with start set to a null pointer (char *)0, * the next value element is returned... * * A null pointer is returned when there are no (more) value elements. */ char *parse_comma_string( char *start) /* I (optional) */ { static char *pc; /* if start is null, restart from here */ char *back; char *rv; if (start != NULL) pc = start; if (*pc == '\0') { return(NULL); /* already at end, no strings */ } /* skip over leading white space */ while ((*pc != '\n') && isspace((int)*pc) && *pc) pc++; rv = pc; /* the start point which will be returned */ /* go find comma or end of line */ while (*pc) { if (*pc == '\\') { if (*++pc == '\0') break; } else if ((*pc == ',') || (*pc == '\n')) { break; } ++pc; } back = pc; while (isspace((int)*--back)) /* strip trailing spaces */ *back = '\0'; if (*pc != '\0') *pc++ = '\0'; /* if not end, terminate this and adv past */ return(rv); } /* END parse_comma_string() */ /* * count_substrings * counts number of substrings in a comma separated string * see parse_comma_string */ int count_substrings( char *val, /*comma separated string of substrings*/ int *pcnt /*where to return the value*/ ) { int rc = 0; int ns; char *pc; if (val == (char *)0) return (PBSE_INTERNAL); /* * determine number of substrings, each sub string is terminated * by a non-escaped comma or a new-line, the whole string is terminated * by a null */ ns = 1; for (pc = val; *pc; pc++) { if (*pc == '\\') { if (*++pc == '\0') break; } else if ((*pc == ',') || (*pc == '\n')) { ++ns; } } pc--; if ((*pc == '\n') || ((*pc == ',') && (*(pc - 1) != '\\'))) { ns--; /* strip any trailing null string */ *pc = '\0'; } *pcnt = ns; return rc; } /* * attrl_fixlink - fix up the next pointer within the attropl substructure * within a svrattrl list. */ void attrl_fixlink( tlist_head *phead /* pointer to head of svrattrl list */ ) { svrattrl *pal; svrattrl *pnxt; pal = (svrattrl *)GET_NEXT(*phead); while (pal) { pnxt = (svrattrl *)GET_NEXT(pal->al_link); if (pal->al_flags & ATR_VFLAG_DEFLT) { pal->al_atopl.op = DFLT; } else { pal->al_atopl.op = SET; } if (pnxt) pal->al_atopl.next = &pnxt->al_atopl; else pal->al_atopl.next = (struct attropl *)0; pal = pnxt; } } torque-2.4.16/src/lib/Libattr/strToL.c0000664000113300011330000001315511272401245014370 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include "Long.h" #include "Long_.h" #undef strToL #undef strTouL u_Long strTouL A_((const char *nptr, char **endptr, int base)); /* * strToL - returns the Long value representing the string whose first * character is *nptr, when interpreted as an integer in base, base. * * If base is zero, the base of the integer is determined by the way the * string starts. The string is interpreted as decimal if the first * character after leading white space and an optional sign is a digit * between 1 and 9, inclusive. The string is interpreted as octal if the * first character after leading white space and an optional sign is the * digit "0" and the next character is not an "X" (either upper or lower * case). The string is interpreted as hexidecimal if the first character * after leading white space and an optional sign is the digit "0", * followed by an "X" (either upper or lower case). * * If base is greater than 1 and less than the number of characters in the * Long_dig array, it represents the base in which the number will be * interpreted. Characters for digits beyond 9 are represented by the * letters of the alphabet, either upper case or lower case. */ Long strToL(nptr, endptr, base) const char *nptr; char **endptr; int base; { Long value; value = (Long)strTouL(nptr, endptr, base); if (Long_neg) { if (value >= 0) { value = lONG_MIN; errno = ERANGE; } } else if (value < 0) { value = lONG_MAX; errno = ERANGE; } return (value); } torque-2.4.16/src/lib/Libattr/attr_fn_arst.c0000664000113300011330000005420011455674147015643 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains general function for attributes of type * array of (pointers to) strings * * Each set has functions for: * Decoding the value string to the machine representation. * Encoding the internal representation of the attribute to external * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * Freeing the space malloc-ed to the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * ---------------------------------------------------------------------------- * Attribute functions for attributes with value type "array of strings". * * The "encoded" or external form of the value is a string with the orginial * strings separated by commas (or new-lines) and terminated by a null. * Any embedded commas or black-slashes must be escaped by a prefixed back- * slash. * * The "decoded" form is a set of strings pointed to by an array_strings struct * ---------------------------------------------------------------------------- */ /** * Parse string and convert to attribute array. * * @return 0 on SUCCESS, PBSE_* on FAILURE */ int decode_arst_direct( struct attribute *patr, /* I (modified) */ char *val) /* I */ { unsigned long bksize; int j; int ns; char *pbuf; char *pc; char *pstr; size_t ssize; char *tmpval; struct array_strings *stp; /* * determine number of sub strings, each sub string is terminated * by a non-escaped comma or a new-line, the whole string is terminated * by a null */ ns = 1; ssize = strlen(val) + 1; if ((tmpval = malloc((unsigned)ssize)) == NULL) { /* FAILURE */ return(PBSE_SYSTEM); } strcpy(tmpval,val); for (pc = tmpval;*pc;pc++) { if (*pc == '\\') { if (*++pc == '\0') break; } else if ((*pc == ',') || (*pc == '\n')) { ++ns; } } pc--; if (((*pc == '\n') || (*pc == ',')) && (*(pc - 1) != '\\')) { ns--; /* strip any trailing null string */ *pc = '\0'; ssize--; } if ((pbuf = malloc((unsigned)ssize)) == NULL) { /* FAILURE */ return(PBSE_SYSTEM); } bksize = (ns - 1) * sizeof(char *) + sizeof(struct array_strings); if ((stp = (struct array_strings *)malloc(bksize)) == NULL) { /* FAILURE */ return(PBSE_SYSTEM); } stp->as_npointers = ns; /* number of slots (sub strings) */ /* for the strings themselves */ stp->as_buf = pbuf; stp->as_next = pbuf; stp->as_bufsize = (unsigned int)ssize; /* now copy in substrings and set pointers */ pc = pbuf; j = 0; pstr = parse_comma_string(tmpval); while ((pstr != NULL) && (j < ns)) { stp->as_string[j] = pc; while (*pstr) { if (*pstr == '\\') if (*++pstr == '\0') break; *pc++ = *pstr++; } *pc++ = '\0'; j++; pstr = parse_comma_string(NULL); } /* END while ((pstr != NULL) && (j < ns)) */ stp->as_usedptr = j; stp->as_next = pc; patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; patr->at_val.at_arst = stp; free(tmpval); /* SUCCESS */ return(0); } /* END decode_arst_direct() */ /* * decode_arst - decode a comma string into an attr of type ATR_TYPE_ARST * * @see decode_arst_direct() - child * @see set_arst() - child * * Returns: 0 if ok, * >0 error number1 if error, * *patr members set */ int decode_arst( struct attribute *patr, /* O (modified) */ char *name, /* I attribute name (notused) */ char *rescn, /* I resource name (notused) */ char *val) /* I attribute value */ { int rc; attribute temp; if ((val == NULL) || (strlen(val) == 0)) { free_arst(patr); patr->at_flags &= ~ATR_VFLAG_MODIFY; /* _SET cleared in free_arst */ return(0); } if ((patr->at_flags & ATR_VFLAG_SET) && (patr->at_val.at_arst)) { /* already have values, decode new into temp */ /* then use set(incr) to add new to existing */ temp.at_val.at_arst = NULL; /* convert value string into attribute array */ if ((rc = decode_arst_direct(&temp,val)) != 0) { /* FAILURE */ return(rc); } rc = set_arst(patr,&temp,INCR); free_arst(&temp); return(rc); } /* decode directly into real attribute */ return(decode_arst_direct(patr,val)); } /* END decode_arst() */ /* * decode_arst_merge - decode a comma string into an attr of type ATR_TYPE_ARST * * @see decode_arst_direct() - child * @see set_arst() - child * * Returns: 0 if ok, * >0 error number1 if error, * *patr members set */ int decode_arst_merge( struct attribute *patr, /* O (modified) */ char *name, /* I attribute name (notused) */ char *rescn, /* I resource name (notused) */ char *val) /* I attribute value */ { int rc; attribute new; attribute tmp; if ((val == NULL) || (strlen(val) == 0)) { free_arst(patr); patr->at_flags &= ~ATR_VFLAG_MODIFY; /* _SET cleared in free_arst */ return(0); } if (!(patr->at_flags & ATR_VFLAG_SET) || (patr->at_val.at_arst == NULL)) { /* decode directly into real attribute */ return(decode_arst_direct(patr,val)); } memset(&new,0x0,sizeof(attribute)); memset(&tmp,0x0,sizeof(attribute)); /* already have values, decode new into temp */ /* then use set(incr) to add new to existing */ /* convert value string into attribute array */ if ((rc = decode_arst_direct(&new,val)) != 0) { /* FAILURE */ return(rc); } /* copy patr to temp, and new to patr */ tmp.at_val.at_arst = patr->at_val.at_arst; patr->at_val.at_arst = new.at_val.at_arst; /* incr original patr value onto new patr */ tmp.at_flags |= ATR_VFLAG_SET; rc = set_arst(patr,&tmp,MERGE); free_arst(&tmp); return(rc); } /* END decode_arst_merge() */ /* * encode_arst - encode attr of type ATR_TYPE_ARST into attrlist entry * * Mode ATR_ENCODE_CLIENT - encode strings into single super string * separated by ',' * * Mode ATR_ENCODE_SVR - treated as above * * Mode ATR_ENCODE_MOM - treated as above * * Mode ATR_ENCODE_SAVE - encode strings into single super string * separated by '\n' * * Returns: >0 if ok, entry created and linked into list * =0 no value to encode, entry not created * -1 if error */ /*ARGSUSED*/ int encode_arst( attribute *attr, /* I ptr to attribute to encode */ tlist_head *phead, /* O ptr to head of attrlist list */ char *atname, /* I attribute name */ char *rsname, /* I resource name or NULL (optional) */ int mode) /* I encode mode */ { char *end; int i; int j; svrattrl *pal; char *pc; char *pfrom; char separator; if (attr == NULL) { /* FAILURE - invalid parameters */ return(-2); } if (((attr->at_flags & ATR_VFLAG_SET) == 0) || !attr->at_val.at_arst || !attr->at_val.at_arst->as_usedptr) { /* SUCCESS - empty list */ return(0); /* no values */ } i = (int)(attr->at_val.at_arst->as_next - attr->at_val.at_arst->as_buf); if (mode == ATR_ENCODE_SAVE) { separator = '\n'; /* new-line for encode_acl */ /* allow one extra byte for final new-line */ j = i + 1; } else { separator = ','; /* normally a comma is the separator */ j = i; } /* how many back-slashes are required */ for (pc = attr->at_val.at_arst->as_buf;pc < attr->at_val.at_arst->as_next;++pc) { if ((*pc == '"') || (*pc == '\'') || (*pc == ',') || (*pc == '\\') || (*pc == '\n')) ++j; } pal = attrlist_create(atname, rsname, j); if (pal == NULL) { return(-1); } pal->al_flags = attr->at_flags; pc = pal->al_value; pfrom = attr->at_val.at_arst->as_buf; /* replace nulls between sub-strings with separater characters */ /* escape any embedded special character */ end = attr->at_val.at_arst->as_next; while (pfrom < end) { if ((*pfrom == '"') || (*pfrom == '\'') || (*pfrom == ',') || (*pfrom == '\\') || (*pfrom == '\n')) { *pc++ = '\\'; *pc = *pfrom; } else if (*pfrom == '\0') { *pc = separator; } else { *pc = *pfrom; } pc++; pfrom++; } /* convert the last null to separator only if going to new-lines */ if (mode == ATR_ENCODE_SAVE) *pc = '\0'; /* insure string terminator */ else *(pc - 1) = '\0'; append_link(phead, &pal->al_link, pal); return(1); } /* END encode_arst() */ /* * set_arst - set value of attribute of type ATR_TYPE_ARST to another * * A=B --> set of strings in A replaced by set of strings in B * A+B --> set of strings in B appended to set of strings in A * A-B --> any string in B found is A is removed from A * * Returns: 0 if ok * >0 if error */ int set_arst( struct attribute *attr, /* I/O */ struct attribute *new, /* I */ enum batch_op op) /* I */ { int i; int j; int nsize; int need; long offset; char *pc; long used; struct array_strings *newpas; struct array_strings *pas; struct array_strings *tmp_arst = NULL; assert(attr && new && (new->at_flags & ATR_VFLAG_SET)); pas = attr->at_val.at_arst; newpas = new->at_val.at_arst; if (newpas == NULL) { return(PBSE_INTERNAL); } if (pas == NULL) { /* not array_strings control structure, make one */ j = newpas->as_npointers; if (j < 1) { return(PBSE_INTERNAL); } need = (int)sizeof(struct array_strings) + (j - 1) * sizeof(char *); pas = (struct array_strings *)malloc((size_t)need); if (pas == NULL) { return(PBSE_SYSTEM); } pas->as_npointers = j; pas->as_usedptr = 0; pas->as_bufsize = 0; pas->as_buf = NULL; pas->as_next = NULL; attr->at_val.at_arst = pas; } /* END if (pas == NULL) */ if ((op == INCR) && !pas->as_buf) op = SET; /* no current strings, change op to SET */ /* * At this point we know we have a array_strings struct initialized */ switch (op) { case SET: /* * Replace old array of strings with new array, this is * simply done by deleting old strings and appending the * new (to the null set). */ for (i = 0;i < pas->as_usedptr;i++) pas->as_string[i] = NULL; /* clear all pointers */ pas->as_usedptr = 0; pas->as_next = pas->as_buf; if (new->at_val.at_arst == (struct array_strings *)0) break; /* none to set */ nsize = newpas->as_next - newpas->as_buf; /* space needed */ if (nsize > pas->as_bufsize) { /* new data won't fit */ if (pas->as_buf) free(pas->as_buf); nsize += nsize / 2; /* alloc extra space */ if (!(pas->as_buf = malloc((size_t)nsize))) { pas->as_bufsize = 0; return(PBSE_SYSTEM); } pas->as_bufsize = nsize; } else { /* str fits, clear buf */ memset(pas->as_buf,0,pas->as_bufsize); } pas->as_next = pas->as_buf; /* no break, "SET" falls into "INCR" to add strings */ case MERGE: nsize = newpas->as_next - newpas->as_buf; /* space needed */ used = pas->as_next - pas->as_buf; if (nsize > (pas->as_bufsize - used)) { need = pas->as_bufsize + 2 * nsize; /* alloc new buf */ if (pas->as_buf) pc = realloc(pas->as_buf, (size_t)need); else pc = malloc((size_t)need); if (pc == NULL) { return(PBSE_SYSTEM); } offset = pc - pas->as_buf; pas->as_buf = pc; pas->as_next = pc + used; pas->as_bufsize = need; for (j = 0;j < pas->as_usedptr;j++) /* adjust points */ pas->as_string[j] += offset; } /* END if (nsize > (pas->as_bufsize - used)) */ j = pas->as_usedptr + newpas->as_usedptr; if (j > pas->as_npointers) { struct array_strings *tmpPas; /* need more pointers */ j = 3 * j / 2; /* allocate extra */ need = (int)sizeof(struct array_strings) + (j - 1) * sizeof(char *); tmpPas = (struct array_strings *)realloc((char *)pas,(size_t)need); if (tmpPas == NULL) { return(PBSE_SYSTEM); } tmpPas->as_npointers = j; pas = tmpPas; attr->at_val.at_arst = pas; } /* END if (j > pas->as_npointers) */ /* now append new strings */ for (i = 0;i < newpas->as_usedptr;i++) { char *tail; int len; int MatchFound; /* boolean */ if ((op == MERGE) && (tail = strchr(newpas->as_string[i],'='))) { len = tail - newpas->as_string[i]; MatchFound = 0; for (j = 0;j < pas->as_usedptr;j++) { if (!strncmp(pas->as_string[j],newpas->as_string[i],len)) { MatchFound = 1; break; } } if (MatchFound == 1) continue; } strcpy(pas->as_next,newpas->as_string[i]); pas->as_string[pas->as_usedptr++] = pas->as_next; pas->as_next += strlen(pas->as_next) + 1; } /* END for (i) */ break; case INCR: j = 1.5 * (pas->as_usedptr + newpas->as_usedptr); /* malloc the tmp array strings */ need = sizeof(struct array_strings) + (j-1) * sizeof(char *); tmp_arst = (struct array_strings *)malloc(need); if (tmp_arst == NULL) return(PBSE_SYSTEM); memset(tmp_arst,0,need); nsize = newpas->as_next - newpas->as_buf; /* space needed */ used = pas->as_next - pas->as_buf; need = 2 * (nsize + used); tmp_arst->as_bufsize = need; /* malloc the buffer size */ pc = malloc(need); if (pc == NULL) return(PBSE_SYSTEM); tmp_arst->as_buf = pc; tmp_arst->as_next = pc; tmp_arst->as_npointers = j; /* now that everything is allocated, copy the strings into the new * array_strings struct */ /* first, copy the new */ for (i = 0; i < newpas->as_usedptr; i++) { strcpy(tmp_arst->as_next,newpas->as_string[i]); tmp_arst->as_string[tmp_arst->as_usedptr++] = tmp_arst->as_next; tmp_arst->as_next += strlen(tmp_arst->as_next) + 1; } /* second, copy the old if not already there */ for (i = 0; i < pas->as_usedptr; i++) { char *tail; int len; int MatchFound = 0; /* boolean */ if ((tail = strchr(pas->as_string[i],'='))) { len = tail - pas->as_string[i]; for (j = 0;j < newpas->as_usedptr;j++) { if (!strncmp(pas->as_string[i],newpas->as_string[j],len)) { MatchFound = 1; break; } } } if (MatchFound == 0) { strcpy(tmp_arst->as_next,pas->as_string[i]); tmp_arst->as_string[tmp_arst->as_usedptr++] = tmp_arst->as_next; tmp_arst->as_next += strlen(tmp_arst->as_next) + 1; } } /* free the old pas */ free_arst(attr); attr->at_val.at_arst = tmp_arst; break; case DECR: /* decrement (remove) string from array */ for (j = 0;j < newpas->as_usedptr;j++) { for (i = 0;i < pas->as_usedptr;i++) { if (!strcmp(pas->as_string[i], newpas->as_string[j])) { /* compact buffer */ nsize = strlen(pas->as_string[i]) + 1; pc = pas->as_string[i] + nsize; need = pas->as_next - pc; memcpy(pas->as_string[i], pc, (size_t)need); pas->as_next -= nsize; /* compact pointers */ for (++i;i < pas->as_npointers;i++) pas->as_string[i - 1] = pas->as_string[i] - nsize; pas->as_string[i - 1] = NULL; pas->as_usedptr--; break; } } } break; default: return(PBSE_INTERNAL); /*NOTREACHED*/ break; } /* END switch(op) */ attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return(0); } /* END set_arst() */ /* * comp_arst - compare two attributes of type ATR_TYPE_ARST * * Returns: 0 if the set of strings in the two attributes match * +1 otherwise */ int comp_arst( struct attribute *attr, struct attribute *with) { int i; int j; struct array_strings *apa; struct array_strings *bpb; if (!attr || !with || !attr->at_val.at_arst || !with->at_val.at_arst) { return(1); } if ((attr->at_type != ATR_TYPE_ARST) || (with->at_type != ATR_TYPE_ARST)) { return(1); } apa = attr->at_val.at_arst; bpb = with->at_val.at_arst; for (j = 0;j < bpb->as_usedptr;j++) { for (i = 0;i < apa->as_usedptr;i++) { if (strcmp(bpb->as_string[j], apa->as_string[i])) { return(1); } } } return(0); /* all match */ } void free_arst( struct attribute *attr) { if ((attr->at_flags & ATR_VFLAG_SET) && (attr->at_val.at_arst)) { if (attr->at_val.at_arst->as_buf) (void)free(attr->at_val.at_arst->as_buf); (void)free((char *)attr->at_val.at_arst); } attr->at_val.at_arst = (struct array_strings *)0; attr->at_flags &= ~ATR_VFLAG_SET; return; } /* END free_arst() */ /* * arst_string - see if a string occurs as a prefix in an arst attribute entry * Search each entry in the value of an arst attribute for a sub-string * that begins with the passed string * * Return: pointer to string if so, NULL if not */ char *arst_string( char *str, attribute *pattr) { int i; size_t len; struct array_strings *parst; if ((str == NULL) || (pattr == NULL)) { return(NULL); } if ((pattr->at_type != ATR_TYPE_ARST) || !(pattr->at_flags & ATR_VFLAG_SET)) { /* bad type or value not set */ return(NULL); } len = strlen(str); parst = pattr->at_val.at_arst; for (i = 0;i < parst->as_usedptr;i++) { if (!strncmp(str, parst->as_string[i], len)) { return(parst->as_string[i]); } } /* END for (i) */ return(NULL); } /* END arst_string() */ torque-2.4.16/src/lib/Libattr/attr_fn_b.c0000664000113300011330000002137411272401245015101 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type * boolean * * Each set has functions for: * Decoding the value string to the machine representation. * Encoding the machine representation of the value to a string * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * Freeing the space malloc-ed to the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * ------------------------------------------------------- * Set of General functions for attributes of type boolean * ------------------------------------------------------- */ static char true_val[] = ATR_TRUE; static char false_val[] = ATR_FALSE; /* * decode_b - decode string into boolean attribute * * String of "1" decodes to true, all else to false * Returns: 0 if ok * >0 error number if error * *patr elements set */ int decode_b( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val /* attribute value */ ) { char *pc; if ((val == (char *)0) || (strlen(val) == 0)) { patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; patr->at_val.at_long = 0; /* default to false */ } else { for (pc = val; *pc; pc++) *pc = (char)toupper((int) * pc); if ((strcmp(val, true_val) == 0) || (strcmp(val, "TRUE") == 0) || (strcmp(val, "true") == 0) || (strcmp(val, "t") == 0) || (strcmp(val, "T") == 0) || (strcmp(val, "1") == 0) || (strcmp(val, "y") == 0) || (strcmp(val, "Y") == 0)) patr->at_val.at_long = 1; /* true */ else if ((strcmp(val, false_val) == 0) || (strcmp(val, "FALSE") == 0) || (strcmp(val, "false") == 0) || (strcmp(val, "f") == 0) || (strcmp(val, "F") == 0) || (strcmp(val, "0") == 0) || (strcmp(val, "n") == 0) || (strcmp(val, "N") == 0)) patr->at_val.at_long = 0; /* false */ else return (PBSE_BADATVAL); patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; } return (0); } /* * encode_b - encode attribute of type ATR_TYPE_LONG to attr_extern * * Returns: >0 size of data returned to buffer * =0 if not value, no link added * <0 if error */ /*ARGSUSED*/ int encode_b( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attribute list */ char *atname, /* attribute name */ char *rsname, /* resource name or null */ int mode /* encode mode, unused here */ ) { size_t ct; svrattrl *pal; char *value; if (!attr) return (-1); if (!(attr->at_flags & ATR_VFLAG_SET)) return (0); if (attr->at_val.at_long) { value = true_val; } else { value = false_val; } ct = strlen(value) + 1; pal = attrlist_create(atname, rsname, ct); if (pal == (svrattrl *)0) return (-1); strcpy(pal->al_value, value); pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); return (1); } /* * set_b - set attribute of type ATR_TYPE_LONG * * A=B --> A set to value of B * A+B --> A = A | B (inclusive or, turn on) * A-B --> A = A & ~B (and not, clear) * * Returns: 0 if ok * >0 if error */ int set_b(struct attribute *attr, struct attribute *new, enum batch_op op) { assert(attr && new && (new->at_flags & ATR_VFLAG_SET)); switch (op) { case SET: attr->at_val.at_long = new->at_val.at_long; break; case INCR: attr->at_val.at_long = attr->at_val.at_long | new->at_val.at_long; /* "or" */ break; case DECR: attr->at_val.at_long = attr->at_val.at_long & ~new->at_val.at_long; break; default: return (PBSE_INTERNAL); } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return (0); } /* * comp_b - compare two attributes of type ATR_TYPE_LONG * * Returns: 0 if same value * +1 if different value */ int comp_b(struct attribute *attr, struct attribute *with) { if (!attr || !with) return (1); if (((attr->at_val.at_long == 0) && (with->at_val.at_long == 0)) || ((attr->at_val.at_long != 0) && (with->at_val.at_long != 0))) return (0); else return (1); } /* * free_b - use free_null() to (not) free space */ torque-2.4.16/src/lib/Libattr/attr_fn_str.c0000664000113300011330000002400311272401245015460 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "pbs_error.h" /* * This file contains functions for manipulating attributes of type string * * Then there are a set of functions for each type of attribute: * string * * Each set has functions for: * Decoding the value string to the internal representation. * Encoding the internal attribute form to external form * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * * Some or all of the functions for an attribute type may be shared with * other attribute types. * * The prototypes are declared in "attribute.h" * * ------------------------------------------------- * Set of general attribute functions for attributes * with value type "string" * ------------------------------------------------- */ /* * decode_str - decode string into string attribute * * Returns: 0 if 0k * >0 error number if error * *patr members set */ int decode_str( struct attribute *patr, /* (I modified, allocated ) */ char *name, /* (I - optional) attribute name */ char *rescn, /* resource name - unused here */ char *val) /* attribute value */ { size_t len; if ((patr->at_flags & ATR_VFLAG_SET) && (patr->at_val.at_str != NULL)) { free(patr->at_val.at_str); patr->at_val.at_str = NULL; } if ((val != NULL) && ((len = strlen(val) + 1) > 1)) { patr->at_val.at_str = malloc((unsigned)len); if (patr->at_val.at_str == NULL) { /* FAILURE - cannot allocate memory */ return(PBSE_SYSTEM); } strcpy(patr->at_val.at_str, val); patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; } else { /* string is empty */ patr->at_flags = (patr->at_flags & ~ATR_VFLAG_SET) | ATR_VFLAG_MODIFY; patr->at_val.at_str = NULL; } /* SUCCESS */ return(0); } /* END decode_str() */ /* * encode_str - encode attribute of type ATR_TYPE_STR into attr_extern * * Returns: >0 if ok * =0 if no value, so no link added to list * <0 if error */ /*ARGSUSED*/ int encode_str( attribute *attr, /* ptr to attribute */ tlist_head *phead, /* head of attrlist */ char *atname, /* name of attribute */ char *rsname, /* resource name or null */ int mode) /* encode mode, unused here */ { svrattrl *pal; if (attr == NULL) { return(-1); } if (!(attr->at_flags & ATR_VFLAG_SET) || !attr->at_val.at_str || (*attr->at_val.at_str == '\0')) { return(0); } pal = attrlist_create(atname, rsname, (int)strlen(attr->at_val.at_str) + 1); if (pal == NULL) { return(-1); } strcpy(pal->al_value, attr->at_val.at_str); pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); return(1); } /* * set_str - set attribute value based upon another * * A+B --> B is concatenated to end of A * A=B --> A is replaced with B * A-B --> If B is a substring at the end of A, it is stripped off * * Returns: 0 if ok * >0 if error */ int set_str(struct attribute *attr, struct attribute *new, enum batch_op op) { char *new_value; char *p; size_t nsize; assert(attr && new && new->at_val.at_str && (new->at_flags & ATR_VFLAG_SET)); nsize = strlen(new->at_val.at_str) + 1; /* length of new string */ if ((op == INCR) && !attr->at_val.at_str) op = SET; /* no current string, change INCR to SET */ switch (op) { case SET: /* set is replace old string with new */ if (attr->at_val.at_str) (void)free(attr->at_val.at_str); if ((attr->at_val.at_str = malloc(nsize)) == (char *)0) return (PBSE_SYSTEM); (void)strcpy(attr->at_val.at_str, new->at_val.at_str); break; case INCR: /* INCR is concatenate new to old string */ nsize += strlen(attr->at_val.at_str); if (attr->at_val.at_str) new_value = realloc(attr->at_val.at_str, nsize); else new_value = malloc(nsize); if (new_value == (char *)0) return (PBSE_SYSTEM); attr->at_val.at_str = new_value; (void)strcat(attr->at_val.at_str, new->at_val.at_str); break; case DECR: /* DECR is remove substring if match, start at end */ if (!attr->at_val.at_str) break; if (--nsize == 0) break; p = attr->at_val.at_str + strlen(attr->at_val.at_str) - nsize; while (p >= attr->at_val.at_str) { if (strncmp(p, new->at_val.at_str, (int)nsize) == 0) { do { *p = *(p + nsize); } while (*p++); } p--; } break; default: return (PBSE_INTERNAL); } if ((attr->at_val.at_str != (char *)0) && (*attr->at_val.at_str != '\0')) attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; else attr->at_flags &= ~ATR_VFLAG_SET; return (0); } /* * comp_str - compare two attributes of type ATR_TYPE_STR * * Returns: see strcmp(3) */ int comp_str(struct attribute *attr, struct attribute *with) { if (!attr || !attr->at_val.at_str) return (-1); return (strcmp(attr->at_val.at_str, with->at_val.at_str)); } /* * free_str - free space malloc-ed for string attribute value */ void free_str( struct attribute *attr) { if ((attr->at_flags & ATR_VFLAG_SET) && (attr->at_val.at_str != NULL)) { free(attr->at_val.at_str); } attr->at_val.at_str = NULL; attr->at_flags &= ~ATR_VFLAG_SET; return; } /* END free_str() */ /* * replace_attr_string - replace string attribute value */ void replace_attr_string( struct attribute *attr, char *newval) { free_str(attr); attr->at_val.at_str = newval; attr->at_flags |= ATR_VFLAG_SET; return; } /* END replace_job_attr_string() */ /* END attr_fn_str.c */ /* END attr_fn_str.c */ torque-2.4.16/src/lib/Libattr/uLTostr.c0000664000113300011330000001225711272401245014557 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include "Long.h" #include "Long_.h" #define LBUFSIZ (CHAR_BIT * sizeof(u_Long) + 2) static char buffer[LBUFSIZ]; /* * uLTostr - returns a pointer to the character string representation of the * u_Long, value, represented in base, base. * * If base is outside its domain of 2 through the number of characters in * the Long_dig array, uLTostr returns a zero-length string and sets errno * to EDOM. * * The string is stored in a static array and will be clobbered the next * time either LTostr or uLTostr is called. The price of eliminating the * possibility of memory leaks is the necessity to copy the string * immediately to a safe place if it must last. */ const char *uLTostr( u_Long value, int base) { char *bp = &buffer[LBUFSIZ]; *--bp = '\0'; if (base < 2 || base > (int)strlen(Long_dig)) { errno = EDOM; return(bp); } do { *--bp = Long_dig[value % base]; value /= base; } while (value); switch (base) { case 16: *--bp = 'x'; case 8: *--bp = '0'; } return(bp); } torque-2.4.16/src/lib/Libattr/Makefile.am0000664000113300011330000000065311272401245015030 00000000000000include $(top_srcdir)/buildutils/config.mk noinst_LIBRARIES = libattr.a libattr_a_SOURCES = attr_atomic.c attr_fn_acl.c attr_fn_arst.c attr_fn_b.c \ attr_fn_c.c attr_fn_hold.c attr_fn_intr.c attr_fn_l.c \ attr_fn_ll.c attr_fn_resc.c attr_fn_size.c \ attr_fn_str.c attr_fn_time.c attr_fn_unkn.c \ attr_func.c attr_node_func.c Long_.c LTostr.c strToL.c \ strTouL.c uLTostr.c attr_fn_tokens.c torque-2.4.16/src/lib/Makefile.in0000664000113300011330000004522511605403740013446 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter SUBDIRS = Libattr Libcmds Libcsv Libdis Libifl Liblog Libnet Libpbs Libsite Libutils all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libcsv/0000777000113300011330000000000011614035166012700 500000000000000torque-2.4.16/src/lib/Libcsv/csv.c0000664000113300011330000000550311272401246013554 00000000000000/* Copyright 2008 Cluster Resources */ /* A small library of functions dealing with comma separated variable strings. * This library is designed to work with small lists of 10 or so items. * It does not scale to larger lists which would require some kind of pointer * array to the list items with the associated parsing and construction of * this structure, etc. */ #include #include /** * Gets the number of items in a string list. * @param csv_str The string list. * @return The number of items in the list. */ int csv_length(char *csv_str) { int length = 0; char *cp; if (!csv_str || *csv_str == 0) return(0); length++; cp = csv_str; while ((cp = strchr(cp, ','))) { cp++; length++; } return(length); } /** * Gets the nth item from a comma seperated list of names. * @param csv_str The string list. * @param n The item number requested (0 is the first item). * @return Null if csv_str is null or empty, * otherwise, a pointer to a local buffer containing the nth item. */ #define NBUFFERS 32 char *csv_nth(char *csv_str, int n) { int i; char *cp; char *tp; static char buffer[NBUFFERS][128]; static int buffer_index; if (!csv_str || *csv_str == 0) return(0); cp = csv_str; for (i = 0; i < n; i++) { if (!(cp = strchr(cp, ','))) { return(0); } cp++; } buffer_index++; if (buffer_index >= NBUFFERS) buffer_index = 0; memset(buffer[buffer_index], 0, sizeof(buffer[buffer_index])); if ((tp = strchr(cp, ','))) { strncpy(buffer[buffer_index], cp, tp - cp); } else { strcpy(buffer[buffer_index], cp); } return(buffer[buffer_index]); } /** * * csv_find_string * * Search a csv list for an entry that matches a specified search string. */ char * csv_find_string(char *csv_str, char *search_str) { int i; int nitems; int search_length = 0; char *cp; if (!search_str) return(NULL); search_length = strlen(search_str); nitems = csv_length(csv_str); for (i = 0; i < nitems; i++) { cp = csv_nth(csv_str, i); if (cp) { while (isspace(*cp)) cp++; if ((int)strlen(cp) >= search_length && !isalpha(cp[search_length]) && !strncmp(cp, search_str, search_length)) { return(cp); } } } return(NULL); } /** * * csv_find_value * * Search a csv list for an entry that matches a specified search string. * Assuming that this is entry of the form "attribute=value", return a * pointer to the start of the value string. */ char * csv_find_value(char *csv_str, char *search_str) { char *cp; char *vp; cp = csv_find_string(csv_str, search_str); if (cp) { if ((vp = strchr(cp, '='))) return(vp + 1); } return(NULL); } torque-2.4.16/src/lib/Libcsv/Makefile.in0000664000113300011330000003271611605403731014671 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libcsv ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libcsv/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libcsv/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all compilation happens in lib/Libpbs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libcsv/Makefile.am0000664000113300011330000000012411272401246014643 00000000000000include $(top_srcdir)/buildutils/config.mk # all compilation happens in lib/Libpbs torque-2.4.16/src/lib/Libsite/0000777000113300011330000000000011614035170013044 500000000000000torque-2.4.16/src/lib/Libsite/site_mom_jst.c0000664000113300011330000001143611272401246015630 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ /* * This is used only in mom and needs PBS_MOM defined in order to * have things from other .h files (such as struct task) be defined. * If UNSUPPORTED_MACH is defined, then we just fake it. */ #ifndef UNSUPPORTED_MACH #define PBS_MOM #endif #include #include #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "pbs_job.h" #ifndef UNSUPPORTED_MACH #include "mom_mach.h" #include "mom_func.h" #endif /* * site_job_setup() - to allow a site to perform site specific actions * once the session has been created and before the job run. * Return non-zero to abort the job. */ int site_job_setup(job *pjob) { return (0); } torque-2.4.16/src/lib/Libsite/site_allow_u.c0000664000113300011330000001125511272401246015621 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #ifdef _AIX #include #include #endif #include /* the master config generated by configure */ #include "portability.h" #include "pbs_error.h" /* * site_allow_u - site allow user access * * This routine determines if a user is privileged to access the batch * system on this host. * * It's implementation is "left as an exercise for the reader." * * Arguments: user - the user's name making the request * host - host from which the user is making the request * * Returns: zero - if user is acceptable * non-zero error number (PBSE_PERM) if not */ int site_allow_u(char *user, char *host) { return 0; } torque-2.4.16/src/lib/Libsite/Makefile.in0000664000113300011330000004466411605403737015055 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libsite_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libsite ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libsite_a_AR = $(AR) $(ARFLAGS) libsite_a_LIBADD = am_libsite_a_OBJECTS = site_allow_u.$(OBJEXT) site_alt_rte.$(OBJEXT) \ site_check_u.$(OBJEXT) site_map_usr.$(OBJEXT) \ site_mom_chu.$(OBJEXT) site_mom_ckp.$(OBJEXT) \ site_mom_jst.$(OBJEXT) libsite_a_OBJECTS = $(am_libsite_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libsite_a_SOURCES) DIST_SOURCES = $(libsite_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/resmom/@PBS_MACH@ IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter noinst_LIBRARIES = libsite.a libsite_a_SOURCES = site_allow_u.c site_alt_rte.c site_check_u.c \ site_map_usr.c site_mom_chu.c site_mom_ckp.c \ site_mom_jst.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libsite/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libsite/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libsite.a: $(libsite_a_OBJECTS) $(libsite_a_DEPENDENCIES) -rm -f libsite.a $(libsite_a_AR) libsite.a $(libsite_a_OBJECTS) $(libsite_a_LIBADD) $(RANLIB) libsite.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_allow_u.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_alt_rte.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_check_u.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_map_usr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_mom_chu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_mom_ckp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/site_mom_jst.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libsite/site_check_u.c0000664000113300011330000002173611272401246015565 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #ifdef _AIX #include #endif /* _AIX */ #include "portability.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "server.h" #include "queue.h" #include "pbs_job.h" #include "log.h" #include "batch_request.h" #include "pbs_nodes.h" #ifndef TRUE #define TRUE 1 #endif /* Global Data Items */ extern char *pbs_o_host; extern char server_host[]; extern char *msg_orighost; /* error message: no PBS_O_HOST */ /* * site_check_u - site_check_user_map() * * This routine determines if a user is privileged to execute a job * on this host under the login name specified (in user-list attribute) * * As provided, this routine uses ruserok(3N). If this is a problem, * It's replacement is "left as an exercise for the reader." * * Return -1 for access denied, otherwise 0 for ok. */ int site_check_user_map( job *pjob, /* I */ char *luser, /* I */ char *EMsg) /* O (optional,minsize=1024) */ { char *orighost; char owner[PBS_MAXUSER + 1]; char *p1; char *p2; int rc; int ProxyAllowed = 0; int ProxyRequested = 0; int HostAllowed = 0; char *dptr; if (EMsg != NULL) EMsg[0] = '\0'; /* get just the owner name, without the "@host" */ p1 = pjob->ji_wattr[JOB_ATR_job_owner].at_val.at_str; p2 = owner; while ((*p1 != '@') && (*p1 != '\0')) *p2++ = *p1++; *p2 = '\0'; orighost = get_variable(pjob, pbs_o_host); if (orighost == NULL) { /* access denied */ log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, msg_orighost); if (EMsg != NULL) strcpy(EMsg, "source host not specified"); return(-1); } if ((server.sv_attr[(int)SRV_ATR_AllowProxyUser].at_flags & ATR_VFLAG_SET) && \ (server.sv_attr[(int)SRV_ATR_AllowProxyUser].at_val.at_long == 1)) { ProxyAllowed = 1; } if (strcmp(owner, luser) != 0) { ProxyRequested = 1; } if (!strcmp(orighost, server_host) && !strcmp(owner, luser)) { /* submitting from server host, access allowed */ if ((ProxyRequested == 0) || (ProxyAllowed == 1)) { return(0); } /* host is fine, must validate proxy via ruserok() */ HostAllowed = 1; } /* make short host name */ if ((dptr = strchr(orighost, '.')) != NULL) { *dptr = '\0'; } if ((HostAllowed == 0) && (server.sv_attr[SRV_ATR_AllowNodeSubmit].at_flags & ATR_VFLAG_SET) && (server.sv_attr[SRV_ATR_AllowNodeSubmit].at_val.at_long == 1) && (find_nodebyname(orighost) != NULL)) { /* job submitted from compute host, access allowed */ if (dptr != NULL) *dptr = '.'; if ((ProxyRequested == 0) || (ProxyAllowed == 1)) { return(0); } /* host is fine, must validate proxy via ruserok() */ HostAllowed = 1; } if ((HostAllowed == 0) && (server.sv_attr[(int)SRV_ATR_SubmitHosts].at_flags & ATR_VFLAG_SET)) { struct array_strings *submithosts = NULL; char *testhost; int hostnum = 0; submithosts = server.sv_attr[(int)SRV_ATR_SubmitHosts].at_val.at_arst; for (hostnum = 0;hostnum < submithosts->as_usedptr;hostnum++) { testhost = submithosts->as_string[hostnum]; if (!strcasecmp(testhost, orighost)) { /* job submitted from host found in trusted submit host list, access allowed */ if (dptr != NULL) *dptr = '.'; if ((ProxyRequested == 0) || (ProxyAllowed == 1)) { return(0); } /* host is fine, must validate proxy via ruserok() */ HostAllowed = 1; break; } } /* END for (hostnum) */ } /* END if (SRV_ATR_SubmitHosts) */ if (dptr != NULL) *dptr = '.'; rc = ruserok(orighost, 0, owner, luser); if (rc != 0 && EMsg != NULL) { /* Test rc so as to not fill this message in the case of success, since other * callers might not fill this message in the case of their errors and * very misleading error message will go into the logs. */ snprintf(EMsg, 1024, "ruserok failed validating %s/%s from %s", owner, luser, orighost); } #ifdef sun /* broken Sun ruserok() sets process so it appears to be owned */ /* by the luser, change it back for cosmetic reasons */ setuid(0); #endif /* sun */ return(rc); } /* END site_check_user_map() */ /* * site_check_u - site_acl_check() * * This routine is a place holder for sites that wish to implement * access controls that differ from the standard PBS user, group, host * access controls. It does NOT replace their functionality. * * Return -1 for access denied, otherwise 0 for ok. */ int site_acl_check( job *pjob, pbs_queue *pque) { return(0); } torque-2.4.16/src/lib/Libsite/site_mom_ckp.c0000664000113300011330000001231411272401246015601 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include /* DEBUG */ /* * site_mom_pchk.c = a site modifible file * * Contains Pre and Post checkpoint stubs for MOM. */ /* * This is used only in mom and needs PBS_MOM defined in order to * have things from other .h files (such as struct task) be defined. * If UNSUPPORTED_MACH is defined, then we just fake it. */ #ifndef UNSUPPORTED_MACH #define PBS_MOM #endif #include #include #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "pbs_job.h" #ifndef UNSUPPORTED_MACH #include "mom_mach.h" #include "mom_func.h" #endif /* * site_mom_postchk() - Post-checkpoint stub for MOM. * Called if checkpoint (on qhold,qterm) suceeded. * * Should return 0 If ok * non-zero If not ok. */ int site_mom_postchk(job *pjob, int hold_type) { return 0; } /* * site_mom_prerst() - Pre-restart stub for MOM. * Called just before restart is performed. * * Should return 0 if ok * JOB_EXEC_FATAL1 for permanent error, abort job * JOB_EXEC_RETRY for temporary problem, requeue job. */ int site_mom_prerst(job *pjob) { return 0; } torque-2.4.16/src/lib/Libsite/site_map_usr.c0000664000113300011330000001156511272401246015631 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * site_map_user - map user name on a named host to user name on this host * * NOTE: for thoses of us who operate in a world of consistant * user names, this routine just returns the original name. * * This routine is "left as an exersize for the reader." * If you don't have consistant names, its up to you to replace * this code with what will work for you. * * The input parameters cannot be modified. If the replacement routine * is to change the user's name, the new value should be kept in a static * character array of size PBS_MAXUSER+1. */ #include /* the master config generated by configure */ #include "pbs_ifl.h" #include "svrfunc.h" #include /* ARGSUSED */ char *site_map_user( char *uname, /* I */ char *host) /* I (pbs_o_host) */ { /* NO-OP */ return(uname); } /* END site_map_usr.c */ torque-2.4.16/src/lib/Libsite/site_alt_rte.c0000664000113300011330000001060311272401246015605 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "portability.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "queue.h" #include "pbs_job.h" int site_alt_router(job *jobp, pbs_queue *qp, long retry_time) { return (default_router(jobp, qp, retry_time)); } torque-2.4.16/src/lib/Libsite/Makefile.am0000664000113300011330000000041711272401246015021 00000000000000include $(top_srcdir)/buildutils/config.mk AM_CPPFLAGS += -I$(top_srcdir)/src/resmom/@PBS_MACH@ noinst_LIBRARIES = libsite.a libsite_a_SOURCES = site_allow_u.c site_alt_rte.c site_check_u.c \ site_map_usr.c site_mom_chu.c site_mom_ckp.c \ site_mom_jst.c torque-2.4.16/src/lib/Libsite/site_mom_chu.c0000664000113300011330000001156011272401246015605 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * site_mom_chu.c = a site modifible file */ #include /* the master config generated by configure */ /* * This is used only in mom and needs PBS_MOM defined in order to * have things from other .h files (such as struct task) be defined. * If UNSUPPORTED_MACH is defined, then we just fake it. */ #ifndef UNSUPPORTED_MACH #define PBS_MOM #endif #include #include #include "portability.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "pbs_job.h" #ifndef UNSUPPORTED_MACH #include "mom_mach.h" #include "mom_func.h" #endif /* * site_mom_chkuser() - for adding validity checking to the user's account * on the execution machine. This is called from start_exec(). * Return non-zero if you wish the job to be aborted. */ int site_mom_chkuser( job *pjob) { return(0); } torque-2.4.16/src/lib/Libnet/0000777000113300011330000000000011614035170012666 500000000000000torque-2.4.16/src/lib/Libnet/get_hostname.c0000664000113300011330000001514511272401247015435 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "portability.h" #include #include #include #include #include /* * get_fullhostname - get the fully qualified name of a host * * Returns: 0 - if success * host name in character buffer pointed to by namebuf * -1 - if error */ /* NOTE: make response lower case */ int get_fullhostname( char *shortname, /* I */ char *namebuf, /* O */ int bufsize, /* I */ char *EMsg) /* O (optional,minsize=1024) */ { char *pbkslh = NULL; char *pcolon = NULL; struct hostent *phe; struct in_addr ina; int index; if ((shortname == NULL) || (shortname[0] == '\0')) { /* FAILURE */ if (EMsg != NULL) strcpy(EMsg, "host name not specified"); return(-1); } if ((pcolon = strchr(shortname, ':')) != NULL) { *pcolon = '\0'; if (*(pcolon - 1) == '\\') { pbkslh = pcolon - 1; *pbkslh = '\0'; } } phe = gethostbyname(shortname); if (pcolon != NULL) { *pcolon = ':'; /* replace the colon */ if (pbkslh) *pbkslh = '\\'; } if (phe == NULL) { /* FAILURE - cannot gethostbyname() */ if (EMsg != NULL) snprintf(EMsg, 1024, "gethostbyname(%s) failed, h_errno=%d", shortname, h_errno); return(-1); } memcpy((char *)&ina, *phe->h_addr_list, phe->h_length); phe = gethostbyaddr((char *) & ina, phe->h_length, phe->h_addrtype); if (phe == NULL) { if (h_errno == HOST_NOT_FOUND) { fprintf(stderr, "Unable to lookup host '%s' by address (check /etc/hosts or DNS reverse name lookup)\n", shortname); } if (EMsg != NULL) snprintf(EMsg, 1024, "gethostbyname(%s) failed, h_errno=%d", shortname, h_errno); /* FAILURE - cannot get host by address */ return(-1); } if ((size_t)bufsize < strlen(phe->h_name)) { /* FAILURE - name too long */ if (EMsg != NULL) snprintf(EMsg, 1024, "hostname (%.32s...) is too long (> %d chars)", phe->h_name, bufsize); return(-1); } strncpy(namebuf, phe->h_name, bufsize); namebuf[bufsize - 1] = '\0'; /* ensure null terminated */ for (index = 0;index < bufsize;index++) { if (namebuf[index] == '\0') break; namebuf[index] = tolower(namebuf[index]); } /* END for (index) */ /* SUCCESS */ return(0); } /* END get_fullhostname() */ /* END get_hostname.c */ torque-2.4.16/src/lib/Libnet/port_forwarding.c0000664000113300011330000002341011272401247016160 00000000000000/* port forwarding functions for TORQUE */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "port_forwarding.h" /* handy utility to handle forwarding socket connections to another host * pass in an initialized pfwdsock struct with sockets to listen on, a function * pointer to get a new socket for forwarding, and a hostname and port number to * pass to the function pointer, and it will do the rest. The caller probably * should fork first since this function is an infinite loop and never returns */ /* __attribute__((noreturn)) - how do I do this portably? */ void port_forwarder( struct pfwdsock *socks, int (*connfunc)(char *, int, char *), char *phost, int pport, char *EMsg) /* O */ { fd_set rfdset, wfdset, efdset; int rc, maxsock = 0; struct sockaddr_in from; torque_socklen_t fromlen; int n, n2, sock; fromlen = sizeof(from); while (1) { FD_ZERO(&rfdset); FD_ZERO(&wfdset); FD_ZERO(&efdset); maxsock = 0; for (n = 0; n < NUM_SOCKS; n++) { if (!(socks + n)->active) continue; if ((socks + n)->listening) { FD_SET((socks + n)->sock, &rfdset); } else { if ((socks + n)->bufavail < BUF_SIZE) FD_SET((socks + n)->sock, &rfdset); if ((socks + ((socks + n)->peer))->bufavail - (socks + ((socks + n)->peer))->bufwritten > 0) FD_SET((socks + n)->sock, &wfdset); /*FD_SET((socks+n)->sock,&efdset);*/ } maxsock = (socks + n)->sock > maxsock ? (socks + n)->sock : maxsock; } maxsock++; rc = select(maxsock, &rfdset, &wfdset, &efdset, NULL); if ((rc == -1) && (errno == EINTR)) continue; if (rc < 0) { perror("port forwarding select()"); exit(EXIT_FAILURE); } for (n = 0;n < NUM_SOCKS;n++) { if (!(socks + n)->active) continue; if (FD_ISSET((socks + n)->sock, &rfdset)) { if ((socks + n)->listening) { int newsock = 0, peersock = 0; if ((sock = accept((socks + n)->sock, (struct sockaddr *) & from, &fromlen)) < 0) { if ((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINTR) || (errno == ECONNABORTED)) continue; close((socks + n)->sock); (socks + n)->active = 0; continue; } newsock = peersock = 0; for (n2 = 0; n2 < NUM_SOCKS; n2++) { if ((socks + n2)->active || (((socks + n2)->peer != 0) && (socks + ((socks + n2)->peer))->active)) continue; if (newsock == 0) newsock = n2; else if (peersock == 0) peersock = n2; else break; } (socks + newsock)->sock = (socks + peersock)->remotesock = sock; (socks + newsock)->listening = (socks + peersock)->listening = 0; (socks + newsock)->active = (socks + peersock)->active = 1; (socks + newsock)->peer = (socks + peersock)->sock = connfunc(phost, pport, EMsg); (socks + newsock)->bufwritten = (socks + peersock)->bufwritten = 0; (socks + newsock)->bufavail = (socks + peersock)->bufavail = 0; (socks + newsock)->buff[0] = (socks + peersock)->buff[0] = '\0'; (socks + newsock)->peer = peersock; (socks + peersock)->peer = newsock; } else { /* non-listening socket to be read */ rc = read( (socks + n)->sock, (socks + n)->buff + (socks + n)->bufavail, BUF_SIZE - (socks + n)->bufavail); if (rc < 1) { shutdown((socks + n)->sock, SHUT_RDWR); close((socks + n)->sock); (socks + n)->active = 0; } else { (socks + n)->bufavail += rc; } } } /* END if rfdset */ } /* END foreach fd */ for (n = 0; n < NUM_SOCKS; n++) { if (!(socks + n)->active) continue; if (FD_ISSET((socks + n)->sock, &wfdset)) { int peer = (socks + n)->peer; rc = write( (socks + n)->sock, (socks + peer)->buff + (socks + peer)->bufwritten, (socks + peer)->bufavail - (socks + peer)->bufwritten); if (rc < 1) { shutdown((socks + n)->sock, SHUT_RDWR); close((socks + n)->sock); (socks + n)->active = 0; } else { (socks + peer)->bufwritten += rc; } } /* END if wfdset */ } /* END foreach fd */ for (n2 = 0; n2 <= 1;n2++) { for (n = 0; n < NUM_SOCKS; n++) { int peer; if (!(socks + n)->active || (socks + n)->listening) continue; peer = (socks + n)->peer; if ((socks + n)->bufwritten == (socks + n)->bufavail) { (socks + n)->bufwritten = (socks + n)->bufavail = 0; } if (!(socks + peer)->active && ((socks + peer)->bufwritten == (socks + peer)->bufavail)) { shutdown((socks + n)->sock, SHUT_RDWR); close((socks + n)->sock); (socks + n)->active = 0; } } } } /* END while(1) */ } /* END port_forwarder() */ /* disable nagle on a socket */ void set_nodelay( int fd) { int opt; torque_socklen_t optlen; optlen = sizeof(opt); if (getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen) == -1) { fprintf(stderr, "getsockopt TCP_NODELAY: %.100s", strerror(errno)); return; } if (opt == 1) { fprintf(stderr, "fd %d is TCP_NODELAY", fd); return; } opt = 1; if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof opt) == -1) fprintf(stderr, "setsockopt TCP_NODELAY: %.100s", strerror(errno)); return; } /* return a socket to the specified X11 unix socket */ int connect_local_xsocket( u_int dnr) { int sock; struct sockaddr_un addr; if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { fprintf(stderr, "socket: %.100s", strerror(errno)); return -1; } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; snprintf(addr.sun_path, sizeof addr.sun_path, X_UNIX_PATH, dnr); if (connect(sock, (struct sockaddr *) & addr, sizeof(addr)) == 0) return sock; close(sock); fprintf(stderr, "connect %.100s: %.100s", addr.sun_path, strerror(errno)); return(-1); } int x11_connect_display( char *display, int alsounused, char *EMsg) /* O */ { #ifndef HAVE_GETADDRINFO /* this was added for cygwin which doesn't seem to have a working * getaddrinfo() yet. * this will have to be figured out later */ if (EMsg != NULL) EMsg[0] = '\0'; return(-1); #else int display_number, sock = 0; char buf[1024], *cp; struct addrinfo hints, *ai, *aitop; char strport[NI_MAXSERV]; int gaierr; if (EMsg != NULL) EMsg[0] = '\0'; /* * Now we decode the value of the DISPLAY variable and make a * connection to the real X server. */ /* * Check if it is a unix domain socket. Unix domain displays are in * one of the following formats: unix:d[.s], :d[.s], ::d[.s] */ if (strncmp(display, "unix:", 5) == 0 || display[0] == ':') { /* Connect to the unix domain socket. */ if (sscanf(strrchr(display, ':') + 1, "%d", &display_number) != 1) { fprintf(stderr, "Could not parse display number from DISPLAY: %.100s", display); return -1; } /* Create a socket. */ sock = connect_local_xsocket(display_number); if (sock < 0) return -1; /* OK, we now have a connection to the display. */ return sock; } /* * Connect to an inet socket. The DISPLAY value is supposedly * hostname:d[.s], where hostname may also be numeric IP address. */ strncpy(buf, display, sizeof(buf)); cp = strchr(buf, ':'); if (!cp) { fprintf(stderr, "Could not find ':' in DISPLAY: %.100s", display); return -1; } *cp = 0; /* buf now contains the host name. But first we parse the display number. */ if (sscanf(cp + 1, "%d", &display_number) != 1) { fprintf(stderr, "Could not parse display number from DISPLAY: %.100s", display); return -1; } /* Look up the host address */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof strport, "%d", 6000 + display_number); if ((gaierr = getaddrinfo(buf, strport, &hints, &aitop)) != 0) { fprintf(stderr, "%100s: unknown host. (%s)", buf, gai_strerror(gaierr)); return -1; } for (ai = aitop; ai; ai = ai->ai_next) { /* Create a socket. */ sock = socket(ai->ai_family, SOCK_STREAM, 0); if (sock < 0) { fprintf(stderr, "socket: %.100s", strerror(errno)); continue; } /* Connect it to the display. */ if (connect(sock, ai->ai_addr, ai->ai_addrlen) < 0) { fprintf(stderr, "connect %.100s port %d: %.100s", buf, 6000 + display_number, strerror(errno)); close(sock); continue; } /* Success */ break; } freeaddrinfo(aitop); if (!ai) { fprintf(stderr, "connect %.100s port %d: %.100s", buf, 6000 + display_number, strerror(errno)); return -1; } set_nodelay(sock); return sock; #endif /* HAVE_GETADDRINFO */ } torque-2.4.16/src/lib/Libnet/net_server.c0000664000113300011330000005103511307151350015126 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include /* added - CRI 9/05 */ #include /* added - CRI 9/05 */ #include #include #include #include #include #if defined(FD_SET_IN_SYS_SELECT_H) # include #endif #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H) #include #endif #include "portability.h" #include "server_limits.h" #include "net_connect.h" #include "log.h" extern int LOGLEVEL; /* External Functions Called */ extern void process_request A_((int)); extern time_t time(time_t *); /* Global Data (I wish I could make it private to the library, sigh, but * C don't support that scope of control.) * * This array of connection structures is used by the server to maintain * a record of the open I/O connections, it is indexed by the socket number. */ struct connection svr_conn[PBS_NET_MAX_CONNECTIONS]; /* * The following data is private to this set of network interface routines. */ static int max_connection = PBS_NET_MAX_CONNECTIONS; static int num_connections = 0; static fd_set *GlobalSocketReadSet = NULL; static void (*read_func[2]) A_((int)); pbs_net_t pbs_server_addr; /* Private function within this file */ static void accept_conn(); static struct netcounter nc_list[60]; void netcounter_incr(void) { time_t now, lastmin; int i; now = time(NULL); lastmin = now - 60; if (nc_list[0].time == now) { nc_list[0].counter++; } else { memmove(&nc_list[1], &nc_list[0], sizeof(struct netcounter)*59); nc_list[0].time = now; nc_list[0].counter = 1; for (i = 0;i < 60;i++) { if (nc_list[i].time < lastmin) { nc_list[i].time = 0; nc_list[i].counter = 0; } } } } int get_num_connections() { return(num_connections); } int * netcounter_get(void) { static int netrates[3]; int netsums[3] = {0, 0, 0}; int i; for (i = 0;i < 5;i++) { netsums[0] += nc_list[i].counter; netsums[1] += nc_list[i].counter; netsums[2] += nc_list[i].counter; } for (i = 5;i < 30;i++) { netsums[1] += nc_list[i].counter; netsums[2] += nc_list[i].counter; } for (i = 30;i < 60;i++) { netsums[2] += nc_list[i].counter; } if (netsums[0] > 0) { netrates[0] = netsums[0] / 5; netrates[1] = netsums[1] / 30; netrates[2] = netsums[2] / 60; } else { netrates[0] = 0; netrates[1] = 0; netrates[2] = 0; } return netrates; } /** * init_network - initialize the network interface * allocate a socket and bind it to the service port, * add the socket to the readset for select(), * add the socket to the connection structure and set the * processing function to accept_conn() */ int init_network( unsigned int port, void (*readfunc)()) { int i; static int initialized = 0; int sock; int MaxNumDescriptors = 0; struct sockaddr_in socname; enum conn_type type; #ifdef ENABLE_UNIX_SOCKETS struct sockaddr_un unsocname; int unixsocket; memset(&unsocname, 0, sizeof(unsocname)); #endif MaxNumDescriptors = get_max_num_descriptors(); memset(&socname, 0, sizeof(socname)); if (initialized == 0) { for (i = 0;i < PBS_NET_MAX_CONNECTIONS;i++) svr_conn[i].cn_active = Idle; /* initialize global "read" socket FD bitmap */ GlobalSocketReadSet = (fd_set *)calloc(1,sizeof(char) * get_fdset_size()); type = Primary; } else if (initialized == 1) { type = Secondary; } else { /* FAILURE */ return(-1); /* too many main connections */ } /* save the routine which should do the reading on connections */ /* accepted from the parent socket */ read_func[initialized++] = readfunc; if (port != 0) { sock = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { /* FAILURE */ return(-1); } if (MaxNumDescriptors < PBS_NET_MAX_CONNECTIONS) max_connection = MaxNumDescriptors; i = 1; setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&i, sizeof(i)); /* name that socket "in three notes" */ socname.sin_port = htons((unsigned short)port); socname.sin_addr.s_addr = INADDR_ANY; socname.sin_family = AF_INET; if (bind(sock, (struct sockaddr *)&socname, sizeof(socname)) < 0) { /* FAILURE */ close(sock); return(-1); } /* record socket in connection structure and select set */ add_conn(sock, type, (pbs_net_t)0, 0, PBS_SOCK_INET, accept_conn); /* start listening for connections */ if (listen(sock, 512) < 0) { /* FAILURE */ return(-1); } } /* END if (port != 0) */ #ifdef ENABLE_UNIX_SOCKETS if (port == 0) { /* setup unix domain socket */ unixsocket = socket(AF_UNIX, SOCK_STREAM, 0); if (unixsocket < 0) { return(-1); } unsocname.sun_family = AF_UNIX; strncpy(unsocname.sun_path, TSOCK_PATH, sizeof(unsocname.sun_path) - 1); unlink(TSOCK_PATH); /* don't care if this fails */ if (bind(unixsocket, (struct sockaddr *)&unsocname, sizeof(unsocname)) < 0) { close(unixsocket); return(-1); } if (chmod(TSOCK_PATH, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) != 0) { close(unixsocket); return(-1); } add_conn(unixsocket, type, (pbs_net_t)0, 0, PBS_SOCK_UNIX, accept_conn); if (listen(unixsocket, 512) < 0) { /* FAILURE */ return(-1); } } /* END if (port == 0) */ #endif /* END ENABLE_UNIX_SOCKETS */ if (port != 0) { /* allocate a minute's worth of counter structs */ for (i = 0;i < 60;i++) { nc_list[i].time = 0; nc_list[i].counter = 0; } } return(0); } /* END init_network() */ /* * wait_request - wait for a request (socket with data to read) * This routine does a select on the readset of sockets, * when data is ready, the processing routine associated with * the socket is invoked. */ int wait_request( time_t waittime, /* I (seconds) */ long *SState) /* I (optional) */ { extern char *PAddrToString(pbs_net_t *); void close_conn(); int i; int n; time_t now; fd_set *SelectSet = NULL; int SelectSetSize = 0; int MaxNumDescriptors = 0; char id[] = "wait_request"; char tmpLine[1024]; struct timeval timeout; long OrigState = 0; if (SState != NULL) OrigState = *SState; timeout.tv_usec = 0; timeout.tv_sec = waittime; SelectSetSize = sizeof(char) * get_fdset_size(); SelectSet = (fd_set *)calloc(1,SelectSetSize); memcpy(SelectSet,GlobalSocketReadSet,SelectSetSize); /* selset = readset;*/ /* readset is global */ MaxNumDescriptors = get_max_num_descriptors(); n = select(MaxNumDescriptors, SelectSet, (fd_set *)0, (fd_set *)0, &timeout); if (n == -1) { if (errno == EINTR) { n = 0; /* interrupted, cycle around */ } else { int i; struct stat fbuf; /* check all file descriptors to verify they are valid */ /* NOTE: selset may be modified by failed select() */ for (i = 0;i < MaxNumDescriptors;i++) { if (FD_ISSET(i, GlobalSocketReadSet) == 0) continue; if (fstat(i, &fbuf) == 0) continue; /* clean up SdList and bad sd... */ FD_CLR(i, GlobalSocketReadSet); } /* END for (i) */ free(SelectSet); return(-1); } /* END else (errno == EINTR) */ } /* END if (n == -1) */ for (i = 0;(i < max_connection) && (n != 0);i++) { if (FD_ISSET(i, SelectSet)) { /* this socket has data */ n--; svr_conn[i].cn_lasttime = time((time_t *)0); if (svr_conn[i].cn_active != Idle) { netcounter_incr(); svr_conn[i].cn_func(i); /* NOTE: breakout if state changed (probably received shutdown request) */ if ((SState != NULL) && (OrigState != *SState)) break; } else { FD_CLR(i, GlobalSocketReadSet); close_conn(i); sprintf(tmpLine,"closed connection to fd %d - num_connections=%d (select bad socket)", i, num_connections); log_err(-1,id,tmpLine); } } } /* END for (i) */ /* NOTE: break out if shutdown request received */ if ((SState != NULL) && (OrigState != *SState)) { free(SelectSet); return(0); } /* have any connections timed out ?? */ now = time((time_t *)0); for (i = 0;i < max_connection;i++) { struct connection *cp; cp = &svr_conn[i]; if (cp->cn_active != FromClientDIS) continue; if ((now - cp->cn_lasttime) <= PBS_NET_MAXCONNECTIDLE) continue; if (cp->cn_authen & PBS_NET_CONN_NOTIMEOUT) continue; /* do not time-out this connection */ /* NOTE: add info about node associated with connection - NYI */ snprintf(tmpLine, sizeof(tmpLine), "connection %d to host %s has timed out after %d seconds - closing stale connection\n", i, PAddrToString(&cp->cn_addr), PBS_NET_MAXCONNECTIDLE); log_err(-1, "wait_request", tmpLine); /* locate node associated with interface, mark node as down until node responds */ /* NYI */ close_conn(i); } /* END for (i) */ free(SelectSet); return(0); } /* END wait_request() */ /* * accept_conn - accept request for new connection * this routine is normally associated with the main socket, * requests for connection on the socket are accepted and * the new socket is added to the select set and the connection * structure - the processing routine is set to the external * function: process_request(socket) */ static void accept_conn( int sd) /* main socket with connection request pending */ { int newsock; struct sockaddr_in from; struct sockaddr_un unixfrom; torque_socklen_t fromsize; from.sin_addr.s_addr = 0; from.sin_port = 0; /* update lasttime of main socket */ svr_conn[sd].cn_lasttime = time((time_t *)0); if (svr_conn[sd].cn_socktype == PBS_SOCK_INET) { fromsize = sizeof(from); newsock = accept(sd, (struct sockaddr *) & from, &fromsize); } else { fromsize = sizeof(unixfrom); newsock = accept(sd, (struct sockaddr *) & unixfrom, &fromsize); } if (newsock == -1) { return; } if ((num_connections >= max_connection) || (newsock >= PBS_NET_MAX_CONNECTIONS)) { close(newsock); return; /* too many current connections */ } /* add the new socket to the select set and connection structure */ add_conn( newsock, FromClientDIS, (pbs_net_t)ntohl(from.sin_addr.s_addr), (unsigned int)ntohs(from.sin_port), svr_conn[sd].cn_socktype, read_func[(int)svr_conn[sd].cn_active]); return; } /* END accept_conn() */ /* * add_conn - add a connection to the svr_conn array. * The params addr and port are in host order. * * NOTE: This routine cannot fail. */ void add_conn( int sock, /* socket associated with connection */ enum conn_type type, /* type of connection */ pbs_net_t addr, /* IP address of connected host */ unsigned int port, /* port number (host order) on connected host */ unsigned int socktype, /* inet or unix */ void (*func) A_((int))) /* function to invoke on data rdy to read */ { num_connections++; FD_SET(sock, GlobalSocketReadSet); svr_conn[sock].cn_active = type; svr_conn[sock].cn_addr = addr; svr_conn[sock].cn_port = (unsigned short)port; svr_conn[sock].cn_lasttime = time((time_t *)0); svr_conn[sock].cn_func = func; svr_conn[sock].cn_oncl = 0; svr_conn[sock].cn_socktype = socktype; #ifndef NOPRIVPORTS if ((socktype == PBS_SOCK_INET) && (port < IPPORT_RESERVED)) { svr_conn[sock].cn_authen = PBS_NET_CONN_FROM_PRIVIL; } else { /* AF_UNIX sockets */ svr_conn[sock].cn_authen = 0; } #else /* !NOPRIVPORTS */ if (socktype == PBS_SOCK_INET) { /* All TCP connections are privileged */ svr_conn[sock].cn_authen = PBS_NET_CONN_FROM_PRIVIL; } else { /* AF_UNIX sockets */ svr_conn[sock].cn_authen = 0; } #endif /* !NOPRIVPORTS */ return; } /* END add_conn() */ /* * close_conn - close a network connection * does physical close, also marks the connection table */ void close_conn( int sd) /* I */ { if ((sd < 0) || (max_connection <= sd)) { return; } if (svr_conn[sd].cn_active == Idle) { return; } close(sd); /* if there is a function to call on close, do it */ if (svr_conn[sd].cn_oncl != 0) svr_conn[sd].cn_oncl(sd); /* * In the case of a -t cold start, this will be called prior to * GlobalSocketReadSet being initialized */ if (GlobalSocketReadSet != NULL) { FD_CLR(sd, GlobalSocketReadSet); } svr_conn[sd].cn_addr = 0; svr_conn[sd].cn_handle = -1; svr_conn[sd].cn_active = Idle; svr_conn[sd].cn_func = (void (*)())0; svr_conn[sd].cn_authen = 0; num_connections--; return; } /* END close_conn() */ /* * net_close - close all network connections but the one specified, * if called with impossible socket number (-1), all will be closed. * This function is typically called when a server is closing down and * when it is forking a child. * * We clear the cn_oncl field in the connection table to prevent any * "special on close" functions from being called. */ void net_close( int but) /* I */ { int i; for (i = 0;i < max_connection;i++) { if (i != but) { svr_conn[i].cn_oncl = 0; close_conn(i); } } /* END for (i) */ return; } /* END net_close() */ /* * get_connectaddr - return address of host connected via the socket * This is in host order. */ pbs_net_t get_connectaddr( int sock) /* I */ { return(svr_conn[sock].cn_addr); } int find_conn( pbs_net_t addr) /* I */ { int index; /* NOTE: there may be multiple connections per addr (not handled) */ for (index = 0;index < PBS_NET_MAX_CONNECTIONS;index++) { if (addr == svr_conn[index].cn_addr) { return(index); } } /* END for (index) */ return(-1); } /* END find_conn() */ /* * get_connecthost - return name of host connected via the socket */ int get_connecthost( int sock, /* I */ char *namebuf, /* O (minsize=size) */ int size) /* I */ { struct hostent *phe; struct in_addr addr; int namesize = 0; static struct in_addr serveraddr; static char *server_name = NULL; if ((server_name == NULL) && (pbs_server_addr != 0)) { /* cache local server addr info */ serveraddr.s_addr = htonl(pbs_server_addr); if ((phe = gethostbyaddr( (char *) & serveraddr, sizeof(struct in_addr), AF_INET)) == NULL) { server_name = strdup(inet_ntoa(serveraddr)); } else { server_name = strdup(phe->h_name); } } size--; addr.s_addr = htonl(svr_conn[sock].cn_addr); if ((server_name != NULL) && (svr_conn[sock].cn_socktype & PBS_SOCK_UNIX)) { /* lookup request is for local server */ strcpy(namebuf, server_name); } else if ((server_name != NULL) && (addr.s_addr == serveraddr.s_addr)) { /* lookup request is for local server */ strcpy(namebuf, server_name); } else if ((phe = gethostbyaddr( (char *) & addr, sizeof(struct in_addr), AF_INET)) == NULL) { strcpy(namebuf, inet_ntoa(addr)); } else { namesize = strlen(phe->h_name); strncpy(namebuf, phe->h_name, size); *(namebuf + size) = '\0'; } if (namesize > size) { /* FAILURE - buffer too small */ return(-1); } /* SUCCESS */ return(0); } /* END get_connecthost() */ /* ** Put a human readable representation of a network address into ** a staticly allocated string. */ char *netaddr_pbs_net_t( pbs_net_t ipadd) { static char out[80]; if (ipadd == 0) return "unknown"; sprintf(out, "%ld.%ld.%ld.%ld", (ipadd & 0xff000000) >> 24, (ipadd & 0x00ff0000) >> 16, (ipadd & 0x0000ff00) >> 8, (ipadd & 0x000000ff)); return (out); } /* END net_server.c */ torque-2.4.16/src/lib/Libnet/md5.c0000664000113300011330000002615511272401247013450 00000000000000 /* *********************************************************************** ** md5.c -- the source code for MD5 routines ** ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** ** Created: 2/17/90 RLR ** ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. ** *********************************************************************** */ /* *********************************************************************** ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** ** ** ** License to copy and use this software is granted provided that ** ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** ** Digest Algorithm" in all material mentioning or referencing this ** ** software or this function. ** ** ** ** License is also granted to make and use derivative works ** ** provided that such works are identified as "derived from the RSA ** ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** ** material mentioning or referencing the derived work. ** ** ** ** RSA Data Security, Inc. makes no representations concerning ** ** either the merchantability of this software or the suitability ** ** of this software for any particular purpose. It is provided "as ** ** is" without express or implied warranty of any kind. ** ** ** ** These notices must be retained in any copies of any part of this ** ** documentation and/or software. ** *********************************************************************** */ #include /* the master config generated by configure */ #include "md5.h" /* *********************************************************************** ** Message-digest routines: ** ** To form the message digest for a message M ** ** (1) Initialize a context buffer mdContext using MD5Init ** ** (2) Call MD5Update on mdContext and M ** ** (3) Call MD5Final on mdContext ** ** The message digest is now in mdContext->digest[0...15] ** *********************************************************************** */ /* forward declaration */ static void Transform(UINT4 *, UINT4 *); static unsigned char PADDING[64] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* F, G, H and I are basic MD5 functions */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ /* Rotation is separate from addition to prevent recomputation */ #define FF(a, b, c, d, x, s, ac) \ {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) \ {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) \ {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) \ {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* The routine MD5Init initializes the message-digest context mdContext. All fields are set to zero. */ void MD5Init(MD5_CTX *mdContext) { mdContext->i[0] = mdContext->i[1] = (UINT4)0; /* Load magic initialization constants. */ mdContext->buf[0] = (UINT4)0x67452301; mdContext->buf[1] = (UINT4)0xefcdab89; mdContext->buf[2] = (UINT4)0x98badcfe; mdContext->buf[3] = (UINT4)0x10325476; } /* The routine MD5Update updates the message-digest context to account for the presence of each of the characters inBuf[0..inLen-1] in the message whose digest is being computed. */ void MD5Update(MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen) { UINT4 in[16]; int mdi; unsigned int i, ii; /* compute number of bytes mod 64 */ mdi = (int)((mdContext->i[0] >> 3) & 0x3F); /* update number of bits */ if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0]) mdContext->i[1]++; mdContext->i[0] += ((UINT4)inLen << 3); mdContext->i[1] += ((UINT4)inLen >> 29); while (inLen--) { /* add new character to buffer, increment mdi */ mdContext->in[mdi++] = *inBuf++; /* transform if necessary */ if (mdi == 0x40) { for (i = 0, ii = 0; i < 16; i++, ii += 4) in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | (((UINT4)mdContext->in[ii+2]) << 16) | (((UINT4)mdContext->in[ii+1]) << 8) | ((UINT4)mdContext->in[ii]); Transform(mdContext->buf, in); mdi = 0; } } } /* The routine MD5Final terminates the message-digest computation and ends with the desired message digest in mdContext->digest[0...15]. */ void MD5Final(MD5_CTX *mdContext) { UINT4 in[16]; int mdi; unsigned int i, ii; unsigned int padLen; /* save number of bits */ in[14] = mdContext->i[0]; in[15] = mdContext->i[1]; /* compute number of bytes mod 64 */ mdi = (int)((mdContext->i[0] >> 3) & 0x3F); /* pad out to 56 mod 64 */ padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); MD5Update(mdContext, PADDING, padLen); /* append length in bits and transform */ for (i = 0, ii = 0; i < 14; i++, ii += 4) in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | (((UINT4)mdContext->in[ii+2]) << 16) | (((UINT4)mdContext->in[ii+1]) << 8) | ((UINT4)mdContext->in[ii]); Transform(mdContext->buf, in); /* store buffer in digest */ for (i = 0, ii = 0; i < 4; i++, ii += 4) { mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF); mdContext->digest[ii+1] = (unsigned char)((mdContext->buf[i] >> 8) & 0xFF); mdContext->digest[ii+2] = (unsigned char)((mdContext->buf[i] >> 16) & 0xFF); mdContext->digest[ii+3] = (unsigned char)((mdContext->buf[i] >> 24) & 0xFF); } } /* Basic MD5 step. Transforms buf based on in. */ static void Transform(UINT4 *buf, UINT4 *in) { UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; /* Round 1 */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 FF(a, b, c, d, in[ 0], S11, 3614090360UL); /* 1 */ FF(d, a, b, c, in[ 1], S12, 3905402710UL); /* 2 */ FF(c, d, a, b, in[ 2], S13, 606105819UL); /* 3 */ FF(b, c, d, a, in[ 3], S14, 3250441966UL); /* 4 */ FF(a, b, c, d, in[ 4], S11, 4118548399UL); /* 5 */ FF(d, a, b, c, in[ 5], S12, 1200080426UL); /* 6 */ FF(c, d, a, b, in[ 6], S13, 2821735955UL); /* 7 */ FF(b, c, d, a, in[ 7], S14, 4249261313UL); /* 8 */ FF(a, b, c, d, in[ 8], S11, 1770035416UL); /* 9 */ FF(d, a, b, c, in[ 9], S12, 2336552879UL); /* 10 */ FF(c, d, a, b, in[10], S13, 4294925233UL); /* 11 */ FF(b, c, d, a, in[11], S14, 2304563134UL); /* 12 */ FF(a, b, c, d, in[12], S11, 1804603682UL); /* 13 */ FF(d, a, b, c, in[13], S12, 4254626195UL); /* 14 */ FF(c, d, a, b, in[14], S13, 2792965006UL); /* 15 */ FF(b, c, d, a, in[15], S14, 1236535329UL); /* 16 */ /* Round 2 */ #define S21 5 #define S22 9 #define S23 14 #define S24 20 GG(a, b, c, d, in[ 1], S21, 4129170786UL); /* 17 */ GG(d, a, b, c, in[ 6], S22, 3225465664UL); /* 18 */ GG(c, d, a, b, in[11], S23, 643717713UL); /* 19 */ GG(b, c, d, a, in[ 0], S24, 3921069994UL); /* 20 */ GG(a, b, c, d, in[ 5], S21, 3593408605UL); /* 21 */ GG(d, a, b, c, in[10], S22, 38016083UL); /* 22 */ GG(c, d, a, b, in[15], S23, 3634488961UL); /* 23 */ GG(b, c, d, a, in[ 4], S24, 3889429448UL); /* 24 */ GG(a, b, c, d, in[ 9], S21, 568446438UL); /* 25 */ GG(d, a, b, c, in[14], S22, 3275163606UL); /* 26 */ GG(c, d, a, b, in[ 3], S23, 4107603335UL); /* 27 */ GG(b, c, d, a, in[ 8], S24, 1163531501UL); /* 28 */ GG(a, b, c, d, in[13], S21, 2850285829UL); /* 29 */ GG(d, a, b, c, in[ 2], S22, 4243563512UL); /* 30 */ GG(c, d, a, b, in[ 7], S23, 1735328473UL); /* 31 */ GG(b, c, d, a, in[12], S24, 2368359562UL); /* 32 */ /* Round 3 */ #define S31 4 #define S32 11 #define S33 16 #define S34 23 HH(a, b, c, d, in[ 5], S31, 4294588738UL); /* 33 */ HH(d, a, b, c, in[ 8], S32, 2272392833UL); /* 34 */ HH(c, d, a, b, in[11], S33, 1839030562UL); /* 35 */ HH(b, c, d, a, in[14], S34, 4259657740UL); /* 36 */ HH(a, b, c, d, in[ 1], S31, 2763975236UL); /* 37 */ HH(d, a, b, c, in[ 4], S32, 1272893353UL); /* 38 */ HH(c, d, a, b, in[ 7], S33, 4139469664UL); /* 39 */ HH(b, c, d, a, in[10], S34, 3200236656UL); /* 40 */ HH(a, b, c, d, in[13], S31, 681279174UL); /* 41 */ HH(d, a, b, c, in[ 0], S32, 3936430074UL); /* 42 */ HH(c, d, a, b, in[ 3], S33, 3572445317UL); /* 43 */ HH(b, c, d, a, in[ 6], S34, 76029189UL); /* 44 */ HH(a, b, c, d, in[ 9], S31, 3654602809UL); /* 45 */ HH(d, a, b, c, in[12], S32, 3873151461UL); /* 46 */ HH(c, d, a, b, in[15], S33, 530742520UL); /* 47 */ HH(b, c, d, a, in[ 2], S34, 3299628645UL); /* 48 */ /* Round 4 */ #define S41 6 #define S42 10 #define S43 15 #define S44 21 II(a, b, c, d, in[ 0], S41, 4096336452UL); /* 49 */ II(d, a, b, c, in[ 7], S42, 1126891415UL); /* 50 */ II(c, d, a, b, in[14], S43, 2878612391UL); /* 51 */ II(b, c, d, a, in[ 5], S44, 4237533241UL); /* 52 */ II(a, b, c, d, in[12], S41, 1700485571UL); /* 53 */ II(d, a, b, c, in[ 3], S42, 2399980690UL); /* 54 */ II(c, d, a, b, in[10], S43, 4293915773UL); /* 55 */ II(b, c, d, a, in[ 1], S44, 2240044497UL); /* 56 */ II(a, b, c, d, in[ 8], S41, 1873313359UL); /* 57 */ II(d, a, b, c, in[15], S42, 4264355552UL); /* 58 */ II(c, d, a, b, in[ 6], S43, 2734768916UL); /* 59 */ II(b, c, d, a, in[13], S44, 1309151649UL); /* 60 */ II(a, b, c, d, in[ 4], S41, 4149444226UL); /* 61 */ II(d, a, b, c, in[11], S42, 3174756917UL); /* 62 */ II(c, d, a, b, in[ 2], S43, 718787259UL); /* 63 */ II(b, c, d, a, in[ 9], S44, 3951481745UL); /* 64 */ buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } /* *********************************************************************** ** End of md5.c ** ******************************** (cut) ******************************** */ torque-2.4.16/src/lib/Libnet/Makefile.in0000664000113300011330000003271611605403733014666 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libnet ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libnet/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libnet/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all compilation happens in lib/Libpbs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libnet/net_client.c0000664000113300011330000003322211272401247015100 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "portability.h" #include "server_limits.h" #include "net_connect.h" #include "mcom.h" #include #include #include #ifdef _AIX #include #endif #ifdef __APPLE__ /* this is a hack for the missing bindresvport declaration on OS X the function works fine but its use will generate a compiler warning if -Wall is used with gcc */ int bindresvport(int sd, struct sockaddr_in *sin); #endif /** * Returns the max number of possible file descriptors (as * per the OS limits). * */ int get_max_num_descriptors(void) { static int max_num_descriptors = 0; if (max_num_descriptors <= 0) max_num_descriptors = getdtablesize(); return(max_num_descriptors); } /* END get_num_max_descriptors() */ /** * Returns the number of bytes needed to allocate * a fd_set array that can hold all of the possible * socket descriptors. */ int get_fdset_size(void) { unsigned int MaxNumDescriptors = 0; int NumFDSetsNeeded = 0; int NumBytesInFDSet = 0; int Result = 0; MaxNumDescriptors = get_max_num_descriptors(); NumBytesInFDSet = sizeof(fd_set); NumFDSetsNeeded = MaxNumDescriptors / FD_SETSIZE; if (MaxNumDescriptors < FD_SETSIZE) { /* the default size already provides sufficient space */ Result = NumBytesInFDSet; } else if ((MaxNumDescriptors % FD_SETSIZE) > 0) { /* we need to allocate more memory to cover extra * bits--add an extra FDSet worth of memory to the size */ Result = (NumFDSetsNeeded + 1) * NumBytesInFDSet; } else { /* division was exact--we know exactly how many bytes we need */ Result = NumFDSetsNeeded * NumBytesInFDSet; } return(Result); } /* END get_fdset_size() */ /* ** wait for connect to complete. We use non-blocking sockets, ** so have to wait for completion this way. */ static int await_connect( long timeout, /* I */ int sockd) /* I */ { int n, val, rc; int MaxNumDescriptors = 0; fd_set *BigFDSet = NULL; struct timeval tv; torque_socklen_t len; /* * some operating systems (like FreeBSD) cannot have a value for tv.tv_usec * larger than 1,000,000 so we need to split up the timeout duration between * seconds and microseconds */ tv.tv_sec = timeout / 1000000; tv.tv_usec = timeout % 1000000; /* calculate needed size for fd_set in select() */ MaxNumDescriptors = get_max_num_descriptors(); BigFDSet = (fd_set *)calloc(1,sizeof(char) * get_fdset_size()); FD_SET(sockd, BigFDSet); if ((n = select(sockd+1,0,BigFDSet,0,&tv)) != 1) { /* FAILURE: socket not ready for write */ free(BigFDSet); return(-1); } len = sizeof(val); rc = getsockopt(sockd, SOL_SOCKET, SO_ERROR, &val, &len); if ((rc == 0) && (val == 0)) { /* SUCCESS: no failures detected */ free(BigFDSet); return(0); } errno = val; /* FAILURE: socket error detected */ free(BigFDSet); return(-1); } /* END await_connect() */ /* global */ long MaxConnectTimeout = 5000000; /* in microseconds */ /* * client_to_svr - connect to a server * * Perform socket/tcp/ip stuff to connect to a server. * * Returns: >=0 the socket obtained, or * PBS_NET_RC_FATAL (-1) if fatal error, just quit, or * PBS_NET_RC_RETRY (-2) if temp error, should retry * * NOTE: the server's host address and port were chosen as parameters * rather than their names to possibly save extra look-ups. It seems likely * that the caller "might" make several calls to the same host or different * hosts with the same port. Let the caller keep the addresses around * rather than look it up each time. * * NOTE: will wait up to MaxConnectTimeout microseconds for transient network failures */ /* NOTE: create new connection on reserved port to validate root/trusted authority */ int client_to_svr( pbs_net_t hostaddr, /* I - internet addr of host */ unsigned int port, /* I - port to which to connect */ int local_port, /* I - BOOLEAN: not 0 to use local reserved port */ char *EMsg) /* O (optional,minsize=1024) */ { const char id[] = "client_to_svr"; struct sockaddr_in local; struct sockaddr_in remote; int sock; unsigned short tryport; #ifndef NOPRIVPORTS int flags; #endif /* !NOPRIVPORTS */ int one = 1; int trycount; if (EMsg != NULL) EMsg[0] = '\0'; errno = 0; memset(&local, 0, sizeof(local)); memset(&remote, 0, sizeof(remote)); local.sin_family = AF_INET; local.sin_addr.s_addr = 0; local.sin_port = 0; tryport = IPPORT_RESERVED - 1; #ifndef NOPRIVPORTS retry: /* retry goto added (rentec) */ #endif /* !NOPRIVPORTS */ /* get socket */ sock = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { if (EMsg != NULL) sprintf(EMsg, "cannot create socket in %s - errno: %d %s", id, errno, strerror(errno)); return(PBS_NET_RC_FATAL); } if (sock >= PBS_NET_MAX_CONNECTIONS) { if (EMsg != NULL) sprintf(EMsg, "PBS_NET_MAX_CONNECTIONS exceeded in %s", id); close(sock); /* too many connections */ return(PBS_NET_RC_RETRY); } #ifndef NOPRIVPORTS flags = fcntl(sock, F_GETFL); flags |= O_NONBLOCK; fcntl(sock, F_SETFL, flags); #endif /* !NOPRIVPORTS */ /* If local privilege port requested, bind to one */ /* must be root privileged to do this */ trycount = 0; if (local_port != FALSE) { /* set REUSEADDR (rentec) */ setsockopt( sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(one)); #ifndef NOPRIVPORTS #ifdef HAVE_BINDRESVPORT /* * bindresvport seems to cause connect() failures in some odd corner case when * talking to a local daemon. So we'll only try this once and fallback to * the slow loop around bind() if connect() fails with EADDRINUSE * or EADDRNOTAVAIL. * http://www.supercluster.org/pipermail/torqueusers/2006-June/003740.html */ if (tryport == (IPPORT_RESERVED - 1)) { if (bindresvport(sock, &local) < 0) { if (EMsg != NULL) sprintf(EMsg, "cannot bind to reserved port in %s", id); close(sock); return(PBS_NET_RC_FATAL); } } else { #endif /* HAVE_BINDRESVPORT */ local.sin_port = htons(tryport); while (bind(sock, (struct sockaddr *)&local, sizeof(local)) < 0) { #ifdef NDEBUG2 fprintf(stderr, "INFO: cannot bind to port %d, errno: %d - %s\n", tryport, errno, strerror(errno)); #endif /* NDEBUG2 */ if ((errno != EADDRINUSE) && (errno != EADDRNOTAVAIL)) { if (EMsg != NULL) sprintf(EMsg, "cannot bind to port %d in %s - errno: %d %s", tryport, id, errno, strerror(errno)); close(sock); return(PBS_NET_RC_FATAL); } trycount++; if (--tryport < (unsigned short)(IPPORT_RESERVED / 2)) { if (EMsg != NULL) sprintf(EMsg, "cannot bind to port %d in %s - too many retries", tryport, id); close(sock); return(PBS_NET_RC_RETRY); } local.sin_port = htons(tryport); } /* END while (bind() < 0) */ #ifdef HAVE_BINDRESVPORT } /* END if (tryport == (IPPORT_RESERVED - 1)) else */ #endif /* HAVE_BINDRESVPORT */ #endif /* !NOPRIVPORTS */ } /* END if (local_port != FALSE) */ /* bind successful!!! */ /* connect to specified server host and port */ remote.sin_addr.s_addr = htonl(hostaddr); remote.sin_port = htons((unsigned short)port); remote.sin_family = AF_INET; if (connect(sock, (struct sockaddr *)&remote, sizeof(remote)) >= 0) { /* SUCCESS */ return(sock); } #ifdef NDEBUG2 fprintf(stderr, "INFO: cannot connect to port %d, errno=%d - %s\n", tryport, errno, strerror(errno)); #endif /* NDEBUG2 */ /* process failure */ switch (errno) { case EADDRINUSE: case EADDRNOTAVAIL: #ifndef NOPRIVPORTS if (local_port != FALSE) { /* continue port search (rentec) */ close(sock); --tryport; goto retry; } #endif /* NOPRIVPORTS */ /* fall through to next case */ case EINTR: case ETIMEDOUT: case EINPROGRESS: if (await_connect(MaxConnectTimeout, sock) == 0) { /* socket not ready for writing after MaxConnectTimeout microseconds timeout */ /* no network failures detected */ break; } /* fall through to next case */ case ECONNREFUSED: if (EMsg != NULL) sprintf(EMsg, "cannot connect to port %d in %s - connection refused", tryport, id); close(sock); return(PBS_NET_RC_RETRY); /*NOTREACHED*/ break; default: if (EMsg != NULL) sprintf(EMsg, "cannot connect to port %d in %s - errno:%d %s", tryport, id, errno, strerror(errno)); close(sock); return(PBS_NET_RC_FATAL); /*NOTREACHED*/ break; } /* END switch (errno) */ /* SUCCESS */ return(sock); } /* END client_to_svr() */ /* END net_client.c */ torque-2.4.16/src/lib/Libnet/net_set_clse.c0000664000113300011330000001073511272401247015427 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include "portability.h" #include #include "net_connect.h" /* global data */ extern struct connection svr_conn[]; /* * net_add_close_func - install a function to be called on close of * the network connection */ void net_add_close_func(sd, func) int sd; void (*func) A_((int)); { if (svr_conn[sd].cn_active == Idle) return; svr_conn[sd].cn_oncl = func; } torque-2.4.16/src/lib/Libnet/rm.c0000664000113300011330000005064411306021360013371 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #if !defined(_BSD) && defined(_AIX) /* this is needed by AIX */ #define _BSD 1 #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "pbs_error.h" #include "net_connect.h" #include "resmon.h" #include "log.h" #include "dis.h" #include "dis_init.h" #include "rm.h" #if RPP #include "rpp.h" #else extern void DIS_tcp_funcs(); #endif static int full = 1; /* ** This is the structure used to keep track of the resource ** monitor connections. Each entry is linked into as list ** pointed to by "outs". If len is -1, no ** request is active. If len is -2, a request has been ** sent and is waiting to be read. If len is > 0, the number ** indicates how much data is waiting to be sent. */ struct out { int stream; int len; struct out *next; }; #define HASHOUT 32 static struct out *outs[HASHOUT]; /* ** Create an "out" structure and put it in the hash table. */ static int addrm( int stream) /* I */ { struct out *op, **head; if ((op = (struct out *)malloc(sizeof(struct out))) == NULL) { pbs_errno = errno; return -1; } head = &outs[stream % HASHOUT]; op->stream = stream; op->len = -1; op->next = *head; *head = op; return 0; } #if RPP static void funcs_dis(void) /* The equivalent of DIS_tcp_funcs() */ { if (dis_getc != rpp_getc) { dis_getc = (int (*)(int))rpp_getc; dis_puts = (int (*)(int, const char *, size_t))rpp_write; dis_gets = (int (*)(int, char *, size_t))rpp_read; disr_commit = (int (*)(int, int))rpp_rcommit; disw_commit = (int (*)(int, int))rpp_wcommit; } } #define setup_dis(x) funcs_dis() /* RPP doesn't need reset */ #define close_dis(x) rpp_close(x) #define flush_dis(x) rpp_flush(x) #else #define funcs_dis() DIS_tcp_funcs() #define setup_dis(x) DIS_tcp_setup(x) #define close_dis(x) close(x) #define flush_dis(x) DIS_tcp_wflush(x) #endif char TRMEMsg[1024]; /* global rm error message */ /* ** Connects to a resource monitor and returns a file descriptor to ** talk to it. If port is zero, use default port. */ int openrm( char *host, /* I */ unsigned int port) /* I (optional,0=DEFAULT) */ { int stream; #if RPP static int first = 1; #endif /* RPP */ static unsigned int gotport = 0; pbs_errno = 0; if (port == 0) { if (gotport == 0) { gotport = get_svrport(PBS_MANAGER_SERVICE_NAME, "tcp", PBS_MANAGER_SERVICE_PORT); } /* END if (gotport == 0) */ port = gotport; } #if RPP if (first) { int tryport = IPPORT_RESERVED; first = 0; while (--tryport > 0) { if (rpp_bind(tryport) != -1) break; if ((errno != EADDRINUSE) && (errno != EADDRNOTAVAIL)) break; } } if ((stream = rpp_open(host, port, TRMEMsg)) == -1) { pbs_errno = errno; return(-1); } #else /* RPP */ if ((stream = socket(AF_INET, SOCK_STREAM, 0)) != -1) { int tryport = IPPORT_RESERVED; struct sockaddr_in addr; struct hostent *hp; if ((hp = gethostbyname(host)) == NULL) { DBPRT(("host %s not found\n", host)) pbs_errno = ENOENT; return(-1); } memset(&addr, '\0', sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); while (--tryport > 0) { addr.sin_port = htons((u_short)tryport); if (bind(stream, (struct sockaddr *)&addr, sizeof(addr)) != -1) break; if ((errno != EADDRINUSE) && (errno != EADDRNOTAVAIL)) break; } memset(&addr, '\0', sizeof(addr)); addr.sin_family = hp->h_addrtype; addr.sin_port = htons((unsigned short)port); memcpy(&addr.sin_addr, hp->h_addr, hp->h_length); if (connect(stream, (struct sockaddr *)&addr, sizeof(addr)) == -1) { pbs_errno = errno; close(stream); return(-1); } } /* END if ((stream = socket(AF_INET,SOCK_STREAM,0)) != -1) */ #endif /* RPP */ pbs_errno = errno; if (stream < 0) { return(-1); } if (addrm(stream) == -1) { pbs_errno = errno; close_dis(stream); return(-1); } return(stream); } /* END openrm() */ /* ** Routine to close a connection to a resource monitor ** and free the "out" structure. ** Return 0 if all is well, -1 on error. */ static int delrm( int stream) { struct out *op, *prev = NULL; for (op = outs[stream % HASHOUT];op;op = op->next) { if (op->stream == stream) break; prev = op; } /* END for (op) */ if (op != NULL) { close_dis(stream); if (prev != NULL) prev->next = op->next; else outs[stream % HASHOUT] = op->next; free(op); return(0); } return(-1); } /* END delrm() */ /* ** Internal routine to find the out structure for a stream number. ** Return non NULL if all is well, NULL on error. */ static struct out *findout( int stream) { struct out *op; for (op = outs[stream % HASHOUT];op;op = op->next) { if (op->stream == stream) break; } if (op == NULL) pbs_errno = ENOTTY; return(op); } static int startcom( int stream, /* I */ int com) /* I */ { int ret; setup_dis(stream); ret = diswsi(stream, RM_PROTOCOL); if (ret == DIS_SUCCESS) { ret = diswsi(stream, RM_PROTOCOL_VER); if (ret == DIS_SUCCESS) { ret = diswsi(stream, com); } } if (ret != DIS_SUCCESS) { /* NOTE: cannot resolve log_err */ /* log_err(ret,"startcom - diswsi error",(char *)dis_emsg[ret]); */ pbs_errno = errno; } return(ret); } /* END startcom() */ /* ** Internal routine to compose and send a "simple" command. ** This means anything with a zero length body. ** Return 0 if all is well, -1 on error. */ static int simplecom( int stream, int com) { struct out *op; if ((op = findout(stream)) == NULL) { return(-1); } op->len = -1; if (startcom(stream, com) != DIS_SUCCESS) { close_dis(stream); return(-1); } if (flush_dis(stream) == -1) { pbs_errno = errno; DBPRT(("simplecom: flush error %d (%s)\n", pbs_errno, pbs_strerror(pbs_errno))) close_dis(stream); return(-1); } #if RPP rpp_eom(stream); #endif return(0); } /* END simplecom() */ /* ** Internal routine to read the return value from a command. ** Return 0 if all is well, -1 on error. */ static int simpleget( int stream) { int ret, num; num = disrsi(stream, &ret); if (ret != DIS_SUCCESS) { /* NOTE: cannot resolve log_err */ /* log_err(ret,"simpleget",(char *)dis_emsg[ret]); */ pbs_errno = errno ? errno : EIO; close_dis(stream); return(-1); } if (num != RM_RSP_OK) { #ifdef ENOMSG pbs_errno = ENOMSG; #else pbs_errno = EINVAL; #endif return(-1); } return(0); } /* END simpleget() */ /* ** Close connection to resource monitor. Return result 0 if ** all is ok or -1 if not (set pbs_errno). */ int closerm( int stream) { pbs_errno = 0; simplecom(stream, RM_CMD_CLOSE); if (delrm(stream) == -1) { pbs_errno = ENOTTY; return(-1); } return(0); } /* END closerm() */ /* ** Shutdown the resource monitor. Return result 0 if ** all is ok or -1 if not (set pbs_errno). */ int downrm( int stream) /* I */ { pbs_errno = 0; if (simplecom(stream, RM_CMD_SHUTDOWN)) { return(-1); } if (simpleget(stream)) { return(-1); } delrm(stream); return(0); } /* END downrm() */ /* ** Cause the resource monitor to read the file named. ** Return the result 0 if all is ok or -1 if not (set pbs_errno). */ int configrm( int stream, /* I */ char *file) /* I */ { int ret; size_t len; struct out *op; pbs_errno = 0; if ((op = findout(stream)) == NULL) { return(-1); } op->len = -1; /* NOTE: remove absolute job path check to allow config file staging (CRI) */ /* NOTE: remove filename size check (was 'MAXPATHLEN') */ if ((len = strlen(file)) > (size_t)65536) { pbs_errno = EINVAL; return(-1); } if (startcom(stream, RM_CMD_CONFIG) != DIS_SUCCESS) { return(-1); } ret = diswcs(stream, file, len); if (ret != DIS_SUCCESS) { #if defined(ECOMM) pbs_errno = ECOMM; #elif defined(ENOCONNECT) pbs_errno = ENOCONNECT; #else pbs_errno = ETXTBSY; #endif DBPRT(("configrm: diswcs %s\n", dis_emsg[ret])) return(-1); } if (flush_dis(stream) == -1) { pbs_errno = errno; DBPRT(("configrm: flush error %d (%s)\n", pbs_errno, pbs_strerror(pbs_errno))) return(-1); } if (simpleget(stream)) { return(-1); } return(0); } /* END configrm() */ /* ** Begin a new message to the resource monitor if necessary. ** Add a line to the body of an outstanding command to the resource ** monitor. ** Return the result 0 if all is ok or -1 if not (set pbs_errno). */ static int doreq( struct out *op, char *line) { int ret; if (op->len == -1) { /* start new message */ if (startcom(op->stream, RM_CMD_REQUEST) != DIS_SUCCESS) { return(-1); } op->len = 1; } ret = diswcs(op->stream, line, strlen(line)); if (ret != DIS_SUCCESS) { #if defined(ECOMM) pbs_errno = ECOMM; #elif defined(ENOCONNECT) pbs_errno = ENOCONNECT; #else pbs_errno = ETXTBSY; #endif DBPRT(("doreq: diswcs %s\n", dis_emsg[ret])) return(-1); } return(0); } /* END doreq() */ /* ** Add a request to a single stream. */ int addreq( int stream, char *line) { struct out *op; pbs_errno = 0; if ((op = findout(stream)) == NULL) { return(-1); } funcs_dis(); if (doreq(op, line) == -1) { delrm(stream); return(-1); } return(0); } /* END addreq() */ /* ** Add a request to every stream. ** Return the number of streams acted upon. */ int allreq( char *line) { struct out *op, *prev; int i, num; funcs_dis(); pbs_errno = 0; num = 0; for (i = 0; i < HASHOUT;i++) { prev = NULL; op = outs[i]; while (op != NULL) { if (doreq(op, line) == -1) { struct out *hold = op; close_dis(op->stream); if (prev) prev->next = op->next; else outs[i] = op->next; op = op->next; free(hold); } else { prev = op; op = op->next; num++; } } } return(num); } /* END allreq() */ /* ** Finish (and send) any outstanding message to the resource monitor. ** Return a pointer to the next response line or a NULL if ** there are no more or an error occured. Set pbs_errno on error. */ char *getreq( int stream) /* I */ { char *startline; struct out *op; int ret; pbs_errno = 0; if ((op = findout(stream)) == NULL) { return(NULL); } if (op->len >= 0) { /* there is a message to send */ if (flush_dis(stream) == -1) { pbs_errno = errno; DBPRT(("getreq: flush error %d (%s)\n", pbs_errno, pbs_strerror(pbs_errno))) delrm(stream); return(NULL); } op->len = -2; #if RPP rpp_eom(stream); #endif } funcs_dis(); if (op->len == -2) { if (simpleget(stream) == -1) { return(NULL); } op->len = -1; } startline = disrst(stream, &ret); if (ret == DIS_EOF) { return(NULL); } if (ret != DIS_SUCCESS) { pbs_errno = errno ? errno : EIO; DBPRT(("getreq: cannot read string %s\n", dis_emsg[ret])) return(NULL); } if (!full) { char *cc, *hold; int indent = 0; for (cc = startline;*cc;cc++) { if (*cc == '[') indent++; else if (*cc == ']') indent--; else if ((*cc == '=') && (indent == 0)) { hold = strdup(cc + 1); free(startline); startline = hold; break; } } } /* END if (!full) */ return(startline); } /* END getreq() */ /* ** Finish and send any outstanding messages to all resource monitors. ** Return the number of messages flushed. */ int flushreq(void) { struct out *op, *prev; int did, i; pbs_errno = 0; did = 0; for (i = 0;i < HASHOUT;i++) { for (op = outs[i];op != NULL;op = op->next) { if (op->len <= 0) /* no message to send */ continue; if (flush_dis(op->stream) == -1) { pbs_errno = errno; DBPRT(("flushreq: flush error %d (%s)\n", pbs_errno, pbs_strerror(pbs_errno))) close_dis(op->stream); op->stream = -1; continue; } op->len = -2; #if RPP rpp_eom(op->stream); #endif /* RPP */ did++; } /* END for (op) */ prev = NULL; op = outs[i]; while (op != NULL) { /* get rid of bad streams */ if (op->stream != -1) { prev = op; op = op->next; continue; } if (prev == NULL) { outs[i] = op->next; free(op); op = outs[i]; } else { prev->next = op->next; free(op); op = prev->next; } } } return(did); } /* END flushreq() */ /* ** Return the stream number of the next stream with something ** to read or a negative number (the return from rpp_poll) ** if there is no stream to read. */ int activereq(void) { #ifndef NDEBUG static char id[] = "activereq"; #endif #if RPP struct out *op; int try; int bucket; #endif /* RPP */ int i, num; struct timeval tv; fd_set *FDSet; int MaxNumDescriptors = 0; pbs_errno = 0; flushreq(); MaxNumDescriptors = get_max_num_descriptors(); FDSet = (fd_set *)calloc(1,sizeof(char) * get_fdset_size()); #if RPP for (try = 0;try < 3;) { if ((i = rpp_poll()) >= 0) { if ((op = findout(i)) != NULL) { free(FDSet); return(i); } op = (struct out *)malloc(sizeof(struct out)); if (op == NULL) { pbs_errno = errno; free(FDSet); return(-1); } bucket = i % HASHOUT; op->stream = i; op->len = -2; op->next = outs[bucket]; outs[bucket] = op; } else if (i == -1) { pbs_errno = errno; free(FDSet); return(-1); } else { FD_SET(rpp_fd, FDSet); tv.tv_sec = 5; tv.tv_usec = 0; num = select(FD_SETSIZE, FDSet, NULL, NULL, &tv); if (num == -1) { pbs_errno = errno; DBPRT(("%s: select %d %s\n", id, pbs_errno, pbs_strerror(pbs_errno))) free(FDSet); return -1; } if (num == 0) { try++; DBPRT(("%s: timeout %d\n", id, try)) } } } free(FDSet); return i; #else pbs_errno = 0; for (i = 0; i < HASHOUT; i++) { struct out *op; op = outs[i]; while (op) { FD_SET(op->stream, FDSet); op = op->next; } } tv.tv_sec = 15; tv.tv_usec = 0; num = select(MaxNumDescriptors, FDSet, NULL, NULL, &tv); if (num == -1) { pbs_errno = errno; DBPRT(("%s: select %d %s\n", id, pbs_errno, pbs_strerror(pbs_errno))) free(FDSet); return -1; } else if (num == 0) { free(FDSet); return -2; } for (i = 0; i < HASHOUT; i++) { struct out *op; op = outs[i]; while (op) { if (FD_ISSET(op->stream, FDSet)) { free(FDSet); return op->stream; } op = op->next; } } free(FDSet); return(-2); #endif } /* END activereq() */ /* ** If flag is true, turn on "full response" mode where getreq ** returns a pointer to the beginning of a line of response. ** This makes it possible to examine the entire line rather ** than just the answer following the equal sign. */ void fullresp(int flag) { #if RPP if (flag) rpp_dbprt = 1 - rpp_dbprt; /* toggle RPP debug */ #endif pbs_errno = 0; full = flag; return; } torque-2.4.16/src/lib/Libnet/Makefile.am0000664000113300011330000000012511272401247014640 00000000000000include $(top_srcdir)/buildutils/config.mk # all compilation happens in lib/Libpbs torque-2.4.16/src/lib/Libnet/get_hostaddr.c0000664000113300011330000001340711573726431015437 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H) #include #endif #include "portability.h" #include "server_limits.h" #include "net_connect.h" #include "pbs_error.h" #include "log.h" #if !defined(H_ERRNO_DECLARED) && !defined(_AIX) extern int h_errno; #endif /* * get_hostaddr.c - contains functions to provide the internal * internet address for a host and to provide the port * number for a service. * * get_hostaddr - get internal internet address of a host * * Returns a pbs_net_t (unsigned long) containing the network * address in host byte order. A Null value is returned on * an error. */ char *PAddrToString( pbs_net_t *Addr) { static char tmpLine[1024]; sprintf(tmpLine, "%lu", *(unsigned long *)Addr); return(tmpLine); } pbs_net_t get_hostaddr( char *hostname) /* I */ { static struct in_addr hostaddr; struct hostent *hp; extern int pbs_errno; hp = gethostbyname(hostname); if (hp == NULL) { snprintf(log_buffer, sizeof(log_buffer), "cannot resolve IP address for host '%s' herror=%d: %s", hostname, h_errno, hstrerror(h_errno)); log_event( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, "get_hostaddr", log_buffer); if (h_errno == TRY_AGAIN) pbs_errno = PBS_NET_RC_RETRY; else pbs_errno = PBS_NET_RC_FATAL; return((pbs_net_t)0); } memcpy((void *)&hostaddr, (void *)hp->h_addr_list[0], hp->h_length); return((pbs_net_t)ntohl(hostaddr.s_addr)); } /* END get_hostaddr() */ /* END get_hostaddr.c */ torque-2.4.16/src/lib/Libifl/0000777000113300011330000000000011614035170012652 500000000000000torque-2.4.16/src/lib/Libifl/dec_ReqHdr.c0000664000113300011330000001227411306021360014734 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_ReqHdr() - Decode the Request Header Fields * common to all requests * * Fields are: Protocol ID (unsigned integer) * Protocol Version (unsigned integer) * Request Type (unsignded integer) * User Name (string) * * Returns: -1 on EOF (end of file on first read only) * 0 on success * >0 a DIS error return, see dis.h */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_ReqHdr( int sock, struct batch_request *preq, int *proto_type, int *proto_ver) { int rc; *proto_type = disrui(sock, &rc); if (rc != 0) { return(rc); } if (*proto_type != PBS_BATCH_PROT_TYPE) { return(DIS_PROTO); } *proto_ver = disrui(sock, &rc); if (rc) { return(rc); } preq->rq_type = disrui(sock, &rc); if (rc != 0) { return(rc); } return(disrfst(sock, PBS_MAXUSER + 1, preq->rq_user)); } /* END decode_DIS_ReqHdr() */ torque-2.4.16/src/lib/Libifl/PBSD_submit_caps.c0000664000113300011330000002406511306021360016056 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "portability.h" #include "libpbs.h" #include "dis.h" /* PBSD_submit.c PBSD_rdytocmt() This function does the Ready To Commit sub-function of the Queue Job request. */ int PBSD_rdytocmt( int connect, char *jobid) { int rc; struct batch_reply *reply; int sock; sock = connection[connect].ch_socket; DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_RdytoCommit, pbs_current_user)) || (rc = encode_DIS_JobId(sock, jobid)) || (rc = encode_DIS_ReqExtend(sock, NULL))) { connection[connect].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } /* read reply */ reply = PBSD_rdrpy(connect); PBSD_FreeReply(reply); return(connection[connect].ch_errno); } /* PBS_commit.c This function does the Commit sub-function of the Queue Job request. */ int PBSD_commit( int connect, /* I */ char *jobid) /* I */ { struct batch_reply *reply; int rc; int sock; sock = connection[connect].ch_socket; DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_Commit, pbs_current_user)) || (rc = encode_DIS_JobId(sock, jobid)) || (rc = encode_DIS_ReqExtend(sock, NULL))) { connection[connect].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } /* PBSD_rdrpy sets connection[connect].ch_errno */ reply = PBSD_rdrpy(connect); PBSD_FreeReply(reply); return(connection[connect].ch_errno); } /* END PBSD_commit() */ /* PBS_scbuf.c * * Send a chunk of a of the job script to the server. * Called by pbs_submit. The buffer length could be * zero; the server should handle that case... */ static int PBSD_scbuf( int c, /* connection handle */ int reqtype, /* request type */ int seq, /* file chunk sequence number */ char *buf, /* file chunk */ int len, /* length of chunk */ char *jobid, /* job id (for types 1 and 2 only) */ enum job_file which) /* standard file type, see libpbs.h */ { struct batch_reply *reply; int rc; int sock; sock = connection[c].ch_socket; DIS_tcp_setup(sock); if (jobid == NULL) jobid = ""; /* use null string for null pointer */ if ((rc = encode_DIS_ReqHdr(sock, reqtype, pbs_current_user)) || (rc = encode_DIS_JobFile(sock, seq, buf, len, jobid, which)) || (rc = encode_DIS_ReqExtend(sock, NULL))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } /* read reply */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return(connection[c].ch_errno); } /* PBS_jscript.c * * The Job Script subfunction of the Queue Job request * -- the function PBS_scbuf is called repeatedly to * transfer chunks of the script to the server. */ int PBSD_jscript(int c, char *script_file, char *jobid) { int i; int fd; int cc; char s_buf[SCRIPT_CHUNK_Z]; if ((fd = open(script_file, O_RDONLY, 0)) < 0) { return (-1); } i = 0; cc = read(fd, s_buf, SCRIPT_CHUNK_Z); while ((cc > 0) && (PBSD_scbuf(c, PBS_BATCH_jobscript, i, s_buf, cc, jobid, JScript) == 0)) { i++; cc = read(fd, s_buf, SCRIPT_CHUNK_Z); } close(fd); if (cc < 0) /* read failed */ return (-1); return connection[c].ch_errno; } /* PBS_jobfile.c * * The Job File function used to move files related to * a job between servers. * -- the function PBS_scbuf is called repeatedly to * transfer chunks of the script to the server. */ int PBSD_jobfile( int c, int req_type, char *path, char *jobid, enum job_file which) { int i; int cc; int fd; char s_buf[SCRIPT_CHUNK_Z]; if ((fd = open(path, O_RDONLY, 0)) < 0) { return(-1); } i = 0; cc = read(fd, s_buf, SCRIPT_CHUNK_Z); while ((cc > 0) && (PBSD_scbuf(c, req_type, i, s_buf, cc, jobid, which) == 0)) { i++; cc = read(fd, s_buf, SCRIPT_CHUNK_Z); } close(fd); if (cc < 0) /* read failed */ { return(-1); } return(connection[c].ch_errno); } /* END PBSD_jobfile() */ /* PBS_queuejob.c This function sends the first part of the Queue Job request */ char *PBSD_queuejob( int connect, /* I */ char *jobid, /* I */ char *destin, struct attropl *attrib, char *extend) { struct batch_reply *reply; char *return_jobid = (char *)NULL; int rc; int sock; sock = connection[connect].ch_socket; DIS_tcp_setup(sock); /* first, set up the body of the Queue Job request */ if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_QueueJob, pbs_current_user)) || (rc = encode_DIS_QueueJob(sock, jobid, destin, attrib)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[connect].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(return_jobid); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(return_jobid); } /* read reply from stream into presentation element */ reply = PBSD_rdrpy(connect); if (reply == NULL) { if (PConnTimeout(sock) == 1) { pbs_errno = PBSE_EXPIRED; } else { pbs_errno = PBSE_PROTOCOL; } } else if (reply->brp_choice && reply->brp_choice != BATCH_REPLY_CHOICE_Text && reply->brp_choice != BATCH_REPLY_CHOICE_Queue) { pbs_errno = PBSE_PROTOCOL; } else if (connection[connect].ch_errno == 0) { return_jobid = strdup(reply->brp_un.brp_jid); } PBSD_FreeReply(reply); return(return_jobid); } /* END PBSD_queuejob() */ /* END PBSD_submit.c */ torque-2.4.16/src/lib/Libifl/pbsD_asyrun.c0000664000113300011330000001241211306021360015217 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbsD_asyrun.c */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_asyrunjob( int c, char *jobid, /* I */ char *location, char *extend) { int rc; struct batch_reply *reply; unsigned int resch = 0; int sock; if ((c < 0) || (jobid == NULL) || (*jobid == '\0')) { pbs_errno = PBSE_IVALREQ; return(pbs_errno); } if (location == NULL) location = ""; sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); /* send run request */ if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_AsyrunJob, pbs_current_user)) || (rc = encode_DIS_RunJob(sock, jobid, location, resch)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } /* get reply */ reply = PBSD_rdrpy(c); rc = connection[c].ch_errno; PBSD_FreeReply(reply); return(rc); } /* END pbs_asyrunjob() */ /* END pbsD_asyrun.c */ torque-2.4.16/src/lib/Libifl/enc_Track.c0000664000113300011330000001163311306021360014623 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_TrackJob() - encode a Track Job Batch Request * * This request is used by the server ONLY; its input is a server * batch request structure. * * Data items are: string job id * unsigned int hopcount * string location * u char state */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int encode_DIS_TrackJob(int sock, struct batch_request *preq) { int rc; if ((rc = diswst(sock, preq->rq_ind.rq_track.rq_jid) != 0) || (rc = diswui(sock, preq->rq_ind.rq_track.rq_hopcount) != 0) || (rc = diswst(sock, preq->rq_ind.rq_track.rq_location) != 0) || (rc = diswuc(sock, preq->rq_ind.rq_track.rq_state[0]) != 0)) return rc; return 0; } torque-2.4.16/src/lib/Libifl/enc_CpyFil.c0000664000113300011330000001363611306021360014752 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_CopyFiles() - encode a Copy Files Dependency Batch Request * * This request is used by the server ONLY; its input is a server * batch request structure. * * Data items are: string job id * string job owner (may be null) * string execution user name * string execution group name (may be null) * unsigned int direction * unsigned int count of file pairs in set * set of file pairs: * unsigned int flag * string local path name * string remote path name (may be null) */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int encode_DIS_CopyFiles(int sock, struct batch_request *preq) { int pair_ct = 0; char *nullstr = ""; struct rqfpair *ppair; int rc; ppair = (struct rqfpair *)GET_NEXT(preq->rq_ind.rq_cpyfile.rq_pair); while (ppair) { ++pair_ct; ppair = (struct rqfpair *)GET_NEXT(ppair->fp_link); } if ((rc = diswst(sock, preq->rq_ind.rq_cpyfile.rq_jobid) != 0) || (rc = diswst(sock, preq->rq_ind.rq_cpyfile.rq_owner) != 0) || (rc = diswst(sock, preq->rq_ind.rq_cpyfile.rq_user) != 0) || (rc = diswst(sock, preq->rq_ind.rq_cpyfile.rq_group) != 0) || (rc = diswui(sock, preq->rq_ind.rq_cpyfile.rq_dir) != 0)) return rc; if ((rc = diswui(sock, pair_ct) != 0)) return rc; ppair = (struct rqfpair *)GET_NEXT(preq->rq_ind.rq_cpyfile.rq_pair); while (ppair) { if (ppair->fp_rmt == NULL) ppair->fp_rmt = strdup(nullstr); if ((rc = diswui(sock, ppair->fp_flag) != 0) || (rc = diswst(sock, ppair->fp_local) != 0) || (rc = diswst(sock, ppair->fp_rmt) != 0)) return rc; ppair = (struct rqfpair *)GET_NEXT(ppair->fp_link); } return 0; } torque-2.4.16/src/lib/Libifl/nonblock.c0000664000113300011330000000520311272401246014542 00000000000000/* * Defns of nonblocking read,write. * Headers redefine read/write to name these instead, before inclusion * of stdio.h, so system declaration is used. */ #include #include #include #include /* * Assumes full-block read/write. No accounting for partial blocks, * this would have had to be handled by the main pbs code anyway. */ ssize_t write_nonblocking_socket( int fd, /* I */ const void *buf, /* I */ ssize_t count) /* I */ { ssize_t i; for (;;) { i = write(fd, buf, count); if (i >= 0) { /* successfully wrote 'i' bytes */ return(i); } if (errno != EAGAIN) { /* write failed */ return(i); } } /* NOTE: what is current SIGPIPE handling behavior? */ /* non-blocking socket not ready. no bytes written */ return(0); } /* END write_nonblocking_socket() */ ssize_t read_nonblocking_socket( int fd, void *buf, ssize_t count) { int flags; ssize_t i; time_t start, now; /* verify socket is non-blocking */ /* NOTE: under some circumstances, a blocking fd will be passed */ if ((flags = fcntl(fd, F_GETFL)) == -1) { return(-1); } #if defined(FNDELAY) && !defined(__hpux) if (flags & FNDELAY) #else if (flags & O_NONBLOCK) #endif { /* flag already set */ /* NO-OP */ } else { /* set no delay */ #if defined(FNDELAY) && !defined(__hpux) flags |= FNDELAY; #else flags |= O_NONBLOCK; #endif /* NOTE: the pbs scheduling API passes in a blocking socket which should be a non-blocking socket in pbs_disconnect. Also, qsub passes in a blocking socket which must remain non-blocking */ /* the below non-blocking socket flag check should be rolled into pbs_disconnect and removed from here (NYI) */ /* if (fcntl(fd,F_SETFL,flags) == -1) { return(-1); } */ } /* END else (flags & BLOCK) */ /* Set a timer to prevent an infinite loop here. */ start = -1; for (;;) { i = read(fd, buf, count); if (i >= 0) { return(i); } if (errno != EAGAIN) { return(i); } time(&now); if (start == -1) { start = now; } else if ((now - start) > 30) { return(i); } } /* END for () */ /*NOTREACHED*/ return(0); } /* END read_nonblocking_socket() */ /* * Call the real read, for things that want to block. */ ssize_t read_blocking_socket( int fd, void *buf, ssize_t count) { return(read(fd, buf, count)); } torque-2.4.16/src/lib/Libifl/pbsD_orderjo.c0000664000113300011330000001201111306021360015335 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_orderjob.c */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_orderjob(int c, char *job1, char *job2, char *extend) { struct batch_reply *reply; int rc; int sock; if ((job1 == (char *)0) || (*job1 == '\0') || (job2 == (char *)0) || (*job2 == '\0')) return (pbs_errno = PBSE_IVALREQ); sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_OrderJob, pbs_current_user)) || (rc = encode_DIS_MoveJob(sock, job1, job2)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } if (DIS_tcp_wflush(sock)) { return (pbs_errno = PBSE_PROTOCOL); } /* read reply */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return connection[c].ch_errno; } torque-2.4.16/src/lib/Libifl/dec_RunJob.c0000664000113300011330000001203711306021360014743 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_RunJob() - decode a Run Job batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: string job id * string destination * unsigned int resource_handle */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_RunJob(int sock, struct batch_request *preq) { int rc; preq->rq_ind.rq_run.rq_destin = 0; rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_run.rq_jid); if (rc) return rc; /* This will need to be changed for nodes for FPA */ preq->rq_ind.rq_run.rq_destin = disrst(sock, &rc); if (rc) return rc; preq->rq_ind.rq_run.rq_resch = disrui(sock, &rc); return rc; } torque-2.4.16/src/lib/Libifl/dec_JobObit.c0000664000113300011330000001212411306021360015071 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" /* * decode_DIS_JobObit() - decode a Job Obituary Batch Request (Notice) * * This request is used by the server ONLY. * The batch request structure must already exist. * * Data items are: string job id * signed int status * list of svrattrl */ int decode_DIS_JobObit( int sock, /* I */ struct batch_request *preq) /* O */ { int rc; CLEAR_HEAD(preq->rq_ind.rq_jobobit.rq_attr); rc = disrfst(sock, PBS_MAXSVRJOBID, preq->rq_ind.rq_jobobit.rq_jid); if (rc != 0) { return(rc); } preq->rq_ind.rq_jobobit.rq_status = disrsi(sock, &rc); if (rc != 0) { return(rc); } /* decode list of svrattrl (if any) */ rc = decode_DIS_svrattrl(sock, &preq->rq_ind.rq_jobobit.rq_attr); return(rc); } /* END decode_DIS_JobObit() */ /* END dec_JobObit.c */ torque-2.4.16/src/lib/Libifl/pbsD_rlsjob.c0000664000113300011330000001136311272401246015204 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_rlsjob.c Release a hold on a job. really just an instance of the "manager" request. */ #include /* the master config generated by configure */ #include #include "libpbs.h" int pbs_rlsjob(int c, char *jobid, char *holdtype, char *extend) { struct attropl aopl; if ((jobid == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); aopl.name = ATTR_h; aopl.resource = (char *)NULL; if ((holdtype == (char *)NULL) || (*holdtype == '\0')) aopl.value = "u"; else aopl.value = holdtype; aopl.op = SET; aopl.next = (struct attropl *)NULL; return PBSD_manager(c, PBS_BATCH_ReleaseJob, MGR_CMD_SET, MGR_OBJ_JOB, jobid, &aopl, extend); } torque-2.4.16/src/lib/Libifl/dec_Authen.c0000664000113300011330000001136211306021360014770 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_Authen() - decode a Authenticate User batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: unsigned int port number */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_Authen(int sock, struct batch_request *preq) { int rc; preq->rq_ind.rq_authen.rq_port = disrui(sock, &rc); return rc; } torque-2.4.16/src/lib/Libifl/dec_attropl.c0000664000113300011330000001442711272401246015245 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_attropl() - decode into a list of PBS API "attropl" structures * * The space for the attropl structures is allocated as needed. * * The first item is a unsigned integer, a count of the * number of attropl entries in the linked list. This is encoded * even when there are no entries in the list. * * Each individual entry is encoded as: * u int size of the three strings (name, resource, value) * including the terminating nulls, see dec_svrattrl.c * string attribute name * u int 1 or 0 if resource name does or does not follow * string resource name (if one) * string value of attribute/resource * u int "op" of attrlop (also flag of svrattrl) * * Note, the encoding of a attropl is the same as the encoding of * the pbs_ifl.h structures "attrl" and the server struct svrattrl. * Any one of the three forms can be decoded into any of the three with * the possible loss of the "flags" field (which is the "op" of the * attrlop). */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "dis.h" int decode_DIS_attropl(int sock, struct attropl **ppatt) { int hasresc; unsigned int i; unsigned int name_len; unsigned int numpat; struct attropl *pat = NULL; struct attropl *patprior = NULL; int rc; numpat = disrui(sock, &rc); if (rc) return rc; for (i = 0; i < numpat; ++i) { name_len = disrui(sock, &rc); /* name_len is unused here */ if (rc) break; pat = malloc(sizeof(struct attropl)); if (pat == 0) return DIS_NOMALLOC; pat->next = (struct attropl *)0; pat->name = (char *)0; pat->resource = (char *)0; pat->value = (char *)0; pat->name = disrst(sock, &rc); if (rc) break; hasresc = disrui(sock, &rc); if (rc) break; if (hasresc) { pat->resource = disrst(sock, &rc); if (rc) break; } pat->value = disrst(sock, &rc); if (rc) break; pat->op = (enum batch_op)disrui(sock, &rc); if (rc) break; if (i == 0) { /* first one, link to passing in pointer */ *ppatt = pat; } else { patprior->next = pat; } patprior = pat; } if (rc) PBS_free_aopl(pat); return rc; } torque-2.4.16/src/lib/Libifl/enc_attrl.c0000664000113300011330000001450611306021360014707 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_attrl() - encode a list of PBS API "attrl" structures * * The first item encoded is a unsigned integer, a count of the * number of attrl entries in the linked list. This is encoded * even when there are no svrattrl entries in the list. * * Each individual entry is then encoded as: * u int size of the three strings (name, resource, value) * including the terminating nulls * string attribute name * u int 1 or 0 if resource name does or does not follow * string resource name (if one) * string value of attribute/resource * u int "op" of attrlop, forced to "Set" * * Note, the encoding of an "attrl" is the same as the encoding of * the pbs_ifl.h structures "attrlop" and the server svrattrl. Any * one of the three forms can be decoded into any of the three with the * possible loss of the "flags" field (which is the "op" of the attrlop). */ #include /* the master config generated by configure */ #include "pbs_ifl.h" #include "dis.h" int encode_DIS_attrl( int sock, struct attrl *pattrl) { unsigned int ct = 0; unsigned int name_len; struct attrl *ps; int rc; /* count how many */ for (ps = pattrl;ps != NULL;ps = ps->next) { ++ct; } if ((rc = diswui(sock, ct))) { return(rc); } for (ps = pattrl;ps != NULL;ps = ps->next) { /* length of three strings */ name_len = 0; if (ps->name != NULL) { name_len += (int)strlen(ps->name) + 1; } if (ps->value != NULL) { name_len += (int)strlen(ps->value) + 1; } if (ps->resource != NULL) name_len += strlen(ps->resource) + 1; rc = diswui(sock, name_len); if (rc != 0) break; rc = diswst(sock, ps->name); if (rc != 0) break; if (ps->resource != NULL) { /* has a resource name */ if ((rc = diswui(sock, 1)) != 0) break; if ((rc = diswst(sock, ps->resource)) != 0) break; } else { if ((rc = diswui(sock, 0)) != 0) /* no resource name */ break; } if ((rc = diswst( sock, (ps->value != NULL) ? ps->value : "")) || (rc = diswui(sock, (unsigned int)SET))) break; } /* END for (ps) */ return(rc); } /* END encode_DIS_attrl() */ /* END enc_attrl() */ torque-2.4.16/src/lib/Libifl/PBSD_rdrpy.c0000664000113300011330000001670011306021360014702 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* PBS_rdrpy Read the reply to a batch request. A reply structure is allocated and cleared. The reply is read and decoded into the structure. The reply structure is returned. The caller MUST free the reply structure by calling PBS_FreeReply(). */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include "dis.h" struct batch_reply *PBSD_rdrpy( int c) /* I */ { int rc; struct batch_reply *reply; int sock; /* clear any prior error message */ if (connection[c].ch_errtxt != NULL) { free(connection[c].ch_errtxt); connection[c].ch_errtxt = NULL; } if ((reply = (struct batch_reply *)calloc(1, sizeof(struct batch_reply))) == NULL) { connection[c].ch_errno = PBSE_SYSTEM; pbs_errno = PBSE_SYSTEM; return(NULL); } sock = connection[c].ch_socket; DIS_tcp_setup(sock); if ((rc = decode_DIS_replyCmd(sock, reply))) { free(reply); if (DIS_tcp_istimeout(sock) == TRUE) { pbs_errno = PBSE_TIMEOUT; } else { pbs_errno = PBSE_PROTOCOL; } connection[c].ch_errno = pbs_errno; connection[c].ch_errtxt = strdup(dis_emsg[rc]); return(NULL); } DIS_tcp_reset(sock, 0); /* reset DIS read buffer */ connection[c].ch_errno = reply->brp_code; pbs_errno = reply->brp_code; if (reply->brp_choice == BATCH_REPLY_CHOICE_Text) { connection[c].ch_errtxt = strdup(reply->brp_un.brp_txt.brp_str); } return(reply); } /* END PBSD_rdrpy() */ /* * PBS_FreeReply - Free a batch_reply structure allocated in PBS_rdrpy() * * Any additional allocated substructures pointed to from the * reply structure are freed, then the base struture itself is gone. */ void PBSD_FreeReply( struct batch_reply *reply) { struct brp_select *psel; struct brp_select *pselx; struct brp_cmdstat *pstc; struct brp_cmdstat *pstcx; struct attrl *pattrl; struct attrl *pattrx; if (reply == 0) { return; } if (reply->brp_choice == BATCH_REPLY_CHOICE_Text) { if (reply->brp_un.brp_txt.brp_str) { (void)free(reply->brp_un.brp_txt.brp_str); reply->brp_un.brp_txt.brp_str = (char *)0; reply->brp_un.brp_txt.brp_txtlen = 0; } } else if (reply->brp_choice == BATCH_REPLY_CHOICE_Select) { psel = reply->brp_un.brp_select; while (psel) { pselx = psel->brp_next; (void)free(psel); psel = pselx; } } else if (reply->brp_choice == BATCH_REPLY_CHOICE_Status) { pstc = reply->brp_un.brp_statc; while (pstc) { pstcx = pstc->brp_stlink; pattrl = pstc->brp_attrl; while (pattrl) { pattrx = pattrl->next; if (pattrl->name) (void)free(pattrl->name); if (pattrl->resource) (void)free(pattrl->resource); if (pattrl->value) (void)free(pattrl->value); (void)free(pattrl); pattrl = pattrx; } (void)free(pstc); pstc = pstcx; } } else if (reply->brp_choice == BATCH_REPLY_CHOICE_RescQuery) { (void)free(reply->brp_un.brp_rescq.brq_avail); (void)free(reply->brp_un.brp_rescq.brq_alloc); (void)free(reply->brp_un.brp_rescq.brq_resvd); (void)free(reply->brp_un.brp_rescq.brq_down); } free(reply); return; } /* END PBSD_FreeReply() */ torque-2.4.16/src/lib/Libifl/enc_JobId.c0000664000113300011330000001062111306021360014542 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_JobId() - encode a Job ID string * * This is used for the following batch requests: * Ready_to_Commit * Commit * Locate Job * Rerun Job */ #include /* the master config generated by configure */ #include "pbs_error.h" #include "libpbs.h" #include "dis.h" int encode_DIS_JobId(int sock, char *jobid) { return (diswst(sock, jobid)); } torque-2.4.16/src/lib/Libifl/enc_MsgJob.c0000664000113300011330000001106511306021360014737 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_MessageJob() - encode a Message Job Batch Request * * Data items are: string job id * unsigned int which file (fileopt) * string the message */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_MessageJob(int sock, char *jobid, int fileopt, char *msg) { int rc; if ((rc = diswst(sock, jobid) != 0) || (rc = diswui(sock, fileopt) != 0) || (rc = diswst(sock, msg) != 0)) return rc; return 0; } torque-2.4.16/src/lib/Libifl/PBSD_manage2.c0000664000113300011330000001202611306021360015051 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* PBS_mgr_put.c The send-request side of the PBS_manager function */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int PBSD_mgr_put( int c, /* I */ int function, /* I */ int command, /* I */ int objtype, /* I */ char *objname, /* I */ struct attropl *aoplp, /* I */ char *extend) /* I */ { int rc; int sock; sock = connection[c].ch_socket; DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, function, pbs_current_user)) || (rc = encode_DIS_Manage(sock, command, objtype, objname, aoplp)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } return(0); } /* END PBSD_mgr_put() */ torque-2.4.16/src/lib/Libifl/pbsD_holdjob.c0000664000113300011330000001153311272401246015331 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_holdjob.c Send the Hold Job request to the server -- really just an instance of the "manager" request. */ #include /* the master config generated by configure */ #include #include "libpbs.h" int pbs_holdjob(int c, char *jobid, char *holdtype, char *extend) { struct attropl aopl; if ((jobid == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); aopl.name = ATTR_h; aopl.resource = (char *)NULL; if ((holdtype == (char *)NULL) || (*holdtype == '\0')) aopl.value = "u"; else aopl.value = holdtype; aopl.op = SET; aopl.next = (struct attropl *)NULL; return PBSD_manager(c, PBS_BATCH_HoldJob, MGR_CMD_SET, MGR_OBJ_JOB, jobid, &aopl, extend); } torque-2.4.16/src/lib/Libifl/enc_JobFile.c0000664000113300011330000001136011306021360015066 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_JobFile() - encode a Job Releated File * * Data items are: u int block sequence number * u int file type (stdout, stderr, ...) * u int size of data in block * string job id * cnt str data */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_JobFile(int sock, int seq, char *buf, int len, char *jobid, int which) { int rc; if (jobid == (char *)0) jobid = ""; if ((rc = diswui(sock, seq) != 0) || (rc = diswui(sock, which) != 0) || (rc = diswui(sock, len) != 0) || (rc = diswst(sock, jobid) != 0) || (rc = diswcs(sock, buf, len) != 0)) return rc; return 0; } torque-2.4.16/src/lib/Libifl/dec_JobCred.c0000664000113300011330000001203411306021360015051 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_JobCred() - decode a Job Credential batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: unsigned int credential type * counted string the message */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_JobCred(int sock, struct batch_request *preq) { int rc; size_t rqsize; preq->rq_ind.rq_jobcred.rq_data = 0; preq->rq_ind.rq_jobcred.rq_type = disrui(sock, &rc); if (rc) return rc; preq->rq_ind.rq_jobcred.rq_data = disrcs(sock, &rqsize, &rc); preq->rq_ind.rq_jobcred.rq_size = rqsize; return rc; } torque-2.4.16/src/lib/Libifl/pbsD_statque.c0000664000113300011330000001066311272401246015401 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_statque.c Return the status of a queue. */ #include /* the master config generated by configure */ #include "libpbs.h" struct batch_status *pbs_statque( int c, char *id, struct attrl *attrib, char *extend) { return(PBSD_status(c, PBS_BATCH_StatusQue, id, attrib, extend)); } /* END pbs_statque() */ /* END pbsD_statque.c */ torque-2.4.16/src/lib/Libifl/enc_Shut.c0000664000113300011330000001054011306021360014476 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_ShutDown() - encode a Server Shut Down Batch Request * * Data items are: unsigned int manner */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_ShutDown(int sock, int manner) { return (diswui(sock, manner)); } torque-2.4.16/src/lib/Libifl/dec_Sig.c0000664000113300011330000001157411306021360014273 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_SignalJob() - decode a Signal Job batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: string job id * string signal (name) */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_SignalJob(int sock, struct batch_request *preq) { int rc; rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_signal.rq_jid); if (rc) return rc; rc = disrfst(sock, PBS_SIGNAMESZ + 1, preq->rq_ind.rq_signal.rq_signame); return rc; } torque-2.4.16/src/lib/Libifl/dec_Resc.c0000664000113300011330000001310011306021360014430 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "list_link.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "pbs_error.h" #include "dis.h" /* * decode_DIS_rescl() - decode a resource request * * Used for resource query, resource reserver, resource free. * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have been decoded. * * Data items are: signed int resource handle * unsigned int count of resource queries * followed by that number of: * string resource list */ int decode_DIS_Rescl( int sock, struct batch_request *preq) { int ct; int i; char **ppc; int rc; /* first, the resource handle (even if not used in request) */ preq->rq_ind.rq_rescq.rq_rhandle = disrsi(sock, &rc); if (rc) { return(rc); } /* next need to know how many query strings */ ct = disrui(sock, &rc); if (rc) { return(rc); } preq->rq_ind.rq_rescq.rq_num = ct; if (ct) { if ((ppc = (char **)malloc(ct * sizeof(char *))) == NULL) { return(PBSE_RMSYSTEM); } for (i = 0;i < ct;i++) *(ppc + i) = NULL; preq->rq_ind.rq_rescq.rq_list = ppc; for (i = 0;i < ct;i++) { *(ppc + i) = disrst(sock, &rc); if (rc) break; } } return(rc); } /* END decode_DIS_Rescl() */ torque-2.4.16/src/lib/Libifl/pbsD_submit.c0000664000113300011330000001302311272401246015207 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_submit.c * * The Submit Job request. */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" char *pbs_submit( int c, struct attropl *attrib, char *script, char *destination, char *extend) /* (optional) */ { struct attropl *pal; char * return_jobid = NULL; /* first be sure that the script is readable if specified ... */ if ((script != NULL) && (*script != '\0')) { if (access(script, R_OK) != 0) { pbs_errno = PBSE_BADSCRIPT; return(NULL); } } /* initiate the queueing of the job */ for (pal = attrib;pal != NULL;pal = pal->next) pal->op = SET; /* force operator to SET */ /* Queue job with null string for job id */ return_jobid = PBSD_queuejob(c, "", destination, attrib, extend); if (return_jobid == NULL) { return(NULL); } /* send script across */ if ((script != NULL) && (*script != '\0')) { if (PBSD_jscript(c, script, NULL) != 0) { pbs_errno = PBSE_BADSCRIPT; return(NULL); } } /* OK, the script got across, apparently, so we are */ /* ready to commit */ #ifndef PBS_MOM #ifndef QUICKCOMMIT if (PBSD_rdytocmt(c, return_jobid) != 0) { return(NULL); } #endif #endif if (PBSD_commit(c, return_jobid) != 0) { return(NULL); } return(return_jobid); } /* END pbs_submit() */ /* END pbsD_submit.c */ torque-2.4.16/src/lib/Libifl/pbsD_connect.c0000664000113300011330000005764111446202523015353 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_connect.c * * Open a connection with the TORQUE server. At this point several * things are stubbed out, and other things are hard-wired. * */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_SYS_UCRED_H #include #endif #if HAVE_SYS_UIO_H #include #endif #include "libpbs.h" #include "csv.h" #include "dis.h" #include "net_connect.h" #define CNTRETRYDELAY 5 /* NOTE: globals, must not impose per connection constraints */ static uid_t pbs_current_uid; /* only one uid per requestor */ extern time_t pbs_tcp_timeout; /* source? */ static unsigned int dflt_port = 0; static char server_list[PBS_MAXSERVERNAME*3 + 1]; static char dflt_server[PBS_MAXSERVERNAME + 1]; static char fb_server[PBS_MAXSERVERNAME + 1]; static int got_dflt = FALSE; static char server_name[PBS_MAXSERVERNAME + 1]; /* definite conflicts */ static unsigned int server_port; /* definite conflicts */ static const char *pbs_destn_file = PBS_DEFAULT_FILE; char *pbs_server = NULL; void empty_alarm_handler(int signo) { } /** * Attempts to get a list of server names. Trys first * to obtain the list from an envrionment variable PBS_DEFAULT. * If this is not set, it then trys to read the first line * from the file server_name in the /var/spool/torque * directory. *

* NOTE: PBS_DEFAULT format: [,] * pbs_destn_file format: [,] *

* @return A pointer to the server list. * The side effect is * that the global variable server_list is set. The one-shot * flag got_dflt is used to limit re-reading of the list. * @see pbs_default() * @see pbs_fbserver() */ char *pbs_get_server_list(void) { FILE *fd; char *pn; char *server; char tmp[1024]; int len; if (got_dflt != TRUE) { memset(server_list, 0, sizeof(server_list)); server = getenv("PBS_DEFAULT"); if ((server == NULL) || (*server == '\0')) { server = getenv("PBS_SERVER"); } if ((server == NULL) || (*server == '\0')) { fd = fopen(pbs_destn_file, "r"); if (fd == NULL) { return(server_list); } if (fgets(tmp, sizeof(tmp), fd) == NULL) { fclose(fd); return(server_list); } strcpy(server_list, tmp); if ((pn = strchr(server_list, (int)'\n'))) * pn = '\0'; while(fgets(tmp, sizeof(tmp), fd)) { strcat(server_list, ","); strcat(server_list, tmp); len = strlen(server_list); if(server_list[len-1] == '\n') { server_list[len-1] = '\0'; } } fclose(fd); } else { strncpy(server_list, server, sizeof(server_list)); } got_dflt = TRUE; } /* END if (got_dflt != TRUE) */ return(server_list); } /** * The routine is called to get the name of the primary * server. It can possibly trigger reading of the server name * list from the envrionment or the disk. * As a side effect, it set file local strings dflt_server * and server_name. I am not sure if this is needed but * it seems in the spirit of the original routine. * @return A pointer to the default server name. * @see pbs_fbserver() */ char *pbs_default(void) { char *cp; pbs_get_server_list(); server_name[0] = 0; cp = csv_nth(server_list, 0); /* get the first item from list */ if (cp) { strcpy(dflt_server, cp); strcpy(server_name, cp); } return(server_name); } /** * The routine is called to get the name of the fall-back * server. It can possibly trigger reading of the server name * list from the envrionment or the disk. * As a side effect, it set file local strings fb_server * and server_name. I am not sure if this is needed but * it seems in the spirit of the original routine. * @return A pointer to the fall-back server name. * @see pbs_default() */ char *pbs_fbserver(void) { char *cp; pbs_get_server_list(); server_name[0] = 0; cp = csv_nth(server_list, 1); /* get the second item from list */ if (cp) { strcpy(fb_server, cp); strcpy(server_name, cp); } return(server_name); } static char *PBS_get_server( char *server, /* I (NULL|'\0' for not set,modified) */ unsigned int *port) /* O */ { int i; char *pc; for (i = 0;i < PBS_MAXSERVERNAME + 1;i++) { /* clear global server_name */ server_name[i] = '\0'; } if (dflt_port == 0) { dflt_port = get_svrport( PBS_BATCH_SERVICE_NAME, "tcp", PBS_BATCH_SERVICE_PORT_DIS); } /* first, get the "net.address[:port]" into 'server_name' */ if ((server == (char *)NULL) || (*server == '\0')) { if (pbs_default() == NULL) { return(NULL); } } else { strncpy(server_name, server, PBS_MAXSERVERNAME); } /* now parse out the parts from 'server_name' */ if ((pc = strchr(server_name, (int)':'))) { /* got a port number */ *pc++ = '\0'; *port = atoi(pc); } else { *port = dflt_port; } return(server_name); } /* END PBS_get_server() */ /* * PBS_authenticate - call pbs_iff(1) to authenticate use to the PBS server. */ static int PBSD_authenticate( int psock) /* I */ { char cmd[PBS_MAXSERVERNAME + 80]; int cred_type; int i; int j; FILE *piff; char *ptr; struct stat buf; static char iffpath[1024]; int rc; /* use pbs_iff to authenticate me */ if (iffpath[0] == '\0') { if ((ptr = getenv("PBSBINDIR")) != NULL) { snprintf(iffpath, sizeof(iffpath), "%s/pbs_iff", ptr); } else { strcpy(iffpath, IFF_PATH); } rc = stat(iffpath, &buf); if (rc == -1) { /* cannot locate iff in default location - search PATH */ if ((ptr = getenv("PATH")) != NULL) { ptr = strtok(ptr, ":"); while (ptr != NULL) { snprintf(iffpath, sizeof(iffpath), "%s/pbs_iff", ptr); rc = stat(iffpath, &buf); if (rc != -1) break; ptr = strtok(NULL, ":"); } /* END while (ptr != NULL) */ } /* END if ((ptr = getenv("PATH")) != NULL) */ if (rc == -1) { /* FAILURE */ if (getenv("PBSDEBUG")) { fprintf(stderr, "ALERT: cannot verify file '%s', errno=%d (%s)\n", cmd, errno, strerror(errno)); } /* cannot locate iff in default location - search PATH */ iffpath[0] = '\0'; return(-1); } } } /* END if (iffpath[0] == '\0') */ snprintf(cmd, sizeof(cmd), "%s %s %u %d", iffpath, server_name, server_port, psock); piff = popen(cmd, "r"); if (piff == NULL) { /* FAILURE */ if (getenv("PBSDEBUG")) { fprintf(stderr, "ALERT: cannot open pipe, errno=%d (%s)\n", errno, strerror(errno)); } return(-1); } i = read(fileno(piff), &cred_type, sizeof(int)); if ((i != sizeof(int)) || (cred_type != PBS_credentialtype_none)) { /* FAILURE */ if (getenv("PBSDEBUG")) { if (i != sizeof(int)) { fprintf(stderr, "ALERT: cannot read pipe, rc=%d, errno=%d (%s)\n", i, errno, strerror(errno)); } else { fprintf(stderr, "ALERT: invalid cred type %d reported\n", cred_type); } } pclose(piff); return(-1); } /* END if ((i != sizeof(int)) || ...) */ j = pclose(piff); if (j != 0) { /* FAILURE */ if (getenv("PBSDEBUG")) { fprintf(stderr, "ALERT: cannot close pipe, errno=%d (%s)\n", errno, strerror(errno)); } /* report failure but do not fail (CRI) */ /* return(-1); */ } /* SUCCESS */ return(0); } /* END PBSD_authenticate() */ #ifdef ENABLE_UNIX_SOCKETS ssize_t send_unix_creds(int sd) { struct iovec vec; struct msghdr msg; struct cmsghdr *cmsg; char dummy = 'm'; char buf[CMSG_SPACE(sizeof(struct ucred))]; struct ucred *uptr; memset(&msg, 0, sizeof(msg)); vec.iov_base = &dummy; vec.iov_len = 1; msg.msg_iov = &vec; msg.msg_iovlen = 1; msg.msg_control = buf; msg.msg_controllen = sizeof(buf); cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDS; cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); uptr = (struct ucred *)CMSG_DATA(cmsg); SPC_PEER_UID(uptr) = getuid(); SPC_PEER_GID(uptr) = getgid(); #ifdef linux uptr->pid = getpid(); #endif msg.msg_controllen = cmsg->cmsg_len; return (sendmsg(sd, &msg, 0) != -1); } #endif /* END ENABLE_UNIX_SOCKETS */ /* returns socket descriptor or negative value (-1) on failure */ /* NOTE: cannot use globals or static information as API may be used to connect a single server to multiple TORQUE interfaces */ /* NOTE: 0 is not a valid return value */ int pbs_original_connect( char *server) /* I (FORMAT: NULL | '\0' | HOSTNAME | HOSTNAME:PORT )*/ { struct sockaddr_in server_addr; struct hostent *hp; int out; int i; struct passwd *pw; int use_unixsock = 0; #ifdef ENABLE_UNIX_SOCKETS struct sockaddr_un unserver_addr; char hnamebuf[256]; #endif char *ptr; /* reserve a connection state record */ out = -1; for (i = 1;i < NCONNECTS;i++) { if (connection[i].ch_inuse) continue; out = i; connection[out].ch_inuse = 1; connection[out].ch_errno = 0; connection[out].ch_socket = -1; connection[out].ch_errtxt = NULL; break; } if (out < 0) { pbs_errno = PBSE_NOCONNECTS; if (getenv("PBSDEBUG")) fprintf(stderr, "ALERT: cannot locate free channel\n"); /* FAILURE */ return(-1); } /* get server host and port */ server = PBS_get_server(server, &server_port); if (server == NULL) { connection[out].ch_inuse = 0; pbs_errno = PBSE_NOSERVER; if (getenv("PBSDEBUG")) fprintf(stderr, "ALERT: PBS_get_server() failed\n"); return(-1); } /* determine who we are */ pbs_current_uid = getuid(); if ((pw = getpwuid(pbs_current_uid)) == NULL) { pbs_errno = PBSE_SYSTEM; if (getenv("PBSDEBUG")) { fprintf(stderr, "ALERT: cannot get password info for uid %ld\n", (long)pbs_current_uid); } return(-1); } strcpy(pbs_current_user, pw->pw_name); pbs_server = server; /* set for error messages from commands */ #ifdef ENABLE_UNIX_SOCKETS /* determine if we want to use unix domain socket */ if (!strcmp(server, "localhost")) use_unixsock = 1; else if ((gethostname(hnamebuf, sizeof(hnamebuf) - 1) == 0) && !strcmp(hnamebuf, server)) use_unixsock = 1; /* NOTE: if any part of using unix domain sockets fails, * we just cleanup and try again with inet sockets */ /* get socket */ if (use_unixsock) { connection[out].ch_socket = socket(AF_UNIX, SOCK_STREAM, 0); if (connection[out].ch_socket < 0) { if (getenv("PBSDEBUG")) { fprintf(stderr, "ERROR: cannot create socket: errno=%d (%s)\n", errno, strerror(errno)); } connection[out].ch_inuse = 0; pbs_errno = PBSE_PROTOCOL; use_unixsock = 0; } } /* and connect... */ if (use_unixsock) { unserver_addr.sun_family = AF_UNIX; strcpy(unserver_addr.sun_path, TSOCK_PATH); if (connect( connection[out].ch_socket, (struct sockaddr *)&unserver_addr, (strlen(unserver_addr.sun_path) + sizeof(unserver_addr.sun_family))) < 0) { close(connection[out].ch_socket); connection[out].ch_inuse = 0; pbs_errno = errno; if (getenv("PBSDEBUG")) { fprintf(stderr, "ERROR: cannot connect to server, errno=%d (%s)\n", errno, strerror(errno)); } use_unixsock = 0; /* will try again with inet socket */ } } if (use_unixsock) { if (!send_unix_creds(connection[out].ch_socket)) { if (getenv("PBSDEBUG")) { fprintf(stderr, "ERROR: cannot send unix creds to pbs_server: errno=%d (%s)\n", errno, strerror(errno)); } close(connection[out].ch_socket); connection[out].ch_inuse = 0; pbs_errno = PBSE_PROTOCOL; use_unixsock = 0; /* will try again with inet socket */ } } #endif /* END ENABLE_UNIX_SOCKETS */ if (!use_unixsock) { /* at this point, either using unix sockets failed, or we determined not to * try */ connection[out].ch_socket = socket(AF_INET, SOCK_STREAM, 0); if (connection[out].ch_socket < 0) { if (getenv("PBSDEBUG")) { fprintf(stderr, "ERROR: cannot connect to server \"%s\", errno=%d (%s)\n", server, errno, strerror(errno)); } connection[out].ch_inuse = 0; pbs_errno = PBSE_PROTOCOL; return(-1); } server_addr.sin_family = AF_INET; hp = NULL; hp = gethostbyname(server); if (hp == NULL) { close(connection[out].ch_socket); connection[out].ch_inuse = 0; pbs_errno = PBSE_BADHOST; if (getenv("PBSDEBUG")) { fprintf(stderr, "ERROR: cannot get servername (%s) errno=%d (%s)\n", (server != NULL) ? server : "NULL", errno, strerror(errno)); } return(-1); } memcpy((char *)&server_addr.sin_addr, hp->h_addr_list[0], hp->h_length); server_addr.sin_port = htons(server_port); if (connect( connection[out].ch_socket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { close(connection[out].ch_socket); connection[out].ch_inuse = 0; pbs_errno = errno; if (getenv("PBSDEBUG")) { fprintf(stderr, "ERROR: cannot connect to server, errno=%d (%s)\n", errno, strerror(errno)); } return(-1); } /* FIXME: is this necessary? Contributed by one user that fixes a problem, but doesn't fix the same problem for another user! */ #if 0 #if defined(__hpux) /*HP-UX : avoiding socket caching */ send(connection[out].ch_socket, '?', 1, MSG_OOB); #endif #endif /* Have pbs_iff authenticate connection */ if ((ENABLE_TRUSTED_AUTH == FALSE) && (PBSD_authenticate(connection[out].ch_socket) != 0)) { close(connection[out].ch_socket); connection[out].ch_inuse = 0; pbs_errno = PBSE_PERM; if (getenv("PBSDEBUG")) { fprintf(stderr, "ERROR: cannot authenticate connection to server \"%s\", errno=%d (%s)\n", server, errno, strerror(errno)); } return(-1); } } /* END if !use_unixsock */ /* setup DIS support routines for following pbs_* calls */ DIS_tcp_setup(connection[out].ch_socket); if ((ptr = getenv("PBSAPITIMEOUT")) != NULL) { pbs_tcp_timeout = strtol(ptr, NULL, 0); if (pbs_tcp_timeout <= 0) { pbs_tcp_timeout = 10800; /* set for 3 hour time out */ } } else { pbs_tcp_timeout = 10800; /* set for 3 hour time out */ } return(out); } /* END pbs_original_connect() */ int pbs_disconnect( int connect) /* I (socket descriptor) */ { int sock; static char x[THE_BUF_SIZE / 4]; /* send close-connection message */ sock = connection[connect].ch_socket; DIS_tcp_setup(sock); if ((encode_DIS_ReqHdr(sock, PBS_BATCH_Disconnect, pbs_current_user) == 0) && (DIS_tcp_wflush(sock) == 0)) { int atime; struct sigaction act; struct sigaction oldact; /* set alarm to break out of potentially infinite read */ /* act.sa_handler = SIG_IGN; */ act.sa_handler = empty_alarm_handler; /* need SOME handler or blocking read never gets interrupted */ sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(SIGALRM, &act, &oldact); atime = alarm(pbs_tcp_timeout); while (1) { /* wait for server to close connection */ /* NOTE: if read of 'sock' is blocking, request below may hang forever * hence the signal handler empty_alarm_handler above */ if (read(sock, &x, sizeof(x)) < 1) break; } alarm(atime); sigaction(SIGALRM, &oldact, NULL); } close(sock); if (connection[connect].ch_errtxt != (char *)NULL) free(connection[connect].ch_errtxt); connection[connect].ch_errno = 0; connection[connect].ch_inuse = 0; return(0); } /* END pbs_disconnect() */ /** * This is a new version of this function that allows * connecting to a list of servers. It is backwards * compatible with the previous version in that it * will accept a single server name. * * @param server_name_ptr A pointer to a server name or server name list. * @returns A file descriptor number. */ int pbs_connect(char *server_name_ptr) /* I (optional) */ { int connect = -1; int i, list_len; char server_name_list[PBS_MAXSERVERNAME*3+1]; char current_name[PBS_MAXSERVERNAME+1]; char *tp; memset(server_name_list, 0, sizeof(server_name_list)); /* If a server name is passed in, use it, otherwise use the list from server_name file. */ if (server_name_ptr && server_name_ptr[0]) { strncpy(server_name_list, server_name_ptr, sizeof(server_name_list) - 1); if (getenv("PBSDEBUG")) { fprintf(stderr, "pbs_connect called with explicit server name \"%s\"\n", server_name_list); } } else { strncpy(server_name_list, pbs_get_server_list(), sizeof(server_name_list) - 1); if (getenv("PBSDEBUG")) { fprintf(stderr, "pbs_connect using default server name list \"%s\"\n", server_name_list); } } list_len = csv_length(server_name_list); for (i = 0; i < list_len; i++) /* Try all server names in the list. */ { tp = csv_nth(server_name_list, i); if (tp && tp[0]) { memset(current_name, 0, sizeof(current_name)); strncpy(current_name, tp, sizeof(current_name) - 1); if (getenv("PBSDEBUG")) { fprintf(stderr, "pbs_connect attempting connection to server \"%s\"\n", current_name); } if ((connect = pbs_original_connect(current_name)) >= 0) { if (getenv("PBSDEBUG")) { fprintf(stderr, "pbs_connect: Successful connection to server \"%s\", fd = %d\n", current_name, connect); } return(connect); /* Success, we have a connection, return it. */ } } } return(connect); } /** * This routine is not used but was implemented to * support qsub. * * @param server_name_ptr A pointer to a server name or server name list. * @param retry_seconds The period of time for which retrys should be attempted. * @returns A file descriptor number. */ int pbs_connect_with_retry(char *server_name_ptr, int retry_seconds) { int n_times_to_try = retry_seconds / CNTRETRYDELAY; int connect = -1; int n; for (n = 0; n < n_times_to_try; n++) /* This is the retry loop */ { if ((connect = pbs_connect(server_name_ptr)) >= 0) return(connect); /* Success, we have a connection, return it. */ sleep(CNTRETRYDELAY); } return(connect); } int pbs_query_max_connections(void) { return(NCONNECTS - 1); } /* END pbsD_connect.c */ torque-2.4.16/src/lib/Libifl/dec_rpyc.c0000664000113300011330000002336411306021360014526 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_replyCmd() - decode a Batch Protocol Reply Structure for a Command * * This routine decodes a batch reply into the form used by commands. * The only difference between this and the server version is on status * replies. For commands, the attributes are decoded into a list of * attrl structure rather than the server's svrattrl. * * batch_reply structure defined in libpbs.h, it must be allocated * by the caller. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" #include "batch_request.h" extern int decode_DIS_attrl(int, struct attrl **); int decode_DIS_replyCmd( int sock, struct batch_reply *reply) { int ct; int i; struct brp_select *psel; struct brp_select **pselx; struct brp_cmdstat *pstcmd; struct brp_cmdstat **pstcx; int rc = 0; /* first decode "header" consisting of protocol type and version */ i = disrui(sock, &rc); if (rc != 0) { return(rc); } if (i != PBS_BATCH_PROT_TYPE) { return(DIS_PROTO); } i = disrui(sock, &rc); if (rc != 0) { return(rc); } if (i != PBS_BATCH_PROT_VER) { return(DIS_PROTO); } /* next decode code, auxcode and choice (union type identifier) */ reply->brp_code = disrsi(sock, &rc); if (rc != 0) { return(rc); } reply->brp_auxcode = disrsi(sock, &rc); if (rc != 0) { return(rc); } reply->brp_choice = disrui(sock, &rc); if (rc != 0) { return(rc); } switch (reply->brp_choice) { case BATCH_REPLY_CHOICE_NULL: break; /* no more to do */ case BATCH_REPLY_CHOICE_Queue: case BATCH_REPLY_CHOICE_RdytoCom: case BATCH_REPLY_CHOICE_Commit: if ((rc = disrfst(sock, PBS_MAXSVRJOBID + 1, reply->brp_un.brp_jid))) { return(rc); } break; case BATCH_REPLY_CHOICE_Select: /* have to get count of number of strings first */ reply->brp_un.brp_select = NULL; pselx = &reply->brp_un.brp_select; ct = disrui(sock, &rc); if (rc) { return(rc); } while (ct--) { psel = (struct brp_select *)malloc(sizeof(struct brp_select)); if (psel == NULL) { return(DIS_NOMALLOC); } psel->brp_next = NULL; psel->brp_jobid[0] = '\0'; rc = disrfst(sock, PBS_MAXSVRJOBID + 1, psel->brp_jobid); if (rc) { free(psel); return(rc); } *pselx = psel; pselx = &psel->brp_next; } break; case BATCH_REPLY_CHOICE_Status: /* have to get count of number of status objects first */ reply->brp_un.brp_statc = NULL; pstcx = &reply->brp_un.brp_statc; ct = disrui(sock, &rc); if (rc) { return(rc); } while (ct--) { pstcmd = (struct brp_cmdstat *)malloc(sizeof(struct brp_cmdstat)); if (pstcmd == NULL) { return(DIS_NOMALLOC); } pstcmd->brp_stlink = NULL; pstcmd->brp_objname[0] = '\0'; pstcmd->brp_attrl = NULL; pstcmd->brp_objtype = disrui(sock, &rc); if (rc == 0) { rc = disrfst(sock, PBS_MAXSVRJOBID + 1, pstcmd->brp_objname); } if (rc) { free(pstcmd); return(rc); } rc = decode_DIS_attrl(sock, &pstcmd->brp_attrl); if (rc) { free(pstcmd); return(rc); } *pstcx = pstcmd; pstcx = &pstcmd->brp_stlink; } break; case BATCH_REPLY_CHOICE_Text: /* text reply */ reply->brp_un.brp_txt.brp_str = disrcs( sock, &reply->brp_un.brp_txt.brp_txtlen, &rc); break; case BATCH_REPLY_CHOICE_Locate: /* Locate Job Reply */ rc = disrfst(sock, PBS_MAXDEST + 1, reply->brp_un.brp_locate); break; case BATCH_REPLY_CHOICE_RescQuery: /* Resource Query Reply */ reply->brp_un.brp_rescq.brq_avail = NULL; reply->brp_un.brp_rescq.brq_alloc = NULL; reply->brp_un.brp_rescq.brq_resvd = NULL; reply->brp_un.brp_rescq.brq_down = NULL; ct = disrui(sock, &rc); if (rc) break; reply->brp_un.brp_rescq.brq_number = ct; reply->brp_un.brp_rescq.brq_avail = (int *)malloc(ct * sizeof(int)); reply->brp_un.brp_rescq.brq_alloc = (int *)malloc(ct * sizeof(int)); reply->brp_un.brp_rescq.brq_resvd = (int *)malloc(ct * sizeof(int)); reply->brp_un.brp_rescq.brq_down = (int *)malloc(ct * sizeof(int)); if ((reply->brp_un.brp_rescq.brq_avail == NULL) || (reply->brp_un.brp_rescq.brq_alloc == NULL) || (reply->brp_un.brp_rescq.brq_resvd == NULL) || (reply->brp_un.brp_rescq.brq_down == NULL)) { return(DIS_NOMALLOC); } for (i = 0;(i < ct) && (rc == 0);++i) *(reply->brp_un.brp_rescq.brq_avail + i) = disrui(sock, &rc); for (i = 0;(i < ct) && (rc == 0);++i) *(reply->brp_un.brp_rescq.brq_alloc + i) = disrui(sock, &rc); for (i = 0;(i < ct) && (rc == 0);++i) *(reply->brp_un.brp_rescq.brq_resvd + i) = disrui(sock, &rc); for (i = 0;(i < ct) && (rc == 0);++i) *(reply->brp_un.brp_rescq.brq_down + i) = disrui(sock, &rc); break; default: return(-1); /*NOTREACHED*/ break; } /* END switch (reply->brp_choice) */ return(rc); } /* END decode_DIS_replyCmd() */ /* END dec_rpyc.c */ torque-2.4.16/src/lib/Libifl/PBSD_status.c0000664000113300011330000001664311272401246015102 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* PBS_status.c The function that underlies all the status requests */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" static struct batch_status *alloc_bs(); struct batch_status *PBSD_status( int c, /* I - socket descriptor */ int function, /* I - ??? */ char *id, /* I - object id (optional) */ struct attrl *attrib, /* I */ char *extend) /* I/O */ { int rc; /* send the status request */ if (id == NULL) id = ""; /* set to null string for encoding */ rc = PBSD_status_put(c, function, id, attrib, extend); if (rc != 0) { if (pbs_errno == 0) pbs_errno = PBSE_PROTOCOL; if (extend != NULL) strcpy(extend, "timeout"); return((struct batch_status *)NULL); } /* get the status reply */ pbs_errno = 0; return(PBSD_status_get(c)); } /* END PBSD_status() */ struct batch_status *PBSD_status_get( int c) /* I */ { struct brp_cmdstat *stp; /* pointer to a returned status record */ struct batch_status *bsp = NULL; struct batch_status *rbsp = (struct batch_status *)NULL; struct batch_reply *reply; int i; /* read reply from stream into presentation element */ pbs_errno = 0; reply = PBSD_rdrpy(c); if (reply == NULL) { pbs_errno = PBSE_PROTOCOL; } else if ((reply->brp_choice != BATCH_REPLY_CHOICE_NULL) && (reply->brp_choice != BATCH_REPLY_CHOICE_Text) && (reply->brp_choice != BATCH_REPLY_CHOICE_Status)) { pbs_errno = PBSE_PROTOCOL; } else if (connection[c].ch_errno != 0) { char tmpLine[1024]; if (pbs_errno == 0) pbs_errno = PBSE_PROTOCOL; sprintf(tmpLine, "PBS API connection failed with pbserrno=%d\n", connection[c].ch_errno); } else { /* query is successful */ /* have zero or more attrl structs to decode here */ stp = reply->brp_un.brp_statc; i = 0; pbs_errno = 0; while (stp != NULL) { if (i++ == 0) { bsp = alloc_bs(); rbsp = bsp; if (bsp == (struct batch_status *)NULL) { pbs_errno = PBSE_SYSTEM; break; } } else { bsp->next = alloc_bs(); bsp = bsp->next; if (bsp == (struct batch_status *)NULL) { pbs_errno = PBSE_SYSTEM; break; } } bsp->name = strdup(stp->brp_objname); bsp->attribs = stp->brp_attrl; if (stp->brp_attrl != NULL) stp->brp_attrl = NULL; bsp->next = (struct batch_status *)NULL; stp = stp->brp_stlink; } /* END while (stp != NULL) */ if (pbs_errno != 0) { /* destroy corrupt results */ pbs_statfree(rbsp); rbsp = (struct batch_status *)NULL; } } /* END else */ PBSD_FreeReply(reply); return(rbsp); } /* END PBSD_status_get() */ /* Allocate a batch status reply structure */ static struct batch_status * alloc_bs(void) { struct batch_status *bsp; /* allocate memory */ bsp = MH(struct batch_status); if (bsp != NULL) { bsp->next = (struct batch_status *)NULL; bsp->name = (char *)NULL; bsp->attribs = (struct attrl *)NULL; bsp->text = (char *)NULL; } return(bsp); } /* END PBSD_status.c */ torque-2.4.16/src/lib/Libifl/rpp.c0000664000113300011330000022600311305006374013541 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* ** Routines to communicate with UDP packets - Reliable Packet Protocol. ** ** This package provides for sending information in "messages" ** which are complete blocks of data which will either arrive ** complete or not at all. */ #if !defined(_BSD) && defined(_AIX) /* this is needed by AIX */ #define _BSD 1 #endif #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H) #include #endif #include "rpp.h" #if !defined(H_ERRNO_DECLARED) && !defined(_AIX) extern int h_errno; #endif /* ** Boolean Constants */ #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif /* ** Turn on for debug log dump to /tmp. #define RPPLOG 1 */ /* ** Size-Constants for the various parts of RPP packet */ #define RPP_PKT_SIZE 4*1024 /* max packet length, including header */ #define RPP_PKT_HEAD 26 /* Size of packet header, includes CRC */ #define RPP_HDR_SID 2 /* position of stream id in packet header */ #define RPP_HDR_SEQ 10 /* position of "sequence" in pkt header */ #define RPP_CRC_LEN 8 /* Length of CRC field in pkt header */ #define RPP_PKT_CRC (RPP_PKT_HEAD - RPP_CRC_LEN) #define RPP_PKT_DATA (RPP_PKT_SIZE - RPP_PKT_HEAD) /* ** RPP packet-header fields ** ** length field ** ======== ========= ** 2 type ** 8 stream id ** 8 sequence ** 8 crc */ /* ** Integer codes for all the valid RPP message types */ #define RPP_ACK 1 #define RPP_DATA 2 #define RPP_EOD 3 #define RPP_HELLO1 4 #define RPP_HELLO2 5 #define RPP_GOODBYE 6 /* ** Integer codes for all the valid RPP state values */ #define RPP_DEAD -1 /* only set during clear_stream() */ #define RPP_FREE 0 #define RPP_OPEN_PEND 1 #define RPP_OPEN_WAIT 2 #define RPP_CONNECT 3 #define RPP_CLOSE_PEND 4 #define RPP_LAST_ACK 5 #define RPP_CLOSE_WAIT1 6 #define RPP_CLOSE_WAIT2 7 #define RPP_STALE 99 /* set when a packet has been sent more than RPP_RETRY times */ /* ** Time in seconds; packet on the master send queue is not sent more ** often than every RPP_TIMEOUT seconds. */ #define DEFAULT_RPP_TIMEOUT 4 /* ** Default number of sendto attempts on a *packet. */ #define DEFAULT_RPP_RETRY 48 /* ** Max allowed number of outstanding pkts */ #define RPP_HIGHWATER 60 int RPPTimeOut = DEFAULT_RPP_TIMEOUT; int RPPRetry = DEFAULT_RPP_RETRY; /* external prototypes */ void rpp_shutdown_on_exit(int, void *); /* END external prototypes */ /* ** Several kinds of linked lists hang from each RPP stream structure. ** In particular, each stream structure has a list of send_packet ** structures. These structures record information that's necessary for ** managing a piece of data that's being sent to the other end of the ** connection. Besides having a pointer that links it to the next ** send_packet on the stream, a send_packet posseses a pair of pointers ** (up,down) which link the send_packet to the master send list when ** connection sequencing has reached the point where it is now proper to ** attach it to the list (stream is fully opened). Once on the master ** sendlist, any invocation of the rpp_send_out routine will attempt to ** transfer the send_packet's data buffer to the other end of the stream ** connection if all of the following hold: ** ** 1) packet hasn't reached its maximum-transfer-attempt limit ** 2) RPP_TIMEOUT or more seconds have elapsed since the last attempt ** 3) the transfer has yet to be ACK'd by the other side. ** 4) less than RPP_HIGHWATER number of non-duplicate packets are ** un-ACK'd ** ** Those "send_packets" that deal with stream control ** (RPP_ACK, RPP_HELLO1, RPP_HELLO2, RPP_GOODBYE) have no ** associated data, the send_packet's data buffer is comprised ** of only the header. */ struct send_packet { u_char *data; /* points to a buffer to be transferred */ u_short type; /* RPP_ACK, RPP_HELLO1, RPP_DATA, etc */ u_short sent_out; /* number of times sent; <= sp->retry */ int len; /* size *data not counting the header */ int index; /* other end's stream id */ int sequence; /* sequential value that is placed into */ /* data buffer's header and is returned */ /* in the RPP_ACK; identifies the data */ /* that was transferred and now needs */ /* to be removed from master send list */ time_t time_sent; /* time packet was last sent; zero if */ /* it has yet to be sent */ struct send_packet *next; /* next packet on stream's send list */ struct send_packet *up; /* used when the send_packet is */ /* on RPP's master send list */ /* pointer to preceeding packet */ struct send_packet *down; /* similar to up, but pointing to */ /* packet following this one */ }; /* ** Hanging from an stream structure is a linked list of recv_packets ** Each recv_packet records the information necessary for managing a ** piece of data that was received from the other end of a connection. ** With the exception of RPP_GOODBYE (a surrogate RPP_EOD), pkts that deal ** with stream control (RPP_ACK,RPP_HELLO1,RPP_HELLO2,) don't ever make it ** to the stream's receive list, they are handled directly as they come ** in. So, the only types of packets on a stream's receive list should ** be ones of type RPP_DATA, RPP_EOD, and RPP_GOODBYE. */ struct recv_packet { u_char *data; /* pointer to byte string that was sent from */ /* the other end of the stream */ u_short type; /* RPP_DATA, RPP_EOD or RPP_GOODBYE; i.e. a */ /* piece of the message or the end of the */ /* message (RPP_EOD or RPP_GOODBYE) */ int len; /* size in bytes of the received string; */ /* does not include the length of the header */ int sequence; /* decoded sequential number; it describes */ /* the buffer's sequential output order */ /* relative to the other buffers */ struct recv_packet *next; /* pointer to next recv_packet in */ /* the linked receive list for */ /* this stream */ }; /* ** Each stream structure has a linked list of pend structs hanging ** from it. This list of structs is used to manage a set of data buffers ** that may or may not all get 'packetized' and sent over to the other ** end of the connection. Subsequent to the creation of the list of data ** buffers, the creating program decides to either commit or not commit ** the sending of this data to the other side-- done by calling the ** interface function, rpp_wcommit. The interface function ** rpp_write doesn't send the data, it merely ** attaches the data buffer to a pending struct and links this struct to ** the stream's list of pending structs. No transfer to the other end ** gets set in motion by calling rpp_write. ** ** Doing an rpp_wcommit, on the other hand, entails adjoining a header ** to each pending struct's data buffer, attaching the buffer to a ** new send_packet struct, linking the send_packet to the master send ** list, freeing the pend struct, and doing an update of the stream's ** pend_commit variable -- a running sum of the number of bytes sent ** to the other side. ** ** Decommiting data that was written for transfer to the other end entails ** removing and freeing the pending structs and their associated data ** buffer from the stream's pend list and, updating the stream's ** pend_attempt varable back to the byte count that is stored in its ** pend_commit variable. Refer to relevant fields in struct stream. */ struct pending { u_char *data; /* pointer to a buffer of user data */ struct pending *next; /* pointer to the next pending struct */ }; /* ** Every stream that comes into existence during the life of the ** process gets realized on each end of the connection by a stream ** struct. All the stream structs generated by a process are in a ** dynamic array in the process' heap area. ** Each stream is a finite state machine. */ struct stream { int state; /* state of this end of the */ /* connection; RPP_OPEN, etc */ struct sockaddr_in addr; /* address of the other end; */ /* port/family/IPadrs */ struct in_addr *addr_array; /* array of alternate network */ /* addresses for other end */ /* of the connection */ int fd; /* must be in rpp_fd_array */ int stream_id; /* id of other end of the */ /* connection; array position */ /* of stream struct on the */ /* other end */ int retry; /* sendto retry limit */ int open_key; /* unique bit pattern created */ /* by the end issuing the */ /* rpp_open. It's the same */ /* same for each end of the */ /* connecton; used in setting */ /* up the stream connection */ int msg_cnt; /* size in bytes of current */ /* DATA/EOD/GOODBYE message */ int send_sequence; /* initialized to value of 1 */ /* and incremented by 1 for */ /* each packet that's added */ /* to the master send list */ struct pending *pend_head; /* head and tail pointers for */ struct pending *pend_tail; /* stream's pend list; see */ /* struct pend definition */ int pend_commit; /* total number of data bytes */ /* sent to other end connect */ int pend_attempt; /* total number bytes that */ /* reside in the list of */ /* pending struct buffers. */ /* pend_commit<=pend_attempt */ struct send_packet *send_head; /* head and tail pointers for */ struct send_packet *send_tail; /* stream's master send list */ /* see struct send_packet */ int recv_sequence; /* monotonic,increasing, by 1 */ /* starts from zero; A packet */ /* on the stream's recv list */ /* having a sequence number */ /* less than this value is a */ /* packet of an earlier mesg */ struct recv_packet *recv_head; /* head and tail pointers for */ struct recv_packet *recv_tail; /* the stream's recv list; */ /* see struct recv_packet */ int recv_commit; /* number of bytes from */ /* start of current message */ /* that have been accepted */ /* by the reader on this end */ int recv_attempt; /* number bytes, from start */ /* of current message, that */ /* have been read */ }; /* ** Static Variables */ static struct stream *stream_array = NULL; /* pointer to stream struct */ /* dynamic array */ static int stream_num = 0; /* current number of stream */ /* structs in stream_array */ static int pkts_sent = 0; /* range: 0 - RPP_HIGHWATER; */ /* incremented with each new */ /* pkt sent; retransmissions */ /* are not counted */ static int open_key = 0; /* monotonicly increasing */ /* value stored in stream */ /* struct on rpp_open and */ /* passed to other end to */ /* be recorded in */ /* corresponding stream */ /* struct there */ static struct send_packet *top = NULL; /* ptrs to beginning and end */ static struct send_packet *bottom = NULL; /* of master send list; */ /* All sent date is linked */ /* between top and bottom. */ /* ** Global Variables */ int rpp_dbprt = 0; /* controls debug printing */ /* ** Current file descriptor. Any call to rpp_open will use this ** for the returned stream. */ int rpp_fd = -1; /* ** A dynamic array of socket descriptors bound to a network address. ** More than one call to rpp_bind can result in this having multiple ** entries. The value of rpp_fd will be contained in this array. */ int *rpp_fd_array = NULL; /* ** Number of elements in rpp_fd_array */ int rpp_fd_num = 0; /* ** Tables used by the macros I2TOH, HTOI2, I8TOH, HTOI8 ** to convert 2 and 8 digit hexidecimal strings to integer and back. */ char cval[] = { -1, -1, -1, -1, -1, -1, -1, -1, /* nul .. bel */ -1, -1, -1, -1, -1, -1, -1, -1, /* bs .. si */ -1, -1, -1, -1, -1, -1, -1, -1, /* dle .. etb */ -1, -1, -1, -1, -1, -1, -1, -1, /* can .. us */ -1, -1, -1, -1, -1, -1, -1, -1, /* sp .. ' */ -1, -1, -1, -1, -1, -1, -1, -1, /* ( .. / */ 0, 1, 2, 3, 4, 5, 6, 7, /* 0 .. 7 */ 8, 9, -1, -1, -1, -1, -1, -1, /* 8 .. ? */ -1, 10, 11, 12, 13, 14, 15, -1, /* @ .. G */ -1, -1, -1, -1, -1, -1, -1, -1, /* H .. O */ -1, -1, -1, -1, -1, -1, -1, -1, /* P .. W */ -1, -1, -1, -1, -1, -1, -1, -1, /* X .. _ */ -1, 10, 11, 12, 13, 14, 15, -1, /* ` .. g */ -1, -1, -1, -1, -1, -1, -1, -1, /* h .. o */ -1, -1, -1, -1, -1, -1, -1, -1, /* p .. w */ -1, -1, -1, -1, -1, -1, -1, -1 /* x .. del */ }; char ival[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /* ** Conversion macros */ #define I2TOH(i, h) \ { \ int num = i; \ char *str = h; \ str[1] = ival[num & 0xF]; num >>= 4 ; \ str[0] = ival[num & 0xF]; \ } #define I8TOH(i, h) \ { \ u_long num = i; \ char *str = h; \ str[7] = ival[num & 0xF]; num >>= 4; \ str[6] = ival[num & 0xF]; num >>= 4; \ str[5] = ival[num & 0xF]; num >>= 4; \ str[4] = ival[num & 0xF]; num >>= 4; \ str[3] = ival[num & 0xF]; num >>= 4; \ str[2] = ival[num & 0xF]; num >>= 4; \ str[1] = ival[num & 0xF]; num >>= 4; \ str[0] = ival[num & 0xF]; \ } #define HTOI2(h, i) \ { \ char *str = h; \ int num = 0; \ num = cval[str[0] & 0xFF]; num <<= 4; \ num |= cval[str[1] & 0xFF]; \ i = num; \ } #define HTOI8(h, i) \ { \ char *str = h; \ u_long num; \ num = (long)cval[str[0] & 0x7F]; num <<= 4; \ num |= (long)cval[str[1] & 0x7F]; num <<= 4; \ num |= (long)cval[str[2] & 0x7F]; num <<= 4; \ num |= (long)cval[str[3] & 0x7F]; num <<= 4; \ num |= (long)cval[str[4] & 0x7F]; num <<= 4; \ num |= (long)cval[str[5] & 0x7F]; num <<= 4; \ num |= (long)cval[str[6] & 0x7F]; num <<= 4; \ num |= (long)cval[str[7] & 0x7F]; \ i = num; \ } /* ** Different print macros for use in debugging. */ #ifdef DEBUG #define DBTO stdout #define DBPRT(x) \ if (rpp_dbprt) { \ int err = errno; \ fprintf(DBTO, "%lX: ", time(0)); \ fprintf x; \ errno = err; \ } #define DOID(x) static char id[] = x; #elif defined(RPPLOG) static char *blog_buf = NULL; static int blog_buflen = 0; static int blog_head = 0; void blog_init(char *s, int len) { if (blog_buf != NULL || len <= 0) return; if (s == NULL) blog_buf = (char *)malloc(len); else blog_buf = s; blog_buflen = len; } int blog_write(char *s) { int i, len; if (s == NULL || *s == '\0') return 0; if (blog_buf == NULL) blog_init(NULL, 64*1024); len = strlen(s) + 1; if (len > blog_buflen) return -1; for (i = 0; i < len; i++) { blog_buf[blog_head++] = *s++; blog_head %= blog_buflen; } return len -1; } void blog_out(char *filename) { FILE *f; int btrail; int c; if (blog_buf == NULL) return; if ((f = fopen(filename, "a")) == NULL) return; for (btrail = blog_head; blog_buf[btrail] != '\0'; btrail++) btrail %= blog_buflen; for (btrail++; btrail != blog_head; btrail++) { btrail %= blog_buflen; c = (int)blog_buf[btrail]; if (c == '\0') continue; putc(c, f); } fclose(f); return; } static char logbuf[4096], *logp; #define DBTO logp #define DBPRT(x) \ sprintf(logbuf, "%lX: ", time(0)); \ logp = logbuf + strlen(logbuf); \ sprintf x; \ blog_write(logbuf); \ if (rpp_dbprt) { \ int err = errno; \ sprintf(logbuf, "/tmp/rpp_log.%d", getpid()); \ blog_out(logbuf); \ rpp_dbprt = 0; \ errno = err; \ } #define DOID(x) static char id[] = x; #else #define DBTO xxx #define DBPRT(x) #define DOID(x) #endif #ifndef MIN #define MIN(x, y) (((x) < (y)) ? (x) : (y)) #endif #ifndef MAX #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #endif /* ** BEGIN included source */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * James W. Williams of NASA Goddard Space Flight Center. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgment: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ static u_long crctab[] = { 0x0, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 }; /* * Compute a POSIX 1003.2 checksum. This routine has been broken out so that * other programs can use it. It takes a char pointer and length. * It ruturns the crc value for the data in buf. */ u_long crc(buf, clen) u_char *buf; u_long clen; { register u_char *p; register u_long crc, len; #define COMPUTE(var, ch) (var) = (((var) << 8) ^ \ crctab[(((var) >> 24) & 0xff) ^ (ch)]) & 0xffffffff for (crc = 0, len = clen, p = buf; len--; ++p) { COMPUTE(crc, *p); } /* Include the length of the file. */ for (; clen != 0; clen >>= 8) { COMPUTE(crc, clen & 0xff); } return (~crc & 0xffffffff); } /* ** END of included source */ /* ** Generate a sequence number for a packet. */ static int next_seq(int *seq) { (*seq)++; if (*seq < 0) /* had a rollover */ { errno = EFBIG; return -1; } return 0; } /* ** Put a human readable representation of a network addres into ** a staticly allocated string. */ char * netaddr(struct sockaddr_in *ap) { static char out[80]; u_long ipadd; if (ap == NULL) return "unknown"; ipadd = ntohl(ap->sin_addr.s_addr); sprintf(out, "%ld.%ld.%ld.%ld:%d", (ipadd & 0xff000000) >> 24, (ipadd & 0x00ff0000) >> 16, (ipadd & 0x0000ff00) >> 8, (ipadd & 0x000000ff), ntohs(ap->sin_port)); return out; } /* ** Create a packet of the given type, fill in the sequence and ** index number. If buf is NULL, malloc an area for just ** a header. If buf is not NULL, it should contain space ** for len+RPP_PKT_HEADER bytes. */ static void rpp_form_pkt( int index, int type, int seq, u_char *buf, int len) { DOID("form_pkt") struct send_packet *pktp; struct stream *sp; DBPRT((DBTO, "%s: index %d type %d seq %d len %d\n", id, index, type, seq, len)) sp = &stream_array[index]; pktp = (struct send_packet *)malloc(sizeof(struct send_packet)); assert(pktp != NULL); pktp->type = type; pktp->sequence = seq; pktp->time_sent = 0; pktp->sent_out = 0; pktp->len = len; pktp->index = index; if (buf) pktp->data = (u_char *)realloc(buf, len + RPP_PKT_HEAD); else pktp->data = (u_char *)malloc(RPP_PKT_HEAD); assert(pktp->data != NULL); /* ** Put on stream send list */ if (sp->send_head == NULL) sp->send_head = pktp; else sp->send_tail->next = pktp; sp->send_tail = pktp; pktp->next = NULL; pktp->down = NULL; /* ** if open has not completed yet, hold off putting on send queue */ if (sp->stream_id == -1) { pktp->up = NULL; return; } /* ** if the stream is fully open, format and put on the send queue */ DBPRT((DBTO, "%s: idx %d link %d seq %d len %d to sendq\n", id, index, type, seq, len)) I2TOH(type, (char *)&pktp->data[len]) I8TOH(sp->stream_id, (char *)&pktp->data[len+RPP_HDR_SID]) I8TOH(seq, (char *)&pktp->data[len+RPP_HDR_SEQ]) I8TOH(crc(pktp->data, (u_long)(len + RPP_PKT_CRC)), (char *)&pktp->data[len+RPP_PKT_CRC]) if (bottom) bottom->down = pktp; pktp->up = bottom; if (top == NULL) /* first one */ top = pktp; bottom = pktp; return; } /* ** Check to make sure an incoming packet goes with one of the ** streams we have. */ static struct stream *rpp_check_pkt( int index, struct sockaddr_in *addrp) { DOID("check_pkt") struct stream *sp; struct in_addr *addrs; int i; if ((index < 0) || (index >= stream_num)) { DBPRT((DBTO, "%s: BAD INDEX %d outside limit %d\n", id, index, stream_num)) return(NULL); } sp = &stream_array[index]; if (sp->state <= RPP_FREE) { DBPRT((DBTO, "%s: FREE STREAM\n", id)) return(NULL); } if ((addrp->sin_family == 0) || (addrp->sin_family >= AF_MAX)) { /* * Some systems have a buggy recvfrom() that doesn't set * sin_family for UDP sockets. This was directly observed * on Sandia's Tru64 system -garrick */ DBPRT((DBTO, "%s: buggy recvfrom(), fixing bogus sin_family value: %d\n", id, addrp->sin_family)); addrp->sin_family = sp->addr.sin_family; } if (addrp->sin_port != sp->addr.sin_port) goto bad; if (addrp->sin_family != sp->addr.sin_family) goto bad; if (addrp->sin_addr.s_addr == sp->addr.sin_addr.s_addr) { return(sp); } if ((addrs = sp->addr_array) != NULL) { for (i = 0;addrs[i].s_addr;i++) { if (addrs[i].s_addr == addrp->sin_addr.s_addr) { return(sp); } } } bad: DBPRT((DBTO, "%s: ADDRESS MISMATCH\n", id)) DBPRT((DBTO, "\tstream %d addr %s\n", index, netaddr(&sp->addr))) DBPRT((DBTO, "\tpkt addr %s\n", netaddr(addrp))) return(NULL); } /* END rpp_check_pkt() */ /* ** Send outstanding information starting with top and working ** down to bottom. Will not cause state change. */ static void rpp_send_out(void) { DOID("send_out") struct send_packet *pp; struct stream *sp; time_t curr; torque_socklen_t len; curr = time(NULL); for (pp = top;pp != NULL;pp = pp->down) { if ((curr - pp->time_sent) < RPPTimeOut) continue; if ((pp->time_sent == 0) && (pkts_sent >= RPP_HIGHWATER)) break; sp = &stream_array[pp->index]; DBPRT((DBTO, "%s index %d type %d sent %d seq %d to %s crc %8.8s\n", id, pp->index, pp->type, pp->sent_out, pp->sequence, netaddr(&sp->addr), (char *)&pp->data[pp->len+RPP_PKT_CRC])) len = sizeof(struct sockaddr_in); if (sendto( sp->fd, (char *)pp->data, RPP_PKT_HEAD + pp->len, 0, (struct sockaddr *)&sp->addr, len) == -1) { DBPRT((DBTO, "%s: SENDTO errno %d (%s)\n", id, errno, strerror(errno))) pp->sent_out++; continue; } if (pp->time_sent == 0) /* new one */ pkts_sent++; pp->time_sent = curr; pp->sent_out++; } /* END for (pp) */ /* NOTE: failure cannot be detected */ return; } /* END rpp_send_out */ /* ** Create or reuse a position in stream_array. */ static int rpp_create_sp(void) { int i; struct stream *sp = NULL; if (stream_array == NULL) { stream_array = (struct stream *)malloc(sizeof(struct stream)); if (stream_array == NULL) { return(-1); } memset(stream_array, '\0', sizeof(struct stream)); stream_num = 1; } for (i = 0;i < stream_num;i++) { sp = &stream_array[i]; if (sp->state == RPP_FREE) break; } if (i == stream_num) { for (i = 0;i < stream_num;i++) { sp = &stream_array[i]; if (sp->state == RPP_DEAD) break; } } if (i == stream_num) { /* no free streams available */ sp = (struct stream *)realloc( (void *)stream_array, (stream_num * 2) * sizeof(struct stream)); if (sp == NULL) { sp = (struct stream *)realloc( (void *)stream_array, (stream_num + 1) * sizeof(struct stream)); if (sp == NULL) { return(-1); } stream_num++; } else { stream_num *= 2; } stream_array = sp; sp = &stream_array[i]; memset((void *)sp, '\0', (stream_num - i) * sizeof(struct stream)); } else { memset((void *)sp, '\0', sizeof(struct stream)); } DBPRT((DBTO, "rpp_create_sp: new index %d\n", i)) return(i); } /* END rpp_create_sp() */ /* ** Look up the "canonical" name for the host by ** calling gethostbyaddr with an IP address. */ static struct hostent *rpp_get_cname( struct sockaddr_in *addr) { DOID("get_cname") struct hostent *hp; char *hname; if ((hp = gethostbyaddr( (void *)&addr->sin_addr, sizeof(struct in_addr), addr->sin_family)) == NULL) { DBPRT((DBTO, "%s: addr not found, h_errno=%d errno=%d (%s)\n", id, h_errno, errno, strerror(errno))) return(NULL); } if ((hname = (char *)strdup(hp->h_name)) == NULL) { return(NULL); } if ((hp = gethostbyname(hname)) == NULL) { DBPRT((DBTO, "%s: canonical name %s not found, h_errno=%d errno=%d (%s)\n", id, hname, h_errno, errno, strerror(errno))) } free(hname); /* SUCCESS */ return(hp); } /* ** Allocate a list of alternate address for a host and save ** them in the stream structure. */ static void rpp_alist( struct hostent *hp, struct stream *sp) { int i, j; for (i = 1;hp->h_addr_list[i];i++); if (i == 1) { return; } sp->addr_array = (struct in_addr *)calloc(i, sizeof(struct in_addr)); if (sp->addr_array == NULL) { return; } j = 0; for (i = 0;hp->h_addr_list[i];i++) { if (memcmp(&sp->addr.sin_addr, hp->h_addr_list[i], hp->h_length) == 0) continue; memcpy(&sp->addr_array[j++], hp->h_addr_list[i], hp->h_length); } sp->addr_array[j].s_addr = 0; return; } static int rpp_send_ack( struct stream *sp, int seq) { DOID("send_ack") char buf[RPP_PKT_HEAD]; u_long xcrc; if (sp->stream_id < 0) { /* can't send yet */ DBPRT((DBTO, "%s: STREAM NOT OPEN seq %d\n", id, seq)) return(0); } I2TOH(RPP_ACK, buf) I8TOH(sp->stream_id, &buf[2]) I8TOH(seq, &buf[10]) xcrc = crc((u_char *)buf, (u_long)RPP_PKT_CRC); I8TOH(xcrc, &buf[RPP_PKT_CRC]) DBPRT((DBTO, "%s: seq %d to %s crc %lX\n", id, seq, netaddr(&sp->addr), xcrc)) if (sendto( sp->fd, buf, RPP_PKT_HEAD, 0, (struct sockaddr *)&sp->addr, sizeof(struct sockaddr_in)) == -1) { DBPRT((DBTO, "%s: ACK error %d (%s)\n", id, errno, strerror(errno))) if ((errno != EWOULDBLOCK) && (errno != ENOBUFS)) { return(-1); } } return(0); } /* END rpp_send_ack() */ /* ** Take a packet off the send queue and free it. */ static void dqueue( struct send_packet *pp) { if (pp->down == NULL) bottom = pp->up; else pp->down->up = pp->up; if (pp->up == NULL) top = pp->down; else pp->up->down = pp->down; if (--pkts_sent < 0) pkts_sent = 0; free(pp->data); free(pp); return; } /* ** Get rid of anything on the pend and send queue for a stream. */ static void clear_send( struct stream *sp) { struct pending *ppp, *pprev; struct send_packet *spp, *sprev; for (ppp = sp->pend_head;ppp;ppp = pprev) { pprev = ppp->next; free(ppp->data); free(ppp); } sp->pend_head = NULL; sp->pend_tail = NULL; sp->pend_commit = 0; sp->pend_attempt = 0; for (spp = sp->send_head;spp;spp = sprev) { sprev = spp->next; if (sp->stream_id == -1) { /* not open yet */ struct send_packet *look; /* might not be */ /* on send queue */ for (look = top;look;look = look->down) { if (look == spp) break; } if (look == NULL) { free(spp->data); free(spp); continue; } } dqueue(spp); } sp->send_head = NULL; sp->send_tail = NULL; return; } /* END clear_send() */ /* ** Remove packets from receive, pending and send queues for ** a stream, free all the memory and zero the stream_array ** entry. */ static void clear_stream( struct stream *sp) { struct recv_packet *rpp, *rprev; DBPRT((DBTO, "CLEAR stream %ld\n", ((long)sp - (long)stream_array) / sizeof(struct stream))) for (rpp = sp->recv_head;rpp;rpp = rprev) { rprev = rpp->next; if (rpp->data) free(rpp->data); free(rpp); } sp->recv_head = NULL; sp->recv_tail = NULL; clear_send(sp); if (sp->addr_array) { free(sp->addr_array); sp->addr_array = NULL; } sp->state = RPP_DEAD; return; } /* END clear_stream() */ /* ** Do a recvfrom() call to get a packet off of all file descriptors. ** Return the index of the stream the packet belonged to, ** -2 if it was no data, or -1 if there was an error. ** Return -3 if there was no data to read. ** MAY CAUSE STATE CHANGE! */ static int rpp_recv_pkt( int fd) /* I */ { DOID("recv_pkt") torque_socklen_t flen; int len; struct sockaddr_in addr; struct hostent *hp; int i, streamid; struct send_packet *spp, *sprev; struct recv_packet *rpp, *rprev; struct recv_packet *pkt; struct stream *sp; char *data; int type; int sequence; u_long pktcrc; data = malloc(RPP_PKT_SIZE); assert(data != NULL); flen = sizeof(struct sockaddr_in); /* ** Loop so we can avoid failing on EINTR. Thanks to ** Pete Wyckoff for finding this. */ for (;;) { len = recvfrom( fd, data, RPP_PKT_SIZE, 0, (struct sockaddr *) & addr, &flen); if (len != -1) break; if (errno == EINTR) continue; free(data); if ((errno == EWOULDBLOCK) || (errno == EAGAIN) || (errno == ECONNREFUSED)) { errno = 0; return(-3); } return(-1); } /* END for (;;) */ DBPRT((DBTO, "%s: addr %s len %d\n", id, netaddr(&addr), len)) if (len < RPP_PKT_HEAD) /* less than minimum size */ goto err_out; HTOI8(&data[len-RPP_CRC_LEN], pktcrc) if (pktcrc != crc((u_char *)data, (u_long)(len - RPP_CRC_LEN))) { DBPRT((DBTO, "%s: packet crc %08lX failed\n", id, pktcrc)) goto err_out; } HTOI2(&data[len-RPP_PKT_HEAD], type) HTOI8(&data[len-RPP_PKT_HEAD+RPP_HDR_SID], streamid) HTOI8(&data[len-RPP_PKT_HEAD+RPP_HDR_SEQ], sequence) switch (type) { case RPP_ACK: DBPRT((DBTO, "%s: ACK stream %d sequence %d crc %08lX\n", id, streamid, sequence, pktcrc)) free(data); if ((sp = rpp_check_pkt(streamid, &addr)) == NULL) { return(-2); } if (sp->state == RPP_OPEN_PEND) { if (sequence != sp->open_key) { DBPRT((DBTO, "%s: WILD ACK in RPP_OPEN_PEND %d\n", id, streamid)) return(-2); } spp = sp->send_head; assert(spp->type == RPP_HELLO2); assert(spp->next == NULL); sp->state = RPP_CONNECT; sp->send_head = NULL; sp->send_tail = NULL; dqueue(spp); /* SUCCESS */ return(streamid); } else if (sp->stream_id == -1) { DBPRT((DBTO, "%s: ACK for closed stream %d\n", id, streamid)) return(-2); } for (spp = sp->send_head, sprev = NULL;spp;sprev = spp, spp = spp->next) { if (spp->sequence == sequence) break; } if (spp != NULL) { DBPRT((DBTO, "%s: stream %d seq %d took %ld\n", id, streamid, sequence, (long)(time(NULL) - spp->time_sent))) if ((sp->state == RPP_CLOSE_WAIT1) && (spp->type == RPP_GOODBYE)) sp->state = RPP_CLOSE_WAIT2; if (sprev == NULL) sp->send_head = spp->next; else sprev->next = spp->next; if (sp->send_tail == spp) sp->send_tail = sprev; dqueue(spp); if ((sp->state == RPP_LAST_ACK) && (sp->send_head == NULL)) { clear_stream(sp); return(-2); } } return(streamid); /*NOTREACHED*/ break; case RPP_GOODBYE: DBPRT((DBTO, "%s: GOODBYE stream %d sequence %d crc %08lX\n", id, streamid, sequence, pktcrc)) free(data); if ((sp = rpp_check_pkt(streamid, &addr)) == NULL) { return(-2); } if (rpp_send_ack(sp, sequence) == -1) { return(-1); } switch (sp->state) { case RPP_OPEN_PEND: case RPP_OPEN_WAIT: case RPP_CLOSE_PEND: case RPP_LAST_ACK: return(-2); /*NOTREACHED*/ break; case RPP_CLOSE_WAIT1: sp->state = RPP_LAST_ACK; return(-2); /*NOTREACHED*/ break; case RPP_CLOSE_WAIT2: clear_stream(sp); return(-2); /*NOTREACHED*/ break; default: /* NO-OP */ break; } /* END switch (sp->state) */ sp->state = RPP_CLOSE_PEND; clear_send(sp); /* other side not reading now */ for (rpp = sp->recv_head, rprev = NULL;rpp != NULL;rprev = rpp, rpp = rpp->next) { if (rpp->sequence >= sequence) break; } if ((rpp == NULL) || (rpp->sequence > sequence)) { DBPRT((DBTO, "%s: GOOD seq %d\n", id, sequence)) pkt = (struct recv_packet *)malloc(sizeof(struct recv_packet)); assert(pkt != NULL); pkt->type = type; pkt->sequence = sequence; pkt->len = 0; pkt->data = NULL; if (rprev == NULL) { pkt->next = sp->recv_head; sp->recv_head = pkt; } else { pkt->next = rprev->next; rprev->next = pkt; } if (sp->recv_tail == rprev) sp->recv_tail = pkt; } else { DBPRT((DBTO, "%s: DUPLICATE seq %d MAX seen %d\n", id, sequence, rpp->sequence)) } return(-2); /*NOTREACHED*/ break; case RPP_DATA: case RPP_EOD: DBPRT((DBTO, "%s: DATA stream %d sequence %d crc %08lX len %d\n", id, streamid, sequence, pktcrc, len)) if ((sp = rpp_check_pkt(streamid, &addr)) == NULL) goto err_out; if (rpp_send_ack(sp, sequence) == -1) { free(data); return(-1); } switch (sp->state) { case RPP_OPEN_WAIT: DBPRT((DBTO, "INPUT on unconnected stream %d\n", streamid)) free(data); return(-2); case RPP_CLOSE_WAIT1: case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: DBPRT((DBTO, "INPUT on closed stream %d\n", streamid)) free(data); return(-2); break; default: /* NO-OP */ break; } if (sequence < sp->recv_sequence) { DBPRT((DBTO, "%s: OLD seq %d\n", id, sequence)) free(data); return(-2); } for (rpp = sp->recv_head, rprev = NULL;rpp != NULL;rprev = rpp, rpp = rpp->next) { if (rpp->sequence >= sequence) break; } if ((rpp == NULL) || (rpp->sequence > sequence)) { DBPRT((DBTO, "%s: GOOD seq %d\n", id, sequence)) data = realloc(data, len); assert(data != NULL); pkt = (struct recv_packet *)malloc(sizeof(struct recv_packet)); assert(pkt != NULL); pkt->type = type; pkt->sequence = sequence; pkt->len = len - RPP_PKT_HEAD; pkt->data = (u_char *)data; if (rprev == NULL) { pkt->next = sp->recv_head; sp->recv_head = pkt; } else { pkt->next = rprev->next; rprev->next = pkt; } if (sp->recv_tail == rprev) sp->recv_tail = pkt; if (sp->state == RPP_OPEN_PEND) return -2; else return streamid; } else { DBPRT((DBTO, "%s: DUPLICATE seq %d MAX seen %d\n", id, sequence, rpp->sequence)) free(data); } break; case RPP_HELLO1: /* ** HELLO1 packets have the remote side's stream index ** in the "streamid" field and open key in the sequence. */ DBPRT((DBTO, "%s: HELLO1 stream %d sequence %d\n", id, streamid, sequence)) free(data); for (i = 0; i < stream_num; i++) { sp = &stream_array[i]; if (sp->state <= RPP_FREE) continue; if (memcmp(&sp->addr, &addr, sizeof(addr))) continue; if (sp->open_key == sequence) { rpp_send_out(); return -2; } DBPRT((DBTO, "OLD STREAM state %d reopened %d %d\n", sp->state, sp->open_key, sequence)) clear_stream(sp); /* old stream */ } i = rpp_create_sp(); if (i == -1) return -1; sp = &stream_array[i]; sp->state = RPP_OPEN_PEND; sp->fd = fd; sp->retry = RPPRetry; memcpy(&sp->addr, &addr, sizeof(addr)); if ((hp = rpp_get_cname(&addr)) != NULL) rpp_alist(hp, sp); sp->stream_id = streamid; sp->open_key = sequence; open_key = MAX(open_key, sequence); rpp_form_pkt(i, RPP_HELLO2, i, NULL, 0); rpp_send_out(); break; case RPP_HELLO2: /* ** HELLO2 packet has this side's stream index in ** "streamid" as usual and the remote side's ** stream index overloaded in the "sequence" field. */ DBPRT((DBTO, "%s: HELLO2 stream %d sequence %d\n", id, streamid, sequence)) free(data); if ((sp = rpp_check_pkt(streamid, &addr)) == NULL) return -2; switch (sp->state) { case RPP_OPEN_WAIT: sp->state = RPP_CONNECT; break; case RPP_CLOSE_WAIT1: /* called close before open done */ case RPP_LAST_ACK: break; default: if (sp->stream_id == sequence) { DBPRT((DBTO, "%s: stream %d got DUP HELLO2 %d\n", id, streamid, sp->state)) if (rpp_send_ack(sp, sp->open_key) == -1) return -1; } else { DBPRT((DBTO, "%s: NON-DUP HELLO2\n", id)) } return -2; } sp->stream_id = sequence; if (rpp_send_ack(sp, sp->open_key) == -1) return -1; if ((spp = sp->send_head) == NULL) { DBPRT((DBTO, "%s: stream %d got HELLO2 but sendq NULL\n", id, streamid)) return -2; } if (spp->type != RPP_HELLO1) { DBPRT((DBTO, "%s: stream %d sendq %d rather than HELLO1\n", id, streamid, spp->type)) return -2; } sp->send_head = spp->next; /* remove HELLO1 pkt */ if (sp->send_tail == spp) sp->send_tail = NULL; dqueue(spp); /* ** Put any waitting packets onto the send queue */ for (spp = sp->send_head; spp; spp = spp->next) { int len = spp->len; DBPRT((DBTO, "%s: idx %d link %d seq %d len %d to sendq\n", id, streamid, spp->type, spp->sequence, len)) I2TOH(spp->type, (char *)&spp->data[len]) I8TOH(sp->stream_id, (char *)&spp->data[len+RPP_HDR_SID]) I8TOH(spp->sequence, (char *)&spp->data[len+RPP_HDR_SEQ]) I8TOH(crc(spp->data, (u_long)(len + RPP_PKT_CRC)), (char *)&spp->data[len+RPP_PKT_CRC]) if (bottom) bottom->down = spp; spp->up = bottom; spp->down = NULL; if (top == NULL) /* first one */ top = spp; bottom = spp; } break; default: DBPRT((DBTO, "%s: UNKNOWN packet type %d stream %d sequence %d\n", id, type, streamid, sequence)) free(data); break; } /* END switch (type) */ return(-2); err_out: /* no data to read */ free(data); return(-2); } /* END rpp_recv_pkt() */ /* ** Do recv calls until there is one that shows data. */ static int rpp_recv_all(void) { int i, ret; int rc = -3; DBPRT((DBTO, "entered rpp_recv_all\n")) for (i = 0;i < rpp_fd_num;i++) { ret = rpp_recv_pkt(rpp_fd_array[i]); rc = MAX(ret, rc); if (ret == -1) { /* failure detected */ break; } } /* END for (i) */ return(rc); } /* rpp_recv_all() */ /* ** Check to see if any packet being sent out on a stream has ** been sent more than a reasonable number of times. */ static void rpp_stale( struct stream *sp) /* I (cleared on corruption) */ { struct send_packet *pp; int counter; if ((sp->state <= RPP_FREE) || (sp->state == RPP_STALE)) { return; } counter = 0; for (pp = sp->send_head;pp != NULL;pp = pp->next) { counter++; if (pp->sent_out >= sp->retry) break; if (counter > 1024) { if (pp->next == pp) { DBPRT((DBTO, "RPP PACKET is corrupt - seq %d sent %d of %d - fixing linked list\n", pp->sequence, pp->sent_out, sp->retry)) pp->next = NULL; } else { /* stream is corrupt - destroy it */ DBPRT((DBTO, "RPP PACKET is corrupt - seq %d sent %d of %d - destroying stream\n", pp->sequence, pp->sent_out, sp->retry)) clear_stream(sp); return; } } } /* END for (pp) */ if (pp != NULL) { DBPRT((DBTO, "STALE PACKET seq %d sent %d of %d\n", pp->sequence, pp->sent_out, sp->retry)) switch (sp->state) { case RPP_OPEN_PEND: case RPP_CLOSE_WAIT1: case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: /* what do these states indicate? */ clear_stream(sp); break; default: sp->state = RPP_STALE; break; } } /* END if (pp != NULL) */ return; } /* END rpp_stale() */ /* ** Form data packets for any pending data. If flag is true, ** create an EOD packet too. */ static int rpp_dopending( int index, /* I */ int flag) /* I */ { DOID("dopending") struct stream *sp; struct pending *pp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) sp = &stream_array[index]; for (pp = sp->pend_head;pp != sp->pend_tail;pp = sp->pend_head) { rpp_form_pkt(index, RPP_DATA, sp->send_sequence, pp->data, RPP_PKT_DATA); sp->pend_head = pp->next; free(pp); sp->pend_attempt -= RPP_PKT_DATA; if (next_seq(&sp->send_sequence) == -1) { return(-1); } } if (flag) { rpp_form_pkt( index, RPP_EOD, sp->send_sequence, (pp != NULL) ? pp->data : NULL, sp->pend_attempt); if (pp != NULL) { free(pp); sp->pend_head = NULL; sp->pend_tail = NULL; } sp->pend_attempt = 0; if (next_seq(&sp->send_sequence) == -1) { return(-1); } } sp->pend_commit = sp->pend_attempt; return(0); } /* END rpp_dopending() */ /* ** Flush all data out of a stream -- do an end of message. ** Return 0 if it all went well, -1 on error. */ int rpp_flush( int index) { DOID("flush") struct stream *sp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) if ((index < 0) || (index >= stream_num)) { errno = EINVAL; return(-1); } sp = &stream_array[index]; switch (sp->state) { case RPP_CLOSE_PEND: errno = EPIPE; return(-1); /*NOTREACHED*/ break; case RPP_DEAD: case RPP_FREE: case RPP_OPEN_PEND: case RPP_CLOSE_WAIT1: case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: errno = ENOTCONN; return(-1); /*NOTREACHED*/ break; default: /* NO-OP */ break; } /* ** if something is pending or we need to return a zero len EOM, ** call rpp_dopending(). */ if ((sp->pend_head != NULL) || (sp->send_head == NULL)) { if (rpp_dopending(index, TRUE)) { return(-1); } } if (rpp_recv_all() == -1) { return(-1); } rpp_send_out(); return(0); } /* END rpp_flush() */ /* ** Create a new socket if needed and bind a local port. ** If port is 0, pick a free port number. */ int rpp_bind( uint port) { struct sockaddr_in from; int flags; if (rpp_fd == -1) { if ((rpp_fd = socket(PF_INET, SOCK_DGRAM, 0)) == -1) { return(-1); } /* set close on exec */ if ((flags = fcntl(rpp_fd, F_GETFD)) == -1) { close(rpp_fd); rpp_fd = -1; return(-1); } flags |= FD_CLOEXEC; if (fcntl(rpp_fd, F_SETFD, flags) == -1) { close(rpp_fd); rpp_fd = -1; return(-1); } /* set no delay */ if ((flags = fcntl(rpp_fd, F_GETFL)) == -1) { close(rpp_fd); rpp_fd = -1; return(-1); } #if defined(FNDELAY) && !defined(__hpux) flags |= FNDELAY; #else flags |= O_NONBLOCK; #endif if (fcntl(rpp_fd, F_SETFL, flags) == -1) { close(rpp_fd); rpp_fd = -1; return(-1); } } /* END if (rpp_fd == -1) */ if (rpp_fd_array != NULL) { int i; for (i = 0;i < rpp_fd_num;i++) { if (rpp_fd_array[i] == rpp_fd) { return(rpp_fd); } } } memset(&from, '\0', sizeof(from)); from.sin_family = AF_INET; from.sin_addr.s_addr = htonl(INADDR_ANY); from.sin_port = htons((u_short)port); if (bind(rpp_fd, (struct sockaddr *)&from, sizeof(from)) == -1) { return(-1); } DBPRT((DBTO, "bind to port %d\n", ntohs(from.sin_port))) if (rpp_fd_array == NULL) { rpp_fd_array = (int *)malloc(sizeof(int)); rpp_fd_num = 1; #if defined(HAVE_ATEXIT) atexit(rpp_shutdown); #elif defined(HAVE_ON_EXIT) on_exit(rpp_shutdown_on_exit, NULL); #else /* atexit() or on_exit() must be defined */ abort compile #endif /* HAVE_ATEXIT */ } else { rpp_fd_num++; rpp_fd_array = (int *)realloc(rpp_fd_array, sizeof(int) * rpp_fd_num); } assert(rpp_fd_array); rpp_fd_array[rpp_fd_num-1] = rpp_fd; return(rpp_fd); } /** * Allocate a communication stream - return -1 on FAILURE */ int rpp_open( char *name, /* I */ uint port, /* I */ char *EMsg) /* O (optional,minsize=1024) */ { DOID("rpp_open") int i, stream; struct hostent *hp; struct stream *sp; DBPRT((DBTO, "%s: entered %s:%d\n", id, name, port)) if (EMsg != NULL) EMsg[0] = '\0'; if (rpp_bind(0) == -1) /* bind if we need to */ { if (EMsg != NULL) sprintf(EMsg, "cannot bind rpp socket"); /* FAILURE */ return(-1); } /* First, we look up the IP address for this name. */ if ((hp = gethostbyname(name)) == NULL) { DBPRT((DBTO, "%s: host %s not found\n", id, name)) errno = ENOENT; if (EMsg != NULL) { sprintf(EMsg, "hostname resolution for '%s' failed, errno=%d", name, h_errno); } /* FAILURE */ return(-1); } /* ** Look for previously existant stream to the given ** host. If one is found in an open state, just ** return it. */ for (i = 0;i < stream_num;i++) { sp = &stream_array[i]; if (sp->state <= RPP_FREE) continue; if (memcmp(&sp->addr.sin_addr, hp->h_addr, hp->h_length)) continue; if (sp->addr.sin_port != htons((unsigned short)port)) continue; if (sp->addr.sin_family != hp->h_addrtype) continue; if (sp->state > RPP_CLOSE_PEND) { DBPRT((DBTO, "%s: OLD STREAM state %d reopened %d\n", id, sp->state, sp->open_key)) clear_stream(sp); /* old stream */ } else { DBPRT((DBTO, "%s: reopen of %s, sp->retry %d, global %d\n", id, netaddr(&sp->addr), sp->retry, RPPRetry)) sp->retry = RPPRetry; /* SUCCESS */ return(i); } } stream = rpp_create_sp(); if (stream == -1) { if (EMsg != NULL) { sprintf(EMsg, "cannot create new stream"); } /* FAILURE */ return(-1); } sp = &stream_array[stream]; if (open_key == 0) open_key = (int)time(0) & 0x0fff; /* ** We save the address returned for the name given so we ** can send out on the preferred interface. */ memcpy(&sp->addr.sin_addr, hp->h_addr, hp->h_length); sp->addr.sin_port = htons((unsigned short)port); sp->addr.sin_family = hp->h_addrtype; sp->fd = rpp_fd; sp->retry = RPPRetry; if (hp->h_addr_list[1] == NULL) { if ((hp = rpp_get_cname(&sp->addr)) == NULL) { errno = ENOENT; if (EMsg != NULL) { sprintf(EMsg, "cannot lookup cname for host '%s'", name); } /* FAILURE */ return(-1); } } rpp_alist(hp, sp); sp->stream_id = stream; /* use my streamid for HELLO1 */ sp->state = RPP_OPEN_WAIT; sp->open_key = open_key++; rpp_form_pkt(stream, RPP_HELLO1, sp->open_key, NULL, 0); sp->stream_id = -1; /* don't know his stream id yet */ if (rpp_recv_all() == -1) { if (EMsg != NULL) { sprintf(EMsg, "rpp_recv_all failed"); } /* FAILURE */ return(-1); } /* SUCCESS */ rpp_send_out(); return(stream); } /* END rpp_open() */ /* ** Return the network address for a stream. */ struct sockaddr_in *rpp_getaddr( int index) { DOID("getaddr") struct stream *sp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) if ((index < 0) || (index >= stream_num)) { errno = EINVAL; return(NULL); } sp = &stream_array[index]; if (sp->state <= RPP_FREE) { errno = ENOTCONN; return(NULL); } return(&sp->addr); } /* ** Free all memory and close the socket. */ void rpp_terminate(void) { struct stream *sp; struct send_packet *spp; struct pending *ppp; struct recv_packet *rpp; int i; for (i = 0;i < rpp_fd_num;i++) close(rpp_fd_array[i]); if (rpp_fd_array) { free(rpp_fd_array); rpp_fd_array = NULL; rpp_fd_num = 0; } for (i = 0;i < stream_num;i++) { sp = &stream_array[i]; if (sp->state == RPP_DEAD) continue; for (ppp = sp->pend_head;ppp != NULL;ppp = sp->pend_head) { free(ppp->data); sp->pend_head = ppp->next; free(ppp); } for (rpp = sp->recv_head;rpp != NULL;rpp = sp->recv_head) { if (rpp->data != NULL) free(rpp->data); sp->recv_head = rpp->next; free(rpp); } for (spp = sp->send_head;spp != NULL;spp = sp->send_head) { free(spp->data); sp->send_head = spp->next; free(spp); } } top = NULL; bottom = NULL; if (stream_array) free(stream_array); stream_num = 0; stream_array = NULL; rpp_fd = -1; return; } /* END rpp_terminate() */ /* ** Trampoline for on_exit */ void rpp_shutdown_on_exit( int foo, void *bar) { rpp_shutdown(); return; } /* END rpp_shutdown_on_exit() */ /* ** Shutdown the library. Flush and close all open streams ** and call rpp_terminate(). */ void rpp_shutdown(void) { int timeouts, num, i; fd_set fdset; struct timeval tv; FD_ZERO(&fdset); for (i = 0;i < stream_num;i++) { rpp_close(i); } for (timeouts = 0;timeouts < 3;) { for (i = 0;i < stream_num;i++) { if (stream_array[i].state > RPP_FREE) break; } if (i == stream_num) break; DBPRT((DBTO, "shutdown: stream %d state %d\n", i, stream_array[i].state)) if ((num = rpp_recv_all()) == -1) break; rpp_send_out(); if (num == -3) { /* got nothing -- wait a bit */ tv.tv_sec = RPPTimeOut; tv.tv_usec = 0; for (i = 0;i < rpp_fd_num;i++) FD_SET(rpp_fd_array[i], &fdset); i = select(FD_SETSIZE, &fdset, NULL, NULL, &tv); if (i == 0) timeouts++; if (i == -1) break; } } /* END for (timeouts) */ rpp_terminate(); return; } /* END rpp_shutdown() */ /* ** Terminate a connection stream. ** Return 0 if it all went well, -1 on error. */ int rpp_close( int index) { DOID("close") struct stream *sp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) if ((index < 0) || (index >= stream_num)) { errno = EINVAL; return(-1); } sp = &stream_array[index]; switch (sp->state) { case RPP_STALE: clear_stream(sp); return(0); /*NOTREACHED*/ break; case RPP_CLOSE_PEND: sp->state = RPP_LAST_ACK; break; case RPP_OPEN_WAIT: case RPP_CONNECT: if (sp->pend_head != NULL) { if (rpp_dopending(index, TRUE)) { return(-1); } } sp->state = RPP_CLOSE_WAIT1; break; default: errno = ENOTCONN; return(-1); /* stream closed */ /*NOTREACHED*/ break; } rpp_form_pkt(index, RPP_GOODBYE, sp->send_sequence, NULL, 0); if (rpp_recv_all() == -1) { return(-1); } rpp_send_out(); return(0); } /* END rpp_close() */ /* ** Add information to the stream given by index. ** Return -1 on error, otherwise number of bytes written. */ int rpp_write( int index, void *buf, int len) { DOID("write") struct stream *sp; struct pending *pp; int hold, residual, more; DBPRT((DBTO, "%s: entered index %d size %d\n", id, index, len)) if ((index < 0) || (index >= stream_num) || (len < 0)) { errno = EINVAL; return(-1); } if (len == 0) { return(0); } sp = &stream_array[index]; rpp_stale(sp); /* check freshness */ switch (sp->state) { case RPP_STALE: errno = ETIMEDOUT; return(-1); /*NOTREACHED*/ break; case RPP_CLOSE_PEND: errno = EPIPE; return(-1); /*NOTREACHED*/ break; case RPP_OPEN_PEND: /* shouldn't happen */ case RPP_DEAD: case RPP_FREE: case RPP_CLOSE_WAIT1: /* stream closed */ case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: errno = ENOTCONN; return(-1); /*NOTREACHED*/ break; default: /* NO-OP */ break; } residual = 0; while (residual < len) { hold = sp->pend_attempt % RPP_PKT_DATA; if (((pp = sp->pend_tail) == NULL) || (hold == 0)) { pp = (struct pending *)malloc(sizeof(struct pending)); if (sp->pend_tail == NULL) sp->pend_head = pp; else sp->pend_tail->next = pp; sp->pend_tail = pp; pp->data = (u_char *)malloc(RPP_PKT_SIZE); assert(pp->data != NULL); pp->next = NULL; } more = MIN(len - residual, RPP_PKT_DATA - hold); memcpy(&pp->data[hold], (char *)buf + residual, more); residual += more; sp->pend_attempt += more; } if (rpp_recv_all() == -1) { return(-1); } rpp_send_out(); return(residual); } /* END rpp_write() */ /* ** Check a stream to see if it needs attention. */ static int rpp_attention( int index) /* I */ { DOID("attention") int mesg, count; int seq; struct stream *sp; struct recv_packet *pp; sp = &stream_array[index]; DBPRT((DBTO, "%s: stream %d in state %d addr %s\n", id, index, sp->state, netaddr(&sp->addr))) rpp_stale(sp); switch (sp->state) { case RPP_STALE: /* need to report error */ return(TRUE); /*NOTREACHED*/ break; case RPP_CLOSE_PEND: /* we haven't closed yet */ case RPP_CONNECT: /* check for message */ /* NO-OP */ break; default: return(FALSE); /*NOTREACHED*/ break; } /* END switch (sp->state) */ if ((sp->msg_cnt > 0) && (sp->recv_attempt <= sp->msg_cnt)) { return(TRUE); /* message to read */ } mesg = FALSE; count = 0; for (pp = sp->recv_head, seq = sp->recv_sequence;pp != NULL;pp = pp->next, seq++) { count += pp->len; if (pp->sequence != seq) break; if (pp->type != RPP_DATA) { /* end of message */ mesg = TRUE; break; } } if (mesg == TRUE) sp->msg_cnt = count; return(mesg); } /* END rpp_attention() */ /* ** Check some state before reading or skipping. If it is ** okay to continue, return 1. Otherwise, return <= 0. */ static int rpp_okay( int index) /* I */ { struct stream *sp; fd_set fdset; struct timeval tv; FD_ZERO(&fdset); while (rpp_attention(index) == FALSE) { int i; tv.tv_sec = RPPTimeOut; tv.tv_usec = 0; for (i = 0;i < rpp_fd_num;i++) FD_SET(rpp_fd_array[i], &fdset); i = select(FD_SETSIZE, &fdset, NULL, NULL, &tv); if ((i == -1) || (i == 0)) { /* if tiemout or select failure, return FAILURE (CRI) */ return(-1); } if (rpp_recv_all() == -1) { return(-1); } rpp_send_out(); } sp = &stream_array[index]; if (sp->state == RPP_STALE) { /* stale output */ errno = ETIMEDOUT; return(-1); } if (sp->recv_attempt == sp->msg_cnt) { /* end of message */ if (sp->state == RPP_CLOSE_PEND) { return(-2); } /* SUCCESS */ return(0); } /* okay to return */ return(1); } /* END rpp_okay() */ /* ** Read a message. Return data up to the end of a message ** or the end of the provided buffer. ** Return -1 on error, -2 if other side has closed, otherwise ** number of bytes read. */ int rpp_read( int index, /* I */ void *buf, /* O */ int len) /* I */ { DOID("read") int hiwater, cpylen, hold, ret, xlen; struct recv_packet *pp; struct stream *sp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) errno = 0; if ((index < 0) || (index >= stream_num) || (len < 0)) { errno = EINVAL; return(-1); } if (len == 0) { /* no data to read, return SUCCESS */ return(0); } sp = &stream_array[index]; switch (sp->state) { case RPP_DEAD: case RPP_FREE: case RPP_CLOSE_WAIT1: case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: errno = ENOTCONN; return(-1); /* stream closed */ /*NOTREACHED*/ break; default: /* NO-OP */ break; } if ((ret = rpp_okay(index)) <= 0) { return(ret); } sp = &stream_array[index]; cpylen = 0; /* find packet to copy from */ for (pp = sp->recv_head;pp != NULL;pp = pp->next) { int bump = cpylen + pp->len; if (sp->recv_attempt < bump) break; cpylen = bump; } /* END for (pp) */ hiwater = 0; xlen = MIN(len, sp->msg_cnt); hold = sp->recv_attempt - cpylen; /* start point in pkt data */ while ((pp != NULL) && (xlen > hiwater)) { /* got room */ cpylen = MIN(pp->len - hold, xlen - hiwater); memcpy((char *)buf + hiwater, &pp->data[hold], cpylen); hiwater += cpylen; sp->recv_attempt += cpylen; hold = 0; pp = pp->next; } /* END while () */ return(hiwater); } /* END rpp_read() */ /* ** Commit data which has been read up to recv_attempt if flag ** is TRUE. Otherwise, set recv_attempt back to the previous ** commit point recv_commit. ** Return -1 on error, FALSE on decommit or if end-of-message has ** not been reached, TRUE if end-of-message has been reached. */ int rpp_rcommit( int index, /* I */ int flag) /* I */ { DOID("rcommit") struct stream *sp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) if ((index < 0) || (index >= stream_num)) { errno = EINVAL; return(-1); } sp = &stream_array[index]; switch (sp->state) { case RPP_CLOSE_WAIT1: /* stream closed */ case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: case RPP_OPEN_PEND: /* shouldn't happen */ case RPP_FREE: case RPP_DEAD: errno = ENOTCONN; return(-1); /*NOTREACHED*/ break; default: /* NO-OP */ break; } if (flag == FALSE) { /* no commit */ sp->recv_attempt = sp->recv_commit; return(0); } sp->recv_commit = sp->recv_attempt; if (sp->recv_commit == sp->msg_cnt) { /* return TRUE, end of message reached */ return(1); } return(0); } /* END rpp_rcommit() */ /* ** Reset end-of-message condition on a stream. Any packets ** on the receive queue are freed. ** Return -1 on error, 0 otherwise. */ int rpp_eom( int index) { DOID("eom") struct stream *sp; struct recv_packet *pp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) if ((index < 0) || (index >= stream_num)) { errno = EINVAL; return(-1); } sp = &stream_array[index]; switch (sp->state) { case RPP_CLOSE_WAIT1: /* stream closed */ case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: case RPP_OPEN_PEND: /* shouldn't happen */ case RPP_FREE: case RPP_DEAD: errno = ENOTCONN; return(-1); /*NOTREACHED*/ break; default: /* NO-OP */ break; } /* ** work though recv packets */ for (pp = sp->recv_head;pp != NULL;pp = sp->recv_head) { if (pp->type == RPP_GOODBYE) /* stream finished */ break; if (sp->msg_cnt < pp->len) break; sp->recv_sequence++; sp->msg_cnt -= pp->len; if (pp->data) free(pp->data); sp->recv_head = pp->next; free(pp); } if (sp->recv_head == NULL) sp->recv_tail = NULL; sp->recv_attempt = 0; sp->recv_commit = 0; return(0); } /* END rpp_eom() */ /* ** Commit data which has been written up to pend_attempt if flag ** is TRUE. Otherwise, set pend_attempt back to the previous ** commit point pend_commit. ** Return -1 on error, 0 otherwise. */ int rpp_wcommit( int index, int flag) { DOID("wcommit") struct pending *pp, *next; struct stream *sp; DBPRT((DBTO, "%s: entered index %d\n", id, index)) if ((index < 0) || (index >= stream_num)) { errno = EINVAL; return(-1); } sp = &stream_array[index]; switch (sp->state) { case RPP_CLOSE_PEND: errno = EPIPE; return(-1); /*NOTREACHED*/ break; case RPP_STALE: errno = ETIMEDOUT; return(-1); /*NOTREACHED*/ break; case RPP_CLOSE_WAIT1: /* stream closed */ case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: case RPP_OPEN_PEND: /* shouldn't happen */ case RPP_FREE: case RPP_DEAD: errno = ENOTCONN; return(-1); break; default: /* NO-OP */ break; } /* END switch (sp->state) */ if (flag) { /* commit */ if (rpp_dopending(index, FALSE)) { return(-1); } if (rpp_recv_all() == -1) { return(-1); } rpp_send_out(); return(0); } sp->pend_attempt = sp->pend_commit; if (sp->pend_head == NULL) { return(0); } for (pp = sp->pend_head->next;pp;pp = next) { free(pp->data); next = pp->next; free(pp); } /* for (pp) */ sp->pend_head->next = NULL; sp->pend_tail = sp->pend_head; return(0); } /* rpp_wcommit() */ /* ** Skip len characters of a message. */ int rpp_skip( int index, int len) { DOID("skip") struct stream *sp; int ret, hiwater; DBPRT((DBTO, "%s: entered index %d\n", id, index)) if ((index < 0) || (index >= stream_num)) { errno = EINVAL; return(-1); } sp = &stream_array[index]; switch (sp->state) { case RPP_DEAD: case RPP_FREE: case RPP_CLOSE_WAIT1: case RPP_CLOSE_WAIT2: case RPP_LAST_ACK: errno = ENOTCONN; return(-1); /* stream closed */ /*NOTREACHED*/ break; default: /* NO-OP */ break; } if ((ret = rpp_okay(index)) <= 0) { /* FAILURE - may be 0, -1, or -2 */ return(ret); } sp = &stream_array[index]; hiwater = MIN(sp->msg_cnt - sp->recv_attempt, len); sp->recv_attempt += hiwater; return(hiwater); } /* END rpp_skip() */ /* ** Check for any stream with a message waiting and ** return the stream number or a -1 if there are none. */ int rpp_poll(void) { DOID("poll") int i; DBPRT((DBTO, "%s: entered streams %d\n", id, stream_num)) /* ** Read socket to get any packets */ for (;;) { i = rpp_recv_all(); if ((i == -1) || (i == -3)) break; } if (i == -1) { return(-1); } /* see if any stream has a message waiting */ for (i = 0;i < stream_num;i++) { if (rpp_attention(i)) break; } if (i < stream_num) /* found one */ { return(i); } rpp_send_out(); /* unknown stream identifier */ return(-2); } /* ** Process any stream i/o. ** Return 0 or a -1 if there was an error. */ int rpp_io(void) { DOID("io") int i; DBPRT((DBTO, "%s: entered streams %d\n", id, stream_num)) /* ** Read socket to get any packets */ for (;;) { i = rpp_recv_all(); if (i == -1 || i == -3) break; } if (i == -1) { return(-1); } rpp_send_out(); return(0); } /* END rpp_io() */ /* ** Read a character. ** Returns >=0 the char read ** -1 error or EOD ** -2 EOF */ int rpp_getc( int index) { int ret; u_char c; if ((ret = rpp_read(index, &c, 1)) == 1) { /* SUCCESS */ return((int)c); } if (ret == -2) { /* FAILURE: type is ??? */ return(-2); } /* FAILURE */ return(-1); } /* END rpp_getc() */ /* ** Write a character. */ int rpp_putc( int index, int c) { u_char x = (u_char)c; if (rpp_write(index, &x, 1) != 1) { return(-1); } return(0); } int RPPConfigure( int SRPPTimeOut, /* I */ int SRPPRetry) /* I */ { if (SRPPTimeOut > 0) RPPTimeOut = SRPPTimeOut; if (SRPPRetry > 1) /* always need an "extra" retry to invalidate existing conns */ RPPRetry = SRPPRetry; return(0); } int RPPReset(void) { RPPTimeOut = DEFAULT_RPP_TIMEOUT; RPPRetry = DEFAULT_RPP_RETRY; return(0); } int rpp_get_stream_state(int index) { struct stream *sp; sp = &stream_array[index]; if(sp) { return(sp->state); } return(-1); } /* END rpp.c */ torque-2.4.16/src/lib/Libifl/enc_Status.c0000664000113300011330000001105311306021360015036 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_Status() - encode a Status Job Batch Request * * Data items are: string object id * list of attrl */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_Status( int sock, char *objid, struct attrl *pattrl) { int rc; if ((rc = diswst(sock, objid) != 0) || (rc = encode_DIS_attrl(sock, pattrl) != 0)) { return(rc); } return(0); } /* END encode_DIS_Status() */ /* END enc_Status.c */ torque-2.4.16/src/lib/Libifl/pbsD_chkptjob.c0000664000113300011330000000117511272401246015515 00000000000000/* Copyright 2008 Cluster Resources */ /* pbs_chkptjob.c Send the Checkpoint Job request to the server -- really just an instance of the "manager" request. */ #include /* the master config generated by configure */ #include #include "libpbs.h" int pbs_checkpointjob(int c, char *jobid, char *extend) { if ((jobid == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); return PBSD_manager(c, PBS_BATCH_CheckpointJob, MGR_CMD_SET, MGR_OBJ_JOB, jobid, NULL, extend); } torque-2.4.16/src/lib/Libifl/dec_Status.c0000664000113300011330000001173411306021360015032 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_Status() - decode a Status batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: string job id * list of attrl */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_Status(int sock, struct batch_request *preq) { int rc; CLEAR_HEAD(preq->rq_ind.rq_status.rq_attr); rc = disrfst(sock, (PBS_MAXSVRJOBID > PBS_MAXDEST ? PBS_MAXSVRJOBID : PBS_MAXDEST) + 1, preq->rq_ind.rq_status.rq_id); if (rc) return rc; rc = decode_DIS_svrattrl(sock, &preq->rq_ind.rq_status.rq_attr); return rc; } torque-2.4.16/src/lib/Libifl/pbsD_statnode.c0000664000113300011330000001076011272401246015532 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_statnode.c Return the status of a Node. */ #include /* the master config generated by configure */ #include "libpbs.h" struct batch_status *pbs_statnode( int c, /* I */ char *id, /* I (nodes to list) */ struct attrl *attrib, /* I */ char *extend) /* I */ { return(PBSD_status( c, PBS_BATCH_StatusNode, id, attrib, extend)); } torque-2.4.16/src/lib/Libifl/enc_svrattrl.c0000664000113300011330000001416311306021360015441 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_svrattrl() - encode a list of server "svrattrl" structures * * The first item encoded is a unsigned integer, a count of the * number of svrattrl entries in the linked list. This is encoded * even when there are no svrattrl entries in the list. * * Each individual entry is then encoded as: * u int size of the three strings (name, resource, value) * including the terminating nulls * string attribute name * u int 1 or 0 if resource name does or does not follow * string resource name (if one) * string value of attribute/resource * u int "op" of attrlop * * Note, the encoding of a svrattrl is the same as the encoding of * the pbs_ifl.h structures "attrl" and "attrlop". Any one of the * three forms can be decoded into any of the three with the possible * loss of the "flags" field (which is the "op" of the attrlop). */ #include /* the master config generated by configure */ #include "libpbs.h" #include "list_link.h" #include "attribute.h" #include "dis.h" int encode_DIS_svrattrl(int sock, svrattrl *psattl) { unsigned int ct = 0; unsigned int name_len; svrattrl *ps; int rc; /* count how many */ for (ps = psattl; ps; ps = (svrattrl *)GET_NEXT(ps->al_link)) { ++ct; } if ((rc = diswui(sock, ct))) return rc; for (ps = psattl; ps; ps = (svrattrl *)GET_NEXT(ps->al_link)) { /* length of three strings */ name_len = (int)strlen(ps->al_atopl.name) + (int)strlen(ps->al_atopl.value) + 2; if (ps->al_atopl.resource) name_len += strlen(ps->al_atopl.resource) + 1; if ((rc = diswui(sock, name_len))) break; if ((rc = diswst(sock, ps->al_atopl.name))) break; if (ps->al_rescln) /* has a resource name */ { if ((rc = diswui(sock, 1))) break; if ((rc = diswst(sock, ps->al_atopl.resource))) break; } else { if ((rc = diswui(sock, 0))) /* no resource name */ break; } if ((rc = diswst(sock, ps->al_atopl.value)) || (rc = diswui(sock, (unsigned int)ps->al_op))) break; } return rc; } torque-2.4.16/src/lib/Libifl/enc_ReqHdr.c0000664000113300011330000001115211306021360014740 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_ReqHdr() - DIS encode a Request Header * Fields are: Protocol ID (unsigned integer) * Protocol Version (unsigned integer) * Request Type (unsignded integer) * User Name (string) */ #include /* the master config generated by configure */ #include "libpbs.h" #include "dis.h" int encode_DIS_ReqHdr(int sock, int reqt, char *user) { int rc; if ((rc = diswui(sock, PBS_BATCH_PROT_TYPE)) || (rc = diswui(sock, PBS_BATCH_PROT_VER)) || (rc = diswui(sock, reqt)) || (rc = diswst(sock, user))) { return rc; } return 0; } torque-2.4.16/src/lib/Libifl/pbsD_stagein.c0000664000113300011330000001214411306021360015332 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_stagein.c */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_stagein(int c, char *jobid, char *location, char *extend) { int rc; struct batch_reply *reply; int sock; if ((jobid == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); if (location == (char *)0) location = ""; sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); /* send stagein request, a run request with a different id */ if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_StageIn, pbs_current_user)) || (rc = encode_DIS_RunJob(sock, jobid, location, 0)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } if (DIS_tcp_wflush(sock)) { return (pbs_errno = PBSE_PROTOCOL); } /* get reply */ reply = PBSD_rdrpy(c); rc = connection[c].ch_errno; PBSD_FreeReply(reply); return rc; } torque-2.4.16/src/lib/Libifl/dec_ReturnFile.c0000664000113300011330000000126211306021360015621 00000000000000 #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_ReturnFiles(int sock, struct batch_request *preq) { struct rq_returnfiles *prfs; int rc; prfs = &preq->rq_ind.rq_returnfiles; if ((rc = disrfst(sock, PBS_MAXSVRJOBID, prfs->rq_jobid)) != 0) return rc; prfs->rq_return_stdout = disrsi(sock, &rc); if (rc != 0) return rc; prfs->rq_return_stderr = disrsi(sock, &rc); if (rc != 0) return rc; return 0; } torque-2.4.16/src/lib/Libifl/pbsD_movejob.c0000664000113300011330000001202611306021360015340 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_movejob.c */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_movejob(int c, char *jobid, char *destin, char *extend) { int rc; struct batch_reply *reply; int sock; if ((jobid == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); if (destin == (char *)0) destin = ""; sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_MoveJob, pbs_current_user)) || (rc = encode_DIS_MoveJob(sock, jobid, destin)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } if (DIS_tcp_wflush(sock)) { return (pbs_errno = PBSE_PROTOCOL); } /* read reply */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return connection[c].ch_errno; } torque-2.4.16/src/lib/Libifl/Makefile.in0000664000113300011330000003272511605403732014651 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libifl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libifl/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libifl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all compilation happens in lib/Libpbs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libifl/PBSD_msg2.c0000664000113300011330000001155011306021360014410 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_msgjob.c * * send the MessageJob request */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" /* * PBS_msg_put.c * * Send the MessageJob request, does not read the reply. */ int PBSD_msg_put(int c, char *jobid, int fileopt, char *msg, char *extend) { int rc = 0; int sock; sock = connection[c].ch_socket; DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_MessJob, pbs_current_user)) || (rc = encode_DIS_MessageJob(sock, jobid, fileopt, msg)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; rc = pbs_errno; } return rc; } torque-2.4.16/src/lib/Libifl/pbsD_manager.c0000664000113300011330000001122111272401246015314 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_manager.c Basically a pass-thru to PBS_manager */ #include /* the master config generated by configure */ #include "libpbs.h" /* stack pbs_manager() PBSD_manager() PBSD_mgr_put() ... mgr_node_set() */ int pbs_manager( int c, int command, int objtype, char *objname, struct attropl *attrib, char *extend) { int rc; rc = PBSD_manager( c, PBS_BATCH_Manager, command, objtype, objname, attrib, extend); return(rc); } /* END pbs_manager() */ torque-2.4.16/src/lib/Libifl/pbsD_locjob.c0000664000113300011330000001314511306021360015152 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_locjob.c This function does the LocateJob request. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" #include "log.h" char * pbs_locjob(int c, char *jobid, char *extend) { int rc; struct batch_reply *reply; char *ploc = (char *)0; int sock; if ((jobid == (char *)0) || (*jobid == '\0')) { pbs_errno = PBSE_IVALREQ; return (ploc); } sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_LocateJob, pbs_current_user)) || (rc = encode_DIS_JobId(sock, jobid)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return (char *)NULL; } /* write data over tcp stream */ if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return (char *)NULL; } /* read reply from stream */ reply = PBSD_rdrpy(c); if (reply == NULL) { pbs_errno = PBSE_PROTOCOL; } else if (reply->brp_choice != BATCH_REPLY_CHOICE_NULL && reply->brp_choice != BATCH_REPLY_CHOICE_Text && reply->brp_choice != BATCH_REPLY_CHOICE_Locate) { #ifndef NDEBUG fprintf(stderr, "advise: pbs_locjob\tUnexpected reply choice\n\n"); #endif /* NDEBUG */ pbs_errno = PBSE_PROTOCOL; } else if (connection[c].ch_errno == 0) { ploc = strdup(reply->brp_un.brp_locate); } PBSD_FreeReply(reply); return ploc; } torque-2.4.16/src/lib/Libifl/pbsD_msgjob.c0000664000113300011330000001156011272401246015171 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_msgjob.c * * send the MessageJob request and get the reply. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_msgjob(int c, char *jobid, int fileopt, char *msg, char *extend) { struct batch_reply *reply; int rc; if ((jobid == (char *)0) || (*jobid == '\0') || (msg == (char *)0) || (*msg == '\0')) return (pbs_errno = PBSE_IVALREQ); /* setup DIS support routines for following DIS calls */ /* DIS_tcp_setup(connection[c].ch_socket); */ if ((rc = PBSD_msg_put(c, jobid, fileopt, msg, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } /* read reply */ reply = PBSD_rdrpy(c); rc = connection[c].ch_errno; PBSD_FreeReply(reply); return rc; } torque-2.4.16/src/lib/Libifl/enc_reply.c0000664000113300011330000001774011306021360014717 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_reply() - encode a Batch Protocol Reply Structure * * batch_reply structure defined in libpbs.h, it must be allocated * by the caller. */ #include /* the master config generated by configure */ #include "libpbs.h" #include "list_link.h" #include "attribute.h" #include "dis.h" #include "batch_request.h" int encode_DIS_reply(int sock, struct batch_reply *reply) { int ct; int i; struct brp_select *psel; struct brp_status *pstat; svrattrl *psvrl; int rc; /* first encode "header" consisting of protocol type and version */ if ((rc = diswui(sock, PBS_BATCH_PROT_TYPE)) || (rc = diswui(sock, PBS_BATCH_PROT_VER))) return rc; /* next encode code, auxcode and choice (union type identifier) */ if ((rc = diswsi(sock, reply->brp_code)) || (rc = diswsi(sock, reply->brp_auxcode)) || (rc = diswui(sock, reply->brp_choice))) return rc; switch (reply->brp_choice) { case BATCH_REPLY_CHOICE_NULL: break; /* no more to do */ case BATCH_REPLY_CHOICE_Queue: case BATCH_REPLY_CHOICE_RdytoCom: case BATCH_REPLY_CHOICE_Commit: if ((rc = diswst(sock, reply->brp_un.brp_jid))) return (rc); break; case BATCH_REPLY_CHOICE_Select: /* have to send count of number of strings first */ ct = 0; psel = reply->brp_un.brp_select; while (psel) { ++ct; psel = psel->brp_next; } if ((rc = diswui(sock, ct))) return rc; psel = reply->brp_un.brp_select; while (psel) { /* now encode each string */ if ((rc = diswst(sock, psel->brp_jobid))) return rc; psel = psel->brp_next; } break; case BATCH_REPLY_CHOICE_Status: /* encode "server version" of status structure. * * Server always uses svrattrl form. * Commands decode into their form. * * First need to encode number of status objects and then * the object itself. */ ct = 0; pstat = (struct brp_status *)GET_NEXT(reply->brp_un.brp_status); while (pstat) { ++ct; pstat = (struct brp_status *)GET_NEXT(pstat->brp_stlink); } if ((rc = diswui(sock, ct))) return rc; pstat = (struct brp_status *)GET_NEXT(reply->brp_un.brp_status); while (pstat) { if ((rc = diswui(sock, pstat->brp_objtype)) || (rc = diswst(sock, pstat->brp_objname))) return rc; psvrl = (svrattrl *)GET_NEXT(pstat->brp_attr); if ((rc = encode_DIS_svrattrl(sock, psvrl))) return rc; pstat = (struct brp_status *)GET_NEXT(pstat->brp_stlink); } break; case BATCH_REPLY_CHOICE_Text: /* text reply */ if ((rc = diswcs(sock, reply->brp_un.brp_txt.brp_str, reply->brp_un.brp_txt.brp_txtlen))) return rc; break; case BATCH_REPLY_CHOICE_Locate: /* Locate Job Reply */ if ((rc = diswst(sock, reply->brp_un.brp_locate))) return rc; break; case BATCH_REPLY_CHOICE_RescQuery: /* Query Resources Reply */ ct = reply->brp_un.brp_rescq.brq_number; if ((rc = diswui(sock, ct))) return rc; for (i = 0; (i < ct) && (rc == 0); ++i) { rc = diswui(sock, *(reply->brp_un.brp_rescq.brq_avail + i)); } if (rc) return rc; for (i = 0; (i < ct) && (rc == 0); ++i) { rc = diswui(sock, *(reply->brp_un.brp_rescq.brq_alloc + i)); } if (rc) return rc; for (i = 0; (i < ct) && (rc == 0); ++i) { rc = diswui(sock, *(reply->brp_un.brp_rescq.brq_resvd + i)); } if (rc) return rc; for (i = 0; (i < ct) && (rc == 0); ++i) { rc = diswui(sock, *(reply->brp_un.brp_rescq.brq_down + i)); } if (rc) return rc; break; default: return -1; } return 0; } torque-2.4.16/src/lib/Libifl/pbsD_sigjob.c0000664000113300011330000001216611334071076015173 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_sigjob. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" int pbs_sigjob(c, jobid, signal, extend) int c; char *jobid; char *signal; char *extend; { int rc = 0; struct batch_reply *reply; if ((jobid == (char *)0) || (*jobid == '\0') || (signal == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); /* send request */ if ((rc = PBSD_sig_put(c, jobid, signal, extend)) != 0) return (rc); /* read reply */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return (connection[c].ch_errno); } int pbs_sigjobasync( int c, char *jobid, char *signal, char *extend) { int rc = 0; struct batch_reply *reply; if ((jobid == (char *)0) || (*jobid == '\0') || (signal == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); /* send request */ if ((rc = PBSD_async_sig_put(c, jobid, signal, extend)) != 0) return (rc); /* read reply */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return (connection[c].ch_errno); } torque-2.4.16/src/lib/Libifl/tcp_dis.c0000664000113300011330000004301411455412757014400 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #if defined(FD_SET_IN_SYS_SELECT_H) # include #endif #include "dis.h" #include "dis_.h" #include "dis_init.h" #include "log.h" #ifdef HAVE_SYS_POLL_H #include #endif #define MAX_INT_LEN 256; static struct tcp_chan **tcparray = NULL; static int tcparraymax = 0; time_t pbs_tcp_timeout = 20; /* reduced from 60 to 20 (CRI - Nov/03/2004) */ void DIS_tcp_settimeout( long timeout) /* I */ { pbs_tcp_timeout = timeout; return; } /* END DIS_tcp_settimeout() */ int DIS_tcp_istimeout( int sock) { if (tcparray == NULL) { return(0); } return(tcparray[sock]->IsTimeout); } /* END DIS_tcp_istimeout() */ /* * tcp_pack_buff - pack existing data into front of buffer * * Moves "uncommited" data to front of buffer and adjusts pointers. * Does a character by character move since data may over lap. */ static void tcp_pack_buff( struct tcpdisbuf *tp) { size_t amt; size_t start; size_t i; start = tp->tdis_trailp - tp->tdis_thebuf; if (start != 0) { amt = tp->tdis_eod - tp->tdis_trailp; for (i = 0;i < amt;++i) { *(tp->tdis_thebuf + i) = *(tp->tdis_thebuf + i + start); } tp->tdis_leadp -= start; tp->tdis_trailp -= start; tp->tdis_eod -= start; } return; } /* END tcp_pack_buff() */ /* * tcp_read - read data from tcp stream to "fill" the buffer * Update the various buffer pointers. * * Return: >0 number of characters read * 0 if EOD (no data currently avalable) * -1 if error * -2 if EOF (stream closed) */ static int tcp_read( int fd) /* I */ { long i; long total = 0; unsigned long newsize; void *ptr; int done = 0; #ifdef HAVE_POLL struct pollfd pollset; int timeout; #else fd_set readset; struct timeval timeout; #endif struct tcpdisbuf *tp; tp = &tcparray[fd]->readbuf; /* must compact any uncommitted data into bottom of buffer */ tcp_pack_buff(tp); /* * we don't want to be locked out by an attack on the port to * deny service, so we time out the read, the network had better * deliver promptly */ tcparray[fd]->IsTimeout = 0; tcparray[fd]->SelectErrno = 0; tcparray[fd]->ReadErrno = 0; do { #ifdef HAVE_POLL /* poll()'s timeout is only a signed int, must be careful not to overflow */ if (INT_MAX / 1000 > pbs_tcp_timeout) timeout = pbs_tcp_timeout * 1000; else timeout = INT_MAX; pollset.fd = fd; pollset.events = POLLIN | POLLHUP; i = poll(&pollset, 1, timeout); #else timeout.tv_sec = pbs_tcp_timeout; timeout.tv_usec = 0; FD_ZERO(&readset); FD_SET(fd, &readset); i = select( fd + 1, &readset, NULL, NULL, &timeout); #endif } while ((i == -1) && (errno == EINTR)); if (i == 0) { /* timeout has occurred */ tcparray[fd]->IsTimeout = 1; return(0); } else if (i < 0) { /* select failed */ tcparray[fd]->SelectErrno = errno; return(-1); } while (1) { while ((i = read( fd, tp->tdis_eod, tp->tdis_thebuf + tp->tdis_bufsize - tp->tdis_eod)) == -1) { if (errno != EINTR) break; } if (i < 0) { /* FAILURE - read failed */ tcparray[fd]->ReadErrno = errno; return(-1); } else if (i == 0) { /* FAILURE - no data read */ return(-2); } /* SUCCESS */ if (i < tp->tdis_thebuf + tp->tdis_bufsize - tp->tdis_eod) done = 1; tp->tdis_eod += i; total += i; /* done reading if we haven't read our max size */ if (done) break; /* otherwise alloc more space and read again, add 25% more space */ newsize = tp->tdis_bufsize * 1.25; ptr = realloc(tp->tdis_thebuf,newsize); if (ptr == NULL) { /* failure to allocate memory, return NULL? */ log_err(ENOMEM,"tcp_read","Could not allocate memory to read buffer"); return(-1); } else { /* adjust the new values */ tp->tdis_eod += ((char *)ptr) - tp->tdis_thebuf; tp->tdis_trailp += ((char *)ptr) - tp->tdis_thebuf; tp->tdis_leadp += ((char *)ptr) - tp->tdis_thebuf; tp->tdis_thebuf = (char *)ptr; tp->tdis_bufsize = newsize; /* fall through to continue reading more */ } } return(total); } /* END tcp_read() */ /* * DIS_tcp_wflush - flush tcp/dis write buffer * * Writes "committed" data in buffer to file discriptor, * packs remaining data (if any), resets pointers * Returns: 0 on success, -1 on error * NOTE: does not close fd * */ int DIS_tcp_wflush( int fd) /* I */ { size_t ct; int i; char *pb; struct tcpdisbuf *tp; tp = &tcparray[fd]->writebuf; pb = tp->tdis_thebuf; ct = tp->tdis_trailp - tp->tdis_thebuf; while ((i = write(fd, pb, ct)) != (ssize_t)ct) { if (i == -1) { if (errno == EINTR) { continue; } /* FAILURE */ if (getenv("PBSDEBUG") != NULL) { fprintf(stderr, "TCP write of %d bytes (%.32s) failed, errno=%d (%s)\n", (int)ct, pb, errno, strerror(errno)); } return(-1); } /* END if (i == -1) */ ct -= i; pb += i; } /* END while (i) */ /* SUCCESS */ tp->tdis_eod = tp->tdis_leadp; tcp_pack_buff(tp); return(0); } /* END DIS_tcp_wflush() */ /* * DIS_tcp_clear - reset tpc/dis buffer to empty */ static void DIS_tcp_clear( struct tcpdisbuf *tp) { tp->tdis_leadp = tp->tdis_thebuf; tp->tdis_trailp = tp->tdis_thebuf; tp->tdis_eod = tp->tdis_thebuf; return; } void DIS_tcp_reset( int fd, int i) { struct tcp_chan *tcp; tcp = tcparray[fd]; if (i == 0) DIS_tcp_clear(&tcp->readbuf); else DIS_tcp_clear(&tcp->writebuf); return; } /* END DIS_tcp_reset() */ /* * tcp_rskip - tcp/dis support routine to skip over data in read buffer * * Returns: 0 on success, -1 on error */ static int tcp_rskip( int fd, size_t ct) { struct tcpdisbuf *tp; tp = &tcparray[fd]->readbuf; if (tp->tdis_leadp - tp->tdis_eod < (ssize_t)ct) { /* this isn't the best thing to do, but this isn't used, so */ return(-1); } tp->tdis_leadp += ct; return(0); } /* * tcp_getc - tcp/dis support routine to get next character from read buffer * * Return: >0 number of characters read * -1 if EOD or error * -2 if EOF (stream closed) */ static int tcp_getc( int fd) { int x; struct tcpdisbuf *tp; tp = &tcparray[fd]->readbuf; if (tp->tdis_leadp >= tp->tdis_eod) { /* not enough data, try to get more */ x = tcp_read(fd); if (x <= 0) { return((x == -2) ? -2 : -1); /* Error or EOF */ } } return((int)*tp->tdis_leadp++); } /* END tcp_getc() */ /* * tcp_gets - tcp/dis support routine to get a string from read buffer * * Return: >0 number of characters read * 0 if EOD (no data currently avalable) * -1 if error * -2 if EOF (stream closed) */ static int tcp_gets( int fd, char *str, size_t ct) { int x; struct tcpdisbuf *tp; tp = &tcparray[fd]->readbuf; while (tp->tdis_eod - tp->tdis_leadp < (ssize_t)ct) { /* not enough data, try to get more */ x = tcp_read(fd); if (x <= 0) { return(x); /* Error or EOF */ } } memcpy((char *)str, tp->tdis_leadp, ct); tp->tdis_leadp += ct; return((int)ct); } /* END tcp_gets() */ int PConnTimeout( int sock) /* I */ { if ((tcparray == NULL) || (tcparray[sock] == NULL)) { return(0); } if (tcparray[sock]->IsTimeout == 1) { /* timeout occurred, report 'TRUE' */ return(1); } return(0); } /* END PConnTimeout() */ int TConnGetReadErrno( int sock) /* I */ { if ((tcparray == NULL) || (tcparray[sock] == NULL)) { return(0); } return(tcparray[sock]->ReadErrno); } /* END TConnGetReadErrno() */ int TConnGetSelectErrno( int sock) /* I */ { if ((tcparray == NULL) || (tcparray[sock] == NULL)) { return(0); } return(tcparray[sock]->SelectErrno); } /* END TConnGetSelectErrno() */ /* * tcp_puts - tcp/dis support routine to put a counted string of characters * into the write buffer. * * Returns: >= 0, the number of characters placed * -1 if error */ static int tcp_puts( int fd, /* I */ const char *str, /* I */ size_t ct) /* I */ { #ifndef NDEBUG char *id = "tcp_puts"; #endif struct tcp_chan *tcp; struct tcpdisbuf *tp; char *temp; int leadpct, trailpct; size_t newbufsize; tcp = tcparray[fd]; /* NOTE: currently, failures may occur if THE_BUF_SIZE is not large enough */ /* this should be changed to allow proper operation with degraded */ /* performance (how?) */ tp = &tcp->writebuf; if ((tp->tdis_thebuf + tp->tdis_bufsize - tp->tdis_leadp) < (ssize_t)ct) { /* not enough room, reallocate the buffer */ leadpct = (int)(tp->tdis_thebuf - tp->tdis_leadp); trailpct = (int)(tp->tdis_thebuf - tp->tdis_trailp); newbufsize = tp->tdis_bufsize + THE_BUF_SIZE; temp = (char *)malloc(newbufsize); if(!temp) { /* FAILURE */ DBPRT(("%s: error! out of space in buffer and cannot realloc message buffer (bufsize=%ld, buflen=%d, ct=%d)\n", id, tp->tdis_bufsize, (int)(tp->tdis_leadp - tp->tdis_thebuf), (int)ct)) return(-1); } memcpy(temp, tp->tdis_thebuf, tp->tdis_bufsize); free(tp->tdis_thebuf); tp->tdis_thebuf = temp; tp->tdis_bufsize = newbufsize; tp->tdis_leadp = tp->tdis_thebuf - leadpct; tp->tdis_trailp = tp->tdis_thebuf - trailpct; } memcpy(tp->tdis_leadp, (char *)str, ct); tp->tdis_leadp += ct; return(ct); } /* END tcp_puts() */ /* * tcp_rcommit - tcp/dis support routine to commit/uncommit read data */ static int tcp_rcommit( int fd, int commit_flag) { struct tcpdisbuf *tp; tp = &tcparray[fd]->readbuf; if (commit_flag) { /* commit by moving trailing up */ tp->tdis_trailp = tp->tdis_leadp; } else { /* uncommit by moving leading back */ tp->tdis_leadp = tp->tdis_trailp; } return(0); } /* END tcp_rcommit() */ /* * tcp_wcommit - tcp/dis support routine to commit/uncommit write data */ static int tcp_wcommit( int fd, int commit_flag) { struct tcpdisbuf *tp; tp = &tcparray[fd]->writebuf; if (commit_flag) { /* commit by moving trailing up */ tp->tdis_trailp = tp->tdis_leadp; } else { /* uncommit by moving leading back */ tp->tdis_leadp = tp->tdis_trailp; } return(0); } void DIS_tcp_funcs(void) { if (dis_getc == tcp_getc) { return; } dis_getc = tcp_getc; dis_puts = tcp_puts; dis_gets = tcp_gets; disr_skip = tcp_rskip; disr_commit = tcp_rcommit; disw_commit = tcp_wcommit; return; } /* * DIS_tcp_setup - setup supports routines for dis, "data is strings", to * use tcp stream I/O. Also initializes an array of pointers to * buffers and a buffer to be used for the given fd. * * NOTE: tmpArray is global * * NOTE: does not return FAILURE - FIXME */ void DIS_tcp_setup( int fd) { struct tcp_chan *tcp; struct tcpdisbuf *tp; /* check for bad file descriptor */ if (fd < 0) { return; } /* set DIS function pointers to tcp routines */ DIS_tcp_funcs(); if (fd >= tcparraymax) { int hold = tcparraymax; tcparraymax = fd + 10; if (tcparray == NULL) { tcparray = (struct tcp_chan **)calloc( tcparraymax, sizeof(struct tcp_chan *)); if (tcparray == NULL) { /* FAILURE */ log_err(errno,"DIS_tcp_setup","calloc failure"); return; } } else { struct tcp_chan **tmpTA; tmpTA = (struct tcp_chan **)realloc( tcparray, tcparraymax * sizeof(struct tcp_chan *)); if (tmpTA == NULL) { /* FAILURE */ log_err(errno,"DIS_tcp_setup","realloc failure"); return; } tcparray = tmpTA; memset(&tcparray[hold], '\0', (tcparraymax - hold) * sizeof(struct tcp_chan *)); } } /* END if (fd >= tcparraymax) */ tcp = tcparray[fd]; if (tcp == NULL) { tcparray[fd] = (struct tcp_chan *)malloc(sizeof(struct tcp_chan)); tcp = tcparray[fd]; if (tcp == NULL) { log_err(errno, "DIS_tcp_setup", "malloc failure"); return; } tp = &tcp->readbuf; tp->tdis_thebuf = (char *)malloc(THE_BUF_SIZE); if(tp->tdis_thebuf == NULL) { log_err(errno,"DIS_tcp_setup","malloc failure"); return; } tp->tdis_bufsize = THE_BUF_SIZE; tp = &tcp->writebuf; tp->tdis_thebuf = (char *)malloc(THE_BUF_SIZE); if(tp->tdis_thebuf == NULL) { log_err(errno,"DIS_tcp_setup","malloc failure"); return; } tp->tdis_bufsize = THE_BUF_SIZE; } /* initialize read and write buffers */ DIS_tcp_clear(&tcp->readbuf); DIS_tcp_clear(&tcp->writebuf); return; } /* END DIS_tcp_setup() */ /* END tcp_dis.c */ torque-2.4.16/src/lib/Libifl/PBSD_sig2.c0000664000113300011330000001260211334071076014415 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_sigjob. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" /* PBS_sig_put.c * * Send the Signal Job Batch Request */ int PBSD_sig_put(c, jobid, signal, extend) int c; char *jobid; char *signal; char *extend; { int sock; int rc = 0; sock = connection[c].ch_socket; DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_SignalJob, pbs_current_user)) || (rc = encode_DIS_SignalJob(sock, jobid, signal)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; rc = pbs_errno; } return rc; } int PBSD_async_sig_put(c,jobid,signal,extend) int c; char *jobid; char *signal; char *extend; { int sock; int rc = 0; sock = connection[c].ch_socket; DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock,PBS_BATCH_SignalJob,pbs_current_user)) || (rc = encode_DIS_SignalJob(sock,jobid,signal)) || (rc = encode_DIS_ReqExtend(sock,extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; rc = pbs_errno; } return(rc); } torque-2.4.16/src/lib/Libifl/dec_Manage.c0000664000113300011330000001263511306021360014740 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_Manage() - decode a Manager Batch Request * * This request is used for most operations where an object is being * created, deleted, or altered. * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: unsigned int command * unsigned int object type * string object name * attropl attributes */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_Manage( int sock, struct batch_request *preq) { int rc; CLEAR_HEAD(preq->rq_ind.rq_manager.rq_attr); /* parse request */ preq->rq_ind.rq_manager.rq_cmd = disrui(sock, &rc); if (rc) { return(rc); } preq->rq_ind.rq_manager.rq_objtype = disrui(sock, &rc); if (rc) { return(rc); } rc = disrfst( sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_manager.rq_objname); if (rc) { return(rc); } rc = decode_DIS_svrattrl( sock, &preq->rq_ind.rq_manager.rq_attr); return (rc); } /* END decode_DIS_Manage() */ /* END dec_Manage.c */ torque-2.4.16/src/lib/Libifl/dec_JobId.c0000664000113300011330000001126511306021360014535 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_JobId() - decode a Job ID string into a batch_request * * This is used for the following batch requests: * Ready_to_Commit * Commit * Locate Job * Rerun Job * * Data items: string job id * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. */ #include /* the master config generated by configure */ #include "pbs_error.h" #include "pbs_ifl.h" #include "dis.h" int decode_DIS_JobId(int sock, char *jobid) { return (disrfst(sock, PBS_MAXSVRJOBID + 1, jobid)); } torque-2.4.16/src/lib/Libifl/tm.c0000664000113300011330000011057711326373231013372 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ /* define the following so we get prototype for getsid() */ #define _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED 1 #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef sun #include #endif #include #ifdef _AIX #include #endif /* _AIX */ #include "dis.h" #include "dis_init.h" #include "tm.h" #include "net_connect.h" #include "pbs_ifl.h" /* ** Set up a debug print macro. */ #ifdef DEBUG #define DBPRT(x) \ { \ int err = errno; \ printf x; \ errno = err; \ } #define DOID(x) static char id[] = x; #else #define DBPRT(x) #define DOID(x) #endif #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif /* ** Allocate some string space to hold the values passed in the ** enviornment from MOM. */ static char *tm_jobid = NULL; static int tm_jobid_len = 0; static char *tm_jobcookie = NULL; static int tm_jobcookie_len = 0; static tm_task_id tm_jobtid = TM_NULL_TASK; static tm_node_id tm_jobndid = TM_ERROR_NODE; static int tm_momport = 0; static int local_conn = -1; static int init_done = 0; int *tm_conn = &local_conn; void DIS_tcp_funcs(); /* ** Events are the central focus of this library. They are tracked ** in a hash table. Many of the library calls return events. They ** are recorded and as information is received from MOM's, the ** event is updated and marked so tm_poll() can return it to the user. */ #define EVENT_HASH 128 typedef struct event_info { tm_event_t e_event; /* event number */ tm_node_id e_node; /* destination node */ int e_mtype; /* message type sent */ void *e_info; /* possible returned info */ struct event_info *e_next; /* link to next event */ struct event_info *e_prev; /* link to prev event */ } event_info; static event_info *event_hash[EVENT_HASH]; static int event_count = 0; /* ** Find an event number or return a NULL. */ static event_info * find_event(tm_event_t x) { event_info *ep; for (ep = event_hash[x % EVENT_HASH]; ep; ep = ep->e_next) { if (ep->e_event == x) break; } return ep; } /* ** Delete an event. */ static void del_event(event_info *ep) { /* unlink event from hash list */ if (ep->e_prev) ep->e_prev->e_next = ep->e_next; else event_hash[ep->e_event % EVENT_HASH] = ep->e_next; if (ep->e_next) ep->e_next->e_prev = ep->e_prev; /* ** Free any memory saved with the event. This depends ** on whay type of event it is. */ switch (ep->e_mtype) { case TM_INIT: case TM_SPAWN: case TM_SIGNAL: case TM_OBIT: case TM_POSTINFO: break; case TM_TASKS: case TM_GETINFO: case TM_RESOURCES: free(ep->e_info); break; default: DBPRT(("del_event: unknown event command %d\n", ep->e_mtype)) break; } free(ep); if (--event_count == 0) { close(local_conn); local_conn = -1; } return; } /* ** Create a new event number. */ static tm_event_t new_event(void) { static tm_event_t next_event = TM_NULL_EVENT + 1; event_info *ep; tm_event_t ret; if (next_event == INT_MAX) next_event = TM_NULL_EVENT + 1; for (;;) { ret = next_event++; for (ep = event_hash[ret % EVENT_HASH]; ep; ep = ep->e_next) { if (ep->e_event == ret) break; /* innter loop: this number is in use */ } if (ep == NULL) break; /* this number is not in use */ } return ret; } /* ** Link new event number into the above hash table. */ static void add_event(tm_event_t event, tm_node_id node, int type, void *info) { event_info *ep, **head; ep = (event_info *)malloc(sizeof(event_info)); assert(ep != NULL); head = &event_hash[event % EVENT_HASH]; ep->e_event = event; ep->e_node = node; ep->e_mtype = type; ep->e_info = info; ep->e_next = *head; ep->e_prev = NULL; if (*head) (*head)->e_prev = ep; *head = ep; event_count++; return; } /* ** Sessions must be tracked by the library so tm_taskid objects ** can be resolved into real tasks on real nodes. ** We will use a hash table. */ #define TASK_HASH 256 typedef struct task_info { char *t_jobid; /* jobid */ tm_task_id t_task; /* task id */ tm_node_id t_node; /* node id */ struct task_info *t_next; /* link to next task */ } task_info; static task_info *task_hash[TASK_HASH]; /* ** Find a task table entry for a given task number or return a NULL. */ static task_info * find_task(tm_task_id x) { task_info *tp; for (tp = task_hash[x % TASK_HASH]; tp; tp = tp->t_next) { if (tp->t_task == x) break; } return tp; } /* ** Create a new task entry and link it into the above hash ** table. */ static tm_task_id new_task(char *jobid, tm_node_id node, tm_task_id task) { DOID("new_task") task_info *tp, **head; DBPRT(("%s: jobid=%s node=%d task=%lu\n", id, jobid, node, (unsigned long)task)) if (jobid != tm_jobid && strcmp(jobid, tm_jobid) != 0) { DBPRT(("%s: task job %s not my job %s\n", id, jobid, tm_jobid)) return TM_NULL_TASK; } if (node == TM_ERROR_NODE) { DBPRT(("%s: called with TM_ERROR_NODE\n", id)) return TM_NULL_TASK; } if ((tp = find_task(task)) != NULL) { DBPRT(("%s: task %lu found with node %d should be %d\n", id, (unsigned long)task, tp->t_node, node)) return task; } if ((tp = (task_info *)malloc(sizeof(task_info))) == NULL) return TM_NULL_TASK; head = &task_hash[task % TASK_HASH]; tp->t_jobid = tm_jobid; tp->t_task = task; tp->t_node = node; tp->t_next = *head; *head = tp; return task; } /* ** Delete a task. === === right now, this is not used. === static void del_task(x) tm_task_id x; { task_info *tp, *prev; prev = NULL; for (tp=task_hash[x % TASK_HASH]; tp; prev=tp, tp=tp->t_next) { if (tp->t_task == x) break; } if (tp) { if (prev) prev->t_next = tp->t_next; else task_hash[x % TASK_HASH] = tp->t_next; tp->t_next = NULL; if (tp->t_jobid != tm_jobid) free(tp->t_jobid); free(tp); } return; } */ /* ** The nodes are tracked in an array. */ static tm_node_id *node_table = NULL; /* ** localmom() - make a connection to the local pbs_mom ** ** The connection will remain open as long as there is an ** outstanding event. */ #define PBS_NET_RC_FATAL -1 #define PBS_NET_RC_RETRY -2 static int localmom(void) { static int have_addr = 0; static struct in_addr hostaddr; struct hostent *hp; int i; struct sockaddr_in remote; int sock; struct linger ltime; if (local_conn >= 0) { return(local_conn); /* already have open connection */ } if (have_addr == 0) { /* lookup "localhost" and save address */ if ((hp = gethostbyname("localhost")) == NULL) { DBPRT(("tm_init: localhost not found\n")) return(-1); } assert((int)hp->h_length <= (int)sizeof(hostaddr)); memcpy(&hostaddr, hp->h_addr_list[0], hp->h_length); have_addr = 1; } for (i = 0;i < 5;i++) { /* get socket */ sock = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { return(-1); } #ifndef HAVE_POLL if (sock >= FD_SETSIZE) { close(sock); return(-1); } #endif /* make sure data goes out */ ltime.l_onoff = 1; ltime.l_linger = 5; setsockopt(sock, SOL_SOCKET, SO_LINGER, <ime, sizeof(ltime)); /* connect to specified local pbs_mom and port */ remote.sin_addr = hostaddr; remote.sin_port = htons((unsigned short)tm_momport); remote.sin_family = AF_INET; if (connect(sock, (struct sockaddr *)&remote, sizeof(remote)) < 0) { switch (errno) { case EINTR: case EADDRINUSE: case ETIMEDOUT: case ECONNREFUSED: close(sock); sleep(1); continue; /*NOTREACHED*/ break; default: close(sock); return(-1); /*NOTREACHED*/ break; } } else { local_conn = sock; break; } } /* END for (i) */ if (local_conn >= 0) DIS_tcp_setup(local_conn); return(local_conn); } /* END local_mom() */ /* ** startcom() - send request header to local pbs_mom. ** If required, make connection to her. */ static int startcom( int com, tm_event_t event) { int ret; if (localmom() == -1) { return(-1); } ret = diswsi(local_conn, TM_PROTOCOL); if (ret != DIS_SUCCESS) goto done; ret = diswsi(local_conn, TM_PROTOCOL_VER); if (ret != DIS_SUCCESS) goto done; ret = diswcs(local_conn, tm_jobid, tm_jobid_len); if (ret != DIS_SUCCESS) goto done; ret = diswcs(local_conn, tm_jobcookie, tm_jobcookie_len); if (ret != DIS_SUCCESS) goto done; ret = diswsi(local_conn, com); if (ret != DIS_SUCCESS) goto done; ret = diswsi(local_conn, event); if (ret != DIS_SUCCESS) goto done; ret = diswui(local_conn, tm_jobtid); if (ret != DIS_SUCCESS) goto done; return(DIS_SUCCESS); done: DBPRT(("startcom: send error %s\n", dis_emsg[ret])) close(local_conn); local_conn = -1; return(ret); } /* END startcom() */ /* ** Initialize the Task Manager interface. */ int tm_init( void *info, /* in, currently unused */ struct tm_roots *roots) /* out */ { tm_event_t nevent, revent; char *env, *hold; int err; int nerr = 0; if (init_done) { return(TM_BADINIT); } if ((tm_jobid = getenv("PBS_JOBID")) == NULL) { return(TM_EBADENVIRONMENT); } tm_jobid_len = strlen(tm_jobid); if ((tm_jobcookie = getenv("PBS_JOBCOOKIE")) == NULL) return TM_EBADENVIRONMENT; tm_jobcookie_len = strlen(tm_jobcookie); if ((env = getenv("PBS_NODENUM")) == NULL) return TM_EBADENVIRONMENT; tm_jobndid = (tm_node_id)strtol(env, &hold, 10); if (env == hold) return TM_EBADENVIRONMENT; if ((env = getenv("PBS_TASKNUM")) == NULL) return TM_EBADENVIRONMENT; if ((tm_jobtid = atoi(env)) == 0) return TM_EBADENVIRONMENT; if ((env = getenv("PBS_MOMPORT")) == NULL) return TM_EBADENVIRONMENT; if ((tm_momport = atoi(env)) == 0) return TM_EBADENVIRONMENT; init_done = 1; nevent = new_event(); /* * send the following request: * header (tm_init) * int node number * int task number */ if (startcom(TM_INIT, nevent) != DIS_SUCCESS) return TM_ESYSTEM; DIS_tcp_wflush(local_conn); add_event(nevent, TM_ERROR_NODE, TM_INIT, (void *)roots); if ((err = tm_poll(TM_NULL_EVENT, &revent, 1, &nerr)) != TM_SUCCESS) return err; return nerr; } /* ** Copy out node info. No communication with pbs_mom is needed. */ int tm_nodeinfo( tm_node_id **list, int *nnodes) { tm_node_id *np; int i; int n = 0; if (!init_done) { return (TM_BADINIT); } if (node_table == NULL) { return (TM_ESYSTEM); } for (np = node_table; *np != TM_ERROR_NODE; np++) n++; /* how many nodes */ if ((np = (tm_node_id *)calloc(n,sizeof(tm_node_id))) == NULL) { /* FAILURE - cannot alloc memory */ return(TM_ERROR); } for (i = 0; i < n; i++) np[i] = node_table[i]; *list = np; *nnodes = i; return(TM_SUCCESS); } /* END tm_nodeinfo() */ /* ** Starts [0] with environment at . */ int tm_spawn( int argc, /* in */ char **argv, /* in */ char **envp, /* in */ tm_node_id where, /* in */ tm_task_id *tid, /* out */ tm_event_t *event) /* out */ { char *cp; int i; /* NOTE: init_done is global */ if (!init_done) { return(TM_BADINIT); } if ((argc <= 0) || (argv == NULL) || (argv[0] == NULL) || (*argv[0] == '\0')) { return(TM_ENOTFOUND); } *event = new_event(); if (startcom(TM_SPAWN, *event) != DIS_SUCCESS) { return(TM_ENOTCONNECTED); } if (diswsi(local_conn, where) != DIS_SUCCESS) /* send where */ { return(TM_ENOTCONNECTED); } if (diswsi(local_conn, argc) != DIS_SUCCESS) /* send argc */ { return(TM_ENOTCONNECTED); } /* send argv strings across */ for (i = 0;i < argc;i++) { cp = argv[i]; if (diswcs(local_conn, cp, strlen(cp)) != DIS_SUCCESS) { return(TM_ENOTCONNECTED); } } /* send envp strings across */ if (getenv("PBSDEBUG") != NULL) { if (diswcs(local_conn, "PBSDEBUG=1", strlen("PBSDEBUG=1")) != DIS_SUCCESS) { return(TM_ENOTCONNECTED); } } if (envp != NULL) { for (i = 0;(cp = envp[i]) != NULL;i++) { if (diswcs(local_conn, cp, strlen(cp)) != DIS_SUCCESS) { return(TM_ENOTCONNECTED); } } } if (diswcs(local_conn, "", 0) != DIS_SUCCESS) { return(TM_ENOTCONNECTED); } DIS_tcp_wflush(local_conn); add_event(*event, where, TM_SPAWN, (void *)tid); return(TM_SUCCESS); } /* END tm_spawn() */ /* ** Sends a signal to all the process groups in the task ** signified by the handle, . */ int tm_kill( tm_task_id tid, /* in */ int sig, /* in */ tm_event_t *event /* out */ ) { task_info *tp; if (!init_done) return TM_BADINIT; if ((tp = find_task(tid)) == NULL) return TM_ENOTFOUND; *event = new_event(); if (startcom(TM_SIGNAL, *event) != DIS_SUCCESS) return TM_ENOTCONNECTED; if (diswsi(local_conn, tp->t_node) != DIS_SUCCESS) return TM_ENOTCONNECTED; if (diswsi(local_conn, tid) != DIS_SUCCESS) return TM_ENOTCONNECTED; if (diswsi(local_conn, sig) != DIS_SUCCESS) return TM_ENOTCONNECTED; DIS_tcp_wflush(local_conn); add_event(*event, tp->t_node, TM_SIGNAL, NULL); return TM_SUCCESS; } /* ** Returns an event that can be used to learn when a task ** dies. */ int tm_obit( tm_task_id tid, /* in */ int *obitval, /* out */ tm_event_t *event /* out */ ) { task_info *tp; if (!init_done) return TM_BADINIT; if ((tp = find_task(tid)) == NULL) return TM_ENOTFOUND; *event = new_event(); if (startcom(TM_OBIT, *event) != DIS_SUCCESS) return TM_ESYSTEM; if (diswsi(local_conn, tp->t_node) != DIS_SUCCESS) return TM_ESYSTEM; if (diswsi(local_conn, tid) != DIS_SUCCESS) return TM_ESYSTEM; DIS_tcp_wflush(local_conn); add_event(*event, tp->t_node, TM_OBIT, (void *)obitval); return TM_SUCCESS; } struct taskhold { tm_task_id *list; int size; int *ntasks; }; /* ** Makes a request for the list of tasks on . If ** is a valid node number, it returns the event that the list of ** tasks on is available. */ int tm_taskinfo( tm_node_id node, /* in */ tm_task_id *tid_list, /* out */ int list_size, /* in */ int *ntasks, /* out */ tm_event_t *event /* out */ ) { struct taskhold *thold; if (!init_done) return TM_BADINIT; if (tid_list == NULL || list_size == 0 || ntasks == NULL) return TM_EBADENVIRONMENT; *event = new_event(); if (startcom(TM_TASKS, *event) != DIS_SUCCESS) return TM_ESYSTEM; if (diswsi(local_conn, node) != DIS_SUCCESS) return TM_ESYSTEM; DIS_tcp_wflush(local_conn); thold = (struct taskhold *)malloc(sizeof(struct taskhold)); assert(thold != NULL); thold->list = tid_list; thold->size = list_size; thold->ntasks = ntasks; add_event(*event, node, TM_TASKS, (void *)thold); return TM_SUCCESS; } /* ** Returns the job-relative node number that holds or held . In ** case of an error, it returns TM_ERROR_NODE. */ int tm_atnode( tm_task_id tid, /* in */ tm_node_id *node /* out */ ) { task_info *tp; if (!init_done) return TM_BADINIT; if ((tp = find_task(tid)) == NULL) return TM_ENOTFOUND; *node = tp->t_node; return TM_SUCCESS; } struct reschold { char *resc; int len; }; /* ** Makes a request for a string specifying the resources ** available on . If is a valid node number, it ** returns the event that the string specifying the resources on ** is available. It returns ERROR_EVENT otherwise. */ int tm_rescinfo( tm_node_id node, /* in */ char *resource, /* out */ int len, /* in */ tm_event_t *event /* out */ ) { struct reschold *rhold; if (!init_done) return TM_BADINIT; if (resource == NULL || len == 0) return TM_EBADENVIRONMENT; *event = new_event(); if (startcom(TM_RESOURCES, *event) != DIS_SUCCESS) return TM_ESYSTEM; if (diswsi(local_conn, node) != DIS_SUCCESS) return TM_ESYSTEM; DIS_tcp_wflush(local_conn); rhold = (struct reschold *)malloc(sizeof(struct reschold)); assert(rhold != NULL); rhold->resc = resource; rhold->len = len; add_event(*event, node, TM_RESOURCES, (void *)rhold); return TM_SUCCESS; } /* ** Posts the first of a copy of * within MOM on ** this node, and associated with this task. If is ** non-NULL, it returns the event that the effort to post * ** is complete. It returns ERROR_EVENT otherwise. */ int tm_publish( char *name, /* in */ void *info, /* in */ int len, /* in */ tm_event_t *event /* out */ ) { if (!init_done) return TM_BADINIT; *event = new_event(); if (startcom(TM_POSTINFO, *event) != DIS_SUCCESS) return TM_ESYSTEM; if (diswst(local_conn, name) != DIS_SUCCESS) return TM_ESYSTEM; if (diswcs(local_conn, info, len) != DIS_SUCCESS) return TM_ESYSTEM; DIS_tcp_wflush(local_conn); add_event(*event, TM_ERROR_NODE, TM_POSTINFO, NULL); return TM_SUCCESS; } struct infohold { void *info; int len; int *info_len; }; /* ** Makes a request for a copy of the info posted by . If ** is a valid task, it returns the event that the ** string specifying the info posted by is available. */ int tm_subscribe( tm_task_id tid, /* in */ char *name, /* in */ void *info, /* out */ int len, /* in */ int *info_len, /* out */ tm_event_t *event /* out */ ) { task_info *tp; struct infohold *ihold; if (!init_done) return TM_BADINIT; if ((tp = find_task(tid)) == NULL) return TM_ENOTFOUND; *event = new_event(); if (startcom(TM_GETINFO, *event) != DIS_SUCCESS) return TM_ESYSTEM; if (diswsi(local_conn, tp->t_node) != DIS_SUCCESS) return TM_ESYSTEM; if (diswsi(local_conn, tid) != DIS_SUCCESS) return TM_ESYSTEM; if (diswst(local_conn, name) != DIS_SUCCESS) return TM_ESYSTEM; DIS_tcp_wflush(local_conn); ihold = (struct infohold *)malloc(sizeof(struct infohold)); assert(ihold != NULL); ihold->info = info; ihold->len = len; ihold->info_len = info_len; add_event(*event, tp->t_node, TM_GETINFO, (void *)ihold); return TM_SUCCESS; } /* ** tm_finalize() - close out task manager interface ** ** This function should be the last one called. It is illegal to call ** any other task manager function following this one. All events are ** freed and any connection to the task manager (pbs_mom) is closed. ** This call is synchronous. */ int tm_finalize(void) { event_info *e; int i = 0; if (!init_done) return TM_BADINIT; while (event_count && (i < EVENT_HASH)) { while ((e = event_hash[i]) != NULL) { del_event(e); } ++i; /* check next slot in hash table */ } init_done = 0; return TM_SUCCESS; /* what else */ } /* ** tm_notify() - set the signal to be sent on event arrival. */ int tm_notify(int tm_signal) { if (!init_done) return TM_BADINIT; return TM_ENOTIMPLEMENTED; } /* ** tm_alloc() - make a request for additional resources. */ int tm_alloc(char *resources, tm_event_t *event) { if (!init_done) return TM_BADINIT; return TM_ENOTIMPLEMENTED; } /* ** tm_dealloc() - drop a node from the job. */ int tm_dealloc(tm_node_id node, tm_event_t *event) { if (!init_done) return TM_BADINIT; return TM_ENOTIMPLEMENTED; } /* ** tm_create_event() - create a persistent event. */ int tm_create_event(tm_event_t *event) { if (!init_done) return TM_BADINIT; return TM_ENOTIMPLEMENTED; } /* ** tm_destroy_event() - destroy a persistent event. */ int tm_destroy_event(tm_event_t *event) { if (!init_done) return TM_BADINIT; return TM_ENOTIMPLEMENTED; } /* ** tm_register() - link a persistent event with action requests ** from the task manager. */ int tm_register(tm_whattodo_t *what, tm_event_t *event) { if (!init_done) return TM_BADINIT; return TM_ENOTIMPLEMENTED; } #define FOREVER 2592000 /* ** tm_poll - poll to see if an event has be completed. ** ** If "poll_event" is a valid event handle, see if it is completed; ** else if "poll_event" is the null event, check for the first event that ** is completed. ** ** result_event is set to the completed event or the null event. ** ** If wait is non_zero, wait for "poll_event" to be completed. ** ** If an error ocurs, set tm_errno non-zero. */ int tm_poll( tm_event_t poll_event, tm_event_t *result_event, int wait, int *tm_errno) { DOID("tm_poll") int num, i; int ret, mtype, nnodes; int prot, protver; int *obitvalp; event_info *ep = NULL; tm_task_id tid, *tidp; tm_event_t nevent; tm_node_id node; char *jobid; char *info; struct tm_roots *roots; struct taskhold *thold; struct infohold *ihold; struct reschold *rhold; extern time_t pbs_tcp_timeout; if (!init_done) { return(TM_BADINIT); } if (result_event == NULL) return(TM_EBADENVIRONMENT); *result_event = TM_ERROR_EVENT; if (poll_event != TM_NULL_EVENT) return(TM_ENOTIMPLEMENTED); if (tm_errno == NULL) return(TM_EBADENVIRONMENT); if (event_count == 0) { DBPRT(("%s: no events waiting\n", id)) return(TM_ENOTFOUND); } if (local_conn < 0) { DBPRT(("%s: INTERNAL ERROR %d events but no connection\n", id, event_count)) return(TM_ENOTCONNECTED); } /* ** Setup tcp dis routines with a wait value appropriate for ** the value of wait the user set. */ pbs_tcp_timeout = wait ? FOREVER : 0; DIS_tcp_funcs(); prot = disrsi(local_conn, &ret); if (ret == DIS_EOD) { *result_event = TM_NULL_EVENT; return TM_SUCCESS; } else if (ret != DIS_SUCCESS) { DBPRT(("%s: protocol number dis error %d\n", id, ret)) goto err; } if (prot != TM_PROTOCOL) { DBPRT(("%s: bad protocol number %d\n", id, prot)) goto err; } /* ** We have seen the start of a message. Set the timeout value ** so we wait for the remaining data of a message. */ pbs_tcp_timeout = FOREVER; protver = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: protocol version dis error %d\n", id, ret)) goto err; } if (protver != TM_PROTOCOL_VER) { DBPRT(("%s: bad protocol version %d\n", id, protver)) goto err; } mtype = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: mtype dis error %d\n", id, ret)) goto err; } nevent = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: event dis error %d\n", id, ret)) goto err; } *result_event = nevent; DBPRT(("%s: got event %d return %d\n", id, nevent, mtype)) if ((ep = find_event(nevent)) == NULL) { DBPRT(("%s: No event found for number %d\n", id, nevent)); (void)close(local_conn); local_conn = -1; return TM_ENOEVENT; } if (mtype == TM_ERROR) /* problem, read error num */ { *tm_errno = disrsi(local_conn, &ret); DBPRT(("%s: event %d error %d\n", id, nevent, *tm_errno)); goto done; } *tm_errno = TM_SUCCESS; switch (ep->e_mtype) { /* ** auxiliary info ( ** number of nodes int; ** nodeid[0] int; ** ... ** nodeid[n-1] int; ** parent jobid string; ** parent nodeid int; ** parent taskid int; ** ) */ case TM_INIT: nnodes = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: INIT failed nnodes\n", id)) goto err; } node_table = (tm_node_id *)calloc(nnodes + 1, sizeof(tm_node_id)); if (node_table == NULL) { perror("Memory allocation failed"); goto err; } DBPRT(("%s: INIT nodes %d\n", id, nnodes)) for (i = 0; i < nnodes; i++) { node_table[i] = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: INIT failed nodeid %d\n", id, i)) goto err; } } node_table[nnodes] = TM_ERROR_NODE; jobid = disrst(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: INIT failed jobid\n", id)) goto err; } DBPRT(("%s: INIT daddy jobid %s\n", id, jobid)) node = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: INIT failed parent nodeid\n", id)) goto err; } DBPRT(("%s: INIT daddy node %d\n", id, node)) tid = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: INIT failed parent taskid\n", id)) goto err; } DBPRT(("%s: INIT daddy tid %lu\n", id, (unsigned long)tid)) roots = (struct tm_roots *)ep->e_info; roots->tm_parent = new_task(jobid, node, tid); roots->tm_me = new_task(tm_jobid, tm_jobndid, tm_jobtid); roots->tm_nnodes = nnodes; roots->tm_ntasks = 0; /* TODO */ roots->tm_taskpoolid = -1; /* what? */ roots->tm_tasklist = NULL; /* TODO */ break; case TM_TASKS: thold = (struct taskhold *)ep->e_info; tidp = thold->list; num = thold->size; for (i = 0;; i++) { tid = disrsi(local_conn, &ret); if (tid == TM_NULL_TASK) break; if (ret != DIS_SUCCESS) goto err; if (i < num) { tidp[i] = new_task(tm_jobid, ep->e_node, tid); } } if (i < num) tidp[i] = TM_NULL_TASK; *(thold->ntasks) = i; break; case TM_SPAWN: tid = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: SPAWN failed tid\n", id)) goto err; } tidp = (tm_task_id *)ep->e_info; *tidp = new_task(tm_jobid, ep->e_node, tid); break; case TM_SIGNAL: break; case TM_OBIT: obitvalp = (int *)ep->e_info; *obitvalp = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: OBIT failed obitval\n", id)) goto err; } break; case TM_POSTINFO: break; case TM_GETINFO: ihold = (struct infohold *)ep->e_info; info = disrcs(local_conn, (size_t *)ihold->info_len, &ret); if (ret != DIS_SUCCESS) { DBPRT(("%s: GETINFO failed info\n", id)) break; } memcpy(ihold->info, info, MIN(*ihold->info_len, ihold->len)); free(info); break; case TM_RESOURCES: rhold = (struct reschold *)ep->e_info; info = disrst(local_conn, &ret); if (ret != DIS_SUCCESS) break; strncpy(rhold->resc, info, rhold->len); free(info); break; default: DBPRT(("%s: unknown event command %d\n", id, ep->e_mtype)) goto err; } done: del_event(ep); return TM_SUCCESS; err: if (ep) del_event(ep); (void)close(local_conn); local_conn = -1; return TM_ENOTCONNECTED; } /* * tm_adopt() -- * * When PBS is used in conjuction with an alternative (MPI) task * spawning/management system (AMS) (like Quadrics RMS or SGI array * services), only the script task on the mother superior node will * be parented by (or even known to) a PBS MOM. Unless the AMS is * PBS-(tm-)aware, all other tasks will be parented (and to varying * extents managed) by the AMS. This means that PBS cannot track * task resource usage (unless the AMS provides such info) nor * manage (suspend, resume, signal, clean up, ...) the task (unless * the AMS provides such functionality). For example pvmrun and * some mpiruns simply use rsh to start remote processes - no AMS * tracking or management facilities are available. * * This function allows any task (session) to be adopted into a PBS * job. It is used by: * - "adopter" (which is in turn used by our pvmrun) * - our rmsloader wrapper (a home-brew replacement for RMS' * rmsloader that does some work and then exec()s the real * rmsloader) to tell PBS to adopt its session id (which * (hopefully) is also the session id for all its child * processes). * - anumpirun on SGI Altix systems * * Call this instead of tm_init() to ask the local pbs_mom to * adopt a session (i.e. create a new task corresponding to the * session id). Note that this may subvert all of the cookie stuff * in PBS as the AMS task starter may not have any PBS cookie info * (eg rmsloader) * * Arguments: * char *id AMS altid (eg RMS resource id) or PBS_JOBID * (depending on adoptCmd) of the job that will adopt * sid. This is how pbs_mom works out which job will * adopt the sid. * int adoptCmd either TM_ADOPT_JOBID or TM_ADOPT_ALTID if task * id is AMS altid * pid_t pid process id of process to be adopted (always self?) * * Assumption: * If TM_ADOPT_ALTID is used to identify tasks to be adopted, PBS * must be configured to work with one and only one alternative task * spawning/management system that uses it own task identifiers. * * Result: * Returns TM_SUCCESS if the session was successfully adopted by * the mom. Returns TM_ENOTFOUND if the mom couldn't find a job * with the given RMS resource id. Returns TM_ESYSTEM or * TM_ENOTCONNECTED if there was some sort of comms error talking * to the mom * * Side effects: * Sets the tm_* globals to fake values if tm_init() has never * been called. This mainly just prevents segfaults etc when * these values are written to local_conn - the mom ignores most * of them for this special adopt case * */ int tm_adopt(char *id, int adoptCmd, pid_t pid) { int status, ret; pid_t sid; char *env; sid = getsid(pid); /* Must be the only call to call to tm and must only be called once */ if (init_done) return TM_BADINIT; init_done = 1; /* Fabricate the tm state as best we can - not really needed */ if ((tm_jobid = getenv("PBS_JOBID")) == NULL) tm_jobid = "ADOPT JOB"; tm_jobid_len = strlen(tm_jobid); if ((tm_jobcookie = getenv("PBS_JOBCOOKIE")) == NULL) tm_jobcookie = "ADOPT COOKIE"; tm_jobcookie_len = strlen(tm_jobcookie); /* We dont have the (right) node id or task id */ tm_jobndid = 0; tm_jobtid = 0; /* Fallback is system default MOM port if not known */ if ((env = getenv("PBS_MOMPORT")) == NULL || (tm_momport = atoi(env)) == 0) tm_momport = PBS_MANAGER_SERVICE_PORT; /* DJH 27 Feb 2002. two kinds of adoption now */ if (adoptCmd != TM_ADOPT_ALTID && adoptCmd != TM_ADOPT_JOBID) return TM_EUNKNOWNCMD; if (startcom(adoptCmd, TM_NULL_EVENT) != DIS_SUCCESS) return TM_ESYSTEM; /* send session id */ if (diswsi(local_conn, sid) != DIS_SUCCESS) return TM_ENOTCONNECTED; /* send job or alternative id */ if (diswcs(local_conn, id, strlen(id)) != DIS_SUCCESS) return TM_ENOTCONNECTED; DIS_tcp_wflush(local_conn); /* The mom should now attempt to adopt the task and will send back a status flag to indicate whether it was successful or not. */ status = disrsi(local_conn, &ret); if (ret != DIS_SUCCESS) return TM_ENOTCONNECTED; /* Don't allow any more tm_* calls in this process. As well as closing an unused socket it also prevents any problems related to the fact that all adopted processes have a fake task id which might break the tm mechanism */ tm_finalize(); /* Since we're not using events, tm_finalize won't actually close the socket, so do it here. */ if (local_conn > -1) { close(local_conn); local_conn = -1; } return (status == TM_OKAY ? TM_SUCCESS : TM_ENOTFOUND); } torque-2.4.16/src/lib/Libifl/enc_Reg.c0000664000113300011330000001217511306021360014276 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_Register() - encode a Register Dependency Batch Request * * This request is used by the server ONLY; its input is a server * batch request structure. * * Data items are: string job owner * string parent job id * string child job id * unsigned int dependency type * unsigned int operation * signed long cost */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int encode_DIS_Register(int sock, struct batch_request *preq) { int rc; if ((rc = diswst(sock, preq->rq_ind.rq_register.rq_owner) != 0) || (rc = diswst(sock, preq->rq_ind.rq_register.rq_parent) != 0) || (rc = diswst(sock, preq->rq_ind.rq_register.rq_child) != 0) || (rc = diswui(sock, preq->rq_ind.rq_register.rq_dependtype) != 0) || (rc = diswui(sock, preq->rq_ind.rq_register.rq_op) != 0) || (rc = diswsl(sock, preq->rq_ind.rq_register.rq_cost) != 0)) return rc; return 0; } torque-2.4.16/src/lib/Libifl/pbsD_statjob.c0000664000113300011330000001233711272401246015361 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_statjob.c Return the status of a job. */ #include /* the master config generated by configure */ #include "libpbs.h" struct batch_status *pbs_statjob( int c, /* I - socket descriptor */ char *id, /* I - job id (optional) */ struct attrl *attrib, /* ??? */ char *extend) /* I - ??? */ { /* NOTE: tcp_read(fd=10) #0 tcp_getc (fd=10) at ../Libifl/tcp_dis.c:399 #1 0x081e40ab in disrsl_ (stream=10, negate=0xbffe9ed0, value=0xbffe9ecc, count=1) at ../Libdis/disrsl_.c:130 #2 0x081e65ef in disrul (stream=10, retval=0xbffe9f04) at ../Libdis/disrul.c:124 #3 0x081e4bbe in decode_DIS_replyCmd (sock=10, reply=0xc6d78e8) at ../Libifl/dec_rpyc.c:119 #4 0x081e47ec in PBSD_rdrpy (c=1) at ../Libifl/PBSD_rdrpy.c:131 #5 0x081e5c91 in PBSD_status_get (c=1) at ../Libifl/PBSD_status.c:144 #6 0x081e5c66 in PBSD_status (c=1, function=19, id=0x8242b48 "", attrib=0x0, extend=0x0) at ../Libifl/PBSD_status.c:125 #7 0x081e3df8 in pbs_statjob (c=1, id=0x0, attrib=0x0, extend=0x0) at ../Libifl/pbsD_statjob.c:96 */ return(PBSD_status(c, PBS_BATCH_StatusJob, id, attrib, extend)); } /* END pbs_statjob() */ torque-2.4.16/src/lib/Libifl/enc_RunJob.c0000664000113300011330000001107211306021360014753 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_RunJob() - encode a Run Job Batch Request * * Data items are: string job id * string destination * unsigned int resource handle (currently 0) */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_RunJob(int sock, char *jobid, char *where, unsigned int resch) { int rc; if ((rc = diswst(sock, jobid) != 0) || (rc = diswst(sock, where) != 0) || (rc = diswui(sock, resch) != 0)) return rc; return 0; } torque-2.4.16/src/lib/Libifl/pbsD_statsrv.c0000664000113300011330000001060511272401246015415 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_statserver.c Return the status of a server. */ #include /* the master config generated by configure */ #include "libpbs.h" struct batch_status *pbs_statserver( int c, struct attrl *attrib, char *extend) { return(PBSD_status(c, PBS_BATCH_StatusSvr, "", attrib, extend)); } /* END pbsD_statsrv.c */ torque-2.4.16/src/lib/Libifl/enc_attropl.c0000664000113300011330000001462511306021360015250 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_attropl() - encode a list of PBS API "attropl" structures * * The first item encoded is a unsigned integer, a count of the * number of attropl entries in the linked list. This is encoded * even when there are no attropl entries in the list. * * Each individual entry is then encoded as: * u int size of the three strings (name, resource, value) * including the terminating nulls * string attribute name * u int 1 or 0 if resource name does or does not follow * string resource name (if one) * string value of attribute/resource * u int "op" of attrlop * * Note, the encoding of a attropl is the same as the encoding of * the pbs_ifl.h structures "attrl" and the server svrattrl. Any * one of the three forms can be decoded into any of the three with the * possible loss of the "flags" field (which is the "op" of the attrlop). */ #include /* the master config generated by configure */ #include "pbs_ifl.h" #include "dis.h" int encode_DIS_attropl( int sock, struct attropl *pattropl) { unsigned int ct = 0; unsigned int name_len; struct attropl *ps; int rc; /* count how many */ for (ps = pattropl;ps;ps = ps->next) { ++ct; } if ((rc = diswui(sock, ct))) { return(rc); } for (ps = pattropl;ps;ps = ps->next) { /* length of three strings */ if (ps->name == NULL) { /* Continue if attribute has no name (CRI 2005-04-22). */ continue; } name_len = strlen(ps->name) + 1; if (ps->value != NULL) name_len += strlen(ps->value) + 1; if (ps->resource != NULL) name_len += strlen(ps->resource) + 1; if ((rc = diswui(sock, name_len))) break; if ((rc = diswst(sock, ps->name))) break; if (ps->resource != NULL) { /* has a resource name */ if ((rc = diswui(sock, 1))) break; if ((rc = diswst(sock, ps->resource))) break; } else { if ((rc = diswui(sock, 0))) /* no resource name */ break; } if (ps->value != NULL) { if ((rc = diswst(sock, ps->value)) || (rc = diswui(sock, (unsigned int)ps->op))) break; } else { if ((rc = diswst(sock, "")) || (rc = diswui(sock, (unsigned int)ps->op))) break; } } /* END for (ps) */ return(rc); } /* END encode_DIS_attropl() */ torque-2.4.16/src/lib/Libifl/enc_MoveJob.c0000664000113300011330000001107711306021360015122 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_MoveJob() - encode a Move Job Batch Request * also used for an Order Job Batch Request * * Data items are: string job id * string destination */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_MoveJob( int sock, char *jobid, char *destin) { int rc; if ((rc = diswst(sock, jobid) != 0) || (rc = diswst(sock, destin) != 0)) { /* FAILURE */ return(rc); } /* SUCCESS */ return(0); } torque-2.4.16/src/lib/Libifl/enc_JobCred.c0000664000113300011330000001076411272401246015102 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_JobCred() - encode a Job Credential Batch Request * * Data items are: unsigned int Credential type * string the credential (octet array) */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_JobCred(int sock, int type, char *cred, int len) { int rc; if ((rc = diswui(sock, type))) return rc; rc = diswcs(sock, cred, (size_t)len); return rc; } torque-2.4.16/src/lib/Libifl/dec_attrl.c0000664000113300011330000001444511306021360014677 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_attrl() - decode into a list of PBS API "attrl" structures * * The space for the attrl structures is allocated as needed. * * The first item is a unsigned integer, a count of the * number of attrl entries in the linked list. This is encoded * even when there are no entries in the list. * * Each individual entry is encoded as: * u int size of the three strings (name, resource, value) * including the terminating nulls, see dec_svrattrl.c * string attribute name * u int 1 or 0 if resource name does or does not follow * string resource name (if one) * string value of attribute/resource * u int "op" of attrlop (also flag of svrattrl) * * Note, the encoding of a attrl is the same as the encoding of * the pbs_ifl.h structures "attropl" and the server struct svrattrl. * Any one of the three forms can be decoded into any of the three with * the possible loss of the "flags" field (which is the "op" of the * attrlop). */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "dis.h" int decode_DIS_attrl(int sock, struct attrl **ppatt) { int hasresc; unsigned int i; unsigned int name_len; unsigned int numpat; struct attrl *pat = NULL; struct attrl *patprior = NULL; int rc; numpat = disrui(sock, &rc); if (rc) return rc; for (i = 0; i < numpat; ++i) { name_len = disrui(sock, &rc); /* name_len is unusued here */ if (rc) break; pat = malloc(sizeof(struct attrl)); if (pat == 0) return DIS_NOMALLOC; pat->next = (struct attrl *)0; pat->name = (char *)0; pat->resource = (char *)0; pat->value = (char *)0; pat->name = disrst(sock, &rc); if (rc) break; hasresc = disrui(sock, &rc); if (rc) break; if (hasresc) { pat->resource = disrst(sock, &rc); if (rc) break; } pat->value = disrst(sock, &rc); if (rc) break; /* discard the op field */ (void)disrui(sock, &rc); if (rc) break; if (i == 0) { /* first one, link to passing in pointer */ *ppatt = pat; } else { patprior->next = pat; } patprior = pat; } if (rc) PBS_free_aopl((struct attropl *)pat); return rc; } torque-2.4.16/src/lib/Libifl/PBSD_status2.c0000664000113300011330000001163311306021360015147 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* PBS_status_put() The function that sends the general batch status request */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int PBSD_status_put( int c, int function, char *id, struct attrl *attrib, char *extend) { int rc = 0; int sock; sock = connection[c].ch_socket; DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, function, pbs_current_user)) || (rc = encode_DIS_Status(sock, id, attrib)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } /* success */ return(0); } /* END PBSD_status_put() */ torque-2.4.16/src/lib/Libifl/pbsD_selectj.c0000664000113300011330000001650511306021360015336 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * This file contines two main library entries: * pbs_selectjob() * pbs_selstat() * * * pbs_selectjob() - the SelectJob request * Return a list of job ids that meet certain selection criteria. */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include "dis.h" static int PBSD_select_put A_((int, int, struct attropl *, char *)); static char **PBSD_select_get A_((int)); char ** pbs_selectjob(int c, struct attropl *attrib, char *extend) { if (PBSD_select_put(c, PBS_BATCH_SelectJobs, attrib, extend) == 0) return (PBSD_select_get(c)); else return ((char **)0); } /* * pbs_selstat() - Selectable status * Return status information for jobs that meet certain selection * criteria. This is a short-cut combination of pbs_selecljob() * and repeated pbs_statjob(). */ struct batch_status * pbs_selstat(int c, struct attropl *attrib, char *extend) { if (PBSD_select_put(c, PBS_BATCH_SelStat, attrib, extend) == 0) return (PBSD_status_get(c)); else return ((struct batch_status *)0); } static int PBSD_select_put(int c, int type, struct attropl *attrib, char *extend) { int rc; int sock; sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, type, pbs_current_user)) || (rc = encode_DIS_attropl(sock, attrib)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } /* write data */ if (DIS_tcp_wflush(sock)) { return (pbs_errno = PBSE_PROTOCOL); } return 0; } static char ** PBSD_select_get(int c) { int i; struct batch_reply *reply; int njobs; char *sp; int stringtot; size_t totsize; struct brp_select *sr; char **retval = (char **)NULL; /* read reply from stream */ reply = PBSD_rdrpy(c); if (reply == NULL) { pbs_errno = PBSE_PROTOCOL; } else if (reply->brp_choice != 0 && reply->brp_choice != BATCH_REPLY_CHOICE_Text && reply->brp_choice != BATCH_REPLY_CHOICE_Select) { pbs_errno = PBSE_PROTOCOL; } else if (connection[c].ch_errno == 0) { /* process the reply -- first, build a linked list of the strings we extract from the reply, keeping track of the amount of space used... */ stringtot = 0; njobs = 0; sr = reply->brp_un.brp_select; while (sr != (struct brp_select *)NULL) { stringtot += strlen(sr->brp_jobid) + 1; njobs++; sr = sr->brp_next; } /* ...then copy all the strings into one of "Bob's structures", freeing all strings we just allocated... */ totsize = stringtot + (njobs + 1) * (sizeof(char *)); retval = (char **)malloc(totsize); if (retval == (char **)NULL) { pbs_errno = PBSE_SYSTEM; return (char **)NULL; } sr = reply->brp_un.brp_select; sp = (char *)retval + (njobs + 1) * sizeof(char *); for (i = 0; i < njobs; i++) { retval[i] = sp; strcpy(sp, sr->brp_jobid); sp += strlen(sp) + 1; sr = sr->brp_next; } retval[i] = (char *)NULL; } PBSD_FreeReply(reply); return retval; } torque-2.4.16/src/lib/Libifl/enc_Manage.c0000664000113300011330000001115511306021360014746 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_Manage() - encode a Manager Batch Request * * This request is used for most operations where an object is being * created, deleted, or altered. */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_Manage(int sock, int command, int objtype, char *objname, struct attropl *aoplp) { int rc; if ((rc = diswui(sock, command) != 0) || (rc = diswui(sock, objtype) != 0) || (rc = diswst(sock, objname) != 0)) return rc; return (encode_DIS_attropl(sock, aoplp)); } torque-2.4.16/src/lib/Libifl/pbsD_resc.c0000664000113300011330000002351111306021360014634 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_resc.c */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" /* Variables for this file */ static int nodes_avail = 0; static int nodes_alloc = 0; static int nodes_resrv = 0; static int nodes_down = 0; static char *resc_nodes = "nodes"; /* * tcp_encode_DIS_resc() - encode a resource related request, * Used by pbs_rescquery(), pbs_rescreserve() and pbs_rescfree() * * Data items are: signed int resource handle * unsigned int count of query strings * followed by that number of: * string resource query */ static int encode_DIS_Resc(sock, rlist, ct, rh) int sock; char **rlist; int ct; resource_t rh; { int i; int rc; if ((rc = diswsi(sock, rh)) == 0) /* resource reservation handle */ { /* next send the number of resource strings */ if ((rc = diswui(sock, ct)) == 0) { /* now send each string (if any) */ for (i = 0; i < ct; ++i) { if ((rc = diswst(sock, *(rlist + i))) != 0) break; } } } return rc; } static int PBS_resc(int c, int reqtype, char **rescl, int ct, resource_t rh) { int rc; int sock; sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, reqtype, pbs_current_user)) || (rc = encode_DIS_Resc(sock, rescl, ct, rh)) || (rc = encode_DIS_ReqExtend(sock, (char *)0))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } if (DIS_tcp_wflush(sock)) { return (pbs_errno = PBSE_PROTOCOL); } return (0); } /* * pbs_rescquery() - query the availability of resources */ int pbs_rescquery( int c, char **resclist, /* In - list of queries */ int num_resc, /* In - number in list */ int *available, /* Out - number available per query */ int *allocated, /* Out - number allocated per query */ int *reserved, /* Out - number reserved per query */ int *down) /* Out - number down/off per query */ { int i; struct batch_reply *reply; int rc = 0; if (resclist == NULL) { connection[c].ch_errno = PBSE_RMNOPARAM; pbs_errno = PBSE_RMNOPARAM; return(pbs_errno); } /* send request */ if ((rc = PBS_resc(c, PBS_BATCH_Rescq, resclist, num_resc, (resource_t)0)) != 0) { return(rc); } /* read in reply */ reply = PBSD_rdrpy(c); if (((rc = connection[c].ch_errno) == PBSE_NONE)) { /* copy in available and allocated numbers */ for (i = 0;i < num_resc;++i) { *(available + i) = *(reply->brp_un.brp_rescq.brq_avail + i); *(allocated + i) = *(reply->brp_un.brp_rescq.brq_alloc + i); *(reserved + i) = *(reply->brp_un.brp_rescq.brq_resvd + i); *(down + i) = *(reply->brp_un.brp_rescq.brq_down + i); } } PBSD_FreeReply(reply); return(rc); } /* END pbs_rescquery() */ /* pbs_reserve() - reserve resources */ int pbs_rescreserve( int c, /* connection */ char **rl, /* list of resources */ int num_resc, /* number of items in list */ resource_t *prh /* ptr to resource reservation handle */ ) { int rc; struct batch_reply *reply; if (rl == NULL) { connection[c].ch_errno = PBSE_RMNOPARAM; return (pbs_errno = PBSE_RMNOPARAM); } if (prh == NULL) { connection[c].ch_errno = PBSE_RMBADPARAM; return (pbs_errno = PBSE_RMBADPARAM); } /* send request */ if ((rc = PBS_resc(c, PBS_BATCH_ReserveResc, rl, num_resc, *prh)) != 0) return (rc); /* * now get reply, if reservation successful, the reservation handle, * resource_t, is in the aux field */ reply = PBSD_rdrpy(c); if (((rc = connection[c].ch_errno) == PBSE_NONE) || (rc == PBSE_RMPART)) { *prh = reply->brp_auxcode; } PBSD_FreeReply(reply); return (rc); } /* * pbs_release() - release a resource reservation * * To encode we send same info as for reserve except that the resource * list is empty. */ int pbs_rescrelease(int c, resource_t rh) { struct batch_reply *reply; int rc; if ((rc = PBS_resc(c, PBS_BATCH_ReleaseResc, (char **)0, 0, rh)) != 0) return (rc); /* now get reply */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return (connection[c].ch_errno); } /* * The following routines are provided as a convience in converting * older schedulers which did addreq() of "totpool", "usepool", and * "avail". * * The "update" flag if non-zero, causes a new resource query to be sent * to the server. If zero, the existing numbers are used. */ /* totpool() - return total number of nodes */ int totpool(int con, int update) { if (update) if (pbs_rescquery(con, &resc_nodes, 1, &nodes_avail, &nodes_alloc, &nodes_resrv, &nodes_down) != 0) { return (-1); } return (nodes_avail + nodes_alloc + nodes_resrv + nodes_down); } /* usepool() - return number of nodes in use, includes reserved and down */ int usepool(int con, int update) { if (update) if (pbs_rescquery(con, &resc_nodes, 1, &nodes_avail, &nodes_alloc, &nodes_resrv, &nodes_down) != 0) { return (-1); } return (nodes_alloc + nodes_resrv + nodes_down); } /* * avail - returns answer about available of a specified node set * "yes" if available (job could be run) * "no" if not currently available * "never" if can never be satified * "?" if error in request */ char *avail(int con, char *resc) { int av; int al; int res; int dwn; if (pbs_rescquery(con, &resc, 1, &av, &al, &res, &dwn) != 0) return ("?"); else if (av > 0) return ("yes"); else if (av == 0) return ("no"); else return ("never"); } torque-2.4.16/src/lib/Libifl/PBS_data.c0000664000113300011330000001070311272401246014353 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include "pbs_ifl.h" #include "server_limits.h" #include "libpbs.h" /* * define common data items for libpbs.a */ char pbs_current_user[PBS_MAXUSER]; /* user name for batch request */ struct connect_handle connection[PBS_NET_MAX_CONNECTIONS]; /* array of connection handles */ int pbs_errno = 0; /* pbs error number */ torque-2.4.16/src/lib/Libifl/enc_QueueJob.c0000664000113300011330000001146611306021360015302 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_QueueJob() - encode a Queue Job Batch Request * * This request is used for the first step in submitting a job, sending * the job attributes. * * Data items are: string job id * string destination * list of attribute, see encode_DIS_attropl() */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_QueueJob( int sock, char *jobid, char *destin, struct attropl *aoplp) { int rc; if (jobid == (char *)0) jobid = ""; if (destin == (char *)0) destin = ""; if ((rc = diswst(sock, jobid) != 0) || (rc = diswst(sock, destin) != 0)) { return rc; } return(encode_DIS_attropl(sock, aoplp)); } /* END encode_DIS_QueueJob() */ torque-2.4.16/src/lib/Libifl/enc_ReqExt.c0000664000113300011330000001111411306021360014761 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_ReqExtend() - write an extension to a Batch Request * The extension is in two parts: * unsigned integer - 1 if an extension string follows, 0 if not * character string - if 1 above */ #include /* the master config generated by configure */ #include "dis.h" int encode_DIS_ReqExtend(int sock, char *extend) { int rc; if ((extend == (char *)0) || (*extend == '\0')) { rc = diswui(sock, 0); } else { if ((rc = diswui(sock, 1)) == 0) { rc = diswst(sock, extend); } } return rc; } torque-2.4.16/src/lib/Libifl/dec_MsgJob.c0000664000113300011330000001177111306021360014731 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_MessageJob() - decode a Message Job batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: string job id * unsigned int which file * string the message */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_MessageJob(int sock, struct batch_request *preq) { int rc; preq->rq_ind.rq_message.rq_text = 0; rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_message.rq_jid); if (rc) return rc; preq->rq_ind.rq_message.rq_file = disrui(sock, &rc); if (rc) return rc; preq->rq_ind.rq_message.rq_text = disrst(sock, &rc); return rc; } torque-2.4.16/src/lib/Libifl/README0000664000113300011330000000056611272401246013460 00000000000000 This code is eventually compiled into the libpbs.a library. All actual compilation occurs in ../Libpbs Originally the libpbs.a file would end up in the directory above this, since it archived object files from both the Libdis and Libifl directories. Currently, all objects and compilation occur in Libpbs and the libpbs.a is left there. DIAGTODO: create a pbsD_statdiag.c torque-2.4.16/src/lib/Libifl/pbsD_rerunjo.c0000664000113300011330000001205111306021360015361 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_rerunjob.c This function does the RerunJob request. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_rerunjob(int c, char *jobid, char *extend) { int rc; struct batch_reply *reply; int sock; if ((jobid == (char *)0) || (*jobid == '\0')) return (pbs_errno = PBSE_IVALREQ); sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_Rerun, pbs_current_user)) || (rc = encode_DIS_JobId(sock, jobid)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); return (pbs_errno = PBSE_PROTOCOL); } /* write data */ if (DIS_tcp_wflush(sock)) { return (pbs_errno = PBSE_PROTOCOL); } /* read reply from stream into presentation element */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return connection[c].ch_errno; } torque-2.4.16/src/lib/Libifl/list_link.c0000664000113300011330000002671711272401246014742 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include "portability.h" #include "list_link.h" #include #include /* * list_link.c - general routines for maintenance of a double * linked list. A user defined structure can be managed as * a double linked list if the first element in the user structure * is the "list_link" struct defined in list_link.h and the list * is headed by a "list_link" struct also defined in list_link.h. * * There are the routines provided: * insert_link - inserts a new entry before or after an old * append_link - adds a new entry to the end of the list * delete_link - removes an entry from the list * is_linked - returns 1 if entry is in the list */ /* * insert_link - adds a new entry to a list. * Entry is added either before (position=0) or after (position !=0) * an old entry. */ void insert_link( struct list_link *old, /* ptr to old entry in list */ struct list_link *new, /* ptr to new link entry */ void *pobj, /* ptr to object to link in */ int position) /* 0=before old, else after */ { #ifndef NDEBUG /* first make sure unlinked entries are pointing to themselves */ if ((pobj == (void *)0) || (old == (struct list_link *)0) || (old->ll_prior == (list_link *)0) || (old->ll_next == (list_link *)0) || (new->ll_prior != (list_link *)new) || (new->ll_next != (list_link *)new)) { fprintf(stderr, "Assertion failed, bad pointer in insert_link\n"); if (pobj == NULL) fprintf(stderr, "ERROR: bad pobj pointer in insert_link\n"); if (old->ll_prior == NULL) fprintf(stderr, "ERROR: bad head->ll_prior pointer in insert_link\n"); if (old->ll_next == NULL) fprintf(stderr, "ERROR: bad head->ll_next pointer in insert_link\n"); if (new->ll_prior != (list_link *)new) fprintf(stderr, "ERROR: bad new->ll_prior pointer in insert_link\n"); if (new->ll_next != (list_link *)new) fprintf(stderr, "ERROR: bad new->ll_next pointer in insert_link\n"); fprintf(stderr, "%p %p %p\n", (void *)new->ll_next, (void *)new->ll_prior, (void *)new); abort(); } #endif /* END NDEBUG */ if (position == LINK_INSET_AFTER) { /* insert new after old */ new->ll_prior = old; new->ll_next = old->ll_next; (old->ll_next)->ll_prior = new; old->ll_next = new; } else { /* insert new before old */ new->ll_next = old; new->ll_prior = old->ll_prior; (old->ll_prior)->ll_next = new; old->ll_prior = new; } /* * its big trouble if ll_struct is null, it would make this * entry appear to be the head, so we never let that happen */ if (pobj != NULL) new->ll_struct = pobj; else new->ll_struct = (void *)new; return; } /* * append_link - append a new entry to the end of the list */ void append_link( tlist_head *head, /* ptr to head of list */ list_link *new, /* ptr to new entry */ void *pobj) /* ptr to object to link in */ { #ifndef NDEBUG /* first make sure unlinked entries are pointing to themselves */ if ((pobj == NULL) || (head->ll_prior == NULL) || (head->ll_next == NULL) || (new->ll_prior != (list_link *)new) || (new->ll_next != (list_link *)new)) { if (pobj == NULL) fprintf(stderr, "ERROR: bad pobj pointer in append_link\n"); if (head->ll_prior == NULL) fprintf(stderr, "ERROR: bad head->ll_prior pointer in append_link\n"); if (head->ll_next == NULL) fprintf(stderr, "ERROR: bad head->ll_next pointer in append_link\n"); if (new->ll_prior == NULL) fprintf(stderr, "ERROR: bad new->ll_prior pointer in append_link\n"); if (new->ll_next == NULL) fprintf(stderr, "ERROR: bad new->ll_next pointer in append_link\n"); abort(); } /* END if ((pobj == NULL) || ...) */ #endif /* NDEBUG */ /* * its big trouble if ll_struct is null, it would make this * entry appear to be the head, so we never let that happen */ if (pobj != NULL) { new->ll_struct = pobj; } else { /* WARNING: This mixes list_link pointers and ll_struct pointers, and may break if the list_link we are operating on is not the first embeded list_link in the surrounding structure, e.g. work_task.wt_link_obj */ new->ll_struct = (void *)new; } new->ll_prior = head->ll_prior; new->ll_next = head; head->ll_prior = new; new->ll_prior->ll_next = new; /* now visible to forward iteration */ return; } /* END append_link() */ /* * delete_link - delete an entry from the list * * Checks to be sure links exist before breaking them * Note: the old entry is unchanged other than the list links * are cleared. */ void delete_link( struct list_link *old /* ptr to link to delete */ ) { if ((old->ll_prior != (list_link *)0) && (old->ll_prior != old) && (old->ll_prior->ll_next == old)) (old->ll_prior)->ll_next = old->ll_next; if ((old->ll_next != (list_link *)0) && (old->ll_next != old) && (old->ll_next->ll_prior == old)) (old->ll_next)->ll_prior = old->ll_prior; old->ll_next = old; old->ll_prior = old; } /* * swap_link - swap the positions of members of a list */ void swap_link(list_link *pone, list_link *ptwo) { list_link *p1p; list_link *p2p; if (pone->ll_next == ptwo) { delete_link(pone); insert_link(ptwo, pone, pone->ll_struct, LINK_INSET_AFTER); } else if (ptwo->ll_next == pone) { delete_link(ptwo); insert_link(pone, ptwo, ptwo->ll_struct, LINK_INSET_AFTER); } else { p1p = pone->ll_prior; p2p = ptwo->ll_prior; delete_link(pone); insert_link(p2p, pone, pone->ll_struct, LINK_INSET_AFTER); delete_link(ptwo); insert_link(p1p, ptwo, ptwo->ll_struct, LINK_INSET_AFTER); } } /* * is_linked - determine if entry is in the list * * Returns: 1 if in list * 0 if not in list */ int is_linked(list_link *head, list_link *entry) { list_link *pl; pl = head->ll_next; while (pl != head) { if (pl == entry) return (1); pl = pl->ll_next; } return (0); } /* * The following routines are replaced by in-line code with the * GET_NEXT / GET_PRIOR macroes when NDEBUG is defined, see list_link.h */ #ifndef NDEBUG void *get_next( list_link pl, /* I */ char *file, /* I */ int line) /* I */ { if ((pl.ll_next == NULL) || ((pl.ll_next == &pl) && (pl.ll_struct != NULL))) { fprintf(stderr, "Assertion failed, bad pointer in link: file \"%s\", line %d\n", file, line); abort(); } return(pl.ll_next->ll_struct); } /* END get_next() */ void *get_prior( list_link pl, char *file, int line) { if ((pl.ll_prior == NULL) || ((pl.ll_prior == &pl) && (pl.ll_struct != NULL))) { fprintf(stderr, "Assertion failed, null pointer in link: file \"%s\", line %d\n", file, line); abort(); } return(pl.ll_prior->ll_struct); } /* END get_prior() */ #endif /* !NDEBUG */ /* * list_move - move an entire list from one head to another */ void list_move(tlist_head *from, tlist_head *to) { if (from->ll_next == from) { to->ll_next = to; to->ll_prior = to; } else { to->ll_next = from->ll_next; to->ll_next->ll_prior = to; to->ll_prior = from->ll_prior; to->ll_prior->ll_next = to; CLEAR_HEAD((*from)); } } torque-2.4.16/src/lib/Libifl/dec_svrattrl.c0000664000113300011330000001563611306021360015435 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_svrattrl() - decode into a list of server "svrattrl" structures * * The space for the svrattrl structures is allocated as needed. * * The first item is a unsigned integer, a count of the * number of svrattrl entries in the linked list. This is encoded * even when there are no entries in the list. * * Each individual entry is encoded as: * u int size of the three strings (name, resource, value) * including the terminating nulls * string attribute name * u int 1 or 0 if resource name does or does not follow * string resource name (if one) * string value of attribute/resource * u int "op" of attrlop * * Note, the encoding of a svrattrl is the same as the encoding of * the pbs_ifl.h structures "attrl" and "attropl". Any one of * the three forms can be decoded into any of the three with the * possible loss of the "flags" field (which is the "op" of the attrlop). */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include "list_link.h" #include "attribute.h" #include "dis.h" int decode_DIS_svrattrl(int sock, tlist_head *phead) { unsigned int i; unsigned int hasresc; size_t ls; unsigned int data_len; unsigned int numattr; svrattrl *psvrat = NULL; int rc; size_t tsize; numattr = disrui(sock, &rc); /* number of attributes in set */ if (rc) return rc; for (i = 0; i < numattr; ++i) { data_len = disrui(sock, &rc); /* here it is used */ if (rc) return rc; tsize = sizeof(svrattrl) + data_len; if ((psvrat = (svrattrl *)malloc(tsize)) == 0) return DIS_NOMALLOC; CLEAR_LINK(psvrat->al_link); psvrat->al_atopl.next = 0; psvrat->al_tsize = tsize; psvrat->al_name = (char *)psvrat + sizeof(svrattrl); psvrat->al_resc = 0; psvrat->al_value = 0; psvrat->al_nameln = 0; psvrat->al_rescln = 0; psvrat->al_valln = 0; psvrat->al_flags = 0; if ((rc = disrfcs(sock, &ls, data_len, psvrat->al_name))) break; *(psvrat->al_name + ls++) = '\0'; psvrat->al_nameln = (int)ls; data_len -= ls; hasresc = disrui(sock, &rc); if (rc) break; if (hasresc) { psvrat->al_resc = psvrat->al_name + ls; if ((rc = disrfcs(sock, &ls, data_len, psvrat->al_resc))) break; *(psvrat->al_resc + ls++) = '\0'; psvrat->al_rescln = (int)ls; data_len -= ls; } psvrat->al_value = psvrat->al_name + psvrat->al_nameln + psvrat->al_rescln; if ((rc = disrfcs(sock, &ls, data_len, psvrat->al_value))) break; *(psvrat->al_value + ls++) = '\0'; psvrat->al_valln = (int)ls; psvrat->al_op = (enum batch_op)disrui(sock, &rc); if (rc) break; append_link(phead, &psvrat->al_link, psvrat); } if (rc) { (void)free(psvrat); } return (rc); } torque-2.4.16/src/lib/Libifl/enc_Sig.c0000664000113300011330000001072411306021360014301 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_SignalJob() - encode a Signal Job Batch Request * * Data items are: string job id * string signal */ #include /* the master config generated by configure */ #include "libpbs.h" #include "pbs_error.h" #include "dis.h" int encode_DIS_SignalJob(int sock, char *jobid, char *signal) { int rc; if ((rc = diswst(sock, jobid) != 0) || (rc = diswst(sock, signal) != 0)) return rc; return 0; } torque-2.4.16/src/lib/Libifl/dec_Track.c0000664000113300011330000001207511306021360014612 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_TrackJob() - decode a Track Job batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: string job id * unsigned int hopcount * string location * u char state */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_TrackJob(int sock, struct batch_request *preq) { int rc; rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_track.rq_jid); if (rc) return rc; preq->rq_ind.rq_track.rq_hopcount = disrui(sock, &rc); if (rc) return rc; rc = disrfst(sock, PBS_MAXDEST + 1, preq->rq_ind.rq_track.rq_location); if (rc) return rc; preq->rq_ind.rq_track.rq_state[0] = disruc(sock, &rc); return rc; } torque-2.4.16/src/lib/Libifl/pbs_statfree.c0000664000113300011330000001177211272401246015426 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_statfree.c The function that deallocates a "batch_status" structure */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" void pbs_statfree( struct batch_status *bsp) { struct attrl *atnxt; struct batch_status *bsnxt; while (bsp != NULL) { if (bsp->name != NULL) free(bsp->name); if (bsp->text != NULL) free(bsp->text); while (bsp->attribs != NULL) { if (bsp->attribs->name != NULL) free(bsp->attribs->name); if (bsp->attribs->resource != NULL) free(bsp->attribs->resource); if (bsp->attribs->value != NULL) free(bsp->attribs->value); atnxt = bsp->attribs->next; free(bsp->attribs); bsp->attribs = atnxt; } /* END while (bsp->attribs != NULL) */ bsnxt = bsp->next; free(bsp); bsp = bsnxt; } /* END while (bsp != NULL) */ return; } /* END pbs_statfree() */ torque-2.4.16/src/lib/Libifl/dec_Shut.c0000664000113300011330000001134511306021360014470 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_ShutDown() - decode a Server Shut Down batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: u int manner */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_ShutDown(int sock, struct batch_request *preq) { int rc; preq->rq_ind.rq_shutdown = disrui(sock, &rc); return rc; } torque-2.4.16/src/lib/Libifl/dec_QueueJob.c0000664000113300011330000001167311306021360015270 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_QueueJob() - decode a Queue Job Batch Request * * Data items are: string job id * string destination * list of attributes (attropl) */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_QueueJob( int sock, struct batch_request *preq) { int rc; CLEAR_HEAD(preq->rq_ind.rq_queuejob.rq_attr); rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_queuejob.rq_jid); if (rc != 0) { return(rc); } rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_queuejob.rq_destin); if (rc != 0) { return(rc); } rc = decode_DIS_svrattrl(sock, &preq->rq_ind.rq_queuejob.rq_attr); return(rc); } /* END decode_DIS_QueueJob() */ torque-2.4.16/src/lib/Libifl/pbsD_termin.c0000664000113300011330000001200711306021360015174 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_terminate.c */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_terminate( int c, /* I */ int manner, /* I */ char *extend) /* I */ { struct batch_reply *reply; int rc = 0; int sock; /* send request */ sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_Shutdown, pbs_current_user)) || (rc = encode_DIS_ShutDown(sock, manner)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } /* read in reply */ reply = PBSD_rdrpy(c); rc = connection[c].ch_errno; PBSD_FreeReply(reply); return(rc); } /* END pbs_terminate() */ torque-2.4.16/src/lib/Libifl/enc_JobObit.c0000664000113300011330000001203211306021360015101 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * encode_DIS_JobObit() - encode a Job Obituary Batch Request (Notice) * * This request is used by the server ONLY; its input is a server * batch request structure. * * Data items are: string job id * signed int status * list of svrattrl */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int encode_DIS_JobObit( int sock, /* I */ struct batch_request *preq) /* I */ { int rc; struct svrattrl *psvrl; psvrl = (struct svrattrl *)GET_NEXT(preq->rq_ind.rq_jobobit.rq_attr); if ((rc = diswst(sock, preq->rq_ind.rq_jobobit.rq_jid) != 0) || (rc = diswsi(sock, preq->rq_ind.rq_jobobit.rq_status) != 0) || (rc = encode_DIS_svrattrl(sock, psvrl) != 0)) { /* FAILURE */ return(rc); } return(0); } /* END encode_DIS_JobObit() */ torque-2.4.16/src/lib/Libifl/dec_ReqExt.c0000664000113300011330000001173711306021360014762 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_ReqExtend() - decode a batch_request Extend string * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) and the request body * have already be decoded. * * The next field is an unsigned integer which is 1 if there is an * extension string and zero if not. */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_ReqExtend( int sock, struct batch_request *preq) { int i; int rc; i = disrui(sock, &rc); /* indicates if an extension exists */ if (rc == 0) { if (i != 0) { preq->rq_extend = disrst(sock, &rc); } } return(rc); } torque-2.4.16/src/lib/Libifl/pbs_geterrmg.c0000664000113300011330000001075411272401246015424 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_geterrmsg.c Return the last error message the server returned on this connection. */ #include /* the master config generated by configure */ #include "server_limits.h" #include "libpbs.h" char *pbs_geterrmsg( int connect) /* I - socket descriptor */ { if ((connect < 0) || (connect > PBS_NET_MAX_CONNECTIONS)) { return(NULL); } return(connection[connect].ch_errtxt); } /* END pbs_geterrmsg() */ /* END pbs_geterrmsg() */ torque-2.4.16/src/lib/Libifl/dec_Reg.c0000664000113300011330000001247711306021360014271 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_Register() - decode a Register Dependency Batch Request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: string job owner * string parent job id * string child job id * unsigned int dependency type * unsigned int operation * signed long cost */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_Register(int sock, struct batch_request *preq) { int rc; if ((rc = disrfst(sock, PBS_MAXUSER, preq->rq_ind.rq_register.rq_owner))) return rc; if ((rc = disrfst(sock, PBS_MAXSVRJOBID, preq->rq_ind.rq_register.rq_parent))) return rc; if ((rc = disrfst(sock, PBS_MAXCLTJOBID, preq->rq_ind.rq_register.rq_child))) return rc; preq->rq_ind.rq_register.rq_dependtype = disrui(sock, &rc); if (rc) return rc; preq->rq_ind.rq_register.rq_op = disrui(sock, &rc); if (rc) return rc; preq->rq_ind.rq_register.rq_cost = disrsl(sock, &rc); return rc; } torque-2.4.16/src/lib/Libifl/pbsD_deljob.c0000664000113300011330000001635411272401246015155 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbsD_deljob.c Send the Delete Job request to the server really just an instance of the manager request */ #include /* the master config generated by configure */ #include #include "libpbs.h" /* NOTE: routes over to X on server side qdel pbs_server ---------------------- ------------------------ pbsD_deljob() (lib/Libifl/pbsD_deljob.c) PBSD_manager() (lib/Libifl/PBSD_manager.c) PBSD_mgr_put() (lib/Libifl/PBSD_manage2.c) DIS_tcp_wflush() --> PBSD_rdrpy() pbs_mom -------------------------- main() (resmom/mom_main.c) finish_loop() (resmom/mom_main.c) wait_request() (lib/Libnet/net_server.c) accept_conn() obit_reply() (resmom/catch_child.c) process_request() (server/process_request.c) dispatch_request() (server/process_request.c) req_cpyfile req_deletejob() (resmom/requests.c) mom_deljob() (resmom/catch_child.c) job_purge() (server/job_func.c) reply_ack() wait_request() (net_server.c) process_request() (server/process_request.c) dis_request_read() (server/dis_read.c) decode_DIS_RunJob() (lib/Libifl/dec_RunJob.c) dispatch_request() (server/process_request.c) req_deletejob() (server/req_delete.c) set_task() (server/svr_task.c) dispatch_task() (server/svr_task.c) reply_text() (server/reply_send.c) reply_send() (server/reply_send.c) * PBSD_rdrpy <----- */ /* NOTE: set_task sets WORK_Deferred_Child : request remains until child terminates */ /* NOTE: track pbs_server to pbs_mom interactions */ int pbs_deljob( int c, char *jobid, char *extend) { int rc; struct attropl *aoplp = NULL; if ((extend == NULL) || strncmp(extend,PURGECOMP,strlen(PURGECOMP))) { if ((c < 0) || (jobid == NULL) || (*jobid == '\0')) { pbs_errno = PBSE_IVALREQ; return(pbs_errno); } } rc = PBSD_manager( c, PBS_BATCH_DeleteJob, MGR_CMD_DELETE, MGR_OBJ_JOB, jobid, aoplp, extend); return(rc); } /* END pbs_deljob() */ torque-2.4.16/src/lib/Libifl/pbsD_runjob.c0000664000113300011330000002030511306021360015175 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_runjob.c */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "dis.h" int pbs_runjob( int c, char *jobid, char *location, char *extend) { int rc; struct batch_reply *reply; unsigned int resch = 0; int sock; /* NOTE: routes over to req_runjob() on server side DIS_tcp_wflush -----> wait_request() (net_server.c) process_request() (server/process_request.c) dis_request_read() (server/dis_read.c) decode_DIS_RunJob() (lib/Libifl/dec_RunJob.c) dispatch_request() (server/process_request.c) req_runjob() (server/req_runjob.c) svr_startjob() (server/req_runjob.c) assign_hosts() (server/req_runjob.c) set_nodes() (server/node_manager.c) node_spec() (server/node_manager.c) search() (server/node_manager.c) svr_strtjob2() (server/req_runjob.c) send_job(jobp,hostaddr) (server/svr_movejob.c) fork() PARENT: set_task() (server/svr_task.c) CHILD: svr_connect() PBSD_queuejob() (lib/libifl/PBSD_submit.c) encode_DIS_QueueJob() DIS_tcp_wflush() PBSD_rdrpy(c) (lib/Libifl/PBSD_rdrpy.c) NOTE: sock = connection[c].ch_socket decode_DIS_replyCmd(sock) (Libifl/dec_rpyc.c) NOTE: stream=sock disrul(stream) (Libdis/disrul.c) disrsl_(stream) (Libdis/disrsl_.c) NOTE: fd=stream tcp_getc(fd) (Libifl/tcp_dis.c) tcp_read(fd) (Libifl/tcp_dis.c) select(pbs_tcp_timeout) read() svr_disconnect() exit() dispatch_task() (server/svr_task.c) NOTE: exit code eval post_sendmom() (server/req_runjob.c) XXX reply_text() (server/reply_send.c) reply_send() (server/reply_send.c) * PBSD_rdrpy <----- */ /* NOTE: set_task sets WORK_Deferred_Child : request remains until child terminates */ if ((c < 0) || (jobid == NULL) || (*jobid == '\0')) { pbs_errno = PBSE_IVALREQ; return(pbs_errno); } if (location == NULL) { location = ""; } sock = connection[c].ch_socket; /* setup DIS support routines for following DIS calls */ DIS_tcp_setup(sock); /* send run request */ if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_RunJob, pbs_current_user)) || (rc = encode_DIS_RunJob(sock, jobid, location, resch)) || (rc = encode_DIS_ReqExtend(sock, extend))) { connection[c].ch_errtxt = strdup(dis_emsg[rc]); pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } if (DIS_tcp_wflush(sock)) { pbs_errno = PBSE_PROTOCOL; return(pbs_errno); } /* get reply */ reply = PBSD_rdrpy(c); rc = connection[c].ch_errno; PBSD_FreeReply(reply); return(rc); } /* END pbs_runjob() */ torque-2.4.16/src/lib/Libifl/PBS_attr.c0000664000113300011330000001200211272401246014406 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" int PBS_val_al(struct attrl *alp) { while (alp) { if ((alp->name == 0) || (alp->value == 0)) return -1; alp = alp->next; } return 0; } void PBS_free_al(struct attrl *alp) { struct attrl *talp; while (alp != (struct attrl *)NULL) { free(alp->name); free(alp->resource); free(alp->value); talp = alp; alp = alp->next; free(talp); } } int PBS_val_aopl(struct attropl *aoplp) { while (aoplp != (struct attropl *)NULL) { if ((aoplp->name == 0) || (aoplp == 0)) return -1; aoplp = aoplp->next; } return 0; } void PBS_free_aopl(struct attropl *aoplp) { struct attropl *taoplp; while (aoplp != (struct attropl *)NULL) { free(aoplp->name); free(aoplp->resource); free(aoplp->value); taoplp = aoplp; aoplp = aoplp->next; free(taoplp); } } torque-2.4.16/src/lib/Libifl/get_svrport.c0000664000113300011330000001125211272401246015314 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "portability.h" /* * get_svrport - get the port number for a given service * * Return the port number in an unsigned interger in host byte order. * Assumes the protocol type is tcp. * Returns 0 on an error. */ unsigned int get_svrport( char *service_name, char *ptype, unsigned int pdefault) /* in host byte order */ { struct servent *psvr; psvr = getservbyname(service_name, ptype); if (psvr) { return((unsigned int)ntohs(psvr->s_port)); } return(pdefault); } torque-2.4.16/src/lib/Libifl/PBSD_manager_caps.c0000664000113300011330000001146011272401246016167 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* PBS_manager.c The function that underlies most of the job manipulation routines... */ #include /* the master config generated by configure */ #include #include "libpbs.h" int PBSD_manager( int c, int function, int command, int objtype, char *objname, struct attropl *aoplp, char *extend) { int rc; struct batch_reply *reply; /* send the manage request */ rc = PBSD_mgr_put( c, function, command, objtype, objname, aoplp, extend); if (rc != 0) { return(rc); } /* read reply from stream into presentation element */ reply = PBSD_rdrpy(c); PBSD_FreeReply(reply); return(connection[c].ch_errno); } /* END PBSD_manager() */ /* END PBSD_manager.c */ torque-2.4.16/src/lib/Libifl/dec_rpys.c0000664000113300011330000001753611306021360014552 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_replySvr() - decode a Batch Protocol Reply Structure for Server * * This routine decodes a batch reply into the form used by server. * The only difference between this and the command version is on status * replies. For the server, the attributes are decoded into a list of * server svrattrl structures rather than a commands's attrl. * * batch_reply structure defined in libpbs.h, it must be allocated * by the caller. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "list_link.h" #include "dis.h" #include "batch_request.h" int decode_DIS_replySvr( int sock, /* I */ struct batch_reply *reply) /* I (modified) */ { int ct; int i; struct brp_select *psel; struct brp_select **pselx; struct brp_status *pstsvr; int rc = 0; /* first decode "header" consisting of protocol type and version */ i = disrui(sock, &rc); if (rc != 0) return rc; if (i != PBS_BATCH_PROT_TYPE) return DIS_PROTO; i = disrui(sock, &rc); if (rc != 0) return rc; if (i != PBS_BATCH_PROT_VER) return DIS_PROTO; /* next decode code, auxcode and choice (union type identifier) */ reply->brp_code = disrsi(sock, &rc); if (rc) return rc; reply->brp_auxcode = disrsi(sock, &rc); if (rc) return rc; reply->brp_choice = disrui(sock, &rc); if (rc) return rc; switch (reply->brp_choice) { case BATCH_REPLY_CHOICE_NULL: break; /* no more to do */ case BATCH_REPLY_CHOICE_Queue: case BATCH_REPLY_CHOICE_RdytoCom: case BATCH_REPLY_CHOICE_Commit: if ((rc = disrfst(sock, PBS_MAXSVRJOBID + 1, reply->brp_un.brp_jid))) return (rc); break; case BATCH_REPLY_CHOICE_Select: /* have to get count of number of strings first */ reply->brp_un.brp_select = (struct brp_select *)0; pselx = &reply->brp_un.brp_select; ct = disrui(sock, &rc); if (rc) return rc; while (ct--) { psel = (struct brp_select *)malloc(sizeof(struct brp_select)); if (psel == 0) return DIS_NOMALLOC; psel->brp_next = (struct brp_select *)0; psel->brp_jobid[0] = '\0'; rc = disrfst(sock, PBS_MAXSVRJOBID + 1, psel->brp_jobid); if (rc) { (void)free(psel); return rc; } *pselx = psel; pselx = &psel->brp_next; } break; case BATCH_REPLY_CHOICE_Status: /* have to get count of number of status objects first */ CLEAR_HEAD(reply->brp_un.brp_status); ct = disrui(sock, &rc); if (rc) return rc; while (ct--) { pstsvr = (struct brp_status *)malloc(sizeof(struct brp_status)); if (pstsvr == 0) return DIS_NOMALLOC; CLEAR_LINK(pstsvr->brp_stlink); pstsvr->brp_objname[0] = '\0'; CLEAR_HEAD(pstsvr->brp_attr); pstsvr->brp_objtype = disrui(sock, &rc); if (rc == 0) { rc = disrfst(sock, PBS_MAXSVRJOBID + 1, pstsvr->brp_objname); } if (rc) { (void)free(pstsvr); return rc; } append_link(&reply->brp_un.brp_status, &pstsvr->brp_stlink, pstsvr); rc = decode_DIS_svrattrl(sock, &pstsvr->brp_attr); } break; case BATCH_REPLY_CHOICE_Text: /* text reply */ reply->brp_un.brp_txt.brp_str = disrcs(sock, &reply->brp_un.brp_txt.brp_txtlen, &rc); break; case BATCH_REPLY_CHOICE_Locate: /* Locate Job Reply */ rc = disrfst(sock, PBS_MAXDEST + 1, reply->brp_un.brp_locate); break; default: return -1; } return rc; } torque-2.4.16/src/lib/Libifl/Makefile.am0000664000113300011330000000012411272401246014622 00000000000000include $(top_srcdir)/buildutils/config.mk # all compilation happens in lib/Libpbs torque-2.4.16/src/lib/Libifl/enc_ReturnFile.c0000664000113300011330000000113611306021360015633 00000000000000 #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int encode_DIS_ReturnFiles(int sock, struct batch_request *preq) { int rc; if ((rc = diswst(sock, preq->rq_ind.rq_returnfiles.rq_jobid) != 0) || (rc = diswsi(sock, preq->rq_ind.rq_returnfiles.rq_return_stdout) != 0) || (rc = diswsi(sock, preq->rq_ind.rq_returnfiles.rq_return_stderr) != 0)) return rc; return 0; } torque-2.4.16/src/lib/Libifl/pbsD_alterjo.c0000664000113300011330000001442711446150203015352 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* pbs_alterjob.c Send the Alter Job request to the server -- really an instance of the "manager" request. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" /* returns pbs_errno */ int pbs_alterjob_asyncflag( int c, /* I */ char *jobid, /* I */ struct attrl *attrib, /* I */ char *extend, /* I */ int asyncFlag) /* I */ { struct attropl *ap = (struct attropl *)NULL; struct attropl *ap1 = (struct attropl *)NULL; int i; if ((c < 0) || (jobid == NULL) || (*jobid == '\0')) { pbs_errno = PBSE_IVALREQ; return(pbs_errno); } /* copy the attrl to an attropl */ while (attrib != NULL) { if (ap == NULL) { ap1 = ap = MH(struct attropl); } else { ap->next = MH(struct attropl); ap = ap->next; } if (ap == NULL) { /* FAILURE */ pbs_errno = PBSE_SYSTEM; return(-1); } ap->name = attrib->name; ap->resource = attrib->resource; ap->value = attrib->value; /* attributes now must have an op specified. Inside TORQUE this defaults * to SET, ensuring the same behavior as before */ ap->op = attrib->op; ap->next = (struct attropl *)NULL; attrib = attrib->next; } /* END while (attrib != NULL) */ i = PBSD_manager( c, asyncFlag ? PBS_BATCH_AsyModifyJob : PBS_BATCH_ModifyJob, MGR_CMD_SET, MGR_OBJ_JOB, jobid, ap1, extend); /* free up the attropl we just created */ while (ap1 != NULL) { ap = ap1->next; free(ap1); ap1 = ap; } return(i); } /* END pbs_alterjob_asyncflag() */ int pbs_alterjob_async( int c, /* I */ char *jobid, /* I */ struct attrl *attrib, /* I */ char *extend) /* I */ { return(pbs_alterjob_asyncflag(c, jobid, attrib, extend, TRUE)); } /* END pbs_alterjob_async() */ int pbs_alterjob( int c, /* I */ char *jobid, /* I */ struct attrl *attrib, /* I */ char *extend) /* I */ { return(pbs_alterjob_asyncflag(c, jobid, attrib, extend, FALSE)); } /* END pbs_alterjob() */ /* END pbsD_alterjo.c */ torque-2.4.16/src/lib/Libifl/dec_JobFile.c0000664000113300011330000001263611306021360015063 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_JobFile() - decode a Job Related Job File Move request * * Data items are: u int block sequence number * u int file type (stdout, stderr, ...) * u int size of data in block * string job id * cnt str data */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_JobFile( int sock, struct batch_request *preq) { int rc; size_t amt; preq->rq_ind.rq_jobfile.rq_data = 0; preq->rq_ind.rq_jobfile.rq_sequence = disrui(sock, &rc); if (rc) { return(rc); } preq->rq_ind.rq_jobfile.rq_type = disrui(sock, &rc); if (rc) { return(rc); } preq->rq_ind.rq_jobfile.rq_size = disrui(sock, &rc); if (rc) { return(rc); } if ((rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_jobfile.rq_jobid)) != 0) { return(rc); } preq->rq_ind.rq_jobfile.rq_data = disrcs(sock, &amt, &rc); if (((long)amt != preq->rq_ind.rq_jobfile.rq_size) && (rc == 0)) rc = DIS_EOD; if (rc) { if (preq->rq_ind.rq_jobfile.rq_data) free(preq->rq_ind.rq_jobfile.rq_data); preq->rq_ind.rq_jobfile.rq_data = 0; } return(rc); } /* END dec_JobFile.c */ torque-2.4.16/src/lib/Libifl/dec_CpyFil.c0000664000113300011330000001421611306021360014733 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_CopyFiles() - decode a Copy Files Dependency Batch Request * * This request is used by the server ONLY. * The batch request structure pointed to by preq must already exist. * * Data items are: string job id (may be null) * string job owner (may be null) * string execution user name * string execution group name (may be null) * unsigned int direction * unsigned int count of file pairs in set * set of file pairs: * unsigned int flag * string local path name * string remote path name (may be null) */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_CopyFiles(int sock, struct batch_request *preq) { int pair_ct; struct rq_cpyfile *pcf; struct rqfpair *ppair; int rc; pcf = &preq->rq_ind.rq_cpyfile; CLEAR_HEAD(pcf->rq_pair); if ((rc = disrfst(sock, PBS_MAXSVRJOBID, pcf->rq_jobid)) != 0) return rc; if ((rc = disrfst(sock, PBS_MAXUSER, pcf->rq_owner)) != 0) return rc; if ((rc = disrfst(sock, PBS_MAXUSER, pcf->rq_user)) != 0) return rc; if ((rc = disrfst(sock, PBS_MAXGRPN, pcf->rq_group)) != 0) return rc; pcf->rq_dir = disrui(sock, &rc); if (rc) return rc; pair_ct = disrui(sock, &rc); if (rc) return rc; while (pair_ct--) { ppair = (struct rqfpair *)malloc(sizeof(struct rqfpair)); if (ppair == (struct rqfpair *)0) return DIS_NOMALLOC; CLEAR_LINK(ppair->fp_link); ppair->fp_local = 0; ppair->fp_rmt = 0; ppair->fp_flag = disrui(sock, &rc); if (rc) { (void)free(ppair); return rc; } ppair->fp_local = disrst(sock, &rc); if (rc) { (void)free(ppair); return rc; } ppair->fp_rmt = disrst(sock, &rc); if (rc) { (void)free(ppair->fp_local); (void)free(ppair); return rc; } append_link(&pcf->rq_pair, &ppair->fp_link, ppair); } return 0; } torque-2.4.16/src/lib/Libifl/dec_MoveJob.c0000664000113300011330000001163311306021360015106 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * decode_DIS_MoveJob() - decode a Move Job batch request * also used for an Order Job batch request * * The batch_request structure must already exist (be allocated by the * caller. It is assumed that the header fields (protocol type, * protocol version, request type, and user name) have already be decoded. * * Data items are: string job id * string destination */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include "list_link.h" #include "server_limits.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "dis.h" int decode_DIS_MoveJob(int sock, struct batch_request *preq) { int rc; rc = disrfst(sock, PBS_MAXSVRJOBID + 1, preq->rq_ind.rq_move.rq_jid); if (rc) return rc; rc = disrfst(sock, PBS_MAXDEST + 1, preq->rq_ind.rq_move.rq_destin); return rc; } torque-2.4.16/src/lib/Libdis/0000777000113300011330000000000011614035170012657 500000000000000torque-2.4.16/src/lib/Libdis/diswul.c0000664000113300011330000001327111305006374014255 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int diswul(int stream, unsigned long value) * * Converts into a Data-is-Strings unsigned integer and sends it to * . * * This format for character strings representing unsigned integers can * best be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next character; if it is a plus sign, go to step (4); if it * is a minus sign, post an error. * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * Returns DIS_SUCCESS if everything works well. Returns an error code * otherwise. In case of an error, no characters are sent to . */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" #include "log.h" /* encode unsigned long for transmission along stream */ int diswul( int stream, /* I */ unsigned long value) /* I */ { int retval; unsigned ndigs; char *cp; int rc; char scratch[DIS_BUFSIZ+1]; assert(stream >= 0); assert(dis_puts != NULL); assert(disw_commit != NULL); memset(scratch, 0, DIS_BUFSIZ+1); cp = discul_(&scratch[DIS_BUFSIZ], value, &ndigs); *--cp = '+'; while (ndigs > 1) cp = discui_(cp, ndigs, &ndigs); retval = (*dis_puts)(stream, cp, strlen(cp)) < 0 ? DIS_PROTO : DIS_SUCCESS; rc = (*disw_commit)(stream, retval == DIS_SUCCESS); if (rc < 0) { return(DIS_NOCOMMIT); } return(retval); } /* END diswul() */ torque-2.4.16/src/lib/Libdis/disrl_.c0000664000113300011330000001723311305006374014224 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" int disrl_( int stream, dis_long_double_t *ldval, unsigned *ndigs, unsigned *nskips, unsigned sigd, unsigned count) { int c; int negate; unsigned unum; char *cp; dis_long_double_t fpnum; char scratch[DIS_BUFSIZ+1]; assert(stream >= 0); assert(dis_getc != NULL); assert(disr_skip != NULL); memset(scratch, 0, DIS_BUFSIZ+1); if (dis_umaxd == 0) disiui_(); switch (c = (*dis_getc)(stream)) { case '-': case '+': negate = c == '-'; *nskips = count > sigd ? count - sigd : 0; count -= *nskips; *ndigs = count; fpnum = 0.0L; do { if (((c = (*dis_getc)(stream)) < '0') || (c > '9')) { if (c < 0) { /* end of data marker located */ return(DIS_EOD); } return(DIS_NONDIGIT); } fpnum = fpnum * 10.0L + (dis_long_double_t)(c - '0'); } while (--count); count = *nskips; if (count > 0) { count--; switch ((*dis_getc)(stream)) { case '5': if (count == 0) break; /* fall through */ case '6': case '7': case '8': case '9': fpnum += 1.0L; /* fall through */ case '0': case '1': case '2': case '3': case '4': if ((count > 0) && ((*disr_skip)(stream, (size_t)count) == (int)count)) { /* all characters successfully read in */ return(DIS_EOD); } break; default: return(DIS_NONDIGIT); /*NOTREACHED*/ break; } /* END switch ((*dis_getc)(stream)) */ } /* END if (count > 0) */ *ldval = negate ? -fpnum : fpnum; return(DIS_SUCCESS); break; case '0': return(DIS_LEADZRO); /*NOTREACHED*/ break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': unum = c - '0'; if (count > 1) { if ((*dis_gets)(stream, scratch + 1, count - 1) != (int)count - 1) { /* cannot read all requested characters from stream */ /* FAILURE */ return(DIS_EOD); } cp = scratch; if (count >= dis_umaxd) { if (count > dis_umaxd) break; *cp = c; if (memcmp(scratch, dis_umax, dis_umaxd) > 0) break; } while (--count) { if (((c = *++cp) < '0') || (c > '9')) { return(DIS_NONDIGIT); } unum = unum * 10 + (unsigned)(c - '0'); } } /* END if (count > 1) */ return(disrl_(stream, ldval, ndigs, nskips, sigd, unum)); /*NOTREACHED*/ break; case - 1: /* -1 indicates tcp_gets() failed with ??? */ return(DIS_EOD); /*NOTREACHED*/ break; case -2: /* -2 indicates tcp_gets() failed with ??? */ return(DIS_EOF); /*NOTREACHED*/ break; default: return(DIS_NONDIGIT); /*NOTREACHED*/ break; } /* END switch (c = (*dis_getc)(stream)) */ *ldval = HUGE_VAL; return(DIS_OVERFLOW); } /* END disrl_() */ /* END disrl_.c */ torque-2.4.16/src/lib/Libdis/disrd.c0000664000113300011330000001447211272401246014057 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * double disrd(int stream, int *retval) * * Gets a Data-is-Strings floating point number from and converts * it into a double which it returns. The number from consists of * two consecutive signed integers. The first is the coefficient, with its * implied decimal point at the low-order end. The second is the exponent * as a power of 10. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. * * By fiat of the author, neither loss of significance nor underflow are * errors. */ #include /* the master config generated by configure */ #include #include #include #include #include "dis.h" #include "dis_.h" #undef disrd double disrd(stream, retval) int stream; int *retval; { int expon; unsigned uexpon; int locret; int negate; unsigned ndigs; unsigned nskips; dis_long_double_t ldval; assert(retval != NULL); assert(disr_commit != NULL); ldval = 0.0L; locret = disrl_(stream, &ldval, &ndigs, &nskips, DBL_DIG, 1); if (locret == DIS_SUCCESS) { locret = disrsi_(stream, &negate, &uexpon, 1); if (locret == DIS_SUCCESS) { expon = negate ? nskips - uexpon : nskips + uexpon; if (expon + (int)ndigs > DBL_MAX_10_EXP) { if (expon + (int)ndigs > DBL_MAX_10_EXP + 1) { ldval = ldval < 0.0L ? -HUGE_VAL : HUGE_VAL; locret = DIS_OVERFLOW; } else { ldval *= disp10l_(expon - 1); if (ldval > DBL_MAX / 10.0L) { ldval = ldval < 0.0L ? -HUGE_VAL : HUGE_VAL; locret = DIS_OVERFLOW; } else ldval *= 10.0L; } } else { if (expon < LDBL_MIN_10_EXP) { ldval *= disp10l_(expon + (int)ndigs); ldval /= disp10l_((int)ndigs); } else ldval *= disp10l_(expon); } } } if ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) locret = DIS_NOCOMMIT; *retval = locret; return((double)ldval); } torque-2.4.16/src/lib/Libdis/disrsc.c0000664000113300011330000001362411272401246014237 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * signed char disrsc(int stream, int *retval) * * Gets a Data-is-Strings signed integer from , converts it into a * signed char, and returns it. The signed integer in consists * of a counted string of digits, starting with a zero or a minus sign, * which represents the number. If the number doesn't lie between -9 and * 9, inclusive, it is preceeded by at least one count. * * This format for character strings representing signed integers can best * be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next digit; if it is a sign, go to step (4). * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the magnitude of the signed integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef disrsc signed char disrsc(stream, retval) int stream; int *retval; { int locret; int negate; signed char value; unsigned uvalue; assert(retval != NULL); assert(disr_commit != NULL); value = 0; switch (locret = disrsi_(stream, &negate, &uvalue, 1)) { case DIS_SUCCESS: if (negate ? (int) - uvalue >= SCHAR_MIN : uvalue <= SCHAR_MAX) { value = negate ? -uvalue : uvalue; break; } else locret = DIS_OVERFLOW; case DIS_OVERFLOW: value = negate ? SCHAR_MIN : SCHAR_MAX; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return (value); } torque-2.4.16/src/lib/Libdis/disiui_.c0000664000113300011330000001150711305006374014373 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" char *dis_umax = NULL; unsigned dis_umaxd = 0; /* * Allocate and fill a counted string containing the constant, UINT_MAX, * expressed as character codes of decimal digits. * * dis_umaxd = number of digits in UINT_MAX * * dis_umax[0] through dis_umax[dis_umaxd - 1] = the digits, in order. */ void disiui_(void) { char *cp; char scratch[DIS_BUFSIZ+1]; assert(dis_umax == NULL); assert(dis_umaxd == 0); memset(scratch, 0, DIS_BUFSIZ+1); cp = discui_(&scratch[DIS_BUFSIZ], UINT_MAX, &dis_umaxd); assert(dis_umaxd > 0); dis_umax = (char *)malloc(dis_umaxd); assert(dis_umax != NULL); memcpy(dis_umax, cp, dis_umaxd); } torque-2.4.16/src/lib/Libdis/disrcs.c0000664000113300011330000001415611272401246014240 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * char *disrcs(int stream, size_t *nchars, int *retval) * * Gets a Data-is-Strings character string from and converts it * into a counted string, returns a pointer to it, and puts the character * count into *. The character string in consists of an * unsigned integer, followed by a number of characters determined by the * unsigned integer. * * The data returned has an NULL byte appended to the end in case the * calling program wishes to treat it as a NULL terminated string. * This means the space allocated for the data is one byte larger than * indicated by the count. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. * In case of an error, disrcs returns NULL and is set to 0. */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" char *disrcs(stream, nchars, retval) int stream; size_t *nchars; int *retval; { int locret; int negate; unsigned count = 0; char *value = NULL; assert(nchars != NULL); assert(retval != NULL); assert(dis_gets != NULL); assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &count, 1); locret = negate ? DIS_BADSIGN : locret; if (locret == DIS_SUCCESS) { if (negate) locret = DIS_BADSIGN; else { value = (char *)malloc((size_t)count + 1); if (value == NULL) locret = DIS_NOMALLOC; else { if ((*dis_gets)(stream, value, (size_t)count) != (int)count) locret = DIS_PROTO; else value[count] = '\0'; } } } locret = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; if ((*retval = locret) != DIS_SUCCESS && value != NULL) { count = 0; free(value); value = NULL; } *nchars = count; return (value); } torque-2.4.16/src/lib/Libdis/dis_.h0000664000113300011330000001201711305006374013666 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include #include #include "dis.h" #include "dis_init.h" #define DIS_BUFSIZ (CHAR_BIT * sizeof(ULONG_MAX)) char *discui_ A_((char *cp, unsigned value, unsigned *ndigs)); char *discul_ A_((char *cp, unsigned long value, unsigned *ndigs)); void disi10d_(); void disi10l_(); void disiui_ A_((void)); double disp10d_ A_((int expon)); dis_long_double_t disp10l_ A_((int expon)); int disrl_ A_((int stream, dis_long_double_t *ldval, unsigned *ndigs, unsigned *nskips, unsigned sigd, unsigned count)); int disrsi_ A_((int stream, int *negate, unsigned *value, unsigned count)); int disrsl_ A_((int stream, int *negate, unsigned long *value, unsigned long count)); int diswui_ A_((int stream, unsigned value)); extern unsigned dis_dmx10; extern double *dis_dp10; extern double *dis_dn10; extern unsigned dis_lmx10; extern dis_long_double_t *dis_lp10; extern dis_long_double_t *dis_ln10; /*extern char dis_buffer[DIS_BUFSIZ];*/ extern char *dis_umax; extern unsigned dis_umaxd; torque-2.4.16/src/lib/Libdis/disp10d_.c0000664000113300011330000001144011272401246014345 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include "dis_.h" /* expon * Returns 10 as a double precision value. */ double disp10d_(int expon) { int negate; unsigned pow2; double accum; if (expon == 0) return (1.0); if (dis_dmx10 == 0) disi10d_(); if ((negate = expon < 0)) expon = -expon; pow2 = 0; do { if (expon & 1) { accum = dis_dp10[pow2]; while (expon >>= 1) { if (++pow2 > dis_dmx10) return (negate ? 0.0 : HUGE_VAL); if (expon & 1) accum *= dis_dp10[pow2]; } return (negate ? 1.0 / accum : accum); } expon >>= 1; } while (pow2++ < dis_dmx10); return (negate ? 0.0 : HUGE_VAL); } torque-2.4.16/src/lib/Libdis/disp10l_.c0000664000113300011330000001220111272401246014351 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include "dis.h" #include "dis_.h" void disi10l_(); /* expon * Returns 10 as a dis_long_double_t value. */ dis_long_double_t disp10l_( int expon) { int negate; unsigned pow2; dis_long_double_t accum; if (expon == 0) { return(1.0L); } if (dis_lmx10 == 0) disi10l_(); if (expon < 0) { negate = TRUE; expon = -expon; } else { negate = FALSE; } pow2 = 0; do { if (expon & 1) { accum = dis_lp10[pow2]; while (expon >>= 1) { if (++pow2 > dis_lmx10) { if (negate == TRUE) return(0.0L); else return(HUGE_VAL); } if (expon & 1) accum *= dis_lp10[pow2]; } if (negate == TRUE) { return(1.0L / accum); } return(accum); } expon >>= 1; } while (pow2++ < dis_lmx10); if (negate == TRUE) { return(0.0L); } return(HUGE_VAL); } /* END disp10l_ */ torque-2.4.16/src/lib/Libdis/disrsi.c0000664000113300011330000001323711272401246014245 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int disrsi(int stream, int *retval) * * Gets a Data-is-Strings signed integer from , converts it into * an int and returns it. * * This format for character strings representing signed integers can best * be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next digit; if it is a sign, go to step (4). * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the magnitude of the signed integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef disrsi int disrsi( int stream, int *retval) { int locret; int negate; int value; unsigned uvalue; assert(retval != NULL); assert(disr_commit != NULL); value = 0; switch (locret = disrsi_(stream, &negate, &uvalue, 1)) { case DIS_SUCCESS: if (negate ? uvalue <= (unsigned) - (INT_MIN + 1) + 1 : uvalue <= (unsigned)INT_MAX) { value = negate ? -uvalue : uvalue; break; } else { locret = DIS_OVERFLOW; } case DIS_OVERFLOW: value = negate ? INT_MIN : INT_MAX; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return(value); } torque-2.4.16/src/lib/Libdis/diswsl.c0000664000113300011330000001316011305006374014250 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int diswsl(int stream, long value) * * Converts into a Data-is-Strings signed integer and sends it to * . * * This format for character strings representing integers can best be * understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next character; if it is a sign, go to step (4). * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * Returns DIS_SUCCESS if everything works well. Returns an error code * otherwise. In case of an error, no characters are sent to . */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" int diswsl( int stream, long value) { int retval; unsigned ndigs; unsigned long ulval; char c; char *cp; char scratch[DIS_BUFSIZ+1]; assert(stream >= 0); assert(dis_puts != NULL); assert(disw_commit != NULL); memset(scratch, 0, DIS_BUFSIZ+1); if (value < 0) { ulval = (unsigned long) - (value + 1) + 1; c = '-'; } else { ulval = value; c = '+'; } cp = discul_(&scratch[DIS_BUFSIZ], ulval, &ndigs); *--cp = c; while (ndigs > 1) cp = discui_(cp, ndigs, &ndigs); retval = (*dis_puts)(stream, cp, strlen(cp)) < 0 ? DIS_PROTO : DIS_SUCCESS; return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : retval); } torque-2.4.16/src/lib/Libdis/disrl.c0000664000113300011330000001533211272401246014063 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * long double disrl(int stream, int *retval) * * Gets a Data-is-Strings floating point number from and converts * it into a long double and returns it. The number from consists * of two consecutive signed integers. The first is the coefficient, with * its implied decimal point at the low-order end. The second is the * exponent as a power of 10. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. * * By fiat of the author, neither loss of significance nor underflow are * errors. */ #include /* the master config generated by configure */ #include #include #include #include #include "dis.h" #include "dis_.h" /* to work around a problem in a compiler */ #if SIZEOF_LONG_DOUBLE == SIZEOF_DOUBLE #ifdef LDBL_MAX #undef LDBL_MAX #endif /* LDBL_MAX */ #define LDBL_MAX DBL_MAX #endif /* SIZEOF_LONG_DOUBLE == SIZEOF_DOUBLE */ #if defined(__GNUC__) && defined(__DBL_MAX__) #ifdef LDBL_MAX #undef LDBL_MAX #endif /* LDBL_MAX */ #define LDBL_MAX __DBL_MAX__ #ifdef HUGE_VAL #undef HUGE_VAL #endif #define HUGE_VAL LDBL_MAX #endif dis_long_double_t disrl( int stream, int *retval) { int expon; unsigned uexpon; int locret; int negate; unsigned ndigs; unsigned nskips; dis_long_double_t ldval; assert(retval != NULL); assert(disr_commit != NULL); ldval = 0.0L; locret = disrl_(stream, &ldval, &ndigs, &nskips, LDBL_DIG, 1); if (locret == DIS_SUCCESS) { locret = disrsi_(stream, &negate, &uexpon, 1); if (locret == DIS_SUCCESS) { expon = negate ? nskips - uexpon : nskips + uexpon; if (expon + (int)ndigs > LDBL_MAX_10_EXP) { if (expon + (int)ndigs > LDBL_MAX_10_EXP + 1) { ldval = ldval < 0.0L ? -HUGE_VAL : HUGE_VAL; locret = DIS_OVERFLOW; } else { ldval *= disp10l_(expon - 1); if (ldval > LDBL_MAX / 10.0L) { ldval = ldval < 0.0L ? -HUGE_VAL : HUGE_VAL; locret = DIS_OVERFLOW; } else ldval *= 10.0L; } } else { if (expon < LDBL_MIN_10_EXP) { ldval *= disp10l_(expon + (int)ndigs); ldval /= disp10l_((int)ndigs); } else ldval *= disp10l_(expon); } } } if ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) locret = DIS_NOCOMMIT; *retval = locret; return(ldval); } torque-2.4.16/src/lib/Libdis/Makefile.in0000664000113300011330000003272511605403731014655 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/lib/Libdis ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Libdis/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lib/Libdis/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # all compilation happens in lib/Libpbs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/lib/Libdis/disrss.c0000664000113300011330000001360611272401246014257 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * short disrss(int stream, int *retval) * * Gets a Data-is-Strings signed integer from , converts it * into a short, and returns it. The signed integer in consists * of a counted string of digits, starting with a zero or a minus sign, * which represents the number. If the number doesn't lie between -9 and * 9, inclusive, it is preceeded by at least one count. * * This format for character strings representing signed integers can best * be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next digit; if it is zero or a minus sign, go to step (4). * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the magnitude of the signed integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef disrss short disrss(stream, retval) int stream; int *retval; { int locret; int negate; short value; unsigned uvalue; assert(retval != NULL); assert(disr_commit != NULL); value = 0; switch (locret = disrsi_(stream, &negate, &uvalue, 1)) { case DIS_SUCCESS: if (negate ? (int) - uvalue >= SHRT_MIN : uvalue <= SHRT_MAX) { value = negate ? -uvalue : uvalue; break; } else locret = DIS_OVERFLOW; case DIS_OVERFLOW: value = negate ? SHRT_MIN : SHRT_MAX; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return (value); } torque-2.4.16/src/lib/Libdis/discul_.c0000664000113300011330000001050411272401246014364 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ char * discul_(char *cp, unsigned long value, unsigned *ndigs) { char *ocp; ocp = cp; while (value > 9) { *--cp = value % 10 + '0'; value /= 10; } *--cp = value + '0'; *ndigs = ocp - cp; return (cp); } torque-2.4.16/src/lib/Libdis/diswcs.c0000664000113300011330000001213511272401246014240 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int diswcs(int stream, char *value, size_t nchars) * * Converts a counted string in * into a Data-is-Strings character * string and sends it to . The character string in * consists of the unsigned integer representation of , followed by * characters from *. * * Returns DIS_SUCCESS if everything works well. Returns an error code * otherwise. In case of an error, no characters are sent to . */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" int diswcs( int stream, const char *value, size_t nchars) { int retval; assert(disw_commit != NULL); assert(dis_puts != NULL); retval = diswui_(stream, (unsigned)nchars); if ((retval == DIS_SUCCESS) && (nchars > 0) && ((*dis_puts)(stream, value, nchars) != (int)nchars)) { retval = DIS_PROTO; } return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : retval); } torque-2.4.16/src/lib/Libdis/disi10d_.c0000664000113300011330000001242311272401246014340 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "dis.h" unsigned dis_dmx10 = 0; double *dis_dp10 = NULL; double *dis_dn10 = NULL; /* * Allocate and fill tables with all powers of 10 that fit the forms: * * n * 2 * *dis_dp10[n] = 10 * * ( n) * -(2 ) * *dis_dn10[n] = 10 * * For all values of n supported by the floating point format. Set * dis_dmx10 equal to the largest value of n that fits the format. */ void disi10d_(void) { unsigned i; unsigned long ul; dis_long_double_t accum; size_t tabsize; assert(dis_dp10 == NULL); assert(dis_dn10 == NULL); assert(dis_dmx10 == 0); #if DBL_MAX_10_EXP + DBL_MIN_10_EXP > 0 ul = DBL_MAX_10_EXP; #else ul = -DBL_MIN_10_EXP; #endif while (ul >>= 1) dis_dmx10++; tabsize = (dis_dmx10 + 1) * sizeof(double); dis_dp10 = (double *)malloc(tabsize); assert(dis_dp10 != NULL); dis_dn10 = (double *)malloc(tabsize); assert(dis_dn10 != NULL); assert(dis_dmx10 > 0); dis_dp10[0] = accum = 10.0L; dis_dn10[0] = 1.0L / accum; for (i = 1; i <= dis_dmx10; i++) { accum *= accum; dis_dp10[i] = accum; dis_dn10[i] = 1.0L / accum; } } torque-2.4.16/src/lib/Libdis/disrst.c0000664000113300011330000001363011272401246014255 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * char *disrst(int stream, int *retval) * * Gets a Data-is-Strings character string from and converts it * into a null-terminated string, and returns a pointer to the result. The * character string in consists of an unsigned integer, followed * by a number of characters determined by the unsigned integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. * In case of an error, the return value is NULL. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include "dis.h" #include "dis_.h" char *disrst( int stream, int *retval) { int locret; int negate; unsigned int count; char *value = NULL; assert(retval != NULL); assert(dis_gets != NULL); assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &count, 1); if (locret == DIS_SUCCESS) { if (negate) { locret = DIS_BADSIGN; } else { value = (char *)malloc((size_t)count + 1); if (value == NULL) { locret = DIS_NOMALLOC; } else { if ((*dis_gets)(stream, value, (size_t)count) != (int)count) locret = DIS_PROTO; #ifndef NDEBUG else if (memchr(value, 0, (size_t)count)) locret = DIS_NULLSTR; #endif else value[count] = '\0'; } } } locret = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; *retval = locret; if ((locret != DIS_SUCCESS) && (value != NULL)) { free(value); value = NULL; } return(value); } /* END disrst() */ /* END disrst.c */ torque-2.4.16/src/lib/Libdis/disrsl.c0000664000113300011330000001323211272401246014243 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * long disrsl(int stream, int *retval) * * Gets a Data-is-Strings signed integer from , converts it into a * long, and returns it. * * This format for character strings representing signed integers can best * be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next digit; if it is a sign, go to step (4). * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the magnitude of the signed integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef disrsl long disrsl( int stream, int *retval) { int locret; int negate; long value; unsigned long uvalue; assert(retval != NULL); assert(disr_commit != NULL); value = 0; switch (locret = disrsl_(stream, &negate, &uvalue, 1)) { case DIS_SUCCESS: if (negate ? uvalue <= (unsigned long) - (LONG_MIN + 1) + 1 : uvalue <= LONG_MAX) { value = negate ? -uvalue : uvalue; break; } else locret = DIS_OVERFLOW; case DIS_OVERFLOW: value = negate ? LONG_MIN : LONG_MAX; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return (value); } torque-2.4.16/src/lib/Libdis/disrus.c0000664000113300011330000001351511272401246014260 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * unsigned short disrus(int stream, int *retval) * * Gets a Data-is-Strings unsigned integer from , converts it into * an unsigned short, and returns it. The unsigned integer in * consists of a counted string of digits, starting with a zero, which * represents the number. If the number doesn't lie between 0 and 9, * inclusive, it is preceeded by at least one count. * * This format for character strings representing unsigned integers can * best be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next digit; if it is a plus sign, go to step (4); if it * is a minus sign, post an error. * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef disrus unsigned short disrus(stream, retval) int stream; int *retval; { int locret; int negate; unsigned value; assert(retval != NULL); assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &value, 1); if (locret != DIS_SUCCESS) { value = 0; } else if (negate) { value = 0; locret = DIS_BADSIGN; } else if (value > USHRT_MAX) { value = USHRT_MAX; locret = DIS_OVERFLOW; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return ((unsigned short)value); } torque-2.4.16/src/lib/Libdis/disrsi_.c0000664000113300011330000001475711305006374014414 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" int disrsi_( int stream, int *negate, unsigned *value, unsigned count) { int c; unsigned locval; unsigned ndigs; char *cp; char scratch[DIS_BUFSIZ+1]; assert(negate != NULL); assert(value != NULL); assert(count); assert(stream >= 0); assert(dis_getc != NULL); assert(dis_gets != NULL); memset(scratch, 0, DIS_BUFSIZ+1); if (dis_umaxd == 0) disiui_(); switch (c = (*dis_getc)(stream)) { case '-': case '+': *negate = c == '-'; if ((*dis_gets)(stream, scratch, count) != (int)count) { return(DIS_EOD); } if (count >= dis_umaxd) { if (count > dis_umaxd) goto overflow; if (memcmp(scratch, dis_umax, dis_umaxd) > 0) goto overflow; } cp = scratch; locval = 0; do { if (((c = *cp++) < '0') || (c > '9')) { return(DIS_NONDIGIT); } locval = 10 * locval + c - '0'; } while (--count); *value = locval; return (DIS_SUCCESS); break; case '0': return (DIS_LEADZRO); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': ndigs = c - '0'; if (count > 1) { if ((*dis_gets)(stream, scratch + 1, count - 1) != (int)count - 1) { return(DIS_EOD); } cp = scratch; if (count >= dis_umaxd) { if (count > dis_umaxd) break; *cp = c; if (memcmp(scratch, dis_umax, dis_umaxd) > 0) break; } while (--count) { if (((c = *++cp) < '0') || (c > '9')) { return(DIS_NONDIGIT); } ndigs = 10 * ndigs + c - '0'; } } /* END if (count > 1) */ return(disrsi_(stream, negate, value, ndigs)); /*NOTREACHED*/ break; case - 1: return(DIS_EOD); /*NOTREACHED*/ break; case -2: return(DIS_EOF); /*NOTREACHED*/ break; default: return(DIS_NONDIGIT); /*NOTREACHED*/ break; } *negate = FALSE; overflow: *value = UINT_MAX; return(DIS_OVERFLOW); } /* END disrsi_() */ torque-2.4.16/src/lib/Libdis/disrsl_.c0000664000113300011330000001614011305006374014403 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "dis.h" #include "dis_.h" static char *ulmax; static unsigned ulmaxdigs = 0; int disrsl_( int stream, int *negate, unsigned long *value, unsigned long count) { int c; unsigned long locval; unsigned long ndigs; char *cp; char scratch[DIS_BUFSIZ+1]; assert(negate != NULL); assert(value != NULL); assert(count); assert(stream >= 0); assert(dis_getc != NULL); assert(dis_gets != NULL); memset(scratch, 0, DIS_BUFSIZ+1); if (ulmaxdigs == 0) { cp = discul_(scratch + DIS_BUFSIZ, ULONG_MAX, &ulmaxdigs); ulmax = (char *)malloc(ulmaxdigs); if (ulmax == NULL) { return(DIS_NOMALLOC); } memcpy(ulmax, cp, ulmaxdigs); if (dis_umaxd == 0) disiui_(); } c = (*dis_getc)(stream); /* FORMAT: +2+1+0+0+64+2079+22+251175826.teva.westgrid.ubc2+362+21+8Job_Name+02+11run32_.2557+02+ ... */ switch (c) { case '-': case '+': *negate = (c == '-'); if ((*dis_gets)(stream, scratch, count) != (int)count) { return(DIS_EOD); } if (count >= ulmaxdigs) { if (count > ulmaxdigs) goto overflow; if (memcmp(scratch, ulmax, ulmaxdigs) > 0) goto overflow; } cp = scratch; locval = 0; do { if ((c = *cp++) < '0' || c > '9') { return(DIS_NONDIGIT); } locval = 10 * locval + c - '0'; } while (--count); *value = locval; return(DIS_SUCCESS); /*NOTREACHED*/ break; case '0': return(DIS_LEADZRO); /*NOTREACHED*/ break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': ndigs = c - '0'; if (count > 1) { if ((*dis_gets)(stream, scratch + 1, count - 1) != (int)count - 1) { /* FAILURE */ return(DIS_EOD); } cp = scratch; if (count >= ulmaxdigs) { if (count > ulmaxdigs) break; *cp = c; if (memcmp(scratch, ulmax, ulmaxdigs) > 0) break; } while (--count) { if (((c = *++cp) < '0') || (c > '9')) { /* FAILURE */ return(DIS_NONDIGIT); } ndigs = 10 * ndigs + c - '0'; } } return(disrsl_(stream, negate, value, ndigs)); /*NOTREACHED*/ break; case - 1: /* FAILURE */ return(DIS_EOD); /*NOTREACHED*/ break; case -2: /* FAILURE */ return(DIS_EOF); /*NOTREACHED*/ break; default: /* FAILURE */ return(DIS_NONDIGIT); /*NOTREACHED*/ break; } /* END switch (c) */ *negate = FALSE; overflow: *value = ULONG_MAX; return(DIS_OVERFLOW); } /* END disrsl_() */ /* END disrsl_.c */ torque-2.4.16/src/lib/Libdis/diswf.c0000664000113300011330000001706511305006374014067 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int diswf(int stream, float value) * * Converts into a Data-is-Strings floating point number and sends * it to . The converted number consists of two consecutive signed * integers. The first is the coefficient, at most long, with its * implied decimal point at the low-order end. The second is the exponent * as a power of 10. * * Returns DIS_SUCCESS if everything works well. Returns an error code * otherwise. In case of an error, no characters are sent to . */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" #undef diswf int diswf(stream, value) int stream; double value; { int c; int expon; unsigned ndigs; int negate; int retval; unsigned pow2; char *cp; char *ocp; double dval; char scratch[DIS_BUFSIZ+1]; assert(stream >= 0); assert(dis_puts != NULL); assert(disw_commit != NULL); memset(scratch, 0, DIS_BUFSIZ+1); /* Make zero a special case. If we don't it will blow exponent */ /* calculation. */ if (value == 0.0) { retval = (*dis_puts)(stream, "+0+0", 4) != 4 ? DIS_PROTO : DIS_SUCCESS; return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : retval); } /* Extract the sign from the coefficient. */ dval = (negate = value < 0.0) ? -value : value; /* Detect and complain about the infinite form. */ if (dval > FLT_MAX) return (DIS_HUGEVAL); /* Compute the integer part of the log to the base 10 of dval. As a */ /* byproduct, reduce the range of dval to the half-open interval, */ /* [1, 10). */ if (dis_dmx10 == 0) disi10d_(); expon = 0; pow2 = dis_dmx10 + 1; if (dval < 1.0) { do { if (dval < dis_dn10[--pow2]) { dval *= dis_dp10[pow2]; expon += 1 << pow2; } } while (pow2); dval *= 10.0; expon = -expon - 1; } else { do { if (dval >= dis_dp10[--pow2]) { dval *= dis_dn10[pow2]; expon += 1 << pow2; } } while (pow2); } /* Round the value to the last digit */ dval += 5.0 * disp10d_(-FLT_DIG); if (dval >= 10.0) { expon++; dval *= 0.1; } /* Starting in the middle of the buffer, convert coefficient digits, */ /* most significant first. */ ocp = cp = &scratch[DIS_BUFSIZ - FLT_DIG]; ndigs = FLT_DIG; do { c = dval; dval = (dval - c) * 10.0; *ocp++ = c + '0'; } while (--ndigs); /* Eliminate trailing zeros. */ while (*--ocp == '0'); /* The decimal point is at the low order end of the coefficient */ /* integer, so adjust the exponent for the number of digits in the */ /* coefficient. */ ndigs = ++ocp - cp; expon -= ndigs - 1; /* Put the coefficient sign into the buffer, left of the coefficient. */ *--cp = negate ? '-' : '+'; /* Insert the necessary number of counts on the left. */ while (ndigs > 1) cp = discui_(cp, ndigs, &ndigs); /* The complete coefficient integer is done. Put it out. */ retval = (*dis_puts)(stream, cp, (size_t)(ocp - cp)) < 0 ? DIS_PROTO : DIS_SUCCESS; /* If that worked, follow with the exponent, commit, and return. */ if (retval == DIS_SUCCESS) return (diswsi(stream, expon)); /* If coefficient didn't work, negative commit and return the error. */ return (((*disw_commit)(stream, FALSE) < 0) ? DIS_NOCOMMIT : retval); } torque-2.4.16/src/lib/Libdis/discui_.c0000664000113300011330000001047711272401246014372 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ char * discui_(char *cp, unsigned value, unsigned *ndigs) { char *ocp; ocp = cp; while (value > 9) { *--cp = value % 10 + '0'; value /= 10; } *--cp = value + '0'; *ndigs = ocp - cp; return (cp); } torque-2.4.16/src/lib/Libdis/disrf.c0000664000113300011330000002223211305006374014052 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * float disrf(int stream, int *retval) * * Gets a Data-is-Strings floating point number from and converts * it into a float and returns it. The number from consists of * two consecutive signed integers. The first is the coefficient, with its * implied decimal point at the low-order end. The second is the exponent * as a power of 10. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. * * By fiat of the author, neither loss of significance nor underflow are * errors. */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" #undef disrf static unsigned ndigs; static unsigned nskips; static double dval; static int disrd_( int stream, unsigned int count) { int c; int negate; unsigned int unum; char *cp; char scratch[DIS_BUFSIZ+1]; if (dis_umaxd == 0) disiui_(); memset(scratch, 0, DIS_BUFSIZ+1); c = (*dis_getc)(stream); switch (c) { case '-': case '+': negate = (c == '-'); nskips = (count > FLT_DIG) ? count - FLT_DIG : 0; count -= nskips; ndigs = count; dval = 0.0; do { c = (*dis_getc)(stream); if ((c < '0') || (c > '9')) { if (c < 0) { return (DIS_EOD); } return(DIS_NONDIGIT); } dval = dval * 10.0 + (double)(c - '0'); } while (--count); count = nskips; if (count > 0) { count--; switch ((*dis_getc)(stream)) { case '5': if (count == 0) break; /* fall through */ case '6': case '7': case '8': case '9': dval += 1.0; /* fall through */ case '0': case '1': case '2': case '3': case '4': if ((count > 0) && ((*disr_skip)(stream, (size_t)count) < 0)) { return(DIS_EOD); } break; default: return(DIS_NONDIGIT); /*NOTREACHED*/ break; } } dval = negate ? -dval : dval; return(DIS_SUCCESS); /*NOTREACHED*/ break; case '0': return(DIS_LEADZRO); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': unum = c - '0'; if (count > 1) { if ((*dis_gets)(stream, scratch + 1, count - 1) != (int)count - 1) { return(DIS_EOD); } cp = scratch; if (count >= dis_umaxd) { if (count > dis_umaxd) break; *cp = c; if (memcmp(scratch, dis_umax, dis_umaxd) > 0) break; } while (--count) { c = *++cp; if ((c < '0') || (c > '9')) { return(DIS_NONDIGIT); } unum = unum * 10 + (unsigned)(c - '0'); } } return(disrd_(stream, unum)); /*NOTREACHED*/ break; case - 1: return(DIS_EOD); /*NOTREACHED*/ break; case -2: return(DIS_EOF); /*NOTREACHED*/ break; default: return(DIS_NONDIGIT); /*NOTREACHED*/ break; } /* END switch(c) */ dval = HUGE_VAL; return(DIS_OVERFLOW); } /* END disrd_() */ float disrf( int stream, int *retval) { int expon; unsigned uexpon; int locret; int negate; assert(retval != NULL); assert(stream >= 0); assert(dis_getc != NULL); assert(dis_gets != NULL); assert(disr_skip != NULL); assert(disr_commit != NULL); dval = 0.0; if ((locret = disrd_(stream, 1)) == DIS_SUCCESS) { locret = disrsi_(stream, &negate, &uexpon, 1); if (locret == DIS_SUCCESS) { expon = negate ? nskips - uexpon : nskips + uexpon; if (expon + (int)ndigs > FLT_MAX_10_EXP) { if (expon + (int)ndigs > FLT_MAX_10_EXP + 1) { dval = dval < 0.0 ? -HUGE_VAL : HUGE_VAL; locret = DIS_OVERFLOW; } else { dval *= disp10d_(expon - 1); if (dval > FLT_MAX / 10.0) { dval = dval < 0.0 ? -HUGE_VAL : HUGE_VAL; locret = DIS_OVERFLOW; } else dval *= 10.0; } } else { if (expon < DBL_MIN_10_EXP) { dval *= disp10d_(expon + (int)ndigs); dval /= disp10d_((int)ndigs); } else dval *= disp10d_(expon); } } } if ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) locret = DIS_NOCOMMIT; *retval = locret; return (dval); } torque-2.4.16/src/lib/Libdis/disruc.c0000664000113300011330000001351311272401246014236 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * unsigned char disruc(int stream, int *) * * Gets a Data-is-Strings unsigned integer from , converts it into * an unsigned char, and returns it. The unsigned integer in * consists of a counted string of digits, starting with a zero, which * represents the number. If the number doesn't lie between 0 and 9, * inclusive, it is preceeded by at least one count. * * This format for character strings representing unsigned integers can * best be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next digit; if it is a plus sign, go to step (4); if it * is a minus sign, post an error. * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef disruc unsigned char disruc(stream, retval) int stream; int *retval; { int locret; int negate; unsigned value; assert(retval != NULL); assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &value, 1); if (locret != DIS_SUCCESS) { value = 0; } else if (negate) { value = 0; locret = DIS_BADSIGN; } else if (value > UCHAR_MAX) { value = UCHAR_MAX; locret = DIS_OVERFLOW; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return ((unsigned char)value); } torque-2.4.16/src/lib/Libdis/disrfcs.c0000664000113300011330000001312411272401246014400 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int disrfcs(int stream, size_t *nchars, size_t achars, char *value) * * Gets a Data-is-Strings character string from and converts it * into a counted string, puts the string into , a pre-allocated * string, long, and puts the count into *. The character * string in consists of an unsigned integer, followed by a number * of characters determined by the unsigned integer. * * Disrfcs returns DIS_SUCCESS if everything works well. It returns an * error code otherwise. In case of an error, the character * pointer is reset, making it possible to retry with some other conversion * strategy, and is set to 0. */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" int disrfcs(stream, nchars, achars, value) int stream; size_t *nchars; size_t achars; char *value; { int locret; int negate; unsigned count = 0; assert(nchars != NULL); assert(value != NULL); assert(dis_gets != NULL); assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &count, 1); if (locret == DIS_SUCCESS) { if (negate) locret = DIS_BADSIGN; else if ((*nchars = count) > achars) locret = DIS_OVERFLOW; else if ((*dis_gets)(stream, value, *nchars) != (int)*nchars) locret = DIS_PROTO; } locret = (*disr_commit)(stream, locret == DIS_SUCCESS) ? DIS_NOCOMMIT : locret; if (locret != DIS_SUCCESS) *nchars = 0; return (locret); } torque-2.4.16/src/lib/Libdis/disrfst.c0000664000113300011330000001364711272401246014433 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int disrfst(int stream, size_t achars, char *value) * * Gets a Data-is-Strings character string from and converts it * into an ASCII NUL-terminated string, and puts the string into , * a pre-allocated string, long. The character string in * consists of an unsigned integer, followed by a number of characters * determined by the unsigned integer. * * Disrfst returns DIS_SUCCESS if everything works well. It returns an * error code otherwise. In case of an error, the character * pointer is reset, making it possible to retry with some other conversion * strategy, and the first character of is set to ASCII NUL. */ #include /* the master config generated by configure */ #include #include #include #ifndef NDEBUG #include #endif #include "dis.h" #include "dis_.h" int disrfst( int stream, size_t achars, char *value) { int locret; /*int rc;*/ int negate; unsigned count; assert(value != NULL); assert(dis_gets != NULL); assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &count, 1); if (locret == DIS_SUCCESS) { if (negate) locret = DIS_BADSIGN; else if (count > achars) locret = DIS_OVERFLOW; else if ((*dis_gets)(stream, value, (size_t)count) != (int)count) locret = DIS_PROTO; #ifndef NDEBUG else if (memchr(value, 0, (size_t)count)) locret = DIS_NULLSTR; #endif else value[count] = '\0'; } /* if (locret == DIS_SUCCESS) rc = (*disr_commit)(stream,TRUE); else rc = (*disr_commit)(stream,FALSE); locret = (rc != 0) ? rc : DIS_NOCOMMIT; */ locret = (*disr_commit)(stream, locret == DIS_SUCCESS) ? DIS_NOCOMMIT : locret; if (locret != DIS_SUCCESS) *value = '\0'; return(locret); } /* END disrfst() */ torque-2.4.16/src/lib/Libdis/README0000664000113300011330000000052411272401246013457 00000000000000 This code is eventually compiled into the libpbs.a library. All actual compilation occurs in ../Libpbs Originally the libpbs.a file would end up in the directory above this, since it archived object files from both the Libdis and Libifl directories. Currently, all objects and compilation occur in Libpbs and the libpbs.a is left there. torque-2.4.16/src/lib/Libdis/diswui.c0000664000113300011330000001224711272401246014254 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int diswui(int stream, unsigned value) * * Converts into a Data-is-Strings unsigned integer and sends it to * . * * This format for character strings representing unsigned integers can * best be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next character; if it is a plus sign, go to step (4); if it * is a minus sign, post an error. * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * Returns DIS_SUCCESS if everything works well. Returns an error code * otherwise. In case of an error, no characters are sent to . */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef diswui int diswui(stream, value) int stream; unsigned value; { int retval; assert(disw_commit != NULL); retval = diswui_(stream, value); return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : retval); } torque-2.4.16/src/lib/Libdis/disrul.c0000664000113300011330000001305611272401246014251 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * unsigned long disrul(int stream, int *retval) * * Gets a Data-is-Strings unsigned integer from , converts it into * an unsigned long, and returns it. * * This format for character strings representing unsigned integers can * best be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next character; if it is a plus sign, go to step (4); if it * is a minus sign, post an error. * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" unsigned long disrul( int stream, /* I */ int *retval) /* O */ { int locret; int negate; unsigned long value; assert(disr_commit != NULL); locret = disrsl_(stream, &negate, &value, 1); if (locret != DIS_SUCCESS) { value = 0; } else if (negate) { value = 0; locret = DIS_BADSIGN; } if ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) { /* FAILURE */ *retval = DIS_NOCOMMIT; } else { *retval = locret; } return(value); } /* END disrul() */ torque-2.4.16/src/lib/Libdis/diswui_.c0000664000113300011330000001113211305006374014403 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" int diswui_(int stream, unsigned value) { unsigned ndigs; char *cp; char scratch[DIS_BUFSIZ+1]; assert(stream >= 0); assert(dis_puts != NULL); memset(scratch, 0, DIS_BUFSIZ+1); cp = discui_(&scratch[DIS_BUFSIZ], value, &ndigs); *--cp = '+'; while (ndigs > 1) cp = discui_(cp, ndigs, &ndigs); if ((*dis_puts)(stream, cp, strlen(cp)) < 0) return(DIS_PROTO); return (DIS_SUCCESS); } torque-2.4.16/src/lib/Libdis/disrui.c0000664000113300011330000001275311272401246014251 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * unsigned disrui(int stream, int *value) * * Gets a Data-is-Strings unsigned integer from , converts it into * an unsigned int, and returns it. * * This format for character strings representing unsigned integers can * best be understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next character; if it is a plus sign, go to step (4); if it * is a minus sign, post an error. * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * * gets DIS_SUCCESS if everything works well. It gets an error * code otherwise. In case of an error, the character pointer is * reset, making it possible to retry with some other conversion strategy. */ #include /* the master config generated by configure */ #include #include #include "dis.h" #include "dis_.h" #undef disrui unsigned disrui( int stream, /* I */ int *retval) /* O */ { int locret; int negate; unsigned value; assert(disr_commit != NULL); locret = disrsi_(stream, &negate, &value, 1); if (locret != DIS_SUCCESS) { value = 0; } else if (negate) { value = 0; locret = DIS_BADSIGN; } *retval = ((*disr_commit)(stream, locret == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : locret; return(value); } torque-2.4.16/src/lib/Libdis/diswsi.c0000664000113300011330000001330211305006374014243 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int diswsi(int stream, int value) * * Converts into a Data-is-Strings signed integer and sends it to * . * * This format for character strings representing integers can best be * understood through the decoding algorithm: * * 1. Initialize the digit count to 1. * * 2. Read the next character; if it is a sign, go to step (4). * * 3. Decode a new count from the digit decoded in step (2) and the next * count - 1 digits; repeat step (2). * * 4. Decode the next count digits as the unsigned integer. * * Returns DIS_SUCCESS if everything works well. Returns an error code * otherwise. In case of an error, no characters are sent to . */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" #undef diswsi int diswsi( int stream, int value) { int retval; unsigned ndigs; unsigned uval; char c; char *cp; int rc; char scratch[DIS_BUFSIZ+1]; assert(stream >= 0); assert(dis_puts != NULL); assert(disw_commit != NULL); memset(scratch, 0, DIS_BUFSIZ+1); if (value < 0) { uval = (unsigned) - (value + 1) + 1; c = '-'; } else { uval = value; c = '+'; } cp = discui_(&scratch[DIS_BUFSIZ], uval, &ndigs); *--cp = c; while (ndigs > 1) cp = discui_(cp, ndigs, &ndigs); retval = (*dis_puts)( stream, cp, strlen(cp)) < 0 ? DIS_PROTO : DIS_SUCCESS; /* disw_commit -> rpp_wcommit */ rc = ((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : retval; return(rc); } torque-2.4.16/src/lib/Libdis/dis.c0000664000113300011330000001206511305006374013525 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include "dis_.h" /* ** Routines to read and write down a stream */ int (*dis_getc) A_((int stream)) = NULL; int (*dis_puts) A_((int stream, const char *string, size_t count)) = NULL; int (*dis_gets) A_((int stream, char *string, size_t count)) = NULL; int (*disr_skip) A_((int stream, size_t nskips)) = NULL; int (*disw_commit) A_((int stream, int commit)) = NULL; int (*disr_commit) A_((int stream, int commit)) = NULL; /* sync w/#define DIS_* (include/dis.h) */ const char *dis_emsg[] = { "No error", "Input value too large to convert to this type", "Tried to write floating point infinity", "Negative sign on an unsigned datum", "Input count or value has leading zero", "Non-digit found where a digit was expected", "Input string has an embedded ASCII NUL", "Premature end of message", "Unable to malloc enough space for string", "Supporting protocol failure", "Protocol failure in commit", "End of File" }; /*char dis_buffer[DIS_BUFSIZ];*/ torque-2.4.16/src/lib/Libdis/Makefile.am0000664000113300011330000000012411272401246014627 00000000000000include $(top_srcdir)/buildutils/config.mk # all compilation happens in lib/Libpbs torque-2.4.16/src/lib/Libdis/diswl_.c0000664000113300011330000002023611305006374014226 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * Synopsis: * int diswl_(int stream, dis_long_double_t value, unsigned int ndigs) * * Converts into a Data-is-Strings floating point number and sends * it to . The converted number consists of two consecutive signed * integers. The first is the coefficient, at most long, with its * implied decimal point at the low-order end. The second is the exponent * as a power of 10. * * This function is only invoked through the macros, diswf, diswd, and * diswl, which are defined in the header file, dis.h. * * Returns DIS_SUCCESS if everything works well. Returns an error code * otherwise. In case of an error, no characters are sent to . */ #include /* the master config generated by configure */ #include #include #include #include "dis.h" #include "dis_.h" /* to work around a problem in a compiler */ #if SIZEOF_LONG_DOUBLE == SIZEOF_DOUBLE #ifdef LDBL_MAX #undef LDBL_MAX #endif /* LDBL_MAX */ #define LDBL_MAX DBL_MAX #endif /* SIZEOF_LONG_DOUBLE == SIZEOF_DOUBLE */ #if defined(__GNUC__) && defined(__DBL_MAX__) #ifdef LDBL_MAX #undef LDBL_MAX #endif /* LDBL_MAX */ #define LDBL_MAX __DBL_MAX__ #ifdef HUGE_VAL #undef HUGE_VAL #endif #define HUGE_VAL LDBL_MAX #endif int diswl_(int stream, dis_long_double_t value, unsigned ndigs) { int c; int expon; int negate; int retval; unsigned pow2; char *cp; char *ocp; dis_long_double_t ldval; char scratch[DIS_BUFSIZ+1]; assert(ndigs > 0 && ndigs <= LDBL_DIG); assert(stream >= 0); assert(dis_puts != NULL); assert(disw_commit != NULL); memset(scratch, 0, DIS_BUFSIZ+1); /* Make zero a special case. If we don't it will blow exponent */ /* calculation. */ if (value == 0.0L) { retval = (*dis_puts)(stream, "+0+0", 4) < 0 ? DIS_PROTO : DIS_SUCCESS; return (((*disw_commit)(stream, retval == DIS_SUCCESS) < 0) ? DIS_NOCOMMIT : retval); } /* Extract the sign from the coefficient. */ ldval = (negate = value < 0.0L) ? -value : value; /* Detect and complain about the infinite form. */ if (ldval > LDBL_MAX) return (DIS_HUGEVAL); /* Compute the integer part of the log to the base 10 of ldval. As a */ /* byproduct, reduce the range of ldval to the half-open interval, */ /* [1, 10). */ if (dis_lmx10 == 0) disi10l_(); expon = 0; pow2 = dis_lmx10 + 1; if (ldval < 1.0L) { do { if (ldval < dis_ln10[--pow2]) { ldval *= dis_lp10[pow2]; expon += 1 << pow2; } } while (pow2); ldval *= 10.0; expon = -expon - 1; } else { do { if (ldval >= dis_lp10[--pow2]) { ldval *= dis_ln10[pow2]; expon += 1 << pow2; } } while (pow2); } /* Round the value to the last digit */ ldval += 5.0L * disp10l_(-ndigs); if (ldval >= 10.0L) { expon++; ldval *= 0.1L; } /* Starting in the middle of the buffer, convert coefficient digits, */ /* most significant first. */ ocp = cp = &scratch[DIS_BUFSIZ - ndigs]; do { c = ldval; ldval = (ldval - c) * 10.0L; *ocp++ = c + '0'; } while (--ndigs); /* Eliminate trailing zeros. */ while (*--ocp == '0'); /* The decimal point is at the low order end of the coefficient */ /* integer, so adjust the exponent for the number of digits in the */ /* coefficient. */ ndigs = ++ocp - cp; expon -= ndigs - 1; /* Put the coefficient sign into the buffer, left of the coefficient. */ *--cp = negate ? '-' : '+'; /* Insert the necessary number of counts on the left. */ while (ndigs > 1) cp = discui_(cp, ndigs, &ndigs); /* The complete coefficient integer is done. Put it out. */ retval = (*dis_puts)(stream, cp, (size_t)(ocp - cp)) < 0 ? DIS_PROTO : DIS_SUCCESS; /* If that worked, follow with the exponent, commit, and return. */ if (retval == DIS_SUCCESS) return (diswsi(stream, expon)); /* If coefficient didn't work, negative commit and return the error. */ return (((*disw_commit)(stream, FALSE) < 0) ? DIS_NOCOMMIT : retval); } torque-2.4.16/src/lib/Libdis/disi10l_.c0000664000113300011330000001251611272401246014353 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include "dis.h" unsigned dis_lmx10 = 0; dis_long_double_t *dis_lp10 = NULL; dis_long_double_t *dis_ln10 = NULL; /* * Allocate and fill tables with all powers of 10 that fit the forms: * * n * 2 * *dis_lp10[n] = 10 * * ( n) * -(2 ) * *dis_ln10[n] = 10 * * For all values of n supported by the floating point format. Set * dis_lmx10 equal to the largest value of n that fits the format. */ void disi10l_(void) { unsigned i; unsigned long ul; dis_long_double_t accum; size_t tabsize; assert(dis_lp10 == NULL); assert(dis_ln10 == NULL); assert(dis_lmx10 == 0); #if LDBL_MAX_10_EXP + LDBL_MIN_10_EXP > 0 ul = LDBL_MAX_10_EXP; #else ul = -LDBL_MIN_10_EXP; #endif while (ul >>= 1) dis_lmx10++; tabsize = (dis_lmx10 + 1) * sizeof(dis_long_double_t); dis_lp10 = (dis_long_double_t *)malloc(tabsize); assert(dis_lp10 != NULL); dis_ln10 = (dis_long_double_t *)malloc(tabsize); assert(dis_ln10 != NULL); assert(dis_lmx10 > 0); dis_lp10[0] = accum = 10.0L; dis_ln10[0] = 1.0L / accum; for (i = 1; i <= dis_lmx10; i++) { accum *= accum; dis_lp10[i] = accum; dis_ln10[i] = 1.0L / accum; } } torque-2.4.16/src/lib/Makefile.am0000664000113300011330000000020211272401247013417 00000000000000include $(top_srcdir)/buildutils/config.mk SUBDIRS = Libattr Libcmds Libcsv Libdis Libifl Liblog Libnet Libpbs Libsite Libutils torque-2.4.16/src/iff/0000777000113300011330000000000011614035165011453 500000000000000torque-2.4.16/src/iff/iff2.c0000664000113300011330000002435111306021357012364 00000000000000#include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libpbs.h" #include "dis.h" #include "server_limits.h" #include "net_connect.h" #include "credential.h" /* * pbs_iff - authenticates the user to the PBS server. * * Usage: call via pbs_connect() with * pbs_iff [-t] hostname port [parent_connection_port] * * The parent_connection_port is required unless -t (for test) is given. */ /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ extern int pbs_errno; extern char pbs_current_user[PBS_MAXUSER]; /* for libpbs.a */ int main( int argc, /* I */ char *argv[], /* I */ char *envp[]) /* I */ { int auth_type = PBS_credentialtype_none; int err = 0; pbs_net_t hostaddr; int i; uid_t myrealuid; uid_t myeuid; unsigned int parentport; int parentsock = -1; struct passwd *pwent; int servport = -1; int sock; struct sockaddr_in sockname; torque_socklen_t socknamelen; int testmode = 0; int rc; struct batch_reply *reply; char *parse_servername A_((char *, short *)); extern int optind; extern char *optarg; char EMsg[1024]; char *ptr; int PBSLOGLEVEL = 0; strcpy(pbs_current_user, "PBS_Server"); if ((ptr = getenv("PBSLOGLEVEL")) != NULL) { PBSLOGLEVEL = (int)strtol(ptr, NULL, 10); } /* Need to unset LOCALDOMAIN if set, want local host name */ for (i = 0;envp[i];++i) { if (!strncmp(envp[i], "LOCALDOMAIN=", 12)) { envp[i] = ""; break; } } /* END for (i) */ while ((i = getopt(argc, argv, "t")) != EOF) { switch (i) { case 't': testmode = 1; break; default: err = 1; break; } } /* END while (i = getopt()) */ if ((err == 1) || (testmode && (argc - optind) != 2) || (!testmode && (argc - optind) != 3)) { fprintf(stderr, "Usage: %s [-t] host port [parent_port]\n", argv[0]); fprintf(stderr, "NOTE: one of '-t' or 'parent_port' must be specified\n"); return(1); } if (!testmode && isatty(fileno(stdout))) { fprintf(stderr, "pbs_iff: output is a tty & not test mode\n"); return(1); } myeuid = geteuid(); #ifndef __CYGWIN__ if (!testmode && (myeuid != 0)) { fprintf(stderr, "pbs_iff: file not setuid root, likely misconfigured\n"); #if SYSLOG syslog(LOG_ERR | LOG_DAEMON, "not setuid 0, likely misconfigured"); #endif /* SYSLOG */ } /* END if (!testmode && (myeuid != 0)) */ #endif /* __CYGWIN__ */ /* first, make sure we have a valid server (host), and ports */ if ((hostaddr = get_hostaddr(argv[optind])) == (pbs_net_t)0) { /* FAILURE */ fprintf(stderr, "pbs_iff: unknown host %s\n", argv[optind]); return(1); } if ((servport = atoi(argv[++optind])) <= 0) { /* FAILURE */ return(1); } errno = 0; for (i = 0;i < 10;i++) { sock = client_to_svr(hostaddr, (unsigned int)servport, 1, EMsg); if (sock != PBS_NET_RC_RETRY) break; sleep(1); } /* END for (i) */ if (sock < 0) { /* FAILURE */ fprintf(stderr, "pbs_iff: cannot connect to %s:%d - %s, errno=%d (%s) %s\n", argv[optind - 1], servport, (sock == PBS_NET_RC_FATAL) ? "fatal error" : "timeout", errno, strerror(errno), EMsg); return(4); } connection[1].ch_inuse = 1; connection[1].ch_errno = 0; connection[1].ch_socket = sock; connection[1].ch_errtxt = NULL; DIS_tcp_setup(sock); if (testmode == 0) { optind++; if ((parentsock = atoi(argv[optind])) < 0) { /* FAILURE */ fprintf(stderr, "pbs_iff: invalid parent socket '%s' specified\n", argv[optind]); return(1); } } else { /* for test mode, use my own port rather than the parents */ parentsock = sock; } /* next, get the real user name */ myrealuid = getuid(); pwent = getpwuid(myrealuid); if (pwent == NULL) { /* FAILURE */ fprintf(stderr, "pbs_iff: cannot get account info for uid %d, errno=%d (%s)\n", (int)myrealuid, errno, strerror(errno)); return(3); } /* now get the parent's client-side port */ socknamelen = sizeof(sockname); if (getsockname( parentsock, (struct sockaddr *)&sockname, &socknamelen) < 0) { /* FAILURE */ fprintf(stderr, "pbs_iff: cannot get sockname for socket %d, errno=%d (%s)\n", parentsock, errno, strerror(errno)); return(3); } parentport = ntohs(sockname.sin_port); /* send authentication information */ if ((rc = encode_DIS_ReqHdr(sock, PBS_BATCH_AuthenUser, pwent->pw_name)) || (rc = diswui(sock, parentport)) || (rc = encode_DIS_ReqExtend(sock, NULL))) { /* FAILURE */ fprintf(stderr, "pbs_iff: cannot send request to pbs_server, rc=%d\n", rc); return(2); } rc = DIS_tcp_wflush(sock); if (rc != 0) { /* FAILURE */ fprintf(stderr, "pbs_iff: cannot flush request to pbs_server, rc=%d\n", rc); return(2); } /* read back the response */ reply = PBSD_rdrpy(1); if (reply == NULL) { /* FAILURE */ fprintf(stderr, "pbs_iff: cannot read reply from pbs_server\n"); return(1); } if (reply->brp_code != 0) { /* FAILURE */ if (reply->brp_choice == BATCH_REPLY_CHOICE_Text) { fprintf(stderr, "pbs_iff: %s\n", reply->brp_un.brp_txt.brp_str); } else { fprintf(stderr, "pbs_iff: pbs_server returned failure code %d\n", reply->brp_code); } return(1); } /* SUCCESS */ pbs_disconnect(1); /* send back "type none" credential */ if (write(fileno(stdout), &auth_type, sizeof(int)) != sizeof(int)) fprintf(stderr, "pbs_iff: error writing to stdout?!\n"); fclose(stdout); return(0); } /* END main() */ /* END iff2.c */ torque-2.4.16/src/iff/Makefile.in0000664000113300011330000004610111605403727013443 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(pbs_iff_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk sbin_PROGRAMS = pbs_iff$(EXEEXT) subdir = src/iff ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_pbs_iff_OBJECTS = iff2.$(OBJEXT) pbs_iff_OBJECTS = $(am_pbs_iff_OBJECTS) am__DEPENDENCIES_1 = ../lib/Libpbs/libtorque.la pbs_iff_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pbs_iff_SOURCES) DIST_SOURCES = $(pbs_iff_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter PBS_LIBS = ../lib/Libpbs/libtorque.la pbs_iff_LDADD = $(PBS_LIBS) pbs_iff_SOURCES = iff2.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/iff/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/iff/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done pbs_iff$(EXEEXT): $(pbs_iff_OBJECTS) $(pbs_iff_DEPENDENCIES) @rm -f pbs_iff$(EXEEXT) $(LINK) $(pbs_iff_LDFLAGS) $(pbs_iff_OBJECTS) $(pbs_iff_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iff2.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-exec-hook install-info install-info-am \ install-man install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-sbinPROGRAMS install-exec-hook: chmod u+s $(DESTDIR)$(sbindir)/$(program_prefix)pbs_iff$(program_suffix) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/iff/Makefile.am0000664000113300011330000000040111272401244013413 00000000000000include $(top_srcdir)/buildutils/config.mk PBS_LIBS = ../lib/Libpbs/libtorque.la sbin_PROGRAMS = pbs_iff pbs_iff_LDADD = $(PBS_LIBS) pbs_iff_SOURCES = iff2.c install-exec-hook: chmod u+s $(DESTDIR)$(sbindir)/$(program_prefix)pbs_iff$(program_suffix) torque-2.4.16/src/mom_rcp/0000777000113300011330000000000011614035203012334 500000000000000torque-2.4.16/src/mom_rcp/rcp.c0000664000113300011330000005700011272401237013210 00000000000000/* * Copyright (c) 1983, 1990, 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char const copyright[] = "@(#) Copyright (c) 1983, 1990, 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #define NEED_BLOCKING_CONNECTIONS #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_ERR_H #include #endif #include "pathnames.h" #include "extern.h" #include "portability.h" #ifndef MAXPATHLEN #define MAXPATHLEN 1024 #endif #ifdef KERBEROS #include #include char dst_realm_buf[REALM_SZ]; char *dest_realm = NULL; int use_kerberos = 1; CREDENTIALS cred; Key_schedule schedule; extern char *krb_realmofhost(); #ifdef CRYPT int doencrypt = 0; #define OPTIONS "dfKk:prtx" #else #define OPTIONS "dfKk:prt" #endif #else #define OPTIONS "dfprt" #endif struct passwd *pwd; u_short port; uid_t userid; int errs, rem; int pflag, iamremote, iamrecursive, targetshouldbedirectory; #define CMDNEEDS 64 char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ #ifdef KERBEROS int kerberos __P((char **, char *, char *, char *)); void oldw __P((const char *, ...)); #endif int response __P((void)); void rsource __P((char *, struct stat *)); void sink __P((int, char *[])); void source __P((int, char *[])); void tolocal __P((int, char *[])); void toremote __P((char *, int, char *[])); void usage __P((void)); int main( int argc, char *argv[]) { struct servent *sp; int ch, fflag, tflag; char *targ, *shell; extern int optind; fflag = tflag = 0; while ((ch = getopt(argc, argv, OPTIONS)) != EOF) switch (ch) /* User-visible flags. */ { case 'K': #ifdef KERBEROS use_kerberos = 0; #endif break; #ifdef KERBEROS case 'k': dest_realm = dst_realm_buf; (void)strncpy(dst_realm_buf, optarg, REALM_SZ); break; #ifdef CRYPT case 'x': doencrypt = 1; /* des_set_key(cred.session, schedule); */ break; #endif #endif case 'p': pflag = 1; break; case 'r': iamrecursive = 1; break; /* Server options. */ case 'd': targetshouldbedirectory = 1; break; case 'f': /* "from" */ iamremote = 1; fflag = 1; break; case 't': /* "to" */ iamremote = 1; tflag = 1; break; case '?': default: usage(); } argc -= optind; argv += optind; #ifdef KERBEROS if (use_kerberos) { #ifdef CRYPT shell = doencrypt ? "ekshell" : "kshell"; #else shell = "kshell"; #endif if ((sp = getservbyname(shell, "tcp")) == NULL) { use_kerberos = 0; oldw("can't get entry for %s/tcp service", shell); sp = getservbyname(shell = "shell", "tcp"); } } else sp = getservbyname(shell = "shell", "tcp"); #else sp = getservbyname(shell = "shell", "tcp"); #endif if (sp == NULL) errx(1, "%s/tcp: unknown service", shell); port = sp->s_port; if ((pwd = getpwuid(userid = getuid())) == NULL) errx(1, "unknown user %d", (int)userid); rem = STDIN_FILENO; /* XXX */ if (fflag) /* Follow "protocol", send data. */ { (void)response(); if (setuid(userid) != 0) err(1, "setuid(%ld) failed", (long)userid); source(argc, argv); exit(errs); } if (tflag) /* Receive data. */ { if (setuid(userid) != 0) err(1, "setuid(%ld) failed", (long)userid); sink(argc, argv); exit(errs); } if (argc < 2) usage(); if (argc > 2) targetshouldbedirectory = 1; rem = -1; /* Command to be executed on remote system using "rsh". */ #ifdef KERBEROS (void)sprintf(cmd, "rcp%s%s%s%s", iamrecursive ? " -r" : "", #ifdef CRYPT (doencrypt && use_kerberos ? " -x" : ""), #else "", #endif pflag ? " -p" : "", targetshouldbedirectory ? " -d" : ""); #else (void)sprintf(cmd, "rcp%s%s%s", iamrecursive ? " -r" : "", pflag ? " -p" : "", targetshouldbedirectory ? " -d" : ""); #endif (void)signal(SIGPIPE, lostconn); if ((targ = colon(argv[argc - 1]))) /* Dest is remote host. */ toremote(targ, argc, argv); else { tolocal(argc, argv); /* Dest is local host. */ if (targetshouldbedirectory) verifydir(argv[argc - 1]); } exit(errs); } void toremote(char *targ, int argc, char *argv[]) { int i, len; char *bp, *host, *src, *suser, *thost, *tuser; *targ++ = 0; if (*targ == 0) targ = "."; if ((thost = strchr(argv[argc - 1], '@'))) { /* user@host */ *thost++ = 0; tuser = argv[argc - 1]; if (*tuser == '\0') tuser = NULL; else if (!okname(tuser)) exit(1); } else { thost = argv[argc - 1]; tuser = NULL; } for (i = 0; i < argc - 1; i++) { src = colon(argv[i]); if (src) /* remote to remote */ { *src++ = 0; if (*src == 0) src = "."; host = strchr(argv[i], '@'); len = strlen(_PATH_RSH) + strlen(argv[i]) + strlen(src) + (tuser ? strlen(tuser) : 0) + strlen(thost) + strlen(targ) + CMDNEEDS + 20; if (!(bp = malloc(len))) err(1, NULL); if (host) { *host++ = 0; suser = argv[i]; if (*suser == '\0') suser = pwd->pw_name; else if (!okname(suser)) continue; (void)sprintf(bp, "%s %s -l %s -n %s %s '%s%s%s:%s'", _PATH_RSH, host, suser, cmd, src, tuser ? tuser : "", tuser ? "@" : "", thost, targ); } else (void)sprintf(bp, "exec %s %s -n %s %s '%s%s%s:%s'", _PATH_RSH, argv[i], cmd, src, tuser ? tuser : "", tuser ? "@" : "", thost, targ); (void)susystem(bp, userid); (void)free(bp); } else /* local to remote */ { if (rem == -1) { len = strlen(targ) + CMDNEEDS + 20; if (!(bp = malloc(len))) err(1, NULL); (void)sprintf(bp, "%s -t %s", cmd, targ); host = thost; #ifdef KERBEROS if (use_kerberos) rem = kerberos(&host, bp, pwd->pw_name, tuser ? tuser : pwd->pw_name); else #endif rem = rcmd(&host, port, pwd->pw_name, tuser ? tuser : pwd->pw_name, bp, 0); if (rem < 0) exit(1); if (response() < 0) exit(1); (void)free(bp); if (setuid(userid) != 0) err(1, "setuid(%ld) failed",(long)userid); } source(1, argv + i); } } } void tolocal(int argc, char *argv[]) { int i, len; char *bp, *host, *src, *suser; for (i = 0; i < argc - 1; i++) { if (!(src = colon(argv[i]))) /* Local to local. */ { len = strlen(_PATH_CP) + strlen(argv[i]) + strlen(argv[argc - 1]) + 20; if (!(bp = malloc(len))) err(1, NULL); (void)sprintf(bp, "exec %s%s%s %s %s", _PATH_CP, iamrecursive ? " -r" : "", pflag ? " -p" : "", argv[i], argv[argc - 1]); if (susystem(bp, userid)) ++errs; (void)free(bp); continue; } *src++ = 0; if (*src == 0) src = "."; if ((host = strchr(argv[i], '@')) == NULL) { host = argv[i]; suser = pwd->pw_name; } else { *host++ = 0; suser = argv[i]; if (*suser == '\0') suser = pwd->pw_name; else if (!okname(suser)) continue; } len = strlen(src) + CMDNEEDS + 20; if ((bp = malloc(len)) == NULL) err(1, NULL); (void)sprintf(bp, "%s -f %s", cmd, src); rem = #ifdef KERBEROS use_kerberos ? kerberos(&host, bp, pwd->pw_name, suser) : #endif rcmd(&host, port, pwd->pw_name, suser, bp, 0); (void)free(bp); if (rem < 0) { ++errs; continue; } if (seteuid(userid) != 0) err(1, "seteuid(%ld) failed", (long)userid); sink(1, argv + argc - 1); (void)seteuid(0); (void)close(rem); rem = -1; } } void source( int argc, char *argv[]) { struct stat stb; static BUF buffer; BUF *bp; off_t i; int amt, fd, haderr, indx, result; char *last, *name, buf[BUFSIZ]; for (indx = 0;indx < argc;++indx) { name = argv[indx]; if ((fd = open(name, O_RDONLY, 0)) < 0) goto syserr; if (fstat(fd, &stb) != 0) { syserr: run_err("%s: %s", name, strerror(errno)); goto next; } switch (stb.st_mode & S_IFMT) { case S_IFREG: break; case S_IFDIR: if (iamrecursive) { rsource(name, &stb); goto next; } /* FALLTHROUGH */ default: run_err("%s: not a regular file", name); goto next; } if ((last = strrchr(name, '/')) == NULL) last = name; else ++last; if (pflag) { /* Make it compatible with possible future versions expecting microseconds */ sprintf(buf, "T%ld 0 %ld 0\n", (long)stb.st_mtime, (long)stb.st_atime); write(rem, buf, strlen(buf)); if (response() < 0) goto next; } #define MODMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) /* NOTE: nothing defined which indicates this is Darwin/powerpc64 etc */ sprintf(buf, "C%04lo %lld %s\n", (unsigned long int)stb.st_mode & MODMASK, (unsigned long long int)stb.st_size, last); write(rem, buf, strlen(buf)); if (response() < 0) goto next; if ((bp = allocbuf(&buffer, fd, BUFSIZ)) == NULL) { next: (void)close(fd); continue; } /* Keep writing after an error so that we stay sync'd up. */ for (haderr = i = 0; i < stb.st_size; i += bp->cnt) { amt = bp->cnt; if (i + amt > stb.st_size) amt = stb.st_size - i; if (!haderr) { result = read(fd, bp->buf, amt); if (result != amt) haderr = result >= 0 ? EIO : errno; } if (haderr) (void)write(rem, bp->buf, amt); else { result = write(rem, bp->buf, amt); if (result != amt) haderr = result >= 0 ? EIO : errno; } } if (close(fd) && !haderr) haderr = errno; if (!haderr) (void)write(rem, "", 1); else run_err("%s: %s", name, strerror(haderr)); (void)response(); } } void rsource(name, statp) char *name; struct stat *statp; { DIR *dirp; struct dirent *dp; char *last, *vect[1], path[MAXPATHLEN]; if (!(dirp = opendir(name))) { run_err("%s: %s", name, strerror(errno)); return; } last = strrchr(name, '/'); if (last == 0) last = name; else last++; if (pflag) { (void)sprintf(path, "T%ld 0 %ld 0\n", (long)statp->st_mtime, (long)statp->st_atime); (void)write(rem, path, strlen(path)); if (response() < 0) { closedir(dirp); return; } } (void)sprintf(path, "D%04lo %d %s\n", (unsigned long)statp->st_mode & MODMASK, 0, last); (void)write(rem, path, strlen(path)); if (response() < 0) { closedir(dirp); return; } while ((dp = readdir(dirp))) { if (dp->d_ino == 0) continue; if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue; if (strlen(name) + 1 + strlen(dp->d_name) >= (size_t)(MAXPATHLEN - 1)) { run_err("%s/%s: name too long", name, dp->d_name); continue; } (void)sprintf(path, "%s/%s", name, dp->d_name); vect[0] = path; source(1, vect); } (void)closedir(dirp); (void)write(rem, "E\n", 2); (void)response(); } void sink(int argc, char *argv[]) { static BUF buffer; struct stat stb; struct timeval tv[2]; enum { YES, NO, DISPLAYED } wrerr; BUF *bp; off_t i, j; int amt, count, exists, first, mask, mode, ofd, omode; int setimes, size, targisdir, wrerrno = 0; char ch, *cp, *np, *targ, *why, *vect[1], buf[BUFSIZ]; #define atime tv[0] #define mtime tv[1] #define SCREWUP(str) { why = str; goto screwup; } setimes = targisdir = 0; mask = umask(0); if (!pflag) (void)umask(mask); if (argc != 1) { run_err("ambiguous target"); exit(1); } targ = *argv; if (targetshouldbedirectory) verifydir(targ); (void)write(rem, "", 1); if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) targisdir = 1; for (first = 1;; first = 0) { cp = buf; if (read(rem, cp, 1) <= 0) return; if (*cp++ == '\n') SCREWUP("unexpected "); do { if (read(rem, &ch, sizeof(ch)) != sizeof(ch)) SCREWUP("lost connection"); *cp++ = ch; } while (cp < &buf[BUFSIZ - 1] && ch != '\n'); *cp = 0; if (buf[0] == '\01' || buf[0] == '\02') { if (iamremote == 0) (void)write(STDERR_FILENO, buf + 1, strlen(buf + 1)); if (buf[0] == '\02') exit(1); ++errs; continue; } if (buf[0] == 'E') { (void)write(rem, "", 1); return; } if (ch == '\n') *--cp = 0; #define getnum(t) (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0'); cp = buf; if (*cp == 'T') { setimes++; cp++; getnum(mtime.tv_sec); if (*cp++ != ' ') SCREWUP("mtime.sec not delimited"); getnum(mtime.tv_usec); if (*cp++ != ' ') SCREWUP("mtime.usec not delimited"); getnum(atime.tv_sec); if (*cp++ != ' ') SCREWUP("atime.sec not delimited"); getnum(atime.tv_usec); if (*cp++ != '\0') SCREWUP("atime.usec not delimited"); (void)write(rem, "", 1); continue; } if (*cp != 'C' && *cp != 'D') { /* * Check for the case "rcp remote:foo\* local:bar". * In this case, the line "No match." can be returned * by the shell before the rcp command on the remote is * executed so the ^Aerror_message convention isn't * followed. */ if (first) { run_err("%s", cp); exit(1); } SCREWUP("expected control record"); } mode = 0; for (++cp; cp < buf + 5; cp++) { if (*cp < '0' || *cp > '7') SCREWUP("bad mode"); mode = (mode << 3) | (*cp - '0'); } if (*cp++ != ' ') SCREWUP("mode not delimited"); for (size = 0; isdigit(*cp);) size = size * 10 + (*cp++ - '0'); if (*cp++ != ' ') SCREWUP("size not delimited"); if (targisdir) { /* FIXME: this code is broken. cursize is never init. memory leak. */ static char *namebuf; static size_t cursize; size_t need; need = strlen(targ) + strlen(cp) + 250; if (need > cursize) { if (!(namebuf = malloc(need))) run_err("%s", strerror(errno)); } (void)sprintf(namebuf, "%s%s%s", targ, *targ ? "/" : "", cp); np = namebuf; } else np = targ; exists = stat(np, &stb) == 0; if (buf[0] == 'D') { int mod_flag = pflag; if (exists) { if (!S_ISDIR(stb.st_mode)) { errno = ENOTDIR; goto bad; } if (pflag) (void)chmod(np, mode); } else { /* Handle copying from a read-only directory */ mod_flag = 1; if (mkdir(np, mode | S_IRWXU) < 0) goto bad; } vect[0] = np; sink(1, vect); if (setimes) { setimes = 0; if (utimes(np, tv) < 0) run_err("%s: set times: %s", np, strerror(errno)); } if (mod_flag) (void)chmod(np, mode); continue; } omode = mode; mode |= S_IWRITE; if ((ofd = open(np, O_WRONLY | O_CREAT, mode)) < 0) { bad: run_err("%s: %s", np, strerror(errno)); continue; } (void)write(rem, "", 1); if ((bp = allocbuf(&buffer, ofd, BUFSIZ)) == NULL) { (void)close(ofd); continue; } cp = bp->buf; wrerr = NO; for (count = i = 0; i < size; i += BUFSIZ) { amt = BUFSIZ; if (i + amt > size) amt = size - i; count += amt; do { j = read(rem, cp, amt); if (j <= 0) { run_err("%s", j ? strerror(errno) : "dropped connection"); exit(1); } amt -= j; cp += j; } while (amt > 0); if (count == bp->cnt) { /* Keep reading so we stay sync'd up. */ if (wrerr == NO) { j = write(ofd, bp->buf, count); if (j != count) { wrerr = YES; wrerrno = j >= 0 ? EIO : errno; } } count = 0; cp = bp->buf; } } if (count != 0 && wrerr == NO && (j = write(ofd, bp->buf, count)) != count) { wrerr = YES; wrerrno = j >= 0 ? EIO : errno; } if (ftruncate(ofd, size)) { run_err("%s: truncate: %s", np, strerror(errno)); wrerr = DISPLAYED; } if (pflag) { if (exists || omode != mode) if (fchmod(ofd, omode)) run_err("%s: set mode: %s", np, strerror(errno)); } else { if (!exists && omode != mode) if (fchmod(ofd, omode & ~mask)) run_err("%s: set mode: %s", np, strerror(errno)); } (void)close(ofd); (void)response(); if (setimes && wrerr == NO) { setimes = 0; if (utimes(np, tv) < 0) { run_err("%s: set times: %s", np, strerror(errno)); wrerr = DISPLAYED; } } switch (wrerr) { case YES: run_err("%s: %s", np, strerror(wrerrno)); break; case NO: (void)write(rem, "", 1); break; case DISPLAYED: break; } } screwup: run_err("protocol error: %s", why); exit(1); } #ifdef KERBEROS int kerberos(char **host, char *bp, char *locuser, char *user) { struct servent *sp; again: if (use_kerberos) { rem = KSUCCESS; errno = 0; if (dest_realm == NULL) dest_realm = krb_realmofhost(*host); rem = #ifdef CRYPT doencrypt ? krcmd_mutual(host, port, user, bp, 0, dest_realm, &cred, schedule) : #endif krcmd(host, port, user, bp, 0, dest_realm); if (rem < 0) { use_kerberos = 0; if ((sp = getservbyname("shell", "tcp")) == NULL) errx(1, "unknown service shell/tcp"); if (errno == ECONNREFUSED) oldw("remote host doesn't support Kerberos"); else if (errno == ENOENT) oldw("can't provide Kerberos authentication data"); port = sp->s_port; goto again; } } else { #ifdef CRYPT if (doencrypt) errx(1, "the -x option requires Kerberos authentication"); #endif rem = rcmd(host, port, locuser, user, bp, 0); } return (rem); } #endif /* KERBEROS */ int response(void) { char ch, *cp, resp, rbuf[BUFSIZ]; if (read(rem, &resp, sizeof(resp)) != sizeof(resp)) lostconn(0); cp = rbuf; switch (resp) { case 0: /* ok */ return (0); default: *cp++ = resp; /* FALLTHROUGH */ case 1: /* error, followed by error msg */ case 2: /* fatal error, "" */ do { if (read(rem, &ch, sizeof(ch)) != sizeof(ch)) lostconn(0); *cp++ = ch; } while (cp < &rbuf[BUFSIZ] && ch != '\n'); if (!iamremote) (void)write(STDERR_FILENO, rbuf, cp - rbuf); ++errs; if (resp == 1) return (-1); exit(1); } /* NOTREACHED */ } void usage(void) { #ifdef KERBEROS #ifdef CRYPT (void)fprintf(stderr, "%s\n\t%s\n", "usage: rcp [-Kpx] [-k realm] f1 f2", "or: rcp [-Kprx] [-k realm] f1 ... fn directory"); #else (void)fprintf(stderr, "%s\n\t%s\n", "usage: rcp [-Kp] [-k realm] f1 f2", "or: rcp [-Kpr] [-k realm] f1 ... fn directory"); #endif #else (void)fprintf(stderr, "usage: rcp [-p] f1 f2; or: rcp [-pr] f1 ... fn directory\n"); #endif exit(1); } #if __STDC__ #include #else #include #endif #ifdef KERBEROS void #if __STDC__ oldw(const char *fmt, ...) #else oldw(fmt, va_alist) char *fmt; va_dcl #endif { va_list ap; #if __STDC__ va_start(ap, fmt); #else va_start(ap); #endif (void)fprintf(stderr, "rcp: "); (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, ", using standard rcp\n"); va_end(ap); } #endif void #if __STDC__ run_err(const char *fmt, ...) #else run_err(fmt, va_alist) char *fmt; va_dcl #endif { static FILE *fp; va_list ap; #if __STDC__ va_start(ap, fmt); #else va_start(ap); #endif ++errs; if (fp == NULL && !(fp = fdopen(rem, "w"))) return; (void)fprintf(fp, "%c", 0x01); (void)fprintf(fp, "rcp: "); (void)vfprintf(fp, fmt, ap); (void)fprintf(fp, "\n"); (void)fflush(fp); if (!iamremote) { (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, "\n"); } va_end(ap); } torque-2.4.16/src/mom_rcp/extern.h0000664000113300011330000000435411272401237013742 00000000000000/*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef __P #if __STDC__ #define __P(x) x #else #define __P(x) () #endif #endif /* __P */ typedef struct { int cnt; char *buf; } BUF; extern int iamremote; BUF *allocbuf __P((BUF *, int, int)); char *colon __P((char *)); void lostconn __P((int)); void nospace __P((void)); int okname __P((char *)); void run_err __P((const char *, ...)); int susystem __P((char *, int)); void verifydir __P((char *)); char *strerror __P((int)); torque-2.4.16/src/mom_rcp/Makefile.in0000664000113300011330000004625311605403741014337 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(pbs_rcp_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk sbin_PROGRAMS = pbs_rcp$(EXEEXT) subdir = src/mom_rcp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_pbs_rcp_OBJECTS = rcp.$(OBJEXT) replace.$(OBJEXT) util.$(OBJEXT) pbs_rcp_OBJECTS = $(am_pbs_rcp_OBJECTS) pbs_rcp_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pbs_rcp_SOURCES) DIST_SOURCES = $(pbs_rcp_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter pbs_rcp_SOURCES = rcp.c replace.c util.c extern.h pathnames.h EXTRA_DIST = ReadMe all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/mom_rcp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/mom_rcp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done pbs_rcp$(EXEEXT): $(pbs_rcp_OBJECTS) $(pbs_rcp_DEPENDENCIES) @rm -f pbs_rcp$(EXEEXT) $(LINK) $(pbs_rcp_LDFLAGS) $(pbs_rcp_OBJECTS) $(pbs_rcp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rcp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-exec-hook install-info install-info-am \ install-man install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-sbinPROGRAMS install-exec-hook: chmod u+s $(DESTDIR)$(sbindir)/$(program_prefix)pbs_rcp$(program_suffix) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/mom_rcp/ReadMe0000664000113300011330000001064211272401237013341 00000000000000MOM's rcp 1. What is this rcp stuff? The majority contents of this directory is the source code for the rcp(1) command. This source is from the bsd4.4-Lite distribution. It is copyrighted by UCB as noted in the source files. This code has been slightly modified in order to have in compile on systems other than bsd4.4; note their liberal use of functions suchs as vwarnx() and snprintf() not found in POSIX. The copyright, reproduced below, clearly grants the right to modify and redistribute the source. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. 2. Why do we need it? Within PBS, there are three cases in which MOM must move files between her machine and some other: a. Pre-execution stage in of files. b. Post-execution stage out of files. c. Post-execution return of the job`s standard output and standard error. The PBS project did not wish to be dependent on NFS, AFS, or any other distributed file system in order to support file delivery. Nor did we wish to restrict the source/target of file movement to those systems with a PBS server. This ruled out using the "job" protocol as a file transport. Ftp(1) and ftam require the user's password. We did not wish to require that knowledge. Thus rcp(1) was selected as the transport method. MOM uses the system(3) library routine to execute the rcp command. However, many rcp implementations come with a serious flaw. They may exit and return an exit status of zero (0), when the file was not delivered. If this happens, MOM would believe that the file was delivered when it was not. One solution would have been to implement a new copy utility for MOM very similar to rcp. But this would have required it's installation on every system to/from which the user may wish to move files. Rather than duplicate rcp, lets just fix it. As only the rcp used by MOM must be "fixed", the PBS team opted to provide a version of rcp that works correctly. The bsd4.4-Lite version was chosen because of the freedom to copy and modify it granted by its copyright. 3. How is it used? The supplied rcp source is compiled and the program is named "pbs_rcp" in order to reduce the level of confusion on having two "rcp"s installed on the system. It is installed in the same directory as MOM (pbs_mom). When MOM invokes pbs_rcp, MOM has forked a child which as set its effective and real uid to that of the user on whoses behalf MOM is operation. This child of MOM, as the user, will use system(3) to fork a shell and execute pbs_rcp. The path to the pbs_rcp is specified in building src/mom/requests.c and contains the directory where MOM is (will be) installed. Pbs_rcp, as in normal rcp, must be installed "setuid" and owned by root. torque-2.4.16/src/mom_rcp/pathnames.h0000664000113300011330000000365011272401237014413 00000000000000/* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ #define _PATH_CP "/bin/cp" #define _PATH_BSHELL "/bin/sh" #define _PATH_RSH "rsh" torque-2.4.16/src/mom_rcp/util.c0000664000113300011330000001030011272401237013371 00000000000000/*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char const sccsid[] = "@(#)util.c 8.2 (Berkeley) 4/2/94"; #endif /* not lint */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_ERR_H #include #endif #include "extern.h" #include "pathnames.h" static char const ident[] = "@(#) $RCSfile$ $Revision: 3006 $"; char * colon(char *cp) { if (*cp == ':') /* Leading colon is part of file name. */ return (0); for (; *cp; ++cp) { if (*cp == ':') return (cp); if (*cp == '/') return (0); } return (0); } void verifydir(char *cp) { struct stat stb; if (!stat(cp, &stb)) { if (S_ISDIR(stb.st_mode)) return; errno = ENOTDIR; } run_err("%s: %s", cp, strerror(errno)); exit(1); } int okname(char *cp0) { int c; char *cp; cp = cp0; do { c = *cp; if (c & 0200) goto bad; if (!isalpha(c) && !isdigit(c) && c != '_' && c != '-') goto bad; } while (*++cp); return (1); bad: warnx("%s: invalid user name", cp0); return (0); } int susystem(char *s, int userid) { int status; pid_t pid; pid = fork(); switch (pid) { case - 1: return (127); case 0: if (setuid(userid) != 0) { run_err("setuid(%ld): %s", (long)userid, strerror(errno)); return (127); } execl(_PATH_BSHELL, "sh", "-c", s, NULL); _exit(127); } if (waitpid(pid, &status, 0) < 0) status = -1; return (status); } BUF *allocbuf( BUF *bp, int fd, int blksize) { struct stat stb; size_t size; void *tmpP; if (fstat(fd, &stb) < 0) { run_err("fstat: %s", strerror(errno)); return (0); } size = (((int)stb.st_blksize + blksize - 1) / blksize) * blksize; if (size == 0) size = blksize; if (bp->cnt >= (int)size) { return(bp); } if (bp->buf != NULL) tmpP = realloc(bp->buf,size); else tmpP = malloc(size); if (tmpP == NULL) { bp->cnt = 0; run_err("%s",strerror(errno)); return(0); } bp->buf = tmpP; bp->cnt = size; return (bp); } void lostconn( int signo) { if (!iamremote) warnx("lost connection"); exit(1); } torque-2.4.16/src/mom_rcp/replace.c0000664000113300011330000000231111272401237014032 00000000000000/* * This file contains homebrewed PBS replacements for * library functions found on BSD 4.4-Lite. * * NOTE: the strange set of "if define..." results from Sun not having * stdarg.h, at least on SunOS 4.x */ #include /* the master config generated by configure */ #include #include #include #if defined(__STDC__) && !defined(__TSUNOS4) #include #else #include #endif #if defined(__STDC__) && !defined(__TSUNOS4) void errx(int err, const char *fmt, ...) #else void errx(err, fmt, va_alist) int err; char *fmt; va_dcl #endif { va_list ap; #if defined(__STDC__) && !defined(__TSUNOS4) va_start(ap, fmt); #else va_start(ap); #endif (void)vfprintf(stderr, fmt, ap); exit(err); } #if defined(__STDC__) && !defined(__TSUNOS4) void warnx(const char *fmt, ...) #else void warnx(fmt, va_alist) char *fmt; va_dcl #endif { va_list ap; #if defined(__STDC__) && !defined(__TSUNOS4) va_start(ap, fmt); #else va_start(ap); #endif vfprintf(stderr, fmt, ap); return; } void err( int val, char *str) { if (str != NULL) { fprintf(stderr, "%s\n", str); } exit(val); } /* END err() */ torque-2.4.16/src/mom_rcp/Makefile.am0000664000113300011330000000037011272401237014312 00000000000000include $(top_srcdir)/buildutils/config.mk sbin_PROGRAMS = pbs_rcp pbs_rcp_SOURCES = rcp.c replace.c util.c extern.h pathnames.h EXTRA_DIST = ReadMe install-exec-hook: chmod u+s $(DESTDIR)$(sbindir)/$(program_prefix)pbs_rcp$(program_suffix) torque-2.4.16/src/scheduler.cc/0000777000113300011330000000000011614035174013251 500000000000000torque-2.4.16/src/scheduler.cc/get_4byte.c0000664000113300011330000001203311272401242015211 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #if defined(NTOHL_NEEDS_ARPA_INET_H) && defined(HAVE_ARPA_INET_H) #include #endif /* FIXME: needs to move to a header file */ #ifndef NEED_BLOCKING_CONNECTIONS extern ssize_t read_nonblocking_socket(int, void *, ssize_t); #endif /* * get_4byte() - read and return a 4 byte integer from the network * sock: socket to read from * val: Return integer from socket * * Returns: the (unsigned int) integer in *val * the function return is * 0 for EOF, * +1 for sucess, or * -1 if error. */ int get_4byte( int sock, unsigned int *val) { int amt; union { int unl; char unc[sizeof(unsigned int)]; } un; un.unl = 0; amt = read(sock, (char *)(un.unc + sizeof(unsigned int) - 4), 4); if (amt == 4) { *val = ntohl(un.unl); return(1); } if (amt == 0) { return(0); } /* FAILURE */ return(-1); } torque-2.4.16/src/scheduler.cc/Makefile.in0000664000113300011330000005652311605403761015250 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(pbs_sched_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk sbin_PROGRAMS = pbs_sched$(EXEEXT) subdir = src/scheduler.cc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_pbs_sched_OBJECTS = pbs_sched.$(OBJEXT) get_4byte.$(OBJEXT) pbs_sched_OBJECTS = $(am_pbs_sched_OBJECTS) am__DEPENDENCIES_1 = ../lib/Libpbs/libtorque.la pbs_sched_DEPENDENCIES = samples/@SCHD_CODE@/libfoo.la \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(pbs_sched_SOURCES) DIST_SOURCES = $(pbs_sched_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter SUBDIRS = samples PBS_LIBS = ../lib/Libpbs/libtorque.la pbs_sched_LDADD = samples/@SCHD_CODE@/libfoo.la $(PBS_LIBS) AM_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" -DPBS_ENVIRON=\"$(PBS_ENVIRON)\" pbs_sched_SOURCES = pbs_sched.c get_4byte.c all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scheduler.cc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scheduler.cc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done pbs_sched$(EXEEXT): $(pbs_sched_OBJECTS) $(pbs_sched_DEPENDENCIES) @rm -f pbs_sched$(EXEEXT) $(LINK) $(pbs_sched_LDFLAGS) $(pbs_sched_OBJECTS) $(pbs_sched_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_4byte.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbs_sched.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive \ clean-sbinPROGRAMS ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-exec-hook \ install-info install-info-am install-man install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-hook uninstall-info-am uninstall-sbinPROGRAMS install-exec-hook: rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbs_sched$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qschedd$(program_suffix)$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/scheduler.cc/pbs_sched.c0000664000113300011330000006356311272401242015273 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #if (PLOCK_DAEMONS & 2) #include #endif /* PLOCK_DAEMONS */ #include "libpbs.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(FD_SET_IN_SYS_SELECT_H) # include #endif #ifdef _CRAY #include #endif /* _CRAY */ #include #include "portability.h" #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "resmon.h" #include "sched_cmds.h" #include "server_limits.h" #include "net_connect.h" #include "rpp.h" #include "rm.h" #include "libpbs.h" extern int pbs_errno; int connector; int server_sock; #define START_CLIENTS 2 /* minimum number of clients */ pbs_net_t *okclients = NULL; /* accept connections from */ int numclients = 0; /* the number of clients */ pbs_net_t *maskclient = NULL; /* wildcard connections */ int mask_num = 0; char *configfile = NULL; /* name of config file */ char *oldpath; extern char *msg_daemonname; char **glob_argv; char usage[] = "[-S port][-d home][-p output][-c config][-a alarm]"; struct sockaddr_in saddr; sigset_t allsigs; int alarm_time; static char *logfile = (char *)0; static char path_log[_POSIX_PATH_MAX]; char path_acct[_POSIX_PATH_MAX]; int pbs_rm_port; int schedreq(); extern int get_4byte(int, unsigned int *); /* ** Clean up after a signal. */ void die( int sig) { char *id = "die"; if (sig > 0) { sprintf(log_buffer, "caught signal %d", sig); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "abnormal termination"); } log_close(1); exit(1); } /* END die() */ /* * Catch core dump signals - set core size so we can see what happened! * * Chris Samuel - VPAC * csamuel@vpac.org - 29th July 2003 */ static void catch_abort( int sig) { struct rlimit rlimit; struct sigaction act; /* * Reset ourselves to the default signal handler to try and * prevent recursive core dumps. */ sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_DFL; sigaction(SIGSEGV, &act, NULL); sigaction(SIGBUS, &act, NULL); sigaction(SIGFPE, &act, NULL); sigaction(SIGILL, &act, NULL); sigaction(SIGTRAP, &act, NULL); sigaction(SIGSYS, &act, NULL); log_err(sig, "pbs_sched", "Caught fatal core signal"); rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CORE, &rlimit); abort(); return; } /* END catch_abort() */ static int server_disconnect( int connect) { close(connection[connect].ch_socket); if (connection[connect].ch_errtxt != (char *)NULL) free(connection[connect].ch_errtxt); connection[connect].ch_errno = 0; connection[connect].ch_inuse = 0; return(0); } /* END server_disconnect() */ /* ** Got an alarm call. */ void toolong( int sig) { char *id = "toolong"; struct stat sb; pid_t cpid; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "scheduling iteration took too long"); DBPRT(("scheduling iteration too long\n")) if (connector >= 0 && server_disconnect(connector)) log_err(errno, id, "server_disconnect"); if (close(server_sock)) log_err(errno, id, "close"); if ((cpid = fork()) > 0) /* parent re-execs itself */ { rpp_terminate(); #ifndef linux sleep(5); #endif /* hopefully, that gave the child enough */ /* time to do its business. anyhow: */ (void)waitpid(cpid, NULL, 0); if (chdir(oldpath) == -1) { sprintf(log_buffer, "chdir to %s", oldpath); log_err(errno, id, log_buffer); } sprintf(log_buffer, "restart dir %s object %s", oldpath, glob_argv[0]); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); execv(glob_argv[0], glob_argv); log_err(errno, id, "execv"); exit(3); } /* ** Child (or error on fork) gets here and tried ** to dump core. */ if (stat("core", &sb) == -1) { if (errno == ENOENT) { log_close(1); abort(); rpp_terminate(); exit(2); /* not reached (hopefully) */ } log_err(errno, id, "stat"); } log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "exiting without core dump"); log_close(1); rpp_terminate(); exit(0); } /* sock refers to an opened socket */ int socket_to_conn(int sock) { int i; for (i = 0; i < NCONNECTS; i++) { if (connection[i].ch_inuse == 0) { connection[i].ch_inuse = 1; connection[i].ch_errno = 0; connection[i].ch_socket = sock; connection[i].ch_errtxt = NULL; return (i); } } pbs_errno = PBSE_NOCONNECTS; return (-1); } int restricted( char *name) { static char id[] = "restricted"; struct hostent *host; struct in_addr saddr; pbs_net_t *newclients; if ((host = gethostbyname(name)) == NULL) { sprintf(log_buffer, "host %s not found", name); log_err(-1, id, log_buffer); return(-1); } if (mask_num > 0) { newclients = realloc(maskclient, sizeof(pbs_net_t) * (mask_num + 1)); } else { newclients = malloc(sizeof(pbs_net_t)); } if (newclients == NULL) { return(-1); } maskclient = newclients; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, name); memcpy((char *)&saddr, host->h_addr, host->h_length); maskclient[mask_num++] = saddr.s_addr; return(0); } int addclient( char *name) { static char id[] = "addclient"; struct hostent *host; struct in_addr saddr; if ((host = gethostbyname(name)) == NULL) { sprintf(log_buffer, "host %s not found", name); log_err(-1, id, log_buffer); return(-1); } if (numclients >= START_CLIENTS) { pbs_net_t *newclients; newclients = realloc(okclients, sizeof(pbs_net_t) * (numclients + 1)); if (newclients == NULL) return -1; okclients = newclients; } memcpy((char *)&saddr, host->h_addr, host->h_length); okclients[numclients++] = saddr.s_addr; return 0; } /* * read_config - read and process the configuration file (see -c option) * * Currently, the parameters are $clienthost - specify which systems can contact the scheduler $restricted - specify which systems can provide rm services on non-privileged ports */ #define CONF_LINE_LEN 120 static int read_config( char *file) { static char *id = "read_config"; FILE *conf; int i; char line[CONF_LINE_LEN]; char *token; struct specialconfig { char *name; int (*handler)(); } special[] = { {"clienthost", addclient }, {"restricted", restricted }, { NULL, NULL } }; #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) if (chk_file_sec(file, 0, 0, S_IWGRP | S_IWOTH, 1, NULL)) { return(-1); } #endif free(maskclient); mask_num = 0; if ((conf = fopen(file, "r")) == NULL) { log_err(errno, id, "cannot open config file"); return(-1); } while (fgets(line, CONF_LINE_LEN, conf)) { if ((line[0] == '#') || (line[0] == '\n')) continue; /* ignore comment & null line */ else if (line[0] == '$') /* special */ { if ((token = strtok(line, " \t")) == NULL) token = ""; for (i = 0; special[i].name; i++) { if (strcmp(token + 1, special[i].name) == 0) break; } if (special[i].name == NULL) { sprintf(log_buffer, "config name %s not known", token); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); continue; } token = strtok(NULL, " \t"); if (*(token + strlen(token) - 1) == '\n') *(token + strlen(token) - 1) = '\0'; if (special[i].handler(token)) { fclose(conf); return (-1); } } else { log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, "invalid line in config file"); fclose(conf); return (-1); } } fclose(conf); return (0); } void restart(int sig) { char *id = "restart"; if (sig) { log_close(1); log_open(logfile, path_log); sprintf(log_buffer, "restart on signal %d", sig); } else { sprintf(log_buffer, "restart command"); } log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); if (configfile) { if (read_config(configfile) != 0) die(0); } } void badconn(char *msg) { static char id[] = "badconn"; struct in_addr addr; char buf[5*sizeof(addr) + 100]; struct hostent *phe; addr = saddr.sin_addr; phe = gethostbyaddr((void *) & addr, sizeof(addr), AF_INET); if (phe == NULL) { char hold[6]; int i; union { struct in_addr aa; u_char bb[sizeof(addr)]; } uu; uu.aa = addr; sprintf(buf, "%u", uu.bb[0]); for (i = 1; i < (int)sizeof(addr); i++) { sprintf(hold, ".%u", uu.bb[i]); strcat(buf, hold); } } else { strncpy(buf, phe->h_name, sizeof(buf)); buf[sizeof(buf)-1] = '\0'; } sprintf(log_buffer, "%s on port %u %s", buf, ntohs(saddr.sin_port), msg); log_err(-1, id, log_buffer); return; } int server_command(void) { char *id = "server_command"; int new_socket; torque_socklen_t slen; int i; unsigned int cmd; pbs_net_t addr; slen = sizeof(saddr); new_socket = accept(server_sock, (struct sockaddr *) & saddr, &slen); if (new_socket == -1) { log_err(errno, id, "accept"); return(SCH_ERROR); } addr = (pbs_net_t)saddr.sin_addr.s_addr; if (ntohs(saddr.sin_port) >= IPPORT_RESERVED) { for (i = 0;i < mask_num;i++) { if (addr == maskclient[i]) break; } if (i == mask_num) { badconn("non-reserved port"); close(new_socket); return(SCH_ERROR); } } else { for (i = 0;i < numclients;i++) { if (addr == okclients[i]) break; } if (i == numclients) { badconn("unauthorized host"); close(new_socket); return(SCH_ERROR); } } if ((connector = socket_to_conn(new_socket)) < 0) { log_err(errno, id, "socket_to_conn"); return(SCH_ERROR); } if (get_4byte(new_socket, &cmd) != 1) { log_err(errno, id, "get4bytes"); return(SCH_ERROR); } return((int)cmd); } /* * lock_out - lock out other daemons from this directory. * * op is either F_WRLCK or F_UNLCK */ static void lock_out(int fds, int op) { struct flock flock; flock.l_type = op; flock.l_whence = SEEK_SET; flock.l_start = 0; flock.l_len = 0; /* whole file */ if (fcntl(fds, F_SETLK, &flock) < 0) { (void)strcpy(log_buffer, "pbs_sched: another scheduler running\n"); log_err(errno, msg_daemonname, log_buffer); fprintf(stderr, "%s", log_buffer); exit(1); } } int main( int argc, char *argv[]) { char *id = "main"; struct hostent *hp; int go, c, errflg = 0; int lockfds; int t = 1; pid_t pid; char host[100]; char *homedir = PBS_SERVER_HOME; unsigned int port; char *dbfile = "sched_out"; struct sigaction act; sigset_t oldsigs; caddr_t curr_brk = 0; caddr_t next_brk; extern char *optarg; extern int optind, opterr; extern int rpp_fd; fd_set fdset; int schedinit A_((int argc, char **argv)); int schedule A_((int com, int connector)); glob_argv = argv; alarm_time = 180; /* The following is code to reduce security risks */ /* move this to a place where nss_ldap doesn't hold a socket yet */ c = sysconf(_SC_OPEN_MAX); while (--c > 2) (void)close(c); /* close any file desc left open by parent */ port = get_svrport(PBS_SCHEDULER_SERVICE_NAME, "tcp", PBS_SCHEDULER_SERVICE_PORT); pbs_rm_port = get_svrport(PBS_MANAGER_SERVICE_NAME, "tcp", PBS_MANAGER_SERVICE_PORT); strcpy(pbs_current_user, "Scheduler"); msg_daemonname = strdup("pbs_sched"); opterr = 0; while ((c = getopt(argc, argv, "L:S:R:d:p:c:a:-:")) != EOF) { switch (c) { case '-': if ((optarg == NULL) || (optarg[0] == '\0')) { errflg = 1; } if (!strcmp(optarg, "version")) { fprintf(stderr, "version: %s\n", PACKAGE_VERSION); exit(0); } else { errflg = 1; } break; case 'L': logfile = optarg; break; case 'S': port = atoi(optarg); if (port == 0) { fprintf(stderr, "%s: illegal port\n", optarg); errflg = 1; } break; case 'R': if ((pbs_rm_port = atoi(optarg)) == 0) { (void)fprintf(stderr, "%s: bad -R %s\n", argv[0], optarg); return 1; } break; case 'd': homedir = optarg; break; case 'p': dbfile = optarg; break; case 'c': configfile = optarg; break; case 'a': alarm_time = atoi(optarg); if (alarm_time == 0) { fprintf(stderr, "%s: bad alarm time\n", optarg); errflg = 1; } break; case '?': errflg = 1; break; } } if (errflg) { fprintf(stderr, "usage: %s %s\n", argv[0], usage); exit(1); } #ifndef DEBUG if ((geteuid() != 0) || (getuid() != 0)) { fprintf(stderr, "%s: Must be run by root\n", argv[0]); return (1); } #endif /* DEBUG */ /* Save the original working directory for "restart" */ if ((oldpath = getcwd((char *)NULL, MAXPATHLEN)) == NULL) { fprintf(stderr, "cannot get current working directory\n"); exit(1); } (void)sprintf(log_buffer, "%s/sched_priv", homedir); #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) c = chk_file_sec(log_buffer, 1, 0, S_IWGRP | S_IWOTH, 1, NULL); c |= chk_file_sec(PBS_ENVIRON, 0, 0, S_IWGRP | S_IWOTH, 0, NULL); if (c != 0) exit(1); #endif /* not DEBUG and not NO_SECURITY_CHECK */ if (chdir(log_buffer) == -1) { perror("chdir"); exit(1); } (void)sprintf(path_log, "%s/sched_logs", homedir); (void)sprintf(path_acct, "%s/%s", log_buffer, PBS_ACCT); /* The following is code to reduce security risks */ /* start out with standard umask, system resource limit infinite */ umask(022); if (setup_env(PBS_ENVIRON) == -1) exit(1); c = getgid(); (void)setgroups(1, (gid_t *)&c); /* secure suppl. groups */ #ifndef DEBUG #ifdef _CRAY (void)limit(C_JOB, 0, L_CPROC, 0); (void)limit(C_JOB, 0, L_CPU, 0); (void)limit(C_JOBPROCS, 0, L_CPU, 0); (void)limit(C_PROC, 0, L_FD, 255); (void)limit(C_JOB, 0, L_FSBLK, 0); (void)limit(C_JOBPROCS, 0, L_FSBLK, 0); (void)limit(C_JOB, 0, L_MEM , 0); (void)limit(C_JOBPROCS, 0, L_MEM , 0); #else /* not _CRAY */ { struct rlimit rlimit; rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; (void)setrlimit(RLIMIT_CPU, &rlimit); (void)setrlimit(RLIMIT_FSIZE, &rlimit); (void)setrlimit(RLIMIT_DATA, &rlimit); (void)setrlimit(RLIMIT_STACK, &rlimit); #ifdef RLIMIT_RSS (void)setrlimit(RLIMIT_RSS , &rlimit); #endif /* RLIMIT_RSS */ #ifdef RLIMIT_VMEM (void)setrlimit(RLIMIT_VMEM , &rlimit); #endif /* RLIMIT_VMEM */ } #endif /* not _CRAY */ #endif /* DEBUG */ if (log_open(logfile, path_log) == -1) { fprintf(stderr, "%s: logfile could not be opened\n", argv[0]); exit(1); } if (gethostname(host, sizeof(host)) == -1) { log_err(errno, id, "gethostname"); die(0); } if ((hp = gethostbyname(host)) == NULL) { log_err(errno, id, "gethostbyname"); die(0); } if ((server_sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { log_err(errno, id, "socket"); die(0); } if (setsockopt(server_sock, SOL_SOCKET, SO_REUSEADDR, (char *)&t, sizeof(t)) == -1) { log_err(errno, id, "setsockopt"); die(0); } saddr.sin_family = AF_INET; saddr.sin_port = htons(port); memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); if (bind(server_sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) { log_err(errno, id, "bind"); die(0); } if (listen(server_sock, 5) < 0) { log_err(errno, id, "listen"); die(0); } okclients = (pbs_net_t *)calloc(START_CLIENTS, sizeof(pbs_net_t)); addclient("localhost"); /* who has permission to call MOM */ addclient(host); if (configfile) { if (read_config(configfile) != 0) die(0); } lockfds = open("sched.lock", O_CREAT | O_TRUNC | O_WRONLY, 0644); if (lockfds < 0) { log_err(errno, id, "open lock file"); exit(1); } lock_out(lockfds, F_WRLCK); fullresp(0); if (sigemptyset(&allsigs) == -1) { perror("sigemptyset"); exit(1); } if (sigprocmask(SIG_SETMASK, &allsigs, NULL) == -1) /* unblock */ { perror("sigprocmask"); exit(1); } act.sa_flags = 0; sigaddset(&allsigs, SIGHUP); /* remember to block these */ sigaddset(&allsigs, SIGINT); /* during critical sections */ sigaddset(&allsigs, SIGTERM); /* so we don't get confused */ act.sa_mask = allsigs; act.sa_handler = restart; /* do a restart on SIGHUP */ sigaction(SIGHUP, &act, NULL); act.sa_handler = toolong; /* handle an alarm call */ sigaction(SIGALRM, &act, NULL); act.sa_handler = die; /* bite the biscuit for all following */ sigaction(SIGINT, &act, NULL); sigaction(SIGTERM, &act, NULL); /* * Catch these signals to ensure we core dump even if * our rlimit for core dumps is set to 0 initially. * * Chris Samuel - VPAC * csamuel@vpac.org - 29th July 2003 * * Now conditional on the PBSCOREDUMP environment variable */ if (getenv("PBSCOREDUMP")) { act.sa_handler = catch_abort; /* make sure we core dump */ sigaction(SIGSEGV, &act, NULL); sigaction(SIGBUS, &act, NULL); sigaction(SIGFPE, &act, NULL); sigaction(SIGILL, &act, NULL); sigaction(SIGTRAP, &act, NULL); sigaction(SIGSYS, &act, NULL); } /* * Local initialization stuff */ if (schedinit(argc, argv)) { (void) sprintf(log_buffer, "local initialization failed, terminating"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); exit(1); } if (getenv("PBSDEBUG") == NULL) { lock_out(lockfds, F_UNLCK); if ((pid = fork()) == -1) { /* error on fork */ perror("fork"); exit(1); } else if (pid > 0) /* parent exits */ { exit(0); } if ((pid = setsid()) == -1) { perror("setsid"); exit(1); } lock_out(lockfds, F_WRLCK); if (freopen(dbfile, "a", stdout) == NULL) { perror("opening lockfile"); exit(1); } setvbuf(stdout, NULL, _IOLBF, 0); dup2(fileno(stdout), fileno(stderr)); } else { setvbuf(stdout, NULL, _IOLBF, 0); setvbuf(stderr, NULL, _IOLBF, 0); pid = getpid(); } if (freopen("/dev/null", "r", stdin) == NULL) { perror("opening /dev/null"); exit(1); } /* write scheduler's pid into lockfile */ (void)sprintf(log_buffer, "%ld\n", (long)pid); if (write(lockfds, log_buffer, strlen(log_buffer) + 1) != (ssize_t)(strlen(log_buffer) + 1)) { perror("writing to lockfile"); exit(1); } #if (PLOCK_DAEMONS & 2) (void)plock(PROCLOCK); /* lock daemon into memory */ #endif sprintf(log_buffer, "%s startup pid %ld", argv[0], (long)pid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); FD_ZERO(&fdset); for (go = 1;go;) { int cmd; if (rpp_fd != -1) FD_SET(rpp_fd, &fdset); FD_SET(server_sock, &fdset); if (select(FD_SETSIZE, &fdset, NULL, NULL, NULL) == -1) { if (errno != EINTR) { log_err(errno, id, "select"); die(0); } continue; } if (rpp_fd != -1 && FD_ISSET(rpp_fd, &fdset)) { if (rpp_io() == -1) log_err(errno, id, "rpp_io"); } if (!FD_ISSET(server_sock, &fdset)) continue; cmd = server_command(); if (sigprocmask(SIG_BLOCK, &allsigs, &oldsigs) == -1) log_err(errno, id, "sigprocmaskSIG_BLOCK)"); alarm(alarm_time); if (schedule(cmd, connector)) /* magic happens here */ go = 0; alarm(0); if (connector >= 0 && server_disconnect(connector)) { log_err(errno, id, "server_disconnect"); die(0); } next_brk = (caddr_t)sbrk(0); if (next_brk > curr_brk) { sprintf(log_buffer, "brk point %ld", (long)next_brk); log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, id, log_buffer); curr_brk = next_brk; } if (sigprocmask(SIG_SETMASK, &oldsigs, NULL) == -1) log_err(errno, id, "sigprocmask(SIG_SETMASK)"); } sprintf(log_buffer, "%s normal finish pid %ld", argv[0], (long)pid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); close(server_sock); exit(0); } /* END main() */ torque-2.4.16/src/scheduler.cc/samples/0000777000113300011330000000000011614035176014717 500000000000000torque-2.4.16/src/scheduler.cc/samples/cray_t3e/0000777000113300011330000000000011614035174016426 500000000000000torque-2.4.16/src/scheduler.cc/samples/cray_t3e/getqueues.c0000664000113300011330000006560511272401241020523 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: getqueues.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" extern int connector; static int queue_claim_jobs(Queue *queue, Job **joblist_ptr); static int queue_sanity(Queue *queue); /* * schd_get_queue_limits - query queue information from the server. * * Returns 0 on success, -1 for "fatal errors", and 1 for a transient * error (i.e., the queue failed the sanity checks imposed by the * queue_sanity() function). */ int schd_get_queue_limits(Queue *queue) { char *id = "schd_get_queue_limits"; int moved = 0, istrue; Batch_Status *bs; AttrList *attr; static AttrList alist[] = { {&alist[1], ATTR_start, "", ""}, {&alist[2], ATTR_enable, "", ""}, {&alist[3], ATTR_count, "", ""}, {&alist[4], ATTR_maxuserrun, "", ""}, {&alist[5], ATTR_rescavail, "", ""}, {&alist[6], ATTR_rescassn, "", ""}, {&alist[7], ATTR_rescdflt, "", ""}, {&alist[8], ATTR_rescmax, "", ""}, {&alist[9], ATTR_rescmin, "", ""}, {&alist[10], ATTR_acluren, "", ""}, {&alist[11], ATTR_acluser, "", ""}, {NULL, ATTR_maxrun, "", ""} }; size_t mem_default = UNSPECIFIED; size_t mem_assn = UNSPECIFIED; size_t mem_max = UNSPECIFIED; size_t mem_min = UNSPECIFIED; int cpu_default = UNSPECIFIED; int cpu_assn = UNSPECIFIED; int cpu_max = UNSPECIFIED; int cpu_min = UNSPECIFIED; int mppe_default = UNSPECIFIED; int mppe_assn = UNSPECIFIED; int mppe_max = UNSPECIFIED; int mppe_min = UNSPECIFIED; int nodes_from_cpu, nodes_from_mem; queue->running = UNSPECIFIED; queue->queued = UNSPECIFIED; queue->maxrun = UNSPECIFIED; queue->userrun = UNSPECIFIED; queue->nodes_max = UNSPECIFIED; queue->nodes_min = UNSPECIFIED; queue->nodes_default = UNSPECIFIED; queue->nodes_assn = UNSPECIFIED; queue->nodes_rsvd = UNSPECIFIED; queue->wallt_max = UNSPECIFIED; queue->wallt_min = UNSPECIFIED; queue->wallt_default = UNSPECIFIED; queue->flags = 0; queue->rsrcs = NULL; if (queue->jobs) { DBPRT(("%s: found jobs on queue '%s'! Freeing them...\n", id, queue->qname)); schd_free_jobs(queue->jobs); } if (queue->useracl) { DBPRT(("%s: found user ACL list on queue '%s'! Freeing it...\n", id, queue->qname)); schd_free_useracl(queue->useracl); } queue->jobs = NULL; queue->useracl = NULL; /* Ask the server for information about the specified queue. */ if ((bs = pbs_statque(connector, queue->qname, alist, NULL)) == NULL) { sprintf(log_buffer, "pbs_statque failed, \"%s\" %d", queue->qname, pbs_errno); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } /* Process the list of attributes returned by the server. */ for (attr = bs->attribs; attr != NULL; attr = attr->next) { /* Is queue started? */ if (!strcmp(attr->name, ATTR_start)) { if (schd_val2bool(attr->value, &istrue) == 0) { if (istrue) /* if true, queue is not stopped. */ queue->flags &= ~QFLAGS_STOPPED; else queue->flags |= QFLAGS_STOPPED; } else { DBPRT(("%s: couldn't parse attr %s value %s to boolean\n", id, attr->name, attr->value)); } continue; } /* Is queue enabled? */ if (!strcmp(attr->name, ATTR_enable)) { if (schd_val2bool(attr->value, &istrue) == 0) { if (istrue) /* if true, queue is not disabled. */ queue->flags &= ~QFLAGS_DISABLED; else queue->flags |= QFLAGS_DISABLED; } else { DBPRT(("%s: couldn't parse attr %s value %s to boolean\n", id, attr->name, attr->value)); } continue; } /* How many jobs are queued and running? */ if (!strcmp(attr->name, ATTR_count)) { queue->queued = schd_how_many(attr->value, SC_QUEUED); queue->running = schd_how_many(attr->value, SC_RUNNING); continue; } /* Queue-wide maximum number of jobs running. */ if (!strcmp(attr->name, ATTR_maxrun)) { queue->maxrun = atoi(attr->value); continue; } /* Per-user maximum number of jobs running. */ if (!strcmp(attr->name, ATTR_maxuserrun)) { queue->userrun = atoi(attr->value); continue; } /* Is there an enabled user access control list on this queue? */ if (!strcmp(attr->name, ATTR_acluren)) { if (schd_val2bool(attr->value, &istrue) == 0) { if (istrue) /* if true, queue has an ACL */ queue->flags |= QFLAGS_USER_ACL; else queue->flags &= ~QFLAGS_USER_ACL; } else { DBPRT(("%s: couldn't parse attr %s value %s to boolean\n", id, attr->name, attr->value)); } continue; } if (!strcmp(attr->name, ATTR_acluser)) { if (queue->useracl) { DBPRT(("queue %s acluser already set!\n", queue->qname)); schd_free_useracl(queue->useracl); } queue->useracl = schd_create_useracl(attr->value); continue; } /* Queue maximum resource usage. */ if (!strcmp(attr->name, ATTR_rescmax)) { if (!strcmp("mem", attr->resource)) { mem_max = schd_val2byte(attr->value); continue; } if (!strcmp("ncpus", attr->resource)) { cpu_max = atoi(attr->value); continue; } if (!strcmp("mppe", attr->resource)) { mppe_max = atoi(attr->value); continue; } if (!strcmp("walltime", attr->resource)) { queue->wallt_max = schd_val2sec(attr->value); continue; } continue; } /* Queue minimum resource usage. */ if (!strcmp(attr->name, ATTR_rescmin)) { if (!strcmp("mem", attr->resource)) { mem_min = schd_val2byte(attr->value); continue; } if (!strcmp("ncpus", attr->resource)) { cpu_min = atoi(attr->value); continue; } if (!strcmp("mppe", attr->resource)) { mppe_min = atoi(attr->value); continue; } if (!strcmp("walltime", attr->resource)) { queue->wallt_min = schd_val2sec(attr->value); continue; } continue; } /* Queue assigned (in use) resource usage. */ if (!strcmp(attr->name, ATTR_rescassn)) { if (!strcmp("mem", attr->resource)) { mem_assn = schd_val2byte(attr->value); continue; } if (!strcmp("ncpus", attr->resource)) { cpu_assn = atoi(attr->value); } continue; } if (!strcmp(attr->name, ATTR_rescdflt)) { if (!strcmp("mem", attr->resource)) { mem_default = schd_val2byte(attr->value); continue; } if (!strcmp("ncpus", attr->resource)) { cpu_default = atoi(attr->value); continue; } if (!strcmp("mppe", attr->resource)) { mppe_default = atoi(attr->value); continue; } if (!strcmp("walltime", attr->resource)) queue->wallt_default = schd_val2sec(attr->value); } /* Ignore anything else */ } pbs_statfree(bs); #if defined(sgi) /* * Calculate values for queue node limits, given memory and cpu values. * Note any discrepancies. */ nodes_from_cpu = NODES_FROM_CPU(cpu_default); nodes_from_mem = NODES_FROM_MEM(mem_default); if (nodes_from_cpu != nodes_from_mem) { sprintf(log_buffer, "%s: Queue '%s' default cpu/mem (%d/%s) convert to %d != %d nodes", id, queue->qname, cpu_default, schd_byte2val(mem_default), nodes_from_cpu, nodes_from_mem); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } nodes_from_cpu = NODES_FROM_CPU(cpu_max); nodes_from_mem = NODES_FROM_MEM(mem_max); if (nodes_from_cpu != nodes_from_mem) { sprintf(log_buffer, "%s: Queue '%s' maximum cpu/mem (%d/%s) convert to %d != %d nodes", id, queue->qname, cpu_max, schd_byte2val(mem_max), nodes_from_cpu, nodes_from_mem); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } nodes_from_cpu = NODES_FROM_CPU(cpu_min); nodes_from_mem = NODES_FROM_MEM(mem_min); if (nodes_from_cpu != nodes_from_mem) { sprintf(log_buffer, "%s: Queue '%s' minimum cpu/mem (%d/%s) convert to %d != %d nodes", id, queue->qname, cpu_min, schd_byte2val(mem_min), nodes_from_cpu, nodes_from_mem); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } /* * Note: The assigned cpus and memory need not be exactly the same * node equivalency. */ if ((cpu_default != UNSPECIFIED) && (mem_default != UNSPECIFIED)) queue->nodes_default = NODES_REQD(cpu_default, mem_default); if ((cpu_max != UNSPECIFIED) && (mem_max != UNSPECIFIED)) queue->nodes_max = NODES_REQD(cpu_max, mem_max); if ((cpu_min != UNSPECIFIED) && (mem_min != UNSPECIFIED)) queue->nodes_min = NODES_REQD(cpu_min, mem_min); if ((cpu_assn != UNSPECIFIED) && (mem_assn != UNSPECIFIED)) queue->nodes_assn = NODES_REQD(cpu_assn, mem_assn); #endif /* defined(sgi) */ /* * Move any jobs on this queue from the global list onto the queue's * list. Keep track of when the longest-running job will end, and set * the 'empty_by' field to that value. Maintain the ordering as it was * in "schd_AllJobs". */ if (schd_AllJobs) moved = queue_claim_jobs(queue, &schd_AllJobs); if (moved < 0) { sprintf(log_buffer, "%s: WARNING! Queue '%s' failed to claim jobs.", id, queue->qname); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } if (queue->nodes_assn == UNSPECIFIED) queue->nodes_assn = 0; if (queue->running == UNSPECIFIED) queue->running = 0; /* * Find out if the queue is idle, and if it was not before, set the idle * time to now. If there are running jobs, the queue is not idle at the * start of this iteration - set idle_since to 0. */ if (queue->running) { queue->idle_since = 0; } else { if (queue->idle_since == 0) queue->idle_since = schd_TimeNow; } /* * Get the resources for this queue from the resource monitor (if * available). If the resmom is not accessible, disable the queue. * If the resources were received okay, compute the available node * masks from the resources and jobs. * Don't bother with resources for the submit queue. */ if (strcmp(queue->qname, schd_SubmitQueue->queue->qname) != 0) { queue->rsrcs = schd_get_resources(queue->exechost); if (queue->rsrcs != NULL) { /* Account for this queue's resources. */ queue->rsrcs->nodes_alloc += queue->nodes_assn; queue->rsrcs->njobs += queue->running; } else { (void)sprintf(log_buffer, "Can't get resources for %s@%s - marking unavailable.", queue->qname, queue->exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); queue->flags |= QFLAGS_DISABLED; } } #ifdef DEBUG schd_dump_queue(queue, QUEUE_DUMP_JOBS); #endif /* DEBUG */ /* * It would probably be better to wait for the world to stabilize * than to try to impose some artificial order upon it. Do not do * the sanity check if the queue is stopped. */ if ((queue->flags & QFLAGS_STOPPED) == 0) { if (!queue_sanity(queue)) { sprintf(log_buffer, "WARNING! Queue '%s' failed sanity checks.", queue->qname); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (1); } } return (0); } #ifdef DEBUG void schd_dump_queue(Queue *queue, int dumpjobs) { Job *job; UserAcl *aclent; char num[32]; char *ptr; int columns; DBPRT(("\nQueue '%s@%s': %sabled/%sed", queue->qname, queue->exechost, (queue->flags & QFLAGS_DISABLED) ? "Dis" : "En", (queue->flags & QFLAGS_STOPPED) ? "Stopp" : "Start")); DBPRT(("%s%s%s%s ", (queue->flags & QFLAGS_FULL) ? "/Full" : "", (queue->flags & QFLAGS_MAXRUN) ? "/MaxRun" : "", (queue->flags & QFLAGS_DRAINING) ? "/Drain" : "", (queue->flags & QFLAGS_USER_ACL) ? "/ACL" : "")); if (schd_ENFORCE_PRIME_TIME && schd_TimeNow >= schd_ENFORCE_PRIME_TIME) DBPRT(("obsv_pt:%s", queue->observe_pt ? "Yes" : "No")); DBPRT(("\n")); sprintf(num, "%d", queue->running); DBPRT((" Job counts: %s running, ", queue->running != UNSPECIFIED ? num : "???")); sprintf(num, "%d", queue->maxrun); DBPRT(("%s max ", queue->maxrun != UNSPECIFIED ? num : "???")); sprintf(num, "%d", queue->userrun); DBPRT(("(%s/user), ", queue->userrun != UNSPECIFIED ? num : "???")); sprintf(num, "%d", queue->queued); DBPRT(("%s queued\n", queue->queued != UNSPECIFIED ? num : "???")); sprintf(num, "%d", queue->nodes_assn); DBPRT((" Nodes:%s/", queue->nodes_assn != UNSPECIFIED ? num : "???")); sprintf(num, "%d", queue->nodes_max); DBPRT(("%s", queue->nodes_max != UNSPECIFIED ? num : "???")); sprintf(num, "%d", queue->nodes_default); DBPRT((" [def %s, ", queue->nodes_default != UNSPECIFIED ? num : "???")); sprintf(num, "%d", queue->nodes_min); DBPRT(("min %s], ", queue->nodes_min != UNSPECIFIED ? num : "???")); DBPRT(("wallt max %s ", (queue->wallt_max != UNSPECIFIED) ? schd_sec2val(queue->wallt_max) : "???")); DBPRT(("[def %s ", queue->wallt_default != UNSPECIFIED ? schd_sec2val(queue->wallt_default) : "???")); DBPRT(("min %s]\n", (queue->wallt_min != UNSPECIFIED) ? schd_sec2val(queue->wallt_min) : "???")); if (queue->empty_by) /* ctime(2) returns a '\n'-terminated string, so no additional '\n' */ DBPRT((" Queue will empty by: %s", ctime(&queue->empty_by))); if (queue->idle_since) /* ctime(2) returns a '\n'-terminated string, so no additional '\n' */ DBPRT((" Queue idle since: %s", ctime(&queue->idle_since))); if (queue->useracl && (queue->flags & QFLAGS_USER_ACL)) { DBPRT((" User ACL: ")); columns = 9; /* Start with 9 columns for 'User ACL: ' */ for (aclent = queue->useracl; aclent != NULL; aclent = aclent->next) { columns += strlen(aclent->user) + 1; if (columns >= 72) { DBPRT(("\n ")); columns = 0; } DBPRT(("%s%s", ((columns == 0) || (aclent == queue->useracl)) ? "" : "/", aclent->user)); } DBPRT(("\n")); } if (dumpjobs && queue->jobs) { DBPRT((" Jobs: ")); columns = 5; /* Start with 5 columns for 'Jobs: ' */ for (job = queue->jobs; job != NULL; job = job->next) { /* Just the job numbers -- but be sure to put the '.' back! */ if ((ptr = strchr(job->jobid, '.')) != NULL) * ptr = '\0'; columns += strlen(job->jobid) + 3; /* 3 == job->state + '/' + ' ' */ if (columns >= 72) { DBPRT(("\n ")); columns = 0; } DBPRT((" %s/", job->jobid)); DBPRT(("%c", (job->flags & JFLAGS_PRIORITY) ? '!' : (job->flags & JFLAGS_WAITING) ? 'W' : job->state)); if (ptr != NULL) *ptr = '.'; } DBPRT(("\n")); } } #endif /* DEBUG */ static int queue_claim_jobs(Queue *queue, Job **joblist_ptr) { Job *job, *prev, *next, *qtail, *longest; int moved; int running, queued, held, other; /* * The time at which this queue should be empty (i.e. when all jobs * currently running on it are completed). Keep track of the longest * running job and compute the empties_at value from that. */ longest = NULL; /* * Keep track of some statistics about what jobs have been found in the * list. These aren't really used (yet), but are easy to compute. */ running = 0; queued = 0; held = 0; other = 0; /* * The number of jobs that have been moved from the global list to the * per-queue list. */ moved = 0; /* * Find the last element of the list of jobs on this queue. This is * probably unnecessary (since this should always be called with * 'queue->jobs' pointing to NULL. Still, it doesn't hurt to try. */ qtail = NULL; if (queue->jobs) { for (qtail = queue->jobs; qtail->next != NULL; qtail = qtail->next) /* Do nothing - just walk to next-to-last element of list */ ; } prev = NULL; for (job = *joblist_ptr; job != NULL; job = next) { next = job->next; if (strcmp(job->qname, queue->qname)) { /* check if this is a challenge or background job that needs * to be merged with the submit list of jobs */ if (!strcmp(queue->qname, schd_SubmitQueue->queue->qname)) /* the submit list? */ { if ((strcmp(job->qname, schd_ChallengeQueue)) && (strcmp(job->qname, schd_SpecialQueue)) && (strcmp(job->qname, schd_BackgroundQueue))) { /* Wrong queue -- ignore this job. */ prev = job; continue; } } } /* * This job belongs to this queue. Remove it from the job list and * place it at the tail of the queue's job list. This is somewhat * complicated since we have to remove it from the joblist first. * If there is no "previous" job element, then the current job is * the head of the list. */ if (job == *joblist_ptr) { /* * This is the head of the list -- just point the list head to * the job's next pointer and now the job is "orphaned". */ *joblist_ptr = next; prev = *joblist_ptr; } else { /* * This job lies in the middle of the list somewhere. Jump over * it in the previous element, and we're done. Note that since * we skipped this job, the previous job pointer does not change. */ prev->next = job->next; } /* * Now 'job' is the only active handle on the job. Place it at the * tail of the queue's list. If 'qtail' is NULL, this is the first * job -- place it at the head of the list. Otherwise, place it after * the element pointed to by the 'qtail'. Either way, this is the * last element in the list, so point the qtail at it and clear its * next pointer. */ if (qtail == NULL) queue->jobs = job; else qtail->next = job; qtail = job; job->next = NULL; if (job->flags & JFLAGS_QNAME_LOCAL) { /* * The job has some memory that was allocated when it was created, * that is used to store the name of the queue on which it resides. * Since we know exactly what queue it lives on (the one pointed to * by 'queue', to be exact), we can free the storage and point the * 'job->qname' at 'queue->qname'. Also store a reference to the * owner queue in the job itself. */ free(job->qname); job->qname = queue->qname; job->queue = queue; /* * Turn off the flag -- job->qname is now a reference to a queue. */ job->flags &= ~JFLAGS_QNAME_LOCAL; } /* Now, count the job and increment the correct statistic. */ moved ++; switch (job->state) { case 'R': running ++; /* * Adjust the time of any job that has run over its expected * time to the JOB_OVERTIME_SLOP. */ if (job->time_left < 0) { job->time_left = JOB_OVERTIME_SLOP; } /* If this job will be running the longest, note that. */ if ((longest == NULL) || (job->time_left > longest->time_left)) { longest = job; } break; case 'Q': queued ++; break; case 'H': held ++; break; default: other ++; break; } } /* * If any jobs were running, then set the empty_by time to the absolute * time (in seconds) when all jobs should be completed. If none are * running, then set empty_by time to 0. */ if (longest) queue->empty_by = schd_TimeNow + longest->time_left; else queue->empty_by = 0; return (moved); } /* * PBS has been known to provide some bizarre information about the state * of the queue (i.e. no jobs are running in it, but some of its resources * are consumed). Perform some consistency checks on the queue information * before agreeing that it is correct. Generate a laundry list of everything * that appears wrong with it. */ static int queue_sanity(Queue *queue) { char *id = "queue_sanity"; Job *job; int queued, running; int is_sane; is_sane = 1; /* Assume the queue is sane for now. */ /* * Count running and queued jobs and make sure the numbers match up. */ queued = running = 0; for (job = queue->jobs; job != NULL; job = job->next) { switch (job->state) { case 'R': running ++; break; case 'Q': queued ++; break; default: /* Empty */ break; } } /* JJPJ -- this no longer makes much sense since we are adding * now moving challenge and background jobs into the queue if (queue->running != running) { sprintf(log_buffer, "Queue '%s' expected %d running jobs, but found %d", queue->qname, queue->running, running); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); is_sane = 0; } if (queue->queued != queued) { sprintf(log_buffer, "Queue '%s' expected %d queued jobs, but found %d", queue->qname, queue->queued, queued); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); is_sane = 0; } * */ if (queue->running && (queue->empty_by < schd_TimeNow)) { sprintf(log_buffer, "Queue '%s' was expected to be empty %d seconds ago", queue->qname, (schd_TimeNow - queue->empty_by)); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); is_sane = 0; } return (is_sane); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/val2sec.c0000664000113300011330000001345211272401241020044 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: val2sec.c 2367 2008-09-03 17:17:34Z josh $ */ /* * Convert a value string from time to its equivalent value in seconds. */ #include #include #include #include #include "pbs_ifl.h" #include "log.h" #include "toolkit.h" time_t schd_val2sec(char *val) { char *id = "val2sec"; char *p1, *p2, *p3, *end, *zero = "0"; time_t v1, v2, v3; time_t sec; char *valcopy; p3 = NULL; valcopy = schd_strdup(val); if (valcopy == NULL) { (void)sprintf(log_buffer, "schd_strdup(val) failed."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return ((time_t) - 1); } /* Split string into at most 3 tokens. */ p1 = strtok(valcopy, ":"); p2 = strtok(NULL, ":"); if (p2 != NULL) { p3 = strtok(NULL, ":"); } /* Only seconds specified. Shift right 2 places into p3, and zero fill */ if (p2 == NULL) { p3 = p1; p2 = zero; p1 = zero; } /* Minutes and seconds specified. Shift right into p3, and zero fill */ if (p3 == NULL) { p3 = p2; p2 = p1; p1 = zero; } v1 = (time_t)strtol(p1, &end, 10); if (*end != '\0') goto error; if (v1 < 0) goto error; v2 = (time_t)strtol(p2, &end, 10); if (*end != '\0') goto error; if (v2 < 0 || v2 > 59) goto error; v3 = (time_t)strtol(p3, &end, 10); if (*end != '\0') goto error; if (v3 < 0 || v3 > 59) goto error; free(valcopy); sec = (v1 * 3600) + (v2 * 60) + v3; return (sec); error: (void)sprintf("Can't parse time '%s' into seconds.\n", val); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); free(valcopy); return ((time_t) - 1); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/schedule.c0000664000113300011330000011670311272401241020304 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: schedule.c 2367 2008-09-03 17:17:34Z josh $ */ /* * This is the main loop for the scheduler. The scheduler receives a * command and then calls the routine schedule(). Appropriate actions * are taken based on the command specified. All actions taken by the * scheduler must be initiated from here. */ #include #include #include #include #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "sched_cmds.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" #include "msgs.h" extern int connector; extern char *schd_CmdStr[16]; /* * How many seconds to wait before attempting to re-request the job and queue * information from the server. */ #define WAIT_FOR_QUEUE_SANITY 10 Resources schd_Rsrcs; /* system resources */ time_t schd_TimeNow; time_t schd_TimeLast = 0; struct tm schd_TmNow; int last_run_in_pt = 0; Job *schd_AllJobs = NULL; static int schd_req(int cmd); static int get_all_queue_info(int numqlists, QueueList *list, ...); static Job *reject_unrunnables(Job *jobs); static int schedule_jobs(QueueList *queues, Job *jobs, char *reason); static int schedule_restart(Job *joblist); static int make_job_dump(char *dumpfile); static int dump_sorted_jobs(FILE *file, Job *joblist); void fix_jim(Queue *submit, Queue *jim); /* * This routine gets the scheduling command and takes appropriate action. * C.f. PBS Administrator's Guide, Section 4.1. * * Valid commands are: * SCH_ERROR ERROR. * SCH_SCHEDULE_NULL Place holder. * SCH_SCHEDULE_NEW New job arrived or a non-running job changed state. * SCH_SCHEDULE_TERM A running job terminated. * SCH_SCHEDULE_TIME The schedulers time interval expired. * SCH_SCHEDULE_RECYC One job was started in the last scheduling cycle. * SCH_SCHEDULE_CMD The server attribute "scheduling" was set to true. * SCH_CONFIGURE Perform any scheduler [re]configuration. * SCH_QUIT QUIT * SCH_RULESET Reread the scheduler rules. * SCH_SCHEDULE_FIRST First schedule run after server starts. */ int schedule(int cmd) { char *id = "schedule"; char *cmdstr = "Error"; /* * Try to find a text string that describes the command request. */ if (cmd >= 0) cmdstr = (schd_CmdStr[cmd] != NULL) ? schd_CmdStr[cmd] : "Unknown"; (void)sprintf(log_buffer, "Schedule: received cmd %d (%s)", cmd, cmdstr); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("--------\n%s\n", log_buffer)); /* * See if a reconfiguration is pending. If so, do it before anything * starts to look at the structures. */ if (schd_sigflags & SCHD_SIGFLAGS_RECONFIG) { (void)sprintf(log_buffer, "Reconfiguring due to delivery of SIGHUP."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); if (schedinit(0, NULL)) { (void)sprintf(log_buffer, "%s: FATAL ERROR!!! Configuration failed!!!", id); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); exit(1); } /* Turn off the pending reconfiguration flag. */ schd_sigflags &= ~SCHD_SIGFLAGS_RECONFIG; } /* * Assume the scheduler is about to use the current configuration. * Set the BUSY flag so that reconfiguration will be postponed until * the scheduler is idle if a SIGHUP is delivered. */ schd_sigflags |= SCHD_SIGFLAGS_BUSY; switch (cmd) { /* * "Null" commands. These cases are quietly ignored. */ case SCH_SCHEDULE_NULL: /* Placeholder only. */ case SCH_ERROR: /* Error. */ case SCH_RULESET: /* Re-read scheduler rules. */ (void)sprintf(log_buffer, "command %d ignored.", cmd); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); break; /* * These commands cause the scheduler to perform its scheduling cycle. */ case SCH_SCHEDULE_FIRST: /* 1st schedule run after server starts. */ case SCH_SCHEDULE_CMD: /* Perform a schedule run now, on command. */ case SCH_SCHEDULE_TERM: /* A running job terminated. */ case SCH_SCHEDULE_NEW: /* A new job has arrived. */ case SCH_SCHEDULE_TIME: /* Scheduler sleep interval reached. */ case SCH_SCHEDULE_RECYC: /* Recycle scheduler after 1 run. */ if (!schd_req(cmd)) { schd_cleanup(); DBPRT(("schd_req(%d) returned 0. Calling it again.\n", cmd)); schd_req(cmd); } schd_cleanup(); break; case SCH_CONFIGURE: /* Re-initialize the scheduler. */ (void)sprintf(log_buffer, "[re]configure scheduler"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); schedinit(0, NULL); /* XXX args not used... for now! */ break; case SCH_QUIT: /* Exit gracefully. */ (void)sprintf(log_buffer, "Scheduler was asked to quit. Exit."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); exit(0); default: (void)sprintf(log_buffer, "Schedule command %d unrecognized.", cmd); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); } /* * The scheduling part of the scheduler is now idle. Unset the BUSY * flag. */ schd_sigflags &= ~SCHD_SIGFLAGS_BUSY; schd_FirstRun = 0; return (0); } /* * Service a request to schedule a job. */ /* ARGSUSED */ int schd_req(int cmd) { char *id = "schd_req"; Job *this, *jobs = NULL; QueueList *qptr, *next; QueueList *normalQs = NULL, *normalQtail = NULL, *newqlp; Outage *outages; int ran, error, total_ran = 0; int hosts_in_dedtime = 0; struct tm *tm_ptr; char reason[MAX_TXT + 1]; /* Save "last" run time (in global 'schd_TimeNow') for later use. */ schd_TimeLast = schd_TimeNow; /* * Get the number of seconds since the Epoch, and break it down into * the various day, month, year, fields in a struct tm. */ time(&schd_TimeNow); if (tm_ptr = localtime(&schd_TimeNow)) memcpy((void *) & schd_TmNow, (void *)tm_ptr, sizeof(struct tm)); else memset((void *)&schd_TmNow, 0, sizeof(struct tm)); DBPRT(("[time_t %d] %s", schd_TimeNow, ctime(&schd_TimeNow))); /* * If the configuration file has been changed since the last time the * scheduler was run, than note that in the logs. Don't re-read it * automatically, just note the fact. Don't reset the timestamp - it * will be done when someone finally HUP's the scheduler. */ if (schd_CfgFilename && schd_file_has_changed(schd_CfgFilename, 0)) { (void)sprintf(log_buffer, "WARNING!!! Scheduler config file %s has changed!", schd_CfgFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); (void)sprintf(log_buffer, "Run 'kill -HUP %ld' to reconfigure.", (long)getpid()); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } /* * See if the holidays file has changed. If it's re-read successfully, * update the last changed timestamp. Otherwise, keep it around and * keep trying to re-read it until someone fixes the problem. "This * shouldn't happen." */ if (schd_file_has_changed(HOLIDAYS_FILE, 0) > 0) { (void)sprintf(log_buffer, "Attempting to update holidays/primetime from %s.", HOLIDAYS_FILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); if (schd_read_holidays() < 0) { (void)sprintf(log_buffer, "Failed to read holidays file."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); } else { /* Reset the "last changed time", since it was re-read okay. */ (void)schd_file_has_changed(HOLIDAYS_FILE, 1); } } /* * If this is the first run during non-primetime, set all the execution * queues' observed primetime back to 'on'. If it's primetime now, set * the "last run in primetime" global. */ if (schd_ENFORCE_PRIME_TIME && schd_TimeNow >= schd_ENFORCE_PRIME_TIME) { if (schd_prime_time(0)) { last_run_in_pt = 1; } else if (last_run_in_pt) { DBPRT(("%s: First non-pt run, reset queue observed times.\n", id)); if (schd_BatchQueues) schd_reset_observed_pt(schd_BatchQueues); /* Last run was not in prime time. */ last_run_in_pt = 0; } } /* Get the current list of all jobs known to our server. * Set the job->priority field so that each jobs is assign an * inherent priority, using several criteria including recent * past usage, nodes requsted, time on queue, originating queue * and then populate the schd_AllJobs list with these jobs */ jobs = schd_get_jobs(NULL, NULL); /* * Check for queued jobs on any of the run queues. This may happen if * there is some glitch and the POSIX jobs are checkpointed. * schedule_restart() will return non-zero if it finds and restarts * any jobs. Recycle if this is the case. */ if (schd_SCHED_RESTART_ACTION != SCHD_RESTART_NONE) { if (schedule_restart(jobs)) { schd_free_jobs(jobs); return (0); } } /* * Sort jobs by the priority field set above. Note that the jobs * are reordered "in situ". The sorting routine returns a pointer to * the new head of the list created by relinking the elements of the * linked list, or NULL if an error occurs. Zero the original list * pointer to reduce confusion - the same list, in different order, now * lives on schd_AllJobs. */ schd_AllJobs = schd_sort_jobs(jobs); jobs = NULL; /* now query the GRM on the T3e to get the node map information; * and then correlatate in-use PEs to running jobs, filling the global * schd_PEMAP in the process. */ if (load_pe_map(schd_AllJobs)) { /* unable to get PE map ... do something... */ ; } /* * Get the queue limits and utilization for each queue about which the * scheduler knows. Any jobs on schd_AllJobs (set by get_and_sort_jobs() * above) that belong to the queue will be placed on the queue->jobs * list. * * If PBS fails to provide us any information about a queue, treat it * as a fatal error. */ error = get_all_queue_info(3 /* Number of queue lists */, schd_SubmitQueue, schd_BatchQueues, schd_DedQueues); if (error < 0) { DBPRT(("get_all_queue_info() failed\n")); return (1); /* Bogus queue - don't recycle. */ } else if (error > 0) { DBPRT(("queue failed sanity check - wait and recycle.\n")); sleep(WAIT_FOR_QUEUE_SANITY); return (0); /* Attempt to recycle scheduler. */ } /* Fix added by jjones per Dr. Hook to change behavior of jobs being * moved from submit queue to exec queue before run, at request of * ERDC. */ fix_jim(schd_SubmitQueue->queue, schd_BatchQueues->queue); /* * At this point, schd_AllJobs should hold only orphan jobs (i.e. only * jobs that belong to queues about which the scheduler does not care). * Note it and go on scheduling -- unless nothing is being scheduled, * this is more-or-less meaningless. */ if (schd_AllJobs) { (void)sprintf(log_buffer, "Some jobs not claimed by queues."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n%s: Unclaimed jobs: ", id, log_buffer, id)); #ifdef DEBUG for (this = schd_AllJobs; this != NULL; this = this->next) { DBPRT(("%s%s", this->jobid, this->next ? ", " : "")); } DBPRT(("\n")); #endif /* DEBUG */ } /* Dump the list of jobs being scheduled from submit queue. */ if (schd_JOB_DUMPFILE) { (void)sprintf(log_buffer, "Dumping sorted job information to %s", schd_JOB_DUMPFILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); make_job_dump(schd_JOB_DUMPFILE); } /* * Allocation and usage information are updated at [roughly] 2:00 AM * (Eastern time). Since they may have been updated, attempt to fetch * them again in the middle of the night. */ if (schd_NeedToGetDecayInfo) schd_decay_info("r"); /* get users' recent past usage */ if (schd_ENFORCE_ALLOCATION && schd_TimeNow >= schd_ENFORCE_ALLOCATION) { /* * If the allocations file has already been loaded, consult the file * timestamp to determine if it has changed. If so, flag that it * needs to be reloaded. */ if (!schd_NeedToGetAllocInfo && schd_AllocFilename) schd_NeedToGetAllocInfo = schd_file_has_changed(schd_AllocFilename, 1); if (!schd_NeedToGetYTDInfo && schd_CurrentFilename) schd_NeedToGetYTDInfo = schd_file_has_changed(schd_CurrentFilename, 1); /* If either file needs to be [re]loaded, do so. */ if (schd_NeedToGetAllocInfo || schd_NeedToGetYTDInfo) schd_alloc_info(); } /* * We need to save the past usage data periodically, so that a restart * of pbs_sched doesn't lose it ... */ if (schd_save_decay()) /* is it time yet ? */ schd_decay_info("w"); /* yep, so do it */ if (schd_SubmitQueue->queue->jobs && !(schd_SubmitQueue->queue->flags & (QFLAGS_DISABLED | QFLAGS_STOPPED))) { /* * Test each job against the set of execution queues. If it can * never be run in any queue, reject it immediately. This saves * the user having to wait for the scheduler to get around to being * able to run it. */ jobs = reject_unrunnables(schd_SubmitQueue->queue->jobs); /* * Look for queues whose execution hosts are in dedicated time. If * any are found, note that fact and continue. Otherwise, add them * to the normalQs list, which will be scheduled normally. If the * flag is set indicating that one or more hosts is in dedtime, they * will be scheduled after everything else is done. */ for (qptr = schd_BatchQueues; qptr != NULL; qptr = qptr->next) { if (schd_ENFORCE_DEDTIME && schd_TimeNow >= schd_ENFORCE_DEDTIME) outages = schd_host_outage(qptr->queue->exechost, 0); else outages = NULL; /* * Is there a scheduled outage right now for this host? If so, * note that fact and continue to the next queue. All of this * information is cached, so this isn't as expensive as it seems. */ if (outages != NULL) { if ((outages->beg_time <= schd_TimeNow) && (outages->end_time > schd_TimeNow)) { DBPRT(("%s: Host %s is in dedtime (from %s:%s to %s:%s)\n", id, outages->exechost, outages->beg_datestr, outages->beg_timestr, outages->end_datestr, outages->end_timestr)); DBPRT(("%s: Queue %s@%s will not be scheduled.\n", id, qptr->queue->qname, qptr->queue->exechost)); /* This exechost is in dedicated time, ignore the queue. */ hosts_in_dedtime ++; continue; } else if (outages->beg_time > schd_TimeNow) { /* Upcoming dedtime, but not yet. Schedule the queue. */ DBPRT(("%s: Host %s upcoming dedtime (at %s:%s to %s:%s)\n", id, outages->exechost, outages->beg_datestr, outages->beg_timestr, outages->end_datestr, outages->end_timestr)); } } /* * This host is not currently in dedicated time. Add it to the * tail of the list of queues to be scheduled. */ newqlp = (QueueList *)malloc(sizeof(QueueList)); if (newqlp == NULL) { (void)sprintf(log_buffer, "malloc(QueueList) for %s@%s failed", qptr->queue->qname, qptr->queue->exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); if (normalQs) schd_free_qlist(normalQs); return (1); } newqlp->queue = qptr->queue; if (normalQtail) normalQtail->next = newqlp; else normalQs = newqlp; normalQtail = newqlp; newqlp->next = NULL; } DBPRT(("%s: calling schedule_jobs(", id)); if (normalQs) { for (qptr = normalQs; qptr != NULL; qptr = qptr->next) DBPRT(("%s@%s%s", qptr->queue->qname, qptr->queue->exechost, qptr->next ? ", " : "")); } else { DBPRT(("")); } DBPRT((")\n")); /* Now make the call to actually run some jobs */ total_ran += ran = schedule_jobs(normalQs, jobs, reason); if (ran < 0) { DBPRT(("Could not run any jobs!\n")); } else { DBPRT(("RAN %d jobs.\n", ran)); } if (normalQs) schd_free_qlist(normalQs); normalQs = normalQtail = NULL; } /* * Now check the dedtime queues with queued jobs for hosts that are * in dedicated time. If any are found, comment the jobs appropriately * and/or schedule them. */ for (qptr = schd_DedQueues; qptr != NULL; qptr = qptr->next) { if (qptr->queue->queued == 0) continue; DBPRT(("%s: schd_handle_dedicated_time(%s)\n", id, qptr->queue->qname)); /* * Keep track of the next pointer, and zero the queue's next ptr so * it looks like a single queue. */ next = qptr->next; qptr->next = NULL; ran = schd_handle_dedicated_time(qptr->queue); if (ran < 0) { (void)sprintf(log_buffer, "schd_handle_dedicated_time(%s@%s) failed!", qptr->queue->qname, qptr->queue->exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } else { DBPRT(("RAN %d jobs on %s@%s.\n", ran, qptr->queue->qname, qptr->queue->exechost)); total_ran += ran; } /* Replace the zero'd next pointer to rechain the list. */ qptr->next = next; } if (total_ran > 0) { (void)sprintf(log_buffer, "System resources after scheduling:"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); schd_dump_rsrclist(); } (void)sprintf(log_buffer, ">>> End Scheduling Cycle (ran %d jobs) <<<", total_ran); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (1); } static int schedule_jobs(QueueList *queues, Job *jobs, char *reason) { char *id = "schedule_jobs"; int numran; Job *job; Queue *shortest; int priority_to_1st = 1; /* * Since the sorting code has provided an order in which the jobs should * be run, attempt to honor that order by treating the first job on the * list as our first priority. This amounts to draining the queue in * order to run that job, if necessary. * * If the job has been waiting too long, find the smallest queue in which * the job will fit, and consider its expected run time. If the waiting * job cannot run when the queue has emptied, then go on to the next. * However, if there are jobs running on the queue, it is possible that * this queue could support the waiting job if it were started draining * now. When enough jobs had exited, the waiting job would be runnable. * In order to determine if this is true, walk through the list of jobs, * which are sorted in order of completion (from soonest to last), and * find how many resources would be available after that job finished. * If there is space, calculate what time it will be when that many jobs * have completed, and see if the primetime limits apply at that time. * If the job fits in the primetime limits at that time, then start the * queue draining. If it will not fit after all jobs have been tested, * then give up on this queue and go on to the next. * * If a queue was found that requires draining, mark it for draining. * * After the waiting job handling has completed, collect a list of * all the available execution queues, and place it into the pointer * given to this function by the caller. */ for (job = jobs; job != NULL; job = job->next) { if (job->state != 'Q') continue; if (!priority_to_1st && !(job->flags & JFLAGS_WAITING)) continue; DBPRT(("%s: job %s is %s (eligible for %s, needs %d nodes)\n", id, job->jobid, priority_to_1st ? "FIRSTJOB" : (job->flags & JFLAGS_PRIORITY) ? "SPECIAL" : "WAITING", schd_sec2val(job->eligible), job->nodes)); /* * Find the smallest, shortest-wait queue in which this job will * fit. If it is empty, great. If not, mark it to be drained, * in anticipation of the job being run soon. Note that the queue * drain_by time should only be shortened - it doesn't make sense * to push it out. */ shortest = schd_find_drain(queues, job); if (shortest) { /* * If there are no jobs running in the queue, then unset the * draining flag (if present), so that the queue will be * available for this job. * * If there are running jobs, set the draining flag, and * adjust the empty_by value to be the expected time when * the job will first become runnable. */ if (shortest->running == 0) { shortest->flags &= ~QFLAGS_DRAINING; } else { /* If running jobs, empty_by should be non-zero. */ if (shortest->drain_by <= shortest->empty_by) { shortest->flags |= QFLAGS_DRAINING; DBPRT(("%s: shortest queue %s now draining, drain_by %s", id, shortest->qname, ctime(&shortest->drain_by))); } } } /* * We have looked at (and possibly arranged for special treatment * of) the first job on the list. Now only look for special or * waiting jobs. */ priority_to_1st = 0; } numran = schd_pack_queues(jobs, queues, reason); if (numran < 0) { (void)sprintf(log_buffer, "sched_pack_queues() failed!"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } return (numran); } /* * Get information about each of the queues in the list of lists. If * schd_get_queue_limits() fails, return the error condition. It may * be a transient or a hard failure, which the caller may want to deal * with. If all queues are successful, return '0'. */ static int get_all_queue_info(int numqlists, QueueList *list, ...) { va_list ap; int count = 0, ret; QueueList *qptr; char *id = "get_all_queue_info"; va_start(ap, numqlists); while (count < numqlists) { list = va_arg(ap, QueueList *); for (qptr = list; qptr != NULL; qptr = qptr->next) { /* * Get the limits, current resources, and any jobs for this * queue. */ if ((ret = schd_get_queue_limits(qptr->queue)) != 0) { DBPRT(("get_all_queue_info: get_queue_limits for %s failed.\n", qptr->queue->qname)); va_end(ap); return (ret); } /* * Set the queue flags if limits are exceeded. Don't bother * getting a reason string. */ schd_check_queue_limits(qptr->queue, NULL); } count ++; } va_end(ap); return (0); } static int schedule_restart(Job *joblist) { char *id = "schedule_restart"; Job *job, *nextjob; QueueList *qptr; int found, changed; changed = found = 0; for (job = joblist; job != NULL; job = nextjob) { nextjob = job->next; if (job->state != 'Q') continue; /* * See if the job is queued on one of the batch queues. If not, * go on to the next job. */ for (qptr = schd_BatchQueues; qptr != NULL; qptr = qptr->next) if (strcmp(qptr->queue->qname, job->qname) == 0) break; if (qptr == NULL) continue; found++; if (schd_SCHED_RESTART_ACTION == SCHD_RESTART_RERUN) { (void)sprintf(log_buffer, "Restart job '%s' on queue '%s'.", job->jobid, job->qname); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); schd_comment_job(job, schd_JobMsg[JOB_RESTARTED], JOB_COMMENT_REQUIRED); if (schd_run_job_on(job, job->queue, schd_SCHED_HOST, LEAVE_JOB_COMMENT)) { (void)sprintf(log_buffer, "Unable to run job '%s' on queue '%s'.", job->jobid, job->qname); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else changed ++; } else /* (SCHED_RESTART_ACTION == SCHD_RESTART_RESUBMIT) */ { if (schd_TEST_ONLY) { DBPRT(("%s: would have moved %s back to queue %s\n", id, job->jobid, schd_SubmitQueue->queue->qname)); } else { /* Move the job back to its originating queue. */ if (pbs_movejob(connector, job->jobid, job->oqueue, NULL) != 0) { (void)sprintf(log_buffer, "failed to move %s to queue %s, %d", job->jobid, job->oqueue, pbs_errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } else { (void)sprintf(log_buffer, "Requeued job '%s' on queue '%s'.", job->jobid, job->oqueue); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); schd_comment_job(job, schd_JobMsg[JOB_RESUBMITTED], JOB_COMMENT_REQUIRED); changed ++; } } } } if (found) { if (schd_SCHED_RESTART_ACTION == SCHD_RESTART_RERUN) { (void)sprintf(log_buffer, "Re-ran %d jobs (of %d) found queued on run queues.\n", changed, found); } else { (void)sprintf(log_buffer, "Moved %d queued jobs (of %d) from run queues back to '%s'.\n", changed, found, schd_SubmitQueue->queue->qname); } log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } return (changed); } static Job * reject_unrunnables(Job *jobs) { Job *this, *nextjob; char tmpstr[300]; for (this = jobs; this != NULL; this = nextjob) { nextjob = this->next; if (!schd_job_can_queue(this)) { /* * If this job is at the head of the list, we must deal with * it specially. We need to advance the list pointer forward * so that further scheduling will not be done on the now * bogus job. Advance 'jobs', and make 'nextjob' the 'next' * pointer for the new head of the list. */ if (this == jobs) { jobs = jobs->next; nextjob = jobs ? jobs->next : NULL; } DBPRT(("job %s does not fit on any execution queue - reject\n", this->jobid)); schd_reject_job(this, "Job will not fit on any execution queue.\n" "\n" "Use 'qstat -q' to get execution queue limits.\n"); continue; } /* * Enforce maximum job limits * "Big" jobs are given a maximum walltime limit (WALLT_LARGE_LIMIT) * that differs from "small" jobs. (Job size distinction based on * the size specified by SMALL_JOB_MAX.) We need to reject any job * which violate these limits. * * Special-priority jobs are not affected. */ if (!(this->flags & JFLAGS_PRIORITY) && (schd_SMALL_JOB_MAX > 0)) { if (this->nodes <= schd_SMALL_JOB_MAX) { if (this->walltime > schd_WALLT_SMALL_LIMIT) { if (this == jobs) { jobs = jobs->next; nextjob = jobs ? jobs->next : NULL; } DBPRT(("job %s exceeds Small job walltime limit - reject\n", this->jobid)); sprintf(tmpstr, "Job exceeds maximum walltime limit (%s) policy\n" "\tfor small jobs (1 - %d nodes).\n", schd_sec2val(schd_WALLT_SMALL_LIMIT), schd_SMALL_JOB_MAX); schd_reject_job(this, tmpstr); continue; } } else { if (this->walltime > schd_WALLT_LARGE_LIMIT) { if (this == jobs) { jobs = jobs->next; nextjob = jobs ? jobs->next : NULL; } DBPRT(("job %s exceeds Large job walltime limit - reject\n", this->jobid)); sprintf(tmpstr, "Job exceeds maximum walltime limit (%s) policy\n" "\tfor large jobs (%d+ nodes).\n", schd_sec2val(schd_WALLT_LARGE_LIMIT), schd_SMALL_JOB_MAX + 1); schd_reject_job(this, tmpstr); continue; } } } } return (jobs); } static int make_job_dump(char *dumpfile) { char *id = "make_job_dump"; FILE *dump; QueueList *qptr; /* * Attempt to open the dump file, creating it if necessary. It should * be truncated each time this runs, so don't open with append mode. */ if ((dump = fopen(dumpfile, "w")) == NULL) { (void)sprintf(log_buffer, "Cannot write to %s: %s\n", dumpfile, strerror(errno)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } /* Head the file with a timestamp. */ fprintf(dump, "%s\n", ctime(&schd_TimeNow)); /* And some more useful information about the state of the world. */ fprintf(dump, "Scheduler running on '%s'\n", schd_ThisHost); fprintf(dump, "Prime-time is "); if (schd_ENFORCE_PRIME_TIME && schd_TimeNow >= schd_ENFORCE_PRIME_TIME) { fprintf(dump, "from %s ", schd_sec2val(schd_PRIME_TIME_START)); fprintf(dump, "to %s.\n", schd_sec2val(schd_PRIME_TIME_END)); } else fprintf(dump, "not enforced.\n"); fprintf(dump, "\nJOBS LISTED IN ORDER FROM HIGHEST TO LOWEST PRIORITY\n\n"); /* Now dump the jobs queued on the various queues, in order of priority. */ qptr = schd_SubmitQueue; if (qptr->queue->jobs) { fprintf(dump, "Jobs on submit queue '%s':\n", qptr->queue->qname); dump_sorted_jobs(dump, qptr->queue->jobs); } for (qptr = schd_DedQueues; qptr != NULL; qptr = qptr->next) { if (qptr->queue->jobs) { fprintf(dump, "Jobs on dedicated queue '%s':\n", qptr->queue->qname); dump_sorted_jobs(dump, qptr->queue->jobs); } } if (fclose(dump)) { (void)sprintf(log_buffer, "close(%s): %s\n", dumpfile, strerror(errno)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } return (0); } static int dump_sorted_jobs(FILE *dump, Job *joblist) { Job *job; int njobs; int elig_mesg = 0; #define DUMP_JID_LEN 16 #define DUMP_STATE_LEN 1 #define DUMP_OWNER_LEN 8 #define DUMP_NODES_LEN 3 #define DUMP_PRIORITY_LEN 4 #define DUMP_WALLT_LEN 8 #define DUMP_WAITT_LEN 8 #define DUMP_ELIGI_LEN 9 /* time plus '*' if wait != eligible */ #define DUMP_FLAGS_LEN 18 char jid[DUMP_JID_LEN + 1]; char owner[DUMP_OWNER_LEN + 1]; char wallt[DUMP_WALLT_LEN + 1]; char waitt[DUMP_WAITT_LEN + 1]; char eligi[DUMP_ELIGI_LEN + 1]; char flags[DUMP_FLAGS_LEN + 1]; fprintf(dump, " %*s %*s %*s %*s %*s %*s %*s %*s %*s\n", -DUMP_JID_LEN, "Job ID", -DUMP_STATE_LEN, "S", -DUMP_OWNER_LEN, "Owner", -DUMP_NODES_LEN, "PEs", -DUMP_PRIORITY_LEN, "Pri", -DUMP_WALLT_LEN, "Walltime", -DUMP_WAITT_LEN, "Q'd for", -DUMP_ELIGI_LEN, "Eligible", -DUMP_FLAGS_LEN, "Flags"); fprintf(dump, " %*s %c %*s %*s %*s %*s %*s %*s %*s\n", -DUMP_JID_LEN, "----------------", '-', -DUMP_OWNER_LEN, "--------", -DUMP_NODES_LEN, "---", -DUMP_PRIORITY_LEN, "----", -DUMP_WALLT_LEN, "--------", -DUMP_WAITT_LEN, "--------", -DUMP_ELIGI_LEN, "---------", -DUMP_FLAGS_LEN, "------------------"); for (njobs = 0, job = joblist; job != NULL; job = job->next) { njobs++; strncpy(jid, job->jobid, DUMP_JID_LEN); strncpy(owner, job->owner, DUMP_OWNER_LEN); strcpy(wallt, schd_sec2val(job->walltime)); strcpy(waitt, schd_sec2val(job->time_queued)); strcpy(eligi, schd_sec2val(job->eligible)); if (job->time_queued != job->eligible) { strcat(eligi, "*"); elig_mesg ++; } flags[0] = '\0'; /* Watch length of 'flags[]' array! */ if (job->flags & JFLAGS_INTERACTIVE) strcat(flags, "Int "); /* "Priority" jobs are marked as being waiting, even if they're new. */ if (job->flags & JFLAGS_PRIORITY) strcat(flags, "High "); else if (job->flags & JFLAGS_WAITING) strcat(flags, "Wait "); if (job->flags & JFLAGS_DEDICATED) strcat(flags, "Ded "); /* Trim off the trailing space if any flags were listed. */ if (flags[0] != '\0') flags[strlen(flags) - 1] = '\0'; fflush(dump); fprintf(dump, " %*s %c %*s %*d %*d %*s %*s %*s %*s\n", -DUMP_JID_LEN, jid, job->state, -DUMP_OWNER_LEN, owner, -DUMP_NODES_LEN, job->nodes, -DUMP_PRIORITY_LEN, job->priority, -DUMP_WALLT_LEN, wallt, -DUMP_WAITT_LEN, waitt, -DUMP_ELIGI_LEN, eligi, -DUMP_FLAGS_LEN, flags); } fprintf(dump, " Total: %d job%s\n\n", njobs, (njobs == 1) ? "" : "s"); if (elig_mesg) { fprintf(dump, "Jobs marked with a ``*'' have an etime different " "from their ctime.\n\n"); } return (njobs); } /* Fix added by jjones per Dr. Hook to change behavior of jobs being * moved from submit queue to exec queue before run, at request of * ERDC. */ void fix_jim(Queue *submit, Queue *jim) { /* there'll be no running jobs on 'jim', but the scheduler */ /* _assumes_ that jobs *only* run out of that queue ... :-P */ jim->running = submit->running; submit->running = 0; /* also, the scheduler would be surprised to find any */ /* resources "assigned" to any queue but 'jim' ... */ jim->nodes_assn = submit->nodes_assn; jim->nodes_rsvd = submit->nodes_rsvd; /* _probably_ unnecessary */ submit->nodes_assn = submit->nodes_rsvd = 0; /* for the "draining" logic, we should probably adjust 'empty_by' */ jim->empty_by = submit->empty_by; return; } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/toolkit.h0000664000113300011330000005025411272401241020200 00000000000000/* $Id: toolkit.h 2367 2008-09-03 17:17:34Z josh $ */ /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #ifndef TOOLKIT_H_ #define TOOLKIT_H_ #include #include /* For time_t declaration. */ #include "pbs_ifl.h" #define UNSPECIFIED -1 #include "bitfield.h" /* * Location of the accounting HOLIDAYS file. */ #ifndef HOLIDAYS_FILE #define HOLIDAYS_FILE "/usr/lib/acct/holidays" #endif /* ! HOLIDAYS_FILE */ /* * It may take this long for mom to kill a job that runs over its expected * run time (i.e. a "1:00:00" job may run for up to 5 minutes longer than * the expected hour). When this is the case, the time left for the job to * complete becomes negative. Since this is clearly bogus, and there is no * way to tell when PBS will actually terminate the job, adjust the time * remaining for any job that has passed its expected completion time to * be JOB_OVERTIME_SLOP seconds in the future. */ #define JOB_OVERTIME_SLOP (3 * 60) /* * Lengths of strings to allocate for holding dates and time in the following * formats. Used for scheduled outages. */ #define DATE_LENGTH 10 /* length of "MM/DD/YYYY" */ #define TIME_LENGTH 5 /* length of "HH:MM" */ #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif /* ! MAX */ #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* ! MIN */ /* * Macro to compute the number of nodes required to supply the CPU an * memory requested. Note that the MB_PER_NODE definition reflects the * physical configuration of the machine. * * !!! MB_PER_NODE may vary if different memory configurations are * !!! installed on the systems. This value is currently correct * !!! for all Origins at NAS, but may not be correct in all cases. */ #define MB_PER_NODE ((size_t)256*1024*1024) #define PE_PER_NODE 2 #define NODES_FROM_MEM(mem) (int)(((mem) + MB_PER_NODE - 1) / MB_PER_NODE) #define NODES_FROM_CPU(cpu) (int)(((cpu) + PE_PER_NODE - 1) / PE_PER_NODE) #define NODES_REQD(cpu,mem) (int)MAX(NODES_FROM_CPU(cpu),NODES_FROM_MEM(mem)) /* * One of the more time-consuming activities in the scheduler is modifying * the job comments (since it requires a round trip with the server on each * comment). In order to reduce the impact this commenting has on the time * that each scheduling iteration takes, comment jobs only the first time * they are seen, or after their last modification time ages to more than * MIN_COMMENT_AGE seconds old. */ #define MIN_COMMENT_AGE (5 * 60) /* Valid state count search strings */ #define SC_TRANSIT "Transit" #define SC_QUEUED "Queued" #define SC_HELD "Held" #define SC_WAITING "Waiting" #define SC_RUNNING "Running" #define SC_EXITING "Exiting" /* * Typedef's for external PBS declarations. */ typedef struct batch_status Batch_Status; typedef struct attrl AttrList; typedef struct attropl AttrOpList; struct job { struct job *next; /* * The following attributes are strdup()'d and must be freed before * the last handle to the job is given up. */ char *jobid; /* Opaque job identifier. */ char *owner; /* Username of owner of this job. */ char *host; /* Host from whence this job came. */ char *exechost; /* Host on which this job is running. */ char *group; /* Group of the owner of this job. */ char *comment; /* Current comment on this job. */ char *oqueue; /* Originating queue name. */ char *pelabel; /* Requested PE label */ /* * This value is strdup()'d when a batch_struct is converted to * a Job struct. When the Job is claimed by a queue, the 'queue' * field is pointed to its owner. 'qname' is then free()'d and * pointed to the queue->qname field. */ char *qname; /* Name of queue this job lives in. */ struct queue *queue; /* Back pointer to queue struct. */ #if PE_MASK != 0 Bitfield nodemask; /* set when moving to execution queue */ #endif /* PE_MASK */ char flags; /* Flags for the state of this job: */ /* * JFLAGS_INTERACTIVE: Job is an "interactive" job (i.e. "qsub -I") * JFLAGS_QNAME_LOCAL: Job->qname points to a piece of storage, i.e. * it is not a reference to a Queue->qname. * JFLAGS_WAITING: Job is an "outstanding waiting" job, i.e it has * been waiting for so long (MAX_QUEUED_TIME) * we need to go to heroic measures to make * sure it runs. * JFLAGS_FIRST_SEEN: Job has arrived since the last scheduler run. * JFLAGS_PRIORITY: Job came from a high-priority queue. * JFLAGS_DEDICATED: Job came from a dedicated time queue. */ #define JFLAGS_INTERACTIVE (1 << 0) #define JFLAGS_QNAME_LOCAL (1 << 1) #define JFLAGS_WAITING (1 << 2) #define JFLAGS_FIRST_SEEN (1 << 3) #define JFLAGS_PRIORITY (1 << 4) #define JFLAGS_DEDICATED (1 << 5) int nodes; /* Number of nodes requested by job. */ time_t walltime; /* Wallclock time the job requested. */ time_t walltime_used; /* Wallclock time used by the job. */ int time_queued; /* How many secs since job queued. */ int eligible; /* How many secs job eligible to run. */ int time_left; /* How many secs remain for this job. */ int time_until_eligible;/* How many secs until job is eligible*/ /* -1 = not eligible in foreseeable */ /* future (eg. no allocation) */ time_t mtime; /* When this job was last modified. */ char state; /* Is the job Running, Queued, etc */ int priority; /* Priority of Job, inherited from Q */ int session; /* Session ID of running job */ int total_delay; /* Total secs job has been bumped from*/ /* its original earliest runtime */ }; typedef struct job Job; struct useracl { struct useracl *next; char user[PBS_MAXUSER + 1]; char *host; }; typedef struct useracl UserAcl; /* This structure is used to hold information about a queue. */ struct queue { /* The following fields are retained across scheduling interations. */ char *qname; /* Pointer to queuename for this info */ char *exechost; /* Host on which this queue executes. */ time_t idle_since; /* The time this queue last went idle */ int observe_pt; /* Observe primetime for this queue? */ /* These fields are recomputed for each run of the scheduler. */ struct resources *rsrcs; /* Resources for this execution host. */ /* * Flags for the internal state of the queue: * * QFLAGS_STOPPED: Queue is stopped -- do not attempt to run jobs on it. * QFLAGS_DISABLED: Queue is disabled -- do not queue or run jobs on it. * QFLAGS_FULL: Queue has jobs running that consume all of at least * one of the queue's limited resources. * QFLAGS_MAXRUN: Queue has enough jobs running. Resources may or may * not be available, but don't run more jobs. * QFLAGS_DRAINING: Queue is being drained, possibly to run a long-waiting * large job. * QFLAGS_USER_ACL: Queue has an active user access control list. * QFLAGS_NPT_JOBS: Some jobs would have been runnable on this queue if * primetime were not being observed. */ int flags; /* Flags for this queue (see above). */ #define QFLAGS_STOPPED (1 << 0) #define QFLAGS_DISABLED (1 << 1) #define QFLAGS_FULL (1 << 2) #define QFLAGS_MAXRUN (1 << 3) #define QFLAGS_DRAINING (1 << 4) #define QFLAGS_USER_ACL (1 << 6) #define QFLAGS_NPT_JOBS (1 << 8) time_t empty_by; /* When this queue will be empty */ time_t drain_by; /* When this queue will be drained */ /* enough to run the waiting job */ Job *jobs; /* Pointer to list of jobs on queue */ UserAcl *useracl; /* Linked list of user ACL's */ int running; /* Num jobs running */ int queued; /* Num jobs queued */ int maxrun; /* Queue run limit */ int userrun; /* Queue per-user run limit */ int nodes_max; /* Maximum node usage */ int nodes_min; /* Minimum node usage */ int nodes_default; /* Default node request for jobs */ time_t wallt_max; /* Maximum walltime allowed (sec) */ time_t wallt_min; /* Minimum walltime allowed (sec) */ time_t wallt_default; /* Default walltime for jobs (sec) */ int nodes_assn; /* Number of nodes assigned (used) */ int nodes_rsvd; /* Number of nodes reserved */ }; typedef struct queue Queue; /* * External list of queues. Needed so that there can be multiple * distinct orderings of the same set of structs. */ struct queuelist { struct queuelist *next; Queue *queue; }; typedef struct queuelist QueueList; /* * This structure contains information about a scheduled outage for a * machine. Each execution host may have one or more scheduled outages * listed for it. This relies upon a clone of the NAS 'schedule' program * (see README and dedicated.c for more information.) */ struct outage { struct outage *next; char *exechost; /* Outage for this host. */ time_t beg_time; /* Time when outage begins. */ time_t end_time; /* Time the outage ends. */ int flags; /* Miscellaneous flags. */ /* * OUTAGE_FLAGS_SYSTEM: This is a system outage, not a per-host one. */ #define OUTAGE_FLAGS_SYSTEM (1) char beg_datestr[DATE_LENGTH + 1]; /* Date of outage start. */ char beg_timestr[TIME_LENGTH + 1]; /* Time of outage start. */ char end_datestr[DATE_LENGTH + 1]; /* Date of outage end. */ char end_timestr[TIME_LENGTH + 1]; /* Time of outage end. */ }; typedef struct outage Outage; /* This structure holds the values returned by the resource monitor. */ struct resources { struct resources *next; /* Pointer to next resource list */ char *exechost; /* Name of this execution host */ int usrtime; /* % wall time spent in user code */ int systime; /* % wall time spent in syscalls */ int idltime; /* % wall time spent in idle loop */ size_t freemem; /* Amount of free memory */ int njobs; /* number of jobs running */ int nodes_total; /* Number of nodes on system */ int nodes_alloc; /* Number of nodes allocated */ int flags; /* Miscellaneous flags. */ }; typedef struct resources Resources; /* Per-group allocation and usage database table constants. */ #ifndef MAX_USER_NAME_SIZE #define MAX_USER_NAME_SIZE 10 #endif /* ! MAX_USER_NAME_SIZE */ #ifndef MAX_GROUP_NAME_SIZE #define MAX_GROUP_NAME_SIZE 10 #endif /* ! MAX_GROUP_NAME_SIZE */ #ifndef MAX_GROUP #define MAX_GROUP 1024 #endif /* ! MAX_GROUP */ #ifndef MAX_USERS #define MAX_USERS 256 #endif /* ! MAX_USERS */ #ifndef MAX_TXT #define MAX_TXT 127 #endif /* ! MAX_TXT */ /* Group usage and allocation counters. */ struct alloc_group { char gname[MAX_GROUP_NAME_SIZE]; /* Name of the group */ double total_usage; /* Allocation usage YTD */ double allocation; /* Total Allocation given */ }; typedef struct alloc_group Alloc_Group; /* PE map specific globals: */ #define MAX_LABEL_SZ 8 #define MAX_PE_MAP_SIZE 555 /* large enough to hold all APP PEs */ #define STAT_DOWN -1 #define STAT_AVAIL 0 #define STAT_JOB_PBS 1 #define STAT_JOB_CMD 2 struct pe_info { Job *job; /* pointer to running job or NULL */ char label[MAX_LABEL_SZ+1]; /* max label size = 8 */ int status; /* status of Node -1 == down */ int apps_max; /* maximum number of apps allowed */ int apps_num; /* current number of apps running */ }; typedef struct pe_info PE_Info; PE_Info schd_PEMAP[ MAX_PE_MAP_SIZE ]; /*****************************************************************************/ /* Exported function prototypes for the scheduler toolkit. */ /*****************************************************************************/ /* acl_support.c */ UserAcl *schd_create_useracl(char *useracl); int schd_free_useracl(UserAcl *); int schd_useracl_okay(Job *job, Queue *queue, char *reason); /* allocations.c */ void schd_alloc_info(void); int schd_is_over_alloc(char *group); int schd_reject_over_alloc(Job *job); /* byte2val.c */ char *schd_byte2val(size_t bytes); /* cleanup.c */ int schd_cleanup(void); /* comment.c */ #define JOB_COMMENT_REQUIRED 0 #define JOB_COMMENT_OPTIONAL 1 void schd_comment_job(Job *job, char *reason, int optional); void schd_comment_server(char *reason); int schd_alterjob(int sv_conn, Job *job, char *name, char *value, char *rsrc); /* dedicated.c */ void schd_clear_outage_cache(void); Outage *schd_host_outage(char *exechost, time_t when); int schd_dedicated_can_run(Job *job, Queue *srcq, time_t when, char *reason); /* dedqueue.c */ int schd_handle_dedicated_time(Queue *dedq); #if PE_MASK != 0 /* dyn_nodemask.c */ char *schd_format_nodemask(Bitfield *mask_mask, Bitfield *ndmask); int schd_bits2mask(char *string, Bitfield *mask); int schd_str2mask(char *maskstr, Bitfield *maskp); int schd_mask2str(char *maskstr, Bitfield *maskp); int schd_node_count(Bitfield *mask); #if defined(sgi) int schd_alloc_nodes(int nnodes, Queue *queue, Bitfield *job_mask); #endif #endif /* PE_MASK */ /* evaluate_system.c */ int schd_evaluate_system(Resources *rsrcs, char *reason); /* file_chgs.c */ int schd_register_file(char *filename); int schd_file_has_changed(char *filename, int reset_stamp); int schd_forget_file(char *filename); /* fragments.c */ int schd_fragment_okay(Job *job, Queue *queue, char *reason); /* getat.c */ char *schd_getat(char *at, Batch_Status *bs, char *rs); /* getconfig.c */ int schd_get_config(char *filename); /* getjobs.c */ Job *schd_get_jobs(char *qname, char *state); /* getqueues.c */ int schd_get_queue_limits(Queue *queue); #ifdef DEBUG #define QUEUE_DUMP_JOBS 1 #define QUEUE_DUMP_STATS_ONLY 0 void schd_dump_queue(Queue *queue, int dumpjobs); #endif /* DEBUG */ /* getrsrcs.c */ Resources *schd_get_resources(char *exechost); void schd_dump_rsrclist(void); /* grminfo.c */ int load_pe_map(Job *Jobs); /* how_many.c */ int schd_how_many(char *str, char *state); /* jobinfo.c */ int schd_get_jobinfo(Batch_Status *bs, Job *job); int schd_free_jobs(Job *list); void calc_job_weight(Job *job); /* misc.c */ void schd_timestamp(char *msg); int schd_free_qlist(QueueList *qlist); int schd_destroy_qlist(QueueList *qlist); char *schd_strdup(char *string); char *schd_lowercase(char *string); char *schd_shorthost(char *fqdn); /* movejob.c */ int schd_move_job_to(Job *job, Queue *destq); /* overlaps.c */ Queue *schd_find_drain(QueueList *qlist, Job *job); /* pack_queues.c */ int schd_pack_queues(Job *jlist, QueueList *qlist, char *reason); /* pnp.c */ int schd_prime_time(time_t when); int schd_secs_til_prime(time_t when); int schd_secs_til_nonprime(time_t when); int schd_read_holidays(void); int schd_reset_observed_pt(QueueList *qlist); /* queue_limits.c */ int schd_job_fits_queue(Job *job, Queue *queue, char *reason); int schd_job_can_queue(Job *job); int schd_check_queue_limits(Queue *queue, char *reason); /* resource_limits.c */ int schd_resource_limits(Job *job, Resources *rsrcs, char *reason); int schd_resources_avail(Job *job, Resources *rsrcs, char *reason); /* rejectjob.c */ int schd_reject_job(Job *job, char *reason); /* runjob.c */ #define SET_JOB_COMMENT 1 #define LEAVE_JOB_COMMENT 0 int schd_run_job_on(Job *job, Queue *queue, char *exechost, int set_comment); int schd_charge_job(Job *job, Queue *queue, Resources *rsrcs); /* schedinit.c */ int schedinit(int argc, char **argv); /* sec2val.c */ char *schd_sec2val(int seconds); /* time_limits.c */ int schd_primetime_limits(Job *job, Queue *queue, time_t when, char *reason); int schd_finish_before_np(Job *job, Queue *queue, time_t when, char *reason); /* user_limits.c */ int schd_user_limits(Job *job, Queue *queue, char *reason); /* usersort.c */ Job *schd_sort_jobs(Job *jobs); int schd_save_decay(void); void schd_decay_info(char *mode); void schd_update_resource_usage(Job *job); double get_resource_usage(char *user); /* val2bool.c */ int schd_val2bool(char *val, int *bool); char *schd_bool2val(int bool); int schd_val2datetime(char *string, time_t *when); int schd_val2booltime(char *val, time_t *t); char *schd_booltime2val(time_t bool); /* val2byte.c */ size_t schd_val2byte(char *val); /* val2sec.c */ time_t schd_val2sec(char *val); #endif /* ! TOOLKIT_H_ */ torque-2.4.16/src/scheduler.cc/samples/cray_t3e/overlaps.c0000664000113300011330000002405511272401241020341 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: overlaps.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include #include #include "pbs_ifl.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" /* * Attempt to find a queue in which this waiting or special job will * be able to run. Also take into account whether it is the shortest * wait or not. Given the choice between two equivalent wait times, * try to choose the smallest queue for the job. * * Return the expected time at which the queue will be sufficiently * drained to run 'job' in qlist->queue->drainby. If there is no queue * capable of running the job, do not modify Q->drain_by, and return * (Queue *)NULL. */ Queue * schd_find_drain(QueueList *qlist, Job *job) { char *id = "schd_find_drain"; QueueList *qptr; Queue *shortest, *queue; Job *rjob; char buff[256]; time_t drainby, mintime; int running; int drainnodes; int freenodes; /* * Find the smallest, shortest-wait queue in which this job will * fit. If it is empty, great. If not, mark it to be drained, * in anticipation of the job being run soon. Also update the * count of nodes that need to be reserved for this job. */ shortest = NULL; drainby = 0; mintime = 0; for (qptr = qlist; qptr != NULL; qptr = qptr->next) { queue = qptr->queue; /* The job will never fit in this queue. */ if (!schd_job_fits_queue(job, queue, NULL)) continue; /* Ignore stopped or disabled queues */ if (queue->flags & (QFLAGS_STOPPED | QFLAGS_DISABLED)) continue; /* Is this job's owner allowed to run in this queue? */ if ((queue->flags & QFLAGS_USER_ACL) && (!schd_useracl_okay(job, queue, NULL))) { continue; } /* * Are there sufficient nodes available to run this job already? If * so, there is no need to drain the queue to run this job. Return * NULL - no action is necessary. */ if ((queue->nodes_max - queue->nodes_assn) >= job->nodes) return (NULL); /* * The job cannot be run in this queue at the expected drain * time. */ drainby = schd_TimeNow; running = queue->running; if (running == 0) { /* "This can't happen." */ DBPRT(("%s: Queue %s not running, but too few nodes for job %s!\n", id, queue->qname, job->jobid)); continue; /* Move on to the next queue. */ } /* * Walk down the list of running jobs, counting up the resources that * will be available after each job completes. At each step, find * out if the waiting job will be able to run then. * * Note that this assumes the jobs will be sorted by ending time * from soonest to longest ending. */ /* Start out with what is available now. */ freenodes = queue->nodes_max - queue->nodes_assn; drainnodes = freenodes; for (rjob = queue->jobs; rjob != NULL; rjob = rjob->next) { /* Not running -- don't bother. */ if (rjob->state != 'R') continue; /* * Pretend that the running job has finished. If the waiting * job will be able to run at this time, then break out and * start this queue draining. */ running --; drainnodes += rjob->nodes; if (running < 0) { DBPRT(("Queue %s RAN OUT OF RUNNING JOBS!?\n", queue->qname)); rjob = NULL; break; } /* Would there be too many jobs running if this job were to run? */ if ((queue->maxrun != UNSPECIFIED) && (running >= queue->maxrun)) continue; /* * If there are not yet sufficient resources, then go on to the * next running job (if there is one). */ if (drainnodes < job->nodes) continue; /* * Calculate the absolute time at which this job is expected to * complete. If the waiting job will not be able to run at that * future time, then go on to the next running job. */ drainby = schd_TimeNow + rjob->time_left; /* * If we've walked past the empty_by time for the queue, then * the empty_by has been pushed forward. This will be done to * support draining a few jobs from a queue. That's it -- * don't bother going further. */ if (drainby > queue->empty_by) { DBPRT(("exceeds '%s' empty_by time\n", queue->qname)); DBPRT(("%s: %s already draining for another job.\n", id, queue->qname)); break; } if (!schd_dedicated_can_run(job, queue, drainby, buff)) continue; if (schd_primetime_limits(job, queue, drainby, buff)) continue; /* Stop examining waiting jobs. */ break; } /* * If 'rjob' is non-NULL, it points to a job in the current queue. * The waiting job will be able to run when this job ompletes. * If not, then the job cannot run in this queue. If this is the * case, go on to the next queue. */ if (rjob == NULL) continue; else DBPRT(("%s: %s can run in %s when %s completes (in %s).\n", id, job->jobid, queue->qname, rjob->jobid, schd_sec2val(rjob->time_left))); /* * If there is no shortest queue yet, then this is it. Otherwise, * see if the wait for this queue will be less than the current * shortest one. */ if ((shortest == NULL) || (drainby < mintime)) { mintime = drainby; shortest = queue; } } if (shortest) { /* reserve the number of currently free nodes that will be needed * later by this job. We only need to reserve what we will actully * use. Set the count of these reserved nodes in the Q struct. */ if (freenodes) shortest->nodes_rsvd = freenodes - (drainnodes - job->nodes); else shortest->nodes_rsvd = freenodes; if (shortest->running) shortest->drain_by = mintime; else shortest->drain_by = schd_TimeNow; } return (shortest); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/val2byte.c0000664000113300011330000001350611272401241020235 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: val2byte.c 2367 2008-09-03 17:17:34Z josh $ */ /* Convert a an allocation value string to its equivalent value in bytes. */ #include #include #include #include #include #include "toolkit.h" /* Power-of-two unit multipliers. */ #define KILO ((size_t)1024) #define MEGA (KILO*1024) #define GIGA (MEGA*1024) #define TERA (GIGA*1024) size_t schd_val2byte(char *val) { /* char *id = "schd_val2byte"; */ int b = 0; size_t num = 0; char *p; if (val == NULL) return (0); b = 0; num = 0; num = strtoul(val, &p, 0); #if 0 /* Dead code as of Feb 10, 1998. Remove no later than Feb 10, 1999. */ (void) sprintf(buffer, "1: val=[%s] num=%lld, p=[%s]", val, num, p); log_record(1, 1, id, buffer); #endif /* 0 */ /* Now 'p' should point to first non-number character. */ /* If no units given, return the number. */ if ((p == val) || (*p == '\0')) return (num); /* XXX return num if p == val? */ /* Parse the given order of magnitude. */ switch (*p) { case 'k': case 'K': num *= KILO; break; case 'm': case 'M': num *= MEGA; break; case 'g': case 'G': num *= GIGA; break; case 't': case 'T': num *= TERA; break; case 'b': case 'B': b++; break; default: return (-1); } /* XXX if (b && *p != '\0') return error. */ /* Parse the word-size unit. */ p++; if ((*p != '\0') && !b) { switch (*p) { case 'b': case 'B': break; case 'w': case 'W': num *= NBPW; /* Multiply by size of word. */ break; default: return (-1); } } /* Return the total number of bytes represented by the value. */ return (num); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/movejob.c0000664000113300011330000001663411272401241020153 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: movejob.c 2367 2008-09-03 17:17:34Z josh $ */ #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Toolkit header files */ #include "toolkit.h" #include "gblxvars.h" /* * Move the internal representation of the given job from the list on its * queue to the tail of the destination queue's list. * * If the destination queue is NULL, this is equivalent to deleting the job * from the per-queue lists. */ int schd_move_job_to(Job *thisjob, Queue *destq) { Job *prev, *tail; Queue *srcq; srcq = thisjob->queue; if (srcq == NULL) { DBPRT(("move_job_to(Job %s, Queue %s) before job->queue init'd\n", thisjob->jobid, destq ? destq->qname : "[dead]")); return (-1); } if (srcq->jobs == NULL) { DBPRT(("job %s says queue %s is owner, but joblist is NULL.\n", thisjob->jobid, srcq->qname)); return (-1); } /* * If the head of the source queue's job list is not the job in question, * walk down the list until we find the element before the job (i.e. * until the element's next pointer is equal to the job's pointer). */ prev = NULL; if (srcq->jobs != thisjob) { for (prev = srcq->jobs; prev != NULL; prev = prev->next) { if (prev->next == thisjob) break; } if (prev == NULL) { DBPRT(("job %s says queue %s is owner, but not on queue joblist.\n", thisjob->jobid, srcq->qname)); return (-1); } } /* * Remove the job from the source queue's list. The previous pointer may * be NULL -- this indicates that the job is the head of the source list. * In that case, simply move the source queue's pointer forward and we're * done. Otherwise, point the previous job's next pointer to skip over * this one. Either way, the job is no longer a list, so set its next * pointer to NULL. */ if (prev == NULL) srcq->jobs = srcq->jobs->next; else prev->next = thisjob->next; thisjob->next = NULL; if (destq) { /* * Append the job to the destination queue job list. Like the source * queue, a NULL pointer in queue->jobs indicates that the list is * empty. In this case, the detached job becomes the head of the * list. Otherwise, find the tail of the list and hook the new job * onto the end of the list. */ if (destq->jobs == NULL) { destq->jobs = thisjob; } else { for (tail = destq->jobs; tail->next != NULL; tail = tail->next) /* do nothing -- just walk the list */ ; tail->next = thisjob; } /* Make the destination the owner of the job. */ thisjob->queue = destq; } else { /* * Moving to a NULL queue is a job deletion. This job is no longer * referenced on the source, so will be lost. Free it's resources. */ schd_free_jobs(thisjob); } /* * Account for the moved job. Decrement the appropriate counters on the * source queue, and increment them on the destination queue (if present) */ switch (thisjob->state) { case 'R': srcq->running --; if (destq) destq->running ++; break; case 'Q': srcq->queued --; if (destq) destq->queued ++; break; default: /* Do nothing. Present for completeness. */ break; } return (0); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/config0000664000113300011330000004427411272401241017537 00000000000000# OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # ################################################################################ # Constant configuration file for the Cray T3E scheduler. This file needs to # be copied to the $(PBS_SERVER_HOME)/sched_priv directory before starting # the scheduler. # # Required arguments are marked by three question marks, ???. A default has # been provided for those options which provide scheduler optimizations. # If you do not wish to take advantage of an option, comment out the line. # # Boolean options take "On", "True", "Yes", "1" for true (case insensitive), # and anything else as false. # ################################################################################ ############################################################################### # This scheduler uses five execution queue types. Any changes to the queue # names in qmgr's list should be added here and vice versa. ############################################################################### # # The queues on the following lists are ordered from highest scheduling # priority to lowest. These are comma separated lists, if more space is # required, the list can be split into multiple lines. Each line must be # prefaced by the appropriate configuration option directive. # # All queues are associated with a particular execution host. They may be # specified either as 'queuename' or 'queuename@exechost'. If only the name # is given, the canonical name of the local host will be automatically # appended to the queue name. # The "normal" scheduling algorithm picks jobs off the SUBMIT_QUEUE and # attempts to run them on the BATCH_QUEUES. Jobs are enqueued onto the # SUBMIT_QUEUE via the 'qsub' command (set the default queue name in PBS # with the 'set server default_queue' qmgr command), and remain there # until they are rejected, run, or deleted. The host attached to the # SUBMIT_QUEUE is ignored - it is assumed to be on the server. # # Note that this implies that the SUBMIT_QUEUE's resources_max values must # be the union of all the BATCH_QUEUES' resources. # SUBMIT_QUEUE ??? # BATCH_QUEUES is a list of execution queues onto which the scheduler should # move and run the jobs it chooses from the SUBMIT_QUEUES. The algorithm used # in the scheduler relies on these queues being arranged from "smallest" to # "largest", as jobs are tested against the list of queues in the order listed, # and run on the queue which first provides enough resources for the job. # BATCH_QUEUES ??? # The SPECIAL_QUEUE is populated by "special" users via the "qsub -q" command. # Authorized users are listed in qmgr with the acl_users command. # When a job enters the SPECIAL_QUEUE, it will be run as soon as resources # become available. Sites with checkpoint/restart capabilities can enhance # this portion of the code so that any job that enters the SPECIAL_QUEUE will # be run "immediately". The special queue is a "special" submit queue, so # there may be only one on the machine. The hostname is ignored. # #SPECIAL_QUEUE ??? #CHALLENGE_QUEUE_NAME ??? #BACKGROUND_QUEUE_NAME ??? # Some sites may wish to schedule outages and dedicated times for the hosts # in the cluster. If you wish to submit jobs that will be queued during # regular times, and run on the machine during dedicated time, list a queue # for dedicated jobs on each machine. Each machine may have at most one # dedicated queue, and it is normally a queue that contains all the machine's # system resources. A comma separated list of queues is expected. # #DEDICATED_QUEUES ??? ############################################################################### # These options are used to optimize system load average and scheduler # effectiveness. It is a good idea to monitor system load as the user community # grows, shrinks, or changes its focus from porting and debugging to # production. These defaults were selected for a 64 processor system with 16gb # of memory. ############################################################################### # # Maximum number of jobs to run. This number can be different than the # combined total of max_running (per queue) limits specified in qmgr. # Sites with time-intensive users can set this higher than the maximum number # of processors. Sites with memory- or CPU- intensive users should set it # lower. As the max_running (per queue) limits change in qmgr, this option # should be revisited. # MAX_JOBS 16 # Minimum number of jobs to keep running. Please note that as the gap between # the MAX_JOBS and MIN_JOBS numbers shrinks, any dynamic backfilling algorithms # will be less effective. # MIN_JOBS 1 # Target Load Average refers to a target percentage of the maximum system # load average (1 point for each processor on the machine). It may vary # as much as the +/- percentages listed in TARGET_LOAD_VARIANCE. Jobs may # or may not be scheduled if the load is too high or too low, even if the # resources indicate that doing so would otherwise cause a problem. # The values below attempt to maintain a system load within 75% to 100% of # the theoretical maximum (load average of 48.0 to 64.0 for a 64-cpu machine). TARGET_LOAD_PCT 90% TARGET_LOAD_VARIANCE -15%,+10% ############################################################################### # These options are used to enforce site-specific policies. It is a good idea # to reevaluate these policies as the user community grows, shrinks, or changes # its focus from porting and debugging to production. ############################################################################### # # Check for Prime Time Enforcement. Sites with a mixed user base can use # this option to enforce separate scheduling policies at different times # during the day. Refer to the INTERACTIVE_QUEUES description for the current # prime-time scheduling policy. If ENFORCE_PRIME_TIME is set to "0", the # non-prime-time scheduling policy (as described in BATCH_QUEUES) will be used # for the entire 24 hour period. # # If enforcement is needed at some future time, it may be specified on the # configuration line instead of "True". The syntax of the date string is # MM/DD/YYYY@HH:MM:SS (due to limitations of the parsing engine). For # instance, to start enforcing primetime on January 1, 2000 at 8:00AM, use # the following configuration line: # # ENFORCE_PRIME_TIME 01/01/2000@08:00:00 # ENFORCE_PRIME_TIME False # Prime-time is defined as a time period each working day (Mon-Fri) # from PRIME_TIME_START through PRIME_TIME_END. Times are in 24 # hour format (i.e. 9:00AM is 9:00:00, 5:00PM is 17:00:00) with hours, # minutes, and seconds. Sites can use the prime-time scheduling policy for # the entire 24 hour period by setting PRIME_TIME_START and PRIME_TIME_END # back-to-back. The portion of a job that fits within primetime must be # no longer than PRIME_TIME_WALLT_LIMIT (represented in HH:MM:SS). # PRIME_TIME_START ??? PRIME_TIME_END ??? PRIME_TIME_WALLT_LIMIT ??? # Some systems may want a split time limit for small and large jobs. If this # is required, the split will be made at PRIME_TIME_SMALL_NODE_LIMIT nodes, # with jobs less than that value being allowed PRIME_TIME_SMALL_WALLT_LIMIT # time values, and larger jobs getting PRIME_TIME_WALLT_LIMIT. # For instance, for 8 nodes or more, give them PRIME_TIME_WALLT_LIMIT, but # if smaller, give them 5 minutes: #PRIME_TIME_SMALL_NODE_LIMIT 8 #PRIME_TIME_SMALL_WALLT_LIMIT 0:05:00 # Additionally, some sites may want a non-primetime walltime limit that is # different for different sized jobs. If so, set the SMALL_JOB_MAX option # to that size, and choose time limits. For instance, for more than 8 nodes, # give them 4 hours outside of primetime. Otherwise, give 2 hours. # # SMALL_JOB_MAX 8 # WALLT_LIMIT_LARGE_JOB 4:00:00 # WALLT_LIMIT_SMALL_JOB 2:00:00 # Interactive jobs that have been queued for (INTERACTIVE_LONG_WAIT + the # requested walltime) will be considered "long outstanding". This is based # on the theory that there is a human on the other end of the 'qsub -I', but # batch jobs have a looser idea of "long outstanding". # INTERACTIVE_LONG_WAIT 0:30:00 # Jobs that have been waiting on the submit queue for a long period of time # should be given higher priority, in order to prevent starvation. If the # scheduler should go out of its way to run a long-waiting job (even to the # extreme of draining the system for it), set the MAX_QUEUED_TIME to the # amount of time that is "too long". 24 to 48 hours is usually good. # MAX_QUEUED_TIME 24:00:00 # Check for Dedicated/Preventative Maintenance Time Enforcement. This option # requires the NAS 'pbsdedtime' command which in turn depends on the NAS # 'schedule' program. # # If enforcement is needed at some future time, it may be specified on the # configuration line instead of "True". The syntax of the date string is # MM/DD/YYYY@HH:MM:SS (due to limitations of the parsing engine). For # instance, to start enforcing dedicated time on January 1, 2000 at 8:00AM, # use the following configuration line: # # ENFORCE_DEDICATED_TIME 01/01/2000@08:00:00 # ENFORCE_DEDICATED_TIME False # Command used to check for upcoming dedicated/preventative maintenance time. # Supply the absolute path to NAS 'pbsdedtime' or a similar command. This # command will be executed with the short name of an execution host as its # only argument. For instance, "/usr/local/pbs/sbin/pbsdedtime hopper". # DEDICATED_TIME_COMMAND ??? # To minimize the impact on the schedule server, as well as reduce average # run time, the scheduler caches the responses for upcominig outages. # The last response from the DEDICATED_TIME_COMMAND will be cached for this # many seconds (300 is recommended). # The outages cache is invalidated upon catching a SIGHUP. # DEDICATED_TIME_CACHE_SECS 300 # If your machines are running in a cluster configuration, you can specify a # "logical system name" for the cluster as a whole. DEDICATED_TIME_COMMAND # must be able to return valid information for this "hostname". Any dedicated # times returned for SYSTEM_NAME will override the dedicated time (or the lack # thereof) for any host in the cluster. Overlaps will be resolved correctly, # with the system dedicated times getting priority. # This option may be useful if your schedule dedicated time for individual # hosts. Point SYSTEM_NAME to the front-end to prevent scheduling jobs when # the front-end is in dedicated time (otherwise, dedicated time is checked for # the back-ends only). #SYSTEM_NAME ??? # If SORT_BY_PAST_USAGE is non-zero, the list of jobs will be permuted to # bring the least active users' jobs to the front of the list. This may # provide some sense of fairness, but be warned that it may cause the choice # of jobs to be fairly inexplicable from the outside. The "past usage" is # decayed daily by one of two values, DECAY_FACTOR or OA_DECAY_FACTOR. The # OA_DECAY_FACTOR is used if the ENFORCE_ALLOCATION is on, and the user is # over their allocations. Decays must be <= 1.0, with lower numbers # indicating quicker decay. # SORT_BY_PAST_USAGE True #DECAY_FACTOR 0.75 #OA_DECAY_FACTOR 0.95 # Check for Allocation Enforcement. This option depends on the NAS ACCT++ # program and a Data Loading Client. # # If enforcement is needed at some future time, it may be specified on the # configuration line instead of "True". The syntax of the date string is # MM/DD/YYYY@HH:MM:SS (due to limitations of the parsing engine). For # instance, to start enforcing allocations on January 1, 2000 at 8:00AM, # use the following configuration line: # # ENFORCE_ALLOCATION 01/01/2000@08:00:00 # ENFORCE_ALLOCATION False # Absolute path to the $(PBS_SERVER_HOME)/pbs_acctdir directory which contains # the accounting year-to-date (YTD) and allocation files. # SCHED_ACCT_DIR ??? # Choose an action to take upon scheduler startup. The default is to do no # special processing (NONE). In some instances, for instance with check- # pointing, a job can end up queued in one of the batch queues, since it was # running before but was stopped by PBS. If the argument is RESUBMIT, these # jobs will be moved back to the first submit queue, and scheduled as if # they had just arrived. If the argument is RERUN, the scheduler will have # PBS run any jobs found enqueued on the execution queues. This may cause # the machine to get somewhat confused, as no limits checking is done (the # assumption being that they were checked when they were enqueued). # SCHED_RESTART_ACTION RESUBMIT # Use heuristics to attempt to reduce the problem of queue fragmentation. # If AVOID_FRAGMENTATION is set, jobs that will cause or prolong queue # fragmentation will not be run. Once the queue becomes fragmented, this # will clear the small jobs out of the queue by favoring larger jobs. # This is probably not very useful in most situations, but might help if # your site has lots of very small jobs and several queues. # AVOID_FRAGMENTATION False # In order to guarantee that large jobs will be able to run at night, set # the NONPRIME_DRAIN_SYS option to True. This will cause a hard barrier to # be set at the time between prime-time and non-prime-time, so the system # will drain down to idle just before non-prime-time begins. # NONPRIME_DRAIN_SYS False # For debugging and evaluation purposes, it might be useful to have a file # listing the "pre-scheduling" sorted list of jobs (including any special # attributes) updated at each run. If SORTED_JOB_DUMPFILE is specified, # the sorted list of jobs will be dumped into it. If special permissions, # etc, are needed, create it with those permissions before starting the # scheduler. If the file does not exist, it will be created with the default # permissions and owner/group. # # A good place for this file might be $(PBS_HOME)/sched_priv/sortedjobs # #SORTED_JOB_DUMPFILE ??? ############################################################################## # For testing, set TEST_ONLY to True to prevent any calls being made to PBS # that would change the jobs in any way. # #TEST_ONLY False # # The scheduler can multiply all system resources, load averages, node counts, # etc, by some integer value in order to simulate running on a larger system. # This can be used to test the expected behavior for a 128-processor machine, # on an 8-processor test host by setting FAKE_MACHINE_MULT to 16 (128 / 8). #FAKE_MACHINE_MULT 16 torque-2.4.16/src/scheduler.cc/samples/cray_t3e/getconfig.c0000664000113300011330000011523511272401241020454 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: getconfig.c 2367 2008-09-03 17:17:34Z josh $ */ /* * This module contains the necessary functions for * processing the config file and setting the * appropriate variables. These functions are: * * get_config: main loop for processing the config file * open_config: open the configuration file for read * close_config: close the configuration file * set_cf_gopt: validate the configuration file and * set appropriate variables */ #include #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "net_connect.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" #define MAX_LINE_SIZE 512 /* maximum line size */ extern int errno; static int post_config(void); static int validate_config(void); static int set_cfg_opt(char *, char *); static int arg_to_qlist(char *, char *, QueueList **); static int get_variance(char *, int *, int *); static void print_config(void); static int qlist_disjoint(QueueList *qlist1, QueueList *qlist2); static int qlist_unique(QueueList *qlist); static int qlist_one_per_host(QueueList *qlist); /* Main loop for processing the configuration file */ int schd_get_config(char *filename) { char *id = "schd_get_config"; char line[MAX_LINE_SIZE]; char cfg_option[MAX_LINE_SIZE]; char cfg_arg[MAX_LINE_SIZE]; FILE *cfgfd = NULL; char *comment; int linenum = 0, error = 0; size_t linelen; cfgfd = fopen(filename, "r"); if (cfgfd == NULL) { (void)sprintf(log_buffer, "Opening '%s': %s", filename, strerror(errno)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } /* Walk through the configuration file line by line. */ while (fgets(line, sizeof(line), cfgfd)) { linenum++; linelen = strlen(line); if (linelen == (sizeof(line) - 1)) { (void)sprintf(log_buffer, "Error in config file %s, line %d: Line too long", filename, linenum); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); error = -1; break; } else { linelen--; /* Move back to newline. */ line[linelen] = '\0'; /* And remove it. */ } /* If there is a comment on this line, remove it from view. */ if ((comment = strchr(line, '#')) != NULL) * comment = '\0'; if (strlen(line) < 2) continue; /* skip blank lines */ /* Split the option and the argument. */ if (sscanf(line, "%s %s", cfg_option, cfg_arg) != 2) { /* Unable to read a cfg_option and cfg_arg */ (void)sprintf(log_buffer, "Error in config file %s, line %d", filename, linenum); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); error = -1; break; } /* Set the configurable options */ if (set_cfg_opt(cfg_option, cfg_arg)) { /* Unable to parse the option. */ (void)sprintf(log_buffer, "Error parsing option '%s' in config file %s, line %d", cfg_option, filename, linenum); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); error = -1; break; } } /* Close the config file */ fclose(cfgfd); if (error) return (error); /* Do any post-configuration necessary. */ if (!post_config()) return (-1); if (!validate_config()) return (-1); print_config(); return (0); } /* * Now that an option and its argument have been read, validate them and * set the appropriate global configuration variables. */ static int set_cfg_opt(char *cfg_option, char *cfg_arg) { char *id = "set_cfg_opt"; /* XXX Should smash case on these before doing string compares? */ if (!strcmp(cfg_option, "TARGET_LOAD_PCT")) { schd_TARGET_LOAD_PCT = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "TARGET_LOAD_VARIANCE")) { return (get_variance(cfg_arg, &schd_TARGET_LOAD_MINUS, &schd_TARGET_LOAD_PLUS)); } if (!strcmp(cfg_option, "HIGH_SYSTIME")) { schd_HIGH_SYSTIME = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "MAX_JOBS")) { schd_MAX_JOBS = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "MIN_JOBS")) { schd_MIN_JOBS = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "MAX_DEDICATED_JOBS")) { schd_MAX_DEDICATED_JOBS = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "MAX_USER_RUN_JOBS")) { schd_MAX_USER_RUN_JOBS = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "ENFORCE_ALLOCATION")) { return schd_val2booltime(cfg_arg, &schd_ENFORCE_ALLOCATION); } if (!strcmp(cfg_option, "TEST_ONLY")) { return schd_val2bool(cfg_arg, &schd_TEST_ONLY); } if (!strcmp(cfg_option, "ENFORCE_DEDICATED_TIME")) { return schd_val2booltime(cfg_arg, &schd_ENFORCE_DEDTIME); } if (!strcmp(cfg_option, "DEDICATED_TIME_COMMAND")) { if (schd_DEDTIME_COMMAND) free(schd_DEDTIME_COMMAND); schd_DEDTIME_COMMAND = schd_strdup(cfg_arg); if (schd_DEDTIME_COMMAND == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_DEDTIME_COMMAND)"); return (-1); } return (0); } if (!strcmp(cfg_option, "DEDICATED_TIME_CACHE_SECS")) { schd_DEDTIME_CACHE_SECS = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "DECAY_FACTOR")) { schd_DECAY_FACTOR = atof(cfg_arg); return (0); } if (!strcmp(cfg_option, "OA_DECAY_FACTOR")) { schd_OA_DECAY_FACTOR = atof(cfg_arg); return (0); } if (!strcmp(cfg_option, "SCHED_ACCT_DIR")) { if (schd_SCHED_ACCT_DIR) free(schd_SCHED_ACCT_DIR); schd_SCHED_ACCT_DIR = schd_strdup(cfg_arg); if (schd_SCHED_ACCT_DIR == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_SCHED_ACCT_DIR)"); return (-1); } return (0); } if (!strcmp(cfg_option, "SYSTEM_NAME")) { if (schd_SYSTEM_NAME) free(schd_SYSTEM_NAME); schd_SYSTEM_NAME = schd_strdup(cfg_arg); schd_lowercase(schd_SYSTEM_NAME); return (0); } if (!strcmp(cfg_option, "SERVER_HOST")) { if (schd_SERVER_HOST) free(schd_SERVER_HOST); schd_SERVER_HOST = schd_strdup(cfg_arg); if (schd_SERVER_HOST == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_SERVER_HOST)"); return (-1); } schd_lowercase(schd_SERVER_HOST); return (0); } if (!strcmp(cfg_option, "SCHED_HOST")) { if (schd_SCHED_HOST) free(schd_SCHED_HOST); schd_SCHED_HOST = schd_strdup(cfg_arg); if (schd_SCHED_HOST == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_SCHED_HOST)"); return (-1); } schd_lowercase(schd_SCHED_HOST); return (0); } if (!strcmp(cfg_option, "SORTED_JOB_DUMPFILE")) { if (schd_JOB_DUMPFILE) free(schd_JOB_DUMPFILE); schd_JOB_DUMPFILE = schd_strdup(cfg_arg); if (schd_JOB_DUMPFILE == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_JOB_DUMPFILE)"); return (-1); } return (0); } if (!strcmp(cfg_option, "SCHED_RESTART_ACTION")) { if (strcmp(cfg_arg, "NONE") == 0) { schd_SCHED_RESTART_ACTION = SCHD_RESTART_NONE; return (0); } if (strcmp(cfg_arg, "RESUBMIT") == 0) { schd_SCHED_RESTART_ACTION = SCHD_RESTART_RESUBMIT; return (0); } if (strcmp(cfg_arg, "RERUN") == 0) { schd_SCHED_RESTART_ACTION = SCHD_RESTART_RERUN; return (0); } return (-1); /* Bad argument */ } if (!strcmp(cfg_option, "SORT_BY_PAST_USAGE")) { return schd_val2bool(cfg_arg, &schd_SORT_BY_PAST_USAGE); } if (!strcmp(cfg_option, "ENFORCE_PRIME_TIME")) { return schd_val2booltime(cfg_arg, &schd_ENFORCE_PRIME_TIME); } if (!strcmp(cfg_option, "PRIME_TIME_START")) { schd_PRIME_TIME_START = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "PRIME_TIME_END")) { schd_PRIME_TIME_END = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "PRIME_TIME_SMALL_NODE_LIMIT")) { schd_PT_SMALL_NODE_LIMIT = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "PRIME_TIME_SMALL_WALLT_LIMIT")) { schd_PT_SMALL_WALLT_LIMIT = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "PRIME_TIME_WALLT_LIMIT")) { schd_PT_WALLT_LIMIT = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "NONPRIME_DRAIN_SYS")) { return schd_val2bool(cfg_arg, &schd_NONPRIME_DRAIN_SYS); } if (!strcmp(cfg_option, "NP_DRAIN_BACKTIME")) { schd_NP_DRAIN_BACKTIME = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "NP_DRAIN_IDLETIME")) { schd_NP_DRAIN_IDLETIME = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "SMALL_JOB_MAX")) { schd_SMALL_JOB_MAX = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "WALLT_LIMIT_LARGE_JOB")) { schd_WALLT_LARGE_LIMIT = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "WALLT_LIMIT_SMALL_JOB")) { schd_WALLT_SMALL_LIMIT = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "MAX_QUEUED_TIME")) { schd_MAX_QUEUED_TIME = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "SMALL_QUEUED_TIME")) { schd_SMALL_QUEUED_TIME = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "INTERACTIVE_LONG_WAIT")) { schd_INTERACTIVE_LONG_WAIT = schd_val2sec(cfg_arg); return (0); } if (!strcmp(cfg_option, "SUBMIT_QUEUE")) { arg_to_qlist(cfg_arg, ",", &schd_SubmitQueue); return (0); } if (!strcmp(cfg_option, "BATCH_QUEUES")) { arg_to_qlist(cfg_arg, ",", &schd_BatchQueues); return (0); } if (!strcmp(cfg_option, "DEDICATED_QUEUES")) { arg_to_qlist(cfg_arg, ",", &schd_DedQueues); return (0); } if (!strcmp(cfg_option, "SPECIAL_QUEUE")) { if (schd_SpecialQueue) free(schd_SpecialQueue); schd_SpecialQueue = schd_strdup(cfg_arg); if (schd_SpecialQueue == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_SpecialQueue)"); return (-1); } return (0); } if (!strcmp(cfg_option, "CHALLENGE_QUEUE_NAME")) { if (schd_ChallengeQueue) free(schd_ChallengeQueue); schd_ChallengeQueue = schd_strdup(cfg_arg); if (schd_ChallengeQueue == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_ChallengeQueue)"); return (-1); } return (0); } if (!strcmp(cfg_option, "BACKGROUND_QUEUE_NAME")) { if (schd_BackgroundQueue) free(schd_BackgroundQueue); schd_BackgroundQueue = schd_strdup(cfg_arg); if (schd_BackgroundQueue == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(schd_BackgroundQueue)"); return (-1); } return (0); } if (!strcmp(cfg_option, "FAKE_MACHINE_MULT")) { schd_FAKE_MACH_MULT = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "AVOID_FRAGMENTATION")) { return schd_val2bool(cfg_arg, &schd_AVOID_FRAGS); } if (!strcmp(cfg_option, "USAGE_WEIGHT")) { schd_USAGE_WEIGHT = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "NODES_WEIGHT")) { schd_NODES_WEIGHT = atoi(cfg_arg); return (0); } if (!strcmp(cfg_option, "TIMEQ_WEIGHT")) { schd_TIMEQ_WEIGHT = atoi(cfg_arg); return (0); } /* Unknown option -- return an error. */ return (-1); } static int post_config(void) { /* char *id = "post_config"; */ /* Set up per-queue primetime enforcement. */ if (schd_BatchQueues) schd_reset_observed_pt(schd_BatchQueues); /* Post processing complete. */ return (1); } static int validate_config(void) { char *id = "validate_config"; char *xit = " Exiting."; /* * Some simple tests to make sure the configuration is * at least minimally rational. */ if (schd_TEST_ONLY) { (void)sprintf(log_buffer, "NOTE: Scheduler is in testing-only mode."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } DBPRT(("%s: validate submit queues\n", id)); if (schd_SubmitQueue == NULL) { (void)sprintf(log_buffer, "No SUBMIT_QUEUE specified.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (schd_SubmitQueue->next != NULL) { (void)sprintf(log_buffer, "Only one SUBMIT_QUEUE can be specified.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } DBPRT(("%s: validate batch queues\n", id)); if (schd_BatchQueues == NULL) { (void)sprintf(log_buffer, "No BATCH_QUEUES specified.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (!qlist_unique(schd_BatchQueues)) { (void)sprintf(log_buffer, "Queues listed in BATCH_QUEUES cannot be repeated.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (schd_ENFORCE_PRIME_TIME) { DBPRT(("%s: validate primetime\n", id)); if (schd_PRIME_TIME_START <= 0 || schd_PRIME_TIME_END <= 0) { (void)sprintf(log_buffer, "ENFORCE_PRIME_TIME set but PRIME_TIME_START/END is not " "specified.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (schd_PT_WALLT_LIMIT <= 0) { (void)sprintf(log_buffer, "ENFORCE_PRIME_TIME set but no PRIME_TIME_WALLT_LIMIT given."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if ((schd_PT_SMALL_NODE_LIMIT > 0) && (schd_PT_SMALL_WALLT_LIMIT <= 0)) { (void)sprintf(log_buffer, "PRIMETIME_SMALL_NODE_LIMIT set but no " "PRIME_TIME_SMALL_WALLT_LIMIT given."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if ((schd_PT_SMALL_NODE_LIMIT <= 0) && (schd_PT_SMALL_WALLT_LIMIT > 0)) { (void)sprintf(log_buffer, "PRIME_TIME_SMALL_WALLT_LIMIT set but no " "PRIMETIME_SMALL_NODE_LIMIT given."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } } if (schd_SMALL_JOB_MAX) { if (schd_WALLT_LARGE_LIMIT <= 0) { (void)sprintf(log_buffer, "SMALL_JOB_MAX set but no WALLT_LIMIT_LARGE_JOB given."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (schd_WALLT_SMALL_LIMIT <= 0) { (void)sprintf(log_buffer, "SMALL_JOB_MAX set but no WALLT_LIMIT_SMALL_JOB given."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } } if (schd_ENFORCE_DEDTIME) { DBPRT(("%s: validate dedicated queue\n", id)); if (schd_DedQueues == NULL) { (void)sprintf(log_buffer, "ENFORCE_DEDICATED_TIME set but no dedicated queues " "specified.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (!qlist_one_per_host(schd_DedQueues)) { (void)sprintf(log_buffer, "Only one DEDICATED_QUEUES entry per exechost allowed.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (!qlist_disjoint(schd_DedQueues, schd_BatchQueues)) { (void)sprintf(log_buffer, "Queues in DEDICATED_QUEUES may not be listed in BATCH_QUEUES.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } DBPRT(("%s: validate dedicated time command\n", id)); if (schd_DEDTIME_COMMAND == NULL) { (void)sprintf(log_buffer, "ENFORCE_DEDICATED_TIME set but no DEDICATED_TIME_COMMAND " "specified.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if (access(schd_DEDTIME_COMMAND, X_OK)) { (void)sprintf(log_buffer, "Execution denied for DEDICATED_TIME_COMMAND '%s'.%s", schd_DEDTIME_COMMAND, xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } } DBPRT(("%s: verify that queue sets are disjoint\n", id)); if (!qlist_disjoint(schd_SubmitQueue, schd_BatchQueues)) { (void)sprintf(log_buffer, "SUBMIT_QUEUE %s cannot be listed in BATCH_QUEUES.%s", schd_SubmitQueue->queue->qname, xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if ((schd_FAKE_MACH_MULT < 1)) { (void)sprintf(log_buffer, "FAKE_MACHINE_MULT must be integer number > 0.%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if ((schd_TIMEQ_WEIGHT < 0) || (schd_TIMEQ_WEIGHT > 10)) { (void)sprintf(log_buffer, "TIMEQ_WEIGHT must be integer number [0,1-10].%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if ((schd_USAGE_WEIGHT < 0) || (schd_USAGE_WEIGHT > 10)) { (void)sprintf(log_buffer, "USAGE_WEIGHT must be integer number [0,1-10].%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } if ((schd_NODES_WEIGHT < 0) || (schd_NODES_WEIGHT > 10)) { (void)sprintf(log_buffer, "NODES_WEIGHT must be integer number [0,1-10].%s", xit); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s\n", log_buffer)); return (0); } DBPRT(("%s: Scheduler configuration appears valid.\n", id)); return (1); } /* print_config(): Dump the current config to the log */ static void print_config(void) { char *id = "print_config"; QueueList *qptr; if (schd_TEST_ONLY) { (void)sprintf(log_buffer, "%-24s = %s", "TEST_ONLY", schd_bool2val(schd_TEST_ONLY)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if (schd_SubmitQueue) { (void)sprintf(log_buffer, "%-24s = %s@%s", "SUBMIT_QUEUE", schd_SubmitQueue->queue->qname, schd_SubmitQueue->queue->exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if (schd_BatchQueues) { for (qptr = schd_BatchQueues; qptr != NULL; qptr = qptr->next) { (void)sprintf(log_buffer, "%-24s = %s@%s", (qptr == schd_BatchQueues) ? "BATCH_QUEUES" : "", qptr->queue->qname, qptr->queue->exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } } if (schd_DedQueues) { for (qptr = schd_DedQueues; qptr != NULL; qptr = qptr->next) { (void)sprintf(log_buffer, "%-24s = %s@%s", (qptr == schd_DedQueues) ? "DEDICATED_QUEUES" : "", qptr->queue->qname, qptr->queue->exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } } (void)sprintf(log_buffer, "%-24s = %s", "ENFORCE_PRIME_TIME", schd_booltime2val(schd_ENFORCE_PRIME_TIME)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "PRIME_TIME_WALLT_LIMIT", schd_sec2val(schd_PT_WALLT_LIMIT)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); if (schd_PT_SMALL_NODE_LIMIT) { (void)sprintf(log_buffer, "%-24s = %d", "PRIME_TIME_SMALL_NODE_LIMIT", schd_PT_SMALL_NODE_LIMIT); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "PRIME_TIME_SMALL_WALLT_LIMIT", schd_sec2val(schd_PT_SMALL_WALLT_LIMIT)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } (void)sprintf(log_buffer, "%-24s = %s", "NONPRIME_DRAIN_SYS", schd_bool2val(schd_NONPRIME_DRAIN_SYS)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); if (schd_NP_DRAIN_BACKTIME > 0) { (void)sprintf(log_buffer, "%-24s = %s", "NP_DRAIN_BACKTIME", schd_sec2val(schd_NP_DRAIN_BACKTIME)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if (schd_NP_DRAIN_IDLETIME > 0) { (void)sprintf(log_buffer, "%-24s = %s", "NP_DRAIN_IDLETIME", schd_sec2val(schd_NP_DRAIN_IDLETIME)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } (void)sprintf(log_buffer, "%-24s = %s", "WALLT_LIMIT_LARGE_JOB", schd_sec2val(schd_WALLT_LARGE_LIMIT)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); if (schd_SMALL_JOB_MAX) { (void)sprintf(log_buffer, "%-24s = %d", "SMALL_JOB_MAX", schd_SMALL_JOB_MAX); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "WALLT_LIMIT_SMALL_JOB", schd_sec2val(schd_WALLT_SMALL_LIMIT)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } (void)sprintf(log_buffer, "%-24s = %s", "PRIME_TIME_START", schd_sec2val(schd_PRIME_TIME_START)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "PRIME_TIME_END", schd_sec2val(schd_PRIME_TIME_END)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %d%%", "TARGET_LOAD_PCT", schd_TARGET_LOAD_PCT); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = -%d%%,+%d%%", "TARGET_LOAD_VARIANCE", schd_TARGET_LOAD_MINUS, schd_TARGET_LOAD_PLUS); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %d", "HIGH_SYSTIME", schd_HIGH_SYSTIME); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %d", "MAX_JOBS", schd_MAX_JOBS); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %d", "MIN_JOBS", schd_MIN_JOBS); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "MAX_QUEUED_TIME", schd_sec2val(schd_MAX_QUEUED_TIME)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "SMALL_QUEUED_TIME", schd_sec2val(schd_SMALL_QUEUED_TIME)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %d", "INTERACTIVE_LONG_WAIT", schd_INTERACTIVE_LONG_WAIT); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %d", "MAX_DEDICATED_JOBS", schd_MAX_DEDICATED_JOBS); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "SORT_BY_PAST_USAGE", schd_bool2val(schd_SORT_BY_PAST_USAGE)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "ENFORCE_ALLOCATION", schd_booltime2val(schd_ENFORCE_ALLOCATION)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "ENFORCE_DEDICATED_TIME", schd_booltime2val(schd_ENFORCE_DEDTIME)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "SCHED_ACCT_DIR", schd_SCHED_ACCT_DIR ? schd_SCHED_ACCT_DIR : "[null]"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "DEDICATED_TIME_COMMAND", schd_DEDTIME_COMMAND ? schd_DEDTIME_COMMAND : "[null]"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "SYSTEM_NAME", schd_SYSTEM_NAME ? schd_SYSTEM_NAME : "[null]"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "SERVER_HOST", schd_SERVER_HOST ? schd_SERVER_HOST : "[null]"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "SCHED_HOST", schd_SCHED_HOST ? schd_SCHED_HOST : "[null]"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, "%-24s = %s", "SCHED_RESTART_ACTION", (schd_SCHED_RESTART_ACTION == SCHD_RESTART_NONE ? "NONE" : (schd_SCHED_RESTART_ACTION == SCHD_RESTART_RESUBMIT ? "RESUBMIT" : (schd_SCHED_RESTART_ACTION == SCHD_RESTART_RERUN ? "RERUN" : "?")))); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); if (schd_AVOID_FRAGS) { (void)sprintf(log_buffer, "%-24s = %s", "AVOID_FRAGMENTATION", schd_bool2val(schd_AVOID_FRAGS)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if (schd_JOB_DUMPFILE) { (void)sprintf(log_buffer, "%-24s = %s", "SORTED_JOB_DUMPFILE", schd_JOB_DUMPFILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } if (schd_FAKE_MACH_MULT != 1) { (void)sprintf(log_buffer, "%-24s = %d", "FAKE_MACHINE_MULT", schd_FAKE_MACH_MULT); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } } static int arg_to_qlist(char *arg, char *sep, QueueList **qlist_ptr) { char *id = "arg_to_qlist"; QueueList *qptr = NULL, *new; int num = 0; char *name, *exechost, canon[PBS_MAXHOSTNAME + 1]; /* * Multiple lines may be used to add queues to the queue list. Find * the tail of the passed-in list (if there is one), and assign the * qptr to the tail element. Later, the new element will be hung off * qptr's next field (or qptr will be set to it.) */ if (*qlist_ptr) { for (qptr = *qlist_ptr; qptr->next != NULL; qptr = qptr->next) /* Walk the list, looking for last element. */; } else { qptr = NULL; } for (name = strtok(arg, sep); name != NULL; name = strtok(NULL, sep)) { /* * If the list is NULL, create the first element and point qptr * at it. If not, take the qptr from the last iteration (which * will be the head the second time through) and place a new * element on its next pointer. Then replace qptr with the * address of the newly allocated struct. */ new = (QueueList *)malloc(sizeof(QueueList)); if (new == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "malloc(newQueue)"); goto error_in_list; } memset(new, 0, sizeof(QueueList)); if (qptr == NULL) { *qlist_ptr = new; qptr = *qlist_ptr; } else { qptr->next = new; qptr = new; } new->queue = (Queue *)malloc(sizeof(Queue)); if (new->queue == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "malloc(newQueue->queue)"); goto error_in_list; } memset(new->queue, 0, sizeof(Queue)); /* * Queue names may be either 'queue3' or 'queue3@exechost'. * If there is a '@', convert it to a '\0' and copy the two * halves of the string into the qname and exechost fields. * Otherwise, this queue is local to this host - paste in the * "local" hostname. */ if ((exechost = strchr(name, '@')) != NULL) { /* Parse queue@host into queue and hostname. */ *exechost = '\0'; /* '@' ==> '\0' to terminate qname */ exechost ++; /* Next character after the new '\0' */ if (get_fullhostname(exechost, canon, PBS_MAXHOSTNAME) == 0) { exechost = canon; /* Point at canonical name. */ } else { sprintf(log_buffer, "Warning: Cannot canonicalize queue %s@%s", name, exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } } else { exechost = schd_ThisHost; /* Queue lives on localhost. */ } new->queue->qname = schd_strdup(name); if (new->queue->qname == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(qname)"); goto error_in_list; } new->queue->exechost = schd_strdup(exechost); if (new->queue->exechost == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(exechost)"); goto error_in_list; } num++; } return (num); error_in_list: /* Something went wrong - delete the new list and return a fatal error. */ if (*qlist_ptr) { schd_destroy_qlist(*qlist_ptr); *qlist_ptr = NULL; } return (-1); } static int qlist_disjoint(QueueList *qlist1, QueueList *qlist2) { QueueList *q1, *q2; /* * If both pointers are NULL, or they point to the same list, then * they are obviously not disjoint sets. */ if (qlist1 == qlist2) return (0); /* * If any element of one list cannot be found in any element of the * other list, than the sets are disjoint. Walk the first list, and * search for the queue on the second list. If not found, then they * are disjoint. */ for (q1 = qlist1; q1 != NULL; q1 = q1->next) { for (q2 = qlist2; q2 != NULL; q2 = q2->next) /* Check the name, then break ties with exechost. */ if ((strcmp(q1->queue->qname, q2->queue->qname) == 0) && (strcmp(q1->queue->exechost, q2->queue->exechost) == 0)) { break; } if (q2 == NULL) return (1); } /* * Walk the second list, searching for the named queue on the first * list. If not found, then they are disjoint. */ for (q1 = qlist1; q1 != NULL; q1 = q1->next) { for (q2 = qlist2; q2 != NULL; q2 = q2->next) /* Make sure both the name and execution host match. */ if ((strcmp(q1->queue->qname, q2->queue->qname) == 0) && (strcmp(q1->queue->exechost, q2->queue->exechost) == 0)) { break; } if (q2 == NULL) return (1); } /* * Both lists contain the same set of (possibly repeated) elements. * They are not disjoint. */ return (0); } static int qlist_unique(QueueList *qlist) { QueueList *q1, *q2; /* No member of the empty set is repeated. */ if (qlist == NULL) return (1); /* A list with only 1 element cannot have repeated elements. */ if (qlist->next == NULL) return (1); /* * For each element in the list, see if any other element in the list * matches its queue name. If so, the members of the set are not unique. */ for (q1 = qlist; q1 != NULL; q1 = q1->next) for (q2 = qlist; q2 != NULL; q2 = q2->next) { /* Is this the *same pointer* (not the same name)? */ if (q1 == q2) continue; /* * If the queues match, then the list members are not unique. * Make sure both the name and execution host match. */ if ((strcmp(q1->queue->qname, q2->queue->qname) == 0) && (strcmp(q1->queue->exechost, q2->queue->exechost) == 0)) { return (0); } } /* No repeated elements found in the list -- it is unique. */ return (1); } /* Make sure no host is listed twice in the list. */ static int qlist_one_per_host(QueueList *qlist) { QueueList *q1, *q2; for (q1 = qlist; q1 != NULL; q1 = q1->next) { for (q2 = qlist; q2 != NULL; q2 = q2->next) { if (q1 == q2) continue; if (strcmp(q1->queue->exechost, q2->queue->exechost) == 0) return (0); } } return (1); /* No host mentioned more than once. */ } static int get_variance(char *string, int *lowp, int *highp) { /* char *id = "get_variance"; */ char *ptr, *buf, *end, sign; long n; int i, low = -1, high = -1; if ((string == NULL) || ((buf = schd_strdup(string)) == NULL)) return (-1); ptr = strtok(buf, ","); while (ptr != NULL) { /* Ensure that the string matches '{+-}[0-9][0-9]*%'. */ sign = *ptr; if ((sign != '+') && (sign != '-')) goto parse_error; ptr++; if ((*ptr < '0') || (*ptr > '9')) goto parse_error; n = strtol(ptr, &end, 10); if (n > INT_MAX) goto parse_error; i = (int)n; if (*end != '%') goto parse_error; if (sign == '-') { if (low >= 0) /* Already set. */ goto parse_error; else low = i; } else { if (high >= 0) /* Already set. */ goto parse_error; else high = i; } ptr = strtok(NULL, ","); } free(buf); *lowp = (low >= 0) ? low : 0; *highp = (high >= 0) ? high : 0; return (0); parse_error: free(buf); return (-1); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/misc.c0000664000113300011330000002201611272401241017434 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: misc.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" /* * POSIX/ANSI does not provide a portable method for finding the system time * of day at sub-second resolution. gettimeofday() is not POSIX 1003.1 * compliant, so it cannot be used if _POSIX_SOURCE is defined. * * POSIX 1003.1 provides the times() library call, which returns the number * of ticks since some fixed time. From this number of ticks, an elapsed * time can be calculated to sub-second granularity. Note that the system * must be asked how many ticks there are per second. */ #ifndef HAVE_GETTIMEOFDAY #if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)) || \ (defined(sgi) && (defined(_BSD_COMPAT) || defined(_BSD_TIME))) #define HAVE_GETTIMEOFDAY #endif /* ! _POSIX_SOURCE */ #endif /* ! HAVE_GETTIMEOFDAY */ void schd_timestamp(char *msg) { #ifdef DEBUG char *id = "schd_timestamp"; static char timestr[32]; time_t sec; struct tms tms; static clock_t oticks = 0; clock_t ticks; clock_t dsec, dmsec; static int tickspersec = 0; #ifdef HAVE_GETTIMEOFDAY struct timeval now; if (gettimeofday(&now, NULL)) { DBPRT(("%s: gettimeofday() failed.\n", id)); return; } sec = now.tv_sec; #else /* HAVE_GETTIMEOFDAY */ if (time(&sec) == (time_t)(-1)) { DBPRT(("%s: gettimeofday() failed.\n", id)); return; } #endif /* else HAVE_GETTIMEOFDAY */ strcpy(timestr, ctime(&sec)); timestr[19] = '\0'; #ifdef HAVE_GETTIMEOFDAY DBPRT(("%s: %-10s %s.%03ld ", id, (msg ? msg : "TIMESTAMP"), ×tr[11], now.tv_usec / 1000)); #else /* HAVE_GETTIMEOFDAY */ DBPRT(("%s: %-10s %s ", id, (msg ? msg : "TIMESTAMP"), ×tr[11])); #endif /* else HAVE_GETTIMEOFDAY */ /* If not already known, find the number of ticks per second. */ if (tickspersec == 0) { tickspersec = (int)sysconf(_SC_CLK_TCK); if (tickspersec < 0) { DBPRT(("%s: sysconf(_SC_CLK_TCK) failed.\n", id)); return; } } ticks = times(&tms); if (ticks == (clock_t)(-1)) { DBPRT(("%s: times() failed.\n", id)); return; } if (oticks) { dsec = (ticks - oticks) / tickspersec; dmsec = (((ticks - oticks) % tickspersec) * 1000) / tickspersec; DBPRT(("elapsed %d.%03d\n", dsec, dmsec)); } oticks = ticks; #endif /* DEBUG */ return; } /* * Free a set of QueueList structures that reference (through qptr->queue) * an existing set of Queue structs. The Queues themselves are not affected. */ int schd_free_qlist(QueueList *qlist) { QueueList *qptr, *next; int num = 0; for (qptr = qlist; qptr != NULL; qptr = next) { next = qptr->next; free(qptr); num++; } return (num); } /* * This function differs from the schd_free_qlist() function in that it * actually frees the Queue's themselves, while schd_free_qlist() simply * destroys the list structures that point to the Queue's. */ int schd_destroy_qlist(QueueList *list) { int num_items = 0; QueueList *qptr, *qnext; for (qptr = list; qptr != NULL; qptr = qnext) { qnext = qptr->next; if (qptr->queue->qname) free(qptr->queue->qname); /* Free strdup()'d storage. */ if (qptr->queue->useracl) schd_free_useracl(qptr->queue->useracl); if (qptr->queue->exechost) free(qptr->queue->exechost); free(qptr->queue); /* Free the queue struct. */ free(qptr); /* And the list that pointed to it. */ num_items++; /* Count it. */ } return (num_items); } /* * strdup(3) is not required for POSIX compliance, so we must provide a * "lookalike". */ char * schd_strdup(char *string) { size_t length; char *copy; /* * Allocate new space for a copy of the string contents, and a * trailing '\0'. */ length = strlen(string) + 1; copy = malloc(length); if (copy == NULL) return (NULL); memcpy(copy, string, length); return(copy); } /* * Convert characters of a string to lowercase. Return a pointer to * the original string. */ char * schd_lowercase(char *string) { char *p; for (p = string; *p != '\0'; p++) if (isupper(*p)) *p = tolower(*p); return (string); } /* * Return a pointer to a copy of the host part of the fqdn presented. I.e. * if fqdn is "foo.bar.com", copy the host part and return a pointer to it, * with the contents "foo". If it is already short, return a copy anyway. */ char * schd_shorthost(char *fqdn) { char *shorthost, *dotp; size_t length; /* Check for bogus fqdn. */ if (*fqdn == '.') return (NULL); if (dotp = strchr(fqdn, '.')) length = (size_t)(dotp - fqdn); else length = strlen(fqdn); if (shorthost = (char *)malloc(length + 1)) { memcpy(shorthost, fqdn, length); shorthost[length] = '\0'; } return (shorthost); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/gblxvars.h0000664000113300011330000001664411272401241020350 00000000000000/* $Id: gblxvars.h 2367 2008-09-03 17:17:34Z josh $ */ /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #ifndef GBLXVARS_H_ #define GBLXVARS_H_ #include #include extern Resources *schd_RsrcsList; /* Execution host resource list */ /* Queue lists */ extern QueueList *schd_SubmitQueue; /* Job submission queue. */ extern QueueList *schd_BatchQueues; /* Job execution queues. */ extern QueueList *schd_DedQueues; /* Dedicated time queues. */ /* * The list of jobs on the system. Jobs will be removed from this * list and placed onto the per-queue lists as they are initialized. * Anything remaining on this list belongs to a queue in which the * scheduler is not interested. */ extern Job *schd_AllJobs; extern Alloc_Group schd_GroupTable[]; /* True if this is the first run since reconfiguration. */ extern int schd_FirstRun; /* Scheduler Configuration Parameters */ extern int schd_TEST_ONLY; extern int schd_AVOID_FRAGS; extern int schd_SORT_BY_PAST_USAGE; extern time_t schd_ENFORCE_PRIME_TIME; extern int schd_NONPRIME_DRAIN_SYS; extern time_t schd_NP_DRAIN_BACKTIME; extern time_t schd_NP_DRAIN_IDLETIME; extern time_t schd_PRIME_TIME_START; extern time_t schd_PRIME_TIME_END; extern time_t schd_PT_SMALL_NODE_LIMIT; extern time_t schd_PT_SMALL_WALLT_LIMIT; extern time_t schd_PT_WALLT_LIMIT; extern time_t schd_SMALL_JOB_MAX; extern time_t schd_WALLT_LARGE_LIMIT; extern time_t schd_WALLT_SMALL_LIMIT; extern int schd_TARGET_LOAD_PCT; extern int schd_TARGET_LOAD_MINUS; extern int schd_TARGET_LOAD_PLUS; extern int schd_HIGH_SYSTIME; extern int schd_MAX_JOBS; extern int schd_MIN_JOBS; extern int schd_MAX_DEDICATED_JOBS; extern int schd_MAX_USER_RUN_JOBS; extern int schd_USAGE_WEIGHT; extern int schd_NODES_WEIGHT; extern int schd_TIMEQ_WEIGHT; extern int schd_MAX_NCPUS; extern char *schd_SERVER_HOST; extern char *schd_SCHED_HOST; extern time_t schd_ENFORCE_ALLOCATION; extern time_t schd_ENFORCE_DEDTIME; extern int schd_DEDTIME_CACHE_SECS; extern char *schd_SCHED_ACCT_DIR; extern char *schd_DEDTIME_COMMAND; extern char *schd_SYSTEM_NAME; extern char *schd_JOB_DUMPFILE; extern char *schd_SpecialQueue; extern char *schd_ChallengeQueue; extern char *schd_BackgroundQueue; #define SCHD_RESTART_NONE 0 #define SCHD_RESTART_RESUBMIT 1 #define SCHD_RESTART_RERUN 2 extern int schd_SCHED_RESTART_ACTION; /* * Pretend this machine is this many times as large as the real numbers * returned by resmom indicate. I.e. to treat a 4-node box as a 64, set * FAKE_MACHINE_MULT to '16'. */ extern int schd_FAKE_MACH_MULT; extern int schd_NeedToGetAllocInfo; extern int schd_NeedToGetYTDInfo; extern int schd_NumAllocation; extern time_t schd_TimeNow; extern time_t schd_TimeLast; extern time_t schd_TimeChk; extern struct tm schd_TmNow; extern char *schd_CfgFilename; extern char *schd_AllocFilename; extern char *schd_CurrentFilename; /* Global Variables added for User/Job Sorting - JJPJ */ extern int schd_NeedToGetDecayInfo; extern time_t schd_MAX_QUEUED_TIME; extern time_t schd_SMALL_QUEUED_TIME; extern time_t schd_INTERACTIVE_LONG_WAIT; extern double schd_DECAY_FACTOR; extern double schd_OA_DECAY_FACTOR; /* * Flags to prevent reconfiguration due to HUP while working. */ #define SCHD_SIGFLAGS_BUSY (1) #define SCHD_SIGFLAGS_RECONFIG (1 << 1) extern volatile sig_atomic_t schd_sigflags; extern char schd_ThisHost[]; #ifndef ALLOC_1ST #define ALLOC_1ST 64 #endif /* !ALLOC_1ST */ #ifndef ALLOC_INC #define ALLOC_INC 32 #endif /* !ALLOC_INC */ #endif /* ! GBLXVARS_H_ */ torque-2.4.16/src/scheduler.cc/samples/cray_t3e/bitfield.h0000664000113300011330000003342711272401241020300 00000000000000/* $Id: bitfield.h 2367 2008-09-03 17:17:34Z josh $ */ /* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #if PE_MASK != 0 /* * * Definition of interface for dealing with arbitrarily large numbers of * contiguous bits. Size of the bitfield is declared at compile time with * the BITFIELD_SIZE #define (default is 128 bits). * * Macros/inlines all take pointers to a Bitfield, and provide : * * Macro BITFIELD_CLRALL(Bitfield *p) * Macro BITFIELD_SETALL(Bitfield *p) * Clear or set all bits in a Bitfield. * * Macro BITFIELD_SET_LSB(Bitfield *p) * Macro BITFIELD_CLR_LSB(Bitfield *p) * Macro BITFIELD_SET_MSB(Bitfield *p) * Macro BITFIELD_CLR_MSB(Bitfield *p) * Set the least or most significant bit of a Bitfield. * * Macro BITFIELD_LSB_ISONE(Bitfield *p) * Macro BITFIELD_MSB_ISONE(Bitfield *p) * Equals non-zero if the least or most significant bit of the Bitfield * is set, or zero otherwise. * * Macro BITFIELD_SETB(Bitfield *p, int bit) * Macro BITFIELD_CLRB(Bitfield *p, int bit) * Macro BITFIELD_TSTB(Bitfield *p, int bit) * Set, clear, or test the bit at position 'bit' in the Bitfield '*p'. * BITFIELD_TSTB() is non-zero if the bit at position 'bit' is set, or * zero if it is clear. * * Inline BITFIELD_IS_ZERO(Bitfield *p) * Inline BITFIELD_IS_ONES(Bitfield *p) * Return non-zero if the bitfield is composed of all zeros or ones, * or zero if the bitfield is non-homogeneous. * * Inline BITFIELD_IS_NONZERO(Bitfield *p) * Returns non-zero if the bitfield contains at least one set bit. * * Inline BITFIELD_NUM_ONES(Bitfield *p) * Returns number of '1' bits in the bitfield. * * Inline BITFIELD_MS_ONE(Bitfield *p) * Inline BITFIELD_LS_ONE(Bitfield *p) * Returns bit position number of least or most significant 1-bit in * the Bitfield. * * Inline BITFIELD_EQ(Bitfield *p, Bitfield *q) * Inline BITFIELD_NOTEQ(Bitfield *p, Bitfield *q) * Return non-zero if Bitfields '*p' and '*q' are (not) equal. * * Inline BITFIELD_SETM(Bitfield *p, Bitfield *mask) * Inline BITFIELD_CLRM(Bitfield *p, Bitfield *mask) * Inline BITFIELD_ANDM(Bitfield *p, Bitfield *mask) * Inline BITFIELD_TSTM(Bitfield *p, Bitfield *mask) * Inline BITFIELD_TSTALLM(Bitfield *p, Bitfield *mask) * Apply the specified 'mask' to the given bitfield 'p': * SETM() sets bits in 'p' for any bits set in 'mask' ('p |= mask'). * CLRM() clears bits in 'p' for any bits set in 'mask' ('p &=~ mask'). * ANDM() logical-and's 'mask' into 'p' ('p &= mask'); * TSTM() returns non-zero if *any* bits set in 'mask' are set in 'p'. * TSTMALL() returns non-zero if *all* bits set in 'mask' are also set * in 'p'. * * Inline BITFIELD_CPY(Bitfield *p, Bitfield *q) * Inline BITFIELD_CPYNOTM(Bitfield *p, Bitfield *q) * Copy the (inverse of) bitfield 'q' into 'p'. * * Inline BITFIELD_ORNOTM(Bitfield *p, Bitfield *q) * Set any bits in 'p' where the corresponding bit in 'q' is clear. * (p |= ~q) * * Inline BITFIELD_SHIFTL(Bitfield *p) * Inline BITFIELD_SHIFTR(Bitfield *p) * Shift the bits in Bitfield 'p' one bit to the right or left. */ #ifndef BITFIELD_H_ #define BITFIELD_H_ /* The size of bitfields being used. Default to 128 bits. */ #ifndef BITFIELD_SIZE #define BITFIELD_SIZE 544 #endif /* !BITFIELD_SIZE */ #include #define BITFIELD_BPW ((int)(sizeof (unsigned long long) * 8)) #define BITFIELD_SHIFT(bit) ((bit) / BITFIELD_BPW) #define BITFIELD_OFFSET(bit) ((bit) & (BITFIELD_BPW - 1)) #define BITFIELD_WORDS (BITFIELD_SHIFT(BITFIELD_SIZE)) typedef struct bitfield { unsigned long long _bits[BITFIELD_WORDS]; } Bitfield; #if defined(sgi) # define INLINE __inline #else # define INLINE #endif /* Operate on least significant bit of a bitfield. */ #define BITFIELD_LSB_ISONE(p) \ ((p)->_bits[0] & 1ULL) #define BITFIELD_SET_LSB(p) \ ((p)->_bits[0] |= 1ULL) #define BITFIELD_CLR_LSB(p) \ ((p)->_bits[0] &= ~(1ULL)) /* Operate on most significant bit of a bitfield. */ #define BITFIELD_MSB_ISONE(p) \ ((p)->_bits[BITFIELD_SHIFT(BITFIELD_SIZE-1)] & (1ULL << (BITFIELD_BPW-1))) #define BITFIELD_SET_MSB(p) \ ((p)->_bits[BITFIELD_SHIFT(BITFIELD_SIZE-1)] |= (1ULL << (BITFIELD_BPW-1))) #define BITFIELD_CLR_MSB(p) \ ((p)->_bits[BITFIELD_SHIFT(BITFIELD_SIZE-1)] &= ~(1ULL << (BITFIELD_BPW-1))) /* Operate on arbitrary bits within the bitfield. */ #define BITFIELD_SETB(p,bit) (((bit) >= 0 && (bit) < BITFIELD_SIZE) ? \ (p)->_bits[BITFIELD_SHIFT(bit)] |= (1ULL << BITFIELD_OFFSET(bit)) : 0) #define BITFIELD_CLRB(p,bit) (((bit) >= 0 && (bit) < BITFIELD_SIZE) ? \ (p)->_bits[BITFIELD_SHIFT(bit)] &= ~(1ULL << BITFIELD_OFFSET(bit)) : 0) #define BITFIELD_TSTB(p,bit) (((bit) >= 0 && (bit) < BITFIELD_SIZE) ? \ ((p)->_bits[BITFIELD_SHIFT(bit)] & (1ULL << BITFIELD_OFFSET(bit))) : 0) /* Clear or set all the bits in the bitfield. */ #define BITFIELD_CLRALL(p) { \ int w; \ assert(p != NULL); \ for (w = 0; w < BITFIELD_WORDS; w++) \ (p)->_bits[w] = 0ULL; \ } #define BITFIELD_SETALL(p) { \ int w; \ assert(p != NULL); \ for (w = 0; w < BITFIELD_WORDS; w++) \ (p)->_bits[w] = ~(0ULL); \ } /* Comparison functions for two bitfield. */ INLINE int BITFIELD_IS_ZERO(Bitfield *p) { int w; assert(p != NULL); for (w = 0; w < BITFIELD_WORDS; w++) if ((p)->_bits[w]) return 0; return 1; } INLINE int BITFIELD_IS_ONES(Bitfield *p) { int w; assert(p != NULL); for (w = 0; w < BITFIELD_WORDS; w++) if ((p)->_bits[w] != ~(0ULL)) return 0; return 1; } INLINE int BITFIELD_IS_NONZERO(Bitfield *p) { int w; assert(p != NULL); for (w = 0; w < BITFIELD_WORDS; w++) if ((p)->_bits[w]) return 1; return 0; } INLINE int BITFIELD_NUM_ONES(Bitfield *p) { int w, cnt; unsigned long long n; assert(p != NULL); cnt = 0; for (w = 0; w < BITFIELD_WORDS; w++) for (n = (p)->_bits[w]; n != 0ULL; cnt++) n &= (n - 1); return (cnt); } INLINE int BITFIELD_LS_ONE(Bitfield *p) { int w, bit; unsigned long long n, x; assert(p != NULL); bit = 0; for (w = 0; w < BITFIELD_WORDS; w++) { n = (p)->_bits[w]; /* Look for the first non-zero word. */ if (n != 0ULL) break; bit += BITFIELD_BPW; } /* No non-zero words found in the bitfield. */ if (w == BITFIELD_WORDS) return (-1); /* Slide a single bit left, looking for the non-zero bit. */ for (x = 1ULL; !(n & x); bit ++) x <<= 1; return (bit); } INLINE int BITFIELD_MS_ONE(Bitfield *p) { int w, bit; unsigned long long n, x; assert(p != NULL); bit = BITFIELD_SIZE - 1; for (w = BITFIELD_WORDS - 1; w >= 0; w--) { n = (p)->_bits[w]; /* Look for the first non-zero word. */ if (n != 0ULL) break; bit -= BITFIELD_BPW; } /* No non-zero words found in the bitfield. */ if (w < 0) return (-1); /* Slide a single bit right, looking for the non-zero bit. */ for (x = 1ULL << BITFIELD_BPW - 1; !(n & x); bit--) x >>= 1; return (bit); } INLINE int BITFIELD_EQ(Bitfield *p, Bitfield *q) { int w; assert(p != NULL && q != NULL); for (w = 0; w < BITFIELD_WORDS; w++) if ((p)->_bits[w] != (q)->_bits[w]) return 0; return 1; } INLINE int BITFIELD_NOTEQ(Bitfield *p, Bitfield *q) { int w; assert(p != NULL && q != NULL); for (w = 0; w < BITFIELD_WORDS; w++) if ((p)->_bits[w] != (q)->_bits[w]) return 1; return 0; } /* Logical manipulation functions for applying one bitfield to another. */ INLINE int BITFIELD_SETM(Bitfield *p, Bitfield *mask) { int w; assert(p != NULL && mask != NULL); for (w = 0; w < BITFIELD_WORDS; w++) (p)->_bits[w] |= (mask)->_bits[w]; return 0; } INLINE int BITFIELD_CLRM(Bitfield *p, Bitfield *mask) { int w; assert(p != NULL && mask != NULL); for (w = 0; w < BITFIELD_WORDS; w++) (p)->_bits[w] &= ~((mask)->_bits[w]); return 0; } INLINE int BITFIELD_ANDM(Bitfield *p, Bitfield *mask) { int w; assert(p != NULL && mask != NULL); for (w = 0; w < BITFIELD_WORDS; w++) (p)->_bits[w] &= (mask)->_bits[w]; return 0; } INLINE int BITFIELD_TSTM(Bitfield *p, Bitfield *mask) { int w; assert(p != NULL && mask != NULL); for (w = 0; w < BITFIELD_WORDS; w++) if ((p)->_bits[w] & (mask)->_bits[w]) return 1; return 0; } INLINE int BITFIELD_TSTALLM(Bitfield *p, Bitfield *mask) { int w; assert(p != NULL && mask != NULL); for (w = 0; w < BITFIELD_WORDS; w++) if (((p)->_bits[w] & (mask)->_bits[w]) != (mask)->_bits[w]) return 0; return 1; } INLINE int BITFIELD_CPY(Bitfield *p, Bitfield *q) { int w; assert(p != NULL && q != NULL); for (w = 0; w < BITFIELD_WORDS; w++) (p)->_bits[w] = (q)->_bits[w]; return 0; } INLINE int BITFIELD_CPYNOTM(Bitfield *p, Bitfield *q) { int w; assert(p != NULL && q != NULL); for (w = 0; w < BITFIELD_WORDS; w++) (p)->_bits[w] = ~((q)->_bits[w]); return 0; } INLINE int BITFIELD_ORNOTM(Bitfield *p, Bitfield *q) { int w; assert(p != NULL && q != NULL); for (w = 0; w < BITFIELD_WORDS; w++) (p)->_bits[w] |= ~((q)->_bits[w]); return 0; } /* Logical shift left and shift right for bitfield. */ INLINE int BITFIELD_SHIFTL(Bitfield *p) { int w, upper; assert(p != NULL); for (w = 0; w < BITFIELD_WORDS - 1; w++) { upper = (p->_bits[w] & (1ULL << (BITFIELD_BPW - 1))) ? 1 : 0; p->_bits[w] <<= 1; p->_bits[w + 1] <<= 1; p->_bits[w + 1] |= upper; } return 0; } INLINE int BITFIELD_SHIFTR(Bitfield *p) { int w, lower; assert(p != NULL); for (w = BITFIELD_WORDS - 1; w > 0; w--) { lower = p->_bits[w] & 1ULL; p->_bits[w] >>= 1; p->_bits[w - 1] >>= 1; p->_bits[w - 1] |= (lower ? (1ULL << (BITFIELD_BPW - 1)) : 0); } return 0; } #endif /* BITFIELD_H_ */ #endif /* PE_MASK */ torque-2.4.16/src/scheduler.cc/samples/cray_t3e/runjob.c0000664000113300011330000002472311272401241020007 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: runjob.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Toolkit header files */ #include "toolkit.h" #include "gblxvars.h" extern int connector; /* * run_job_on(job, queue, set_comment) : * * Run the job pointed to by 'job' in the queue on which it is enqueued. * If 'queue' is non-NULL, move the job to the queue before running it. * If 'set_comment' is non-zero, the job comment will be changed to reflect * the time at which the job was started. */ int schd_run_job_on(Job *job, Queue *destq, char *exechost, int set_comment) { char *id = "schd_run_job_on"; Queue *srcq = NULL; char *date; char reason[128]; /* Get the datestamp from 'ctime()'. Remove the trailing '\n'. */ date = ctime(&schd_TimeNow); date[strlen(date) - 1] = '\0'; if (job->state != 'Q') { (void)sprintf(log_buffer, "run_job_on(%s, %s) called with job not in 'Q' state.\n", job->jobid, (destq ? destq->qname : "(NULL)")); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } if (set_comment) { sprintf(reason, "Started on %s", date); if (job->flags & JFLAGS_PRIORITY) { strcat(reason, " (special access job)"); } else if (job->flags & JFLAGS_WAITING) { strcat(reason, " (waited too long)"); } schd_comment_job(job, reason, JOB_COMMENT_REQUIRED); } /* Fix added by jjones per Dr. Hook to change behavior of jobs being * moved from submit queue to exec queue before run, at request of * ERDC. */ #if 0 /* * If a destination Queue is provided, and it is different from the * source queue, then ask PBS to move the job to that queue before * running it. */ srcq = job->queue; if ((destq != NULL) && (strcmp(destq->qname, srcq->qname) != 0)) { /* Move the job from its queue to the specified run queue. */ if (schd_TEST_ONLY) { DBPRT(("%s: would have moved %s from queue %s to queue %s\n", id, job->jobid, srcq->qname, destq->qname)); } else { if (pbs_movejob(connector, job->jobid, destq->qname, NULL)) { (void)sprintf(log_buffer, "move job %s to queue %s failed, %d", job->jobid, destq->qname, pbs_errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } } schd_move_job_to(job, destq); } #endif /* Give the job handle (JOBID) to PBS to run. */ if (schd_TEST_ONLY) { DBPRT(("%s: would have run %s on queue %s\n", id, job->jobid, destq->qname)); } else { if (pbs_runjob(connector, job->jobid, exechost, NULL)) { (void)sprintf(log_buffer, "failed start job %s on queue %s@%s, %d", job->jobid, destq->qname, exechost, pbs_errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); #if 0 /* * Running failed! Move the job back to the source queue (if * applicable) before returning. This prevents jobs being marooned * in execution queues. */ if (srcq) { DBPRT(("Attempting to move job %s back to queue %s\n", job->jobid, srcq->qname)); if (pbs_movejob(connector, job->jobid, srcq->qname, NULL)) { (void)sprintf(log_buffer, "failed to move job %s back to queue %s, %d", job->jobid, srcq->qname, pbs_errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } schd_move_job_to(job, srcq); } #endif return (-1); } } /* PBS accepted the job (and presumably will run it). Log it. */ (void)sprintf(log_buffer, "job %s started on %s@%s", job->jobid, destq->qname, exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); /* * Change the state of the local representation of the job to "Running". */ job->state = 'R'; /* * Account for the job on this queue's statistics. 'queued' will be * bumped up if the queued job was moved to a new destination queue. */ job->queue->queued --; job->queue->running ++; /* The queue is no longer idle. Unset the idle timer. */ job->queue->idle_since = 0; return (0); /* Job successfully started. */ } /* * schd_charge_job(job, queue, rsrcs) * * Account for the job resources requested by 'job' in the assigned and * available resources in 'queue' and 'rsrcs' * * Possible side effects: * - If job allocates all of some resource, the queue will be marked "FULL". * - queue->empty_by time may be extended to the end of this job. * * Returns 0 on success. */ int schd_charge_job(Job *job, Queue *queue, Resources *rsrcs) { #ifdef DEBUG char *id = "schd_charge_job"; #endif /* DEBUG */ time_t job_ends; /* Update the queue and resources with the job's expected usage. */ queue->nodes_assn += job->nodes; rsrcs->nodes_alloc += job->nodes; rsrcs->freemem -= (job->nodes * MB_PER_NODE); rsrcs->njobs ++; /* Has the queue node limit been reached? If so, note it and fail. */ if ((queue->nodes_max != UNSPECIFIED) && (queue->nodes_max <= queue->nodes_assn)) { DBPRT(("%s: Queue %s node limit (%d) reached - mark full\n", id, queue->qname, queue->nodes_max)); queue->flags |= QFLAGS_FULL; } /* * If job specified a walltime, see if the queue "empty at" time needs * to be updated. This function should only be called once we are * committed to running this job, so it is appropriate to update this * value at this point. */ if (job->walltime != UNSPECIFIED) { job_ends = schd_TimeNow + job->walltime; if (job_ends > queue->empty_by) { DBPRT(("%s: Queue %s empty_by %s to %s", id, queue->qname, queue->empty_by ? "bumped" : "set to", ctime(&job_ends))); queue->empty_by = job_ends; } } /* Lastly, update the Recent Usage Table used by the sorting algorithm */ schd_update_resource_usage(job); return (0); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/acl_support.c0000664000113300011330000001702111272401241021034 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include #include #include #include /* PBS header files */ #include "pbs_ifl.h" #include "log.h" /* Toolkit header files */ #include "toolkit.h" /* * Parse a string like "foo@*.bar.com,bar@qux.baz.org,fred@pox.com" into a * linked list of UserAcl's. Each element's user [and possibly host] field * points to an individually schd_strdup()'d string. */ UserAcl * schd_create_useracl(char *useracl) { char *id = "schd_create_useracl"; char *useracl_copy, *user, *atsign; UserAcl *acl, *new, *acltail; /* * Copy the string. This copy will be chopped up with '\0's to create * the strings pointed to by the array of UserAcl's pointed to by acl. */ if ((useracl_copy = schd_strdup(useracl)) == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(useracl) failed"); DBPRT(("schd_strdup(useracl) failed\n")); return (NULL); } acl = NULL; acltail = NULL; user = strtok(useracl_copy, ","); while (user != NULL) { new = (UserAcl *)malloc(sizeof(UserAcl)); if (new == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "malloc(UserAcl) failed"); DBPRT(("malloc(UserAcl) failed\n")); if (acl) schd_free_useracl(acl); return (NULL); } /* * If a host string is given, change the '@' into a '\0' to terminate * the user string (for the strncpy() below) and place a reference to * a copy of the host string into the host pointer. */ new->host = NULL; if ((atsign = strchr(user, '@')) != NULL) { *atsign = '\0'; /* Skip forward to the start of the remaining host string. */ atsign ++; new->host = schd_strdup(atsign); if (new->host == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(host) failed"); DBPRT(("schd_strdup(host) failed\n")); if (acl) schd_free_useracl(acl); free(new); return (NULL); } } /* * Copy the username into the static array in the UserAcl struct. */ strncpy(new->user, user, PBS_MAXUSER); /* * Place the new ACL element on the tail of the list, or create it * if this is the first element. */ if (acltail) acltail->next = new; else acl = new; acltail = new; acltail->next = NULL; /* Move on to the next user entry in the list. */ user = strtok(NULL, ","); } /* * Free the storage used by the copy of the string that was strtok()'d. */ free(useracl_copy); return (acl); } int schd_free_useracl(UserAcl *acl) { int num = 0; UserAcl *aclptr, *aclnext; for (aclptr = acl; aclptr != NULL; aclptr = aclnext) { aclnext = aclptr->next; if (aclptr->host) free(aclptr->host); free(aclptr); num ++; } return (num); } int schd_useracl_okay(Job *job, Queue *queue, char *reason) { /* char *id = "schd_useracl_okay"; */ UserAcl *ptr; char *jobowner; /* No ACL? Don't disallow this user. */ if (!(queue->flags & QFLAGS_USER_ACL)) return 1; jobowner = job->owner; for (ptr = queue->useracl; ptr != NULL; ptr = ptr->next) { if (!strcmp(jobowner, ptr->user)) { return (1); } /* Note: we are ignoring the host for now. */ } if (reason) sprintf(reason, "Denied by queue %s access control list", queue->qname); return (0); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/schedinit.c0000664000113300011330000004546611272401241020471 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: schedinit.c 2367 2008-09-03 17:17:34Z josh $ */ #define LIVE_DANGEROUSLY 1 /* * Perform any scheduler initialization. */ #include #include #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "net_connect.h" #include "sched_cmds.h" #include "log.h" #include "toolkit.h" #include "gblxvars.h" /* * Flag register to prevent SIGHUP from causing a reconfiguration * while the current configuration is in use. SCHD_SIGFLAGS_BUSY * is set when the scheduler is actively using the structs defined * by the configuration. The SIGHUP handler sets the flag * SCHD_SIGFLAGS_RECONFIG which signals the scheduler to reconfigure * itself before beginning the next scheduling iteration. */ volatile sig_atomic_t schd_sigflags = 0; /* * Declarations of global variables related to configuration */ /* Queue lists. */ QueueList *schd_SubmitQueue = NULL; QueueList *schd_BatchQueues = NULL; QueueList *schd_DedQueues = NULL; int schd_FirstRun = 1; int schd_MAX_NCPUS = 1; /* Scheduler configuration parameters */ int schd_TEST_ONLY = 0; int schd_AVOID_FRAGS = 1; int schd_SORT_BY_PAST_USAGE = 1; int schd_STARVATION_TIMEOUT = 0; time_t schd_ENFORCE_PRIME_TIME = 0; int schd_NONPRIME_DRAIN_SYS = 0; time_t schd_NP_DRAIN_BACKTIME = 0; time_t schd_NP_DRAIN_IDLETIME = 0; time_t schd_PRIME_TIME_START = 0; time_t schd_PRIME_TIME_END = 0; time_t schd_PT_SMALL_NODE_LIMIT = 0; time_t schd_PT_SMALL_WALLT_LIMIT = 0; time_t schd_PT_WALLT_LIMIT = 0; time_t schd_WALLT_LARGE_LIMIT = 0; time_t schd_WALLT_SMALL_LIMIT = 0; time_t schd_SMALL_JOB_MAX = 0; int schd_TARGET_LOAD_PCT = 90; int schd_TARGET_LOAD_MINUS = 15; int schd_TARGET_LOAD_PLUS = 10; int schd_HIGH_SYSTIME = 0; int schd_MAX_JOBS = 0; int schd_MIN_JOBS = 0; int schd_MAX_DEDICATED_JOBS = 0; int schd_MAX_USER_RUN_JOBS = 10; time_t schd_MAX_QUEUED_TIME = 0; time_t schd_SMALL_QUEUED_TIME = 60 * 60 * 12; time_t schd_INTERACTIVE_LONG_WAIT = 0; int schd_SCHED_RESTART_ACTION = 0; time_t schd_ENFORCE_ALLOCATION = 0; time_t schd_ENFORCE_DEDTIME = 0; int schd_DEDTIME_CACHE_SECS = 0; int schd_FAKE_MACH_MULT = 1; int schd_USAGE_WEIGHT = 10; int schd_NODES_WEIGHT = 7; int schd_TIMEQ_WEIGHT = 1; char *schd_SCHED_ACCT_DIR = NULL; char *schd_DEDTIME_COMMAND = NULL; char *schd_SYSTEM_NAME = NULL; char *schd_SERVER_HOST = NULL; char *schd_SCHED_HOST = NULL; char *schd_JOB_DUMPFILE = NULL; char *schd_SpecialQueue = NULL; char *schd_ChallengeQueue = NULL; char *schd_BackgroundQueue = NULL; double schd_DECAY_FACTOR = 0.75; double schd_OA_DECAY_FACTOR = 0.95; char schd_ThisHost[PBS_MAXHOSTNAME]; char *schd_CmdStr[16]; char *schd_CfgFilename = NULL; char *schd_AllocFilename = NULL; char *schd_CurrentFilename = NULL; char *schd_VersionString = "Custom PBS T3e Scheduler (version 1.1)\n"; static void catch_HUP(int signo); static void reset_config(void); static void create_sched_cmdstr(void); /* * Initialize the scheduler from the configuration and holidays files. */ /*ARGSUSED*/ int schedinit(int argc, char *argv[]) { char *id = "schedinit"; struct utsname name; struct sigaction act, oact; char *ptr, canon[PBS_MAXHOSTNAME + 1]; size_t len; DBPRT(("\n%s\n", schd_VersionString)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, schd_VersionString); /* * If this is the initial startup configuration, then schd_TimeNow will * be 0. Initialize it to the current time, so it can be tested against * various times when initializing. */ if (schd_TimeNow == 0) { schd_TimeNow = time(NULL); DBPRT(("%s: initialize/startup at %s", id, ctime(&schd_TimeNow))); } /* * Determine location of configuration file. Check for the presence of * the PBSSCHED_CONFIG environment variable. If not defined, fall back * to the compiled default CONFIGFILE. * * Since neither the environment variables nor the compiled-in default * can be changed (with the exception of someone wreaking havoc with * a debugger or something), this only needs to be done once. */ if (schd_CfgFilename == NULL) { ptr = getenv("PBSSCHED_CONFIG"); if (ptr == NULL) ptr = CONFIGFILE; schd_CfgFilename = schd_strdup(ptr); if (schd_CfgFilename == NULL) { (void)sprintf(log_buffer, "schd_strdup() failed for configfile"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } } /* * From this point on, goto cleanup_and_error: to clean up any allocated * storage for filenames. */ DBPRT(("SCHEDINIT: Reading configuration from '%s'\n", schd_CfgFilename)); /* Reset the configuration to a "known" state. */ reset_config(); /* Determine on what host this scheduler running. */ uname(&name); if (get_fullhostname(name.nodename, canon, PBS_MAXHOSTNAME) == 0) { strncpy(schd_ThisHost, canon, PBS_MAXHOSTNAME); } else { (void)sprintf(log_buffer, "Failed to canonicalize uname %s (using it anyway)", name.nodename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); strncpy(schd_ThisHost, name.nodename, PBS_MAXHOSTNAME); } schd_lowercase(schd_ThisHost); DBPRT(("%s: This host is '%s'\n", id, schd_ThisHost)); /* * Register the state of the config file. The call to reset_config() * above will have cleared all file watches. */ if (schd_register_file(schd_CfgFilename)) { (void)sprintf(log_buffer, "cannot watch %s", schd_CfgFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); goto cleanup_and_error; } /* Read the configuration file. */ if (schd_get_config(schd_CfgFilename)) return (-1); /* * Register the state of the holidays file. This allows schd_req() to * reload it if it is changed. */ if (schd_register_file(HOLIDAYS_FILE)) { (void)sprintf(log_buffer, "cannot watch %s", HOLIDAYS_FILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); goto cleanup_and_error; } /* Get a list of prime/non-prime times from the holidays file */ if (schd_read_holidays() < 0) return (-1); /* * SCHED_ACCT_DIR is a configuration option. Thus, the allocations * and current file may change location or may go away if the * ENFORCE_ALLOCATION option is turned off. If they are needed, * allocate space for the filenames, create the filenames from the * schd_SCHED_ACCT_DIR and trailing pathnames, and then register * them with the file watcher. */ if (schd_AllocFilename != NULL) free(schd_AllocFilename); if (schd_CurrentFilename != NULL) free(schd_CurrentFilename); if (schd_ENFORCE_ALLOCATION && schd_TimeNow >= schd_ENFORCE_ALLOCATION) { len = strlen(schd_SCHED_ACCT_DIR); schd_AllocFilename = (char *)malloc(len + strlen("/allocations") + 1); if (schd_AllocFilename == NULL) { (void)sprintf(log_buffer, "malloc() failed for allocations filename"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); goto cleanup_and_error; } schd_CurrentFilename = (char *)malloc(len + strlen("/current") + 1); if (schd_CurrentFilename == NULL) { (void)sprintf(log_buffer, "malloc() failed for current filename"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); goto cleanup_and_error; } (void)sprintf(schd_AllocFilename, "%s/allocations", schd_SCHED_ACCT_DIR); (void)sprintf(schd_CurrentFilename, "%s/current", schd_SCHED_ACCT_DIR); if (schd_register_file(schd_AllocFilename)) { (void)sprintf(log_buffer, "Cannot watch %s", schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); goto cleanup_and_error; } if (schd_register_file(schd_CurrentFilename)) { (void)sprintf(log_buffer, "Cannot watch %s", schd_CurrentFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); goto cleanup_and_error; } } /* * Set up a signal handler for SIGHUP. catch_HUP() will re-read the * configuration file. */ act.sa_flags = 0; act.sa_handler = catch_HUP; sigemptyset(&act.sa_mask); if (sigaction(SIGHUP, &act, &oact)) { (void)sprintf(log_buffer, "Failed to setup SIGHUP handler."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } DBPRT(("SCHEDINIT: configuration complete.\n")); return (0); cleanup_and_error: /* * Some error occurred. Remove watches and free the storage allocated * for the filenames. */ if (schd_CfgFilename) { schd_forget_file(schd_CfgFilename); free(schd_CfgFilename); } if (schd_AllocFilename) { schd_forget_file(schd_AllocFilename); free(schd_AllocFilename); } if (schd_CurrentFilename) { schd_forget_file(schd_CurrentFilename); free(schd_CurrentFilename); } schd_CfgFilename = NULL; schd_AllocFilename = NULL; schd_CurrentFilename = NULL; return (-1); } /*ARGSUSED*/ static void catch_HUP(int signo) { /* * Arrange for the configuration file to be re-read before the next * scheduling iteration. It is not safe (due to global state in the * C library) to use any stream-based I/O (c.f. POSIX1003.1, Section * 3.3.1.3, note 3f). * * However, if you are willing to live dangerously, you could * reconfigure if the scheduler is not using the structs. */ #ifdef LIVE_DANGEROUSLY /* * If the scheduler is not busy, reconfigure on the fly. * next run. Otherwise, just do it. You may lose badly doing this. */ if (!(schd_sigflags & SCHD_SIGFLAGS_BUSY)) { DBPRT(("Caught a SIGHUP. Reconfiguring.\n")); if (schedinit(0, NULL)) exit(0); return; } else DBPRT(("Caught a SIGHUP. Scheduling reconfiguration when idle.\n")); #endif /* LIVE_DANGEROUSLY */ /* Arrange for the scheduler to reconfigure itself next time around. */ schd_sigflags |= SCHD_SIGFLAGS_RECONFIG; return; } /* * Reset the scheduler's configuration to a "known" state. */ static void reset_config(void) { /* char *id = "reset_config"; */ /* * Clear out any contents of the lists previously defined. */ if (schd_SubmitQueue) schd_destroy_qlist(schd_SubmitQueue); if (schd_BatchQueues) schd_destroy_qlist(schd_BatchQueues); if (schd_DedQueues) schd_destroy_qlist(schd_DedQueues); /* * Clear queue list head pointers. The contents of the lists have * been destroyed, but the head still points to invalidated memory. */ schd_SubmitQueue = NULL; schd_BatchQueues = NULL; schd_DedQueues = NULL; schd_FirstRun = 1; /* First run since reconfig */ /* * Reset scheduler configuration parameters */ schd_TEST_ONLY = 0; schd_AVOID_FRAGS = 1; schd_SORT_BY_PAST_USAGE = 1; schd_NONPRIME_DRAIN_SYS = 0; schd_NP_DRAIN_BACKTIME = 0; schd_NP_DRAIN_IDLETIME = 0; schd_ENFORCE_PRIME_TIME = 0; schd_PRIME_TIME_START = 0; schd_PRIME_TIME_END = 0; schd_PT_SMALL_NODE_LIMIT = 0; schd_PT_SMALL_WALLT_LIMIT = 0; schd_PT_WALLT_LIMIT = 0; schd_WALLT_LARGE_LIMIT = 0; schd_WALLT_SMALL_LIMIT = 0; schd_SMALL_JOB_MAX = 0; schd_TARGET_LOAD_PCT = 90; schd_TARGET_LOAD_MINUS = 15; schd_TARGET_LOAD_PLUS = 10; schd_HIGH_SYSTIME = 0; schd_MAX_JOBS = 0; schd_MIN_JOBS = 0; schd_MAX_DEDICATED_JOBS = 0; schd_MAX_USER_RUN_JOBS = 10; schd_MAX_QUEUED_TIME = 0; schd_SMALL_QUEUED_TIME = 60 * 60 * 12; schd_INTERACTIVE_LONG_WAIT = 0; schd_SCHED_RESTART_ACTION = 0; schd_ENFORCE_ALLOCATION = 0; schd_ENFORCE_DEDTIME = 0; schd_DEDTIME_CACHE_SECS = 0; schd_FAKE_MACH_MULT = 1; schd_DECAY_FACTOR = 0.75; schd_OA_DECAY_FACTOR = 0.95; schd_USAGE_WEIGHT = 10; schd_NODES_WEIGHT = 7; schd_TIMEQ_WEIGHT = 1; /* * Free allocated storage for configuration commands. */ if (schd_SERVER_HOST) free(schd_SERVER_HOST); if (schd_SCHED_HOST) free(schd_SCHED_HOST); if (schd_SCHED_ACCT_DIR) free(schd_SCHED_ACCT_DIR); if (schd_DEDTIME_COMMAND) free(schd_DEDTIME_COMMAND); if (schd_SYSTEM_NAME) free(schd_SYSTEM_NAME); if (schd_JOB_DUMPFILE) free(schd_JOB_DUMPFILE); if (schd_SpecialQueue) free(schd_SpecialQueue); if (schd_ChallengeQueue) free(schd_ChallengeQueue); if (schd_BackgroundQueue) free(schd_BackgroundQueue); schd_SERVER_HOST = NULL; schd_SCHED_HOST = NULL; schd_SCHED_ACCT_DIR = NULL; schd_DEDTIME_COMMAND = NULL; schd_SYSTEM_NAME = NULL; schd_JOB_DUMPFILE = NULL; schd_SpecialQueue = NULL; schd_ChallengeQueue = NULL; schd_BackgroundQueue = NULL; /* * Set flags indicating that allocation and usage files need to * be loaded again. They are updated nightly. By doing this here, * they will be reloaded when the config is reloaded as well. */ schd_NeedToGetAllocInfo = 1; schd_NeedToGetYTDInfo = 1; schd_NeedToGetDecayInfo = 1; /* * Clear file change times. NULL means "clear all files". */ schd_forget_file(NULL); schd_NumAllocation = 0; schd_clear_outage_cache(); schd_ThisHost[0] = '\0'; /* Get the text-strings for the scheduler commands. */ create_sched_cmdstr(); } static void create_sched_cmdstr(void) { static char *c_null = "Null command"; static char *c_new = "New job arrived"; static char *c_term = "Job terminated"; static char *c_time = "Periodic run"; static char *c_recyc = "Scheduler re-cycled"; static char *c_cmd = "Schedule request"; static char *c_config = "Configure scheduler"; static char *c_quit = "Exit gracefully"; static char *c_rules = "New ruleset requested"; static char *c_first = "Server startup, 1st run"; memset(schd_CmdStr, 0, sizeof(schd_CmdStr)); schd_CmdStr[SCH_SCHEDULE_NULL] = c_null; schd_CmdStr[SCH_SCHEDULE_NEW] = c_new; schd_CmdStr[SCH_SCHEDULE_TERM] = c_term; schd_CmdStr[SCH_SCHEDULE_TIME] = c_time; schd_CmdStr[SCH_SCHEDULE_RECYC] = c_recyc; schd_CmdStr[SCH_SCHEDULE_CMD] = c_cmd; schd_CmdStr[SCH_CONFIGURE] = c_config; schd_CmdStr[SCH_QUIT] = c_quit; schd_CmdStr[SCH_RULESET] = c_rules; schd_CmdStr[SCH_SCHEDULE_FIRST] = c_first; } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/queue_limits.c0000664000113300011330000002113411272401241021206 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: queue_limits.c 2367 2008-09-03 17:17:34Z josh $ */ /* * There are two routines here. The first, queue_limits(), evaluates the * limits of a queue to see if the queue can support running another job. * The other, user_limits(), evaluates a job against any imposed user * limit for the specified queue. */ #include #include #include #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" /* * Determine if a job *can* run in this queue. This is distinct from if * it *should* be run in the queue. * * A job *can* fit in a queue if its requested resources are not greater * than the queue's maximums. * * A job *should* be run only if its requested resources do not exceed the * queue's *available* resources. */ int schd_job_fits_queue(Job *job, Queue *queue, char *reason) { /* char *id = "schd_job_fits_queue"; */ int priority; /* Some of the limits are not tested for priority jobs. */ priority = job->flags & JFLAGS_PRIORITY; /* * Compare the job's requested resources against the queue's limits. */ if (!priority && (queue->wallt_min != UNSPECIFIED) && (job->walltime < queue->wallt_min)) { if (reason) (void)sprintf(reason, "Does not meet queue '%s' walltime minimum (%s).", queue->qname, schd_sec2val(queue->wallt_min)); return (0); } if (!priority && (queue->wallt_max != UNSPECIFIED) && (job->walltime > queue->wallt_max)) { if (reason) (void)sprintf(reason, "Would exceed queue '%s' walltime limit (%s).", queue->qname, schd_sec2val(queue->wallt_max)); return (0); } if (!priority && (queue->nodes_min != UNSPECIFIED) && (job->nodes < queue->nodes_min)) { if (reason) (void)sprintf(reason, "Does not meet queue '%s' node minimum (%d).", queue->qname, queue->nodes_min); return (0); } if (!priority && (queue->nodes_max != UNSPECIFIED) && (job->nodes > queue->nodes_max)) { if (reason) (void)sprintf(reason, "Would exceed queue '%s' node limit (%d).", queue->qname, queue->nodes_max); return (0); } /* * The job _can_ fit in this queue. This doesn't mean it *will* fit * in the queue as it currently exists, but it *would* fit if the queue * was completely empty. */ return (1); } int schd_job_can_queue(Job *job) { QueueList *qptr; /* No? Try the batch queues, if any. */ if (schd_BatchQueues) { for (qptr = schd_BatchQueues; qptr != NULL; qptr = qptr->next) { if (schd_job_fits_queue(job, qptr->queue, NULL)) return (1); } } /* * No queues were found that could run this job. Reject it, since it * will never be able to run. */ return (0); } /* * Check queue limits to see if a job should be run out of this queue. */ int schd_check_queue_limits(Queue *queue, char *reason) { /* char *id = "schd_check_queue_limits"; */ /* Is the queue enabled? If not, note it and fail. */ if (queue->flags & QFLAGS_DISABLED) { if (reason) sprintf(reason, "Queue %s not enabled", queue->qname); return (-1); } /* Is the queue started? If not, note it and fail. */ if (queue->flags & QFLAGS_STOPPED) { if (reason) sprintf(reason, "Queue %s not started", queue->qname); return (-1); } /* Is the queue below the run limit? If so, note it and fail. */ if ((queue->maxrun != UNSPECIFIED) && (queue->running >= queue->maxrun)) { if (reason) sprintf(reason, "Queue %s run limit (%d) reached", queue->qname, queue->maxrun); /* * Assert the MAXRUN bit, since the queue is essentially full. */ queue->flags |= QFLAGS_MAXRUN; return (-1); } /* Has the queue nodes limit been reached? If so, note it and fail. */ if ((queue->nodes_max != UNSPECIFIED) && (queue->nodes_assn >= queue->nodes_max)) { if (reason) sprintf(reason, "Queue %s node limit (%d) reached", queue->qname, queue->nodes_max); /* * Assert the QFLAGS_FULL bit, since a queue resource has been * reached. */ queue->flags |= QFLAGS_FULL; return (-1); } /* * There are queued jobs and no queue limits have been reached. Set * the user run limit and return okay. */ return (0); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/pnp.c0000664000113300011330000003455111272401241017305 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: pnp.c 2367 2008-09-03 17:17:34Z josh $ */ /* * It is important to be able to accurately determine when it is prime and * non-prime time. This is accomplished by reading the holidays file and * creating a table of prime and non-prime times. * A quick search of the table can then determine whether we are in prime * or non-prime time. */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "log.h" #include "toolkit.h" #include "gblxvars.h" #define SUNDAY 0 #define SATURDAY 1 /* XXX Saturday is 6 in timeval */ #define WEEKDAY 2 #define PRIME 0 #define NONPRIME 1 #define MAX_HOLIDAYS 256 /* * Range of valid primetime times is 0 - 86399 (hr * 3600 + min * 60 + sec). * Valid times cannot be negative. */ #define ALL -1 #define NONE -2 static int Num_holidays; static int holidays[MAX_HOLIDAYS][2]; static int weekdays[3][2]; static int day_prime_time(int, int); static void init_holidays(void); /* * Given a time_t, determine if it is prime or nonprime time then. If * the 'when' argument is 0, find out if it is primetime *now*. * Return 1 for prime time, 0 for nonprime time */ int schd_prime_time(time_t when) { struct tm *tmptr; int cur_time; /* Now (decimal - 9:30AM == 930, 6:45PM == 1845) */ int h_idx; int rcode; #ifdef DEBUG if (!(schd_ENFORCE_PRIME_TIME && schd_TimeNow >= schd_ENFORCE_PRIME_TIME)) { fprintf(stderr, "WARNING!!! "); fprintf(stderr, "prime_time() called but ENFORCE_PRIME_TIME not set\n"); fprintf(stderr, "WARNING!!! "); fprintf(stderr, "This is almost certainly a bug!\n"); return (0); } #endif /* DEBUG */ /* If no time specified, use the scheduler's "TimeNow" time_t. */ if (when == 0) when = schd_TimeNow; tmptr = localtime(&when); cur_time = (tmptr->tm_hour * 3600) + (tmptr->tm_min * 60) + tmptr->tm_sec; /* * Check holidays array to determine if today is a holiday. Holidays * are not primetime. Note that days in struct timeval's are counted * starting at 0, not at the first like on the calendar. */ for (h_idx = 0; h_idx < Num_holidays; h_idx++) { if (tmptr->tm_yday + 1 == holidays[h_idx][0]) return (0); } /* Today isn't a holiday so is it SATURDAY, SUNDAY or WEEKDAY? */ switch (tmptr->tm_wday) { case 0: rcode = day_prime_time(SUNDAY, cur_time); break; case 6: rcode = day_prime_time(SATURDAY, cur_time); break; default: rcode = day_prime_time(WEEKDAY, cur_time); break; } return (rcode); } /* Based on time of day and day of week, is it prime time now? */ static int day_prime_time(int dow, int now) { int prime_time; int not_prime_time; prime_time = weekdays[dow][PRIME]; not_prime_time = weekdays[dow][NONPRIME]; switch (prime_time) { case ALL: return (1); /* Prime time all day */ case NONE: return (0); /* No prime time today */ default: /* XXX document this case */ if (not_prime_time > prime_time) { if ((now >= prime_time) && (now < not_prime_time)) return (1); else return (0); } else { if ((now >= not_prime_time) && (now < prime_time)) return (0); else return (1); } } } /* Initialize the holidays[] array from the contents of the holidays file */ int schd_read_holidays(void) { char *id = "schd_read_holidays"; FILE *fd; char buf[255]; char *ptr, *err; int h_idx = 0; long day, line = 0; init_holidays(); Num_holidays = 0; if ((fd = fopen(HOLIDAYS_FILE, "r")) == NULL) { (void)sprintf(log_buffer, "Warning: holidays file (%s) is unreadable. Ignoring...", HOLIDAYS_FILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } /* Read lines from the holidays file one by one. */ while (fgets(buf, sizeof(buf), fd)) { line ++; if (strlen(buf) == (sizeof(buf) - 1)) { (void)sprintf(log_buffer, "Line %ld of %s is too long.", line, HOLIDAYS_FILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } /* Trim off comments before anything else is done. */ if ((ptr = strchr(buf, '*')) != NULL) * ptr = '\0'; /* Find first whitespace-separated token in the remaining string. */ ptr = strtok(buf, " \t"); /* Skip blank lines (may have been only a comment). */ if (ptr == NULL) continue; /* Skip 'HOLIDAYFILE_VERSION1 ...' entry */ if (!strncmp(ptr, "HOLIDAYFILE", 11)) continue; /* Skip 'YEAR ...' entries */ if (!strncmp(ptr, "YEAR", 4)) continue; /* Skip '*day ...' entries */ if (strstr(ptr, "day")) continue; /* * Line was not parsed otherwise -- must be a holiday. Holidays * are non prime, so set current holiday list to the day number * of the current year on which the holiday is celebrated. * Note a syntax error if the number doesn't parse nicely, or it * is nonsensical. */ day = strtol(ptr, &err, 10); if ((*err != '\0') || (day < 0) || (day > 365)) { (void)sprintf(log_buffer, "Syntax error in line %ld of %s", line, HOLIDAYS_FILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } /* SGI uses a day of 0 to indicate "ANY YEAR" - ignore these. */ if (day == 0) continue; /* No loss of precision, since 1 <= day <= 365 (see above). */ holidays[h_idx][0] = (int)day; holidays[h_idx][NONPRIME] = ALL; h_idx++; Num_holidays++; if (Num_holidays == MAX_HOLIDAYS) { (void)sprintf(log_buffer, "Only %d holidays allowed - skipping any remaining in %s", MAX_HOLIDAYS, HOLIDAYS_FILE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); break; } } fclose(fd); return (Num_holidays); } /* * Initialize weekdays array. Default is "no primetime anytime", and no * holidays. * * Holidays are loaded from the file ''/usr/lib/acct/holidays'' on the NAS * Origin2000s. */ static void init_holidays(void) { /* Default is no primetime anytime. */ weekdays[SATURDAY][PRIME] = NONE; weekdays[SATURDAY][NONPRIME] = ALL; weekdays[SUNDAY][PRIME] = NONE; weekdays[SUNDAY][NONPRIME] = ALL; weekdays[WEEKDAY][PRIME] = schd_PRIME_TIME_START; weekdays[WEEKDAY][NONPRIME] = schd_PRIME_TIME_END; Num_holidays = 0; /* No holidays to start out. */ } #define MIDNIGHT 86400 /* * Calculate the number of seconds until the next prime time begins. * If the 'when' argument is non-zero, determine how long from the * time given. Otherwise, determine how long it is from now. */ int schd_secs_til_prime(time_t when) { struct tm *tmptr; time_t now; /* Number of seconds elapsed since midnight */ int next_prime; int prime_start; int days; int p; if (when == 0) { /* No time specified -- find out what time it is now. */ time(&when); } tmptr = localtime(&when); /* * Calculate number of seconds elapsed since last midnight (00:00:00). */ now = ((tmptr->tm_hour * 60 * 60) + (tmptr->tm_min * 60) + tmptr->tm_sec); /* * Is today a FRIDAY or SATURDAY? Assume there is no primetime on * weekends, and calculate number of days forward from that. */ switch (tmptr->tm_wday) { case 5: /* Friday */ /* * If it's before the start of prime time, then the next prime time * is in a matter of hours. Otherwise, prime time starts on the * following Monday (in 2 days). */ p = weekdays[WEEKDAY][PRIME]; if (now < p) days = 0; else days = 2; break; case 6: /* Saturday */ /* * Primetime won't start until Monday, so we know we have at least * one day to wait (all on Sunday). */ days = 1; break; default: /* Sunday through Thursday, expect primetime to start "soon" */ days = 0; break; } /* * 'days' tells us how many days we need to get to a weekday (either * this day, or the following Monday morning). This will be the first * prime time. This will need a special case if a specific weekday * does not have a prime time. */ prime_start = weekdays[WEEKDAY][PRIME]; /* * If we are already past the start of this prime time, than the *next* * prime time will begin tomorrow morning. To get the time until then, * take the number of seconds in a day, and subtract how far into today * you've gotten. XXX is this right in all cases? */ if (now >= prime_start) next_prime = MIDNIGHT - (now - prime_start); else next_prime = prime_start - now; /* Add in the time for any full days without primetime. */ next_prime += (days * MIDNIGHT); return (next_prime); } /* * Calculate the number of seconds until the next non-prime time begins. * If the 'when' argument is non-zero, determine how long from the * time given. Otherwise, determine how long it is from now. */ int schd_secs_til_nonprime(time_t when) { struct tm *tmptr; time_t now; /* Number of seconds elapsed since midnight */ int prime_end; int non_prime_start; if (when == 0) { /* No time specified -- find out what time it is now. */ time(&when); } tmptr = localtime(&when); /* * Calculate number of seconds elapsed since last midnight (00:00:00). */ now = ((tmptr->tm_hour * 60 * 60) + (tmptr->tm_min * 60) + tmptr->tm_sec); /* Find how many seconds from midnight until the next nonprime time. */ non_prime_start = weekdays[WEEKDAY][NONPRIME]; prime_end = non_prime_start - now; return (prime_end); } int schd_reset_observed_pt(QueueList *qlist) { QueueList *qptr; int nqueues; nqueues = 0; for (qptr = qlist; qptr != NULL; qptr = qptr->next) { qptr->queue->observe_pt = (schd_ENFORCE_PRIME_TIME && schd_TimeNow >= schd_ENFORCE_PRIME_TIME); ++ nqueues; } return (nqueues); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/getat.c0000664000113300011330000001213211272401241017603 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: getat.c 2367 2008-09-03 17:17:34Z josh $ */ /* * Given a batch_status structure (bs), search the attributes for the * requested attribute (at) and return it's value (v). If the attribute * contains a resource list, then search the resource list for the requested * resource (rs). The function returns the value if found or a NULL if * the search is not successful. */ #include #include #include #include #include "pbs_ifl.h" #include "log.h" #include "toolkit.h" #include "gblxvars.h" char * schd_getat(char *at, Batch_Status *bs, char *rs) { /* char *id = "getat"; */ AttrList *a; for (a = bs->attribs; a != NULL; a = a->next) { /* Is this the attribute we are looking for? */ if (!strcmp(at, a->name)) { /* * If no resource specified, OR this resource matches the * requested one, return a pointer to the attribute's value. */ if ((rs == NULL) || (strcmp(rs, a->resource) == 0)) return (a->value); } } return (NULL); /* No matching attributes. */ } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/fragments.c0000664000113300011330000001651111272401241020472 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: fragments.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" int schd_fragment_okay(Job *job, Queue *queue, char *reason) { /* char *id = "fragment_okay"; */ int nodes_avail, frag_size, avg_nodes; /* * If this job has been waiting for a long time, don't allow anything to * interfere with it's execution. */ if (job->flags & JFLAGS_WAITING) return (1); /* * "Fragments" only make sense if there is a node limit and a maximum * number of running jobs. If not, fragmentation is not really an issue. */ if ((queue->nodes_max == UNSPECIFIED) || (queue->maxrun == UNSPECIFIED) || (queue->maxrun < 2)) { return (1); } frag_size = (queue->nodes_max / queue->maxrun); nodes_avail = (queue->nodes_max - queue->nodes_assn); /* * See if the queue has fragments of less than 2 nodes, and return if * so -- fragmentation is nonsensical for <2 nodes/frag. */ if (frag_size < 2) return (1); /* * If there is less than a fragment left, do not run a job that would * cause this queue to be fragmented when the other jobs exit. */ if (nodes_avail < frag_size) { if ((job->walltime + schd_TimeNow) > queue->empty_by) { if (reason) sprintf(reason, "Would leave fragments in %s (must be <= %s walltime)", queue->qname, schd_sec2val(queue->empty_by - schd_TimeNow)); return (0); } /* * This job will end before the queue is drained, so go ahead and * run it. It may temporarily increase fragmentation, but it will * not be a problem for long. */ return (1); } /* * Find the average number of nodes consumed by jobs in this queue. This * number is rounded to the nearest fragment size. If there are no * running jobs, allow anything to run and deal with the consequences * later. This should help prevent starvation of very small jobs. */ if (queue->running) avg_nodes = ((queue->nodes_assn + (frag_size / 2)) / queue->running); else return (1); /* * If the average number of nodes in use by the processes running in the * queues is less than the fragment size, then run a job that is smaller * than the fragment size, as long as it won't go beyond the time limit * of the longest running job. If there are no running jobs, than let * the fragment run. */ if (job->nodes < frag_size) { /* This job is a fragment, and the average job in the queue is not. */ if (avg_nodes >= frag_size) { if (reason) { sprintf(reason, "Would fragment queue %s (must be >= %d nodes)", queue->qname, frag_size); } return (0); } if (queue->running && ((job->walltime + schd_TimeNow) > queue->empty_by)) { if (reason) { sprintf(reason, "Would perpetuate fragmentation (must be < %d sec)", (queue->empty_by - schd_TimeNow)); } return (0); } } return (1); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/msgs.c0000664000113300011330000001202211272401241017446 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: msgs.c 2367 2008-09-03 17:17:34Z josh $ */ /* * These strings are referenced by symbolic constants defined in 'msgs.h'. * Be sure to update the constants in 'msgs.h' to reflect any changes or * additions made to this array. */ char *schd_JobMsg[] = { "Insufficient free memory available", "Would over-subscribe node resources", "Would exceed acceptable load-average", "Waiting for start of dedicated time", "Waiting on end of dedicated time", "Dedicated time is not being enforced", "Waiting for start of prime time", "Interactive jobs during prime time have priority", "No interactive jobs - running small batch job", "No batch jobs - running interactive job", "Waiting for big job to complete", "Run big job before starting batch scheduling", "Would run over into batch time", "Overlap into prime time exceeds prime time limits", "All destination queues are too full to accept this job", "Interrupted job restarted by scheduler", "Interrupted job resubmitted by scheduler", }; torque-2.4.16/src/scheduler.cc/samples/cray_t3e/byte2val.c0000664000113300011330000001274611272401241020242 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: byte2val.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include /* * byte2val(bytes) * * Return a pointer to a static string that is the shortest string by which * the number of bytes can be accurately represented. i.e.: * * 1023 -> 1023b * 16384 -> 16kb * 1048576 -> 1mb * 16777216 -> 16mb * 16777217 -> 16777217b * 34359738368 -> 32gb */ char * schd_byte2val(size_t bytes) { size_t mult = 1; /* Initial multiplier */ int log_1024 = 0; /* logarithm base 1024 of multiplier */ size_t next_mult = 1024; /* multiplier of next-highest unit */ static char string[32]; char *units[] = { "b", /* bytes */ "kb", /* kilobytes */ "mb", /* megabytes */ "gb", /* gigabytes */ "tb", /* terabytes */ "pb", /* petabytes */ "eb" /* exabytes */ }; /* * Find the first multiplier by which the given byte count is not * evenly divisible. If we overflow the next multiplier, we have * gone far enough. */ while (bytes && (bytes % next_mult) == 0) { mult = next_mult; next_mult <<= 10; log_1024 ++; if (next_mult == 0) break; } /* * Make 'bytes' be the number of units being represented. */ bytes /= mult; /* * Create a string from number of units, and the symbol for that unit. */ sprintf(string, "%lu%s", bytes, units[log_1024]); /* * Remember: this is a static string! */ return (string); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/sec2val.c0000664000113300011330000001150211272401241020036 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: sec2val.c 2367 2008-09-03 17:17:34Z josh $ */ /* * Convert seconds into "HH:MM:SS" format. Note that the returned string * is a pointer to a static buffer. The caller must copy the time string * into a holding buffer before the next call to sec2val() occurs. */ #include #include #include #include char * schd_sec2val(int seconds) { /* char *id = "sec2val"; */ static char tval[16]; int hours = 0; int minutes = 0; /* Hours */ if (seconds >= (60 * 60)) hours = seconds / (60 * 60); seconds -= (hours * (60 * 60)); /* Minutes */ if (seconds >= 60) minutes = seconds / 60; /* Seconds */ seconds -= (minutes * 60); (void)sprintf(tval, "%2.2d:%2.2d:%2.2d", hours, minutes, seconds); return (&tval[0]); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/getjobs.c0000664000113300011330000001646411272401241020150 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: getjobs.c 2367 2008-09-03 17:17:34Z josh $ */ /* Get all the jobs queued in the specified queue. */ #include #include #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" extern int connector; #include "toolkit.h" Job * schd_get_jobs(char *qname, char *state) { char *id = "schd_get_jobs"; int idx; Job *joblist = NULL, *jobtail = NULL, *new; Batch_Status *pbs_head, *pbs_ptr; AttrOpList *attr; static AttrOpList alist[] = { {NULL, NULL, NULL, NULL, EQ}, {NULL, NULL, NULL, NULL, EQ} }; if ((qname == NULL) && (state == NULL)) { attr = NULL; /* Caller requested all jobs in all queues. */ } else { /* * Initialize the search criteria since alist is a static struct * and it will retain the previous search when repeatedly called. */ for (idx = 0; idx < (sizeof(alist) / sizeof(AttrOpList)); idx++) { alist[idx].next = NULL; alist[idx].name = NULL; alist[idx].value = NULL; } idx = 0; /* Was a specific queue requested? */ if (qname != NULL) { alist[idx].name = ATTR_queue; alist[idx].value = qname; idx++; } /* Was a specific state requested? */ if (state != NULL) { alist[idx].name = ATTR_state; alist[idx].value = state; if (idx > 0) alist[idx - 1].next = &alist[idx]; idx++; } /* (More tests can be added here.) */ attr = alist; } /* Ask PBS for the list of jobs requested */ pbs_head = pbs_selstat(connector, attr, NULL); if ((pbs_head == NULL) && (pbs_errno)) { (void)sprintf(log_buffer, "pbs_selstat failed, %d", pbs_errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return (NULL); } for (pbs_ptr = pbs_head; pbs_ptr != NULL; pbs_ptr = pbs_ptr->next) { /* * If there is no list yet, create one. If there is already a list, * create a new element and place it after the current tail. The new * element then becomes the tail. */ new = (Job *)malloc(sizeof(Job)); if (new == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "malloc(new Job)"); /* * Free any allocated storage, set joblist to NULL, and break. * By doing this, the PBS batch_struct list will be freed, * and the NULL joblist returned to the caller. */ if (joblist) schd_free_jobs(joblist); joblist = NULL; break; } new->next = NULL; if (!joblist) { joblist = new; jobtail = joblist; } else { jobtail->next = new; jobtail = jobtail->next; } /* * 'jobtail' now points to a newly-created Job at the end of the * list of jobs. Call get_jobinfo() to fill it in with the contents * of this PBS batch_struct description. */ schd_get_jobinfo(pbs_ptr, jobtail); } /* * We are left with a list of Job's that was created the from the list * of Batch_Structs we got from pbs_selstat(). The Job list should * contain everything we need to know about the jobs. It is okay to * free the list returned by PBS, and return the list of Job's. */ pbs_statfree(pbs_head); return (joblist); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/getrsrcs.c0000664000113300011330000002640111272401241020337 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: getrsrcs.c 2367 2008-09-03 17:17:34Z josh $ */ /* * Obtain resource information from the resource monitor and * job counts from the server. */ #include #include #include #include #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "resmon.h" #include "rm.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" #ifndef GETRSRCS_CONNECT_TIME #define GETRSRCS_CONNECT_TIME 10 /* how long to wait for resource info */ #endif /* ! GETRSRCS_CONNECT_TIME */ Resources *schd_RsrcsList = NULL; /* List of hosts and their resources */ extern char *schd_CmdStr[16]; static void dump_resources(Resources *rsrcs); /* ARGSUSED */ static void connect_interrupt(int signo) { /* * Do nothing. Just accept the signal and allow an alarmed syscall * to be interrupted. */ return; } /* * Find an entry for the resources for the requested host in the list of * existing resources, or create a new one for that host and return it. */ Resources * schd_get_resources(char *exechost) { char *id = "schd_get_resources"; Resources *rptr, *new_rsrcs; int rm; char *response; int badreply = 0; int cpus_avail = 0; int cpus_tot = 0; struct sigaction act, oact; unsigned int remain; /* Time remaining in any old alarm(). */ time_t then; /* When this alarm() was started. */ /* * Check for a local copy of the resources being available already. * If so, just return a reference to that Resources structure. */ if (schd_RsrcsList != NULL) { for (rptr = schd_RsrcsList; rptr != NULL; rptr = rptr->next) if (strcmp(rptr->exechost, exechost) == 0) return (rptr); } schd_timestamp("get_rsrcs"); /* * No cached resource information for 'exechost'. Need to query the * host for its information. */ if ((new_rsrcs = (Resources *)malloc(sizeof(Resources))) == NULL) { (void)sprintf(log_buffer, "Unable to alloc space for Resources."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (NULL); /* Can't get the information - nowhere to store it. */ } memset((void *)new_rsrcs, 0, sizeof(Resources)); act.sa_flags = 0; act.sa_handler = connect_interrupt; sigemptyset(&act.sa_mask); remain = 0; then = 0; /* * Set the alarm, and maintain some idea of how long was left on any * previously set alarm. */ if (sigaction(SIGALRM, &act, &oact) == 0) { remain = alarm(GETRSRCS_CONNECT_TIME); then = time(NULL); } if ((rm = openrm(exechost, 0)) == -1) { (void)sprintf(log_buffer, "Unable to contact resmom@%s (%d)", exechost, pbs_errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); badreply = 1; goto bail; } /* * Turn off full response. Responses will be received in the order in * which they are sent. */ fullresp(0); /* Build a list of all the resources about which we want information. */ addreq(rm, "mppe_app"); addreq(rm, "mppe_avail"); /* Get the values back from the resource monitor, and round up. */ /* Receive MPPE_APP response from resource monitor. */ /* returns the total number of Application PEs configured */ response = getreq(rm); if (response != NULL) { cpus_tot = atoi(response) * schd_FAKE_MACH_MULT; } else { (void)sprintf(log_buffer, "bad return from getreq(ncpus), %d, %d", pbs_errno, errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); badreply = 1; goto bail; } /* Receive MPPE_AVAIL response from resource monitor. */ /* returns the largest contiguous block of APP PEs */ response = getreq(rm); if (response != NULL) { cpus_avail = atoi(response) * schd_FAKE_MACH_MULT; } else { (void)sprintf(log_buffer, "bad return from getreq(ncpus), %d, %d", pbs_errno, errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); badreply = 1; goto bail; } new_rsrcs->freemem = MB_PER_NODE * schd_FAKE_MACH_MULT; bail: /* Disconnect from the resource monitor. */ if (rm) closerm(rm); /* And unset the alarm and handler. */ alarm(0); sigaction(SIGALRM, &oact, &act); /* Reset the old alarm, taking into account how much time has passed. */ if (remain) { DBPRT(("%s: old alarm had %d secs remaining, %d elapsed, ", id, remain, (time(NULL) - then))); /* How much time remains even after the time spent above? */ remain -= (time(NULL) - then); /* * Would the previous time have already expired? If so, schedule * an alarm call in 1 second (close enough, hopefully). */ if (remain < 1) remain = 1; DBPRT(("reset to %d secs\n", remain)); alarm(remain); } /* * Verify all the data came back as expected; if not, abort this * iteration of the scheduler. */ if (badreply) { (void)sprintf(log_buffer, "Got bad info from mom@%s - aborting sched run", exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); free(new_rsrcs); return (NULL); } /* Make a copy of the hostname for the resources struct. */ new_rsrcs->exechost = schd_strdup(exechost); if (new_rsrcs->exechost == NULL) { (void)sprintf(log_buffer, "Unable to copy exechost %s to rsrcs", exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); free(new_rsrcs); return (NULL); } new_rsrcs->nodes_total = cpus_tot; new_rsrcs->nodes_alloc = cpus_tot - cpus_avail; if (schd_RsrcsList == NULL) { schd_RsrcsList = new_rsrcs; /* Start the list. */ } else { for (rptr = schd_RsrcsList; rptr->next != NULL; rptr = rptr->next) /* Find the last element in the list. */ ; rptr->next = new_rsrcs; } /* Next pointer for the tail of the list points to nothing. */ new_rsrcs->next = NULL; return (new_rsrcs); } void schd_dump_rsrclist(void) { Resources *rsrcs; for (rsrcs = schd_RsrcsList; rsrcs != NULL; rsrcs = rsrcs->next) dump_resources(rsrcs); } static void dump_resources(Resources *rsrcs) { char *id = "dump_resources"; /* Log the system's status */ (void)sprintf(log_buffer, "Resources for host %s", rsrcs->exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, " :: %-24s = %s", "Memory (free):", schd_byte2val(rsrcs->freemem)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, " :: %-24s = %d / %d (%.2f%% utilization)", "Nodes allocated:", rsrcs->nodes_alloc, rsrcs->nodes_total, (rsrcs->nodes_alloc * 100.0) / rsrcs->nodes_total); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); (void)sprintf(log_buffer, " :: %-24s = %d", "Running jobs:", rsrcs->njobs); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/Makefile.in0000664000113300011330000005625711605403763020433 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libfoo_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/buildutils/config.mk subdir = src/scheduler.cc/samples/cray_t3e ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libfoo_la_LIBADD = am_libfoo_la_OBJECTS = acl_support.lo allocations.lo byte2val.lo \ cleanup.lo comment.lo dedicated.lo dedqueue.lo dyn_nodemask.lo \ evaluate_system.lo file_chgs.lo fragments.lo getat.lo \ getconfig.lo getjobs.lo getqueues.lo getrsrcs.lo grminfo.lo \ how_many.lo jobinfo.lo misc.lo movejob.lo msgs.lo overlaps.lo \ pack_queues.lo pnp.lo queue_limits.lo rejectjob.lo \ resource_limits.lo runjob.lo schedinit.lo schedule.lo \ sec2val.lo time_limits.lo user_limits.lo usersort.lo \ val2bool.lo val2byte.lo val2sec.lo libfoo_la_OBJECTS = $(am_libfoo_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/buildutils/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libfoo_la_SOURCES) DIST_SOURCES = $(libfoo_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(schedprivdir)" schedprivDATA_INSTALL = $(INSTALL_DATA) DATA = $(schedpriv_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include -fullwarn -D_POSIX_C_SOURCE \ -DDEBUG -DCONFIGFILE=\"$(CONFIGFILE)\" \ -DDECAY_INFO_FILE=\"$(DECAY_INFO_FILE)\" IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter # Support files used by the scheduler schedprivdir = $(PBS_SERVER_HOME)/sched_priv schedpriv_DATA = config EXTRA_DIST = $(schedpriv_DATA) # File which contains the scheduler's configuration information CONFIGFILE = $(schedprivdir)/config # File in which scheduler maintains decayed recent usage. DECAY_INFO_FILE = $(schedprivdir)/decay_usage noinst_LTLIBRARIES = libfoo.la libfoo_la_SOURCES = acl_support.c allocations.c byte2val.c cleanup.c \ comment.c dedicated.c dedqueue.c dyn_nodemask.c \ evaluate_system.c file_chgs.c fragments.c getat.c \ getconfig.c getjobs.c getqueues.c getrsrcs.c grminfo.c \ how_many.c jobinfo.c misc.c movejob.c msgs.c overlaps.c \ pack_queues.c pnp.c queue_limits.c rejectjob.c \ resource_limits.c runjob.c schedinit.c schedule.c \ sec2val.c time_limits.c user_limits.c usersort.c \ val2bool.c val2byte.c val2sec.c \ bitfield.h gblxvars.h msgs.h toolkit.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scheduler.cc/samples/cray_t3e/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scheduler.cc/samples/cray_t3e/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libfoo.la: $(libfoo_la_OBJECTS) $(libfoo_la_DEPENDENCIES) $(LINK) $(libfoo_la_LDFLAGS) $(libfoo_la_OBJECTS) $(libfoo_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acl_support.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocations.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byte2val.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cleanup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comment.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dedicated.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dedqueue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dyn_nodemask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evaluate_system.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_chgs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragments.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getconfig.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getjobs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getqueues.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrsrcs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grminfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/how_many.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jobinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/movejob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overlaps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_queues.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_limits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rejectjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_limits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runjob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schedinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schedule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sec2val.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_limits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user_limits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usersort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/val2bool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/val2byte.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/val2sec.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-schedprivDATA: $(schedpriv_DATA) @$(NORMAL_INSTALL) test -z "$(schedprivdir)" || $(mkdir_p) "$(DESTDIR)$(schedprivdir)" @list='$(schedpriv_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(schedprivDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(schedprivdir)/$$f'"; \ $(schedprivDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(schedprivdir)/$$f"; \ done uninstall-schedprivDATA: @$(NORMAL_UNINSTALL) @list='$(schedpriv_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(schedprivdir)/$$f'"; \ rm -f "$(DESTDIR)$(schedprivdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/../../../../buildutils @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(schedprivdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-schedprivDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-schedprivDATA .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-schedprivDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-schedprivDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/src/scheduler.cc/samples/cray_t3e/how_many.c0000664000113300011330000001214111272401241020320 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: how_many.c 2367 2008-09-03 17:17:34Z josh $ */ /* * Given a state_count string, return the integer value * of the state requested. */ #include #include #include #include #include "toolkit.h" int schd_how_many(char *str, char *state) { /* char *id = "how_many"; */ char *avalue, *ptr1; int intval = 0; /* Make a duplicate of the string since strtok() is destructive. */ avalue = schd_strdup(str); if (avalue == NULL) return (0); /* XXX - return an error (malloc) here? */ /* Search for a token that matches the requested state */ for (ptr1 = strtok(avalue, " "); ptr1 != NULL; ptr1 = strtok(NULL, " ")) if (!strncmp(state, ptr1, strlen(state))) break; if (ptr1 == NULL) goto free_and_exit; /* XXX return an error */ /* Locate the number after the colon */ ptr1 = strchr(ptr1, ':'); if (ptr1 == NULL) goto free_and_exit; /* XXX return an error? */ ptr1++; intval = atoi(ptr1); free_and_exit: free(avalue); /* Free the memory schd_strdup() allocated. */ return (intval); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/allocations.c0000664000113300011330000004340611272401241021017 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: allocations.c 2367 2008-09-03 17:17:34Z josh $ */ /* * This file contains routines pulled over from the parallel systems' * PBS toolkit. * * Authors include: James Patton Jones, NAS/NASA Ames * Dr. Ed Hook, NASA LaRC * Chris Batten, NASA LaRC */ #include #include #include #include #include #include #include #include #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "toolkit.h" #include "gblxvars.h" extern int connector; /* Misc Other Global Variables */ int schd_NeedToGetAllocInfo; int schd_NeedToGetYTDInfo; int schd_NumAllocation; Alloc_Group schd_GroupTable[MAX_GROUP]; static int cmp_gname(const void *a, const void *b); static int get_FY_used(char *gname, float *used); static int get_allocation(char *gname, float *alloc); static char *trim_whitespace(char *string); /* * Read allocation and usage data for current fiscal year * * Allocation database is a flat file that contains lines like: * * P= XXX:Evolution of FOO for XXX Applications = 1234 = 0.0 = 50.0 = 0 */ void schd_alloc_info(void) { char *id = "schd_alloc_info"; char *syntax = "Syntax error in line %d of %s. Skipping..."; int i; int linenum, jobs, ret; int count = 0; char buffer[MAX_TXT * 2]; char gname[MAX_USER_NAME_SIZE]; char uid[MAX_TXT + 1]; char gid[MAX_TXT + 1]; char used[MAX_TXT + 1]; char alloc_line[MAX_TXT + 1]; FILE *fp; char *p, *end; float nodes_used, pct; float alloc; int table_modified = 0; if (!schd_NeedToGetAllocInfo) goto get_current; /* Initialize the allocation group table(s) */ for (i = 0; i < MAX_GROUP; ++i) { schd_GroupTable[i].allocation = 0.0; strcpy(schd_GroupTable[i].gname, ""); } if ((fp = fopen(schd_AllocFilename, "r")) == NULL) { (void)sprintf(log_buffer, "Warning: group allocation data (%s) unreadable. Skipping...", schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { linenum = 0; while (fgets(buffer, sizeof(buffer), fp)) { linenum ++; p = strtok(buffer, "="); /* p --> 'P' */ if ((strcmp(p, "P") != 0) || (p == NULL)) { (void)sprintf(log_buffer, syntax, linenum, schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); continue; } p = strtok(NULL, "="); /* p --> ' ' */ if (p == NULL) { (void)sprintf(log_buffer, syntax, linenum, schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); continue; } p = strtok(NULL, "="); /* p --> '' */ if (p == NULL) { (void)sprintf(log_buffer, syntax, linenum, schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); continue; } p = trim_whitespace(p); if (isdigit((int)*p)) /* isdigit() wants an int, not char */ sprintf(gname, "g%s", p); /* 'g7989' */ else sprintf(gname, "%s", p); /* 'groupname' */ p = strtok(NULL, "="); /* p --> '' */ if (p == NULL) { (void)sprintf(log_buffer, syntax, linenum, schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); continue; } #ifdef INCLUDE_DEAD_CODE p = trim_whitespace(p); if (!strcmp(schd_SYSTEM_NAME, "babbage")) p = strtok(NULL, "="); if (!strcmp(schd_SYSTEM_NAME, "poseidon")) p = strtok(NULL, "="); if (p == NULL) { (void)sprintf(log_buffer, syntax, linenum, schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); continue; } #endif /* INCLUDE_DEAD_CODE */ p = trim_whitespace(p); /* Do more robust error checking of the allocations value. */ alloc = strtod(p, &end); if (*end != '\0') { (void)sprintf(log_buffer, syntax, linenum, schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); continue; } strcpy(schd_GroupTable[count].gname, gname); schd_GroupTable[count].allocation = alloc; ++count; if (count >= MAX_GROUP) { (void)sprintf(log_buffer, "WARNING: Too much allocation data. " "Only using first %d lines of %s.\n", count, schd_AllocFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); break; } } fclose(fp); } schd_NumAllocation = count; qsort(schd_GroupTable, count, sizeof(Alloc_Group), cmp_gname); schd_NeedToGetAllocInfo = 0; schd_NeedToGetYTDInfo = 1; /* necessary */ table_modified = 1; get_current: if (!schd_NeedToGetYTDInfo) goto skip_ytd_info; /* Initialize the usage count in the table */ for (i = 0; i < schd_NumAllocation; ++i) schd_GroupTable[i].total_usage = 0.0; if ((fp = fopen(schd_CurrentFilename, "r")) == NULL) { (void)sprintf(log_buffer, "Error: %s: unable to open %s for read.", id, schd_CurrentFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { linenum = 0; while (fgets(buffer, sizeof buffer, fp)) { ++linenum; ret = sscanf(buffer, "%s %s %d %f", uid, /* user name (string) */ gid, /* group name (string) */ &jobs, /* nbr of jobs */ &nodes_used); /* node-hours */ if (ret != 4) /* oops */ { (void)sprintf(log_buffer, syntax, linenum, schd_CurrentFilename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); continue; } /* XXX check ranges (esp. signed) on jobs and cpu */ /* Find data for this group in our table */ for (i = 0; i < schd_NumAllocation; ++i) if (!strcmp(schd_GroupTable[i].gname, gid)) break; if (i == schd_NumAllocation) /* Group not found in table */ { (void)sprintf(log_buffer, "Warning: no allocation for %s", gid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); continue; } /* Add group's "current" usage into the table. */ schd_GroupTable[i].total_usage += nodes_used; } fclose(fp); } schd_NeedToGetYTDInfo = 0; table_modified = 1; skip_ytd_info: if (table_modified) { for (i = 0; i < schd_NumAllocation; i++) { alloc = schd_GroupTable[i].allocation; if (alloc > 0.0) { /* Calculate percentage of allocation used at this point. */ pct = schd_GroupTable[i].total_usage; pct /= alloc; pct *= 100.0; sprintf(used, "%3.2f %%", pct); sprintf(alloc_line, "%.2f", alloc); } else { used[0] = '\0'; if (alloc < 0.0) strcpy(alloc_line, "N/A"); else strcpy(alloc_line, "0.00"); } (void)sprintf(log_buffer, "%s: %-8s Used: %16.4f Allocation: %10s %s", id, schd_GroupTable[i].gname, schd_GroupTable[i].total_usage, alloc_line, used); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } } } static int cmp_gname(const void *a, const void *b) { Alloc_Group *alloc_group_a; Alloc_Group *alloc_group_b; alloc_group_a = (Alloc_Group *)a; alloc_group_b = (Alloc_Group *)b; return strcmp(alloc_group_a->gname, alloc_group_b->gname); } /* * Check if group has exceeded their allocation. If the group has no * allocations, refuse the job. If they have an unlimited (negative) * allocation, then they have used 0% of their allocations. Otherwise, * return either a '0' -- the group is under allocation, or the integer * percentage they've used so far (i.e. 107 for 107% usage). */ int schd_is_over_alloc(char *group) { int percent_used; float alloc, used; /* If the group isn't found in the allocations file, reject the job. */ if (!get_allocation(group, &alloc)) return (100); /* Used 100% of the non-existent allocation. */ /* Negative allocations mean "unlimited usage". Always okay. */ if (alloc < 0.0) return (0); /* * Compute percentage of their allocation that has been used this FY. * If no record is found for usage, they have a zero usage. */ if (!get_FY_used(group, &used)) used = 0.0; percent_used = (int)((used / alloc * 100.0) + 0.5); if (percent_used < 100) return (0); /* Are not over allocation. */ else return (percent_used); /* Return percent allocation used (100+%) */ } /* * The group to which this job belongs is over their allocation. Send * the owner of the job a nastygram and ask the JMS to delete the job. */ int schd_reject_over_alloc(Job *job) { char *id = "schd_reject_over_alloc"; char buffer[4 * MAX_TXT + 1]; char *unknown = "???"; float alloc, used; char *group; int rc = 0; char *nastygram = "Allocation Exceeded.\n" "\n" "Your PBS job %s would exceed the group\n" "or project allocation given for this operational year.\n" "\n" "This limit has been imposed on you because your group (%s)\n" "has used %3.2f node-hours of its allocation of %3.2f node-hours.\n" "\n" "Please contact the Principal Investigator (PI) for your group\n" "for additional information. The PI should contact their HPCCP\n" "Resource Monitor to apply for an allocation increase.\n" "\n"; /* Get the group's allocation and usage statistics. */ group = (job->group != NULL) ? job->group : unknown; /* * Get the current allocation for this group. If the group does not * have an allocation entry, assume it's zero. */ if (!get_allocation(group, &alloc)) alloc = 0.0; /* * Get the current usage for this group. If the group does not have a * current usage entry, assume it's zero -- a job may never have been * run by this group, if the allocation is 0.0 (not allowed). */ if (!get_FY_used(group, &used)) used = 0.0; /* This should not be called if the group is below its allocation. */ if (used < alloc) { (void)sprintf(log_buffer, "group %s (job %s) below allocation ???", group, job->jobid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return (1); } /* * User has used up allocation, so we get to delete this job. But we * need to log the deletion, and notify the user via email why the job * was terminated. Don't perform the deletion if this is a remote job. */ (void)sprintf(log_buffer, "rejecting %s because group %s over allocation (%3.1f/%3.1f)", job->jobid, group, used, alloc); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); sprintf(buffer, nastygram, job->jobid, group, used, alloc); /* * Since the job cannot run inside allocations, delete it. The JMS * will deliver the notification (the string in 'buffer') to the user. */ if (schd_reject_job(job, buffer)) { (void)sprintf(log_buffer, "schd_reject_job failed: %d", rc); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } return (0); } /* * Look for the total_usage for the requested group. If not found, return * zero. Otherwise, put the usage into *used, and return 1. */ static int get_FY_used(char *gname, float *used) { int i; for (i = 0; i < schd_NumAllocation; i++) /* If the right group is found, return the total usage. */ if (!strcmp(schd_GroupTable[i].gname, gname)) { *used = schd_GroupTable[i].total_usage; return (1); } return (0); /* Requested group not found. */ } /* * Look for the allocations for the requested group. If not found, return * zero. Otherwise, put the allocation into *alloc, and return 1. */ static int get_allocation(char *gname, float *alloc) { int i = 0; for (i = 0; i < schd_NumAllocation; i++) /* If the right group is found, return the allocation. */ if (!strcmp(schd_GroupTable[i].gname, gname)) { *alloc = schd_GroupTable[i].allocation; return (1); } return (0); /* Requested group not found. */ } /* * Remove leading and trailing whitespace from a string. Returns a pointer * to the first non-whitespace character in the string and replaces the first * trailing space with a '\0'. Returns an empty string (*p = '\0') if all * whitespace. */ static char * trim_whitespace(char *string) { int i; /* Trim off any whitespace on the end of the string. */ for (i = (int)strlen(string) - 1; i >= 0 && isspace((int)string[i]); i--) string[i] = '\0'; /* Find first non-whitespace character in the string. */ for (i = 0; string[i] != '\0'; i++) if (!isspace((int)string[i])) break;; return &string[i]; } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/grminfo.c0000664000113300011330000002512311272401241020144 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * This file contains the routines necessary to query information from * the T3e's Global Resource Monitor (GRM). The GRM has the final decison * on the placement of jobs on the torus of the T3e, thus its a good idea * for the scheduler to know some of the contraints of the GRM, so as to * avoid scheduling a job that the GRM will not be able to run immediately. * For example, the GRM enforces a requirement that all jobs must be run * on contiguous PEs. So knowing the total number of free PE's is not * sufficient for scheduling. * * Secondly, the T3e permits a site to assign arbitrary "labels" to PEs. * These must conform to certain restrictions (see also setlabel(1) and * grmview(1) ). For example, the label must be 2-8 characters in length * and start with either an 'H' or 'S' indicating whether it is a hard * (e.g. required) or soft (e.g. requested, not required) label. * * The routines in this file make sactl(2) calls to query this information * from the GRM, and creates a global PE_MAP array for use by the queue * packing algorithms, etc. */ #include #include #include typedef unsigned int uint; /* why isn't this defined in sys/??? */ #include #include #include #include #include "toolkit.h" #include "gblxvars.h" #define OPERATIONAL (GRMINFO_PE_AVAIL_REG | GRMINFO_PE_AVAIL_NET) /* * Information is gathered from three locations and stored in the global * schd_PEMAP array. The array is populated in two steps: * * 1. PE specific information (current and max application counts, * status, label) * 2. Running Application information (each running job reported by * GRM is mapped back (via the sessionID/JID GRM field) to a PBS * JOBID (from the Running Jobs List), if its available). */ int load_pe_map(Job *jobs) { int i, j, k, ret, pe, found, pe_count = 0; int name[SA_MAX_NAMES]; char buf[256]; sa_info_t sa_info; Job *this; struct pe_attr *attr; struct pe_app *app; static char *func_id = "load_pe_map"; union { char slab[sizeof(int) * 2]; int ilab[2]; } label; for (i = 0; i < MAX_PE_MAP_SIZE; i++) { schd_PEMAP[i].job = NULL; schd_PEMAP[i].label[0] = '\0'; schd_PEMAP[i].status = STAT_DOWN; /* default: down */ schd_PEMAP[i].apps_max = -1; /* unlimited apps */ schd_PEMAP[i].apps_num = 0; /* # of apps assigned */ } /* load PE resource information */ /* Get the PEs MAP */ name[0] = SA_GRM; name[1] = GRM_CTL_PE_MAP; ret = sactl(name, 2, (char *) & sa_info, sizeof(sa_info), SA_INFO, 0, 0, 0); if (ret < 0) { return -1; } else if (sa_info.numrec == 0) { return -1; /* no PEs defined */ } if ((attr = (struct pe_attr *)malloc(sa_info.numrec * sa_info.recsize)) != (struct pe_attr *)0) { ret = sactl(name, 2, (char *) attr, sa_info.numrec * sa_info.recsize, SA_READ, 0, 0, 0); if (ret < 0) { free((char *)attr); return -1; } for (i = 0, pe = 0; i < sa_info.numrec; i++) { /* we only care about Application PEs... */ if (attr[i].type != GRMINFO_PE_TYPE_APP) { continue; } pe = attr[i].logical_pe; /* check if this PE is okay; otherwise, skip it */ if ((attr[pe].available & OPERATIONAL) != OPERATIONAL) { continue; } pe_count++; schd_PEMAP[pe].status = STAT_AVAIL; schd_PEMAP[pe].apps_num = attr[pe].aps_ents; schd_PEMAP[pe].apps_max = attr[pe].aps_max; if (attr[pe].label) { /* label value stored internally to GRM as an int; * convert it back to char so we can use it. */ label.ilab[0] = attr[i].label; label.ilab[1] = 0; strncpy(schd_PEMAP[pe].label, label.slab, MAX_LABEL_SZ); schd_PEMAP[pe].label[MAX_LABEL_SZ] = '\0'; } free((char *)attr); } } schd_MAX_NCPUS = pe_count; /* now get the application specific PE information */ name[0] = SA_GRM; name[1] = GRM_CTL_PE_APS; ret = sactl(name, 2, (char *) & sa_info, sizeof(sa_info), SA_INFO, 0, 0, 0); if (ret < 0 || sa_info.numrec == 0) { return -1; /* no PEs defined */ } if ((app = (struct pe_app *)malloc(sa_info.numrec * sa_info.recsize)) != (struct pe_app *)0) { ret = sactl(name, 2, (char *) app, sa_info.numrec * sa_info.recsize, SA_READ, 0, 0, 0); if (ret < 0) { free((char *)app); return -1; } /* loop through the GRM's list of applications */ for (i = 0, pe = 0; i < sa_info.numrec; i++) { found = 0; if (app[i].base_pe < 0) /* -1 == Queued */ continue; /* Got a running job, now need to match it to * something in the PBS RunningJobs list... */ for (this = jobs; this != NULL; this = this->next) { if (this->state == 'R') { if (app[i].jid == this->session) { pe = app[i].base_pe + app[i].num_pes; for (k = app[i].base_pe; k < pe; k++) { schd_PEMAP[k].job = this; schd_PEMAP[k].status = STAT_JOB_PBS; } found = 1; break; } } } if (!found) { /* must be a foreign job */ pe = app[i].base_pe + app[i].num_pes; for (k = app[i].base_pe; k < pe; k++) { schd_PEMAP[k].status = STAT_JOB_CMD; } } } } #ifdef DEBUG_LOTS /* now a sanity check... */ for (i = 0; i < MAX_PE_MAP_SIZE; i++) { printf("[%3d] stat=%d ", i, schd_PEMAP[i].status); if (schd_PEMAP[i].status == STAT_DOWN) printf(" DOWN\n"); else if (schd_PEMAP[i].status == STAT_JOB_PBS) printf("num=%d max=%d label=[%s] job=%s\n", schd_PEMAP[i].apps_num, schd_PEMAP[i].apps_max, (schd_PEMAP[i].label != NULL) ? schd_PEMAP[i].label : "None", schd_PEMAP[i].job->jobid); else if (schd_PEMAP[i].status == STAT_JOB_CMD) printf("num=%d max=%d label=[%s] job=FOREIGN\n", schd_PEMAP[i].apps_num, schd_PEMAP[i].apps_max, (schd_PEMAP[i].label != NULL) ? schd_PEMAP[i].label : "None"); else printf("num=%d max=%d label=[%s] AVAILABLE\n", schd_PEMAP[i].apps_num, schd_PEMAP[i].apps_max, (schd_PEMAP[i].label != NULL) ? schd_PEMAP[i].label : "None"); } #endif /* DEBUG_LOTS */ return 0; } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/dedicated.c0000664000113300011330000012173611272401241020420 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: dedicated.c 2367 2008-09-03 17:17:34Z josh $ */ /* * *********************************** * *** STANDARDS COMPLIANCE NOTICE *** * *********************************** * * This file makes use of the AT&T UNIX-based popen() and pclose() calls * to read the output of a user-supplied command (schd_DEDTIME_COMMAND). * This file will not build in a strict ANSI-only environment. Neither * ANSI-C (ISO/IEC 9899-1990), nor the POSIX 1003.1 specification (ISO/IEC * 9945-1) specify the popen()/pclose() library functions. * * If the target machine does not have an implementation of popen() and * pclose(), a working implementation of the library routines should be * available from one of the free UN*X/BSD clones (i.e. NetBSD, FreeBSD, * OpenBSD, etc). * * most real machines do provide an implementation of the popen() and * pclose() library routines. It may be necessary to turn off strict * ANSI-compliance modes to build this file. It may also be necessary * to link with a compatibility library in order to use popen()/pclose(). * * Note: popen()/pclose() are only necessary if dedicated time information * can only be retrieved from the output of a command. Another strategy * might be to exec() the command, redirecting its output into a file, and * then use open()/read()/close() to parse the resultant flat file. */ #include #include #include #include #include #include #include #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #ifdef DBPRT #undef DBPRT #define DBPRT(X) #endif /* DBPRT */ #include "toolkit.h" #include "gblxvars.h" struct outagelist { struct outagelist *next; /* next pointer */ char *exechost; /* pointer to name of host for this element */ Outage *outages; /* list of outages for host */ time_t cached_at; /* time the list was fetched or 0 if invalid */ }; typedef struct outagelist OutageList; OutageList *host_outage_list = NULL; static int get_outages(char *exechost, Outage **outlistp); static Outage *merge_outages(Outage *system_outages, Outage *host_outages); static int MMDDYYYY_HHMM(char *MMDDYYYY, char *HHMM); static int make_time_strs(Outage *outp); static int free_outages(Outage *outages); static int compare_outages_time(const void *e1, const void *e2); static int resolve_outage_overlap(Outage **outlistp); static char *print_outage(Outage *outp); /* * The outage resolution algorithm uses an iterative approach to resolve * one outage at a time. To prevent it looping indefinitely, set this * to some ludicrously large number (say, 250) of times that the list * should be passed through without resolving all the conflicts. If this * happens, it is almost certainly a bug in the implementation. */ #define MAX_OUTAGE_RESOLVE_ITERS 250 /* * Invalidate any existing entries on the outage caches, and free the lists. */ void schd_clear_outage_cache(void) { OutageList *outlp; for (outlp = host_outage_list; outlp != NULL; outlp = outlp->next) { free_outages(outlp->outages); outlp->cached_at = 0; outlp->outages = NULL; } } Outage * schd_host_outage(char *exechost, time_t when) { char *id = "schd_host_outage"; OutageList *outlp, *newoutl; Outage *outages, *sys_out, *outp; if (when == 0) when = schd_TimeNow; else if (when < schd_TimeNow) { (void)sprintf(log_buffer, "Asked for outages for time in the past - results may be inaccurate!"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } /* * Scan the list of host outage lists for an entry that matches * the requested hostname. If not found, then there is no data * cached. If the data is old, purge it and ask for a new list * of outages for this host. */ for (outlp = host_outage_list; outlp != NULL; outlp = outlp->next) { if (strcmp(exechost, outlp->exechost) == 0) { break; } } /* If no entry was found on the list, one must be created. */ if (outlp == NULL) { newoutl = (OutageList *)malloc(sizeof(OutageList)); if ((newoutl == NULL) || ((newoutl->exechost = schd_strdup(exechost)) == NULL)) { (void)sprintf(log_buffer, "Warning! Couldn't allocate space to track dedicated times!"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (NULL); } /* newoutl->exechost is set, now fill in the rest of the fields. */ newoutl->next = NULL; newoutl->outages = NULL; /* * Indicate that the list pointed to by newoutl->outages is bogus and * needs to be re-fetched. */ newoutl->cached_at = 0; /* * If the list is empty, make this the first element. Otherwise, * place the new element at the tail of the existing list. */ if (host_outage_list == NULL) { host_outage_list = newoutl; } else { for (outlp = host_outage_list; outlp->next; outlp = outlp->next) /* Just walk to last element in list. */ ; outlp->next = newoutl; } outlp = newoutl; } /* * outlp now points to a valid host OutageList. See if the list of * outages hanging off the host name is still valid. */ if ((outlp->cached_at == 0) || (schd_TimeNow - outlp->cached_at) > schd_DEDTIME_CACHE_SECS) { DBPRT(("%s: dedicated time list for host %s ", id, outlp->exechost)); if (outlp->cached_at) { DBPRT(("expired %s ago\n", schd_sec2val(schd_TimeNow - (outlp->cached_at + schd_DEDTIME_CACHE_SECS)))); } else { DBPRT(("uninitialized\n")); } /* * Try to get a new list of outages. Don't blow away the old one yet, * though. If there's some problem getting the new list, the values * from the old list are more likely to be valid than a NULL list. */ if (get_outages(exechost, &outages)) { (void)sprintf(log_buffer, "WARNING! Could not update dedtime cache for %s!", exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); if (outlp->cached_at) (void)sprintf(log_buffer, "WARNING! Cached data is %s old!", schd_sec2val(schd_TimeNow - outlp->cached_at)); else (void)sprintf(log_buffer, "WARNING! Cache is uninitialized!"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } else { DBPRT(("%s: got valid list for %s - update cache\n", id, exechost)); (void)sprintf(log_buffer, "updating dedtime cache for %s (valid for %s)", exechost, schd_sec2val(schd_DEDTIME_CACHE_SECS)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); /* Set up back pointers to the OutageList's exechost string. */ for (outp = outages; outp != NULL; outp = outp->next) outp->exechost = outlp->exechost; #ifdef DEBUG_DEDTIME DBPRT(("%s: EXECHOST OUTAGES FOR %s:\n", id, exechost)); for (outp = outages; outp != NULL; outp = outp->next) DBPRT(("%s: %s\n", id, print_outage(outp))); #endif /* DEBUG_DEDTIME */ /* * Now that the valid per-host data has been received, check for * any system outage, if schd_SYSTEM_NAME is not NULL. Mix these * into the list, handling overlaps. Note that system dedtimes * take precedence over the per-host dedtimes. */ if (schd_SYSTEM_NAME) { DBPRT(("%s: SYSTEM_NAME is '%s' - look for outages.\n", id, schd_SYSTEM_NAME)); if (get_outages(schd_SYSTEM_NAME, &sys_out) == 0) { if (sys_out != NULL) { /* Mark these outages as system outages. */ for (outp = sys_out; outp != NULL; outp = outp->next) { outp->exechost = schd_SYSTEM_NAME; outp->flags |= OUTAGE_FLAGS_SYSTEM; } #ifdef DEBUG_DEDTIME DBPRT(("%s: SYSTEM OUTAGES FOR %s:\n", id, exechost)); for (outp = sys_out; outp != NULL; outp = outp->next) DBPRT(("%s: %s\n", id, print_outage(outp))); #endif /* DEBUG_DEDTIME */ (void)sprintf(log_buffer, "merging system %s outages with host %s outages", schd_SYSTEM_NAME, exechost); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); /* Merge the sys_out outages on top of any outages. */ outages = merge_outages(sys_out, outages); if (outages == NULL) DBPRT(("%s: dedtime merge failed\n", id)); sys_out = NULL; /* list was merged into outages list. */ } } else { (void)sprintf(log_buffer, "WARNING! Could not get " "outages for system '%s'!", schd_SYSTEM_NAME); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } } /* Throw out the old list. */ free_outages(outlp->outages); /* And point to the new list of outages. */ outlp->outages = outages; outlp->cached_at = schd_TimeNow; } } /* * There is now (at least somewhat) valid data in the host cache. Find * the first entry on the list that we might be within. One could clean * up this list if a dedtime had come and gone, but the benefits would * be quite minimal, given the ratio of cache time to length of the * scheduled outages (usually secs vs. hours). * * A NULL list means that there is no scheduled outage - return the NULL * and be done with it. */ #ifdef DEBUG_DEDTIME DBPRT(("%s: FINAL OUTAGES FOR %s:\n", id, exechost)); for (outp = outlp->outages; outp != NULL; outp = outp->next) DBPRT(("%s: %s\n", id, print_outage(outp))); #endif /* DEBUG_DEDTIME */ for (outp = outlp->outages; outp != NULL; outp = outp->next) { /* Ignore any outage that has already come and gone. */ if (outp->end_time > when) break; DBPRT(("%s: Outage from %s:%s to %s:%s ignored\n", id, outp->beg_datestr, outp->beg_timestr, outp->end_datestr, outp->end_timestr)); } return (outp); } /* * Dedicated time is scheduled to begin soon. Determine if the given job * will complete before dedicated time starts. */ int schd_dedicated_can_run(Job *job, Queue *queue, time_t when, char *reason) { #ifdef DEBUG_DEDTIME char *id = "schd_dedicated_can_run"; #endif /* DEBUG_DEDTIME */ Outage *host_out; char *shorthost; time_t job_ends; /* * If no dedicated queues are defined, or dedicated time is not being * enforced, then there's no dedtime to worry about. */ if (!(schd_ENFORCE_DEDTIME && schd_TimeNow >= schd_ENFORCE_DEDTIME)) return(1); if (schd_DedQueues == NULL) return(1); /* If no time is given, assume that the caller means "now". */ if (when == 0) when = schd_TimeNow; /* Get the (possibly cached) dedicated time for the queue's exechost. */ host_out = schd_host_outage(queue->exechost, when); /* No dedicated time for this host. */ if (host_out == NULL) return (1); shorthost = schd_shorthost(host_out->exechost); job_ends = when + job->walltime; /* Is the time currently between the start and end of the dedicated time? */ if ((host_out->beg_time <= when) && (when <= host_out->end_time)) { /* * If the job was not queued on the dedicated queue, it cannot be * run during dedicated time. Note that and return "not okay." */ if (job->flags & JFLAGS_DEDICATED) { /* * The job is on the dedicated queue. It may not be runnable * if it runs over past the end of dedicated time. Check that. */ if (job_ends >= host_out->end_time) { if (reason) (void)sprintf(reason, "Can't complete within this dedicated time (%s %s %s)", shorthost ? shorthost : host_out->exechost, host_out->end_datestr, host_out->end_timestr); return 0; } } else { /* Job is a regular job. It cannot run during dedicated time. */ if (reason) sprintf(reason, "Waiting for end of dedicated time (%s %s %s)", shorthost ? shorthost : host_out->exechost, host_out->end_datestr, host_out->end_timestr); return 0; } } else { /* * It is not currently dedicated time. However, the job may spill * over into dedtime. Check this by calculating when the job will * finish execution and seeing if that falls within dedicated time. */ if (job_ends >= host_out->beg_time) { if (reason) (void)sprintf(reason, "Can't complete before next dedicated time (%s %s %s)", shorthost ? shorthost : host_out->exechost, host_out->beg_datestr, host_out->beg_timestr); return 0; } } #ifdef DEBUG_DEDTIME DBPRT(("%s: job %s is okay.\n", id, job->jobid)); #endif /* DEBUG_DEDTIME */ return 1; /* Job will not interfere with dedicated time if run now. */ } /* * Get a linked list of outages for host exechost. The caller is expected * to point the 'exechost' pointer for each element in this list to a piece * of storage containing the exechost's name. This is crufty, but minimizes * the amount of extra allocation being done. */ static int get_outages(char *exechost, Outage **outlistp) { char *id = "get_outages"; char buffer[BUFSIZ]; char ded_ck_cmd[BUFSIZ]; char *p, *shortexec; char Start_Date[DATE_LENGTH + 1]; /* + 1 for '\0' */ char Start_Time[TIME_LENGTH + 1]; /* + 1 for '\0' */ char End_Date[DATE_LENGTH + 1]; /* + 1 for '\0' */ char End_Time[TIME_LENGTH + 1]; /* + 1 for '\0' */ char *ded_system; FILE *schedule_pipe; Outage *outs, *tail, *newout; int info_valid, ded_cancelled; size_t length; outs = tail = NULL; /* * Assume we will not get valid dedtime information from the piped command. */ info_valid = 0; Start_Date[0] = '\0'; Start_Time[0] = '\0'; End_Date[0] = '\0'; End_Time[0] = '\0'; /* Get the "short" version of the exechost. */ shortexec = schd_shorthost(exechost); if (shortexec == NULL) return (-1); sprintf(ded_ck_cmd, "%s %s", schd_DEDTIME_COMMAND, shortexec); DBPRT(("%s: Consult '%s'\n", id, ded_ck_cmd)); if ((schedule_pipe = popen(ded_ck_cmd, "r")) == NULL) { (void)sprintf(log_buffer, "ERROR: \"%s\": %s", ded_ck_cmd, strerror(errno)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); free(shortexec); return (1); } /* Read each entry from the schedule output. */ while (fgets(buffer, sizeof buffer, schedule_pipe) != NULL) { ded_cancelled = 0; /* Skip totally blank lines. */ if ((length = strlen(buffer)) == 0) continue; /* Flag an error if this line was too long. */ if (length >= (sizeof(buffer) - 1)) { (void)sprintf(log_buffer, "%s: Input line from '%s' too long.", id, ded_ck_cmd); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); info_valid = 0; break; } /* Remove trailing carriage return. */ if (buffer[length - 1] == '\n') buffer[length - 1] = '\0'; /* Check for error conditions returned by the program. */ if (!strncmp(buffer, "ERROR", 5)) { info_valid = 0; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, buffer); DBPRT(("%s: %s\n", id, buffer)); break; } if (!strcmp(buffer, "No scheduled downtime for the specified period.")) { info_valid ++; break; /* None scheduled */ } /* * Output of 'schedule' "linewraps" with more than 8 spaces before * the text. I.e. more than 8 spaces means that this is a continued * line. We are only interested in the "header" lines. */ if (!strncmp(buffer, " ", 8)) { continue; } if (strstr(buffer, "CANCELLED")) ded_cancelled ++; /* format: "SYSTEM MM/DD/YYYY HH:MM-HH:MM MM/DD/YYYY" */ p = strtok(buffer, " \t"); /* p -> '' */ if (p == NULL) continue; /* Keep track of which system this line references. */ ded_system = p; p = strtok(NULL, " \t"); /* p -> '' */ if (p == NULL) continue; strncpy(Start_Date, p, DATE_LENGTH); p = strtok(NULL, "-"); /* p -> '' */ if (p == NULL) continue; strncpy(Start_Time, p, TIME_LENGTH); p = strtok(NULL, " \t"); /* p -> '' */ if (p == NULL) continue; strncpy(End_Time, p, TIME_LENGTH); p = strtok(NULL, " \t"); /* p -> '' */ if (p == NULL) continue; strncpy(End_Date, p, DATE_LENGTH); /* * We have discovered a line that "looks okay". Consider the output * being sent from the schedule command to be "acceptable". */ info_valid++; /* * It may be a valid line, and still not be information about this * machine. Convert the string to all lowercase before comparing * it against the lowercase system name. */ schd_lowercase(ded_system); if (strcmp(ded_system, shortexec) != 0) { continue; } if (MMDDYYYY_HHMM(Start_Date, Start_Time) >= MMDDYYYY_HHMM(End_Date, End_Time)) { DBPRT(("%s: found dedtime shorter than 1 minute!\n", id)); DBPRT(("%s: bad dedtime: (%s %s %s - %s %s)\n", id, shortexec, Start_Date, Start_Time, End_Date, End_Time)); continue; } if (ded_cancelled) { /* * A cancellation is a valid entry. It also means we need to * update our cache, since it may be cancelling the cached * value. However, we also need to see if there is any time * really scheduled later. */ DBPRT(("%s: found cancelled dedtime for %s from %s:%s to %s:%s\n", id, shortexec, Start_Date, Start_Time, End_Date, End_Time)); info_valid ++; continue; } /* * Dedicated time is scheduled for this machine. Will it end at * some _future_ time ?? If so, make a new entry in the list of * Outages for the shortexec. */ if (MMDDYYYY_HHMM(End_Date, End_Time) > schd_TimeNow) { info_valid ++; if ((newout = (Outage *)malloc(sizeof(Outage))) == NULL) { (void)sprintf(log_buffer, "malloc(Outage) failed\n"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); info_valid = 0; break; } memset((void *)newout, 0, sizeof(Outage)); /* Hook the new element on the end of the list. */ if (tail) tail->next = newout; else outs = newout; tail = newout; newout->next = NULL; /* Load the outage information into the new struct. */ newout->exechost = NULL; /* Caller must set. */ strncpy(newout->beg_datestr, Start_Date, DATE_LENGTH); strncpy(newout->beg_timestr, Start_Time, TIME_LENGTH); strncpy(newout->end_datestr, End_Date, DATE_LENGTH); strncpy(newout->end_timestr, End_Time, TIME_LENGTH); newout->beg_time = MMDDYYYY_HHMM(Start_Date, Start_Time); newout->end_time = MMDDYYYY_HHMM(End_Date, End_Time); } } pclose(schedule_pipe); free(shortexec); if (info_valid) { *outlistp = outs; return 0; } else { DBPRT(("%s: no valid dedtime info found (%s)\n", id, ded_ck_cmd)); if (outs) free_outages(outs); *outlistp = NULL; return 1; } } static Outage * merge_outages(Outage *system_outages, Outage *host_outages) { char *id = "merge_outages"; Outage **outp_array, *outp, *newlist; int num_outages, i, found; /* If there are no system outages, just return the host list. */ if (system_outages == NULL) return (host_outages); /* If there are no host outages, just return the system list. */ if (host_outages == NULL) return (system_outages); /* Count the total number of outages in both lists. */ num_outages = 0; for (outp = system_outages; outp != NULL; outp = outp->next) ++ num_outages; for (outp = host_outages; outp != NULL; outp = outp->next) ++ num_outages; /* Now allocate space for a bunch of pointers to the outages. */ outp_array = (Outage **)calloc(num_outages, sizeof(Outage *)); if (outp_array == NULL) { (void)sprintf(log_buffer, "calloc() failed (%d * %d)\n", num_outages, (int)sizeof(Outage *)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); /* Free the passed-in lists. */ free_outages(system_outages); free_outages(host_outages); /* And return an error condition. */ return (NULL); } /* * Walk the outage lists again, assigning each element in the array to * point to one outage. Sort the resultant array in ascending order * of the start time of the outage pointed to by each element in the * array. */ i = 0; for (outp = system_outages; outp != NULL; outp = outp->next) outp_array[i++] = outp; for (outp = host_outages; outp != NULL; outp = outp->next) outp_array[i++] = outp; qsort(outp_array, num_outages, sizeof(Outage *), compare_outages_time); /* * The array is now a set of pointers to outages. Re-link the outages in * the order given in the array. */ newlist = outp = outp_array[0]; for (i = 1; i < num_outages; i++) { outp->next = outp_array[i]; outp = outp->next; } outp->next = NULL; /* Free the array of pointers since it is no longer needed. */ free(outp_array); /* * Now the 'newlist' list contains the members of both lists, arranged in * time from earliest to latest. All that remains is to resolve any * overlapping cases. Do this one at a time, until no more can be found. * This should significantly simplify the code, and since there should * only be a handful of outages at any time, it won't be prohibitively * expensive. */ DBPRT(("%s: MERGED/SORTED OUTAGES LIST:\n", id)); for (outp = newlist; outp != NULL; outp = outp->next) DBPRT(("%s: %s\n", id, print_outage(outp))); for (i = 0; i < MAX_OUTAGE_RESOLVE_ITERS; i++) { found = resolve_outage_overlap(&newlist); if (found < 0) { (void)sprintf(log_buffer, "couldn't resolve overlaps!"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); /* Free the merged contents of the two lists. */ free_outages(newlist); return (NULL); } if (found == 0) { /* No overlaps were found and resolved, so nothing left to do. */ break; } /* At least one overlap was found and fixed. Try to find more. */ continue; } if (i == MAX_OUTAGE_RESOLVE_ITERS) { (void)sprintf(log_buffer, "WARNING!!! Couldn't resolve all overlaps in %d passes!", i); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } /* * 'newlist' should now contain a list of outages, either for the system * or for this individual host, ordered in time, and with no overlaps. */ return (newlist); } static int resolve_outage_overlap(Outage **outlistp) { char *id = "resolve_outage_overlap"; Outage *new, *discard; Outage *outp, *next, *this, *host, *sys; time_t sys_beg, sys_end, host_beg, host_end; int found = 0; /* * Walk the list of outages, looking for overlaps and resolving them. * Once an overlap has been resolved, return 1 to indicate that there * was an overlap found. In this case, this function should be called * again. If no overlaps are found, return 0 to indicate that fact. * Return -1 on error. * * Note that system outages should take priority over per-host outages. * * The outages list *must* be sorted into ascending order of start-time * for the outages. * * The five possible overlap scenarios are ('*' indicates system outage * time, '-' indicates host outages, blank space is non-outage time) : * * Time *** *** ----- ----- ----- * | -***- *** ----- *** * | -***- ----- *** *** *** * | *** ----- *** ----- *** * | * V Case: 1 2 3 4 5 (no overlap) */ /* * Discarded outages go on this list, so they can be easily reclaimed * if another outage needs to be allocated. */ discard = NULL; /* * Start with the original list head pointer. This will be replaced * with the new head at the end of the for loop. */ new = *outlistp; for (this = new; this->next != NULL; this = next) { next = this->next; /* * If this outage ends before the next one starts, then there is no * overlap between these two elements. */ if (this->end_time < next->beg_time) continue; /* Found an overlap. */ found = 1; /* * Check the types of the two outages. If they are the same, extend * the first entry to stretch through the whole time, note the fact. * Otherwise, figure out which is the host outage, and which is the * system outage, and assign pointers respectively. */ if ((this->flags & OUTAGE_FLAGS_SYSTEM) == (next->flags & OUTAGE_FLAGS_SYSTEM)) { DBPRT(("%s: Two outages of same type (%s) overlap.\n", id, (this->flags & OUTAGE_FLAGS_SYSTEM) ? "system" : "host")); DBPRT(("%s: Outages are (%s)\n", id, print_outage(this))); DBPRT(("%s: (%s)\n", id, print_outage(next))); /* * Expand both outages to cover the same time. This will * cause it to be dealt with by case 1 below. */ this->beg_time = MIN(this->beg_time, next->beg_time); this->end_time = MAX(this->end_time, next->end_time); next->beg_time = this->beg_time; next->end_time = this->end_time; /* Create new time/date strings for the different time_t's. */ make_time_strs(this); make_time_strs(next); DBPRT(("%s: Overlap extended to (%s)\n", id, print_outage(this))); /* And assign them "relative priorities". */ sys = this; host = next; } else { /* Figure out which is the system and which is the host outage. */ if (this->flags & OUTAGE_FLAGS_SYSTEM) { sys = this; host = next; } else { host = this; sys = next; } } DBPRT(("%s: system outage (%s) overlaps\n", id, print_outage(sys))); DBPRT(("%s: host outage (%s)\n", id, print_outage(host))); sys_beg = sys->beg_time; sys_end = sys->end_time; host_beg = host->beg_time; host_end = host->end_time; /* * Quick sanity check for reasonable outage times. */ if ((sys_end - sys_beg) < 1) { (void)sprintf(log_buffer, "system outage (%s) less than 1 second!\n", print_outage(sys)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); /* Note the problem and return an error. */ found = -1; break; } if ((host_end - host_beg) < 1) { (void)sprintf(log_buffer, "host outage (%s) less than 1 second!\n", print_outage(host)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); /* Note the problem and return an error. */ found = -1; break; } /* Case 1: 'sys' starts before, and ends after, 'host'. * This is a complete overlap (the easy case). This is either a * duplicated host outage, or a system outage overlaps the host * outage. In either case, choose one to discard and it's done. */ if ((sys_beg <= host_beg) && (sys_end >= host_end)) { DBPRT(("%s: case 1: sys outage overlaps all of host outage.\n", id)); DBPRT(("%s: Discarding host outage (%s)\n", id, print_outage(host))); /* * Discard the per-host outage onto the discard pile. It * may be re-used if a new element is required. If not, it * will be freed at the end of the function. If the host * outage is the first in the list, bump the new list pointer * forward, otherwise find the previous element and point over * the host element to the next one. */ if (host != new) { for (outp = new; outp != NULL; outp = outp->next) /* Walk list looking for previous pointer. */ if (outp->next == host) break; if (outp == NULL) { DBPRT(("%s: host outage not found!\n", id)); found = -1; break; } DBPRT(("%s: host outage not head of list. Skipping from %s\n", id, print_outage(outp))); outp->next = host->next; } else { new = host->next; DBPRT(("%s: host outage is head of list. new head %s\n", id, print_outage(new))); } host->next = discard; discard = host; DBPRT(("%s: Place host on discard pile %s\n", id, print_outage(discard))); /* This conflict is now resolved. Break out of loop. */ break; } /* Case 2: 'system' starts before, and ends before, 'host' outage. * Adjust the host outage to start just after the system outage ends. * The conflict is then resolved. */ if ((sys_beg <= host_beg) && (sys_end < host_end)) { DBPRT(("%s: case 2: sys outage overlaps start of host outage.\n", id)); host->beg_time = sys_end + 1; /* Sanity check. "This can't happen." */ if (host->end_time <= host->beg_time) { DBPRT(("%s: host outage %s < 1 second long!", id, print_outage(host))); found = -1; break; } /* Create new time/date strings for the changed time_t's. */ make_time_strs(host); DBPRT(("%s: host outage bumped to (%s)\n", id, print_outage(host))); /* That's all that's required to resolve the conflict. */ break; } /* Case 3: 'system' outage starts after, and ends after, 'host' outage. * Adjust the host outage to end just before the system outage starts. * The conflict is then resolved. */ if ((sys_beg > host_beg) && (sys_end >= host_end)) { DBPRT(("%s: case 3: sys outage overlaps end of host outage.\n", id)); host->end_time = sys_beg - 1; /* Sanity check. "This can't happen." */ if (host->end_time <= host->beg_time) { DBPRT(("%s: host outage %s < 1 second long!", id, print_outage(host))); found = -1; break; } /* Create new time/date strings for the changed time_t's. */ make_time_strs(host); DBPRT(("%s: host outage bumped to (%s)\n", id, print_outage(host))); /* That's all that's required to resolve the conflict. */ break; } /* Case 4: 'system' outage starts after, and ends before 'host' outage. * System outage splits the host outage into two pieces. Shorten the * first piece like case #3 above, and create a new Outage for the * remaining chunk. */ if ((sys_beg > host_beg) && (sys_end < host_end)) { DBPRT(("%s: case 4: sys outage overlaps middle of host outage.\n", id)); /* Shorten the original host entry to first chunk of the outage. */ host->end_time = sys_beg - 1; /* Create a new host chunk to follow the system one on the list. */ if (discard) { outp = discard; discard = discard->next; } else { if ((outp = (Outage *)malloc(sizeof(Outage))) == NULL) { (void)sprintf(log_buffer, "malloc(%d) failed!", (int)sizeof(Outage)); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); found = -1; break; } } /* Initialize the new element. */ memset((void *)outp, 0, sizeof(Outage)); /* Point to the host's exechost, and fill in the time fields. */ outp->exechost = host->exechost; outp->beg_time = sys_end + 1; outp->end_time = host_end; /* Now recompute the date and time strings for each outage. */ make_time_strs(host); /* The original "first" chunk */ make_time_strs(outp); /* The newly-created 2nd chunk */ DBPRT(("%s: Split host outage into :\n", id)); DBPRT(("%s: host outage (%s)\n", id, print_outage(host))); DBPRT(("%s: sys outage (%s)\n", id, print_outage(sys))); DBPRT(("%s: new host outage (%s)\n", id, print_outage(outp))); /* And link the new host outage in after the system outage. */ outp->next = sys->next; sys->next = outp; /* And this case is resolved. */ break; } /* Unexpected case! Return an error! */ (void)sprintf(log_buffer, "unexpected outage overlap!"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); found = -1; break; } /* * Replace the pointer to the head of the list with the head of the new * outage list. The new list may not have the same head as the old one * (if the original head was discarded). */ *outlistp = new; /* Clean up the discard list, if necessary. */ if (discard) free_outages(discard); discard = NULL; return (found); } /* * Return a pointer to a static buffer containing a string describing the * times of the outage. */ static char * print_outage(Outage *outp) { static char buffer[64]; sprintf(buffer, "%s %s:%02.2d - %s %s:%02.2d [%s]", outp->beg_datestr, outp->beg_timestr, (int)(outp->beg_time % 60), outp->end_datestr, outp->end_timestr, (int)(outp->end_time % 60), outp->exechost); return (buffer); } static int compare_outages_time(const void *e1, const void *e2) { Outage *outage1 = *(Outage **)e1; Outage *outage2 = *(Outage **)e2; time_t diff; /* Sort first based on starting time, from soonest to latest. */ diff = outage1->beg_time - outage2->beg_time; if (diff) return (diff); /* Break ties by sorting by end time. */ diff = outage1->end_time - outage2->end_time; return (diff); } static int make_time_strs(Outage *outp) { struct tm *tm_ptr; if ((tm_ptr = localtime(&(outp->beg_time))) == NULL) return (1); sprintf(outp->beg_datestr, "%2.2d/%2.2d/%4.4d", tm_ptr->tm_mon + 1, tm_ptr->tm_mday, tm_ptr->tm_year + 1900); sprintf(outp->beg_timestr, "%2.2d:%2.2d", tm_ptr->tm_hour, tm_ptr->tm_min); if ((tm_ptr = localtime(&(outp->end_time))) == NULL) return (1); sprintf(outp->end_datestr, "%2.2d/%2.2d/%4.4d", tm_ptr->tm_mon + 1, tm_ptr->tm_mday, tm_ptr->tm_year + 1900); sprintf(outp->end_timestr, "%2.2d:%2.2d", tm_ptr->tm_hour, tm_ptr->tm_min); return (0); } /* * Free each element of a list of outages. Note that the 'exechost' field * for the outage points back to the OutageList->host, and isn't allocated * storage. */ static int free_outages(Outage *outages) { int n; Outage *ptr, *next; for (n = 0, ptr = outages; ptr != NULL; ptr = next) { next = ptr->next; free(ptr); n++; } return (n); } /* Parse "MM/DD/YYYY HH:MM" style dates into seconds since the Epoch. */ static int MMDDYYYY_HHMM(char *MMDDYYYY, char *HHMM) { /* char *id = "MMDDYYYY_HHMM"; */ struct tm junk; char copy[MAX_TXT + 1]; strcpy(copy, MMDDYYYY); /* Copy it so we can modify the string. */ copy[2] = copy[5] = '\0'; /* 'MM/DD/YYYY\0' ==> 'MM\0DD\0YYYY\0' */ junk.tm_mon = atoi(copy); junk.tm_mday = atoi(copy + 3); junk.tm_year = atoi(copy + 6); junk.tm_mon -= 1; /* mktime() counts from 0, not 1 like us */ junk.tm_year -= 1900; /* mktime() counts from 1900 */ strcpy(copy, HHMM); /* Copy it so we can modify the string. */ copy[2] = '\0'; /* 'HH:MM\0' ==> 'HH\0MM\0' */ junk.tm_hour = atoi(copy); junk.tm_min = atoi(copy + 3); junk.tm_sec = 0; junk.tm_isdst = -1; /* Choose correct DST value from timezone */ return (int)mktime(&junk); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/dedqueue.c0000664000113300011330000002556611272401241020317 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * FILE: dedqueue.c * Contains routines needed to process dedicated time and/or scheduled * down time. */ #include #include #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" #include "msgs.h" static int schedule_dedicated(Queue *dedq); int schd_handle_dedicated_time(Queue *dedq) { char *id = "schd_handle_dedicated_time"; Job *jobs; Outage *outages; char *comment, *shorthost; char *ptr; char buffer[256]; int ran; if (!(schd_ENFORCE_DEDTIME && schd_TimeNow >= schd_ENFORCE_DEDTIME)) { comment = schd_booltime2val(schd_ENFORCE_DEDTIME); strcpy(buffer, schd_JobMsg[NO_DED_TIME]); if (ptr = strchr(comment, '(')) { strcat(buffer, " "); strcat(buffer, ptr); } comment = buffer; DBPRT(("%s: dedicated time is not enforced.\n", id)); } else { outages = schd_host_outage(dedq->exechost, 0); /* Get the short hostname for the outages string. */ shorthost = schd_shorthost(dedq->exechost); if (outages != NULL) { /* Are we currently in dedicated time? */ if ((schd_TimeNow >= outages->beg_time) && (schd_TimeNow < outages->end_time)) { (void)sprintf(log_buffer, "currently dedtime for %s (%s/%s - %s/%s)", shorthost ? shorthost : outages->exechost, outages->beg_datestr, outages->beg_timestr, outages->end_datestr, outages->end_timestr); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); DBPRT(("%s: schedule_dedicated(%s@%s)\n", id, dedq->qname, dedq->exechost)); ran = schedule_dedicated(dedq); return (ran); } else { /* Dedtime is being enforced, and a dedtime is upcoming. */ (void)sprintf(log_buffer, "upcoming dedtime for %s (%s/%s - %s/%s)", shorthost ? shorthost : outages->exechost, outages->beg_datestr, outages->beg_timestr, outages->end_datestr, outages->end_timestr); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); sprintf(buffer, "%s (%s %s %s)", schd_JobMsg[WAIT_FOR_DEDTIME], shorthost ? shorthost : outages->exechost, outages->beg_datestr, outages->beg_timestr); if (shorthost) free(shorthost); comment = buffer; DBPRT(("%s: %s\n", id, comment)); } } else { /* Dedtime is being enforced, but no dedtime is upcoming. */ sprintf(buffer, "%s (none scheduled for %s)", schd_JobMsg[WAIT_FOR_DEDTIME], shorthost); comment = buffer; DBPRT(("%s: waiting for dedicated time.\n", id)); } } /* Set the comment in each of the dedicated time jobs * noting why they are waiting. * Don't care if it's NULL -- if so, no jobs are waiting. */ for (jobs = dedq->jobs; jobs != NULL; jobs = jobs->next) { schd_comment_job(jobs, comment, JOB_COMMENT_OPTIONAL); } return (0); } /* * Dedicated-time job scheduling algorithm. * */ static int schedule_dedicated(Queue *dedq) { char *id = "schedule_dedicated"; Job *job; char reason[256]; int queue_full, ran = 0; /* * Determine if the dedicated queue is full. This isn't a fatal error - * if it is, just comment each job that this is the case. 'reason' will * still be set in the check below. */ queue_full = schd_check_queue_limits(dedq, reason); if (dedq->rsrcs == NULL) dedq->rsrcs = schd_get_resources(dedq->exechost); if (dedq->rsrcs == NULL) { DBPRT(("%s: schd_get_resources(%s) failed!\n", id, dedq->exechost)); return (-1); } /* * Choose the first N jobs that "fit" into the queue's resource limits. * prevents the call to actually run the job, but allows the scheduler * to set the comment field to the correct string for each pending job. */ DBPRT(("%s: Considering jobs:\n", id)); for (job = dedq->jobs; job != NULL; job = job->next) { /* We are only interested in jobs in state "Q" == Queued */ if (job->state != 'Q') continue; /* * If queue_limits() says that no jobs may be run on the queue, set * the comment field of each job. 'reason' will still be set from * the call to 'check_queue_limits()' above. */ if (queue_full) { DBPRT(("queue_full -- rejected [%s]\n", reason)); schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } if (!schd_job_fits_queue(job, dedq, reason)) { DBPRT(("job %s does not fit %s : %s\n", job->jobid, dedq->qname, reason)); schd_reject_job(job, reason); continue; } /* * Check that the resources requested by this job will not exceed * the system's available resources. */ if (schd_resource_limits(job, dedq->rsrcs, reason)) { DBPRT(("rejected by resource_limits() [%s]\n", reason)); schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } DBPRT(("dedicated_can_run('%s', '%s'):\n", job->jobid, dedq->qname)); /* Zero 'when' argument indicates that we are asking about "now". */ if (!schd_dedicated_can_run(job, dedq, 0, reason)) { DBPRT(("No (%s).\n", reason)); schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } /* * Check that the resources requested by this job will not * exceed the queue's available resources, and that it will * fit within the dedicated time. */ if (schd_user_limits(job, dedq, reason)) { DBPRT(("rejected by user_limits() [%s]\n", reason)); schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } /* * Job is okay. * * Run the job on the queue, and set its comment to indicate when * it began running. Then add its expected resource usage to the * queue's limits and resources. */ if (schd_run_job_on(job, dedq, dedq->exechost, SET_JOB_COMMENT)) { (void)sprintf(log_buffer, "Unable to run job '%s' on queue '%s'.", job->jobid, dedq->qname); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return (-1); } /* Account for the job's impact on the queue. */ schd_charge_job(job, dedq, dedq->rsrcs); ran++; /* Count number of jobs running on the queue. */ } DBPRT(("%s: ran %d jobs on queue %s@%s.\n", id, ran, dedq->qname, dedq->exechost)); return (ran); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/pack_queues.c0000664000113300011330000004317311272401241021015 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: pack_queues.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Scheduler header files */ #include "toolkit.h" #include "gblxvars.h" #include "msgs.h" extern int connector; /* * Given a list of jobs, ordered from most-eligible to least-eligible to * run, attempt to place as many of them as possible into the queues listed * in qlist. Jobs that will not currently fit are ignored (i.e. the entire * list is processed, running each job in order that fits). * * Jobs are run by run_job_on() as they are found on the list. Resources * must be supplied because the jobs are tested against them in * 'schd_resource_limits()', and they are updated by sched_run_jobs_on(). * * This function returns the number of jobs run, or -1 on error. */ int schd_pack_queues(Job *jobs, QueueList *qlist, char *reason) { char *id = "schd_pack_queues"; Job *job, *nextjob; QueueList *qptr; Queue *queue, *firstfit; int allfull, jobsrun, rerun; char str[PBS_MAXHOSTNAME + 32]; jobsrun = 0; DBPRT(("%s: scheduling queues", id)); for (qptr = qlist; qptr != NULL; qptr = qptr->next) { DBPRT((" %s@%s", qptr->queue->qname, qptr->queue->exechost)); } DBPRT((".\n")); if (jobs == NULL) { DBPRT(("No jobs available for QueueList %s%s - all done!", qlist->queue->qname, qlist->next ? " ..." : "")); return (0); } /* This is the first run through this part of the code. */ rerun = 0; /* * Consider jobs from the list of queues. For each job, if it appears * eligible to run, try to find a queue on which to place it. * * Note that schd_run_job_on() may remove the job from the list, so * this function must keep track of the current job's next pointer. */ run_job_list: for (job = jobs; job != NULL; job = nextjob) { nextjob = job->next; /* Ignore any non-queued jobs in the list. */ if (job->state != 'Q') continue; /* * Would this job cause the user to exceed group's current allocation? */ if (schd_ENFORCE_ALLOCATION && schd_TimeNow >= schd_ENFORCE_ALLOCATION) { if (job->group != NULL) { if (schd_is_over_alloc(job->group)) { /* * schd_reject_over_alloc() will delete the job from * PBS, and also from the queue's job list. */ if (schd_reject_over_alloc(job)) { (void)sprintf(log_buffer, "reject_over_alloc() failed for job %s\n", job->jobid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } continue; } } else { (void)sprintf(log_buffer, "ENFORCE ALLOCATION set, but job %s has no group field", job->jobid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); continue; } } /* See if any queues are available for scheduling now. */ allfull = 1; /* Assume all queues are full to start. */ for (qptr = qlist; qptr != NULL; qptr = qptr->next) { if ((qptr->queue->flags & QFLAGS_FULL == 0) && ((qptr->queue->rsrcs == NULL) || (!schd_evaluate_system(qptr->queue->rsrcs, reason)))) { DBPRT(("%s: evaluate_system: %s\n", id, qptr->queue->rsrcs ? reason : "No resources")); DBPRT(("%s: Marking queue %s@%s full\n", id, qptr->queue->qname, qptr->queue->exechost)); qptr->queue->flags |= QFLAGS_FULL; } /* * If an empty queue has not yet been found, check this one. * if this queue is not full, then all queues are not full. * Note this and continue - if all queues are full at the * end of this exercise, we will give up. */ if (allfull) if (!schd_check_queue_limits(qptr->queue, NULL)) allfull = 0; } /* * Check each queue in the list in order, to see if this job * will fit, and if it should be run now. */ firstfit = NULL; /* Haven't found the first queue it fits. */ for (qptr = qlist; qptr != NULL; qptr = qptr->next) { queue = qptr->queue; /* * If this is the first queue that this job will fit in, then * note it. This is the "best fit" queue (hopefully) and the * job comment should not be modified unless the comment refers * to this queue. * */ if (!schd_job_fits_queue(job, queue, reason)) continue; /* * If this job has a user access control list, check that this * job can be allowed in it. */ if (queue->useracl && (queue->flags & QFLAGS_USER_ACL)) { if (!schd_useracl_okay(job, queue, reason)) { DBPRT(("%s: %s %s\n", id, job->jobid, reason)); continue; } } if (!firstfit) firstfit = queue; /* * Check that this job will not overrun a dedicated time. The '0' * indicates that we are interested in "now". */ if (schd_ENFORCE_DEDTIME && schd_TimeNow >= schd_ENFORCE_DEDTIME) { if (!schd_dedicated_can_run(job, queue, 0, reason)) { if (firstfit == queue) schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } } /* * Check primetime limits. If it is primetime now, and the job * will complete before primetime, limit it to 1 hour. If it will * overrun primetime, be sure that the amount that falls within * primetime will not violate the primetime limit. * Special jobs are not subject to primetime walltime limits. */ if (schd_ENFORCE_PRIME_TIME && (schd_TimeNow >= schd_ENFORCE_PRIME_TIME) && (schd_SMALL_JOB_MAX <= 0)) { if (!(job->flags & JFLAGS_PRIORITY)) { if (schd_primetime_limits(job, queue, 0, reason)) { schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); /* Note that a job could have run if it were not pt. */ if (!rerun) queue->flags |= QFLAGS_NPT_JOBS; continue; } } } /* * Check that this job will complete before the beginning of * nonprime. The '0' indicates that we are interested in "now". */ if (schd_NONPRIME_DRAIN_SYS) { /* Note: Special jobs are not subject to this restriction */ if (!(job->flags & JFLAGS_PRIORITY)) { if (!schd_finish_before_np(job, queue, 0, reason)) { schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); /* Note that a job could have run if it were not pt. */ if (!rerun) queue->flags |= QFLAGS_NPT_JOBS; continue; } } } /* * Check that the queue is actually available to pack jobs * into. Although it was checked above, the above test is * very inexpensive, so it's not a big deal to do it again. */ if (schd_check_queue_limits(queue, reason)) { if (firstfit == queue) schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } /* * Check this job against the execution resource limits. * There is no point to going any further if this job would * overrun the system limits. * It is possible for the size of the queues to be larger than * the available resources on the machine (i.e. a node board * goes down). Make sure that jobs are not considered that will * not be able to run within the system's current resources. */ if (!schd_resources_avail(job, queue->rsrcs, reason) || schd_resource_limits(job, queue->rsrcs, reason)) { if (firstfit == queue) schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); /* Continue to the next job. */ continue; } /* * Check that this job will complete before the beginning of * nonprime. The '0' indicates that we are interested in "now". * Note: Special jobs are not subject to this restriction. */ if (schd_NONPRIME_DRAIN_SYS && !(job->flags & JFLAGS_PRIORITY)) { if (!schd_finish_before_np(job, queue, 0, reason)) { schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } } /* * If the queue is being drained, don't run the job in it unless * (1) there are unreserved resources available, or * (2) it would *not* increase the time it will take to drain * the queue. Note that drain_by is the absolute time, while * the job->time_left is relative to now. */ /* (1) are there unreserved nodes available? */ if (job->nodes > (queue->nodes_max - (queue->nodes_assn + queue->nodes_rsvd))) { /* no, so (2) see if we can backfill with this job... */ if (queue->flags & QFLAGS_DRAINING) { if ((schd_TimeNow + job->walltime) > queue->drain_by) { (void)sprintf(reason, "Queue %s is being drained for high-priority job.", queue->qname); if (firstfit == queue) schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } } } /* * Queue can accept a job, provided the job does not overrun the * queue limits. */ if (schd_user_limits(job, queue, reason)) { if (firstfit == queue) schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } /* * Check for fragmentation in the queue, and don't run it if so. * fragment_okay() returns -1 if queue is nonsensical, 1 if this * job would induce or perpetuate fragmentation. If this job is * waiting, we don't care - just run it. */ if (schd_AVOID_FRAGS && !(job->flags & JFLAGS_WAITING)) { if (!schd_fragment_okay(job, queue, reason)) { if (firstfit == queue) schd_comment_job(job, reason, JOB_COMMENT_OPTIONAL); continue; } } /* * Found a queue on which this job can run. Attempt to run it. */ break; } /* * If the job was unable to fit on all of the queues, go on to the * next one. For "strict" packing, make this a 'break' and it will * stop processing jobs when it finds the first one that does not * fit. */ if (!qptr) { /* * If the job did not fit in any of the provided queues, assume * that the queue it wants is not available. Provide a comment, * even if it is sort of vague. */ if (firstfit == NULL) { schd_comment_job(job, schd_JobMsg[NO_RESOURCES], JOB_COMMENT_OPTIONAL); } continue; } /* There is a queue free enough to run this job. */ if (schd_run_job_on(job, qptr->queue, qptr->queue->exechost, SET_JOB_COMMENT)) { (void)sprintf(log_buffer, "Unable to run batch job %s on queue %s", job->jobid, qptr->queue->qname); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return (-1); } /* * Account for the job's impact on the queue. * This includes subtracting the job's resource requests from the * queue's available resources. */ schd_charge_job(job, queue, queue->rsrcs); jobsrun ++; } /* * Adjust the observance of primetime on the queues, if necessary. Do * it only if the queue is observing primetime, it has been idle for a * while(*), it's close enough(*) to primetime, and there were some jobs * that could have been run if primetime had been not-observed. */ if (!rerun && (schd_ENFORCE_PRIME_TIME && schd_TimeNow >= schd_ENFORCE_PRIME_TIME) && schd_NP_DRAIN_BACKTIME > 0 && schd_prime_time(0) && schd_secs_til_nonprime(0) <= schd_NP_DRAIN_BACKTIME) { for (qptr = qlist; qptr != NULL; qptr = qptr->next) { queue = qptr->queue; /* Were there any jobs that could have run if it were non-pt? */ if (!(queue->flags & QFLAGS_NPT_JOBS)) continue; if (queue->running) continue; /* Already disabled or idle - ignore this queue. */ if (!queue->observe_pt) continue; /* If a minimum idle time is given, check it. */ if ((schd_NP_DRAIN_IDLETIME > 0) && (schd_TimeNow - queue->idle_since) <= schd_NP_DRAIN_IDLETIME) continue; /* * Queue has been idle for some time. Start non-primetime early * so those jobs that were refused can start running now. */ (void)sprintf(log_buffer, "Turning off prime-time enforcement on queue %s\n", queue->qname); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); queue->observe_pt = 0; rerun ++; } if (rerun) { (void)sprintf(log_buffer, "Prime-time enforcement adjusted - reconsidering active jobs."); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); goto run_job_list; } } return (jobsrun); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/evaluate_system.c0000664000113300011330000001403711272401241021717 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: evaluate_system.c 2367 2008-09-03 17:17:34Z josh $ */ /* * Perform some basic analysis of system resources to determine if * jobs should be run. */ #include #include /* PBS header files */ #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" /* Scheduler head files */ #include "toolkit.h" #include "gblxvars.h" #define DONT_START_JOB 0 #define START_JOB 1 int schd_evaluate_system(Resources *rsrcs, char *reason) { double loadchk; if (rsrcs->nodes_alloc == rsrcs->nodes_total) { if (reason) (void)sprintf(reason, "No nodes available to schedule"); return (DONT_START_JOB); } /* Are there enough jobs running? If not, start one. */ if ((rsrcs->njobs < schd_MIN_JOBS) && schd_MIN_JOBS) { if (reason) (void)sprintf(reason, "Not running enough jobs (%d/%d min)", rsrcs->njobs, schd_MIN_JOBS); return (START_JOB); } /* Are there too many jobs running? If so, don't start one. */ if ((rsrcs->njobs >= schd_MAX_JOBS) && schd_MAX_JOBS) { if (reason) (void)sprintf(reason, "Maximum number of jobs running (%d/%d max)", rsrcs->njobs, schd_MAX_JOBS); return (DONT_START_JOB); } /* * If system time is high and we are permitting deferred jobs then * change our mind and don't permit deferred jobs. The high system * time could be a short duration anomaly due to several jobs all * doing I/O. However, we should let regular jobs start if we are * taking idle time. */ if ((rsrcs->systime >= schd_HIGH_SYSTIME) && schd_HIGH_SYSTIME) { if (reason) (void)sprintf(reason, "High system time (%d/%d max)", rsrcs->systime, schd_HIGH_SYSTIME); return (DONT_START_JOB); } if (reason) (void)sprintf(reason, "Done. Don't need to run any jobs."); /* * If we reached here, then we really don't need to start * another job. If we do, then the system could become over * burdened with work. */ return (DONT_START_JOB); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/jobinfo.c0000664000113300011330000005052711272401241020137 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: jobinfo.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include #include #include #include "pbs_ifl.h" #include "log.h" #include "net_connect.h" #include "toolkit.h" #include "gblxvars.h" extern int connector; static int bump_rsrc_requests(Job *job, int ncpus, size_t mem); /* * This function takes a pointer to a struct batch_status for a job, and * fills in the appropriate fields of the supplied job struct. It returns * the number of items that were found. */ int schd_get_jobinfo(Batch_Status *bs, Job *job) { char *id = "schd_get_jobinfo"; int changed = 0; int cpu_req = 0; size_t mem_req = 0; char *host; char *p, *tmp_p, *var_p; AttrList *attr; char canon[PBS_MAXHOSTNAME + 1]; int istrue; memset((void *)job, 0, sizeof(Job)); job->jobid = schd_strdup(bs->name); if (job->jobid == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(bs->name)"); return (-1); } changed ++; for (attr = bs->attribs; attr != NULL; attr = attr->next) { /* * If this is the 'owner' field, chop it into 'owner' and 'host' * fields, and copy them into the Job struct. */ if (!strcmp(attr->name, ATTR_owner)) { /* Look for the '@' that separates user and hostname. */ host = strchr(attr->value, '@'); if (host) { *host = '\0'; /* Replace '@' with NULL (ends username). */ host ++; /* Move to first character of hostname. */ } job->owner = schd_strdup(attr->value); if (job->owner == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(job->owner)"); return (-1); } changed ++; job->host = schd_strdup(host); if (job->host == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(job->host)"); return (-1); } changed ++; /* * We don't "own" the attribute strings, so put back the '@' * character we removed above, in case something else expects * it to be there. * Note that 'host' points to the first character of the host- * name, not the hole one character behind. */ if (host) { host --; /* Step back one character. */ *host = '@'; /* Replace the '@' that was deleted above. */ } /* That's all for the owner field. */ continue; } /* The group to which to charge the resources for this job. */ if (!strcmp(attr->name, ATTR_egroup)) { job->group = schd_strdup(attr->value); if (job->group == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(job->group)"); return (-1); } changed ++; continue; } /* The comment currently assigned to this job. */ if (!strcmp(attr->name, ATTR_comment)) { job->comment = schd_strdup(attr->value); if (job->comment == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(job->comment)"); return (-1); } changed ++; continue; } /* The host on which this job is running. */ if (!strcmp(attr->name, ATTR_exechost)) { job->exechost = schd_strdup(attr->value); if (job->exechost == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(job->exechost)"); return (-1); } changed ++; continue; } if (!strcmp(attr->name, ATTR_inter)) { /* Is this job interactive or not? */ if (schd_val2bool(attr->value, &istrue) == 0) { if (istrue) job->flags |= JFLAGS_INTERACTIVE; else job->flags &= ~JFLAGS_INTERACTIVE; changed ++; } else { DBPRT(("%s: can't parse %s = %s into boolean\n", id, attr->name, attr->value)); } continue; } if (!strcmp(attr->name, ATTR_state)) { /* State is one of 'R', 'Q', 'E', etc. */ job->state = attr->value[0]; changed ++; continue; } if (!strcmp(attr->name, ATTR_queue)) { job->qname = schd_strdup(attr->value); if (job->qname == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(job->qname)"); return (-1); } job->flags |= JFLAGS_QNAME_LOCAL; changed ++; continue; } if (!strcmp(attr->name, ATTR_v)) { var_p = schd_strdup(attr->value); if (var_p == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(Variable_List)"); return (-1); } p = NULL; tmp_p = strstr(var_p, "PBS_O_QUEUE"); if (tmp_p) { p = strtok(tmp_p, "="); p = strtok(NULL, ", "); } if (p != NULL) { job->oqueue = schd_strdup(p); } else { /* if the originating queue is unknown, default * to the locally defined "submit" queue. */ job->oqueue = schd_strdup(schd_SubmitQueue->queue->qname); } free(var_p); changed ++; continue; } if (!strcmp(attr->name, ATTR_l)) { if (!strcmp(attr->resource, "walltime")) { job->walltime = schd_val2sec(attr->value); changed ++; } else if (!strcmp(attr->resource, "ncpus")) { cpu_req = atoi(attr->value); job->nodes = MAX(job->nodes, cpu_req); changed ++; } else if (!strcmp(attr->resource, "mppe")) { cpu_req = atoi(attr->value); job->nodes = MAX(job->nodes, cpu_req); changed ++; } else if (!strcmp(attr->resource, "mem")) { mem_req = schd_val2byte(attr->value); job->nodes = MAX(job->nodes, NODES_FROM_MEM(mem_req)); changed ++; #if PE_MASK != 0 } else if (!strcmp(attr->resource, "pe_mask")) { if (schd_str2mask(attr->value, &job->nodemask)) { (void)sprintf(log_buffer, "bad pe_mask %s for job %s", attr->value, job->jobid); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } else changed++; /* Job pe_mask was valid. */ #endif /* PE_MASK */ } /* That's all for requested resources. */ continue; } if (!strcmp(attr->name, ATTR_used)) { if (!strcmp(attr->resource, "walltime")) { job->walltime_used = schd_val2sec(attr->value); changed ++; } /* No other interesting cases. */ continue; } /* Session ID for running jobs (used to correlate GRM info */ if (!strcmp(attr->name, ATTR_session)) { job->session = atoi(attr->value); continue; } /* Job Priority attribute (inherited from queue) */ if (!strcmp(attr->name, ATTR_p)) { job->priority = atoi(attr->value); continue; } /* Creation time attribute. */ if (!strcmp(attr->name, ATTR_ctime)) { /* How long ago was it put in the queue ? */ job->time_queued = schd_TimeNow - atoi(attr->value); continue; } /* Modified time attribute. */ if (!strcmp(attr->name, ATTR_mtime)) { /* When was the job last modified? */ job->mtime = atoi(attr->value); continue; } #ifdef ATTR_etime /* * When was the job last eligible to run? When a user-hold is * released, this value is updated to the current time. This * prevents users from gaining higher priority from holding their * jobs. */ if (!strcmp(attr->name, ATTR_etime)) { job->eligible = schd_TimeNow - atoi(attr->value); continue; } #endif /* ATTR_etime */ } /* * If this job is in the "Running" state, compute how many seconds * remain until it is completed. */ if (job->state == 'R') { job->time_left = job->walltime - job->walltime_used; } /* * If this job was enqueued since the last time we ran, set the job * flag to indicate that we have not yet seen this job. This makes it * a candidate for additional processing. There may be some inaccuracy, * since the time_t has resolution of 1 second. Attempt to err on the * side of caution. */ if ((job->state == 'Q') && (job->time_queued != UNSPECIFIED)) { if (job->time_queued <= (schd_TimeNow - schd_TimeLast)) { job->flags |= JFLAGS_FIRST_SEEN; } } /* * If the 'etime' attribute wasn't found, set it to the time the job has * been queued. Most jobs will be eligible to run their entire lifetime. * The exception is a job that has been held - if it was a user hold, * the release will reset the etime to the latest value. * If not eligible time was given, use the job's creation time. */ if (!job->eligible) job->eligible = job->time_queued; #if defined(sgi) /* * If the job provided a memory or CPU resource that does not match * the resources that will be allocated by the assigned nodes (i.e. * a request for 100mb of memory and 16 CPUs - the job will "get" all * 4GB of memory anyway), alter the job attributes such that they * will align with the assigned nodes later. */ bump_rsrc_requests(job, cpu_req, mem_req); #endif /* defined(sgi) */ /* * Need to update the time_until_eligible and total_delay fields, * probably from a global array of information saved from previous * scheduler iteration. */ /* * Calculate the job priority weight sort key to be used later in * job sorting. This is the "priority" the job should have during * sorting based on the size of the job, the length of time queued, * and the job type. */ calc_job_weight(job); return (changed); } /* * Walk a list of jobs, freeing any information on them and then freeing * each element. Returns number of elements freed. */ int schd_free_jobs(Job *list) { Job *job, *next; int numjobs = 0; for (job = list; job != NULL; job = next) { numjobs ++; next = job->next; if (job->jobid) free(job->jobid); if (job->owner) free(job->owner); if (job->host) free(job->host); if (job->exechost) free(job->exechost); if (job->group) free(job->group); if (job->comment) free(job->comment); if (job->oqueue) free(job->oqueue); /* * Do *not* free the Job's backpointer to the queue's name if it * is a reference to the Queue's qname. If it is local storage * created by schd_strdup(), it should be freed to prevent a * memory leak. */ if (job->flags & JFLAGS_QNAME_LOCAL) free(job->qname); free(job); } return (numjobs); } static int bump_rsrc_requests(Job *job, int cpu_req, size_t mem_req) { char *id = "bump_rsrc_requests"; char *val; char buf[64]; int bumped = 0; /* * If a job gives the "wrong" value for the memory request (for the * number of nodes required to fulfill the request), then bump the * memory request to the amount of memory the assigned nodes would * consume. */ if ((mem_req == 0) || (mem_req != (job->nodes * MB_PER_NODE))) { /* Make a printable version of the requested memory. */ strcpy(buf, schd_byte2val(mem_req)); /* Compute the "right" memory request, based on the nodes. */ val = schd_byte2val(job->nodes * MB_PER_NODE); if (val == NULL) return (1); if (schd_alterjob(connector, job, ATTR_l, val, "mem")) { DBPRT(("%s: Failed to set job %s \"mem\" attr to %s\n", id, job->jobid, val)); return (1); } bumped++; } /* * If a job gives the "wrong" value for the CPU request (for the * number of nodes required to fulfill the request), then bump the * CPU request to the number of CPUs the assigned nodes would * consume. */ if ((cpu_req == 0) || (cpu_req != (job->nodes * PE_PER_NODE))) { /* Compute the "right" memory request, based on the nodes. */ sprintf(buf, "%d", (job->nodes * PE_PER_NODE)); if (schd_alterjob(connector, job, ATTR_l, buf, "ncpus")) { DBPRT(("%s: Failed to set job %s \"ncpus\" attr to %s\n", id, job->jobid, buf)); return (1); } bumped++; } if (bumped) { strncpy(buf, schd_byte2val(job->nodes * MB_PER_NODE), sizeof(buf) - 1); sprintf(log_buffer, "%s cpu/mem (%d/%s) bumped to %d/%s (%d nodes)", job->jobid, cpu_req, schd_byte2val(mem_req), job->nodes * PE_PER_NODE, buf, job->nodes); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); } return (0); } /* * The job->priority field correspondes to the priority of * the queue to which the job was submitted. This value * is then used in the following calculation to determine * a new priority that takes into consideration the recent * past usage of the user, the number of nodes requested, * the priority of the queue to which the job was submitted, * and the lenght of time the job has been queued. * * Jobs are initially assigned a priority value based on: * * Queue Initial Max * Name Priority Priority * -------- -------- -------- * Special 1000 1024 * Challenge 900 999 * Normal 0 999 * Background <0 -1024 * */ #define SECS_PER_HOUR 3600 void calc_job_weight(Job *job) { int timeQd; float usage, weight, A, B, C, D, E, F; double priority; timeQd = schd_TimeNow - job->eligible; usage = get_resource_usage(job->owner); if (!strcmp(job->oqueue, schd_SpecialQueue)) job->priority = 1000; else if (!strcmp(job->oqueue, schd_ChallengeQueue)) job->priority = 900; else if (!strcmp(job->oqueue, schd_BackgroundQueue)) job->priority = -100; else job->priority = 0; /* these should be set by parameters in the config file */ /* These are used to scale the impact of various attributes */ /* of the job on the job weight, used in the priority calc */ A = 4.0; /* Adjust recent usage */ B = 2.0; /* Adjust job size (nodes) */ C = 1.0 / 7.0; /* Adjust time queued */ /* Use user supplied values for weight of each factor: */ /* For simplicty, the user tunable parameters are in the */ /* range of 1-10, or 0 (no weight). We scale these into */ /* new ranges such that the values proportionately affect */ /* the calculated weight of the job. */ /* */ /* Recommended input values for a large system are: */ /* */ /* schd_USAGE_WEIGHT = 10 */ /* schd_NODES_WEIGHT = 7 */ /* schd_TIMEQ_WEIGHT = 1 */ /* */ A = schd_USAGE_WEIGHT / 2.50000; /* scale to range 1-4 */ B = schd_NODES_WEIGHT / 3.33333; /* scale to range 1-3 */ C = schd_TIMEQ_WEIGHT / 1.42857; /* scale to range 1-7 */ D = 0.001; /* Bring baseline into desired range */ E = 0.3; /* Adjust slope of tanh() curve */ F = 1.0; /* Adjust slope of tanh() curve */ /* scale the priority (set by the originating queue) such */ /* that the tanh() on the baseline produces appropriate */ /* values (eg. with the ranges stated above). */ if (job->priority >= 1000) job->priority *= 10; else if (job->priority >= 900) job->priority *= 7.8; else if (job->priority >= 0) job->priority = 100; else if (job->priority < 0) job->priority *= -1; weight = -A * usage / schd_MAX_NCPUS + B * job->nodes / schd_MAX_NCPUS + C * timeQd / SECS_PER_HOUR + D * job->priority ; priority = 500 * (1 + tanh(E * weight - F)); if (job->priority < 0) job->priority = -1 * (1024 - priority); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/usersort.c0000664000113300011330000006771411272401241020405 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: usersort.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include #include #include #include #include #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "toolkit.h" #include "gblxvars.h" /* * Conditional compilation flags: * * USERSORT_DEBUG: Enable additional debugging of queue and job structs. */ /* #define USERSORT_DEBUG */ extern int connector; int schd_NeedToGetDecayInfo; /* User information. */ struct Uinfo { char name[MAX_TXT+1]; int jobcount; int running_jobs; double nodehours; }; /* Decayed usage statistics. */ struct past_usage { char user[MAX_TXT+1]; double usage; }; static time_t when_decay_saved; static time_t when_decay_done; static int debug = 1; static int n_Resource_usage; static struct past_usage *Resource_usage; /* Per-user usage information. */ static struct Uinfo *Users = NULL; static int nUsers; /* Per-class job lists. Point to a set of jobs in the input list. */ static Job **runningJobs = NULL; static int nJQs, nJRs; static Job **normalQ = NULL; static int nnormalQ; static Job **dedtimeQ = NULL; static int ndedtimeQ; static Job **otherQ = NULL; static int notherQ; static char *unknown = "???"; static int split_jobs(Job *jobs); static void get_users(void); static int make_uinfo(char *user, struct Uinfo *info); static Job *make_job_list(void); static int is_new_user(char *user, struct Uinfo *list, int len, int *which); static void sort_users(void); static int is_outstanding(Job *job); static int compare_users(const void *e1, const void *e2); static int compare_running(const void *e1, const void *e2); static char *make_grp_usr_tuple(Job *job); static void sort_jobs(void); #ifdef USERSORT_DEBUG static int print_jobs(Job *joblist); #endif /* USERSORT_DEBUG */ /* * Take a list of jobs and sort them based on the priority field. * Return a pointer to a new list of jobs in the order in which * they should be run. */ Job * schd_sort_jobs(Job *jobs) { Job *newjobs = NULL; if (split_jobs(jobs)) /* split jobs into sublists */ return (NULL); /* * Create a list of the users with jobs queued. */ get_users(); /* * Sort user list in order of ascending past-usage. */ sort_users(); /* * Sort the jobs in runningQ, normalQ, and backgrdQ. */ sort_jobs(); /* * Convert arrays of jobs into a linked list. */ newjobs = make_job_list(); #ifdef USERSORT_DEBUG /* Print the newly-created ordered job list. */ print_jobs(newjobs); #endif /* USERSORT_DEBUG */ return (newjobs); } /* * Determine if it is necessary to save the past usage information * to disk. */ int schd_save_decay(void) { if (schd_TimeNow >= (when_decay_saved + 3600)) return 1; return 0; } /* * Read or write the past usage data to the disk file. */ void schd_decay_info(char *mode) { char *id = "schd_decay_info"; FILE *decay; char buffer[MAX_TXT + 1 + 1]; /* size = MAX_TXT + a newline + a NULL */ char gname[50]; char *group_ptr; struct past_usage *pusage_ptr; int next = 0; int last = -1; size_t temp = 0; int do_decay = 0; int i; /* * If there is no pre-existing file, bootstrap it with a single record * for root:root. */ if ((decay = fopen(DECAY_INFO_FILE, mode)) == NULL) { sprintf(log_buffer, "fopen(%s,%s) failed (%d)", DECAY_INFO_FILE, mode, errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); if ((decay = fopen(DECAY_INFO_FILE, "w")) == NULL) { /* * Could not open the file for writing. Possibly the path is * invalid? */ sprintf(log_buffer, "fopen(%s,%s) failed (%d)", DECAY_INFO_FILE, mode, errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return; } /* * The file pointed to by DECAY_INFO_FILE is writable. Create the * bootstrap record. */ strftime(buffer, sizeof buffer, "%a\n", &schd_TmNow); fputs(buffer, decay); fprintf(decay, "root:root 1.0\n"); fclose(decay); sprintf(log_buffer, "wrote bootstrap record"); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); /* * Attempt to reopen the file. If it fails, then the bootstrap * failed as well. This leaves the open stream pointer in 'decay' * as if it were opened successfully above. */ if ((decay = fopen(DECAY_INFO_FILE, mode)) == NULL) { sprintf(log_buffer, "bootstrap:fopen(%s,%s) failed", DECAY_INFO_FILE, mode); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return; } } /* Read or write based on mode. */ if (mode[0] == 'r') { pusage_ptr = Resource_usage; pusage_ptr = realloc(pusage_ptr, ALLOC_1ST * sizeof * pusage_ptr); if (pusage_ptr == NULL) { temp = ALLOC_1ST * (sizeof * pusage_ptr); sprintf(log_buffer, "realloc(%ld) failed", temp); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return; } last = ALLOC_1ST - 1; /* XXX No error checking. */ fgets(buffer, sizeof buffer, decay); /* skip day_of_week */ while (fgets(buffer, sizeof buffer, decay)) { if (next > last) { last += ALLOC_INC; pusage_ptr = realloc(pusage_ptr, (last + 1) * sizeof * pusage_ptr); if (pusage_ptr == NULL) { temp = last * (sizeof * pusage_ptr); sprintf(log_buffer, "realloc(%ld) failed", temp); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return; } } /* XXX No error checking. */ strcpy(pusage_ptr[next].user, strtok(buffer, " \n")); pusage_ptr[next].usage = atof(strtok(NULL, " \n")); if (debug) { sprintf(log_buffer, "Read: %-8s\t%.02f", pusage_ptr[next].user, pusage_ptr[next].usage); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } ++next; } fclose(decay); pusage_ptr = realloc(pusage_ptr, next * sizeof * pusage_ptr); if (pusage_ptr == NULL) { temp = next * (sizeof * pusage_ptr); sprintf(log_buffer, "realloc(%ld) failed", temp); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return; } Resource_usage = pusage_ptr; n_Resource_usage = next; schd_NeedToGetDecayInfo = 0; when_decay_done = schd_TimeNow; } else if (mode[0] == 'w') { /* XXX 23 hours hardcoded */ do_decay = schd_TimeNow > when_decay_done + 82800; strftime(buffer, sizeof buffer, "%a\n", &schd_TmNow); fputs(buffer, decay); pusage_ptr = Resource_usage; for (i = 0; i < n_Resource_usage; ++i) { if (do_decay) { /* extract group id from group:user tuple */ strcpy(gname, pusage_ptr->user); group_ptr = strtok(gname, ":"); if (schd_ENFORCE_ALLOCATION && schd_TimeNow >= schd_ENFORCE_ALLOCATION && schd_is_over_alloc(group_ptr)) { pusage_ptr->usage = pusage_ptr->usage * schd_OA_DECAY_FACTOR; } else { pusage_ptr->usage = pusage_ptr->usage * schd_DECAY_FACTOR; } } if (pusage_ptr->usage > 0) { fprintf(decay, "%s %0.3f\n", pusage_ptr->user, pusage_ptr->usage); if (debug) { sprintf(log_buffer, "Wrote: %-8s\t%0.3f", pusage_ptr->user, pusage_ptr->usage); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } } ++pusage_ptr; } fclose(decay); if (do_decay) when_decay_done = schd_TimeNow; when_decay_saved = schd_TimeNow; } else { sprintf(log_buffer, "unknown mode [%s]", mode); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); } return; } /* * Split the supplied list of Job's into separate arrays based on various * characteristics of the jobs (queued vs. running, waiting, special, etc) */ static int split_jobs(Job *jobs) { char *id = "split_jobs"; Job *this; QueueList *qptr; int dedtimeI, normalI, otherI, runningI; /* Number of elements in the queue arrays. */ nJRs = nJQs = 0; ndedtimeQ = nnormalQ = notherQ = 0; runningJobs = NULL; dedtimeQ = NULL; normalQ = NULL; otherQ = NULL; /* * Count the number of jobs that belong to each class, and allocate * an array of pointers to Job's for each non-empty class. Note that * only jobs that are either 'R'unning or 'Q'ueued are of interest. * Place "other" jobs on the "other" list for completeness. */ for (this = jobs; this != NULL; this = this->next) { if (this->state == 'R') { nJRs ++; continue; } if (this->state == 'Q') { nJQs ++; /* Does this job belong on the dedicated list? */ if ((schd_DedQueues != NULL)) { for (qptr = schd_DedQueues; qptr != NULL; qptr = qptr->next) { if (!strcmp(this->qname, qptr->queue->qname)) { ndedtimeQ ++; break; } } if (qptr != NULL) /* Match found with dedicated queue. */ { this->flags |= JFLAGS_DEDICATED; continue; } } /* Does this job belong on the special queue list? */ if ((schd_SpecialQueue != NULL) && (!strcmp(this->qname, schd_SpecialQueue))) { this->flags |= (JFLAGS_WAITING | JFLAGS_PRIORITY); nnormalQ ++; continue; } /* Is the job in an outstanding condition? */ if (is_outstanding(this)) { this->flags |= JFLAGS_WAITING; /* Note the waiting condition. */ nnormalQ ++; continue; } if (this->priority < 0) /* a Background Job */ { nnormalQ ++; continue; } /* Anything else must be a normal job */ nnormalQ ++; continue; } /* Some other state. Keep track of it so the memory isn't lost. */ notherQ ++; continue; } /* No running or queued jobs. that's odd. */ if (!nJRs && !nJQs) return (-1); /* * Now allocate arrays of pointers large enough to hold a pointer to * each job in the class. These arrays will be sorted, and the job * lists reordered to match the sorted values. */ if (nJRs) { if ((runningJobs = (Job **)malloc(nJRs * sizeof(Job *))) == NULL) { DBPRT(("%s: malloc failed for %d Job *'s (%s)\n", id, nJRs, "runningJobs")); goto malloc_failed; } } if (ndedtimeQ) { if ((dedtimeQ = (Job **)malloc(ndedtimeQ * sizeof(Job *))) == NULL) { DBPRT(("%s: malloc failed for %d Job *'s (%s)\n", id, ndedtimeQ, "dedtimeQ")); goto malloc_failed; } } if (nnormalQ) { if ((normalQ = (Job **)malloc(nnormalQ * sizeof(Job *))) == NULL) { DBPRT(("%s: malloc failed for %d Job *'s (%s)\n", id, nnormalQ, "normalQ")); goto malloc_failed; } } if (notherQ) { if ((otherQ = (Job **)malloc(notherQ * sizeof(Job *))) == NULL) { DBPRT(("%s: malloc failed for %d Job *'s (%s)\n", id, notherQ, "otherQ")); goto malloc_failed; } } /* * Populate the arrays of pointers with the jobs */ dedtimeI = normalI = otherI = runningI = 0; for (this = jobs; this != NULL; this = this->next) { if (this->state != 'R' && this->state != 'Q') { otherQ[otherI++] = this; continue; } if (this->state == 'R') { runningJobs[runningI++] = this; continue; } /* Does this job belong on the dedicated list? */ if (this->flags & JFLAGS_DEDICATED) { dedtimeQ[dedtimeI++] = this; continue; } /* every other kind of job. */ normalQ[normalI++] = this; } (void)sprintf(log_buffer, "run:%d norm:%d ded:%d othr: %d total:%d", runningI, normalI, dedtimeI, otherI, runningI + normalI + dedtimeI + otherI); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (0); malloc_failed: if (dedtimeQ) { free(dedtimeQ); dedtimeQ = NULL; } if (normalQ) { free(normalQ); normalQ = NULL; } if (otherQ) { free(otherQ); otherQ = NULL; } nJRs = nJQs = 0; log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "malloc failed"); return (-1); } /* * Determine whether a queued job has waited so long that extra emphasis * should be placed on running this job. */ static int is_outstanding(Job *job) { /* * If it is currently primetime, consider an interactive job "waiting * for a long time" if it has waited for more time than some constant * plus the time it requested. * * A batch job can wait for much longer than an interactive job. Given * the ability to submit an interactive job, assume that if the user was * actually waiting for the job to start, they would submit it as inter- * active. * * The lower-priority "background" jobs are not eligable for "long waiting * assistance". */ if (!strcmp(job->oqueue, schd_BackgroundQueue)) return(0); if (schd_INTERACTIVE_LONG_WAIT && job->flags & JFLAGS_INTERACTIVE) { if (job->eligible > (job->walltime + schd_INTERACTIVE_LONG_WAIT)) if (schd_prime_time(0)) return (1); } else { if (schd_MAX_QUEUED_TIME && (job->eligible > schd_MAX_QUEUED_TIME)) return 1; } #ifdef JAMES_DEBUG if (job->eligible > Min_Queued_Time) return job->walltime < schd_SMALL_QUEUED_TIME; #endif /* JAMES_DEBUG */ return 0; } /* * Construct a list of users who own one or more "normal" jobs, and count * the number of jobs they own. */ static void get_users(void) { char *id = "get_users"; Job *job_ptr; char *uname; char *name; int which; int i; int j; /* * Destroy any previously created list. */ if (Users) free(Users); Users = NULL; nUsers = 0; /* * Walk the list of "normal" jobs, creating group/owner tuples for each * new user. */ for (i = 0; i < nnormalQ; ++i) { job_ptr = normalQ[i]; name = make_grp_usr_tuple(job_ptr); /* Is this a new entry in the list? */ if (is_new_user(name, Users, nUsers, &which)) { ++nUsers; Users = realloc(Users, nUsers * sizeof * Users); if (!Users) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "realloc(Users)"); return; } make_uinfo(name, &(Users[nUsers - 1])); } else { Users[which].jobcount++; } } /* Now, walk the list of running jobs and record each user's count. */ for (i = 0; i < nUsers; ++i) { uname = Users[i].name; for (j = 0; j < nJRs; ++j) { job_ptr = runningJobs[j]; /* Create the name tuple for this user. */ name = make_grp_usr_tuple(job_ptr); if (!strcmp(name, uname)) Users[i].running_jobs++; ++job_ptr; } } return; } /* Search the list of users, looking for 'user'. */ static int is_new_user(char *user, struct Uinfo *list, int len, int *which) { struct Uinfo *list_ptr = list; int i; for (i = 0; i < len; ++i) { if (!strcmp(list_ptr->name, user)) { *which = i; return 0; } ++list_ptr; } return 1; } /* Build a record of the pertinent data about a job owner. */ static int make_uinfo(char *user, struct Uinfo *uinfo) { strncpy(uinfo->name, user, sizeof(uinfo->name) - 1); uinfo->jobcount = 1; uinfo->running_jobs = 0; uinfo->nodehours = get_resource_usage(user); return 0; } /* * Retrieve this user's info from the past usage database. If 'user' is * not found, create and install an appropriate entry in the usage database. */ double get_resource_usage(char *user) { char *id = "get_resource_usage"; struct past_usage *pusage_ptr; int i; /* Search for 'user' in the existing database. */ pusage_ptr = Resource_usage; for (i = 0; i < n_Resource_usage; ++i) { if (!strcmp(pusage_ptr->user, user)) return (pusage_ptr->usage); ++pusage_ptr; } /* No pre-existing entry. Create a new one. */ ++n_Resource_usage; pusage_ptr = realloc(Resource_usage, n_Resource_usage * sizeof * pusage_ptr); if (!pusage_ptr) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "realloc(Resource_usage)"); return -1; } Resource_usage = pusage_ptr; pusage_ptr += n_Resource_usage - 1; strcpy(pusage_ptr->user, user); pusage_ptr->usage = 0.0; return 0; } /* * Update past-usage database to account for a new job being run. */ void schd_update_resource_usage(Job *job) { char *id = "schd_update_resource_usage"; int i; char *name; double node_hours; /* create the name tuple for this guy */ name = make_grp_usr_tuple(job); /* We want to evaluate a new past-usage charge rate. * instead of use this old equation: * node_hours = (job->walltime / 3600.0) * job->nodes; * * lets just have a flat charge per job. but lets not * charge anything for very short jobs. */ if (job->walltime > (20*60)) /* greater than 20 minutes */ node_hours = 10.0; else node_hours = 1.0; /* * First, update the recent past-usage database. Find the appropriate * user entry, and add the job's expected usage to that user's total. */ for (i = 0; i < n_Resource_usage; ++i) { if (strcmp(Resource_usage[i].user, name)) continue; Resource_usage[i].usage += node_hours; if (debug) { sprintf(log_buffer, "%s has %f node-hour recent usage", Resource_usage[i].user, Resource_usage[i].usage); log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_REQUEST, id, log_buffer); } break; } /* * Next, update the FY-to-date usage database. Same as above, but * operate on the per-group database. */ for (i = 0; i < schd_NumAllocation; i++) { if (strcmp(schd_GroupTable[i].gname, job->group)) continue; schd_GroupTable[i].total_usage += node_hours; break; } /* * Finally, update the user's running-job count. */ for (i = 0; i < nUsers; ++i) { if (strcmp(Users[i].name, name)) continue; Users[i].running_jobs++; if (debug) { sprintf(log_buffer, "%s has %d running jobs", Users[i].name, Users[i].running_jobs); log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_REQUEST, id, log_buffer); } break; } return; } /* * Sort the list of users with jobs in the "normal" list in ascending order * by number of jobs queued. */ static void sort_users(void) { qsort(Users, nUsers, sizeof *Users, compare_users); return; } /* * qsort() comparison function. Sort Uinfo records by increasing value of * the 'jobcount' fields. */ static int compare_users(const void *e1, const void *e2) { struct Uinfo *u1 = (struct Uinfo *)e1; struct Uinfo *u2 = (struct Uinfo *)e2; int jc1; int jc2; jc1 = u1->jobcount; jc2 = u2->jobcount; return ((jc1 > jc2) ? 1 : ((jc1 < jc2) ? -1 : 0)); } /* * qsort() function to sort jobs from largest to smallest by priority */ static int priority_ordering(const void *e1, const void *e2) { Job *job1 = *(Job **)e1; Job *job2 = *(Job **)e2; if (job1->priority > job2->priority) return -1; if (job1->priority < job2->priority) return 1; return 0; } /* * Sort "normal" jobs by priority. */ static void sort_jobs(void) { int (*criterion)(const void *, const void *); /* * Depending upon the time of day, use a different ordering routine. * This is where most of the policy is implemented, as the rest of * the scheduler code attempts to run jobs in as close to this order * as possible, assuming available resources, time, etc. */ criterion = priority_ordering; if (schd_ENFORCE_PRIME_TIME && schd_TimeNow >= schd_ENFORCE_PRIME_TIME) { if (schd_prime_time(0)) /* for now use the same ordering all the time */ criterion = priority_ordering; } /* * Sort the jobs based upon the proper criterion * for the current time of day. */ qsort(normalQ, nnormalQ, sizeof *normalQ, criterion); /* * Sort the list of running jobs, in ascending order by the expected * time to completion. */ qsort(runningJobs, nJRs, sizeof *runningJobs, compare_running); return; } /* * qsort() function to order running jobs. * * Order running jobs by remaining runtime from soonest-ending to latest- * ending. Jobs end up in order of time of completion (first to complete * first). */ static int compare_running(const void *e1, const void *e2) { Job *job1 = *(Job **)e1; Job *job2 = *(Job **)e2; if (job1->time_left > job2->time_left) return 1; if (job1->time_left < job2->time_left) return -1; return 0; } /* * This function creates a new linked list from the Job structs pointed to * by the arrays of Job pointers. Note that the reassembly is carried out * in place - only the links are modified, there is no allocation or freeing * other than at the end to free all the sublists. * * The final list will be reassembled and ordered as: * * running, normal, dedicated */ static Job * make_job_list(void) { Job list_seed, *joblist, *jobtail; int i; memset(&list_seed, 0, sizeof(list_seed)); /* * "Seed" the linked list by pointing to a bogus initial element. * Since the jobtail->next pointer will always be valid (either it * hangs off the seed or a real job) this simplifies the following * list operations considerably. */ joblist = &list_seed; jobtail = &list_seed; jobtail->next = NULL; /* Walk the running jobs and place them on the list. */ for (i = 0; i < nJRs; i++) jobtail = jobtail->next = runningJobs[i]; /* Walk the normal jobs and place them on the list. */ for (i = 0; i < nnormalQ; i++) jobtail = jobtail->next = normalQ[i]; /* Walk the dedicated queue jobs and place them on the list. */ for (i = 0; i < ndedtimeQ; i++) jobtail = jobtail->next = dedtimeQ[i]; /* Place any remaining jobs on the end of the list. */ for (i = 0; i < notherQ; i++) jobtail = jobtail->next = otherQ[i]; /* Terminate the last element on the list with a NULL next pointer. */ jobtail->next = NULL; /* Free any storage allocated for the lists. */ if (runningJobs) free(runningJobs); if (dedtimeQ) free(dedtimeQ); if (normalQ) free(normalQ); if (otherQ) free(otherQ); /* And reset all the values. */ runningJobs = dedtimeQ = normalQ = otherQ = NULL; nJRs = nJQs = ndedtimeQ = nnormalQ = notherQ = 0; /* * The first element on joblist is the pointer to the list_seed. It's * next pointer points to the head of the real list - return that. */ return (joblist->next); } static char * make_grp_usr_tuple(Job *job) { static char tuple[PBS_MAXUSER + MAX_GROUP_NAME_SIZE + 1 + 1]; strncpy(tuple, job->group ? job->group : unknown, MAX_GROUP_NAME_SIZE); strcat(tuple, ":"); strncat(tuple, job->owner ? job->owner : unknown, PBS_MAXUSER); return tuple; } #ifdef USERSORT_DEBUG static int print_jobs(Job *joblist) { char *id = "pntJ"; Job *job; if (joblist) { log_record(PBSEVENT_SCHED, PBS_EVENTCLASS_SERVER, id, "Sorted/Ordered Job List:"); for (job = joblist; job != NULL; job = job->next) { sprintf(log_buffer, "%s %c owner=%s\tnodes=%d q=%s", job->jobid, job->state, job->owner, job->nodes, job->qname); log_record(PBSEVENT_SCHED, PBS_EVENTCLASS_SERVER, id, log_buffer); } } return 0; } #endif /* USERSORT_DEBUG */ torque-2.4.16/src/scheduler.cc/samples/cray_t3e/rejectjob.c0000664000113300011330000001461411272401241020455 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: rejectjob.c 2367 2008-09-03 17:17:34Z josh $ */ #include #include #include "pbs_ifl.h" #include "log.h" #include "toolkit.h" #include "gblxvars.h" /* * The size of the buffer to allocate to hold the message that will be * sent to the user. This is dynamically allocated (once) since it may * need to be a very large buffer, depending on the complexity of the * message. */ #define MSG_BUFFER_SIZE 4000 extern int connector; int schd_reject_job(Job *job, char *reason) { char *id = "schd_reject_job"; static char *message = NULL; int rc = 0; if (message == NULL) { if ((message = (char *)malloc(MSG_BUFFER_SIZE)) == NULL) { (void)sprintf(log_buffer, "cannot malloc %d bytes\n", MSG_BUFFER_SIZE); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return (-1); } } DBPRT(( "*************************************************************************\n")); if (schd_TEST_ONLY) { DBPRT(("JOB %s WOULD HAVE BEEN DELETED!!!\n", job->jobid)); DBPRT(("Message: %s\n", reason)); } else { (void)sprintf(message, "\n" "PBS job '%s' was rejected by all execution queues.\n" "\n" "The reason given for this action was :\n" "\n" " %s\n" "\n" "Please correct the problem and resubmit your job, or contact the PBS\n" "administrator for assistance.\n" "\n" "Thank you.\n" "\n", job->jobid, reason); /* * Ask PBS to delete the job from the queue, which should deliver the * message to the user. */ rc = pbs_deljob(connector, job->jobid, message); if (rc) { (void)sprintf(log_buffer, "pbs_deljob failed: error %d", rc); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return 1; } /* * Delete this job from the queue's list (move to a NULL queue) */ schd_move_job_to(job, NULL); DBPRT(("JOB %s DELETED!!!\n", job->jobid)); DBPRT(("Message: %s\n", reason)); } DBPRT(( "*************************************************************************\n")); return 0; } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/file_chgs.c0000664000113300011330000002234511272401241020431 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* $Id: file_chgs.c 2367 2008-09-03 17:17:34Z josh $ */ /* * Routines to check if files have been changed, deleted, created, etc. since * the last invocation. Used to automatically load new configuration and * statistics data. */ #include #include #include #include #include #include #include "pbs_error.h" #include "pbs_ifl.h" #include "log.h" #include "toolkit.h" struct filestatus { struct filestatus *next; char *filename; time_t ctime; int exists; }; typedef struct filestatus FileStatus; static FileStatus *filestats = NULL; int schd_register_file(char *filename) { char *id = "schd_register_file"; FileStatus *stats, *tail, *new = NULL; /* * Look for the tail of the list. While walking the list, check to see * that the filename is not already registered. */ tail = NULL; for (stats = filestats; stats != NULL; stats = stats->next) { if (strcmp(filename, stats->filename) == 0) { sprintf(log_buffer, "%s: file %s already registered.", id, filename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); DBPRT(("%s: %s\n", id, log_buffer)); return (-1); } tail = stats; } /* Create space for the new record. */ new = (FileStatus *) malloc(sizeof(FileStatus)); if (new == NULL) { sprintf(log_buffer, "%s: out of memory allocating FileStatus for file %s", id, filename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return (-1); } /* Clear the record out -- this clears the ctime and next pointer. */ memset(new, 0, sizeof(FileStatus)); /* Keep a copy of the filename around. */ new->filename = schd_strdup(filename); if (new->filename == NULL) { log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, "schd_strdup(filename)"); return (-1); } /* * If this is not the first element, tack it on the end of the list. * Otherwise, start the list with it. */ if (tail) tail->next = new; else filestats = new; (void)sprintf(log_buffer, "%s: file %s registered.", id, filename); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); /* * Load the new element with the initial values for the file. Ignore * the return value - only setting up the timestamp and file existence * status are important. */ (void)schd_file_has_changed(filename, 1); return (0); } int schd_file_has_changed(char *filename, int reset_stamp) { char *id = "schd_file_has_changed"; FileStatus *stats; struct stat stat_buffer; int exists; /* Assume that the file has not changed, and that it exists. */ exists = 1; if (filename == NULL) { DBPRT(("%s: filename is null\n", id)); return (-1); } for (stats = filestats; stats != NULL; stats = stats->next) { if (strcmp(filename, stats->filename) == 0) break; } if (stats == NULL) { DBPRT(("%s: filename %s not registered\n", id, filename)); return (-1); } /* Get the file modification times from the filesystem. */ if (stat(filename, &stat_buffer) == -1) { if (errno == ENOENT) { exists = 0; } else { (void)sprintf(log_buffer, "%s: stat(%s) failed: %d", id, filename, errno); log_record(PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, id, log_buffer); return (-1); } } /* * Has file has changed state? */ if (exists != stats->exists) { stats->exists = exists; if (exists && reset_stamp) stats->ctime = stat_buffer.st_ctime; return (1); } /* * If the ctime is different from the previously recorded one, the * file has changed. stat(2) indicates that ctime will be changed * on every write, truncate, etc. Update the ctime value for the * next call. */ if (exists && (stat_buffer.st_ctime != stats->ctime)) { if (reset_stamp) stats->ctime = stat_buffer.st_ctime; return (1); } /* * Either file still does not exist, or it has not been changed since * the last call. */ return (0); } /* * "Forget" about the file named by 'filename', or all files if 'filename' * is a NULL pointer. Returns the number of files removed from the watch * list, or -1 if the file is not found (or the list was empty). */ int schd_forget_file(char *filename) { /* char *id = "schd_forget_file"; */ FileStatus *stats, *prev, *next; int count, found; count = 0; found = 0; prev = NULL; /* * Remove entries in the list of file stats being watched that match * the supplied filename, or all entries if 'filename' is NULL. */ for (stats = filestats; stats != NULL; stats = next) { next = stats->next; if (filename && (strcmp(filename, stats->filename) != 0)) { prev = stats; continue; } found ++; if (stats == filestats) { filestats = stats->next; } else { prev->next = stats->next; } /* Free the schd_strdup()'d filename */ free(stats->filename); free(stats); count ++; } if (found) return (count); else return (-1); } torque-2.4.16/src/scheduler.cc/samples/cray_t3e/README0000664000113300011330000004767011272401241017232 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ * The Configuration File The scheduler's configuration file is a flat ASCII file. Comments are allowed anywhere, and begin with a '#' character. Any non-comment lines are considered to be statements, and must conform to the syntax :

= success */ if (!user_account_read_user(arguser)) { sprintf(log_buffer, "user_account_default(%s) = USER NOT FOUND", arguser); goto user_account_default_done; } if (UserAcct.ActCnt < 1) { sprintf(log_buffer, "user_account_default(%s) = NO PROJECT FOUND", arguser); goto user_account_default_done; } rc = UserAcct.ActAdr[0]; sprintf(log_buffer, "user_account_default(%s) = %s", arguser, rc); user_account_default_done: log_event( PBSEVENT_JOB | PBSEVENT_SECURITY, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); return(rc); } /* END user_account_default() */ /* * Given a username, returns that user's accounts from the user->account file * Returns 0 if username isn't found */ #define AcctScanUser 0 #define AcctScanAcct 1 #define AcctScanLine -1 #define AcctFile "/usr/local/etc/usertg/project-by-user-torque.map" int user_account_read_user( char *arguser) { char proj_file[] = AcctFile; int fd; char s_buf[128*1024]; int readsize; int scanmode = AcctScanUser; int i, j; char *ci; char *cj; int arguserlen; arguserlen = strlen(arguser); if ((fd = open(proj_file, O_RDONLY, 0)) < 0) { return(0); } if (lseek(fd, (off_t)0, SEEK_SET) != 0) { close(fd); return(0); } readsize = read(fd, s_buf, sizeof(s_buf)); close(fd); if ((readsize < 1) || (readsize > sizeof(s_buf))) { /* bail if not sane */ return(0); } for (i = 0;i < readsize;++i) { /* First, handle comments and whitespace */ if (scanmode == AcctScanLine) { /* Looking for new line */ if (s_buf[i] == '\n') /* Found it */ scanmode = AcctScanUser; continue; } if (isspace(s_buf[i])) /* Skip spaces */ continue; if (s_buf[i] == '#') { /* Comment found */ scanmode = AcctScanLine; continue; } /* Next, handle user and account scanning */ if (scanmode == AcctScanUser) { if ((i + arguserlen) > readsize) /* Past the end */ { return(0); } if (strncmp(&s_buf[i], arguser, arguserlen)) { scanmode = AcctScanLine; /* Not arguser, next line */ continue; } if (isspace(s_buf[i + arguserlen]) || s_buf[i + arguserlen] == ':') { i += arguserlen; /* Is arguser */ scanmode = AcctScanAcct; } else { /* Whatever, ignore it */ scanmode = AcctScanLine; continue; } } else { /* scanmode == AcctScanAcct */ if ((s_buf[i] == ':') || isspace(s_buf[i])) continue; for (j = i;j < readsize;j++) { if (isspace(s_buf[j])) { strncpy(UserAcct.ActRaw, &s_buf[i], j - i); UserAcct.ActRaw[j-i] = '\0'; goto have_account; } } return(0); } } /* END for (i) */ return(0); /* Never found it */ have_account: if (strlen(UserAcct.ActRaw) < 1) /* Nothing found */ { return(0); } strcpy(UserAcct.ActDat, UserAcct.ActRaw); UserAcct.ActCnt = 0; UserAcct.ActMax = UserAcctMax; for (ci = &UserAcct.ActDat[0];*ci != '\0';ci++) { if (isspace(*ci) || (*ci == ',')) continue; for (cj = ci + 1;!isspace(*cj) && (*cj != ',') && (*cj != '\0');cj++) { /* NO-OP */ } *cj = '\0'; UserAcct.ActAdr[UserAcct.ActCnt++] = ci; ci = cj; } return(1); } /* END user_account_read_user() */ #endif /* PNOT */ /* END req_quejob.c() */ torque-2.4.16/src/server/svr_chk_owner.c0000664000113300011330000003422711413217001015144 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include "string.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "server.h" #include "pbs_job.h" #include "credential.h" #include "batch_request.h" #include "pbs_error.h" #include "log.h" #include "svrfunc.h" #include "mcom.h" /* Global Data */ extern struct credential conn_credent[PBS_NET_MAX_CONNECTIONS]; extern char *pbs_o_host; extern char server_host[]; extern char *msg_permlog; extern time_t time_now; extern char *PJobState[]; extern int site_allow_u(char *, char *); int svr_chk_owner_generic(struct batch_request *preq, char *owner, char *submit_host); int svr_authorize_req(struct batch_request *preq, char *owner, char *submit_host); /* * svr_chk_owner - compare a user name from a request and the name of * the user who owns the job. * * Return 0 if same, non 0 if user is not the job owner */ int svr_chk_owner( struct batch_request *preq, /* I */ job *pjob) /* I */ { char owner[PBS_MAXUSER + 1]; get_jobowner(pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, owner); return svr_chk_owner_generic(preq, owner, get_variable(pjob, pbs_o_host)); } /* END svr_chk_owner() */ int svr_chk_owner_generic( struct batch_request *preq, char *owner, char *submit_host) { char *pu; char rmtuser[PBS_MAXUSER + 1]; /* map user@host to "local" name */ pu = site_map_user(preq->rq_user, preq->rq_host); if (pu == NULL) { /* FAILURE */ return(-1); } strncpy(rmtuser, pu, PBS_MAXUSER); rmtuser[PBS_MAXUSER] = '\0'; pu = site_map_user(owner, submit_host); return(strcmp(rmtuser, pu)); } /* * svr_authorize_jobreq - determine if requestor is authorized to make * request against the job. This is only called for batch requests * against jobs, not manager requests against queues or the server. * * Returns 0 if authorized (job owner, operator, administrator) * -1 if not authorized. */ int svr_authorize_jobreq( struct batch_request *preq, /* I */ job *pjob) /* I */ { char owner[PBS_MAXUSER + 1]; get_jobowner(pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, owner); return svr_authorize_req(preq, owner, get_variable(pjob, pbs_o_host)); } /* END svr_authorize_jobreq() */ int svr_authorize_req( struct batch_request *preq, char *owner, char *submit_host) { /* does requestor have special privileges? */ if ((preq->rq_perm & (ATR_DFLAG_OPRD | ATR_DFLAG_OPWR | ATR_DFLAG_MGRD | ATR_DFLAG_MGWR)) != 0) { /* request authorized */ return(0); } /* is requestor the job owner? */ if (svr_chk_owner_generic(preq, owner, submit_host) == 0) { /* request authorized */ return(0); } /* not authorized */ return(-1); } /* * svr_get_privilege - get privilege level of a user. * * Privilege is granted to a user at a host. A user is automatically * granted "user" privilege. The user@host pair must appear in * the server's administrator attribute list to be granted "manager" * privilege and/or appear in the operators attribute list to be * granted "operator" privilege. If either acl is unset, then root * on the server machine is granted that privilege. * * If "PBS_ROOT_ALWAYS_ADMIN" is defined, then root always has privilege * even if not in the list. * * The returns are based on the access permissions of attributes, see * attribute.h. */ int svr_get_privilege( char *user, /* I */ char *host) /* I */ { char id[] = "svr_get_privilege"; int is_root = 0; int priv = (ATR_DFLAG_USRD | ATR_DFLAG_USWR); int num_host_chars; char uh[PBS_MAXUSER + PBS_MAXHOSTNAME + 2]; char host_no_port[PBS_MAXHOSTNAME+1]; char *colon_loc = NULL; if(!user) { sprintf(log_buffer, "Invalid user: %s", "null"); log_record( PBSEVENT_SECURITY, PBS_EVENTCLASS_SERVER, id, log_buffer); return(0); } /* user name cannot be longer than PBS_MAXUSER*/ if(strlen(user) > PBS_MAXUSER) { sprintf(log_buffer, "Invalid user: %s", user); log_record( PBSEVENT_SECURITY, PBS_EVENTCLASS_SERVER, id, log_buffer); return(0); } if(!host) return(0); colon_loc = strchr(host, ':'); /* if the request host has port information in it, we want to strip it out */ if (colon_loc == NULL) { /* no colon found */ num_host_chars = strlen(host); sprintf(host_no_port, "%s", host); } else { num_host_chars = colon_loc - host; /* actually remove the colon for host_no_port */ *colon_loc = '\0'; sprintf(host_no_port,"%s",host); *colon_loc = ':'; } /* num_host_chars cannot be more than PBS_MAXHOSTNAME */ if (num_host_chars > PBS_MAXHOSTNAME) { snprintf(log_buffer, LOG_BUF_SIZE, "Invalid host: %s", host); /* log_buffer is big but just in case host was really long we need to null terminate the last byte. strncpy will copy LOG_BUF_SIZE but not null terminate the array if host is larger. */ log_buffer[LOG_BUF_SIZE - 1] = 0; log_record( PBSEVENT_SECURITY, PBS_EVENTCLASS_SERVER, id, log_buffer); return(0); } sprintf(uh, "%s@%s", user, host); /* NOTE: enable case insensitive host check (CRI) */ if ((strcmp(user, PBS_DEFAULT_ADMIN) == 0) && !strcasecmp(host_no_port, server_host)) { is_root = 1; #ifdef PBS_ROOT_ALWAYS_ADMIN return(priv | ATR_DFLAG_MGRD | ATR_DFLAG_MGWR | ATR_DFLAG_OPRD | ATR_DFLAG_OPWR); #endif } if (!(server.sv_attr[(int)SRV_ATR_managers].at_flags & ATR_VFLAG_SET)) { if (is_root) priv |= (ATR_DFLAG_MGRD | ATR_DFLAG_MGWR); } else if (acl_check(&server.sv_attr[SRV_ATR_managers], uh, ACL_User)) { priv |= (ATR_DFLAG_MGRD | ATR_DFLAG_MGWR); } if (!(server.sv_attr[(int)SRV_ATR_operators].at_flags & ATR_VFLAG_SET)) { if (is_root) priv |= (ATR_DFLAG_OPRD | ATR_DFLAG_OPWR); } else if (acl_check(&server.sv_attr[SRV_ATR_operators], uh, ACL_User)) { priv |= (ATR_DFLAG_OPRD | ATR_DFLAG_OPWR); } return(priv); } /* END svr_get_privilege() */ /* * authenticate_user - authenticate user by checking name against credential * provided on connection via Authenticate User request. * * Returns 0 if user is who s/he claims, non-zero error code if not */ int authenticate_user( struct batch_request *preq, /* I */ struct credential *pcred) /* I */ { int rc; char uath[PBS_MAXUSER + PBS_MAXHOSTNAME + 1]; if (strncmp(preq->rq_user, pcred->username, PBS_MAXUSER)) { return(PBSE_BADCRED); } if (strncmp(preq->rq_host, pcred->hostname, PBS_MAXHOSTNAME)) { return(PBSE_BADCRED); } if (pcred->timestamp) { long lifetime; if ((server.sv_attr[SRV_ATR_CredentialLifetime].at_flags & ATR_VFLAG_SET) != 0) { /* use configured value if set */ lifetime = server.sv_attr[SRV_ATR_CredentialLifetime].at_val.at_long; } else { /* if not use the default */ lifetime = CREDENTIAL_LIFETIME; } /* negative values mean that credentials have an infinite lifetime */ if (lifetime > -1) { if ((pcred->timestamp - CREDENTIAL_TIME_DELTA > time_now) || (pcred->timestamp + lifetime < time_now)) { return(PBSE_EXPIRED); } } } /* If Server's Acl_User enabled, check if user in list */ if (server.sv_attr[SRV_ATR_AclUserEnabled].at_val.at_long) { strcpy(uath, preq->rq_user); strcat(uath, "@"); strcat(uath, preq->rq_host); if (acl_check(&server.sv_attr[SRV_ATR_AclUsers], uath, ACL_User) == 0) { #ifdef PBS_ROOT_ALWAYS_ADMIN if ((strcmp(preq->rq_user, PBS_DEFAULT_ADMIN) != 0) || (strcasecmp(preq->rq_host, server_host) != 0)) { return(PBSE_PERM); } #else /* PBS_ROOT_ALWAYS_ADMIN */ return(PBSE_PERM); #endif /* PBS_ROOT_ALWAYS_ADMIN */ } } /* A site stub for additional checking */ rc = site_allow_u(preq->rq_user, preq->rq_host); return(rc); } /* END authenticate_user() */ /* * chk_job_request - check legality of a request against a job * * this checks the most conditions common to most job batch requests. * It also returns a pointer to the job if found and the tests pass. */ job *chk_job_request( char *jobid, /* I */ struct batch_request *preq) /* I */ { job *pjob; if ((pjob = find_job(jobid)) == NULL) { log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, jobid, pbse_to_txt(PBSE_UNKJOBID)); req_reject(PBSE_UNKJOBID, 0, preq, NULL, "cannot locate job"); return(NULL); } if (svr_authorize_jobreq(preq, pjob) == -1) { sprintf(log_buffer, msg_permlog, preq->rq_type, "Job", pjob->ji_qs.ji_jobid, preq->rq_user, preq->rq_host); log_event( PBSEVENT_SECURITY, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); req_reject(PBSE_PERM, 0, preq, NULL, "operation not permitted"); return(NULL); } if (pjob->ji_qs.ji_state >= JOB_STATE_EXITING) { /* job has completed */ switch (preq->rq_type) { case PBS_BATCH_Rerun: /* allow re-run to be executed for completed jobs */ /* NO-OP */ break; default: { char tmpLine[1024]; sprintf(log_buffer, "%s %s", pbse_to_txt(PBSE_BADSTATE), PJobState[pjob->ji_qs.ji_state]); log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); sprintf(tmpLine, "invalid state for job - %s", PJobState[pjob->ji_qs.ji_state]); req_reject(PBSE_BADSTATE, 0, preq, NULL, tmpLine); return(NULL); } /*NOTREACHED*/ break; } /* END switch (preq->rq_type) */ } /* END if (pjob->ji_qs.ji_state >= JOB_STATE_EXITING) */ /* SUCCESS - request is valid */ return(pjob); } /* END chk_job_request() */ torque-2.4.16/src/server/req_rescq.c0000664000113300011330000002051411272401245014261 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * svr_rescq.c * * Functions relating to the Resource Query Batch Request. * * Included funtions are: * * */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include #include #include #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_error.h" #include "svrfunc.h" #include "log.h" /* Global Data Items: */ resource_t next_resource_tag; /* * req_rescq - Resource Query * * This responds to a Resource Query request with the * amount of the resource(s) available/allocated/reserved/down. * * Currently only recognizes "nodes" */ void req_rescq(struct batch_request *preq) { int i; char *pn; char *pv; int rc; struct brp_rescq *preply; struct rq_rescq *prescq = &preq->rq_ind.rq_rescq; if (prescq->rq_num < 1) { req_reject(RM_ERR_BADPARAM, 0, preq, NULL, NULL); return; } preply = &preq->rq_reply.brp_un.brp_rescq; preq->rq_reply.brp_choice = BATCH_REPLY_CHOICE_RescQuery; preply->brq_number = prescq->rq_num; preply->brq_avail = (int *)malloc(prescq->rq_num * sizeof(int)); preply->brq_alloc = (int *)malloc(prescq->rq_num * sizeof(int)); preply->brq_resvd = (int *)malloc(prescq->rq_num * sizeof(int)); preply->brq_down = (int *)malloc(prescq->rq_num * sizeof(int)); if ((preply->brq_avail == 0) || (preply->brq_alloc == 0) || (preply->brq_resvd == 0) || (preply->brq_down == 0)) { req_reject(PBSE_SYSTEM, errno, preq, NULL, NULL); return; } for (i = 0; i < prescq->rq_num; ++i) { *(preply->brq_resvd + i) = 0; *(preply->brq_down + i) = 0; pn = *(prescq->rq_list + i); while (isspace((int)*pn)) ++pn; pv = pn; while (isalnum((int)*pv)) ++pv; if (*pv != '\0') *pv++ = '\0'; /* skip delimiter */ if (strcmp(pn, "nodes") == 0) { /* check on availability of nodes */ if ((rc = node_avail(pv, preply->brq_avail + i, preply->brq_alloc + i, preply->brq_resvd + i, preply->brq_down + i)) != 0) { req_reject(rc, 0, preq, NULL, NULL); return; } } else { req_reject(RM_ERR_BADPARAM, 0, preq, NULL, NULL); return; } } (void)reply_send(preq); } /* * req_rescreserve - Resource reserve * * Reserve a set of resources (only "nodes" for now) */ void req_rescreserve(struct batch_request *preq) { int i; int freeold = 0; struct rq_rescq *prescq = &preq->rq_ind.rq_rescq; int part = 0; char *pn; char *pv; int rc; resource_t tag; if ((preq->rq_perm & (ATR_DFLAG_MGWR | ATR_DFLAG_OPWR)) == 0) { req_reject(PBSE_PERM, 0, preq, NULL, NULL); return; } if (prescq->rq_num < 1) { req_reject(RM_ERR_BADPARAM, 0, preq, NULL, NULL); return; } tag = prescq->rq_rhandle; if (tag > 0) { freeold = 1; } else { tag = next_resource_tag++; } for (i = 0; i < prescq->rq_num; ++i) { pn = *(prescq->rq_list + i); while (isspace((int)*pn)) ++pn; pv = pn; while (isalnum((int)*pv)) ++pv; if (*pv != '\0') *pv++ = '\0'; /* skip delimiter */ if (strcmp(pn, "nodes") == 0) { /* If existing (partial) reservation, free it */ if (freeold == 1) node_unreserve(tag); /* attempt to reserve some nodes */ rc = node_reserve(pv, tag); if (rc < 0) { req_reject(rc, 0, preq, NULL, NULL); return; } else if (rc == 0) part = 1; continue; } else { req_reject(PBSE_RMUNKNOWN, 0, preq, NULL, NULL); return; } } if (part) preq->rq_reply.brp_code = PBSE_RMPART; else preq->rq_reply.brp_code = 0; preq->rq_reply.brp_auxcode = tag; reply_send(preq); } /* * req_rescfree - Free a reserved set of resources */ void req_rescfree(struct batch_request *preq) { if ((preq->rq_perm & (ATR_DFLAG_MGWR | ATR_DFLAG_OPWR)) == 0) { req_reject(PBSE_PERM, 0, preq, NULL, NULL); return; } node_unreserve(preq->rq_ind.rq_rescq.rq_rhandle); reply_ack(preq); } torque-2.4.16/src/server/req_signal.c0000664000113300011330000002271111334071076014426 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * req_signaljob.c - functions dealing with sending a signal * to a running job. */ #include /* the master config generated by configure */ #include #include #include "libpbs.h" #include #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "work_task.h" #include "pbs_error.h" #include "log.h" #include "svrfunc.h" /* Private Function local to this file */ static void post_signal_req A_((struct work_task *)); /* Global Data Items: */ extern int LOGLEVEL; extern void set_old_nodes A_((job *)); /* * req_signaljob - service the Signal Job Request * * This request sends (via MOM) a signal to a running job. * MOM procceses in req_signaljob() * MOM replies with either ack or reject * Server gets response from MOM which invokes post_signal_req() * Which then replies to the requester with either a reject or ack */ void req_signaljob( struct batch_request *preq) /* I */ { job *pjob; int rc; if ((pjob = chk_job_request(preq->rq_ind.rq_signal.rq_jid, preq)) == 0) { return; } /* the job must be running */ if (pjob->ji_qs.ji_state != JOB_STATE_RUNNING) { req_reject(PBSE_BADSTATE, 0, preq, NULL, NULL); return; } /* Special pseudo signals for suspend and resume require op/mgr */ if (!strcmp(preq->rq_ind.rq_signal.rq_signame, SIG_RESUME) || !strcmp(preq->rq_ind.rq_signal.rq_signame, SIG_SUSPEND)) { if ((preq->rq_perm & (ATR_DFLAG_OPRD | ATR_DFLAG_OPWR | ATR_DFLAG_MGRD | ATR_DFLAG_MGWR)) == 0) { /* for suspend/resume, must be mgr/op */ req_reject(PBSE_PERM, 0, preq, NULL, NULL); return; } preq->rq_extra = pjob; /* save job ptr for post_signal_req() */ } /* FIXME: need a race-free check for available free subnodes before * resuming a suspended job */ #ifdef DONOTSUSPINTJOB /* interactive jobs don't resume correctly so don't allow a suspend */ if (!strcmp(preq->rq_ind.rq_signal.rq_signame, SIG_SUSPEND) && (pjob->ji_wattr[(int)JOB_ATR_interactive].at_flags & ATR_VFLAG_SET) && (pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long > 0)) { req_reject(PBSE_JOBTYPE, 0, preq, NULL, NULL); return; } #endif if (LOGLEVEL >= 6) { sprintf(log_buffer, "relaying signal request to mom %lu", pjob->ji_qs.ji_un.ji_exect.ji_momaddr); log_record( PBSEVENT_SCHED, PBS_EVENTCLASS_REQUEST, "req_signaljob", log_buffer); } /* send reply for asynchronous suspend */ if (preq->rq_type == PBS_BATCH_AsySignalJob) { reply_ack(preq); } /* pass the request on to MOM */ if ((rc = relay_to_mom( pjob->ji_qs.ji_un.ji_exect.ji_momaddr, preq, post_signal_req))) { req_reject(rc, 0, preq, NULL, NULL); /* unable to get to MOM */ return; } /* After MOM acts and replies to us, we pick up in post_signal_req() */ /* SUCCESS */ return; } /* END req_signaljob() */ /* * issue_signal - send an internally generated signal to a running job */ int issue_signal( job *pjob, char *signame, /* name of the signal to send */ void (*func) A_((struct work_task *)), void *extra) /* extra parameter to be stored in sig request */ { int rc; struct batch_request *newreq; /* build up a Signal Job batch request */ if ((newreq = alloc_br(PBS_BATCH_SignalJob)) == NULL) { /* FAILURE */ return(PBSE_SYSTEM); } newreq->rq_extra = extra; strcpy(newreq->rq_ind.rq_signal.rq_jid, pjob->ji_qs.ji_jobid); strncpy(newreq->rq_ind.rq_signal.rq_signame, signame, PBS_SIGNAMESZ); rc = relay_to_mom( pjob->ji_qs.ji_un.ji_exect.ji_momaddr, newreq, func); /* when MOM replies, we just free the request structure */ return(rc); } /* END issue_signal() */ /* * post_signal_req - complete a Signal Job Request (externally generated) */ static void post_signal_req( struct work_task *pwt) { job *pjob; struct batch_request *preq; svr_disconnect(pwt->wt_event); /* disconnect from MOM */ preq = pwt->wt_parm1; preq->rq_conn = preq->rq_orgconn; /* restore client socket */ if (preq->rq_reply.brp_code) { log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_REQUEST, preq->rq_ind.rq_signal.rq_jid, pbse_to_txt(PBSE_MOMREJECT)); errno = 0; req_reject(preq->rq_reply.brp_code, 0, preq, NULL, NULL); } else { pjob = preq->rq_extra; if (strcmp(preq->rq_ind.rq_signal.rq_signame, SIG_SUSPEND) == 0) { if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) == 0) { pjob->ji_qs.ji_svrflags |= JOB_SVFLG_Suspend; set_statechar(pjob); job_save(pjob, SAVEJOB_QUICK); /* release resources allocated to suspended job - NORWAY */ free_nodes(pjob); } } else if (strcmp(preq->rq_ind.rq_signal.rq_signame, SIG_RESUME) == 0) { if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) { /* re-allocate assigned node to resumed job - NORWAY */ set_old_nodes(pjob); pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_Suspend; set_statechar(pjob); job_save(pjob, SAVEJOB_QUICK); } } reply_ack(preq); } return; } /* END post_signal_req() */ /* END req_signal.c */ torque-2.4.16/src/server/svr_task.c0000664000113300011330000001533311272401245014134 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * @file svr_task.c * * Contains functions to deal with the server's task list * * A task list is a set of pending functions usually associated with * processing a reply message. * * Functions included are: */ #include /* the master config generated by configure */ #include "portability.h" #include #include #include #include #include #include "server_limits.h" #include "list_link.h" #include "work_task.h" /* Global Data Items: */ extern tlist_head task_list_immed; extern tlist_head task_list_timed; extern tlist_head task_list_event; /* * set_task - add the job entry to the task list * * Task time depends on the type of task. The list is time ordered. */ struct work_task *set_task( enum work_type type, long event_id, /* I - based on type can be time of event */ void (*func)(), void *parm) { struct work_task *pnew; struct work_task *pold; pnew = (struct work_task *)malloc(sizeof(struct work_task)); if (pnew == NULL) { return(NULL); } CLEAR_LINK(pnew->wt_linkall); CLEAR_LINK(pnew->wt_linkobj); pnew->wt_event = event_id; pnew->wt_type = type; pnew->wt_func = func; pnew->wt_parm1 = parm; pnew->wt_parm2 = NULL; pnew->wt_aux = 0; if (type == WORK_Immed) { append_link(&task_list_immed, &pnew->wt_linkall, pnew); } else if (type == WORK_Timed) { pold = (struct work_task *)GET_NEXT(task_list_timed); while (pold != NULL) { if (pold->wt_event > pnew->wt_event) break; pold = (struct work_task *)GET_NEXT(pold->wt_linkall); } if (pold != NULL) { insert_link( &pold->wt_linkall, &pnew->wt_linkall, pnew, LINK_INSET_BEFORE); } else { append_link(&task_list_timed, &pnew->wt_linkall, pnew); } } else { append_link(&task_list_event, &pnew->wt_linkall, pnew); } return(pnew); } /* END set_task() */ /* * dispatch_task - dispatch a work task found on a work list * * delinks the work task entry, calls the associated function with * the parameters from the work task entry, and then frees the entry. */ void dispatch_task( struct work_task *ptask) { delete_link(&ptask->wt_linkall); delete_link(&ptask->wt_linkobj); if (ptask->wt_func != NULL) ptask->wt_func(ptask); /* dispatch process function */ free(ptask); return; } /* END dispatch_task() */ /* * delete_task - unlink and free a work_task structure. */ void delete_task(struct work_task *ptask) { delete_link(&ptask->wt_linkobj); delete_link(&ptask->wt_linkall); (void)free(ptask); } torque-2.4.16/src/server/req_manager.c0000664000113300011330000016173211421621643014570 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * svr_manager.c * * Functions relating to the Manager Batch Request (qmgr). * * Included funtions are: * * mgr_set_attr() - set attributes for an server/queue object * mgr_set_node_attr() - sets "node-attributes" (state,properties etc) * on a node * mgr_queue_create() - create a queue * mgr_queue_delete() - delete a queue * mgr_server_set() - set server attributes * mgr_server_unset() - unset server attributes * mgr_queue_set() - set queue attributes * mgr_queue_unset() - unset queue attributes * mgr_node_set() - top level for setting "node-attributes" on * a set of nodes * mgr_node_delete() - top level function for effectively deleting a node * mgr_node_create() - top level function for creating a node * req_manager() - process manager request (top level) * disallowed_types_chk() - at action for queue disallowed_types attribute */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include #include #include #include #include #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "server.h" #include "queue.h" #include "credential.h" #include "batch_request.h" #include "net_connect.h" #include "pbs_error.h" #include "log.h" #include "svrfunc.h" #include "pbs_job.h" #include "pbs_nodes.h" #include "work_task.h" #include "mcom.h" #define PERM_MANAGER (ATR_DFLAG_MGWR | ATR_DFLAG_MGRD) #define PERM_OPorMGR (ATR_DFLAG_MGWR | ATR_DFLAG_MGRD | ATR_DFLAG_OPRD | ATR_DFLAG_OPWR) /* Global Data Items: */ extern struct server server; extern tlist_head svr_queues; extern attribute_def que_attr_def[]; extern attribute_def svr_attr_def[]; extern attribute_def node_attr_def[]; /* node attributes defs */ extern int svr_chngNodesfile; extern char *msg_attrtype; extern char *msg_daemonname; extern char *msg_manager; extern char *msg_man_cre; extern char *msg_man_del; extern char *msg_man_set; extern char *msg_man_uns; extern int que_purge(pbs_queue *); extern void save_characteristic(struct pbsnode *); extern int chk_characteristic(struct pbsnode *, int *); extern int hasprop(struct pbsnode *, struct prop *); extern int PNodeStateToString(int, char *, int); /* private data */ static char *all_quename = "_All_"; static char *all_nodes = "_All_"; /* * check_que_attr - check if attributes in request are consistant with * the current queue type. This is called when creating or setting * the attributes of a queue. * * Returns: NULL if all ok or name of bad attribute if not ok */ static char * check_que_attr(pbs_queue *pque) { int i; int type; type = pque->qu_qs.qu_type; /* current type of queue */ for (i = 0; i < (int)QA_ATR_LAST; ++i) { if (pque->qu_attr[i].at_flags & ATR_VFLAG_SET) { if (que_attr_def[i].at_parent == PARENT_TYPE_QUE_EXC) { if (type == QTYPE_Unset) type = QTYPE_Execution; else if (type != QTYPE_Execution) return (que_attr_def[i].at_name); } else if (que_attr_def[i].at_parent == PARENT_TYPE_QUE_RTE) { if (type == QTYPE_Unset) type = QTYPE_RoutePush; else if (type != QTYPE_RoutePush) return (que_attr_def[i].at_name); } } } return ((char *)0); /* all attributes are ok */ } /* * check_que_enable - check if attempt to enable incompletely defined queue * This is the at_action() routine for QA_ATR_Enabled */ int check_que_enable( attribute *pattr, void *pque, /* actually a queue* */ int mode ) { attribute *datr; if (pattr->at_val.at_long != 0) { /* * admin attempting to enabled queue, * is it completely defined */ if (((pbs_queue *)pque)->qu_qs.qu_type == QTYPE_Unset) return (PBSE_QUENOEN); else if (((pbs_queue *)pque)->qu_qs.qu_type == QTYPE_RoutePush) { datr = &((pbs_queue *)pque)->qu_attr[(int)QR_ATR_RouteDestin]; if (!(datr->at_flags & ATR_VFLAG_SET) || (datr->at_val.at_arst->as_usedptr == 0)) return (PBSE_QUENOEN); } } return (0); /* ok to enable queue */ } /* * set_queue_type - check the requested value of the queue type attribute * and set qu_type accordingly. * This is the at_action() routine for QA_ATR_QType */ int set_queue_type(attribute *pattr, void *pque, int mode) { int i; char *pca; char *pcv; int spectype; static struct { int type; char *name; } qt[2] = { { QTYPE_Execution, "Execution" }, { QTYPE_RoutePush, "Route" } }; if ((pattr->at_flags & ATR_VFLAG_SET) == 0) /* better be set or we shouldn't be here */ return (PBSE_BADATVAL); /* does the requested value match a legal value? */ for (i = 0; i < 2; i++) { spectype = qt[i].type; pca = pattr->at_val.at_str; pcv = qt[i].name; if (*pca == '\0') return (PBSE_BADATVAL); while (*pca) { if (toupper((int)*pca++) != toupper((int)*pcv++)) { spectype = -1; /* no match */ break; } } if (spectype != -1) /* set up the attribute */ { ((pbs_queue *)pque)->qu_qs.qu_type = spectype; (void)free(pattr->at_val.at_str); pattr->at_val.at_str = malloc(strlen(qt[i].name) + 1); if (pattr->at_val.at_str == (char *)0) return (PBSE_SYSTEM); (void)strcpy(pattr->at_val.at_str, qt[i].name); return (0); } } return (PBSE_BADATVAL); } /* * mgr_log_attr - log the change of an attribute */ static void mgr_log_attr( char *msg, struct svrattrl *plist, int logclass, /* see log.h */ char *objname /* object being modified */ ) { char *pstr; while (plist) { (void)strcpy(log_buffer, msg); (void)strcat(log_buffer, plist->al_name); if (plist->al_rescln) { (void)strcat(log_buffer, "."); (void)strcat(log_buffer, plist->al_resc); } if (plist->al_op == INCR) pstr = " + "; else if (plist->al_op == DECR) pstr = " - "; else pstr = " = "; (void)strcat(log_buffer, pstr); if (plist->al_valln) (void)strncat(log_buffer, plist->al_value, LOG_BUF_SIZE - strlen(log_buffer) - 1); log_buffer[LOG_BUF_SIZE-1] = '\0'; log_event(PBSEVENT_ADMIN, logclass, objname, log_buffer); plist = (struct svrattrl *)GET_NEXT(plist->al_link); } } /* * mgr_set_attr - set attributes for manager function * * The set operation is performed as an atomic operation: all specified * attributes must be successfully set, or none are modified. */ static int mgr_set_attr( attribute *pattr, /* current attributes */ attribute_def *pdef, int limit, svrattrl *plist, int privil, int *bad, void *parent, int mode) { int index; attribute *new; attribute *pnew; attribute *pold; int rc; if (plist == (struct svrattrl *)0) { return(0); } new = (attribute *)calloc((unsigned int)limit, sizeof(attribute)); if (new == (attribute *)0) { return(PBSE_SYSTEM); } /* * decode the new attribute values which are in the request, * copy the corresponding current attribute into a holding array * and update it with the newly decoded value */ if ((rc = attr_atomic_set(plist, pattr, new, pdef, limit, -1, privil, bad)) != 0) { attr_atomic_kill(new, pdef, limit); return(rc); } for (index = 0;index < limit;index++) { pnew = new + index; pold = pattr + index; if (pnew->at_flags & ATR_VFLAG_MODIFY) { /* * for each attribute which is to be modified, call the * at_action routine for the attribute, if one exists, with the * new value. If the action fails, undo everything. */ if ((pdef + index)->at_action) { if ((rc = (pdef + index)->at_action(new + index, parent, mode))) { /* always allow removing from ACLs */ if (!((plist->al_op == DECR) && (pdef + index)->at_type == ATR_TYPE_ACL)) { attr_atomic_kill(new, pdef, limit); return(rc); } } } /* now replace the old values with any modified new values */ (pdef + index)->at_free(pold); if ((pold->at_type == ATR_TYPE_LIST) || (pold->at_type == ATR_TYPE_RESC)) { list_move(&pnew->at_val.at_list, &pold->at_val.at_list); } else { *pold = *pnew; } pold->at_flags = pnew->at_flags; /* includes MODIFY */ } } /* * we have moved all the "external" values to the old array, thus * we just free the new array, NOT call at_free on each. */ free((char *)new); return(0); } /* END mgr_set_attr() */ /* * mgr_unset_attr - Unset (clear) attributes for manager function * * The set operation is performed as an atomic operation: all specified * attributes must be successfully set, or none are modified. */ int mgr_unset_attr( attribute *pattr, /* current attributes */ attribute_def *pdef, int limit, svrattrl *plist, int privil, int *bad) { int index; int ord; svrattrl *pl; resource_def *prsdef; resource *presc; /* first check the attribute exists and we have privilege to set */ ord = 0; pl = plist; while (pl != NULL) { ord++; index = find_attr(pdef, pl->al_name, limit); if (index < 0) { *bad = ord; return(PBSE_NOATTR); } /* have we privilege to unset the attribute ? */ if (((pdef + index)->at_flags & privil & ATR_DFLAG_WRACC) == 0) { *bad = ord; return(PBSE_ATTRRO); } if (((pdef + index)->at_type == ATR_TYPE_RESC) && (pl->al_resc != NULL)) { /* check the individual resource */ prsdef = find_resc_def( svr_resc_def, pl->al_resc, svr_resc_size); if (prsdef == NULL) { *bad = ord; return(PBSE_UNKRESC); } if ((prsdef->rs_flags & privil & ATR_DFLAG_WRACC) == 0) { *bad = ord; return(PBSE_PERM); } } pl = (svrattrl *)GET_NEXT(pl->al_link); } /* ok, now clear them */ while (plist != NULL) { index = find_attr(pdef, plist->al_name, limit); if (((pdef + index)->at_type == ATR_TYPE_RESC) && (plist->al_resc != NULL)) { /* free resource member, not the attribute */ prsdef = find_resc_def( svr_resc_def, plist->al_resc, svr_resc_size); if ((presc = find_resc_entry(pattr + index, prsdef))) { if ((pdef->at_parent != PARENT_TYPE_SERVER) || (index != (int)SRV_ATR_resource_cost)) { prsdef->rs_free(&presc->rs_value); } delete_link(&presc->rs_link); } free(presc); } else { /* free the whole attribute */ (pdef + index)->at_free(pattr + index); (pattr + index)->at_flags |= ATR_VFLAG_MODIFY; } plist = (svrattrl *)GET_NEXT(plist->al_link); } /* END while (plist != NULL) */ return(0); } /* END mgr_unset_attr() */ /* * update_subnode - update subnodes with state and props * * state information comes from the parent node * prop information taken from the 1st subnode * * Note, while it isn't a problem now, if the server is ever multithreaded, * this will have to locked out while subnodes are being allocated or * otherwise updated. */ static void update_subnode( struct pbsnode *pnode) { struct pbssubn *pnxtsn; unsigned short state; state = pnode->nd_state & INUSE_COMMON_MASK; for (pnxtsn = pnode->nd_psn;pnxtsn;pnxtsn = pnxtsn->next) { pnxtsn->host = pnode; pnxtsn->inuse = (pnxtsn->inuse & ~INUSE_COMMON_MASK) | state; } return; } /* END update_subnode() */ /* * mgr_set_node_attr - "set state, properties, ntype" for mgr_node_set function * * The set operation is performed as an atomic operation-- all specified * items must be successfully set for the node, or none are modified. * * Although a node doesn't, at present, have an array of attributes as one * of its structure members, we will proceed as though it did by using the * node to derive a temporary array of attributes. We use the "action" * function of our artificial attribute_def array with a mode value of NEW * in constructing this temporary node attribute array. Once this temporary * array is constucted, the "svrattrl" request list is processed against it * to produce a new "updated" attribute array. When all the attribute * processing completes, assuming it's successful, the updated attribute * array is used to modify the node itself-- this can be done via each * attribute's "action" function with the value of mode set to "ALTER". * Although it's a little twisted to use the idea of an attribute's * "action function" to move between node an attribute,it pushes the * details down a level, below that which is taking place here-- a good * thing. */ int mgr_set_node_attr( struct pbsnode *pnode, /*do some kind of "set" action on this node */ attribute_def *pdef, /*pbsnode doesn't have attributes*/ /*but in the future it might so,*/ /*make code similar to existing */ int limit, /*length of the *pdef array */ svrattrl *plist, /*batch request's svrattrl list */ /*begins here */ int privil, /*requester's privilege */ int *bad, /*if there is a "bad attribute" */ /*pass back position via this loc*/ void *parent, /*may go unused in this function */ int mode) /*passed to attrib's action func */ /*not used by this func at this time*/ { int i; int index; int nstatus = 0; int nprops = 0; int rc; attribute *new; attribute *unused = (attribute *)0; attribute *pnew; struct pbsnode tnode; /*temporary node*/ struct pbssubn tsnd; /*temporary subnode */ struct pbssubn *xtmp; struct prop *pdest; struct prop **plink; if (plist == NULL) { return(0); /* nothing to do, return success */ } /* Get heap space for a temporary node-attribute array and use the * various "node-attribute action" functions defined in the file * "node_attr_def.c" to set the current values of each entry's * structure members */ new = (attribute *)calloc((unsigned int)limit, sizeof(attribute)); if (new == NULL) { return(PBSE_SYSTEM); } for (index = 0; index < limit; index++) { if ((pdef + index)->at_action) { if ((rc = (pdef + index)->at_action(new + index, (void *)pnode, ATR_ACTION_NEW))) { /*call the "at_free" func for each member of*/ /*new" and then free the entire "new" array */ /*return code (rc) shapes caller's reply */ attr_atomic_kill(new, pdef, limit); return(rc); } } } /* * The function "attr_atomic_node_set" does the following: * successively decodes the new attribute modifications carried in the * the request list, "plist", into a temporary attribute (on stack). * Updates each attribute in the derived node-attribute array using the * decoded values. If a failure of some sort occurs, as evidenced by * a non-zero return code (rc), call attr_atomic_kill() to undo * everything-- calls upon the "at_free" function for each attribute * to free hanging structures, then frees up the "new" array * return code (rc) shapes caller's reply */ if ((rc = attr_atomic_node_set(plist, unused, new, pdef, limit, -1, privil, bad)) != 0) { attr_atomic_kill(new, pdef, limit); return(rc); } /* * Use the updated attribute values in attribute array, "new", to update a * temporary (on stack) pbsnode, which is a copy of the one pointed to by * pnode. If all goes well, we are home free-- just copy the information * in the temporary pbsnode, after it has gotten modified, back to the * node pointed to by "pnode" and free the attribute array "new". */ tnode = *pnode; tsnd = *pnode->nd_psn; tnode.nd_psn = &tsnd; tsnd.host = &tnode; for (index = 0;index < limit;index++) { pnew = new + index; if (pnew->at_flags & ATR_VFLAG_MODIFY) { /* * for each attribute which is to cause modification to the node, "tnode", * call the specified "at_action" routine for that attribute passing it * the address of the temporary attribute and the address of the temporary * pbsnode object. If any of the update actions fail along the way, undo * everything. Any malloc'd substructures should be hanging off the * appropriate attribute of the attribute array "new". */ if ((pdef + index)->at_action) { if ((rc = (pdef + index)->at_action(new + index, (void *)&tnode, ATR_ACTION_ALTER))) { attr_atomic_kill(new, pdef, limit); return(rc); } } } } /* * we have successfully updated tnode; use it to modify pnode * if pnode has any malloc-ed storage that is being replaced * be sure to free the old. */ if (pnode->nd_prop && (pnode->nd_prop != tnode.nd_prop)) { if (pnode->nd_prop->as_buf) free(pnode->nd_prop->as_buf); free(pnode->nd_prop); pnode->nd_prop = NULL; } /* NOTE: nd_status properly freed during attribute alter */ if ((pnode->nd_state != tnode.nd_state)) { char OrigState[1024]; char FinalState[1024]; /* changing node state */ /* log change */ PNodeStateToString(pnode->nd_state, OrigState, sizeof(OrigState)); PNodeStateToString(tnode.nd_state, FinalState, sizeof(FinalState)); sprintf(log_buffer, "node %s state changed from %s to %s", pnode->nd_name, OrigState, FinalState); log_event( PBSEVENT_ADMIN, PBS_EVENTCLASS_NODE, pnode->nd_name, log_buffer); } /* NOTE: nd_status properly freed during attribute alter */ /* if ((pnode->nd_status != NULL) && (pnode->nd_status != tnode.nd_status)) { if (pnode->nd_status->as_buf != NULL) free(pnode->nd_status->as_buf); free(pnode->nd_status); pnode->nd_status = NULL; } */ xtmp = pnode->nd_psn; *pnode = tnode; /* updates all data including linking in props */ pnode->nd_psn = xtmp; *pnode->nd_psn = tsnd; pnode->nd_psn->host = pnode; free(new); /*any new prop list has been put on pnode*/ /*dispense with the attribute array itself*/ /* update prop list based on new prop array */ free_prop_list(pnode->nd_first); plink = &pnode->nd_first; if (pnode->nd_prop) { nprops = pnode->nd_prop->as_usedptr; for (i = 0;i < nprops;++i) { pdest = init_prop(pnode->nd_prop->as_string[i]); *plink = pdest; plink = &pdest->next; } } /* now add in name as last prop */ pdest = init_prop(pnode->nd_name); *plink = pdest; pnode->nd_last = pdest; pnode->nd_nprops = nprops + 1; /* update status list based on new status array */ free_prop_list(pnode->nd_f_st); plink = &pnode->nd_f_st; if (pnode->nd_status != NULL) { nstatus = pnode->nd_status->as_usedptr; for (i = 0;i < nstatus;++i) { pdest = init_prop(pnode->nd_status->as_string[i]); *plink = pdest; plink = &pdest->next; } } /* now add in name as last status */ pdest = init_prop(pnode->nd_name); *plink = pdest; pnode->nd_l_st = pdest; pnode->nd_nstatus = nstatus + 1; /* now update subnodes */ update_subnode(pnode); return(0); } /* END mgr_set_node_attr() */ /* * mgr_queue_create - process request to create a queue * * Creates queue and calls mgr_set_attr to set queue attributes. */ void mgr_queue_create( struct batch_request *preq) { int bad; char *badattr; svrattrl *plist; pbs_queue *pque; int rc; rc = strlen(preq->rq_ind.rq_manager.rq_objname); if ((rc > PBS_MAXQUEUENAME) || (rc == 0)) { req_reject(PBSE_QUENBIG, 0, preq, NULL, NULL); return; } if (find_queuebyname(preq->rq_ind.rq_manager.rq_objname)) { req_reject(PBSE_QUEEXIST, 0, preq, NULL, NULL); return; } pque = que_alloc(preq->rq_ind.rq_manager.rq_objname); /* set the queue attributes */ plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); rc = mgr_set_attr( pque->qu_attr, que_attr_def, QA_ATR_LAST, plist, preq->rq_perm, &bad, (void *)pque, ATR_ACTION_NEW); if (rc != 0) { reply_badattr(rc, bad, plist, preq); que_free(pque); } else { que_save(pque); svr_save(&server, SVR_SAVE_QUICK); sprintf(log_buffer, msg_manager, msg_man_cre, preq->rq_user, preq->rq_host); log_event( PBSEVENT_ADMIN, PBS_EVENTCLASS_QUEUE, pque->qu_qs.qu_name, log_buffer); mgr_log_attr( msg_man_set, plist, PBS_EVENTCLASS_QUEUE, preq->rq_ind.rq_manager.rq_objname); /* check the appropriateness of the attributes vs. queue type */ if ((badattr = check_que_attr(pque)) != NULL) { /* mismatch, issue warning */ sprintf(log_buffer, msg_attrtype, pque->qu_qs.qu_name, badattr); reply_text(preq, PBSE_ATTRTYPE, log_buffer); } else { reply_ack(preq); } } return; } /* * mgr_queue_delete - delete a queue * * The queue must be empty of jobs */ void mgr_queue_delete( struct batch_request *preq) { pbs_queue *pque; int rc; pque = find_queuebyname(preq->rq_ind.rq_manager.rq_objname); if (pque == NULL) { /* FAILURE */ req_reject(PBSE_UNKQUE, 0, preq, NULL, NULL); return; } if ((rc = que_purge(pque)) != 0) { /* FAILURE */ req_reject(rc, 0, preq, NULL, NULL); return; } svr_save(&server, SVR_SAVE_QUICK); sprintf(log_buffer, msg_manager, msg_man_del, preq->rq_user, preq->rq_host); log_event( PBSEVENT_ADMIN, PBS_EVENTCLASS_QUEUE, preq->rq_ind.rq_manager.rq_objname, log_buffer); reply_ack(preq); /* SUCCESS */ return; } /* END mgr_queue_delete() */ int hostname_check( char *hostname) { char myhost[PBS_MAXHOSTNAME]; char extension[PBS_MAXHOSTNAME]; char ret_hostname[PBS_MAXHOSTNAME]; char *open_bracket; if (hostname == NULL) return(SUCCESS); else if(strchr(hostname,'*') != NULL) return(SUCCESS); strcpy(myhost,hostname); open_bracket = strchr(myhost,'['); ret_hostname[0] = '\0'; if (open_bracket == NULL) { /* handle normally */ if ((get_fullhostname(hostname,ret_hostname,PBS_MAXHOSTNAME,NULL)) || strncmp(hostname, ret_hostname, PBS_MAXHOSTNAME)) { return(FAILURE); } } else { /* authenticate the range */ int low; int high; char *dash; char *host_end; char *close_bracket = strchr(open_bracket,']'); low = atoi(open_bracket+1); dash = strchr(open_bracket,'-'); host_end = open_bracket + strlen(open_bracket); if ((dash == NULL) || (close_bracket == NULL)) { /* not a valid range */ return(FAILURE); } high = atoi(dash+1); /* check for anything left over */ extension[0] = '\0'; if (close_bracket < host_end) { strcpy(extension,close_bracket+1); } /* now check each hostname */ while (low < high) { sprintf(open_bracket,"%d%s",low,extension); if ((get_fullhostname(myhost,ret_hostname,PBS_MAXHOSTNAME,NULL)) || (strncmp(myhost,ret_hostname,PBS_MAXHOSTNAME))) { return(FAILURE); } low++; } } return(SUCCESS); } /* END hostname_check() */ /* * mgr_server_set - Set Server Attribute Values * * Sets the requested attributes and returns a reply */ void mgr_server_set( struct batch_request *preq) /* I */ { int bad_attr = 0; svrattrl *plist; int rc; plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); rc = mgr_set_attr( server.sv_attr, svr_attr_def, SRV_ATR_LAST, plist, preq->rq_perm, &bad_attr, (void *) & server, ATR_ACTION_ALTER); /* PBSE_BADACLHOST - lets show the user the first bad host in the ACL */ if (rc == PBSE_BADACLHOST) { char *bad_host; char *host_entry; attribute temp; int index; int i; struct array_strings *pstr; int bhstrlen; bhstrlen = PBS_MAXHOSTNAME + 17; bad_host = malloc(sizeof(char) * (bhstrlen + 1)); if (bad_host == NULL) { reply_badattr(PBSE_BADHOST, bad_attr, plist, preq); return; } /* look into plist to find an offending attr */ while (plist != NULL) { /* only concerned about operators and managers */ if (strcmp(plist->al_name, ATTR_managers) && strcmp(plist->al_name, ATTR_operators)) { plist = (svrattrl *)GET_NEXT(plist->al_link); continue; } index = find_attr(svr_attr_def, plist->al_name, SRV_ATR_LAST); clear_attr(&temp, &svr_attr_def[index]); svr_attr_def[index].at_decode(&temp, plist->al_name, plist->al_resc, plist->al_value); pstr = temp.at_val.at_arst; bad_host[0] = '\0'; /* loop over all hosts in the request and perform same check as manager_oper_chk*/ for (i = 0;i < pstr->as_usedptr;++i) { host_entry = strchr(pstr->as_string[i], (int)'@'); if (hostname_check(host_entry+1) == FAILURE) { snprintf(bad_host, bhstrlen, "First bad host: %s", host_entry + 1); break; } } if (bad_host[0] != '\0') break; /* nothing wrong found in the request, let's try again with the server's list */ pstr = server.sv_attr[(int)index].at_val.at_arst; for (i = 0; i < pstr->as_usedptr; ++i) { host_entry = strchr(pstr->as_string[i], (int)'@'); if (hostname_check(host_entry+1) == FAILURE) { snprintf(bad_host,bhstrlen,"First bad host: %s", host_entry+1); break; } } if (bad_host[0] != '\0') break; plist = (svrattrl *)GET_NEXT(plist->al_link); } if (bad_host[0] != '\0') /* we found a fully qualified host that was bad */ { req_reject(PBSE_BADACLHOST, 0, preq, NULL, bad_host); } else { /* this shouldn't happen (return PBSE_BADACLHOST, but now we can't find the bad host) */ reply_badattr(PBSE_BADHOST, bad_attr, plist, preq); } return; } /* END if (rc == PBSE_BADACLHOST) */ else if (rc != 0) { reply_badattr(rc, bad_attr, plist, preq); return; } svr_save(&server, SVR_SAVE_FULL); sprintf(log_buffer, msg_manager, msg_man_set, preq->rq_user, preq->rq_host); log_event( PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); mgr_log_attr(msg_man_set, plist, PBS_EVENTCLASS_SERVER, msg_daemonname); reply_ack(preq); return; } /* END mgr_server_set() */ /* * mgr_server_unset - Unset (clear) Server Attribute Values * * Clears the requested attributes and returns a reply */ void mgr_server_unset( struct batch_request *preq) { int bad_attr = 0; svrattrl *plist; int rc; plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); rc = mgr_unset_attr( server.sv_attr, svr_attr_def, SRV_ATR_LAST, plist, preq->rq_perm, &bad_attr); if (rc != 0) { reply_badattr(rc, bad_attr, plist, preq); } else { svr_save(&server, SVR_SAVE_FULL); sprintf(log_buffer, msg_manager, msg_man_uns, preq->rq_user, preq->rq_host); log_event( PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); mgr_log_attr(msg_man_uns, plist, PBS_EVENTCLASS_SERVER, msg_daemonname); reply_ack(preq); } return; } /* END mgr_server_unset() */ /* * mgr_queue_set - Set Queue Attribute Values * * Finds the queue, Sets the requested attributes and returns a reply */ void mgr_queue_set( struct batch_request *preq) { int allques; int bad = 0; char *badattr; svrattrl *plist; pbs_queue *pque; char *qname; int rc; if ((*preq->rq_ind.rq_manager.rq_objname == '\0') || (*preq->rq_ind.rq_manager.rq_objname == '@')) { qname = all_quename; allques = TRUE; pque = (pbs_queue *)GET_NEXT(svr_queues); } else { qname = preq->rq_ind.rq_manager.rq_objname; allques = FALSE; pque = find_queuebyname(qname); } if (pque == NULL) { req_reject(PBSE_UNKQUE, 0, preq, NULL, NULL); return; } /* set the attributes */ sprintf(log_buffer, msg_manager, msg_man_set, preq->rq_user, preq->rq_host); log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_QUEUE, qname, log_buffer); if (allques == TRUE) pque = (pbs_queue *)GET_NEXT(svr_queues); plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); while (pque != NULL) { rc = mgr_set_attr( pque->qu_attr, que_attr_def, QA_ATR_LAST, plist, preq->rq_perm, &bad, (void *)pque, ATR_ACTION_ALTER); if (rc != 0) { reply_badattr(rc, bad, plist, preq); return; } que_save(pque); mgr_log_attr(msg_man_set, plist, PBS_EVENTCLASS_QUEUE, pque->qu_qs.qu_name); if (allques == FALSE) break; pque = (pbs_queue *)GET_NEXT(pque->qu_link); } /* END while (pque != NULL) */ /* check the appropriateness of the attributes based on queue type */ if (allques == TRUE) pque = (pbs_queue *)GET_NEXT(svr_queues); while (pque != NULL) { if ((badattr = check_que_attr(pque)) != NULL) { sprintf(log_buffer, msg_attrtype, pque->qu_qs.qu_name, badattr); reply_text(preq, PBSE_ATTRTYPE, log_buffer); return; } if (allques == FALSE) break; pque = (pbs_queue *)GET_NEXT(pque->qu_link); } /* END while (pque != NULL) */ reply_ack(preq); return; } /* END mgr_queue_set() */ /* * mgr_queue_unset - Unset (clear) Queue Attribute Values * * Finds the queue, clears the requested attributes and returns a reply */ void mgr_queue_unset( struct batch_request *preq) { int allques; int bad_attr = 0; svrattrl *plist; pbs_queue *pque; char *qname; int rc; if ((*preq->rq_ind.rq_manager.rq_objname == '\0') || (*preq->rq_ind.rq_manager.rq_objname == '@')) { qname = all_quename; allques = TRUE; pque = (pbs_queue *)GET_NEXT(svr_queues); } else { allques = FALSE; qname = preq->rq_ind.rq_manager.rq_objname; pque = find_queuebyname(qname); } if (pque == NULL) { req_reject(PBSE_UNKQUE, 0, preq, NULL, NULL); return; } sprintf(log_buffer, msg_manager, msg_man_uns, preq->rq_user, preq->rq_host); log_event( PBSEVENT_ADMIN, PBS_EVENTCLASS_QUEUE, qname, log_buffer); plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); while (pque != NULL) { rc = mgr_unset_attr( pque->qu_attr, que_attr_def, QA_ATR_LAST, plist, preq->rq_perm, &bad_attr); if (rc != 0) { reply_badattr(rc, bad_attr, plist, preq); return; } que_save(pque); mgr_log_attr(msg_man_uns, plist, PBS_EVENTCLASS_QUEUE, pque->qu_qs.qu_name); if ((pque->qu_attr[(int)QA_ATR_QType].at_flags & ATR_VFLAG_SET) == 0) pque->qu_qs.qu_type = QTYPE_Unset; if (allques == FALSE) break; pque = GET_NEXT(pque->qu_link); } reply_ack(preq); return; } /* * mgr_node_set - Set node "state" or "properties" * * Finds the node, Sets the requested state flags, properties, or type and returns * a reply to the sender of the batch_request */ void mgr_node_set( struct batch_request *preq) /* I */ { static int need_todo = 0; int allnodes = 0; int propnodes = 0; int bad = 0; svrattrl *plist; struct pbsnode *pnode; char *nodename = NULL; int rc; int i, len; int problem_cnt = 0; char *problem_names; struct pbsnode **problem_nodes = NULL; struct prop props; if ((*preq->rq_ind.rq_manager.rq_objname == '\0') || (*preq->rq_ind.rq_manager.rq_objname == '@') || ((*preq->rq_ind.rq_manager.rq_objname == ':') && (*(preq->rq_ind.rq_manager.rq_objname + 1) != '\0'))) { /*In this instance the set node req is to apply to all */ /*nodes at the local ('\0') or specified ('@') server */ if ((pbsndlist != NULL) && svr_totnodes) { pnode = *pbsndlist; if ((*preq->rq_ind.rq_manager.rq_objname == ':') && (strcmp(preq->rq_ind.rq_manager.rq_objname + 1, "ALL") != 0)) { propnodes = 1; nodename = preq->rq_ind.rq_manager.rq_objname; props.name = nodename + 1; props.mark = 1; props.next = NULL; } else { allnodes = 1; nodename = all_nodes; } } else { /* specified server has no nodes in its node table */ pnode = NULL; } } else { nodename = preq->rq_ind.rq_manager.rq_objname; pnode = find_nodebyname(nodename); } if (pnode == NULL) { req_reject(PBSE_UNKNODE, 0, preq, NULL, NULL); return; } /*set "state", "properties", or type of node (nodes if allnodes == 1)*/ sprintf(log_buffer, msg_manager, msg_man_set, preq->rq_user, preq->rq_host); log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_NODE, nodename, log_buffer); if (allnodes || propnodes) { pnode = pbsndlist[0]; problem_nodes = (struct pbsnode **)malloc(svr_totnodes * sizeof(struct pbsnode *)); problem_cnt = 0; } plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); for (i = 0;i < svr_totnodes;i++, pnode = pbsndlist[i]) { if (propnodes && !hasprop(pnode, &props)) continue; save_characteristic(pnode); rc = mgr_set_node_attr( pnode, node_attr_def, ND_ATR_LAST, plist, preq->rq_perm, &bad, (void *)pnode, ATR_ACTION_ALTER); if (rc != 0) { if (allnodes || propnodes) { if (problem_nodes) /*we have an array in which to save*/ problem_nodes[ problem_cnt ] = pnode; ++problem_cnt; } else { /*In the specific node case, reply w/ error and return*/ switch (rc) { case PBSE_INTERNAL: case PBSE_SYSTEM: req_reject(rc, bad, preq, NULL, NULL); break; case PBSE_NOATTR: case PBSE_ATTRRO: case PBSE_MUTUALEX: case PBSE_BADNDATVAL: reply_badattr(rc, bad, plist, preq); break; default: req_reject(rc, 0, preq, NULL, NULL); break; } return; } /* END else */ } else { /* modifications succeeded for this node */ chk_characteristic(pnode, &need_todo); mgr_log_attr( msg_man_set, plist, PBS_EVENTCLASS_NODE, pnode->nd_name); } if (!allnodes && !propnodes) break; } /* END for (i) */ if (need_todo & WRITENODE_STATE) { /*some nodes set to "offline"*/ write_node_state(); need_todo &= ~(WRITENODE_STATE); } if (need_todo & WRITENODE_NOTE) { /*some nodes have new "note"s*/ write_node_note(); need_todo &= ~(WRITENODE_NOTE); } if (need_todo & WRITE_NEW_NODESFILE) { /*create/delete/prop/ntype change*/ if (!update_nodes_file()) need_todo &= ~(WRITE_NEW_NODESFILE); /*successful on update*/ } if (allnodes || propnodes) { /* modification was for all nodes */ if (problem_cnt) { /* one or more problems encountered */ for (len = 0, i = 0;i < problem_cnt;i++) len += strlen(problem_nodes[i]->nd_name) + 3; len += strlen(pbse_to_txt(PBSE_GMODERR)); if ((problem_names = malloc(len))) { strcpy(problem_names, pbse_to_txt(PBSE_GMODERR)); for (i = 0;i < problem_cnt;i++) { if (i) strcat(problem_names, ", "); strcat(problem_names, problem_nodes[i]->nd_name); } reply_text(preq, PBSE_GMODERR, problem_names); free(problem_names); } else { reply_text(preq, PBSE_GMODERR, pbse_to_txt(PBSE_GMODERR)); } } if (problem_nodes != NULL) free(problem_nodes); if (problem_cnt) { /* reply has already been sent */ recompute_ntype_cnts(); return; } } /* END if (allnodes || propnodes) */ recompute_ntype_cnts(); reply_ack(preq); /*request completely successful*/ return; } /* END void mgr_node_set() */ /* * mgr_node_delete - mark a node (or all nodes) in the server's node list * as being "deleted". It (they) will no longer get * assigned to a job, will no longer be pinged, and * any current job tasks will continue until they end, * abort, or are killed. * */ static void mgr_node_delete( struct batch_request *preq) { static int need_todo = 0; int allnodes = 0; struct pbsnode *pnode; char *nodename = NULL; int rc; int i, len; int problem_cnt = 0; char *problem_names; struct pbsnode **problem_nodes = NULL; svrattrl *plist; if ((*preq->rq_ind.rq_manager.rq_objname == '\0') || (*preq->rq_ind.rq_manager.rq_objname == '@')) { /* In this instance the set node req is to apply to all */ /* nodes at the local ('\0') or specified ('@') server */ if ((pbsndlist != NULL) && svr_totnodes) { nodename = all_nodes; pnode = *pbsndlist; allnodes = 1; } else { /* specified server has no nodes in its node table */ pnode = NULL; } } else { nodename = preq->rq_ind.rq_manager.rq_objname; pnode = find_nodebyname(nodename); } if (pnode == NULL) { req_reject(PBSE_UNKNODE, 0, preq, NULL, NULL); return; } sprintf(log_buffer, msg_manager, msg_man_del, preq->rq_user, preq->rq_host); log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_NODE, nodename, log_buffer); /*if doing many and problem arises with some, record them for report*/ /*the array of "problem nodes" sees no use now and may never see use*/ if (allnodes) { pnode = pbsndlist[0]; problem_nodes = (struct pbsnode **)malloc( svr_totnodes * sizeof(struct pbsnode *)); problem_cnt = 0; } /*set "deleted" bit in node's (nodes, allnodes == 1) "inuse" field*/ /*remove entire prop list, including the node name, from the node */ /*remove the IP address array hanging from the node */ plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); for (i = 0;i < svr_totnodes;i++, pnode = pbsndlist[i]) { save_characteristic(pnode); nodename = strdup(pnode->nd_name); effective_node_delete(pnode); rc = 0; /*currently, failure not possible so set rc=0 */ if (rc != 0) { if (allnodes) { if (problem_nodes) /*we have an array in which to save*/ problem_nodes[problem_cnt] = pnode; ++problem_cnt; } else { /*In the specific node case, reply w/ error and return*/ switch (rc) { default: req_reject(rc, 0, preq, NULL, NULL); break; } return; } } else { /*modifications succeed for this node*/ chk_characteristic(pnode, &need_todo); if (nodename) { mgr_log_attr(msg_man_set, plist, PBS_EVENTCLASS_NODE, nodename); free(nodename); } } if (!allnodes) break; } /* bottom of the for() */ if (need_todo & WRITENODE_STATE) { /*some nodes set to "offline"*/ write_node_state(); need_todo &= ~(WRITENODE_STATE); } if (need_todo & WRITE_NEW_NODESFILE) { /* create/delete/prop/ntype change */ if (!update_nodes_file()) need_todo &= ~(WRITE_NEW_NODESFILE); /*successful on update*/ } if (allnodes) { /*modification was for all nodes */ if (problem_cnt) /*one or more problems encountered*/ { for (len = 0, i = 0; i < problem_cnt; i++) len += strlen(problem_nodes[i]->nd_name) + 3; len += strlen(pbse_to_txt(PBSE_GMODERR)); if ((problem_names = malloc(len))) { strcpy(problem_names, pbse_to_txt(PBSE_GMODERR)); for (i = 0; i < problem_cnt; i++) { if (i) strcat(problem_names, ", "); strcat(problem_names, problem_nodes[i]->nd_name); } reply_text(preq, PBSE_GMODERR, problem_names); free(problem_names); } else { reply_text(preq, PBSE_GMODERR, pbse_to_txt(PBSE_GMODERR)); } } if (problem_nodes) /*maybe problem malloc failed */ free(problem_nodes); if (problem_cnt) /*reply has already been sent */ { recompute_ntype_cnts(); return ; } } recompute_ntype_cnts(); reply_ack(preq); /*request completely successful*/ return; } /* END mgr_node_delete() */ /* * mgr_node_create - process request to create a node * * Creates pbsnode and calls mgr_set_node_attr to set * any associated node attributes also specified in the * request. */ void mgr_node_create( struct batch_request *preq) { int bad; svrattrl *plist; int rc; plist = (svrattrl *)GET_NEXT(preq->rq_ind.rq_manager.rq_attr); rc = create_pbs_node( preq->rq_ind.rq_manager.rq_objname, plist, preq->rq_perm, &bad); if (rc != 0) { switch (rc) { case PBSE_INTERNAL: case PBSE_SYSTEM: req_reject(rc, bad, preq, NULL, NULL); break; case PBSE_NOATTR: case PBSE_ATTRRO: case PBSE_MUTUALEX: case PBSE_BADNDATVAL: reply_badattr(rc, bad, plist, preq); break; default: req_reject(rc, 0, preq, NULL, NULL); break; } return; } mgr_log_attr( msg_man_set, plist, PBS_EVENTCLASS_NODE, preq->rq_ind.rq_manager.rq_objname); setup_notification(preq->rq_ind.rq_manager.rq_objname); /* set mechanism for notifying */ /* other nodes of new member */ if (update_nodes_file()) { /* if update fails now (odd) */ svr_chngNodesfile = 1; /* try it when server shutsdown */ } else { svr_chngNodesfile = 0; } reply_ack(preq); /* create request successful */ return; } /* * req_manager - the dispatch routine for a series of functions which * implement the Manager (qmgr) Batch Request * * The privilege of the requester is checked against the type of * the object and the operation to be performed on it. Then the * appropriate function is called to perform the operation. */ void req_manager( struct batch_request *preq) /* I */ { switch (preq->rq_ind.rq_manager.rq_cmd) { case MGR_CMD_CREATE: case MGR_CMD_DELETE: if ((preq->rq_perm & PERM_MANAGER) == 0) { req_reject(PBSE_PERM, 0, preq, NULL, NULL); return; } switch (preq->rq_ind.rq_manager.rq_objtype) { case MGR_OBJ_QUEUE: if (preq->rq_ind.rq_manager.rq_cmd == MGR_CMD_CREATE) mgr_queue_create(preq); else mgr_queue_delete(preq); break; case MGR_OBJ_NODE: if (preq->rq_ind.rq_manager.rq_cmd == MGR_CMD_CREATE) mgr_node_create(preq); else mgr_node_delete(preq); break; default: req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); return; break; } break; case MGR_CMD_SET: if ((preq->rq_perm & PERM_OPorMGR) == 0) { req_reject(PBSE_PERM, 0, preq, NULL, NULL); return; } switch (preq->rq_ind.rq_manager.rq_objtype) { case MGR_OBJ_SERVER: mgr_server_set(preq); break; case MGR_OBJ_QUEUE: mgr_queue_set(preq); break; case MGR_OBJ_NODE: mgr_node_set(preq); break; default: req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); break; } break; case MGR_CMD_UNSET: if ((preq->rq_perm & PERM_OPorMGR) == 0) { req_reject(PBSE_PERM, 0, preq, NULL, NULL); return; } switch (preq->rq_ind.rq_manager.rq_objtype) { case MGR_OBJ_SERVER: mgr_server_unset(preq); break; case MGR_OBJ_QUEUE: mgr_queue_unset(preq); break; #if 0 /* "unsetting" nodes isn't currently supported */ case MGR_OBJ_NODE: mgr_node_unset(preq); break; #endif /* 0 */ default: req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); break; } break; default: /* batch_request specified an invalid command */ req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); break; } /* END switch() */ return; } /* END req_manager() */ /* * manager_oper_chk - check the @host part of a manager or operator acl * entry to insure it is fully qualified. This is to prevent * input errors when setting the list. * This is the at_action() routine for the server attributes * "managers" and "operators" */ int manager_oper_chk( attribute *pattr, void *pobject, int actmode) { char *entry; int err = 0; int i; struct array_strings *pstr; if (actmode == ATR_ACTION_FREE) { return(0); /* no checking on free */ } pstr = pattr->at_val.at_arst; if (pstr == NULL) { return(0); } for (i = 0;i < pstr->as_usedptr;++i) { entry = strchr(pstr->as_string[i], (int)'@'); if (entry == NULL) { err = PBSE_BADHOST; break; } entry++; /* point after the '@' */ if (hostname_check(entry) == FAILURE) { if (actmode == ATR_ACTION_RECOV) { sprintf(log_buffer, "bad entry in acl: %s", pstr->as_string[i]); log_err(PBSE_BADACLHOST, "manager_oper_chk", log_buffer); } else { sprintf(log_buffer, "bad entry in acl: %s", pstr->as_string[i]); log_err(PBSE_BADACLHOST, "manager_oper_chk", log_buffer); err = PBSE_BADACLHOST; } } } return(err); } /* END manager_oper_chk() */ /* * servername_chk - insure it is fully qualified. * This is the at_action() routine for the server attribute * "server_name" */ int servername_chk( attribute *pattr, /* I */ void *pobject, /* I */ int actmode) /* I */ { int err = 0; char hostname[PBS_MAXHOSTNAME + 1]; char *pstr; extern char server_name[]; if (actmode == ATR_ACTION_FREE) { if ((gethostname(hostname, PBS_MAXHOSTNAME) == -1) || (get_fullhostname(hostname, hostname, PBS_MAXHOSTNAME, NULL) == -1)) { return(PBSE_BADHOST); } strcpy(server_name, hostname); return(0); } pstr = pattr->at_val.at_str; if (pstr == NULL) { return(PBSE_BADHOST); } /* must be fully qualified host */ if (get_fullhostname(pstr, hostname, PBS_MAXHOSTNAME, NULL) || strncmp(pstr, hostname, PBS_MAXHOSTNAME)) { if (actmode == ATR_ACTION_RECOV) { sprintf(log_buffer, "bad servername: %s", pstr); log_err(PBSE_BADHOST, "servername_chk", log_buffer); } else { err = PBSE_BADHOST; } } else { strcpy(server_name, hostname); } return(err); } /* END server_name_chk() */ /* * extra_resc_chk() called when extra_resc server attribute is changed * It's purpose is to re-init the resource definitions by calling * init_resc_defs(). Unfortunately, it gets call before the * change is actually committed; so we setup a work task to call * it async asap. */ void on_extra_resc( struct work_task *ptask) { init_resc_defs(); } int extra_resc_chk( attribute *pattr, /* I */ void *pobject, /* I */ int actmode) /* I */ { struct work_task *ptask; /* Is there anything to validate? Maybe check for all alphanum? */ /* the new resource is at pattr->at_val.at_str */ ptask = set_task(WORK_Immed, 0, on_extra_resc, NULL); return (ptask == NULL); } /* * free_extraresc() makes sure that the init_resc_defs() is called after * the list has changed by 'unset'. */ void free_extraresc( struct attribute *attr) { set_task(WORK_Immed, 0, on_extra_resc, NULL); free_arst(attr); } /* * disallowed_types_chk - * This is the at_action() routine for the queue disallowed_type attribute */ int disallowed_types_chk( attribute *pattr, void *pobject, int actmode) { int i; int j; int found; struct array_strings *pstr; extern char *array_disallowed_types[]; if (actmode == ATR_ACTION_FREE) { return(0); /* no checking on free or DECR */ } pstr = pattr->at_val.at_arst; if (pstr == NULL) { return(0); } for (i = 0;i < pstr->as_usedptr;i++) { /* first check for dupe */ for (j = 0; j < pstr->as_usedptr;j++) { if (i == j) continue; if (strcmp(pstr->as_string[i], pstr->as_string[j]) == 0) { return PBSE_DUPLIST; } } found = FALSE; for (j = 0; (strcmp(array_disallowed_types[j], "_END_") != 0); j++) { if (strcmp(pstr->as_string[i], array_disallowed_types[j]) == 0) { found = TRUE; break; } } if (found == FALSE) { return(PBSE_BADDISALLOWTYPE); } } return(0); } /* END disallowed_types_chk() */ static int mgr_long_action_helper( attribute *pattr, int actmode, long minimum, long maximum) { int err = PBSE_NONE; if (pattr->at_val.at_long < minimum) { err = PBSE_BADATVAL; } if (pattr->at_val.at_long > maximum) { err = PBSE_EXLIMIT; } if (err && (actmode == ATR_ACTION_RECOV)) { pattr->at_val.at_long = maximum; err = PBSE_NONE; } return(PBSE_NONE); } /* END mgr_long_action_helper() */ /* * schiter_chk - make sure values are sane * This is the at_action() routine for the server attribute * "scheduler_iteration" */ int schiter_chk( attribute *pattr, void *pobject, int actmode) { return(mgr_long_action_helper(pattr, actmode, 1, PBS_SCHEDULE_CYCLE)); } /* END schiter_chk() */ /* nextjobnum_action - makes sure value is sane (>=0) Note that there must be special code in svr_recov to prevent the attribute value from clobbering the internal counter server.sv_qs.sv_jobidnumber. */ int nextjobnum_chk( attribute *pattr, void *pobject, int actmode) { if (pattr->at_val.at_long > PBS_SEQNUMTOP) { return(PBSE_EXLIMIT); } else if (pattr->at_val.at_long >= 0) { return(PBSE_NONE); } else { return(PBSE_BADATVAL); } } int set_nextjobnum( struct attribute *attr, struct attribute *new, enum batch_op op) { /* this is almost identical to set_l, but we need to grab the current value of server.sv_qs.sv_jobidnumber before we INCR/DECR the value of attr->at_val.at_long. In fact, it probably should be moved to Libattr/ */ /* The special handling of INCR is to allow setting of a job number range. * If the job numbers are already in the range, it does not alter the number. * Otherwise, if the number is in the default range, it sets it to the new range. */ switch (op) { case SET: attr->at_val.at_long = new->at_val.at_long; break; /* Code in Moab depends on this, do not change until the Moab code is fixed. */ case INCR: attr->at_val.at_long = MAX(server.sv_qs.sv_jobidnumber, new->at_val.at_long); /*case INCR: attr->at_val.at_long += new->at_val.at_long;*/ break; case DECR: attr->at_val.at_long -= new->at_val.at_long; break; default: return(PBSE_SYSTEM); } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; server.sv_qs.sv_jobidnumber = attr->at_val.at_long; svr_save(&server, SVR_SAVE_QUICK); return 0; } /* END req_manager.c */ torque-2.4.16/src/server/stat_job.c0000664000113300011330000002526711477227465014135 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ /* * stat_job.c * * Functions which support the Status Job Batch Request. * * Included funtions are: * status_job() * status_attrib() */ #include #include #include "libpbs.h" #include #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "server.h" #include "queue.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "work_task.h" #include "pbs_error.h" #include "svrfunc.h" #include "resource.h" extern int svr_authorize_jobreq A_((struct batch_request *, job *)); int status_attrib A_((svrattrl *, attribute_def *, attribute *, int, int, tlist_head *, int *, int)); /* Global Data Items: */ extern attribute_def job_attr_def[]; extern int resc_access_perm; /* see encode_resc() in attr_fn_resc.c */ extern struct server server; extern time_t time_now; /** * status_job - Build the status reply for a single job. * * @see req_stat_job_step2() - parent * @see status_attrib() - child */ int status_job( job *pjob, /* ptr to job to status */ struct batch_request *preq, svrattrl *pal, /* specific attributes to status */ tlist_head *pstathd, /* RETURN: head of list to append status to */ int *bad) /* RETURN: index of first bad attribute */ { struct brp_status *pstat; int IsOwner = 0; /* see if the client is authorized to status this job */ if (svr_authorize_jobreq(preq, pjob) == 0) IsOwner = 1; if (!server.sv_attr[(int)SRV_ATR_query_others].at_val.at_long) { if (IsOwner == 0) { return(PBSE_PERM); } } /* allocate reply structure and fill in header portion */ pstat = (struct brp_status *)malloc(sizeof(struct brp_status)); if (pstat == NULL) { return(PBSE_SYSTEM); } CLEAR_LINK(pstat->brp_stlink); pstat->brp_objtype = MGR_OBJ_JOB; strcpy(pstat->brp_objname, pjob->ji_qs.ji_jobid); CLEAR_HEAD(pstat->brp_attr); append_link(pstathd, &pstat->brp_stlink, pstat); /* add attributes to the status reply */ *bad = 0; if (status_attrib( pal, job_attr_def, pjob->ji_wattr, JOB_ATR_LAST, preq->rq_perm, &pstat->brp_attr, bad, IsOwner)) { return(PBSE_NOATTR); } return (0); } /* END status_job() */ /** * status_attrib - add each requested or all attributes to the status reply * * Returns: 0 on success * -1 on error (bad attribute), "bad" set to ordinal of attribute * * @see status_job() - parent * @see find_attr() - child * @see *->at_encode() - child */ int status_attrib( svrattrl *pal, /* I */ attribute_def *padef, attribute *pattr, int limit, int priv, tlist_head *phead, int *bad, int IsOwner) /* 0 == FALSE, 1 == TRUE */ { int index; int nth = 0; priv &= ATR_DFLAG_RDACC; /* user-client privilege */ resc_access_perm = priv; /* pass privilege to encode_resc() */ /* for each attribute asked for or for all attributes, add to reply */ if (pal != NULL) { /* client specified certain attributes */ while (pal != NULL) { ++nth; index = find_attr(padef, pal->al_name, limit); if (index < 0) { *bad = nth; /* FAILURE */ return(-1); } if ((padef + index)->at_flags & priv) { if (!(((padef + index)->at_flags & ATR_DFLAG_PRIVR) && (IsOwner == 0))) { (padef + index)->at_encode( pattr + index, phead, (padef + index)->at_name, NULL, ATR_ENCODE_CLIENT); } } pal = (svrattrl *)GET_NEXT(pal->al_link); } /* SUCCESS */ return(0); } /* END if (pal != NULL) */ /* attrlist not specified, return all readable attributes */ for (index = 0;index < limit;index++) { if (((padef + index)->at_flags & priv) && !((padef + index)->at_flags & ATR_DFLAG_NOSTAT)) { if (!(((padef + index)->at_flags & ATR_DFLAG_PRIVR) && (IsOwner == 0))) { (padef + index)->at_encode( pattr + index, phead, (padef + index)->at_name, NULL, ATR_ENCODE_CLIENT); /* add walltime remaining if started */ if ((index == JOB_ATR_start_time) && ((pattr + index)->at_flags & ATR_VFLAG_SET)) { /* encode walltime remaining, this is custom because walltime * remaining isn't an attribute */ int len; char buf[MAXPATHLEN]; char *pname; svrattrl *pal; resource *pres; int found = 0; unsigned long remaining; unsigned long upperBound; if (((pattr + JOB_ATR_resource)->at_val.at_list.ll_next != NULL) && ((pattr + JOB_ATR_resource)->at_flags & ATR_VFLAG_SET)) { pres = (resource *)GET_NEXT((pattr + JOB_ATR_resource)->at_val.at_list); if ((pattr + JOB_ATR_comp_time)->at_flags & ATR_VFLAG_SET) { upperBound = (pattr + JOB_ATR_comp_time)->at_val.at_long; } else { upperBound = (unsigned long)time_now; } /* find the walltime resource */ for (;pres != NULL;pres = (resource *)GET_NEXT(pres->rs_link)) { pname = pres->rs_defin->rs_name; if (strcmp(pname, "walltime") == 0) { /* found walltime */ unsigned long value = (unsigned long)pres->rs_value.at_val.at_long; if (((pattr+index)->at_flags & ATR_VFLAG_SET) != FALSE) { remaining = value - (upperBound - (pattr + index)->at_val.at_long); } else { remaining = value; } found = TRUE; break; } } } if (found == TRUE) { snprintf(buf,sizeof(buf),"%lu",remaining); len = strlen(buf) + 1; pal = attrlist_create("Walltime","Remaining",len); if (pal != NULL) { memcpy(pal->al_value,buf,len); pal->al_flags = ATR_VFLAG_SET; append_link(phead,&pal->al_link,pal); } } } /* END if (index == JOB_ATR_start_time) */ } } } /* END for (index) */ /* SUCCESS */ return(0); } /* END status_attrib() */ /* END stat_job.c */ torque-2.4.16/src/server/req_deletearray.c0000664000113300011330000002152511272401245015450 00000000000000#include /* the master config generated by configure */ #include #include #include #include #include "libpbs.h" #include "server_limits.h" #include "list_link.h" #include "work_task.h" #include "attribute.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "queue.h" #include "pbs_error.h" #include "acct.h" #include "log.h" #include "svrfunc.h" #include "array.h" extern int svr_authorize_req(struct batch_request *preq, char *owner, char *submit_host); extern void job_purge(job *pjob); extern struct work_task *apply_job_delete_nanny(struct job *, int); extern int has_job_delete_nanny(struct job *); extern void remove_stagein(job *pjob); extern void change_restart_comment_if_needed A_((struct job *)); extern char *msg_unkarrayid; extern char *msg_permlog; extern time_t time_now; static void post_delete(struct work_task *pwt); void array_delete_wt(struct work_task *ptask); void req_deletearray(struct batch_request *preq) { job_array *pa; job *pjob; job *next; struct work_task *pwtold; struct work_task *ptask; struct work_task *pwtnew; int num_skipped; char owner[PBS_MAXUSER + 1]; pa = get_array(preq->rq_ind.rq_delete.rq_objname); num_skipped = 0; if (pa == NULL) { reply_ack(preq); return; } /* check authorization */ get_jobowner(pa->ai_qs.owner, owner); if (svr_authorize_req(preq, owner, pa->ai_qs.submit_host) == -1) { sprintf(log_buffer, msg_permlog, preq->rq_type, "Array", preq->rq_ind.rq_delete.rq_objname, preq->rq_user, preq->rq_host); log_event( PBSEVENT_SECURITY, PBS_EVENTCLASS_JOB, preq->rq_ind.rq_delete.rq_objname, log_buffer); req_reject(PBSE_PERM, 0, preq, NULL, "operation not permitted"); return; } /* iterate over list of jobs and delete each one */ pjob = (job*)GET_NEXT(pa->array_alljobs); while (pjob != NULL) { /* grab the pointer to the next job now so when we call job_abt * on the current job we will still have the pointer to the next */ next = (job*)GET_NEXT(pjob->ji_arrayjobs); if (pjob->ji_qs.ji_state >= JOB_STATE_EXITING) { /* invalid state for request, skip */ pjob = next; continue; } if (pjob->ji_qs.ji_state == JOB_STATE_TRANSIT) { /* * Find pid of router from existing work task entry, * then establish another work task on same child. * Next, signal the router and wait for its completion; */ pwtold = (struct work_task *)GET_NEXT(pjob->ji_svrtask); while (pwtold != NULL) { if ((pwtold->wt_type == WORK_Deferred_Child) || (pwtold->wt_type == WORK_Deferred_Cmp)) { kill((pid_t)pwtold->wt_event, SIGTERM); pjob->ji_qs.ji_substate = JOB_SUBSTATE_ABORT; } pwtold = (struct work_task *)GET_NEXT(pwtold->wt_linkobj); } num_skipped++; continue; } /* END if (pjob->ji_qs.ji_state == JOB_SUBSTATE_TRANSIT) */ else if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) { /* we'll wait for the mom to get this job, then delete it */ num_skipped++; } /* END if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) */ else if (pjob->ji_qs.ji_state == JOB_STATE_RUNNING) { /* set up nanny */ if (!has_job_delete_nanny(pjob)) { apply_job_delete_nanny(pjob, time_now + 60); /* need to issue a signal to the mom, but we don't want to sent an ack to the * client when the mom replies */ issue_signal(pjob, "SIGTERM", post_delete, NULL); } if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) != 0) { /* job has restart file at mom, change restart comment if failed */ change_restart_comment_if_needed(pjob); } pjob = next; continue; } /* END if (pjob->ji_qs.ji_state == JOB_STATE_RUNNING) */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) != 0) { /* job has restart file at mom, change restart comment if failed */ change_restart_comment_if_needed(pjob); /* job has restart file at mom, do end job processing */ svr_setjobstate(pjob, JOB_STATE_EXITING, JOB_SUBSTATE_EXITING); pjob->ji_momhandle = -1; /* force new connection */ pwtnew = set_task(WORK_Immed, 0, on_job_exit, (void *)pjob); if (pwtnew) { append_link(&pjob->ji_svrtask, &pwtnew->wt_linkobj, pwtnew); } } else if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_StagedIn) != 0) { /* job has staged-in file, should remove them */ remove_stagein(pjob); job_abt(&pjob, NULL); } else { /* * the job is not transitting (though it may have been) and * is not running, so put in into a complete state. */ struct work_task *ptask; struct pbs_queue *pque; int KeepSeconds = 0; svr_setjobstate(pjob, JOB_STATE_COMPLETE, JOB_SUBSTATE_COMPLETE); if ((pque = pjob->ji_qhdr) && (pque != NULL)) { pque->qu_numcompleted++; } KeepSeconds = attr_ifelse_long( &pque->qu_attr[(int)QE_ATR_KeepCompleted], &server.sv_attr[(int)SRV_ATR_KeepCompleted], 0); ptask = set_task(WORK_Timed, time_now + KeepSeconds, on_job_exit, pjob); if (ptask != NULL) { append_link(&pjob->ji_svrtask, &ptask->wt_linkobj, ptask); } } pjob = next; } if ((pa = get_array(preq->rq_ind.rq_delete.rq_objname)) != NULL) { /* some jobs were not deleted. They must have been running or had JOB_SUBSTATE_TRANSIT */ if (num_skipped != 0) { ptask = set_task(WORK_Timed, time_now + 2, array_delete_wt, preq); return; } } /* now that the whole array is deleted, we should mail the user if necessary */ reply_ack(preq); return; } static void post_delete(struct work_task *pwt) { /* no op - do not reply to client */ } /* if jobs were in the prerun state , this attempts to keep track of if it was called continuously on the same array for over 10 seconds. If that is the case then it deletes prerun jobs no matter what. if it has been less than 10 seconds or if there are jobs in other statest then req_deletearray is called again */ void array_delete_wt(struct work_task *ptask) { struct batch_request *preq; job_array *pa; /*struct work_task *pnew_task;*/ struct work_task *pwtnew; static int last_check = 0; static char *last_id = NULL; preq = ptask->wt_parm1; pa = get_array(preq->rq_ind.rq_delete.rq_objname); if (pa == NULL) { /* jobs must have exited already */ reply_ack(preq); last_check = 0; free(last_id); last_id = NULL; return; } if (last_id == NULL) { last_id = strdup(preq->rq_ind.rq_delete.rq_objname); last_check = time_now; } else if (strcmp(last_id, preq->rq_ind.rq_delete.rq_objname) != 0) { last_check = time_now; free(last_id); last_id = strdup(preq->rq_ind.rq_delete.rq_objname); } else if (time_now - last_check > 10) { int num_jobs; int num_prerun; job *pjob; job *next; num_jobs = 0; num_prerun = 0; pjob = (job*)GET_NEXT(pa->array_alljobs); while (pjob != NULL) { num_jobs++; /* grab the pointer to the next job now so when we call job_abt * on the current job we will still have the pointer to the next */ next = (job*)GET_NEXT(pjob->ji_arrayjobs); if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) { num_prerun++; /* mom still hasn't gotten job?? delete anyway */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) != 0) { /* job has restart file at mom, do end job processing */ change_restart_comment_if_needed(pjob); svr_setjobstate(pjob, JOB_STATE_EXITING, JOB_SUBSTATE_EXITING); pjob->ji_momhandle = -1; /* force new connection */ pwtnew = set_task(WORK_Immed, 0, on_job_exit, (void *)pjob); if (pwtnew) { append_link(&pjob->ji_svrtask, &pwtnew->wt_linkobj, pwtnew); } } else if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_StagedIn) != 0) { /* job has staged-in file, should remove them */ remove_stagein(pjob); job_abt(&pjob, NULL); } else { job_abt(&pjob, NULL); } } pjob = next; } if (num_jobs == num_prerun) { reply_ack(preq); free(last_id); last_id = NULL; return; } } req_deletearray(preq); } torque-2.4.16/src/server/svr_jobfunc.c0000664000113300011330000017216111605403054014623 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * svr_jobfunc.c - contains server functions dealing with jobs * * Included public functions are: * svr_enquejob() - place job in a queue * svr_dequejob() - remove job from queue * svr_setjobstate() - set the state/substate of a job * svr_evaljobstate() - evaluate the state of a job based on attributes * chk_resc_limits() - check job resources vs queue/server limits * svr_chkque() - check if job can enter queue * job_set_wait() - set event for when job's wait time ends * get_variable() - get value of a single environ variable of a job * prefix_std_file() - build the fully prefixed default name for std e/o * get_jobowner() - get job owner name without @host suffix * set_resc_deflt() - set unspecified resource_limit to default values * set_statechar() - set the job state attribute character value * * Private functions * chk_svr_resc_limit() - check job requirements againt queue/server limits * default_std() - make the default name for standard out/error * eval_checkpoint() - insure job checkpoint .ge. queues min. time * set_deflt_resc() - set unspecified resource_limit to default values * job_wait_over() - event handler for job_set_wait() */ #include /* the master config generated by configure */ #include "pbs_ifl.h" #include #include #include #include #include #include #include #include #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "server.h" #include "queue.h" #include "pbs_job.h" #include "work_task.h" #include "pbs_error.h" #include "log.h" #include "acct.h" #include "svrfunc.h" #include "sched_cmds.h" #include "pbs_proto.h" /* Private Functions */ static void default_std A_((job *, int key, char * to)); static void eval_checkpoint A_((attribute *j, attribute *q)); /* Global Data Items: */ extern struct server server; extern tlist_head svr_alljobs; extern tlist_head svr_jobarrays; extern char *msg_badwait; /* error message */ extern char *msg_daemonname; extern char *pbs_o_host; extern char server_name[]; extern tlist_head svr_queues; extern int comp_resc_lt; extern int comp_resc_gt; extern int svr_do_schedule; extern int listener_command; extern int LOGLEVEL; extern time_t time_now; extern int DEBUGMODE; int SvrNodeCt = 0; /* cfg nodes or num nodes specified via resources_available */ /* External Functions */ extern int node_avail_complex(char *, int *, int *, int *, int *); /* Private Functions */ #ifndef NDEBUG static void correct_ct A_((pbs_queue *)); #endif /* NDEBUG */ /* sync w/#define JOB_STATE_XXX */ const char *PJobState[] = { "TRANSIT", "QUEUED", "HELD", "WAITING", "RUNNING", "EXITING", "COMPLETE", NULL }; /* sync w/#define JOB_SUBSTATE_XXX, PJobSubState in mom_main.c */ const char *PJobSubState[] = { "TRANSIN", /* Transit in, wait for commit */ "TRANSICM", /* Transit in, wait for commit */ "TRNOUT", /* transiting job outbound */ "TRNOUTCM", /* transiting outbound, rdy to commit */ "SUBSTATE04", "SUBSTATE05", "SUBSTATE06", "SUBSTATE07", "SUBSTATE08", "SUBSTATE09", "QUEUED", /* job queued and ready for selection */ "PRESTAGEIN", /* job queued, has files to stage in */ "SUBSTATE12", "SYNCRES", /* job waiting on sync start ready */ "STAGEIN", /* job staging in files then wait */ "STAGEGO", /* job staging in files and then run */ "STAGECMP", /* job stage in complete */ "SUBSTATE17", "SUBSTATE18", "SUBSTATE19", "HELD", /* job held - user or operator */ "SYNCHOLD", /* job held - waiting on sync regist */ "DEPNHOLD", /* job held - waiting on dependency */ "SUBSTATE23", "SUBSTATE24", "SUBSTATE25", "SUBSTATE26", "SUBSTATE27", "SUBSTATE28", "SUBSTATE29", "WAITING", /* job waiting on execution time */ "SUBSTATE31", "SUBSTATE32", "SUBSTATE33", "SUBSTATE34", "SUBSTATE35", "SUBSTATE36", "STAGEFAIL", /* job held - file stage in failed */ "SUBSTATE38", "SUBSTATE39", "PRERUN", /* job sent to MOM to run */ "STARTING", "RUNNING", /* job running */ "SUSPEND", /* job suspended, CRAY only */ "SUBSTATE44", "SUBSTATE45", "SUBSTATE46", "SUBSTATE47", "SUBSTATE48", "SUBSTATE49", "EXITING", /* start of job exiting processing */ "STAGEOUT", /* job staging out (other) files */ "STAGEDEL", /* job deleting staged out files */ "EXITED", /* job exit processing completed */ "ABORT", /* job is being aborted by server */ "SUBSTATE55", "SUBSTATE56", "SUBSTATE57", "OBIT", /* (MOM) job obit notice sent */ "COMPLETE", "RERUN", /* job is rerun, recover output stage */ "RERUN1", /* job is rerun, stageout phase */ "RERUN2", /* job is rerun, delete files stage */ "RERUN3", /* job is rerun, mom delete job */ "SUBSTATE64", "SUBSTATE65", "SUBSTATE66", "SUBSTATE67", "SUBSTATE68", "SUBSTATE69", "RETURNSTD", /* returning stderr/stdout files to server spool */ NULL }; /* * svr_enquejob() - enqueue job into specified queue */ int svr_enquejob( job *pjob) /* I */ { attribute *pattrjb; attribute_def *pdef; job *pjcur; pbs_queue *pque; int rc; /* make sure queue is still there, there exists a small window ... */ pque = find_queuebyname(pjob->ji_qs.ji_queue); if (pque == NULL) { return(PBSE_UNKQUE); } /* add job to server's 'all job' list and update server counts */ #ifndef NDEBUG sprintf(log_buffer, "enqueuing into %s, state %x hop %ld", pque->qu_qs.qu_name, pjob->ji_qs.ji_state, pjob->ji_wattr[(int)JOB_ATR_hopcount].at_val.at_long); log_event( PBSEVENT_DEBUG2, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); #endif /* NDEBUG */ pjcur = (job *)GET_PRIOR(svr_alljobs); while (pjcur != NULL) { if ((unsigned long)pjob->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long >= (unsigned long)pjcur->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long) break; pjcur = (job *)GET_PRIOR(pjcur->ji_alljobs); } /* END while (pjcur != NULL) */ if (pjcur == 0) { /* link first in server's list */ insert_link(&svr_alljobs, &pjob->ji_alljobs, pjob, LINK_INSET_AFTER); } else { /* link after 'current' job in server's list */ insert_link( &pjcur->ji_alljobs, &pjob->ji_alljobs, pjob, LINK_INSET_AFTER); } server.sv_qs.sv_numjobs++; server.sv_jobstates[pjob->ji_qs.ji_state]++; /* place into queue in order of queue rank starting at end */ pjob->ji_qhdr = pque; pjcur = (job *)GET_PRIOR(pque->qu_jobs); while (pjcur != NULL) { if ((unsigned long)pjob->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long >= (unsigned long)pjcur->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long) break; pjcur = (job *)GET_PRIOR(pjcur->ji_jobque); } if (pjcur == NULL) { /* link first in list */ insert_link(&pque->qu_jobs, &pjob->ji_jobque, pjob, LINK_INSET_AFTER); } else { /* link after 'current' job in list */ insert_link(&pjcur->ji_jobque, &pjob->ji_jobque, pjob, LINK_INSET_AFTER); } /* update counts: queue and queue by state */ pque->qu_numjobs++; pque->qu_njstate[pjob->ji_qs.ji_state]++; /* update the current location and type attribute */ pdef = &job_attr_def[(int)JOB_ATR_in_queue]; pattrjb = &pjob->ji_wattr[(int)JOB_ATR_in_queue]; pdef->at_free(pattrjb); pdef->at_decode(pattrjb, NULL, NULL, pque->qu_qs.qu_name); pjob->ji_wattr[(int)JOB_ATR_queuetype].at_val.at_char = *pque->qu_attr[(int)QA_ATR_QType].at_val.at_str; pjob->ji_wattr[(int)JOB_ATR_queuetype].at_flags |= ATR_VFLAG_SET; if ((pjob->ji_wattr[(int)JOB_ATR_qtime].at_flags & ATR_VFLAG_SET) == 0) { pjob->ji_wattr[(int)JOB_ATR_qtime].at_val.at_long = time_now; pjob->ji_wattr[(int)JOB_ATR_qtime].at_flags |= ATR_VFLAG_SET; /* issue enqueued accounting record */ sprintf(log_buffer, "queue=%s", pque->qu_qs.qu_name); account_record(PBS_ACCT_QUEUE, pjob, log_buffer); } /* * set any "unspecified" resources which have default values, * first with queue defaults, then with server defaults */ set_resc_deflt(pjob, NULL); /* See if we need to do anything special based on type of queue */ if (pque->qu_qs.qu_type == QTYPE_Execution) { /* set union to "EXEC" and clear mom's address */ if (pjob->ji_qs.ji_un_type != JOB_UNION_TYPE_EXEC) { pjob->ji_qs.ji_un_type = JOB_UNION_TYPE_EXEC; pjob->ji_qs.ji_un.ji_exect.ji_momaddr = 0; pjob->ji_qs.ji_un.ji_exect.ji_exitstat = 0; } /* check the job checkpoint against the queue's min */ eval_checkpoint( &pjob->ji_wattr[(int)JOB_ATR_checkpoint], &pque->qu_attr[(int)QE_ATR_checkpoint_min]); /* do anything needed doing regarding job dependencies */ if (pjob->ji_wattr[(int)JOB_ATR_depend].at_flags & ATR_VFLAG_SET) { if ((rc = depend_on_que(& pjob->ji_wattr[(int)JOB_ATR_depend], pjob, ATR_ACTION_NOOP)) != 0) { return(rc); } } /* set eligible time */ if (((pjob->ji_wattr[(int)JOB_ATR_etime].at_flags & ATR_VFLAG_SET) == 0) && (pjob->ji_qs.ji_state == JOB_STATE_QUEUED)) { pjob->ji_wattr[(int)JOB_ATR_etime].at_val.at_long = time_now; pjob->ji_wattr[(int)JOB_ATR_etime].at_flags |= ATR_VFLAG_SET; } /* notify the scheduler we have a new job */ svr_do_schedule = SCH_SCHEDULE_NEW; listener_command = SCH_SCHEDULE_NEW; } else if (pque->qu_qs.qu_type == QTYPE_RoutePush) { /* start attempts to route job */ pjob->ji_qs.ji_un_type = JOB_UNION_TYPE_ROUTE; pjob->ji_qs.ji_un.ji_routet.ji_quetime = time_now; pjob->ji_qs.ji_un.ji_routet.ji_rteretry = 0; } return(0); } /* END svr_enquejob() */ /* * svr_dequejob() - remove job from whatever queue its in and reduce counts */ void svr_dequejob( job *pjob) { int bad_ct = 0; attribute *pattr; pbs_queue *pque; resource *presc; /* remove job from server's all job list and reduce server counts */ if (is_linked(&svr_alljobs, &pjob->ji_alljobs)) { delete_link(&pjob->ji_alljobs); if (--server.sv_qs.sv_numjobs < 0) bad_ct = 1; if (--server.sv_jobstates[pjob->ji_qs.ji_state] < 0) bad_ct = 1; } if ((pque = pjob->ji_qhdr) != (pbs_queue *)0) { if (is_linked(&pque->qu_jobs, &pjob->ji_jobque)) { delete_link(&pjob->ji_jobque); if (--pque->qu_numjobs < 0) bad_ct = 1; if (--pque->qu_njstate[pjob->ji_qs.ji_state] < 0) bad_ct = 1; if (pjob->ji_qs.ji_state == JOB_STATE_COMPLETE) if (--pque->qu_numcompleted < 0) bad_ct = 1; } pjob->ji_qhdr = (pbs_queue *)0; } #ifndef NDEBUG sprintf(log_buffer, "dequeuing from %s, state %s", pque ? pque->qu_qs.qu_name : "unknown queue", PJobState[pjob->ji_qs.ji_state]); log_event( PBSEVENT_DEBUG2, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); if (bad_ct) /* state counts are all messed up */ correct_ct(pque); #endif /* NDEBUG */ pjob->ji_wattr[(int)JOB_ATR_qtime].at_flags &= ~ATR_VFLAG_SET; /* clear any default resource values. */ pattr = &pjob->ji_wattr[(int)JOB_ATR_resource]; if (pattr->at_flags & ATR_VFLAG_SET) { presc = (resource *)GET_NEXT(pattr->at_val.at_list); while (presc != NULL) { if (presc->rs_value.at_flags & ATR_VFLAG_DEFLT) presc->rs_defin->rs_free(&presc->rs_value); presc = (resource *)GET_NEXT(presc->rs_link); } } /* notify scheduler a job has been removed */ svr_do_schedule = SCH_SCHEDULE_TERM; listener_command = SCH_SCHEDULE_TERM; return; } /* END svr_dequejob() */ /* * svr_setjobstate - set the job state, update the server/queue state counts, * and save the job */ int svr_setjobstate( job *pjob, /* I (modified) */ int newstate, /* I */ int newsubstate) /* I */ { int changed = 0; int oldstate; pbs_queue *pque = pjob->ji_qhdr; if (LOGLEVEL >= 2) { sprintf(log_buffer, "svr_setjobstate: setting job %s state from %s-%s to %s-%s (%d-%d)\n", (pjob->ji_qs.ji_jobid != NULL) ? pjob->ji_qs.ji_jobid : "", PJobState[pjob->ji_qs.ji_state], PJobSubState[pjob->ji_qs.ji_substate], PJobState[newstate], PJobSubState[newsubstate], newstate, newsubstate); log_event(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); } /* * if its is a new job, then don't update counts, svr_enquejob() will * take care of that, also req_commit() will see that the job is saved. */ if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_TRANSICM) { /* Not a new job, update the counts and save if needed */ if (pjob->ji_qs.ji_substate != newsubstate) changed = 1; /* if the state is changing, also update the state counts */ oldstate = pjob->ji_qs.ji_state; if (oldstate != newstate) { changed = 1; server.sv_jobstates[oldstate]--; server.sv_jobstates[newstate]++; if (pque != (pbs_queue *)0) { pque->qu_njstate[oldstate]--; pque->qu_njstate[newstate]++; /* if execution queue, and eligibility to run has improved, */ /* notify the scheduler */ if ((pque->qu_qs.qu_type == QTYPE_Execution) && (newstate == JOB_STATE_QUEUED)) { svr_do_schedule = SCH_SCHEDULE_NEW; listener_command = SCH_SCHEDULE_NEW; if ((pjob->ji_wattr[(int)JOB_ATR_etime].at_flags & ATR_VFLAG_SET) == 0) { pjob->ji_wattr[(int)JOB_ATR_etime].at_val.at_long = time_now; pjob->ji_wattr[(int)JOB_ATR_etime].at_flags |= ATR_VFLAG_SET; } } else if ((newstate == JOB_STATE_HELD) || (newstate == JOB_STATE_WAITING)) { /* on hold or wait, clear etime */ job_attr_def[(int)JOB_ATR_etime].at_free( &pjob->ji_wattr[(int)JOB_ATR_etime]); } } } } /* END if (pjob->ji_qs.ji_substate != JOB_SUBSTATE_TRANSICM) */ /* set the states accordingly */ pjob->ji_qs.ji_state = newstate; pjob->ji_qs.ji_substate = newsubstate; pjob->ji_wattr[(int)JOB_ATR_substate].at_val.at_long = newsubstate; set_statechar(pjob); /* update the job file */ if (pjob->ji_modified) { return(job_save(pjob, SAVEJOB_FULL)); } if (changed) { return(job_save(pjob, SAVEJOB_QUICK)); } return(0); } /* END svr_setjobstate() */ /* * svr_evaljobstate - evaluate and return the job state and substate * according to the the values of the hold, execution time, and * dependency attributes. This is typically called after the job has been * enqueued or the (hold, execution-time) attributes have been modified. */ void svr_evaljobstate( job *pjob, int *newstate, /* O recommended new state for job */ int *newsub, /* O recommended new substate for job */ int forceeval) { if ((forceeval == 0) && ((pjob->ji_qs.ji_state == JOB_STATE_RUNNING) || (pjob->ji_qs.ji_state == JOB_STATE_TRANSIT))) { *newstate = pjob->ji_qs.ji_state; /* leave as is */ *newsub = pjob->ji_qs.ji_substate; } else if (pjob->ji_wattr[(int)JOB_ATR_hold].at_val.at_long) { *newstate = JOB_STATE_HELD; /* is the hold due to a dependency? */ if ((pjob->ji_qs.ji_substate == JOB_SUBSTATE_SYNCHOLD) || (pjob->ji_qs.ji_substate == JOB_SUBSTATE_DEPNHOLD)) *newsub = pjob->ji_qs.ji_substate; /* keep it */ else *newsub = JOB_SUBSTATE_HELD; } else if (pjob->ji_wattr[(int)JOB_ATR_exectime].at_val.at_long > (long)time_now) { *newstate = JOB_STATE_WAITING; *newsub = JOB_SUBSTATE_WAITING; } else if (pjob->ji_wattr[(int)JOB_ATR_stagein].at_flags & ATR_VFLAG_SET) { *newstate = JOB_STATE_QUEUED; if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_StagedIn) { *newsub = JOB_SUBSTATE_STAGECMP; } else { *newsub = JOB_SUBSTATE_PRESTAGEIN; } } else { *newstate = JOB_STATE_QUEUED; *newsub = JOB_SUBSTATE_QUEUED; } return; } /* END svr_evaljobstate() */ /* * get_variable - get the value associated with a specified environment * variable of a job * * Returns a pointer to the start of the value or NULL if the variable * is not found in the variable_list attribute. */ char *get_variable( job *pjob, /* I */ char *variable) /* I */ { char *pc; pc = arst_string( variable, &pjob->ji_wattr[(int)JOB_ATR_variables]); if (pc) { if ((pc = strchr(pc, (int)'=')) != NULL) pc++; } return(pc); } /* END get_variable() */ /* * get_resource - find a resource (value) entry in the queue or server list * * Returns: pointer to struct resource or NULL */ resource *get_resource( attribute *p_queattr, /* I */ attribute *p_svrattr, /* I */ resource_def *rscdf, /* I */ int *fromQueue) /* O */ { resource *pr; pr = find_resc_entry(p_queattr, rscdf); if ((pr == NULL) || ((pr->rs_value.at_flags & ATR_VFLAG_SET) == 0)) { /* queue limit not set, check server's */ pr = find_resc_entry(p_svrattr, rscdf); if ((pr != NULL) && (pr->rs_value.at_flags & ATR_VFLAG_SET)) { *fromQueue = 0; } } else { /* queue limit is set, use it */ *fromQueue = 1; } return(pr); } /* END get_resource() */ /* * compare the job resource limit against the system limit * unless a queue limit exists, it takes priority * * returns number of .gt. and .lt. comparison in comp_resc_gt and comp_resc_lt * does not make use of comp_resc_eq or comp_resc_nc */ static void chk_svr_resc_limit( attribute *jobatr, /* I */ pbs_queue *pque, /* I */ int qtype, /* I */ char *EMsg) /* O (optional,minsize=1024) */ { int dummy; int rc; resource *jbrc; resource *jbrc_nodes = NULL; resource *qurc; resource *svrc; resource *cmpwith; int LimitIsFromQueue; char *LimitName; /* NOTE: support Cray-specific evaluation */ int MPPWidth = 0; int PPN = 0; long mpp_nppn = 0; long mpp_width = 0; long mpp_nodect = 0; resource *mppnodect_resource = NULL; static resource_def *noderesc = NULL; static resource_def *needresc = NULL; static resource_def *nodectresc = NULL; static resource_def *mppwidthresc = NULL; static resource_def *mppnppn = NULL; static time_t UpdateTime = 0; static time_t now; /* NOTE: server limits are specified with server.resources_available */ if (EMsg != NULL) EMsg[0] = '\0'; time(&now); if ((noderesc == NULL) || (now > UpdateTime + 30)) { UpdateTime = now; /* NOTE: to optimize, only update once per 30 seconds */ noderesc = find_resc_def(svr_resc_def, "nodes", svr_resc_size); needresc = find_resc_def(svr_resc_def, "neednodes", svr_resc_size); nodectresc = find_resc_def(svr_resc_def, "nodect", svr_resc_size); mppwidthresc = find_resc_def(svr_resc_def, "mppwidth", svr_resc_size); mppnppn = find_resc_def(svr_resc_def, "mppnppn", svr_resc_size); SvrNodeCt = 0; if (nodectresc != NULL) { svrc = (resource *)GET_NEXT( server.sv_attr[SRV_ATR_resource_avail].at_val.at_list); while (svrc != NULL) { if (svrc->rs_defin == nodectresc) { svrc = find_resc_entry( &server.sv_attr[SRV_ATR_resource_avail], svrc->rs_defin); if ((svrc != NULL) && (svrc->rs_value.at_flags & ATR_VFLAG_SET)) { SvrNodeCt = svrc->rs_value.at_val.at_long; } } svrc = (resource *)GET_NEXT(svrc->rs_link); } /* END while (svrc != NULL) */ } /* END if (nodectresc != NULL) */ } /* END if ((noderesc == NULL) || ...) */ /* return values via global comp_resc_gt and comp_resc_lt */ comp_resc_gt = 0; comp_resc_lt = 0; jbrc = (resource *)GET_NEXT(jobatr->at_val.at_list); while (jbrc != NULL) { cmpwith = NULL; if ((jbrc->rs_value.at_flags & (ATR_VFLAG_SET | ATR_VFLAG_DEFLT)) == ATR_VFLAG_SET) { qurc = find_resc_entry(&pque->qu_attr[QA_ATR_ResourceMax], jbrc->rs_defin); LimitName = jbrc->rs_defin->rs_name; cmpwith = get_resource(&pque->qu_attr[QA_ATR_ResourceMax], &server.sv_attr[SRV_ATR_ResourceMax], jbrc->rs_defin, &LimitIsFromQueue); if (strcmp(LimitName,"mppnppn") == 0) { mpp_nppn = jbrc->rs_value.at_val.at_long; } if (strcmp(LimitName,"mppwidth") == 0) { mpp_width = jbrc->rs_value.at_val.at_long; } if ((jbrc->rs_defin == noderesc) && (qtype == QTYPE_Execution)) { /* NOTE: process after loop so SvrNodeCt is loaded */ /* can check pure nodes violation right here */ int job_nodes; int queue_nodes; jbrc_nodes = jbrc; if ((jbrc_nodes != NULL) && (qurc != NULL)) { if ((isdigit(*(jbrc_nodes->rs_value.at_val.at_str))) && (isdigit(*(qurc->rs_value.at_val.at_str)))) { job_nodes = atoi(jbrc_nodes->rs_value.at_val.at_str); queue_nodes = atoi(qurc->rs_value.at_val.at_str); if (queue_nodes < job_nodes) comp_resc_lt++; } } } #ifdef NERSCDEV else if (jbrc->rs_defin == mppwidthresc) { if (jbrc->rs_value.at_flags & ATR_VFLAG_SET) { MPPWidth = jbrc->rs_value.at_val.at_long; } } #endif /* NERSCDEV */ else if ((strcmp(LimitName,"mppnodect") == 0) && (jbrc->rs_value.at_val.at_long == -1)) { /* * mppnodect is a special attrtibute, It gets set based upon the * values of mppwidth and mppnppn. -1 signifies the case where mppwidth * and mppnppn were not both specified for the job. We will need to * check mppnodect limits against queue/server defaults, if any. */ mppnodect_resource = jbrc; } else if ((cmpwith != NULL) && (jbrc->rs_defin != needresc)) { /* don't check neednodes */ rc = jbrc->rs_defin->rs_comp( &cmpwith->rs_value, &jbrc->rs_value); if (rc > 0) { comp_resc_gt++; } else if (rc < 0) { /* only record if: * is_transit flag is not set * or is_transit is set, but not to true * or the value comes from queue limit */ if ((!(pque->qu_attr[(int)QE_ATR_is_transit].at_flags & ATR_VFLAG_SET)) || (!pque->qu_attr[(int)QE_ATR_is_transit].at_val.at_long) || (LimitIsFromQueue)) { if ((EMsg != NULL) && (EMsg[0] == '\0')) { sprintf(EMsg, "cannot satisfy %s max %s requirement", (LimitIsFromQueue == 1) ? "queue" : "server", (LimitName != NULL) ? LimitName : "resource"); } comp_resc_lt++; } } } } /* END if () */ jbrc = (resource *)GET_NEXT(jbrc->rs_link); } /* END while (jbrc != NULL) */ if (mppnodect_resource != NULL) { /* * special case where mppnodect was not specified for the job, we need to * check max against recalculated value using queue/server resources_defaults */ if (mpp_nppn == 0) { /* get queue/server default value */ if (mppnppn != NULL) { cmpwith = get_resource(&pque->qu_attr[QA_ATR_ResourceDefault], &server.sv_attr[SRV_ATR_resource_deflt], mppnppn, &LimitIsFromQueue); if (cmpwith != NULL) { mpp_nppn = cmpwith->rs_value.at_val.at_long; } } } if (mpp_width == 0) { /* get queue/server default value */ if (mppwidthresc != NULL) { cmpwith = get_resource(&pque->qu_attr[QA_ATR_ResourceDefault], &server.sv_attr[SRV_ATR_resource_deflt], mppwidthresc, &LimitIsFromQueue); if (cmpwith != NULL) { mpp_width = cmpwith->rs_value.at_val.at_long; } } } /* Uses same way of calculating as set_mppnodect */ /* Check for width less than a node */ if ((mpp_width) && (mpp_width < mpp_nppn)) { mpp_nppn = mpp_width; } /* Compute an estimate for the number of nodes needed */ mpp_nodect = mpp_width; if (mpp_nppn > 1) { mpp_nodect = (mpp_nodect + mpp_nppn - 1) / mpp_nppn; } LimitIsFromQueue = 0; LimitName = mppnodect_resource->rs_defin->rs_name; cmpwith = get_resource(&pque->qu_attr[QA_ATR_ResourceMax], &server.sv_attr[SRV_ATR_ResourceMax], mppnodect_resource->rs_defin, &LimitIsFromQueue); if (cmpwith != NULL) { long nodect_orig; if (LOGLEVEL >= 7) { sprintf(log_buffer, "chk_svr_resc_limit: comparing calculated mppnodect %ld, %s limit %s %ld\n", mpp_nodect, (LimitIsFromQueue == 1) ? "queue" : "server", LimitName, cmpwith->rs_value.at_val.at_long); log_event(PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); } nodect_orig = mppnodect_resource->rs_value.at_val.at_long; mppnodect_resource->rs_value.at_val.at_long = mpp_nodect; rc = mppnodect_resource->rs_defin->rs_comp( &cmpwith->rs_value, &mppnodect_resource->rs_value); mppnodect_resource->rs_value.at_val.at_long = nodect_orig; if (rc > 0) { comp_resc_gt++; } else if (rc < 0) { /* only record if: * is_transit flag is not set * or is_transit is set, but not to true * or the value comes from queue limit */ if ((!(pque->qu_attr[(int)QE_ATR_is_transit].at_flags & ATR_VFLAG_SET)) || (!pque->qu_attr[(int)QE_ATR_is_transit].at_val.at_long) || (LimitIsFromQueue)) { if ((EMsg != NULL) && (EMsg[0] == '\0')) { sprintf(EMsg, "cannot satisfy %s max %s requirement", (LimitIsFromQueue == 1) ? "queue" : "server", (LimitName != NULL) ? LimitName : "resource"); } comp_resc_lt++; } } } } /* END if (mppnodect_resource != NULL) */ if (jbrc_nodes != NULL) { int tmpI; char *ptr; int IgnTest = 0; /* the DREADED special case ... */ /* check nodes using special function */ /* NOTE: if 'nodes' is simple nodect specification AND server nodect * is set, and requested nodes < server nodect, ignore special * case test */ ptr = jbrc_nodes->rs_value.at_val.at_str; if (isdigit(*ptr) && !strchr(ptr, ':') && !strchr(ptr, '+')) { tmpI = (int)strtol(ptr, NULL, 10); if ((SvrNodeCt > 0) && (tmpI <= SvrNodeCt)) IgnTest = 1; if (server.sv_attr[(int)SRV_ATR_NodePack].at_val.at_long) IgnTest = 1; } if (IgnTest == 0) { if (node_avail_complex( jbrc_nodes->rs_value.at_val.at_str, &dummy, &dummy, &dummy, &dummy) == -1) { /* only record if: * is_transit flag is not set * or is_transit is set, but not to true */ if ((!(pque->qu_attr[(int)QE_ATR_is_transit].at_flags & ATR_VFLAG_SET)) || (!pque->qu_attr[(int)QE_ATR_is_transit].at_val.at_long)) { if ((EMsg != NULL) && (EMsg[0] == '\0')) strcpy(EMsg, "cannot locate feasible nodes"); comp_resc_lt++; } } } } /* END if (jbrc_nodes != NULL) */ if (MPPWidth > 0) { /* NYI */ if (PPN == 0) { if (EMsg != NULL) strcpy(EMsg, "MPP Width Detected"); } } return; } /* END chk_svr_resc_limit() */ /* * chk_resc_limits - check job Resource_Limits attribute against the queue * and server maximum and mininum values. * * return 0 if within limits, or an pbs_error number if not. */ int chk_resc_limits( attribute *pattr, /* I */ pbs_queue *pque, /* I */ char *EMsg) /* O (optional,minsize=1024) */ { /* NOTE: comp_resc_gt and comp_resc_lt are global ints */ if (EMsg != NULL) EMsg[0] = '\0'; /* first check against queue minimum */ if ((comp_resc2( &pque->qu_attr[QA_ATR_ResourceMin], pattr, server.sv_attr[(int)SRV_ATR_QCQLimits].at_val.at_long, EMsg) == -1) || (comp_resc_gt > 0)) { if ((EMsg != NULL) && (EMsg[0] == '\0')) strcpy(EMsg, "job violates queue min resource limits"); return(PBSE_EXCQRESC); } /* now check against queue or server maximum */ chk_svr_resc_limit( pattr, pque, pque->qu_qs.qu_type, EMsg); if (comp_resc_lt > 0) { if ((EMsg != NULL) && (EMsg[0] == '\0')) strcpy(EMsg, "job violates queue/server max resource limits"); return(PBSE_EXCQRESC); } /* SUCCESS */ return(0); } /* END chk_resc_limits() */ /* * svr_chkque - check if job can enter a queue * * returns 0 for yes, 1 for no * * NOTE: the following fields must be set in the job struture before * calling svr_chkque(): ji_wattr[JOB_ATR_job_owner] * NOTE: calls chk_resc_limits() to validate resource request * * Also if the job is being considered for an execution queue, then * set_jobexid() will be called. */ int svr_chkque( job *pjob, pbs_queue *pque, char *hostname, int mtype, /* MOVE_TYPE_* type, see server_limits.h */ char *EMsg) /* O (optional,minsize=1024) */ { int i; int failed_group_acl = 0; int failed_user_acl = 0; int user_jobs; job *pj; struct array_strings *pas; int j = 0; if (EMsg != NULL) EMsg[0] = '\0'; /* * 1. If the queue is an Execution queue ... * These is checked first because 1a - 1c are more damaging * (see local_move() in svr_movejob.c) */ if (pque->qu_qs.qu_type == QTYPE_Execution) { /* 1a. if not already set, set up execution uid/gid/name */ if (!(pjob->ji_wattr[(int)JOB_ATR_euser].at_flags & ATR_VFLAG_SET) || !(pjob->ji_wattr[(int)JOB_ATR_egroup].at_flags & ATR_VFLAG_SET)) { if ((i = set_jobexid(pjob, pjob->ji_wattr, EMsg)) != 0) { return(i); /* PBSE_BADUSER or GRP */ } } /* 1b. check site restrictions */ if (site_acl_check(pjob, pque)) { if (EMsg) snprintf(EMsg, 1024, "site_acl_check() failed: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_PERM); } /* 1c. cannot have an unknown resource */ if (find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], &svr_resc_def[svr_resc_size - 1]) != 0) { if (EMsg) { snprintf(EMsg, 1024, "detected request for an unknown resource"); } return(PBSE_UNKRESC); } /* 1d. cannot have an unknown attribute */ if (pjob->ji_wattr[(int)JOB_ATR_UNKN].at_flags & ATR_VFLAG_SET) { if (EMsg) snprintf(EMsg, 1024, "detected presence of an unknown attribute"); return(PBSE_NOATTR); } /* 1e. check queue's disallowed_types */ if (pque->qu_attr[QA_ATR_DisallowedTypes].at_flags & ATR_VFLAG_SET) { for (i = 0; i < (pque->qu_attr[QA_ATR_DisallowedTypes]).at_val.at_arst->as_usedptr; i++) { /* if job is interactive...*/ if ((pjob->ji_wattr[(int)JOB_ATR_interactive].at_flags & ATR_VFLAG_SET) && (pjob->ji_wattr[(int)JOB_ATR_interactive].at_val.at_long > 0)) { if (strcmp(Q_DT_interactive, pque->qu_attr[QA_ATR_DisallowedTypes].at_val.at_arst->as_string[i]) == 0) { if (EMsg) snprintf(EMsg, 1024, "interactive job is not allowed for queue: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_NOINTERACTIVE); } } else /* else job is batch... */ { if (strcmp(Q_DT_batch, pque->qu_attr[QA_ATR_DisallowedTypes].at_val.at_arst->as_string[i]) == 0) { if (EMsg) snprintf(EMsg, 1024, "batch job is not allowed for queue: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_NOBATCH); } } if (strcmp(Q_DT_rerunable, pque->qu_attr[QA_ATR_DisallowedTypes].at_val.at_arst->as_string[i]) == 0 && (pjob->ji_wattr[(int)JOB_ATR_rerunable].at_flags & ATR_VFLAG_SET && pjob->ji_wattr[(int)JOB_ATR_rerunable].at_val.at_long > 0)) { if (EMsg) snprintf(EMsg, 1024, "rerunable job is not allowed for queue: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_NORERUNABLE); } if (strcmp(Q_DT_nonrerunable, pque->qu_attr[QA_ATR_DisallowedTypes].at_val.at_arst->as_string[i]) == 0 && (!(pjob->ji_wattr[(int)JOB_ATR_rerunable].at_flags & ATR_VFLAG_SET) || pjob->ji_wattr[(int)JOB_ATR_rerunable].at_val.at_long == 0)) { if (EMsg) snprintf(EMsg, 1024, "only rerunable jobs are allowed for queue: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_NONONRERUNABLE); } if (strcmp(Q_DT_fault_tolerant, pque->qu_attr[QA_ATR_DisallowedTypes].at_val.at_arst->as_string[i]) == 0 && ((pjob->ji_wattr[(int)JOB_ATR_fault_tolerant].at_flags & ATR_VFLAG_SET) && pjob->ji_wattr[(int)JOB_ATR_fault_tolerant].at_val.at_long != 0)) { if (EMsg) snprintf(EMsg, 1024, "fault_tolerant jobs are not allowed for queue: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_NOFAULTTOLERANT); } if (strcmp(Q_DT_fault_intolerant, pque->qu_attr[QA_ATR_DisallowedTypes].at_val.at_arst->as_string[i]) == 0 && (!(pjob->ji_wattr[(int)JOB_ATR_fault_tolerant].at_flags & ATR_VFLAG_SET) || pjob->ji_wattr[(int)JOB_ATR_fault_tolerant].at_val.at_long == 0)) { if (EMsg) snprintf(EMsg, 1024, "only fault_tolerant jobs are allowed for queue: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_NOFAULTINTOLERANT); } if (strcmp(Q_DT_job_array, pque->qu_attr[QA_ATR_DisallowedTypes].at_val.at_arst->as_string[i]) == 0 && (pjob->ji_wattr[(int)JOB_ATR_job_array_request].at_flags & ATR_VFLAG_SET)) { if (EMsg) snprintf(EMsg, 1024, "job arrays are not allowed for queue: queue %s", pque->qu_qs.qu_name); return(PBSE_NOJOBARRAYS); } } } /* END if (pque->qu_attr[QA_ATR_DisallowedTypes].at_flags & ATR_VFLAG_SET) */ /* 1f. if enabled, check the queue's group ACL */ if (pque->qu_attr[QA_ATR_AclGroupEnabled].at_val.at_long) { int rc; int slpygrp; slpygrp = attr_ifelse_long( &pque->qu_attr[(int)QA_ATR_AclGroupSloppy], &server.sv_attr[(int)SRV_ATR_AclGroupSloppy], 0); rc = acl_check( &pque->qu_attr[QA_ATR_AclGroup], pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str, ACL_Group); if ((rc == 0) && slpygrp) { /* try again looking at the gids */ rc = acl_check( &pque->qu_attr[QA_ATR_AclGroup], pjob->ji_wattr[(int)JOB_ATR_egroup].at_val.at_str, ACL_Gid); } if ((rc == 0) && slpygrp && (!(pjob->ji_wattr[(int)JOB_ATR_grouplst].at_flags & ATR_VFLAG_SET))) { /* check group acl against all accessible groups */ struct group *grp; int i; char uname[PBS_MAXUSER + 1]; strncpy(uname, pjob->ji_wattr[(int)JOB_ATR_euser].at_val.at_str, PBS_MAXUSER); /* fetch the groups in the ACL and look for matching user membership */ pas = pque->qu_attr[QA_ATR_AclGroup].at_val.at_arst; for (i = 0; pas != NULL && i < pas->as_usedptr;i++) { if ((grp = getgrnam(pas->as_string[i])) == NULL) continue; for (j = 0;grp->gr_mem[j] != NULL;j++) { if (!strcmp(grp->gr_mem[j], uname)) { rc = 1; break; } } if (rc == 1) break; } } /* END if (rc == 0) && slpygrp && ...) */ if (rc == 0) { /* ACL not satisfied */ if (mtype != MOVE_TYPE_MgrMv) /* ok if mgr */ { int logic_or; logic_or = attr_ifelse_long(&pque->qu_attr[(int)QA_ATR_AclLogic], &server.sv_attr[(int)SRV_ATR_AclLogic], 0); if (logic_or && pque->qu_attr[QA_ATR_AclUserEnabled].at_val.at_long) { /* only fail if neither user nor group acls can be met */ failed_group_acl = 1; } else { /* no user acl, fail immediately */ if (EMsg) snprintf(EMsg, 1024, "group ACL is not satisfied: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_PERM); } } } } /* END if (pque->qu_attr[QA_ATR_AclGroupEnabled].at_val.at_long) */ } /* END if (pque->qu_qs.qu_type == QTYPE_Execution) */ /* checks 2 and 3 are bypassed for a move by manager or qorder */ if ((mtype != MOVE_TYPE_MgrMv) && (mtype != MOVE_TYPE_Order)) { /* 2. the queue must be enabled and the job limit not exceeded */ if (pque->qu_attr[QA_ATR_Enabled].at_val.at_long == 0) { if (EMsg) snprintf(EMsg, 1024, "queue is disabled: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_QUNOENB); } if ((pque->qu_attr[QA_ATR_MaxJobs].at_flags & ATR_VFLAG_SET) && ((pque->qu_numjobs - pque->qu_numcompleted) >= pque->qu_attr[QA_ATR_MaxJobs].at_val.at_long)) { if (EMsg) snprintf(EMsg, 1024, "total number of jobs in queue exceeds the queue limit: " "user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_MAXQUED); } if ((pque->qu_attr[QA_ATR_MaxUserJobs].at_flags & ATR_VFLAG_SET) && (pque->qu_attr[QA_ATR_MaxUserJobs].at_val.at_long >= 0)) { /* count number of jobs user has in queue */ user_jobs = 0; pj = (job *)GET_NEXT(pque->qu_jobs); while (pj != NULL) { if ((pj->ji_qs.ji_state <= JOB_STATE_RUNNING) && (!strcmp(pj->ji_wattr[JOB_ATR_job_owner].at_val.at_str, pjob->ji_wattr[JOB_ATR_job_owner].at_val.at_str))) { user_jobs++; } pj = (job *)GET_NEXT(pj->ji_jobque); } if (user_jobs >= pque->qu_attr[QA_ATR_MaxUserJobs].at_val.at_long) { if (EMsg) snprintf(EMsg, 1024, "total number of current user's jobs exceeds the queue limit: " "user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_MAXUSERQUED); } } /* 3. if "from_route_only" is true, only local route allowed */ if ((pque->qu_attr[QA_ATR_FromRouteOnly].at_flags & ATR_VFLAG_SET) && (pque->qu_attr[QA_ATR_FromRouteOnly].at_val.at_long == 1)) { if (mtype == MOVE_TYPE_Move) /* ok if not plain user */ { if (EMsg) snprintf(EMsg, 1024, "queue accepts only routed jobs, no direct submission: " "user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_QACESS); } } } /* checks 4, 5, and 6 are bypassed for a move by manager */ if (mtype != MOVE_TYPE_MgrMv) { /* 4. if enabled, check the queue's host ACL */ if (pque->qu_attr[QA_ATR_AclHostEnabled].at_val.at_long) { if (acl_check(&pque->qu_attr[QA_ATR_AclHost], hostname, ACL_Host) == 0) { if (EMsg) snprintf(EMsg, 1024, "host ACL rejected the submitting host: user %s, queue %s, host %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name, hostname); return(PBSE_BADHOST); } } /* 5. if enabled, check the queue's user ACL */ if (pque->qu_attr[QA_ATR_AclUserEnabled].at_val.at_long) { if (acl_check( &pque->qu_attr[QA_ATR_AclUsers], pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, ACL_User) == 0) { int logic_or; logic_or = attr_ifelse_long(&pque->qu_attr[(int)QA_ATR_AclLogic], &server.sv_attr[(int)SRV_ATR_AclLogic], 0); if (logic_or && pque->qu_attr[QA_ATR_AclGroupEnabled].at_val.at_long) { /* only fail if neither user nor group acls can be met */ failed_user_acl = 1; } else { /* no group acl, fail immediately */ if (EMsg) snprintf(EMsg, 1024, "user ACL rejected the submitting user: user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_PERM); } } } /* 5.5. if failed user and group acls, fail */ if (failed_group_acl && failed_user_acl) { if (EMsg) snprintf(EMsg, 1024, "both user and group ACL rejected the submitting user: " "user %s, queue %s", pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str, pque->qu_qs.qu_name); return(PBSE_PERM); } /* 6. resources of the job must be in the limits of the queue */ if ((i = chk_resc_limits(&pjob->ji_wattr[(int)JOB_ATR_resource], pque, EMsg)) != 0) { /* FAILURE */ return(i); } } /* END if (mtype != MOVE_TYPE_MgrMv) */ /* SUCCESS - job can enter queue */ return(0); } /* END svr_chkque() */ /* * job_wait_over - The execution wait time of a job has been reached, at * least according to a work_task entry via which we were invoked. * * If indeed the case, re-evaluate and set the job state. */ static void job_wait_over( struct work_task *pwt) { int newstate; int newsub; job *pjob; pjob = (job *)pwt->wt_parm1; #ifndef NDEBUG { time_t now = time((time_t *)0); time_t when = ((job *)pjob)->ji_wattr[(int)JOB_ATR_exectime].at_val.at_long; struct work_task *ptask; if (when > now) { sprintf(log_buffer, msg_badwait, ((job *)pjob)->ji_qs.ji_jobid); log_err(-1, "job_wait_over", log_buffer); /* recreate the work task entry */ ptask = set_task(WORK_Timed, when, job_wait_over, pjob); if (ptask != NULL) append_link(&pjob->ji_svrtask, &ptask->wt_linkobj, ptask); return; } } #endif /* !NDEBUG */ pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_HASWAIT; /* clear the exectime attribute */ job_attr_def[(int)JOB_ATR_exectime].at_free( &pjob->ji_wattr[(int)JOB_ATR_exectime]); pjob->ji_modified = 1; svr_evaljobstate(pjob, &newstate, &newsub, 0); svr_setjobstate(pjob, newstate, newsub); return; } /* * job_set_wait - set up a work task entry that will trigger at the execution * wait time of the job. * * This is called as the at_action (see attribute.h) function associated * with the execution-time job attribute. */ int job_set_wait( attribute *pattr, void *pjob, /* a (job *) cast to void * */ int mode) /* unused, do it for all action modes */ { struct work_task *ptask; long when; if ((pattr->at_flags & ATR_VFLAG_SET) == 0) { return(0); } when = pattr->at_val.at_long; ptask = (struct work_task *)GET_NEXT(((job *)pjob)->ji_svrtask); /* Is there already an entry for this job? Then reuse it */ if (((job *)pjob)->ji_qs.ji_svrflags & JOB_SVFLG_HASWAIT) { while (ptask != NULL) { if ((ptask->wt_type == WORK_Timed) && (ptask->wt_func == job_wait_over) && (ptask->wt_parm1 == pjob)) { ptask->wt_event = when; return(0); } ptask = (struct work_task *)GET_NEXT(ptask->wt_linkobj); } } ptask = set_task(WORK_Timed, when, job_wait_over, pjob); if (ptask == NULL) { return(-1); } append_link(&((job *)pjob)->ji_svrtask, &ptask->wt_linkobj, ptask); /* set JOB_SVFLG_HASWAIT to show job has work task entry */ ((job *)pjob)->ji_qs.ji_svrflags |= JOB_SVFLG_HASWAIT; return(0); } /* END job_set_wait() */ /* * default_std - make the default name for standard output or error * "job_name".[e|o]job_sequence_number */ static void default_std( job *pjob, int key, /* 'e' for stderr, 'o' for stdout */ char *to) /* ptr to buffer in which to return name */ /* had better be big enough! */ { int len; char *pd; pd = strrchr(pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str, '/'); if (pd != NULL) ++pd; else pd = pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str; len = strlen(pd); strcpy(to, pd); /* start with the job name */ *(to + len++) = '.'; /* the dot */ *(to + len++) = (char)key; /* the letter */ pd = pjob->ji_qs.ji_jobid; /* the seq_number */ while (isdigit((int)*pd)) *(to + len++) = *pd++; #ifdef JOBARRAYTESTING if (isdigit((int)*(pd + 1))) { /* add the jatid (job array taskid) */ *(to + len++) = *pd++; while (isdigit((int)*pd)) *(to + len++) = *pd++; } #endif *(to + len) = '\0'; return; } /* END default_std() */ /* * prefix_std_file - build the fully prefixed default file name for the job's * standard output or error: * qsub_host:$PBS_O_WORKDIR/job_name.[e|o]job_sequence_number */ char *prefix_std_file( job *pjob, int key) { int len; char *name = (char *)0; char *qsubhost; char *wdir; qsubhost = get_variable(pjob, pbs_o_host); wdir = get_variable(pjob, "PBS_O_WORKDIR"); if (qsubhost != NULL) { /* If just the host name portion was specified * then we use it instead of qsubhost */ if ((key == (int)'e') && (pjob->ji_wattr[(int)JOB_ATR_errpath].at_flags & ATR_VFLAG_SET) && (pjob->ji_wattr[(int)JOB_ATR_errpath].at_val.at_str[strlen(pjob->ji_wattr[(int)JOB_ATR_errpath].at_val.at_str) - 1] == ':')) { pjob->ji_wattr[(int)JOB_ATR_errpath].at_val.at_str[strlen(pjob->ji_wattr[(int)JOB_ATR_errpath].at_val.at_str) - 1] = '\0'; qsubhost = pjob->ji_wattr[(int)JOB_ATR_errpath].at_val.at_str; } else if ((key == (int)'o') && (pjob->ji_wattr[(int)JOB_ATR_outpath].at_flags & ATR_VFLAG_SET) && (pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str[strlen(pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str) - 1] == ':')) { pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str[strlen(pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str) - 1] = '\0'; qsubhost = pjob->ji_wattr[(int)JOB_ATR_outpath].at_val.at_str; } len = strlen(qsubhost) + strlen(pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str) + PBS_MAXSEQNUM + 5; if (wdir) len += strlen(wdir); name = malloc(len); if (name) { strcpy(name, qsubhost); /* the qsub host name */ strcat(name, ":"); /* the : */ if (wdir) { strcat(name, wdir); /* the qsub cwd */ strcat(name, "/"); /* the final / */ } /* now add the rest */ default_std(pjob, key, name + strlen(name)); } } return(name); } /* * add_std_filename - add the default file name for the job's * standard output or error: * job_name.[e|o]job_sequence_number */ char *add_std_filename( job *pjob, char * path, int key) { int len; char *name = (char *)0; len = strlen(path) + strlen(pjob->ji_wattr[(int)JOB_ATR_jobname].at_val.at_str) + PBS_MAXSEQNUM + 5; name = malloc(len); if (name) { strcpy(name, path); strcat(name, "/"); /* the final / */ /* now add the rest */ default_std(pjob, key, name + strlen(name)); } return(name); } /* * get_jobowner - copy the basic job owner's name, without the @host suffix. * The "to" buffer must be large enought (PBS_MAXUSER+1). */ void get_jobowner( char *from, char *to) { int i; for (i = 0;i < PBS_MAXUSER;++i) { if ((*(from + i) == '@') || (*(from + i) == '\0')) break; *(to + i) = *(from + i); } *(to + i) = '\0'; return; } /** * @see set_resc_deflt() - parent * * @param jb * @param *dflt */ static void set_deflt_resc( attribute *jb, attribute *dflt) { resource *prescjb; resource *prescdt; if (dflt->at_flags & ATR_VFLAG_SET) { /* for each resource in the default value list */ prescdt = (resource *)GET_NEXT(dflt->at_val.at_list); while (prescdt != NULL) { if (prescdt->rs_value.at_flags & ATR_VFLAG_SET) { /* see if the job already has that resource */ prescjb = find_resc_entry(jb, prescdt->rs_defin); if ((prescjb == NULL) || ((prescjb->rs_value.at_flags & ATR_VFLAG_SET) == 0)) { /* resource does not exist or value is not set */ if (prescjb == NULL) prescjb = add_resource_entry(jb, prescdt->rs_defin); if (prescjb != NULL) { if (prescdt->rs_defin->rs_set( &prescjb->rs_value, &prescdt->rs_value, SET) == 0) { prescjb->rs_value.at_flags |= (ATR_VFLAG_SET | ATR_VFLAG_DEFLT | ATR_VFLAG_MODIFY); } } } } prescdt = (resource *)GET_NEXT(prescdt->rs_link); } } return; } /* END set_deflt_resc() */ /** * Set job defaults * * @see svr_enquejob() - parent * @see set_deflt_resc() - child * * @param pjob (I) [modified] * @param ji_wattr * * NOTE: if ji_wattr parameter is passed in, update it instead of pjob */ void set_resc_deflt( job *pjob, /* I (modified) */ attribute *ji_wattr) /* I (optional) decoded attributes */ { attribute *ja; pbs_queue *pque; attribute_def *pdef; int i, rc; pque = pjob->ji_qhdr; assert(pque != NULL); if (ji_wattr != NULL) ja = &ji_wattr[(int)JOB_ATR_resource]; else ja = &pjob->ji_wattr[(int)JOB_ATR_resource]; /* apply queue defaults first since they take precedence */ set_deflt_resc(ja, &pque->qu_attr[(int)QA_ATR_ResourceDefault]); /* server defaults will only be applied to attributes which have not yet been set */ set_deflt_resc(ja, &server.sv_attr[(int)SRV_ATR_resource_deflt]); /* apply queue max limits first since they take precedence */ #ifdef RESOURCEMAXDEFAULT set_deflt_resc(ja, &pque->qu_attr[(int)QA_ATR_ResourceMax]); /* server max limits will only be applied to attributes which have not yet been set */ set_deflt_resc(ja, &server.sv_attr[(int)SRV_ATR_ResourceMax]); #endif for (i = 0;i < JOB_ATR_LAST;++i) { pdef = &job_attr_def[i]; if ((pjob->ji_wattr[i].at_flags & ATR_VFLAG_SET) && (pdef->at_action)) { if ((rc = pdef->at_action(&pjob->ji_wattr[i], pjob, ATR_ACTION_NEW)) != 0) { /* FIXME: return an actual error */ return; } } } return; } /* END set_resc_deflt() */ /* * set_statechar - set the job state attribute to the letter that correspondes * to its current state. */ void set_statechar( job *pjob) /* *I* (modified) */ { static char *statechar = "TQHWREC"; static char suspend = 'S'; if ((pjob->ji_qs.ji_state == JOB_STATE_RUNNING) && (pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend)) { pjob->ji_wattr[JOB_ATR_state].at_val.at_char = suspend; } else { if (pjob->ji_qs.ji_state < (int)strlen(statechar)) { pjob->ji_wattr[JOB_ATR_state].at_val.at_char = *(statechar + pjob->ji_qs.ji_state); } else { pjob->ji_wattr[JOB_ATR_state].at_val.at_char = 'U'; /* Unknown */ } } return; } /* END set_statechar() */ /* * eval_checkpoint - if the job's checkpoint attribute is "c=nnnn" and * nnnn is less than the queue' minimum checkpoint time, reset * to the queue min time. */ static void eval_checkpoint( attribute *jobckp, /* job's checkpoint attribute */ attribute *queckp) /* queue's checkpoint attribute */ { int jobs; char queues[30]; char *pv; if (((jobckp->at_flags & ATR_VFLAG_SET) == 0) || ((queckp->at_flags & ATR_VFLAG_SET) == 0)) { return; /* need do nothing */ } pv = jobckp->at_val.at_str; if (*pv++ == 'c') { if (*pv == '=') pv++; jobs = atoi(pv); if (jobs < queckp->at_val.at_long) { sprintf(queues, "c=%ld", queckp->at_val.at_long); free_str(jobckp); decode_str(jobckp, 0, 0, queues); } } return; } /* END eval_checkpoint() */ #ifndef NDEBUG /* * correct_ct - This is a work-around for an as yet unfound bug where * the counts of jobs in each state sometimes (rarely) become wrong. * When this happens, the count for a state can become negative. * If this is detected (see above), this routine is called to reset * all of the counts and log a message. */ static void correct_ct( pbs_queue *pqj) { int i; char *pc; job *pjob; pbs_queue *pque; sprintf(log_buffer, "Job state counts incorrect, server %d: ", server.sv_qs.sv_numjobs); server.sv_qs.sv_numjobs = 0; for (i = 0;i < PBS_NUMJOBSTATE;++i) { pc = log_buffer + strlen(log_buffer); sprintf(pc, "%d ", server.sv_jobstates[i]); server.sv_jobstates[i] = 0; } if (pqj != NULL) { pc = log_buffer + strlen(log_buffer); sprintf(pc, "; queue %s %d (completed: %d): ", pqj->qu_qs.qu_name, pqj->qu_numjobs, pqj->qu_numcompleted); for (i = 0;i < PBS_NUMJOBSTATE;++i) { pc = log_buffer + strlen(log_buffer); sprintf(pc, "%d ", pqj->qu_njstate[i]); } } log_event(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); for (pque = (pbs_queue *)GET_NEXT(svr_queues); pque != NULL; pque = (pbs_queue *)GET_NEXT(pque->qu_link)) { pque->qu_numjobs = 0; pque->qu_numcompleted = 0; for (i = 0;i < PBS_NUMJOBSTATE;++i) pque->qu_njstate[i] = 0; } for (pjob = (job *)GET_NEXT(svr_alljobs); pjob != NULL; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { server.sv_qs.sv_numjobs++; server.sv_jobstates[pjob->ji_qs.ji_state]++; pque = pjob->ji_qhdr; if (pque == NULL) pque = find_queuebyname(pjob->ji_qs.ji_queue); if (pque != NULL) { pque->qu_numjobs++; pque->qu_njstate[pjob->ji_qs.ji_state]++; if (pjob->ji_qs.ji_state == JOB_STATE_COMPLETE) pque->qu_numcompleted++; pjob->ji_qhdr = pque; } } /* END for (pjob) */ return; } /* END correct_ct() */ #endif /* NDEBUG */ torque-2.4.16/src/server/svr_attr_def.c0000664000113300011330000005702011375011550014761 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * svr_attr_def is the array of attribute definitions for the server. * Each legal server attribute is defined here */ #include /* the master config generated by configure */ #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" /* External Functions Referenced */ extern int manager_oper_chk A_((attribute *pattr, void *pobject, int actmode)); extern int servername_chk A_((attribute *pattr, void *pobject, int actmode)); extern int schiter_chk A_((attribute *pattr, void *pobject, int actmode)); extern int nextjobnum_chk A_((attribute *pattr, void *pobject, int actmode)); extern int set_nextjobnum A_((attribute *attr, attribute *new, enum batch_op op)); extern int poke_scheduler A_((attribute *pattr, void *pobject, int actmode)); extern int encode_svrstate A_((attribute *pattr, tlist_head *phead, char *aname, char *rsname, int mode)); extern int decode_rcost A_((attribute *patr, char *name, char *rn, char *val)); extern int encode_rcost A_((attribute *attr, tlist_head *phead, char *atname, char *rsname, int mode)); extern int set_rcost A_((attribute *attr, attribute *new, enum batch_op)); extern void free_rcost A_((attribute *attr)); extern int decode_null A_((attribute *patr, char *name, char *rn, char *val)); extern int set_null A_((attribute *patr, attribute *new, enum batch_op op)); extern int token_chk A_((attribute *pattr, void *pobject, int actmode)); extern int set_tokens A_((struct attribute *attr, struct attribute *new, enum batch_op op)); extern int extra_resc_chk A_((attribute *pattr, void *pobject, int actmode)); extern void free_extraresc A_((attribute *attr)); extern void restore_attr_default A_((struct attribute *)); /* DIAGTODO: write diag_attr_def.c */ /* * The entries for each attribute are (see attribute.h): * name, * decode function, * encode function, * set function, * compare function, * free value space function, * action function, * access permission flags, * value type */ /* define ATTR_XXX in pbs_ifl.h */ /* sync SRV_ATTR_XXX w/enum srv_atr in server.h */ /* define default in server_limits.h */ /* set default in pbsd_init() in pbsd_init.c */ attribute_def svr_attr_def[] = { /* SRV_ATR_State */ { ATTR_status, /* "server_state" */ decode_null, encode_svrstate, set_null, comp_l, free_null, NULL_FUNC, READ_ONLY, ATR_TYPE_LONG, PARENT_TYPE_SERVER, }, /* SRV_ATR_scheduling */ { ATTR_scheduling, decode_b, encode_b, set_b, comp_b, free_null, poke_scheduler, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER, }, /* SRV_ATR_max_running */ { ATTR_maxrun, /* "max_running" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_MaxUserRun */ { ATTR_maxuserrun, /* "max_user_run" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_MaxGrpRun */ { ATTR_maxgrprun, /* "max_group_run" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_TotalJobs */ { ATTR_total, /* "total_jobs" */ decode_null, encode_l, set_null, comp_l, free_null, NULL_FUNC, READ_ONLY, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_JobsByState */ { ATTR_count, /* "state_count" */ decode_null, /* note-uses fixed buffer in server struct */ encode_str, set_null, comp_str, free_null, NULL_FUNC, READ_ONLY, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_acl_host_enable */ { ATTR_aclhten, /* "acl_host_enable" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_acl_hosts */ { ATTR_aclhost, /* "acl_hosts" */ decode_arst, encode_arst, set_hostacl, comp_arst, free_arst, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_ACL, PARENT_TYPE_SERVER }, /* SRV_ATR_AclUserEnabled */ /* User ACL to be used */ { ATTR_acluren, /* "acl_user_enable" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_AclUsers */ /* User Acess Control List */ { ATTR_acluser, /* "acl_users" */ decode_arst, encode_arst, set_uacl, comp_arst, free_arst, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_ACL, PARENT_TYPE_SERVER }, /* SRV_ATR_AclRoot */ /* List of which roots may execute jobs */ { ATTR_aclroot, /* "acl_roots" */ decode_arst, encode_arst, set_uacl, comp_arst, free_arst, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_ACL, PARENT_TYPE_SERVER }, /* SRV_ATR_managers */ { ATTR_managers, /* "managers" */ decode_arst, encode_arst, set_uacl, comp_arst, free_arst, manager_oper_chk, MGR_ONLY_SET, ATR_TYPE_ACL, PARENT_TYPE_SERVER }, /* SRV_ATR_operators */ { ATTR_operators, /* "operators" */ decode_arst, encode_arst, set_uacl, comp_arst, free_arst, manager_oper_chk, MGR_ONLY_SET, ATR_TYPE_ACL, PARENT_TYPE_SERVER }, /* SRV_ATR_dflt_que */ { ATTR_dfltque, /* "default_queue" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, NO_USER_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_log_events */ { ATTR_logevents, /* "log_events" */ decode_l, encode_l, set_l, comp_l, restore_attr_default, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_mailfrom */ { ATTR_mailfrom, /* "mail_from" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, NO_USER_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_query_others */ { ATTR_queryother, /* "query_other_jobs" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_resource_avail */ { ATTR_rescavail, /* "resources_available" */ decode_resc, encode_resc, set_resc, comp_resc, free_resc, NULL_FUNC, NO_USER_SET, ATR_TYPE_RESC, PARENT_TYPE_SERVER }, /* SRV_ATR_resource_deflt */ { ATTR_rescdflt, /* "resources_default" */ decode_resc, encode_resc, set_resc, comp_resc, free_resc, NULL_FUNC, NO_USER_SET, ATR_TYPE_RESC, PARENT_TYPE_SERVER }, /* SRV_ATR_ResourceMax */ { ATTR_rescmax, /* "resources_max" */ decode_resc, encode_resc, set_resc, comp_resc, free_resc, NULL_FUNC, NO_USER_SET, ATR_TYPE_RESC, PARENT_TYPE_SERVER }, /* SRV_ATR_resource_assn */ { ATTR_rescassn, /* "resources_assigned" */ decode_resc, encode_resc, set_resc, comp_resc, free_resc, NULL_FUNC, READ_ONLY, ATR_TYPE_RESC, PARENT_TYPE_SERVER }, /* SRV_ATR_resource_cost */ { ATTR_resccost, /* "resources_cost" */ decode_rcost, /* these are not right, haven't figured this out yet */ encode_rcost, set_rcost, NULL_FUNC, free_rcost, NULL_FUNC, NO_USER_SET, ATR_TYPE_RESC, PARENT_TYPE_SERVER }, /* SRV_ATR_sys_cost */ { ATTR_syscost, /* "system_cost" */ decode_l, encode_l, set_l, NULL_FUNC, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_schedule_iteration */ { ATTR_schedit, /* "schedule_iteration" */ decode_l, encode_l, set_l, comp_l, free_noop, /* disable unset */ schiter_chk, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_ping_rate */ { ATTR_pingrate, /* "node_ping_rate" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_check_rate */ { ATTR_ndchkrate, /* "node_check_rate" */ decode_l, encode_l, set_l, comp_l, free_noop, /* disable unset */ NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_tcp_timeout */ { ATTR_tcptimeout, /* "tcp_timeout" */ decode_l, encode_l, set_l, comp_l, restore_attr_default, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_Comment */ { ATTR_comment, /* "comment" - information */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_DefNode */ { ATTR_defnode, /* "default_node" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_NodePack */ { ATTR_nodepack, /* "node_pack" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_NodeSuffix */ { ATTR_nodesuffix, /* "node_suffix" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_JobStatRate */ { ATTR_jobstatrate, /* "job_stat_rate" */ decode_l, encode_l, set_l, comp_l, restore_attr_default, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_PollJobs */ { ATTR_polljobs, /* "poll_jobs" */ decode_b, encode_b, set_b, comp_b, restore_attr_default, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_LogLevel */ { ATTR_loglevel, /* "loglevel" */ decode_l, encode_l, set_l, comp_l, restore_attr_default, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_DownOnError */ { ATTR_downonerror, /* "down_on_error" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_DisableServerIdCheck */ { ATTR_disableserveridcheck, /* "disable_server_id_check" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_JobNanny */ { ATTR_jobnanny, /* "job_nanny" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_OwnerPurge */ { ATTR_ownerpurge, /* "owner_purge" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_QCQLimits */ { ATTR_qcqlimits, /* "queue_centric_limits" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_MomJobSync */ { ATTR_momjobsync, /* "mom_job_sync" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_MailDomain */ { ATTR_maildomain, /* "mail_domain" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_version */ { ATTR_pbsversion, /* "pbs_version" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, READ_ONLY, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_KillDelay */ { ATTR_killdelay, /* "kill_delay" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_AclLogic */ { ATTR_acllogic, /* "acl_logic_or" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_AclGroupSloppy */ { ATTR_aclgrpslpy, /* "acl_group_sloppy" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_KeepCompleted */ { ATTR_keepcompleted, /* "keep_completed" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_SubmitHosts */ { ATTR_submithosts, /* "submit_hosts" */ decode_arst, encode_arst, set_arst, comp_arst, free_arst, NULL_FUNC, NO_USER_SET, ATR_TYPE_ARST, PARENT_TYPE_SERVER }, /* SRV_ATR_AllowNodeSubmit */ { ATTR_allownodesubmit, /* "allow_node_submit" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_AllowProxyUser */ { ATTR_allowproxyuser, /* "allow_proxy_user" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_AutoNodeNP */ { ATTR_autonodenp, /* "auto_node_np" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_LogFileMaxSize */ { ATTR_logfilemaxsize, /* "log_file_max_size" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_LogFileRollDepth */ { ATTR_logfilerolldepth, /* "log_file_roll_depth" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SVR_ATR_Log_Keep_Days */ { ATTR_logkeepdays, /* "log_keep_days" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_NextJobNumber */ { ATTR_nextjobnum, decode_l, encode_l, set_nextjobnum, comp_l, free_noop, nextjobnum_chk, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_tokens */ { ATTR_tokens, decode_arst, encode_arst, set_tokens, comp_arst, free_arst, token_chk, MGR_ONLY_SET, ATR_TYPE_ARST, PARENT_TYPE_SERVER }, /* SRV_ATR_NetCounter */ { ATTR_netcounter, /* "net_counter" */ decode_null, encode_str, set_null, comp_str, free_null, NULL_FUNC, READ_ONLY, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_ExtraResc */ { ATTR_extraresc, /* "extra_resc" */ decode_arst, encode_arst, set_arst, comp_arst, free_extraresc, extra_resc_chk, NO_USER_SET, ATR_TYPE_ARST, PARENT_TYPE_SERVER }, /* SRV_ATR_ServerName */ { ATTR_servername, /* "server_name" */ decode_str, encode_str, set_str, comp_str, free_str, servername_chk, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_SchedVersion */ { ATTR_schedversion, /* "sched_version" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_AcctKeepDays */ { ATTR_acctkeepdays, /* "accounting_keep_days" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_lockfile */ { ATTR_lockfile, /* "lock_file" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_lockfile */ { ATTR_LockfileUpdateTime, /* lock_file_update_time */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_LockfileCheckTime */ { ATTR_LockfileCheckTime, /* lock_file_check_time */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_CredentialLifetime */ { ATTR_credentiallifetime, /* "credential_lifetime" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_JobMustReport */ { ATTR_jobmustreport, /* "job_must_report" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_checkpoint_dir */ { ATTR_checkpoint_dir, /* "checkpoint_dir" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /*SRV_ATR_display_job_server_suffix */ { ATTR_dispsvrsuffix, /* "display_job_server_suffix" */ decode_b, encode_b, set_b, comp_b, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /*SRV_ATR_job_suffix_alias */ { ATTR_jobsuffixalias, /* "job_suffix_alias" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_MailSubjectFmt */ { ATTR_mailsubjectfmt, /* "mail_subject_fmt" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_MailBodyFmt */ { ATTR_mailbodyfmt, /* "mail_body_fmt" */ decode_str, encode_str, set_str, comp_str, free_str, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_STR, PARENT_TYPE_SERVER }, /* SRV_ATR_NPDefault */ { ATTR_npdefault, /* "np_default" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_JobStartTimeout */ { ATTR_jobstarttimeout, /* "job_start_timeout" */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, NO_USER_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* SRV_ATR_JobForceCancelTime */ { ATTR_jobforcecanceltime, /* job_force_cancel_time */ decode_l, encode_l, set_l, comp_l, free_null, NULL_FUNC, MGR_ONLY_SET, ATR_TYPE_LONG, PARENT_TYPE_SERVER }, /* site supplied server attribute definitions if any, see site_svr_attr_*.h */ #include "site_svr_attr_def.h" }; torque-2.4.16/src/server/req_locate.c0000664000113300011330000001357211272401245014421 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * svr_locate.c * * Functions relating to the Locate Job Batch Request. * * Included funtions are: * * */ #include /* the master config generated by configure */ #include #include "libpbs.h" #include #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "work_task.h" #include "tracking.h" #include "pbs_error.h" #include "log.h" /* Global Data Items: */ extern struct server server; extern char server_name[]; extern int LOGLEVEL; /* * req_locatejob - service the Locate Job Request * * This request attempts to locate a job. */ void req_locatejob( struct batch_request *preq) { char *at; int i; job *pjob; char *location = (char *)0; if ((at = strchr(preq->rq_ind.rq_locate, (int)'@'))) * at = '\0'; /* strip off @server_name */ pjob = find_job(preq->rq_ind.rq_locate); if (pjob) { location = server_name; } else { for (i = 0; i < server.sv_tracksize; i++) { if ((server.sv_track + i)->tk_mtime && !strcmp((server.sv_track + i)->tk_jobid, preq->rq_ind.rq_locate)) { location = (server.sv_track + i)->tk_location; break; } } } if (location != NULL) { preq->rq_reply.brp_code = 0; preq->rq_reply.brp_auxcode = 0; preq->rq_reply.brp_choice = BATCH_REPLY_CHOICE_Locate; strcpy(preq->rq_reply.brp_un.brp_locate, location); reply_send(preq); } else { if (LOGLEVEL >= 7) { log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, preq->rq_ind.rq_locate, "cannot find job in server tracking list"); } req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); } return; } /* END req_locatejob() */ torque-2.4.16/src/server/attr_recov.c0000664000113300011330000003217311272401245014451 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * save_attr.c - This file contains the functions to perform a buffered * save of an object (structure) and an attribute array to a file. * It also has the function to recover (reload) an attribute array. * * Included public functions are: * * save_setup called to initialize the buffer * save_struct copy a struct into the save i/o buffer * save_flush flush out the current save operation * save_attr buffer and write attributes to disk file * recov_attr read attributes from disk file */ #include /* the master config generated by configure */ #include "pbs_ifl.h" #include #include #include #include #include #include #include "list_link.h" #include "attribute.h" #include "log.h" #include "svrfunc.h" /* Global Variables */ extern int resc_access_perm; /* data items global to functions in this file */ #define PKBUFSIZE 2048 #define ENDATTRIBUTES -711 char pk_buffer[PKBUFSIZE]; /* used to do buffered output */ static int pkbfds = -2; /* descriptor to use for saves */ static size_t spaceavail; /* space in pk_buffer available */ static size_t spaceused = 0; /* amount of space used in pkbuffer */ /* * save_setup - set up the save i/o buffer. * The "buffer control information" is left updated to reflect * the file descriptor, and the space in the buffer. */ void save_setup( int fds) /* file descriptor to use for save */ { if (pkbfds != -2) { /* somebody forgot to flush the buffer */ log_err(-1, "save_setup", "someone forgot to flush"); } /* initialize buffer control */ pkbfds = fds; spaceavail = PKBUFSIZE; spaceused = 0; return; } /* END save_setup() */ /* * save_struct - Copy a structure (as a block) into the save i/o buffer * This is useful to save fixed sized structure without pointers * that point outside of the structure itself. * * Write out buffer as required. Leave spaceavail and spaceused updated * * Returns: 0 on success * -1 on error */ int save_struct( char *pobj, /* I */ unsigned int objsize) /* I */ { int amt; size_t copysize; int i; char *pbufin; char *pbufout; assert(pkbfds >= 0); /* NOTE: pkbfds, spaceavail, spaceused, and pk_buffer are global */ while (objsize > 0) { pbufin = pk_buffer + spaceused; if (objsize > spaceavail) { copysize = spaceavail; if (copysize != 0) { memcpy(pbufin, pobj, copysize); } amt = PKBUFSIZE; pbufout = pk_buffer; while ((i = write(pkbfds, pbufout, amt)) != amt) { if (i == -1) { if (errno != EINTR) { return(-1); } } else { amt -= i; pbufout += i; } } pobj += copysize; spaceavail = PKBUFSIZE; spaceused = 0; } else { copysize = (size_t)objsize; memcpy(pbufin, pobj, copysize); spaceavail -= copysize; spaceused += copysize; } objsize -= copysize; } /* while (objsize > 0) */ return(0); } /* END save_struct() */ /* * save_flush - flush out the current save operation * Flush buffer if needed, reset spaceavail, spaceused, * clear out file descriptor * * Returns: 0 on success * -1 on failure (flush failed) */ int save_flush(void) { int i; char *pbuf; /* NOTE: spaceused, pkbfds, and pk_buffer are global */ assert(pkbfds >= 0); pbuf = pk_buffer; if (spaceused > 0) { while ((i = write(pkbfds, pbuf, spaceused)) != (ssize_t)spaceused) { if (i == -1) { if (errno != EINTR) { log_err(errno, "save_flush", "bad write"); return(-1); } } else { pbuf += i; spaceused -= i; } } } pkbfds = -2; /* flushed flag */ return(0); } /* END save_flush() */ /* * save_attr() - write set of attributes to disk file * * Each of the attributes is encoded into the attrlist form. * They are packed and written using save_struct(). * * The final real attribute is followed by a dummy attribute with a * al_size of ENDATTRIB. This cannot be mistaken for the size of a * real attribute. * * Note: attributes of type ATR_TYPE_ACL are not saved with the other * attribute of the parent (queue or server). They are kept in their * own file. */ int save_attr( struct attribute_def *padef, /* attribute definition array */ struct attribute *pattr, /* ptr to attribute value array */ int numattr) /* number of attributes in array */ { svrattrl dummy; int errct = 0; tlist_head lhead; int i; svrattrl *pal; int rc; /* encode each attribute which has a value (not non-set) */ CLEAR_HEAD(lhead); for (i = 0;i < numattr;i++) { if ((padef + i)->at_type != ATR_TYPE_ACL) { /* NOTE: access lists are not saved this way */ rc = (padef + i)->at_encode( pattr + i, &lhead, (padef + i)->at_name, NULL, ATR_ENCODE_SAVE); if (rc < 0) errct++; (pattr + i)->at_flags &= ~ATR_VFLAG_MODIFY; /* now that it has been encoded, block and save it */ while ((pal = (svrattrl *)GET_NEXT(lhead)) != NULL) { if (save_struct((char *)pal, pal->al_tsize) < 0) errct++; delete_link(&pal->al_link); free(pal); } } } /* END for (i) */ /* indicate last of attributes by writing dummy entry */ memset(&dummy, 0, sizeof(dummy)); dummy.al_tsize = ENDATTRIBUTES; if (save_struct((char *)&dummy, sizeof(dummy)) < 0) errct++; if (errct != 0) { return(-1); } /* SUCCESS */ return(0); } /* END save_attr() */ /* * recov_attr() - read attributes from disk file * * Recover (reload) attribute from file written by save_attr(). * Since this is not often done (only on server initialization), * Buffering the reads isn't done. */ int recov_attr( int fd, void *parent, struct attribute_def *padef, struct attribute *pattr, int limit, int unknown, int do_actions) { static char id[] = "recov_attr"; int amt; int i; int index; svrattrl *pal = NULL; int palsize = 0; svrattrl tempal; /* set all privileges (read and write) for decoding resources */ /* This is a special (kludge) flag for the recovery case, see */ /* decode_resc() in lib/Libattr/attr_fn_resc.c */ resc_access_perm = ATR_DFLAG_ACCESS; /* For each attribute, read in the attr_extern header */ while (1) { i = read(fd, (char *) & tempal, sizeof(tempal)); if (i != sizeof(tempal)) { log_err(errno, id, "read1"); return(-1); } if (tempal.al_tsize == ENDATTRIBUTES) break; /* hit dummy attribute that is eof */ if (tempal.al_tsize <= (int)sizeof(tempal)) { log_err(-1, id, "attr size too small"); return(-1); } /* read in the attribute chunck (name and encoded value) */ palsize = tempal.al_tsize; pal = (svrattrl *)calloc(1, palsize); if (pal == NULL) { log_err(errno, id, "calloc failed"); return(-1); } *pal = tempal; CLEAR_LINK(pal->al_link); /* read in the actual attribute data */ amt = pal->al_tsize - sizeof(svrattrl); i = read(fd, (char *)pal + sizeof(svrattrl), amt); if (i != amt) { log_err(errno, id, "read2"); free(pal); return(-1); } /* the pointer into the data are of course bad, so reset them */ pal->al_name = (char *)pal + sizeof(svrattrl); if (pal->al_rescln) pal->al_resc = pal->al_name + pal->al_nameln; else pal->al_resc = NULL; if (pal->al_valln) pal->al_value = pal->al_name + pal->al_nameln + pal->al_rescln; else pal->al_value = NULL; /* find the attribute definition based on the name */ index = find_attr(padef, pal->al_name, limit); if (index < 0) { /* * There are two ways this could happen: * 1. if the (job) attribute is in the "unknown" list - * keep it there; * 2. if the server was rebuilt and an attribute was * deleted, - the fact is logged and the attribute * is discarded (system,queue) or kept (job) * */ if (unknown > 0) { index = unknown; } else { log_err(-1, id, "unknown attribute discarded"); free(pal); continue; } } /* END if (index < 0) */ (padef + index)->at_decode( pattr + index, pal->al_name, pal->al_resc, pal->al_value); if ((do_actions) && (padef + index)->at_action != (int (*)())0) (padef + index)->at_action(pattr + index, parent, ATR_ACTION_RECOV); (pattr + index)->at_flags = pal->al_flags & ~ATR_VFLAG_MODIFY; free(pal); } /* END while (1) */ return(0); } /* END recov_attr() */ /* END attr_recov.c */ torque-2.4.16/src/server/req_holdarray.c0000664000113300011330000000611711272401245015134 00000000000000#include /* the master config generated by configure */ #include #include "sys/types.h" #include "libpbs.h" #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "pbs_error.h" #include "log.h" #include "acct.h" #include "svrfunc.h" #include "array.h" #include "csv.h" extern int chk_hold_priv A_((long val, int perm)); extern int get_hold A_((tlist_head *, char **, attribute *)); extern int svr_authorize_req(struct batch_request *preq, char *owner, char *submit_host); extern char *msg_permlog; void req_holdarray(struct batch_request *preq) { long *hold_val; int newstate; int newsub; long old_hold; job *pjob; char *pset; int rc; attribute temphold; attribute *pattr; char owner[PBS_MAXUSER + 1]; job_array *pa; /* batch_request *preq_tmp; */ pa = get_array(preq->rq_ind.rq_hold.rq_orig.rq_objname); if (pa == NULL) { /* this shouldn't happen since we verify that this is a valid array just prior to calling this function */ req_reject(PBSE_UNKARRAYID, 0, preq, NULL, "unable to find array"); } get_jobowner(pa->ai_qs.owner, owner); if (svr_authorize_req(preq, owner, pa->ai_qs.submit_host) == -1) { sprintf(log_buffer, msg_permlog, preq->rq_type, "Array", preq->rq_ind.rq_delete.rq_objname, preq->rq_user, preq->rq_host); log_event( PBSEVENT_SECURITY, PBS_EVENTCLASS_JOB, preq->rq_ind.rq_delete.rq_objname, log_buffer); req_reject(PBSE_PERM, 0, preq, NULL, "operation not permitted"); return; } if ((rc = get_hold(&preq->rq_ind.rq_hold.rq_orig.rq_attr, &pset, &temphold)) != 0) { req_reject(rc, 0, preq, NULL, NULL); return; } /* if other than HOLD_u is being set, must have privil */ if ((rc = chk_hold_priv(temphold.at_val.at_long, preq->rq_perm)) != 0) { req_reject(rc, 0, preq, NULL, NULL); return; } pjob = (job*)GET_NEXT(pa->array_alljobs); while (pjob != NULL) { hold_val = &pjob->ji_wattr[(int)JOB_ATR_hold].at_val.at_long; old_hold = *hold_val; *hold_val |= temphold.at_val.at_long; pjob->ji_wattr[(int)JOB_ATR_hold].at_flags |= ATR_VFLAG_SET; pattr = &pjob->ji_wattr[(int)JOB_ATR_checkpoint]; if ((pjob->ji_qs.ji_state == JOB_STATE_RUNNING) && ((pattr->at_flags & ATR_VFLAG_SET) && ((csv_find_string(pattr->at_val.at_str, "s") != NULL) || (csv_find_string(pattr->at_val.at_str, "c") != NULL) || (csv_find_string(pattr->at_val.at_str, "enabled") != NULL)))) { /* TODO */ /* preq_tmp = alloc_br(preq->rq_type); */ } else if (old_hold != *hold_val) { /* indicate attributes changed */ pjob->ji_modified = 1; svr_evaljobstate(pjob, &newstate, &newsub, 0); svr_setjobstate(pjob, newstate, newsub); } pjob = (job*)GET_NEXT(pjob->ji_arrayjobs); } reply_ack(preq); } torque-2.4.16/src/server/pbsd_init.c0000664000113300011330000014010711403757171014261 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _CRAY #include #endif /* _CRAY */ #include #include #include "pbs_ifl.h" #include "log.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "server.h" #include "queue.h" #include "pbs_job.h" #include "resource.h" #include "work_task.h" #include "tracking.h" #include "svrfunc.h" #include "acct.h" #include "rpp.h" #include "net_connect.h" #include "pbs_proto.h" #include "batch_request.h" #include "array.h" #include "csv.h" #include "pbs_nodes.h" /*#ifndef SIGKILL*/ /* there is some weird stuff in gcc include files signal.h & sys/params.h */ #include /*#endif*/ #ifndef SUCCESS #define SUCCESS 1 #endif /* SUCCESS */ #ifndef FAILURE #define FAILURE 0 #endif /* FAILURE */ #ifndef TRUE #define TRUE 1 #endif /* TRUE */ #ifndef FALSE #define FALSE 0 #endif /* FALSE */ /* global Data Items */ extern char *msg_startup3; extern char *msg_daemonname; extern char *msg_init_abt; extern char *msg_init_queued; extern char *msg_init_substate; extern char *msg_err_noqueue; extern char *msg_err_malloc; extern char *msg_init_noqueues; extern char *msg_init_recovque; extern char *msg_init_expctq; extern char *msg_init_nojobs; extern char *msg_init_exptjobs; extern char *msg_init_norerun; extern char *msg_init_unkstate; extern char *msg_init_baddb; extern char *msg_init_chdir; extern char *msg_init_badjob; extern char *msg_script_open; extern char *acct_file; extern char *log_file; extern char *path_home; extern char *path_acct; extern char path_log[]; extern char *path_priv; extern char *path_arrays; extern char *path_jobs; extern char *path_queues; extern char *path_spool; extern char *path_svrdb; extern char *path_svrdb_new; extern char *path_svrlog; extern char *path_track; extern char *path_nodes; extern char *path_nodes_new; extern char *path_nodestate; extern char *path_nodenote; extern char *path_nodenote_new; extern char *path_checkpoint; extern int queue_rank; extern char server_name[]; extern int svr_delay_entry; extern tlist_head svr_newjobs; extern tlist_head svr_alljobs; extern tlist_head svr_queues; extern tlist_head svr_requests; extern tlist_head svr_newnodes; extern tlist_head svr_jobarrays; extern tlist_head task_list_immed; extern tlist_head task_list_timed; extern tlist_head task_list_event; extern time_t time_now; extern int a_opt_init; extern int LOGLEVEL; extern char *plogenv; extern struct server server; /* External Functions Called */ extern void on_job_exit A_((struct work_task *)); extern void on_job_rerun A_((struct work_task *)); extern void set_resc_assigned A_((job *, enum batch_op)); extern void set_old_nodes A_((job *)); extern void acct_close A_((void)); extern struct work_task *apply_job_delete_nanny A_((struct job *, int)); extern int net_move A_((job *, struct batch_request *)); extern void job_clone_wt A_((struct work_task *)); /* Private functions in this file */ static void init_abt_job A_((job *)); static char *build_path A_((char *, char *, char *)); static void catch_child A_((int)); static void catch_abort A_((int)); static void change_logs A_((int)); static void change_log_level A_((int)); static int chk_save_file A_((char *)); static void need_y_response A_((int)); static int pbsd_init_job A_((job *, int)); static void pbsd_init_reque A_((job *, int)); static void resume_net_move A_((struct work_task *)); static void rm_files A_((char *)); static void stop_me A_((int)); /* private data */ #define CHANGE_STATE 1 #define KEEP_STATE 0 /** * dynamic array, with utility functions for easy appending */ typedef struct darray_t { int Length; void **Data; int AppendIndex; } darray_t; /** * Initialize a dynamic array to a specific size * @param Array (O) Assumed to be uninitialized struct * @param InitialSize (I) raised to 0 if less than 0 */ int DArrayInit( darray_t *Array, /* I */ int InitialSize) /* I */ { if (InitialSize <= 0) { Array->Length = 0; Array->Data = NULL; } else { Array->Length = InitialSize; Array->Data = (void **)malloc(sizeof(Array->Data[0]) * InitialSize); if (Array->Data == NULL) return(FAILURE); } Array->AppendIndex = 0; return(SUCCESS); } /*END DArrayInit */ /** * Free the resources associated with Array * It does NOT free any data stored in the array, just the array structure itself. * param Array (I) */ int DArrayFree( darray_t *Array) /* I */ { free(Array->Data); Array->Data = NULL; Array->Length = 0; Array->AppendIndex = 0; return(SUCCESS); } /*END DArrayFree */ /** * Append Item onto the end of Array, resizing it if necessary * @param Array (I/O) * @param Item (I) */ int DArrayAppend( darray_t *Array, /* I/O */ void *Item) /* I */ { if(Array->AppendIndex >= Array->Length) { int newLength = Array->Length * 2; if(newLength <= 10) newLength = 10; Array->Length = newLength; Array->Data = realloc(Array->Data,sizeof(Array->Data[0]) * Array->Length); if(Array->Data == NULL) { Array->Length = 0; Array->AppendIndex = 0; return(FAILURE); } } /* assert(Array->AppendIndex >= 0); assert(Array->AppendIndex < Array->Length); */ Array->Data[Array->AppendIndex++] = Item; return(SUCCESS); } /* END DArrayAppend */ /** * Sort two job structs by their priority in ascending order * @param A (I) * @param B (I) */ static int SortPrioAscend( const void *A, /* I */ const void *B) /* I */ { job *pjob1 = *((job **)A); job *pjob2 = *((job **)B); int prio1 = pjob1->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long; int prio2 = pjob2->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long; return(prio1 - prio2); } /*END SortPrioAscend */ void update_default_np() { struct pbsnode *pnode; int i; long default_np; long npfreediff; default_np = server.sv_attr[(int)SRV_ATR_NPDefault].at_val.at_long; if(default_np > 0) { for(i = 0; i < svr_totnodes; i++) { pnode = pbsndlist[i]; npfreediff = pnode->nd_nsn - pnode->nd_nsnfree; pnode->nd_nsn = default_np; pnode->nd_nsnfree = default_np - npfreediff; } } return; } /* Add the server names from /var/spool/torque/server_name to the trusted hosts list. */ void add_server_names_to_acl_hosts(void) { int n, list_len, rc; char *server_list_ptr; char *tp; char buffer[PBS_MAXSERVERNAME+1]; attribute temp; struct attribute *patr = &server.sv_attr[(int)SRV_ATR_acl_hosts]; server_list_ptr = pbs_get_server_list(); list_len = csv_length(server_list_ptr); for (n = 0; n < list_len; n++) { tp = csv_nth(server_list_ptr, n); if (tp) { strcpy(buffer, tp); if ((tp = strchr(buffer, ':'))) /* Don't include any port specification */ *tp = 0; if ((rc = decode_arst_direct(&temp, buffer)) != 0) { return; } set_arst(patr, &temp, DECR); /* First make sure that the strings are not there. */ set_arst(patr, &temp, INCR); free_arst(&temp); } } return; } /* * This file contains the functions to initialize the PBS Batch Server. * The code is called once when the server is brought up. */ int pbsd_init( int type) /* type of initialization */ { int baselen = 0; char basen[MAXPATHLEN+1]; struct dirent *pdirent; DIR *dir; int fd; int had; int i; static char id[] = "pbsd_init"; char *job_suffix = JOB_FILE_SUFFIX; int job_suf_len = strlen(job_suffix); int array_suf_len = strlen(ARRAY_FILE_SUFFIX); int logtype; char *new_tag = ".new"; job *pjob; pbs_queue *pque; char *psuffix; int rc; int Index; struct stat statbuf; char *suffix_slash = "/"; struct sigaction act; struct sigaction oact; struct work_task *wt; job_array *pa; #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) char EMsg[1024]; #endif /* not DEBUG and not NO_SECURITY_CHECK */ extern int TForceUpdate; /* The following is code to reduce security risks */ if (setup_env(PBS_ENVIRON) == -1) { return(-1); } i = getgid(); /* secure suppl. groups */ if (setgroups(1,(gid_t *)&i) != 0) { snprintf(log_buffer, sizeof(log_buffer), "Unable to drop secondary groups. Some MAC framework is active?\n"); log_err(errno, id, log_buffer); snprintf(log_buffer, sizeof(log_buffer), "setgroups(group = %lu) failed: %s\n", (unsigned long)i, strerror(errno)); log_err(errno, id, log_buffer); return(-1); } #ifndef DEBUG #ifdef _CRAY limit(C_JOB, 0, L_CPROC, 0); limit(C_JOB, 0, L_CPU, 0); limit(C_JOBPROCS, 0, L_CPU, 0); limit(C_PROC, 0, L_FD, 255); limit(C_JOB, 0, L_FSBLK, 0); limit(C_JOBPROCS, 0, L_FSBLK, 0); limit(C_JOB, 0, L_MEM , 0); limit(C_JOBPROCS, 0, L_MEM , 0); #else /* not _CRAY */ { struct rlimit rlimit; rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CPU, &rlimit); setrlimit(RLIMIT_FSIZE, &rlimit); setrlimit(RLIMIT_DATA, &rlimit); setrlimit(RLIMIT_STACK, &rlimit); #ifdef RLIMIT_RSS setrlimit(RLIMIT_RSS, &rlimit); #endif /* RLIMIT_RSS */ #ifdef RLIMIT_VMEM setrlimit(RLIMIT_VMEM, &rlimit); #endif /* RLIMIT_VMEM */ } #endif /* not _CRAY */ #endif /* DEBUG */ /* 1. set up to catch or ignore various signals */ sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = change_logs; if (sigaction(SIGHUP, &act, &oact) != 0) { log_err(errno, id, "sigaction for HUP"); return(2); } act.sa_handler = stop_me; if (sigaction(SIGINT, &act, &oact) != 0) { log_err(errno, id, "sigaction for INT"); return(2); } if (sigaction(SIGTERM, &act, &oact) != 0) { log_err(errno, id, "sigactin for TERM"); return(2); } #ifdef NDEBUG if (sigaction(SIGQUIT, &act, &oact) != 0) { log_err(errno, id, "sigactin for QUIT"); return(2); } #endif /* NDEBUG */ #ifdef SIGSHUTDN if (sigaction(SIGSHUTDN, &act, &oact) != 0) { log_err(errno, id, "sigactin for SHUTDN"); return(2); } #endif /* SIGSHUTDN */ /* * Catch these signals to ensure we core dump even if * our rlimit for core dumps is set to 0 initially. * * Chris Samuel - VPAC * csamuel@vpac.org - 29th July 2003 * * Now conditional on PBSCOREDUMP environment variable. * 13th August 2003. */ if (getenv("PBSCOREDUMP")) { act.sa_handler = catch_abort; /* make sure we core dump */ sigaction(SIGSEGV, &act, NULL); sigaction(SIGBUS, &act, NULL); sigaction(SIGFPE, &act, NULL); sigaction(SIGILL, &act, NULL); sigaction(SIGTRAP, &act, NULL); sigaction(SIGSYS, &act, NULL); } #ifdef NO_SIGCHLD act.sa_handler = SIG_DFL; #else act.sa_handler = catch_child; #endif if (sigaction(SIGCHLD, &act, &oact) != 0) { log_err(errno, id, "sigaction for CHLD"); return(2); } act.sa_handler = SIG_IGN; if (sigaction(SIGPIPE, &act, &oact) != 0) { log_err(errno, id, "sigaction for PIPE"); return(2); } act.sa_handler = change_log_level; if (sigaction(SIGUSR1, &act, &oact) != 0) { log_err(errno, id, "sigaction for USR1"); return(2); } if (sigaction(SIGUSR2, &act, &oact) != 0) { log_err(errno, id, "sigaction for USR2"); return(2); } /* 2. set up the various paths and other global variables we need */ if(path_priv == NULL) { path_priv = build_path(path_home, PBS_SVR_PRIVATE, suffix_slash); } path_arrays = build_path(path_priv, PBS_ARRAYDIR, suffix_slash); path_spool = build_path(path_home, PBS_SPOOLDIR, suffix_slash); path_queues = build_path(path_priv, PBS_QUEDIR, suffix_slash); path_jobs = build_path(path_priv, PBS_JOBDIR, suffix_slash); path_acct = build_path(path_priv, PBS_ACCT, suffix_slash); if(path_svrdb == NULL) { path_svrdb = build_path(path_priv, PBS_SERVERDB, NULL); } path_svrdb_new = build_path(path_priv, PBS_SERVERDB, new_tag); path_svrlog = build_path(path_home, PBS_LOGFILES, suffix_slash); path_track = build_path(path_priv, PBS_TRACKING, NULL); path_nodes = build_path(path_priv, NODE_DESCRIP, NULL); path_nodes_new = build_path(path_priv, NODE_DESCRIP, new_tag); path_nodestate = build_path(path_priv, NODE_STATUS, NULL); path_nodenote = build_path(path_priv, NODE_NOTE, NULL); path_nodenote_new = build_path(path_priv, NODE_NOTE, new_tag); path_checkpoint = build_path(path_home, PBS_CHKPTDIR, suffix_slash); if (svr_resc_def == NULL) { rc = init_resc_defs(); if (rc != 0) { log_err(rc, "pbsd_init", msg_init_baddb); return(-1); } } #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) rc = chk_file_sec(path_jobs, 1, 0, S_IWGRP | S_IWOTH, 1, EMsg); rc |= chk_file_sec(path_queues, 1, 0, S_IWGRP | S_IWOTH, 0, EMsg); rc |= chk_file_sec(path_spool, 1, 1, S_IWOTH, 0, EMsg); rc |= chk_file_sec(path_acct, 1, 0, S_IWGRP | S_IWOTH, 0, EMsg); rc |= chk_file_sec(PBS_ENVIRON, 0, 0, S_IWGRP | S_IWOTH, 1, EMsg); if (rc != 0) { return(3); } #endif /* not DEBUG and not NO_SECURITY_CHECK */ CLEAR_HEAD(svr_requests); CLEAR_HEAD(task_list_immed); CLEAR_HEAD(task_list_timed); CLEAR_HEAD(task_list_event); CLEAR_HEAD(svr_queues); CLEAR_HEAD(svr_alljobs); CLEAR_HEAD(svr_newjobs); CLEAR_HEAD(svr_newnodes); CLEAR_HEAD(svr_jobarrays); time_now = time((time_t *)0); /* 3. Set default server attibutes values */ for (i = 0;i < SRV_ATR_LAST;i++) clear_attr(&server.sv_attr[i], &svr_attr_def[i]); server.sv_attr[(int)SRV_ATR_schedule_iteration].at_val.at_long = PBS_SCHEDULE_CYCLE; server.sv_attr[(int)SRV_ATR_schedule_iteration].at_flags = ATR_VFLAG_SET; server.sv_attr[(int)SRV_ATR_State].at_val.at_long = SV_STATE_INIT; server.sv_attr[(int)SRV_ATR_State].at_flags = ATR_VFLAG_SET; svr_attr_def[(int)SRV_ATR_mailfrom].at_decode( &server.sv_attr[(int)SRV_ATR_mailfrom], 0, 0, PBS_DEFAULT_MAIL); /* disable ping_rate. no longer used */ /* server.sv_attr[(int)SRV_ATR_ping_rate].at_val.at_long = PBS_NORMAL_PING_RATE; server.sv_attr[(int)SRV_ATR_ping_rate].at_flags = ATR_VFLAG_SET; */ server.sv_attr[(int)SRV_ATR_tcp_timeout].at_val.at_long = PBS_TCPTIMEOUT; server.sv_attr[(int)SRV_ATR_tcp_timeout].at_flags = ATR_VFLAG_SET; server.sv_attr[(int)SRV_ATR_check_rate].at_val.at_long = PBS_NORMAL_PING_RATE / 2; server.sv_attr[(int)SRV_ATR_check_rate].at_flags = ATR_VFLAG_SET; server.sv_attr[(int)SRV_ATR_JobStatRate].at_val.at_long = PBS_RESTAT_JOB; server.sv_attr[(int)SRV_ATR_PollJobs].at_val.at_long = PBS_POLLJOBS; /* 4. force logging of all types */ server.sv_attr[(int)SRV_ATR_log_events].at_val.at_long = PBSEVENT_MASK; server.sv_attr[(int)SRV_ATR_log_events].at_flags = ATR_VFLAG_SET; /* 5. If not a "create" initialization, recover server db */ rc = chk_save_file(path_svrdb); if (type != RECOV_CREATE) { /* Open the server database (save file) and read it in */ if ((rc != 0) || ((rc = svr_recov(path_svrdb, FALSE)) == -1)) { log_err(rc, "pbsd_init", msg_init_baddb); return(-1); } if (server.sv_attr[(int)SRV_ATR_resource_assn].at_flags & ATR_VFLAG_SET) { svr_attr_def[(int)SRV_ATR_resource_assn].at_free( &server.sv_attr[(int)SRV_ATR_resource_assn]); } } else { if (rc == 0) { /* path_svrdb exists */ /* will exit on (n)o response */ if (TForceUpdate == 0) { need_y_response(type); } /* (y)es response received */ rm_files(path_priv); svr_save(&server, SVR_SAVE_FULL); } } svr_attr_def[(int)SRV_ATR_version].at_decode( &server.sv_attr[(int)SRV_ATR_version], 0, 0, PACKAGE_VERSION); /* 6. open accounting file */ if (acct_open(acct_file) != 0) { return(-1); } /* 7. Set up other server and global variables */ if (a_opt_init != -1) { /* a_option was set, overrides saved value of scheduling attr */ server.sv_attr[(int)SRV_ATR_scheduling].at_val.at_long = a_opt_init; server.sv_attr[(int)SRV_ATR_scheduling].at_flags |= ATR_VFLAG_SET; } /* Open and read in node list if one exists */ if ((rc = setup_nodes()) == -1) { /* log_buffer set in setup_nodes */ log_err(-1, "pbsd_init(setup_nodes)", log_buffer); return(-1); } add_server_names_to_acl_hosts(); update_default_np(); /* * 8. If not a "create" initialization, recover queues. * If a create, remove any queues that might be there. */ if (chdir(path_queues) != 0) { sprintf(log_buffer, msg_init_chdir, path_queues); log_err(errno, "pbsd_init", log_buffer); return(-1); } had = server.sv_qs.sv_numque; server.sv_qs.sv_numque = 0; dir = opendir("."); if (dir == NULL) { log_err(-1, "pbsd_init", msg_init_noqueues); return(-1); } while ((pdirent = readdir(dir)) != NULL) { if (pdirent->d_name == NULL) { /* invalid name returned */ continue; } if (chk_save_file(pdirent->d_name) == 0) { /* recover queue */ if ((pque = que_recov(pdirent->d_name)) != NULL) { /* que_recov increments sv_numque */ sprintf(log_buffer, msg_init_recovque, pque->qu_qs.qu_name); log_event( PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); if (pque->qu_attr[(int)QE_ATR_ResourceAssn].at_flags & ATR_VFLAG_SET) { que_attr_def[(int)QE_ATR_ResourceAssn].at_free( &pque->qu_attr[(int)QE_ATR_ResourceAssn]); } } } } closedir(dir); if ((had != server.sv_qs.sv_numque) && (type != RECOV_CREATE)) logtype = PBSEVENT_ERROR | PBSEVENT_SYSTEM; else logtype = PBSEVENT_SYSTEM; sprintf(log_buffer, msg_init_expctq, had, server.sv_qs.sv_numque); log_event(logtype, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); /* * 9. If not "create" or "clean" recovery, recover the jobs. * If a a create or clean recovery, delete any jobs. */ /* 9.a, recover job array info */ if (chdir(path_arrays) != 0) { sprintf(log_buffer, msg_init_chdir, path_arrays); log_err(errno, "pbsd_init", log_buffer); return(-1); } dir = opendir("."); while ((pdirent = readdir(dir)) != NULL) { if (chk_save_file(pdirent->d_name) == 0) { /* if not create or clean recovery, recover arrays */ if ((type != RECOV_CREATE) && (type != RECOV_COLD)) { /* skip files without the proper suffix */ baselen = strlen(pdirent->d_name) - array_suf_len; psuffix = pdirent->d_name + baselen; if (strcmp(psuffix, ARRAY_FILE_SUFFIX)) continue; pa = array_recov(pdirent->d_name); if (pa == NULL) { /* TODO GB */ sprintf(log_buffer, "could not recover array-struct from file %s--skipping", pdirent->d_name); log_err(errno, "pbsd_init", log_buffer); continue; } pa->jobs_recovered = 0; } else { unlink(pdirent->d_name); } } } closedir(dir); /* 9.b, recover jobs */ if (chdir(path_jobs) != 0) { sprintf(log_buffer, msg_init_chdir, path_jobs); log_err(errno, "pbsd_init", log_buffer); return(-1); } had = server.sv_qs.sv_numjobs; server.sv_qs.sv_numjobs = 0; dir = opendir("."); if (dir == NULL) { if ((type != RECOV_CREATE) && (type != RECOV_COLD)) { if (had == 0) { log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_SERVER, msg_daemonname, msg_init_nojobs); } else { sprintf(log_buffer, msg_init_exptjobs, had, 0); log_err(-1, "pbsd_init", log_buffer); } } } else { darray_t Array; DArrayInit(&Array,100); /* Now, for each job found ... */ while ((pdirent = readdir(dir)) != NULL) { if (chk_save_file(pdirent->d_name) == 0) { /* recover the jobs */ baselen = strlen(pdirent->d_name) - job_suf_len; psuffix = pdirent->d_name + baselen; if (!strcmp(psuffix, ".TA")) { if ((pjob = job_recov(pdirent->d_name)) != NULL) { append_link(&svr_alljobs, &pjob->ji_alljobs, pjob); pjob->ji_isparent = TRUE; } else { /* FIXME: what should we do here? we won't be able to finish cloning this array because the initial job file is missing */ } continue; } if (strcmp(psuffix, job_suffix)) continue; if ((pjob = job_recov(pdirent->d_name)) != NULL) { if (DArrayAppend(&Array,pjob) == FAILURE) { log_err(ENOMEM,"main","out of memory reloading jobs"); exit(-1); } } else { sprintf(log_buffer, msg_init_badjob, pdirent->d_name); log_err(-1, "pbsd_init", log_buffer); /* remove corrupt job */ strcpy(basen, pdirent->d_name); psuffix = basen + baselen; strcpy(psuffix, JOB_BAD_SUFFIX); if (link(pdirent->d_name, basen) < 0) { log_err(errno, "pbsd_init", "failed to link corrupt .JB file to .BD"); } else { unlink(pdirent->d_name); } } } } /* END while ((pdirent = readdir(dir)) != NULL) */ closedir(dir); qsort(Array.Data,Array.AppendIndex,sizeof(Array.Data[0]),SortPrioAscend); for (Index = 0; Index < Array.AppendIndex; Index++) { job *pjob = (job *)Array.Data[Index]; if (pbsd_init_job(pjob, type) == FAILURE) { log_event( PBSEVENT_ERROR | PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_JOB | PBSEVENT_FORCE, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, msg_script_open); continue; } if ((type != RECOV_COLD) && (type != RECOV_CREATE) && (!(pjob->ji_wattr[(int)JOB_ATR_job_array_request].at_flags & ATR_VFLAG_SET)) && (pjob->ji_qs.ji_svrflags & JOB_SVFLG_SCRIPT)) { strcpy(basen, pjob->ji_qs.ji_jobid); strcat(basen, JOB_SCRIPT_SUFFIX); if (chk_save_file(basen) != 0) { log_event( PBSEVENT_ERROR | PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_JOB | PBSEVENT_FORCE, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, msg_script_open); init_abt_job(pjob); } } } DArrayFree(&Array); if ((had != server.sv_qs.sv_numjobs) && (type != RECOV_CREATE) && (type != RECOV_COLD)) { logtype = PBSEVENT_ERROR | PBSEVENT_SYSTEM; } else { logtype = PBSEVENT_SYSTEM; } sprintf(log_buffer, msg_init_exptjobs, had, server.sv_qs.sv_numjobs); log_event( logtype, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); } /* END else */ /* If queue_rank has gone negative, renumber all jobs and reset rank */ if (queue_rank < 0) { queue_rank = 0; pjob = (job *)GET_NEXT(svr_alljobs); while (pjob != NULL) { pjob->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long = ++queue_rank; job_save(pjob, SAVEJOB_FULL); pjob = (job *)GET_NEXT(pjob->ji_alljobs); } } /* look for empty arrays and delete them also look for arrays that weren't fully built and setup a work task to continue the cloning process*/ pa = (job_array*)GET_NEXT(svr_jobarrays); while (pa != NULL) { if (pa->ai_qs.num_cloned != pa->ai_qs.array_size) { job *pjob = find_job(pa->ai_qs.parent_id); if (pjob == NULL) { /* TODO, we need to so something here, we can't finish cloning the array! */ } else { /* TODO if num_cloned != num_recovered then something strange happend it is possible num_recovered == num_cloned+1. That means that the server terminated after cloning a job but before updating the saved array_info struct. we probably should delete that last job and start the cloning process off at num_cloned. Someone must have been naughty and did a kill -9 on pbs_server */ wt = set_task(WORK_Timed, time_now + 1, job_clone_wt, (void*)pjob); } } else if (GET_NEXT(pa->array_alljobs) == pa->array_alljobs.ll_struct) { job_array *temp = (job_array*)GET_NEXT(pa->all_arrays); array_delete(pa); pa = temp; } if (pa != NULL) { pa = (job_array*)GET_NEXT(pa->all_arrays); } } /* Put us back in the Server's Private directory */ if (chdir(path_priv) != 0) { sprintf(log_buffer, msg_init_chdir, path_priv); log_err(-1, id, log_buffer); return(3); } /* 10. Open and read in tracking records */ fd = open(path_track, O_RDONLY | O_CREAT, 0600); if (fd < 0) { log_err(errno, "pbsd_init", "unable to open tracking file"); return(-1); } #if !defined(DEBUG) && !defined(NO_SECURITY_CHECK) if (chk_file_sec(path_track, 0, 0, S_IWGRP | S_IWOTH, 0, EMsg) != 0) { return(-1); } #endif /* not DEBUG and not NO_SECURITY_CHECK */ if (fstat(fd, &statbuf) < 0) { log_err(errno, "pbs_init", "unable to stat tracking file"); return(-1); } i = (statbuf.st_size + sizeof(struct tracking) - 1) / sizeof(struct tracking); if (i < PBS_TRACK_MINSIZE) server.sv_tracksize = PBS_TRACK_MINSIZE; else server.sv_tracksize = i; if ((server.sv_track = (struct tracking *)calloc(server.sv_tracksize,sizeof(struct tracking))) == NULL) { /* FAILURE - cannot alloc memory */ log_err(errno,"pbs_init","calloc failure"); return(-1); } for (i = 0;i < server.sv_tracksize;i++) (server.sv_track + i)->tk_mtime = 0; /* NOTE: tracking file records are optional */ i = read(fd, (char *)server.sv_track, server.sv_tracksize * sizeof(struct tracking)); if (i < 0) { log_err(errno, "pbs_init", "unable to read tracksize from tracking file"); } close(fd); server.sv_trackmodifed = 0; /* set work task to periodically save the tracking records */ set_task(WORK_Timed, (long)(time_now + PBS_SAVE_TRACK_TM), track_save, 0); /* SUCCESS */ return(0); } /* END pbsd_init() */ /* * build_path - build the pathname for a PBS directory */ static char *build_path( char *parent, /* parent directory name (dirname) */ char *name, /* sub directory name */ char *suffix) /* suffix string to append */ { int prefixslash; char *ppath; size_t len; /* * allocate space for the names + maybe a slash between + the suffix */ if (*(parent + strlen(parent) - 1) == '/') prefixslash = 0; else prefixslash = 1; len = strlen(parent) + strlen(name) + prefixslash + 1; if (suffix != NULL) len += strlen(suffix); ppath = malloc(len); if (ppath != NULL) { strcpy(ppath, parent); if (prefixslash) strcat(ppath, "/"); strcat(ppath, name); if (suffix) strcat(ppath, suffix); return(ppath); } log_err(errno, "build_path", msg_err_malloc); log_close(1); exit(3); } /* END build_path() */ /* * pbsd_init_job - decide what to do with the recovered job structure * * The action depends on the type of initialization. */ static int pbsd_init_job( job *pjob, /* I */ int type) /* I */ { unsigned int d; struct work_task *pwt; pjob->ji_momhandle = -1; /* update at_server attribute in case name changed */ job_attr_def[(int)JOB_ATR_at_server].at_free( &pjob->ji_wattr[(int)JOB_ATR_at_server]); job_attr_def[(int)JOB_ATR_at_server].at_decode( &pjob->ji_wattr[(int)JOB_ATR_at_server], NULL, NULL, server_name); /* update queue_rank if this job is higher than current */ if ((unsigned long)pjob->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long > (unsigned long)queue_rank) queue_rank = pjob->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long; /* now based on the initialization type */ if ((type == RECOV_COLD) || (type == RECOV_CREATE)) { need_y_response(type); init_abt_job(pjob); return(FAILURE); } if (type != RECOV_HOT) pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_HOTSTART; switch (pjob->ji_qs.ji_substate) { case JOB_SUBSTATE_TRANSICM: if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_HERE) { /* * This server created the job, so client * was qsub (a transient client), it won't be * around to recommit, so auto-commit now */ pjob->ji_qs.ji_state = JOB_STATE_QUEUED; pjob->ji_qs.ji_substate = JOB_SUBSTATE_QUEUED; pbsd_init_reque(pjob, CHANGE_STATE); } else { /* * another server is sending, append to new job * list and wait for commit; need to clear * receiving socket number though */ pjob->ji_qs.ji_un.ji_newt.ji_fromsock = -1; append_link(&svr_newjobs, &pjob->ji_alljobs, pjob); } break; case JOB_SUBSTATE_TRNOUT: pjob->ji_qs.ji_state = JOB_STATE_QUEUED; pjob->ji_qs.ji_substate = JOB_SUBSTATE_QUEUED; /* requeue as queued */ pbsd_init_reque(pjob, CHANGE_STATE); break; case JOB_SUBSTATE_TRNOUTCM: /* requeue as is - rdy to cmt */ pbsd_init_reque(pjob, KEEP_STATE); /* resend rtc */ pwt = set_task(WORK_Immed, 0, resume_net_move, (void *)pjob); if (pwt) { append_link(&pjob->ji_svrtask, &pwt->wt_linkobj, pwt); } break; case JOB_SUBSTATE_QUEUED: case JOB_SUBSTATE_PRESTAGEIN: case JOB_SUBSTATE_STAGEIN: case JOB_SUBSTATE_STAGECMP: case JOB_SUBSTATE_STAGEFAIL: case JOB_SUBSTATE_STAGEGO: case JOB_SUBSTATE_CHKPTGO: case JOB_SUBSTATE_CHKPTCMP: case JOB_SUBSTATE_HELD: case JOB_SUBSTATE_SYNCHOLD: case JOB_SUBSTATE_DEPNHOLD: case JOB_SUBSTATE_WAITING: case JOB_SUBSTATE_PRERUN: pbsd_init_reque(pjob, CHANGE_STATE); break; case JOB_SUBSTATE_RUNNING: pbsd_init_reque(pjob, KEEP_STATE); pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_RescAssn; set_resc_assigned(pjob, INCR); /* suspended jobs don't get reassigned to nodes */ if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_Suspend) == 0) { set_old_nodes(pjob); } if (type == RECOV_HOT) pjob->ji_qs.ji_svrflags |= JOB_SVFLG_HOTSTART; break; case JOB_SUBSTATE_SYNCRES: /* clear all dependent job ready flags */ depend_clrrdy(pjob); pbsd_init_reque(pjob, CHANGE_STATE); break; case JOB_SUBSTATE_EXITING: case JOB_SUBSTATE_STAGEOUT: case JOB_SUBSTATE_STAGEDEL: case JOB_SUBSTATE_EXITED: case JOB_SUBSTATE_ABORT: /* This is delayed because it is highly likely MS is "state-unknown" * at this time, and there's no real hurry anyways. */ apply_job_delete_nanny(pjob, time_now + 60); pwt = set_task(WORK_Immed, 0, on_job_exit, (void *)pjob); if (pwt) { append_link(&pjob->ji_svrtask, &pwt->wt_linkobj, pwt); } pbsd_init_reque(pjob, KEEP_STATE); break; case JOB_SUBSTATE_COMPLETE: /* Completed jobs are no longer purged on startup */ pwt = set_task(WORK_Immed, 0, on_job_exit, (void *)pjob); if (pwt) { append_link(&pjob->ji_svrtask, &pwt->wt_linkobj, pwt); } pbsd_init_reque(pjob, KEEP_STATE); break; case JOB_SUBSTATE_RERUN: if (pjob->ji_qs.ji_state == JOB_STATE_EXITING) { pwt = set_task(WORK_Immed, 0, on_job_rerun, (void *)pjob); if (pwt) { append_link(&pjob->ji_svrtask, &pwt->wt_linkobj, pwt); } } pbsd_init_reque(pjob, KEEP_STATE); break; case JOB_SUBSTATE_RERUN1: case JOB_SUBSTATE_RERUN2: pwt = set_task(WORK_Immed, 0, on_job_rerun, (void *)pjob); if (pwt) { append_link(&pjob->ji_svrtask, &pwt->wt_linkobj, pwt); } pbsd_init_reque(pjob, KEEP_STATE); break; default: sprintf(log_buffer, msg_init_unkstate, pjob->ji_qs.ji_substate); log_event( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); job_abt(&pjob, log_buffer); /* pjob is not freed */ if (pjob == NULL) { return(FAILURE); } break; } /* END switch (pjob->ji_qs.ji_substate) */ /* if job has IP address of Mom, it may have changed */ /* reset based on hostname */ if ((pjob->ji_qs.ji_un_type == JOB_UNION_TYPE_EXEC) && (pjob->ji_qs.ji_un.ji_exect.ji_momaddr != 0)) { if (pjob->ji_wattr[(int)JOB_ATR_exec_host].at_flags & ATR_VFLAG_SET) { pjob->ji_qs.ji_un.ji_exect.ji_momaddr = get_hostaddr( parse_servername(pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str, &d)); } else { pjob->ji_qs.ji_un.ji_exect.ji_momaddr = 0; } } return(SUCCESS); } /* END pbsd_init_job() */ static void pbsd_init_reque( job *pjob, /* I (modified/possibly freed) */ int change_state) /* I */ { char logbuf[265]; int newstate; int newsubstate; sprintf(logbuf, msg_init_substate, pjob->ji_qs.ji_substate); /* re-enqueue the job into the queue it was in */ if (change_state) { /* update the state, typically to some form of QUEUED */ svr_evaljobstate(pjob, &newstate, &newsubstate, 0); svr_setjobstate(pjob, newstate, newsubstate); } else { set_statechar(pjob); } if (svr_enquejob(pjob) == 0) { strcat(logbuf, msg_init_queued); strcat(logbuf, pjob->ji_qs.ji_queue); log_event( PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, logbuf); } else { /* Oops, this should never happen */ sprintf(logbuf, "%s; job %s queue %s", msg_err_noqueue, pjob->ji_qs.ji_jobid, pjob->ji_qs.ji_queue); log_err(-1, "pbsd_init_reque", logbuf); job_abt(&pjob, logbuf); /* NOTE: pjob freed but dangling pointer remains */ } return; } /* END pbsd_init_reque() */ /* * Catch core dump signals - set core size so we can see what happened! * * Chris Samuel - VPAC * csamuel@vpac.org - 29th July 2003 */ static void catch_abort( int sig) /* I */ { struct rlimit rlimit; struct sigaction act; /* * Reset ourselves to the default signal handler to try and * prevent recursive core dumps. */ sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_DFL; sigaction(SIGSEGV, &act, NULL); sigaction(SIGBUS, &act, NULL); sigaction(SIGFPE, &act, NULL); sigaction(SIGILL, &act, NULL); sigaction(SIGTRAP, &act, NULL); sigaction(SIGSYS, &act, NULL); log_err(sig, "mom_main", "Caught fatal core signal"); rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CORE, &rlimit); abort(); return; } /* END catch_abort() */ /* * catch_child() - the signal handler for SIGCHLD. * * Collect child status and add to work list entry for that child. * The list entry is marked as immediate to show the child is gone and * svr_delay_entry is incremented to indicate to next_task() to check for it. */ static void catch_child( int sig) { struct work_task *ptask; pid_t pid; int statloc; int found; while (1) { if (((pid = waitpid(-1, &statloc, WNOHANG)) == -1) && (errno != EINTR)) { if ((LOGLEVEL >= 7) && (errno != ECHILD)) { #ifdef NO_SIGCHLD log_err(errno, "catch_child", "waitpid failed"); #else DBPRT(("catch_child waitpid failed %d (%s)\n", errno, pbs_strerror(errno))); #endif } return; } if (pid == 0) { return; } if (LOGLEVEL >= 7) { #ifdef NO_SIGCHLD sprintf(log_buffer, "caught SIGCHLD for pid %d", pid); log_record( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); #else DBPRT(("catch_child caught pid %d\n", (int)pid)); #endif } found = FALSE; ptask = (struct work_task *)GET_NEXT(task_list_event); while (ptask != NULL) { if ((ptask->wt_type == WORK_Deferred_Child) && (ptask->wt_event == pid)) { ptask->wt_type = WORK_Deferred_Cmp; ptask->wt_aux = (int)statloc; /* exit status */ svr_delay_entry++; /* see next_task() */ found = TRUE; if (LOGLEVEL >= 7) { #ifdef NO_SIGCHLD sprintf(log_buffer, "work task found for pid %d", pid); log_record( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); #else DBPRT(("catch_child found work task found for pid %d\n", (int)pid)); #endif } } ptask = (struct work_task *)GET_NEXT(ptask->wt_linkall); } if ((found == FALSE) && (LOGLEVEL >= 7)) { #ifdef NO_SIGCHLD sprintf(log_buffer, "no work task found for pid %d", pid); log_err(-1, "catch_child", log_buffer); #else DBPRT(("catch_child no work task found for pid %d\n", (int)pid)); #endif } } /* END while (1) */ return; } /* END catch_child() */ /* * check_children() - Check for child proccess that have exited * */ #ifdef NO_SIGCHLD void check_children(void) { catch_child(0); return; } /* END check_children() */ #endif /* * changs_logs - signal handler for SIGHUP * Causes the accounting file and log file to be closed and reopened. * Thus the old one can be renamed. */ static void change_logs( int sig) { acct_close(); log_close(1); log_open(log_file, path_log); acct_open(acct_file); rpp_dbprt = 1 - rpp_dbprt; /* toggle debug prints for RPP */ return; } /* * change_log_level - signal handler for SIGUSR! and SIGUSR2 * Increases log level if SIGUSR1 is received. * Decreases log level if SIGUSR2 is received. * Variable plogenv tells us whether or not PBSLOGLEVEL was specified * If it was not then we will update the server log level attribute * which allows qmgr to see the current log level value */ static void change_log_level( int sig) { if (sig == SIGUSR1) { /* increase log level */ if (plogenv == NULL) LOGLEVEL = server.sv_attr[(int)SRV_ATR_LogLevel].at_val.at_long; LOGLEVEL = MIN(LOGLEVEL + 1, 7); if (plogenv == NULL) { server.sv_attr[(int)SRV_ATR_LogLevel].at_val.at_long = LOGLEVEL; server.sv_attr[(int)SRV_ATR_LogLevel].at_flags = ATR_VFLAG_SET; } } else if (sig == SIGUSR2) { /* decrease log level */ if (plogenv == NULL) LOGLEVEL = server.sv_attr[(int)SRV_ATR_LogLevel].at_val.at_long; LOGLEVEL = MAX(LOGLEVEL - 1, 0); if (plogenv == NULL) { server.sv_attr[(int)SRV_ATR_LogLevel].at_val.at_long = LOGLEVEL; server.sv_attr[(int)SRV_ATR_LogLevel].at_flags = ATR_VFLAG_SET; } } sprintf(log_buffer, "received signal %d: adjusting loglevel to %d", sig, LOGLEVEL); log_record( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, log_buffer); return; } /* END change_log_level() */ /* * stop_me - signal handler for all caught signals which terminate the server * * Record the signal so an log_event call can be made outside of * the handler, and set the server state to indicate we should shut down. */ /*ARGSUSED*/ static void stop_me( int sig) { server.sv_attr[(int)SRV_ATR_State].at_val.at_long = SV_STATE_SHUTSIG; return; } static int chk_save_file( char *filename) { struct stat sb; if (*filename == '.') { return(-1); } if (stat(filename, &sb) == -1) { return(errno); } if (S_ISREG(sb.st_mode)) { return(0); } return(-1); } /* * resume_net_move - call net_move() to complete the routing of a job * This is invoked via a work task created on recovery of a job * in JOB_SUBSTATE_TRNOUTCM state. */ static void resume_net_move( struct work_task *ptask) { net_move((job *)ptask->wt_parm1, 0); return; } /* * need_y_response - on create/clean initialization that would delete * information, obtain the operator approval first. */ static void need_y_response( int type) /* I */ { static int answ = -2; int c; if (answ > 0) { return; /* already received a response */ } fflush(stdin); if (type == RECOV_CREATE) printf(msg_startup3, msg_daemonname, server_name, "Create", "server database"); else printf(msg_startup3, msg_daemonname, server_name, "Cold", "jobs"); while (1) { answ = getchar(); c = answ; while ((c != '\n') && (c != EOF)) c = getchar(); switch (answ) { case 'y': case 'Y': return; /*NOTREACHED*/ break; case EOF: case '\n': case 'n': case 'N': printf("PBS server %s initialization aborted\n", server_name); exit(0); /*NOTREACHED*/ break; } printf("y(es) or n(o) please:\n"); } return; } /* END need_y_response() */ /* * rm_files - on an RECOV_CREATE, remove all files under the specified * directory (path_priv) and any subdirectory except under "jobs". */ static void rm_files( char *dirname) { DIR *dir; int i; struct stat stb; struct dirent *pdirt; char path[1024]; /* list of directories in which files are removed */ static char *byebye[] = { "acl_groups", "acl_hosts", "acl_svr", "acl_users", "hostlist", "queues", NULL }; /* keep as last entry */ dir = opendir(dirname); if (dir != NULL) { while ((pdirt = readdir(dir)) != NULL) { strcpy(path, dirname); strcat(path, "/"); strcat(path, pdirt->d_name); if (stat(path, &stb) == 0) { if (S_ISDIR(stb.st_mode)) { for (i = 0;byebye[i];++i) { if (strcmp(pdirt->d_name, byebye[i]) == 0) { rm_files(path); } } } else if (unlink(path) == -1) { strcpy(log_buffer, "cannot unlink"); strcat(log_buffer, path); log_err(errno, "pbsd_init", log_buffer); } } } } return; } /* END rm_files() */ /* * init_abt_job() - log and email owner message that job is being aborted at * initialization; then purge job (must be called after job is enqueued. */ static void init_abt_job( job *pjob) { log_event( PBSEVENT_SYSTEM | PBSEVENT_ADMIN | PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, msg_init_abt); svr_mailowner(pjob, MAIL_ABORT, MAIL_NORMAL, msg_init_abt); job_purge(pjob); return; } /* * This just reads in the server attributes from the server db. */ int get_svr_attr( int type) /* type of initialization */ { static char id[] = "get_svr_attr"; int rc; char *suffix_slash = "/"; if (type != RECOV_CREATE) { /* Open the server database (save file) and read it in */ if(path_priv == NULL) { path_priv = build_path(path_home, PBS_SVR_PRIVATE, suffix_slash); } if(path_svrdb == NULL) { path_svrdb = build_path(path_priv, PBS_SERVERDB, NULL); } if (svr_resc_def == NULL) { rc = init_resc_defs(); if (rc != 0) { log_err(rc, "pbsd_init", msg_init_baddb); return(-1); } } if (((rc = chk_save_file(path_svrdb))!= 0) || ((rc = svr_recov(path_svrdb, TRUE)) == -1)) { log_err(rc, id ,msg_init_baddb); return(-1); } } return(0); } /* END get_svr_attr() */ torque-2.4.16/src/server/req_runjob.c0000664000113300011330000011775411527304735014471 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * req_runjob.c - functions dealing with a Run Job Request */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "libpbs.h" #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "resource.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "queue.h" #include "work_task.h" #include "pbs_error.h" #include "log.h" #include "acct.h" #include "dis.h" #include "svrfunc.h" #include "net_connect.h" #include "pbs_proto.h" #ifdef HAVE_NETINET_IN_H #include #endif /* HAVE_NETINET_IN_H */ /* External Functions Called: */ extern int send_job A_((job *, pbs_net_t, int, int, void (*x)(), struct batch_request *)); extern void set_resc_assigned A_((job *, enum batch_op)); extern struct batch_request *cpy_stage A_((struct batch_request *, job *, enum job_atr, int)); void stream_eof A_((int, u_long, int)); extern int job_set_wait(attribute *, void *, int); extern void stat_mom_job A_((job *)); extern int LOGLEVEL; /* Public Functions in this file */ int svr_startjob A_((job *, struct batch_request *, char *, char *)); /* Private Functions local to this file */ static void post_sendmom A_((struct work_task *)); static int svr_stagein A_((job *, struct batch_request *, int, int)); static int svr_strtjob2 A_((job *, struct batch_request *)); static job *chk_job_torun A_((struct batch_request *, int)); static int assign_hosts A_((job *, char *, int, char *, char *)); /* Global Data Items: */ extern pbs_net_t pbs_mom_addr; extern int pbs_mom_port; extern struct server server; extern char server_host[PBS_MAXHOSTNAME + 1]; extern char server_name[PBS_MAXSERVERNAME + 1]; extern char *msg_badexit; extern char *msg_jobrun; extern char *msg_manager; extern char *msg_stageinfail; extern int scheduler_jobct; extern int scheduler_sock; extern time_t time_now; extern int svr_totnodes; /* non-zero if using nodes */ extern int svr_tsnodes; /* non-zero if time-shared nodes */ extern const char *PJobSubState[]; extern unsigned int pbs_rm_port; extern char *msg_err_malloc; long DispatchTime[20]; job *DispatchJob[20]; char *DispatchNode[20]; /* * req_runjob - service the Run Job and Async Run Job Requests * * This request forces a job into execution. Client must be privileged. */ void req_runjob( struct batch_request *preq) /* I (modified) */ { job *pjob; int rc; void *bp; int setneednodes; char failhost[1024]; char emsg[1024]; /* chk_job_torun will extract job id and assign hostlist if specified */ if (getenv("TORQUEAUTONN")) setneednodes = 1; else setneednodes = 0; if ((pjob = chk_job_torun(preq, setneednodes)) == NULL) { /* FAILURE - chk_job_torun performs req_reject internally */ return; } if (preq->rq_conn == scheduler_sock) ++scheduler_jobct; /* see scheduler_close() */ sprintf(log_buffer, msg_manager, msg_jobrun, preq->rq_user, preq->rq_host); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* If async run, reply now; otherwise reply is handled in */ /* post_sendmom or post_stagein */ /* perhaps node assignment should be handled immediately in async run? */ if ((preq != NULL) && (preq->rq_type == PBS_BATCH_AsyrunJob)) { reply_ack(preq); preq = NULL; /* cleared so we don't try to reuse */ } /* NOTE: nodes assigned to job in svr_startjob() */ rc = svr_startjob(pjob, preq, failhost, emsg); if ((rc != 0) && (preq != NULL)) { free_nodes(pjob); /* if the job has a non-empty rejectdest list, pass the first host into req_reject() */ if ((bp = GET_NEXT(pjob->ji_rejectdest)) != NULL) { req_reject(rc, 0, preq, ((struct badplace *)bp)->bp_dest, "could not contact host"); } else { req_reject(rc, 0, preq, failhost, emsg); } } return; } /* END req_runjob() */ /* * is_checkpoint_restart - Is this the restart of a checkpoint job */ static int is_checkpoint_restart( job *pjob) /* I */ { #if 0 if ((pjob->ji_wattr[(int)JOB_ATR_checkpoint_name].at_flags & ATR_VFLAG_SET) == 0) { return(FALSE); } #else if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) == 0) { return(FALSE); } #endif return(TRUE); } /* END is_checkpoint_restart() */ /* * post_checkpointsend - process reply from MOM to checkpoint copy request */ static void post_checkpointsend( struct work_task *pwt) { int code; job *pjob; struct batch_request *preq; attribute *pwait; preq = pwt->wt_parm1; code = preq->rq_reply.brp_code; pjob = find_job(preq->rq_extra); free(preq->rq_extra); if (pjob != NULL) { if (code != 0) { /* copy failed - hold job */ free_nodes(pjob); pwait = &pjob->ji_wattr[(int)JOB_ATR_exectime]; if ((pwait->at_flags & ATR_VFLAG_SET) == 0) { pwait->at_val.at_long = time_now + PBS_STAGEFAIL_WAIT; pwait->at_flags |= ATR_VFLAG_SET; job_set_wait(pwait, pjob, 0); } svr_setjobstate(pjob, JOB_STATE_WAITING, JOB_SUBSTATE_STAGEFAIL); if (preq->rq_reply.brp_choice == BATCH_REPLY_CHOICE_Text) { sprintf(log_buffer, "Failed to copy checkpoint file to mom - %s", preq->rq_reply.brp_un.brp_txt.brp_str); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* NYI */ svr_mailowner( pjob, MAIL_CHKPTCOPY, MAIL_FORCE, preq->rq_reply.brp_un.brp_txt.brp_str); } } else { /* checkpoint copy was successful */ pjob->ji_qs.ji_svrflags |= JOB_SVFLG_CHECKPOINT_COPIED; /* set restart_name attribute to the checkpoint_name we just copied */ job_attr_def[(int)JOB_ATR_restart_name].at_set( &pjob->ji_wattr[(int)JOB_ATR_restart_name], &pjob->ji_wattr[(int)JOB_ATR_checkpoint_name], SET); pjob->ji_modified = 1; job_save(pjob, SAVEJOB_FULL); /* continue to start job running */ svr_strtjob2(pjob, NULL); } } /* END if (pjob != NULL) */ release_req(pwt); /* close connection and release request */ return; } /* END post_checkpointsend() */ /* * svr_send_checkpoint - direct MOM to copy in the checkpoint files for a job */ static int svr_send_checkpoint( job *pjob, /* I */ struct batch_request *preq, /* I */ int state, /* I */ int substate) /* I */ { struct batch_request *momreq = 0; int rc; momreq = cpy_checkpoint(momreq, pjob, JOB_ATR_checkpoint_name, CKPT_DIR_IN); if (momreq == NULL) { /* no files to send, go directly to sending job to mom */ return(svr_strtjob2(pjob, preq)); } /* save job id for post_checkpointsend */ momreq->rq_extra = malloc(PBS_MAXSVRJOBID + 1); if (momreq->rq_extra == 0) { return(PBSE_SYSTEM); } strcpy(momreq->rq_extra, pjob->ji_qs.ji_jobid); rc = relay_to_mom( pjob->ji_qs.ji_un.ji_exect.ji_momaddr, momreq, post_checkpointsend); if (rc == 0) { svr_setjobstate(pjob, state, substate); /* * checkpoint copy started ok - reply to client as copy may * take too long to wait. */ if (preq != NULL) reply_ack(preq); } else { free(momreq->rq_extra); } return(rc); } /* END svr_send_checkpoint() */ /* * req_stagein - service the Stage In Files for a Job Request * * This request causes MOM to start staging in files. * Client must be privileged. */ void req_stagein( struct batch_request *preq) /* I */ { job *pjob; int rc; int setneednodes; if (getenv("TORQUEAUTONN")) setneednodes = 1; else setneednodes = 0; if ((pjob = chk_job_torun(preq, setneednodes)) == NULL) { return; } if ((pjob->ji_wattr[(int)JOB_ATR_stagein].at_flags & ATR_VFLAG_SET) == 0) { log_err(-1, "req_stagein", "stage-in information not set"); req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); return; } if ((rc = svr_stagein( pjob, preq, JOB_STATE_QUEUED, JOB_SUBSTATE_STAGEIN))) { free_nodes(pjob); req_reject(rc, 0, preq, NULL, NULL); } return; } /* END req_stagein() */ /* * post_stagein - process reply from MOM to stage-in request */ static void post_stagein( struct work_task *pwt) { int code; int newstate; int newsub; job *pjob; struct batch_request *preq; attribute *pwait; preq = pwt->wt_parm1; code = preq->rq_reply.brp_code; pjob = find_job(preq->rq_extra); free(preq->rq_extra); if (pjob != NULL) { if (code != 0) { /* stage in failed - hold job */ free_nodes(pjob); pwait = &pjob->ji_wattr[(int)JOB_ATR_exectime]; if ((pwait->at_flags & ATR_VFLAG_SET) == 0) { pwait->at_val.at_long = time_now + PBS_STAGEFAIL_WAIT; pwait->at_flags |= ATR_VFLAG_SET; job_set_wait(pwait, pjob, 0); } svr_setjobstate(pjob, JOB_STATE_WAITING, JOB_SUBSTATE_STAGEFAIL); if (preq->rq_reply.brp_choice == BATCH_REPLY_CHOICE_Text) { /* set job comment */ /* NYI */ svr_mailowner( pjob, MAIL_STAGEIN, MAIL_FORCE, preq->rq_reply.brp_un.brp_txt.brp_str); } } else { /* stage in was successful */ pjob->ji_qs.ji_svrflags |= JOB_SVFLG_StagedIn; if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_STAGEGO) { if (is_checkpoint_restart(pjob)) { /* need to copy checkpoint file to mom before running */ svr_send_checkpoint( pjob, preq, JOB_STATE_RUNNING, JOB_SUBSTATE_CHKPTGO); } else { /* continue to start job running */ svr_strtjob2(pjob, NULL); } } else { svr_evaljobstate(pjob, &newstate, &newsub, 0); svr_setjobstate(pjob, newstate, newsub); } } } /* END if (pjob != NULL) */ release_req(pwt); /* close connection and release request */ return; } /* END post_stagein() */ /* * svr_stagein - direct MOM to stage in the requested files for a job */ static int svr_stagein( job *pjob, /* I */ struct batch_request *preq, /* I */ int state, /* I */ int substate) /* I */ { struct batch_request *momreq = 0; int rc; momreq = cpy_stage(momreq, pjob, JOB_ATR_stagein, STAGE_DIR_IN); if (momreq == NULL) { /* no files to stage, go directly to sending job to mom */ return(svr_strtjob2(pjob, preq)); } /* have files to stage in */ /* save job id for post_stagein */ momreq->rq_extra = malloc(PBS_MAXSVRJOBID + 1); if (momreq->rq_extra == 0) { return(PBSE_SYSTEM); } strcpy(momreq->rq_extra, pjob->ji_qs.ji_jobid); rc = relay_to_mom( pjob->ji_qs.ji_un.ji_exect.ji_momaddr, momreq, post_stagein); if (rc == 0) { svr_setjobstate(pjob, state, substate); /* * stage-in started ok - reply to client as copy may * take too long to wait. */ if (preq != NULL) reply_ack(preq); } else { free(momreq->rq_extra); } return(rc); } /* END svr_stagein() */ /* * svr_startjob - place a job into running state by shipping it to MOM * called by req_runjob() */ int svr_startjob( job *pjob, /* I job to run (modified) */ struct batch_request *preq, /* I Run Job batch request (optional) */ char *FailHost, /* O (optional,minsize=1024) */ char *EMsg) /* O (optional,minsize=1024) */ { int f; int rc; #ifdef BOEING int sock, nodenum; struct hostent *hp; char *nodestr, *cp, *hostlist; int size; struct sockaddr_in saddr; badplace *bp; char *id = "svr_startjob"; #endif if (FailHost != NULL) FailHost[0] = '\0'; if (EMsg != NULL) EMsg[0] = '\0'; /* if not already setup, transfer the control/script file basename */ /* into an attribute accessible by MOM */ if (!(pjob->ji_wattr[(int)JOB_ATR_hashname].at_flags & ATR_VFLAG_SET)) { if (job_attr_def[(int)JOB_ATR_hashname].at_decode( &pjob->ji_wattr[(int)JOB_ATR_hashname], NULL, NULL, pjob->ji_qs.ji_fileprefix)) { return(PBSE_SYSTEM); } } /* if exec_host already set and either (hot start or checkpoint) */ /* then use the host(s) listed in exec_host */ /* NOTE: qrun hostlist assigned in req_runjob() */ rc = 0; f = pjob->ji_wattr[(int)JOB_ATR_exec_host].at_flags & ATR_VFLAG_SET; if ((f != 0) && ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HOTSTART) || (pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE)) && ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HasNodes) == 0)) { rc = assign_hosts( /* inside svr_startjob() */ pjob, pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str, 0, FailHost, EMsg); } else if (f == 0) { /* exec_host not already set, get hosts and set it */ rc = assign_hosts( pjob, NULL, 1, FailHost, EMsg); /* inside svr_startjob() */ } if (rc != 0) { /* FAILURE */ return(rc); } #ifdef BOEING /* Verify that all the nodes are alive via a TCP connect. */ /* NOTE: Copy the nodes into a temp string because strtok() is destructive. */ size = strlen(pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str); hostlist = malloc(size + 1); if (hostlist == NULL) { sprintf(log_buffer, "could not allocate temporary buffer (malloc failed) -- skipping TCP connect check"); log_err(errno, id, log_buffer); } else { /* Get the first host. */ strncpy(hostlist, pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str, size); hostlist[size] = '\0'; nodestr = strtok(hostlist, "+"); } while (nodestr != NULL) { /* truncate from trailing slash on (if one exists). */ if ((cp = strchr(nodestr, '/')) != NULL) { cp[0] = '\0'; } /* Lookup IP address of host. */ if ((hp = gethostbyname(nodestr)) == NULL) { sprintf(log_buffer, "could not contact %s (gethostbyname failed, errno: %d (%s))", nodestr, errno, pbs_strerror(errno)); if (FailHost != NULL) strncpy(FailHost, nodestr, 1024); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* Add this host to the reject destination list for the job */ bp = (badplace *)malloc(sizeof(badplace)); if (bp == NULL) { log_err(errno, id, msg_err_malloc); return; } CLEAR_LINK(bp->bp_link); strcpy(bp->bp_dest, nodestr); append_link(&pjob->ji_rejectdest, &bp->bp_link, bp); /* FAILURE - cannot lookup master compute host */ return(PBSE_RESCUNAV); } /* open a socket. */ /* NOTE: should change to PF_* */ if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { sprintf(log_buffer, "could not contact %s (cannot create socket, errno: %d (%s))", nodestr, errno, pbs_strerror(errno)); if (FailHost != NULL) strncpy(FailHost, nodestr, 1024); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* Add this host to the reject destination list for the job */ bp = (badplace *)malloc(sizeof(badplace)); if (bp == NULL) { /* FAILURE - cannot allocate memory */ log_err(errno, id, msg_err_malloc); return(PBSE_RESCUNAV); } CLEAR_LINK(bp->bp_link); strcpy(bp->bp_dest, nodestr); append_link(&pjob->ji_rejectdest, &bp->bp_link, bp); /* FAILURE - cannot create socket for master compute host */ return(PBSE_RESCUNAV); } /* Set the host information. */ memset(&saddr, '\0', sizeof(saddr)); saddr.sin_family = AF_INET; memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); saddr.sin_port = htons(pbs_rm_port); /* Connect to the host. */ if (connect(sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) { sprintf(log_buffer, "could not contact %s (connect failed, errno: %d (%s))", nodestr, errno, pbs_strerror(errno)); if (FailHost != NULL) strncpy(FailHost, nodestr, 1024); if (EMsg != NULL) strncpy(EMsg, log_buffer, 1024); log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* Add this host to the reject list for the job */ bp = (badplace *)malloc(sizeof(badplace)); if (bp == NULL) { /* FAILURE - cannot allocate memory */ log_err(errno, id, msg_err_malloc); return(PBSE_RESCUNAV); } CLEAR_LINK(bp->bp_link); strcpy(bp->bp_dest, nodestr); append_link(&pjob->ji_rejectdest, &bp->bp_link, bp); /* FAILURE - cannot connect to master compute host */ return(PBSE_RESCUNAV); } /* clean up and get next host. */ close(sock); nodestr = strtok(NULL, "+"); } /* END while (nodestr != NULL) */ if (hostlist != NULL) free(hostlist); /* END MOM verification check via TCP. */ #endif /* END BOEING */ /* Next, are there files to be staged-in? */ if ((pjob->ji_wattr[(int)JOB_ATR_stagein].at_flags & ATR_VFLAG_SET) && (pjob->ji_qs.ji_substate != JOB_SUBSTATE_STAGECMP)) { /* yes, we do that first; then start the job */ rc = svr_stagein( pjob, preq, JOB_STATE_RUNNING, JOB_SUBSTATE_STAGEGO); /* note, the positive acknowledgment is done by svr_stagein */ } else if (is_checkpoint_restart(pjob)) { /* Checkpoint file copy needed, start copy */ rc = svr_send_checkpoint( pjob, preq, JOB_STATE_RUNNING, JOB_SUBSTATE_CHKPTGO); } else { /* No stage-in or already done, start job executing */ rc = svr_strtjob2(pjob, preq); } return(rc); } /* END svr_startjob() */ /* PATH req_runjob() > svr_startjob() svr_strtjob2() send_job() - svr_movejob.c svr_connect() PBSD_queuejob() */ static int svr_strtjob2( job *pjob, /* I */ struct batch_request *preq) /* I (modified - report status) */ { extern char *PAddrToString(pbs_net_t *); int old_state; int old_subst; attribute *pattr; char tmpLine[1024]; old_state = pjob->ji_qs.ji_state; old_subst = pjob->ji_qs.ji_substate; pattr = &pjob->ji_wattr[(int)JOB_ATR_start_time]; if ((pjob->ji_wattr[(int)JOB_ATR_restart_name].at_flags & ATR_VFLAG_SET) == 0) { pattr->at_val.at_long = time(NULL); pattr->at_flags |= ATR_VFLAG_SET; } pattr = &pjob->ji_wattr[(int)JOB_ATR_start_count]; pattr->at_val.at_long++; pattr->at_flags |= ATR_VFLAG_SET; /* send the job to MOM */ svr_setjobstate(pjob,JOB_STATE_RUNNING,JOB_SUBSTATE_PRERUN); /* if job start timeout attribute is set use its value */ if (((server.sv_attr[(int)SRV_ATR_JobStartTimeout].at_flags & ATR_VFLAG_SET) != 0) && (server.sv_attr[(int)SRV_ATR_JobStartTimeout].at_val.at_long > 0)) { DIS_tcp_settimeout(server.sv_attr[(int)SRV_ATR_JobStartTimeout].at_val.at_long); } if (send_job( pjob, pjob->ji_qs.ji_un.ji_exect.ji_momaddr, pbs_mom_port, MOVE_TYPE_Exec, post_sendmom, (void *)preq) == 2) { /* SUCCESS */ DIS_tcp_settimeout(server.sv_attr[(int)SRV_ATR_tcp_timeout].at_val.at_long); return(0); } DIS_tcp_settimeout(server.sv_attr[(int)SRV_ATR_tcp_timeout].at_val.at_long); sprintf(tmpLine, "unable to run job, send to MOM '%s' failed", PAddrToString(&pjob->ji_qs.ji_un.ji_exect.ji_momaddr)); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, tmpLine); pjob->ji_qs.ji_destin[0] = '\0'; svr_setjobstate( pjob, old_state, old_subst); return(pbs_errno); } /* END svr_strtjob2() */ /* * post_sendmom - clean up action for child started in send_job * which was sending a job "home" to MOM * * If send was successful, mark job as executing, and call stat_mom_job() * to obtain session id. * * If send didn't work, requeue the job. * * If the work_task has a non-null wt_parm2, it is the address of a batch * request to which a reply must be sent. * * Returns: none. */ static void post_sendmom( struct work_task *pwt) /* I */ { char *id = "post_sendmom"; int newstate; int newsub; int r; int stat; job *jobp = (job *)pwt->wt_parm1; struct batch_request *preq = (struct batch_request *)pwt->wt_parm2; char *MOMName = NULL; int jindex; long DTime = time_now - 10000; if (LOGLEVEL >= 6) { log_record( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, "entering post_sendmom"); } stat = pwt->wt_aux; if (WIFEXITED(stat)) { r = WEXITSTATUS(stat); } else { r = 2; /* cannot get child exit status */ sprintf(log_buffer, msg_badexit, stat); strcat(log_buffer, id); log_event( PBSEVENT_SYSTEM, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, log_buffer); } /* maintain local struct to associate job id with dispatch time */ for (jindex = 0;jindex < 20;jindex++) { if (DispatchJob[jindex] == jobp) { DTime = DispatchTime[jindex]; DispatchJob[jindex] = NULL; MOMName = DispatchNode[jindex]; break; } } if (LOGLEVEL >= 1) { sprintf(log_buffer, "child reported %s for job after %ld seconds (dest=%s), rc=%d", (r == 0) ? "success" : "failure", time_now - DTime, (MOMName != NULL) ? MOMName : "???", r); log_event( PBSEVENT_SYSTEM, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, log_buffer); } switch (r) { case 0: /* send to MOM went ok */ jobp->ji_qs.ji_svrflags &= ~JOB_SVFLG_HOTSTART; if (preq != NULL) reply_ack(preq); /* record start time for accounting */ jobp->ji_qs.ji_stime = time_now; /* update resource usage attributes */ set_resc_assigned(jobp, INCR); if (jobp->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) { /* may be EXITING if job finished first */ svr_setjobstate(jobp, JOB_STATE_RUNNING, JOB_SUBSTATE_RUNNING); /* above saves job structure */ } /* accounting log for start or restart */ if (jobp->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) account_record(PBS_ACCT_RESTRT, jobp, "Restart from checkpoint"); else account_jobstr(jobp); /* if any dependencies, see if action required */ if (jobp->ji_wattr[(int)JOB_ATR_depend].at_flags & ATR_VFLAG_SET) depend_on_exec(jobp); /* * it is unfortunate, but while the job has gone into execution, * there is no way of obtaining the session id except by making * a status request of MOM. (Even if the session id was passed * back to the sending child, it couldn't get up to the parent.) */ jobp->ji_momstat = 0; stat_mom_job(jobp); break; case 10: /* NOTE: if r == 10, connection to mom timed out. Mark node down */ stream_eof(-1, jobp->ji_qs.ji_un.ji_exect.ji_momaddr, 0); /* send failed, requeue the job */ log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, "unable to run job, MOM rejected/timeout"); free_nodes(jobp); if (jobp->ji_qs.ji_substate != JOB_SUBSTATE_ABORT) { if (preq != NULL) req_reject(PBSE_MOMREJECT, 0, preq, MOMName, "connection to mom timed out"); svr_evaljobstate(jobp, &newstate, &newsub, 1); svr_setjobstate(jobp, newstate, newsub); } else { if (preq != NULL) req_reject(PBSE_BADSTATE, 0, preq, MOMName, "job was aborted by mom"); } break; case 1: /* commit failed */ default: { int JobOK = 0; /* send failed, requeue the job */ sprintf(log_buffer, "unable to run job, MOM rejected/rc=%d", r); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, log_buffer); free_nodes(jobp); if (jobp->ji_qs.ji_substate != JOB_SUBSTATE_ABORT) { if (preq != NULL) { char tmpLine[1024]; if (preq->rq_reply.brp_code == PBSE_JOBEXIST) { /* job already running, start request failed but return success since * desired behavior (job is running) is accomplished */ JobOK = 1; } else { sprintf(tmpLine, "cannot send job to %s, state=%s", (MOMName != NULL) ? MOMName : "mom", PJobSubState[jobp->ji_qs.ji_substate]); req_reject(PBSE_MOMREJECT, 0, preq, MOMName, tmpLine); } } if (JobOK == 1) { /* do not re-establish accounting - completed first time job was started */ /* update mom-based job status */ jobp->ji_momstat = 0; stat_mom_job(jobp); } else { svr_evaljobstate(jobp, &newstate, &newsub, 1); svr_setjobstate(jobp, newstate, newsub); } } else { if (preq != NULL) req_reject(PBSE_BADSTATE, 0, preq, MOMName, "send failed - abort"); } break; } } /* END switch (r) */ return; } /* END post_sendmom() */ /* * chk_job_torun - check state and past execution host of a job for which * files are about to be staged in or for a job that is about to be run. * Returns pointer to job if all is ok, else returns NULL. */ static job *chk_job_torun( struct batch_request *preq, /* I */ int setnn) /* I */ { static char *id = "chk_job_torun"; job *pjob; struct rq_runjob *prun; int rc; char EMsg[1024]; char FailHost[1024]; char exec_host[1024]; char *ptr; prun = &preq->rq_ind.rq_run; if ((pjob = chk_job_request(prun->rq_jid, preq)) == 0) { /* FAILURE */ return(NULL); } if ((pjob->ji_qs.ji_state == JOB_STATE_TRANSIT) || (pjob->ji_qs.ji_state == JOB_STATE_EXITING) || (pjob->ji_qs.ji_substate == JOB_SUBSTATE_STAGEGO) || (pjob->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) || (pjob->ji_qs.ji_substate == JOB_SUBSTATE_RUNNING)) { /* FAILURE - job already started */ req_reject(PBSE_BADSTATE, 0, preq, NULL, "job already running"); return(NULL); } if (preq->rq_type == PBS_BATCH_StageIn) { if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_STAGEIN) { /* FAILURE */ req_reject(PBSE_BADSTATE, 0, preq, NULL, NULL); return(NULL); } } if ((preq->rq_perm & (ATR_DFLAG_MGWR | ATR_DFLAG_OPWR)) == 0) { /* FAILURE - run request not authorized */ req_reject(PBSE_PERM, 0, preq, NULL, NULL); return(NULL); } if (pjob->ji_qhdr->qu_qs.qu_type != QTYPE_Execution) { /* FAILURE - job must be in execution queue */ log_err(-1, id, "attempt to start job in non-execution queue"); req_reject(PBSE_IVALREQ, 0, preq, NULL, "job not in execution queue"); return(NULL); } /* where to execute the job */ #ifdef ENABLE_BLCR if (pjob->ji_qs.ji_svrflags & JOB_SVFLG_StagedIn) #else if (pjob->ji_qs.ji_svrflags & (JOB_SVFLG_CHECKPOINT_FILE | JOB_SVFLG_StagedIn)) #endif { /* job has been checkpointed or files already staged in */ /* in this case, exec_host must be already set */ if (prun->rq_destin && *prun->rq_destin) /* If a destination has been specified */ { /* specified destination must match exec_host */ strcpy(exec_host, pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str); if ((ptr = strchr(exec_host, '/'))) * ptr = 0; /* For some reason, node name has "/0" on the end (i.e. "node0001/0"). */ if (strcmp(prun->rq_destin, exec_host) != 0) { /* FAILURE */ if (pjob->ji_qs.ji_svrflags & (JOB_SVFLG_CHECKPOINT_FILE)) req_reject(PBSE_EXECTHERE, 0, preq, NULL, "allocated nodes must match checkpoint location"); else req_reject(PBSE_EXECTHERE, 0, preq, NULL, "allocated nodes must match input file stagein location"); return(NULL); } } if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_HasNodes) == 0) { /* re-reserve nodes and leave exec_host as is */ if ((rc = assign_hosts( /* inside chk_job_torun() */ pjob, pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str, 0, FailHost, EMsg)) != 0) /* O */ { req_reject(PBSE_EXECTHERE, 0, preq, FailHost, EMsg); return(NULL); } } } /* END if (pjob->ji_qs.ji_svrflags & (JOB_SVFLG_CHECKPOINT_FILE|JOB_SVFLG_StagedIn)) */ else { /* job has not run before or need not run there again */ /* reserve nodes and set new exec_host */ if ((prun->rq_destin == NULL) || (prun->rq_destin[0] == '\0')) { /* it is possible for the scheduler to pass a hostlist using the rq_extend field--we should use it as the given list * as an alternative to rq_destin */ rc = assign_hosts(pjob, preq->rq_extend, 1, FailHost, EMsg); /* inside chk_job_torun() */ } else { rc = assign_hosts(pjob, prun->rq_destin, 1, FailHost, EMsg); /* inside chk_job_torun() */ } if (rc != 0) { /* FAILURE - cannot assign correct hosts */ req_reject(rc, 0, preq, FailHost, EMsg); return(NULL); } } if (setnn == 1) { #ifdef TDEV /* what should neednodes be set to? */ resource_def *DRes; /* resource definition */ resource *JRes; /* resource on job */ attribute *Attr; /* 'neednodes' attribute */ Attr = &pjob->ji_wattr[(int)JOB_ATR_resource]; DRes = find_resc_def(svr_resc_def, "neednodes", svr_resc_size); JRes = find_resc_entry(Attr, DRes); if ((JRes == NULL) || ((JRes->rs_value.at_flags & ATR_VFLAG_SET) == 0)) { /* resource does not exist or value is not set */ if (JRes == NULL) { JRes = add_resource_entry(Attr, DRes); } if (JRes != NULL) { if (DRes->rs_defin->rs_set( &JRes->rs_value, &DRes->rs_value, SET) == 0) { JRes->rs_value.at_flags |= ATR_VFLAG_SET; } } } #endif /* TDEV */ } /* END if (setnn == 1) */ return(pjob); } /* END chk_job_torun() */ /* * assign_hosts - assign hosts (nodes) to job by the following rules: * 1. use nodes that are "given"; from exec_host when required by * checkpoint-restart or file stage-in, or from run command. * 2. use nodes that match user's resource request. * 3. use default (local system or a single node). */ static int assign_hosts( job *pjob, /* I (modified) */ char *given, /* I (optional) list of requested hosts */ int set_exec_host, /* I (boolean) */ char *FailHost, /* O (optional,minsize=1024) */ char *EMsg) /* O (optional,minsize=1024) */ { unsigned int dummy; char *list = NULL; char *hosttoalloc = NULL; pbs_net_t momaddr = 0; resource *pres; int rc = 0; extern char *mom_host; if (EMsg != NULL) EMsg[0] = '\0'; if (FailHost != NULL) FailHost[0] = '\0'; #ifdef __TREQSCHED if ((given == NULL) || (given[0] == '\0')) { /* scheduler must specify node allocation for all jobs */ return(PBSE_UNKNODEATR); } #endif /* __TREQSCHED */ if ((given != NULL) && (given[0] != '\0')) { /* assign what was specified in run request */ hosttoalloc = given; } else { pres = find_resc_entry( &pjob->ji_wattr[(int)JOB_ATR_resource], find_resc_def(svr_resc_def, "neednodes", svr_resc_size)); if (pres != NULL) { /* assign what was in "neednodes" */ hosttoalloc = pres->rs_value.at_val.at_str; if ((hosttoalloc == NULL) || (hosttoalloc[0] == '\0')) { return(PBSE_UNKNODEATR); } } } if (hosttoalloc != NULL) { /* NO-OP */ } else if (svr_totnodes == 0) { /* assign "local" */ if ((server.sv_attr[(int)SRV_ATR_DefNode].at_flags & ATR_VFLAG_SET) && (server.sv_attr[(int)SRV_ATR_DefNode].at_val.at_str != NULL)) { hosttoalloc = server.sv_attr[(int)SRV_ATR_DefNode].at_val.at_str; } else { hosttoalloc = mom_host; momaddr = pbs_mom_addr; } } else if ((server.sv_attr[(int)SRV_ATR_DefNode].at_flags & ATR_VFLAG_SET) && (server.sv_attr[(int)SRV_ATR_DefNode].at_val.at_str != 0)) { /* alloc server default_node */ hosttoalloc = server.sv_attr[(int)SRV_ATR_DefNode].at_val.at_str; } else if (svr_tsnodes != 0) { /* find first time-shared node */ if ((hosttoalloc = find_ts_node()) == NULL) { /* FAILURE */ return(PBSE_NOTSNODE); } } else { /* fall back to 1 cluster node */ hosttoalloc = PBS_DEFAULT_NODE; } /* do we need to allocate the (cluster) node(s)? */ if (svr_totnodes != 0) { if ((rc = is_ts_node(hosttoalloc)) != 0) { rc = set_nodes(pjob, hosttoalloc, &list, FailHost, EMsg); set_exec_host = 1; /* maybe new VPs, must set */ hosttoalloc = list; } } if (rc == 0) { /* set_nodes succeeded */ if (set_exec_host != 0) { job_attr_def[(int)JOB_ATR_exec_host].at_free( &pjob->ji_wattr[(int)JOB_ATR_exec_host]); job_attr_def[(int)JOB_ATR_exec_host].at_decode( &pjob->ji_wattr[(int)JOB_ATR_exec_host], NULL, NULL, hosttoalloc); /* O */ pjob->ji_modified = 1; } else { /* leave exec_host alone and reuse old IP address */ momaddr = pjob->ji_qs.ji_un.ji_exect.ji_momaddr; hosttoalloc = pjob->ji_wattr[(int)JOB_ATR_exec_host].at_val.at_str; } strncpy( pjob->ji_qs.ji_destin, parse_servername(hosttoalloc, &dummy), PBS_MAXROUTEDEST); if (momaddr == 0) { momaddr = get_hostaddr(pjob->ji_qs.ji_destin); if (momaddr == 0) { free_nodes(pjob); if (list != NULL) free(list); sprintf(log_buffer, "ALERT: job cannot allocate node '%s' (could not determine IP address for node)", pjob->ji_qs.ji_destin); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return(PBSE_BADHOST); } } pjob->ji_qs.ji_un.ji_exect.ji_momaddr = momaddr; } /* END if (rc == 0) */ if (list != NULL) free(list); return(rc); } /* END assign_hosts() */ /* END req_runjob.c */ torque-2.4.16/src/server/job_route.c0000664000113300011330000002734211272401245014273 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * job_route.c - functions to route a job to another queue * * Included functions are: * * job_route() - attempt to route a job to a new destination. */ #include /* the master config generated by configure */ #include #include #include "pbs_ifl.h" #include #include #include #include #include "libpbs.h" #include "pbs_error.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "work_task.h" #include "server.h" #include "log.h" #include "queue.h" #include "pbs_job.h" #include "credential.h" #include "batch_request.h" #if __STDC__ != 1 #include #endif /* External functions called */ extern int svr_movejob A_((job *, char *, struct batch_request *)); /* Local Functions */ int job_route A_((job *)); void queue_route A_((pbs_queue *)); /* Global Data */ extern char *msg_routexceed; extern char *msg_err_malloc; extern char *msg_routexceed; extern time_t time_now; /* * Add an entry to the list of bad destinations for a job. * * Return: pointer to the new entry if it is added, NULL if not. */ void add_dest( job *jobp) { char *id = "add_dest"; badplace *bp; char *baddest = jobp->ji_qs.ji_destin; bp = (badplace *)malloc(sizeof(badplace)); if (bp == NULL) { log_err(errno, id, msg_err_malloc); return; } CLEAR_LINK(bp->bp_link); strcpy(bp->bp_dest, baddest); append_link(&jobp->ji_rejectdest, &bp->bp_link, bp); return; } /* END add_dest() */ /* * Check the job for a match of dest in the list of rejected destinations. * * Return: pointer if found, NULL if not. */ badplace *is_bad_dest( job *jobp, char *dest) { /* ji_rejectdest is set in add_dest if approved in ??? */ badplace *bp; bp = (badplace *)GET_NEXT(jobp->ji_rejectdest); while (bp != NULL) { if (!strcmp(bp->bp_dest, dest)) break; bp = (badplace *)GET_NEXT(bp->bp_link); } return(bp); } /* END is_bad_dest() */ /* * default_router - basic function for "routing" jobs. * Does a round-robin attempt on the destinations as listed, * job goes to first destination that takes it. * * If no destination will accept the job, PBSE_ROUTEREJ is returned, * otherwise 0 is returned. */ int default_router( job *jobp, struct pbs_queue *qp, long retry_time) { struct array_strings *dest_attr = NULL; char *destination; int last; if (qp->qu_attr[(int)QR_ATR_RouteDestin].at_flags & ATR_VFLAG_SET) { dest_attr = qp->qu_attr[(int)QR_ATR_RouteDestin].at_val.at_arst; last = dest_attr->as_usedptr; } else { last = 0; } /* loop through all possible destinations */ jobp->ji_retryok = 0; while (1) { if (jobp->ji_lastdest >= last) { jobp->ji_lastdest = 0; /* have tried all */ if (jobp->ji_retryok == 0) { log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, pbse_to_txt(PBSE_ROUTEREJ)); return(PBSE_ROUTEREJ); } else { /* set time to retry job */ jobp->ji_qs.ji_un.ji_routet.ji_rteretry = retry_time; return(0); } } destination = dest_attr->as_string[jobp->ji_lastdest++]; if (is_bad_dest(jobp, destination)) continue; switch (svr_movejob(jobp, destination, NULL)) { case - 1: /* permanent failure */ add_dest(jobp); break; case 0: /* worked */ case 2: /* deferred */ return(0); /*NOTREACHED*/ break; case 1: /* failed, but try destination again */ jobp->ji_retryok = 1; break; } } return(-1); } /* END default_router() */ /* * job_route - route a job to another queue * * This is only called for jobs in a routing queue. * Loop over all the possible destinations for the route queue. * Check each one to see if it is ok to try it. It could have been * tried before and returned a rejection. If so, skip to the next * destination. If it is ok to try it, look to see if it is a local * queue. If so, it is an internal procedure to try/do the move. * If not, a child process is created to deal with it in the * function net_route(), see svr_movejob.c. * * Returns: 0 on success, non-zero (error number) on failure */ int job_route( job *jobp) /* job to route */ { int bad_state = 0; char *id = "job_route"; time_t life; struct pbs_queue *qp; long retry_time; /* see if the job is able to be routed */ switch (jobp->ji_qs.ji_state) { case JOB_STATE_TRANSIT: return(0); /* already going, ignore it */ /*NOTREACHED*/ break; case JOB_STATE_QUEUED: /* NO-OP */ break; /* ok to try */ case JOB_STATE_HELD: /* job may be acceptable */ bad_state = !jobp->ji_qhdr->qu_attr[QR_ATR_RouteHeld].at_val.at_long; break; case JOB_STATE_WAITING: /* job may be acceptable */ bad_state = !jobp->ji_qhdr->qu_attr[QR_ATR_RouteWaiting].at_val.at_long; break; default: sprintf(log_buffer, "%s %d", pbse_to_txt(PBSE_BADSTATE), jobp->ji_qs.ji_state); strcat(log_buffer, id); log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, log_buffer); return(0); /*NOTREACHED*/ break; } /* check the queue limits, can we route any (more) */ qp = jobp->ji_qhdr; if (qp->qu_attr[(int)QA_ATR_Started].at_val.at_long == 0) { /* queue not started - no routing */ return(0); } if ((qp->qu_attr[(int)QA_ATR_MaxRun].at_flags & ATR_VFLAG_SET) && (qp->qu_attr[(int)QA_ATR_MaxRun].at_val.at_long <= qp->qu_njstate[JOB_STATE_TRANSIT])) { /* max number of jobs being routed */ return(0); } /* what is the retry time and life time of a job in this queue */ if (qp->qu_attr[(int)QR_ATR_RouteRetryTime].at_flags & ATR_VFLAG_SET) { retry_time = (long)time_now + qp->qu_attr[(int)QR_ATR_RouteRetryTime].at_val.at_long; } else { retry_time = (long)time_now + PBS_NET_RETRY_TIME; } if (qp->qu_attr[(int)QR_ATR_RouteLifeTime].at_flags & ATR_VFLAG_SET) { life = jobp->ji_qs.ji_un.ji_routet.ji_quetime + qp->qu_attr[(int)QR_ATR_RouteLifeTime].at_val.at_long; } else { life = 0; /* forever */ } if (life && (life < time_now)) { log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, msg_routexceed); /* job too long in queue */ return(PBSE_ROUTEEXPD); } if (bad_state) { /* not currently routing this job */ return(0); } if (qp->qu_attr[(int)QR_ATR_AltRouter].at_val.at_long == 0) { return(default_router(jobp, qp, retry_time)); } return(site_alt_router(jobp, qp, retry_time)); } /* END job_route() */ /* * queue_route - route any "ready" jobs in a specific queue * * look for any job in the queue whose route retry time has * passed. * If the queue is "started" and if the number of jobs in the * Transiting state is less than the max_running limit, then * attempt to route it. */ void queue_route( pbs_queue *pque) { job *nxjb; job *pjob; int rc; pjob = (job *)GET_NEXT(pque->qu_jobs); while (pjob != NULL) { nxjb = (job *)GET_NEXT(pjob->ji_jobque); if (pjob->ji_qs.ji_un.ji_routet.ji_rteretry <= time_now) { if ((rc = job_route(pjob)) == PBSE_ROUTEREJ) job_abt(&pjob, pbse_to_txt(PBSE_ROUTEREJ)); else if (rc == PBSE_ROUTEEXPD) job_abt(&pjob, msg_routexceed); } pjob = nxjb; } return; } torque-2.4.16/src/server/Makefile.am0000664000113300011330000000325511272401245014170 00000000000000include $(top_srcdir)/buildutils/config.mk PBS_LIBS = ../lib/Libattr/libattr.a \ ../lib/Libsite/libsite.a \ ../lib/Libutils/libutils.a \ ../lib/Libpbs/libtorque.la sbin_PROGRAMS = pbs_server pbs_server_LDADD = $(PBS_LIBS) AM_CFLAGS = -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" -DPBS_ENVIRON=\"$(PBS_ENVIRON)\" pbs_server_SOURCES = accounting.c array_func.c array_upgrade.c attr_recov.c \ dis_read.c geteusernam.c \ issue_request.c job_attr_def.c job_func.c job_recov.c \ job_route.c node_attr_def.c node_func.c \ node_manager.c pbsd_init.c pbsd_main.c \ process_request.c queue_attr_def.c queue_func.c \ queue_recov.c reply_send.c req_delete.c \ req_deletearray.c req_getcred.c \ req_holdjob.c req_jobobit.c req_locate.c req_manager.c \ req_message.c req_modify.c req_movejob.c req_quejob.c \ req_register.c req_rerun.c req_rescq.c req_runjob.c \ req_select.c req_shutdown.c req_signal.c req_stat.c \ req_track.c resc_def_all.c run_sched.c stat_job.c \ svr_attr_def.c svr_chk_owner.c svr_connect.c \ svr_func.c svr_jobfunc.c svr_mail.c svr_movejob.c \ svr_recov.c svr_resccost.c svr_task.c req_tokens.c \ job_qs_upgrade.c req_holdarray.c svr_format_job.c install-exec-hook: $(PBS_MKDIRS) aux || : $(PBS_MKDIRS) server rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qserverd$(program_suffix)$(EXEEXT) ln -s $(program_prefix)pbs_server$(program_suffix)$(EXEEXT) \ $(DESTDIR)$(sbindir)/$(program_prefix)qserverd$(program_suffix)$(EXEEXT) uninstall-hook: rm -f $(DESTDIR)$(PBS_ENVIRON) rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qserverd$(program_suffix)$(EXEEXT) torque-2.4.16/src/server/req_register.c0000664000113300011330000015671511605403054015005 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include "libpbs.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "queue.h" #include "server.h" #include "work_task.h" #include "pbs_error.h" #include "log.h" #include "svrfunc.h" #define SYNC_SCHED_HINT_NULL 0 #define SYNC_SCHED_HINT_FIRST 1 #define SYNC_SCHED_HINT_OTHER 2 /* * This file holds all the functions dealing with job dependency */ /* External functions */ extern int issue_to_svr A_((char *svr, struct batch_request *, void (*func)(struct work_task *))); extern long calc_job_cost A_((job *)); /* Local Private Functions */ static void set_depend_hold A_((job *, attribute *)); static int register_sync A_((struct depend *, char *child, char *host, long)); static int register_dep A_((attribute *, struct batch_request *, int, int *)); static int unregister_dep A_((attribute *, struct batch_request *)); static int unregister_sync A_((attribute *, struct batch_request *)); static struct depend *find_depend A_((int type, attribute *pattr)); static struct depend *make_depend A_((int type, attribute *pattr)); static struct depend_job *find_dependjob A_((struct depend *, char *name)); static struct depend_job *make_dependjob A_((struct depend *, char *jobid, char *host)); static void del_depend_job A_((struct depend_job *pdj)); static int build_depend A_((attribute *, char *)); static void clear_depend A_((struct depend *, int type, int exists)); static void del_depend A_((struct depend *)); static void release_cheapest A_((job *, struct depend *)); static int send_depend_req A_((job *, struct depend_job *pparent, int, int, int, void (*postfunc)(struct work_task *))); /* External Global Data Items */ extern struct server server; extern char server_name[]; extern char *msg_err_malloc; extern char *msg_illregister; extern char *msg_registerdel; extern char *msg_registerrel; extern char *msg_regrej; extern char log_buffer[]; extern int LOGLEVEL; extern char *PJobState[]; /* * req_register - process the Register Dependency Request * * We have an interesting problem here in that the request may well * orginate from ourself. In that case we doen't really reply. * * Note: It is possible, though it doesn't make sense, for a job * to have a self-referencing depend. We reject these for the register * and delete operations, but allow it for others in an attempt * to be graceful. */ void req_register( struct batch_request *preq) /* I */ { int made; attribute *pattr; struct depend *pdep; struct depend_job *pdj; job *pjob; char *ps; int rc = 0; int revtype; int type; /* make sure request is from a server */ if (!preq->rq_fromsvr) { req_reject(PBSE_IVALREQ, 0, preq, NULL, NULL); return; } /* find the "parent" job specified in the request */ if ((pjob = find_job(preq->rq_ind.rq_register.rq_parent)) == NULL) { /* * job not found... if server is initializing, it may not * yet recovered, that is not an error. */ if (server.sv_attr[(int)SRV_ATR_State].at_val.at_long != SV_STATE_INIT) { log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, preq->rq_ind.rq_register.rq_parent, pbse_to_txt(PBSE_UNKJOBID)); req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); } else { reply_ack(preq); } return; } type = preq->rq_ind.rq_register.rq_dependtype; if (((pjob->ji_qs.ji_state == JOB_STATE_COMPLETE) || (pjob->ji_qs.ji_state == JOB_STATE_EXITING)) && ((type = JOB_DEPEND_TYPE_AFTERSTART) || (type = JOB_DEPEND_TYPE_AFTERANY) || ((type = JOB_DEPEND_TYPE_AFTEROK) && (pjob->ji_qs.ji_un.ji_exect.ji_exitstat == 0)) || ((type = JOB_DEPEND_TYPE_AFTERNOTOK) && (pjob->ji_qs.ji_un.ji_exect.ji_exitstat != 0)))) { if (LOGLEVEL >= 8) { sprintf(log_buffer,"Dependency requested for %s job, parent job %s, child job %s", PJobState[pjob->ji_qs.ji_state], preq->rq_ind.rq_register.rq_parent, preq->rq_ind.rq_register.rq_child); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, preq->rq_ind.rq_register.rq_parent, pbse_to_txt(PBSE_BADSTATE)); req_reject(PBSE_BADSTATE, 0, preq, NULL, NULL); return; } if (LOGLEVEL >= 8) { sprintf(log_buffer,"Dependency requested parent job %s state (%s), child job %s", preq->rq_ind.rq_register.rq_parent, PJobState[pjob->ji_qs.ji_state], preq->rq_ind.rq_register.rq_child); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } pattr = &pjob->ji_wattr[(int)JOB_ATR_depend]; pjob->ji_modified = 1; /* more of the server:port fix kludge */ if ((ps = strchr(preq->rq_ind.rq_register.rq_child, (int)'@'))) { strcpy(preq->rq_ind.rq_register.rq_svr, ps + 1); *ps = '\0'; } else { /* We ignore what qsub sent us for the host. We need to use the * server_name so we know we can connect to the active server. * This is an high availability consideration */ if(server_name != NULL) strcpy(preq->rq_ind.rq_register.rq_svr, server_name); else strcpy(preq->rq_ind.rq_register.rq_svr, preq->rq_host); } /* Register a dependency */ switch (preq->rq_ind.rq_register.rq_op) { case JOB_DEPEND_OP_REGISTER: if (!strcmp(preq->rq_ind.rq_register.rq_parent, preq->rq_ind.rq_register.rq_child)) { rc = PBSE_IVALREQ; /* can't depend on self */ break; } switch (type) { case JOB_DEPEND_TYPE_SYNCWITH: pdep = find_depend(JOB_DEPEND_TYPE_SYNCCT, pattr); if (pdep != NULL) { rc = register_sync( pdep, preq->rq_ind.rq_register.rq_child, preq->rq_ind.rq_register.rq_svr, preq->rq_ind.rq_register.rq_cost); if (pdep->dp_numreg > pdep->dp_numexp) { /* all registered - release first */ release_cheapest(pjob, pdep); } } else { rc = PBSE_NOSYNCMSTR; } break; case JOB_DEPEND_TYPE_AFTERSTART: case JOB_DEPEND_TYPE_AFTERANY: case JOB_DEPEND_TYPE_AFTEROK: case JOB_DEPEND_TYPE_AFTERNOTOK: rc = register_dep(pattr, preq, type, &made); break; case JOB_DEPEND_TYPE_BEFORESTART: case JOB_DEPEND_TYPE_BEFOREANY: case JOB_DEPEND_TYPE_BEFOREOK: case JOB_DEPEND_TYPE_BEFORENOTOK: /* * Check job owner for permission, use the real * job owner, not the sending server's name. */ strcpy(preq->rq_user, preq->rq_ind.rq_register.rq_owner); if (svr_chk_owner(preq, pjob)) { rc = PBSE_PERM; /* not same user */ } else { /* ok owner, see if job has "on" */ pdep = find_depend(JOB_DEPEND_TYPE_ON, pattr); if (pdep == NULL) { /* on "on", see if child already registered */ revtype = type ^(JOB_DEPEND_TYPE_BEFORESTART - JOB_DEPEND_TYPE_AFTERSTART); pdep = find_depend(revtype, pattr); if (pdep == NULL) { /* no "on" and no prior - return error */ rc = PBSE_BADDEPEND; } else if ((pdj = find_dependjob(pdep, preq->rq_ind.rq_register.rq_child))) { /* has prior register, update it */ if(server_name != NULL) strncpy(pdj->dc_svr, server_name, PBS_MAXSERVERNAME); else strncpy(pdj->dc_svr, preq->rq_ind.rq_register.rq_svr, PBS_MAXSERVERNAME); } } else if ((rc = register_dep(pattr, preq, type, &made)) == 0) { if (made) { /* first time registered */ if (--pdep->dp_numexp <= 0) del_depend(pdep); } } } break; default: rc = PBSE_IVALREQ; break; } break; case JOB_DEPEND_OP_RELEASE: /* * Release a dependency so job might run */ switch (type) { case JOB_DEPEND_TYPE_BEFORESTART: case JOB_DEPEND_TYPE_BEFOREANY: case JOB_DEPEND_TYPE_BEFOREOK: case JOB_DEPEND_TYPE_BEFORENOTOK: /* predecessor sent release-reduce "on", */ /* see if this job can now run */ type ^= (JOB_DEPEND_TYPE_BEFORESTART - JOB_DEPEND_TYPE_AFTERSTART); if ((pdep = find_depend(type, pattr))) { if ((pdj = find_dependjob(pdep, preq->rq_ind.rq_register.rq_child))) { del_depend_job(pdj); sprintf(log_buffer, msg_registerrel, preq->rq_ind.rq_register.rq_child); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); if (GET_NEXT(pdep->dp_jobs) == 0) { /* no more dependencies of this type */ del_depend(pdep); set_depend_hold(pjob, pattr); } break; } } /* END if ((pdep = find_depend(type,pattr))) */ rc = PBSE_IVALREQ; break; case JOB_DEPEND_TYPE_SYNCWITH: pdep = find_depend(JOB_DEPEND_TYPE_SYNCCT, pattr); if (pdep == NULL) pdep = find_depend(JOB_DEPEND_TYPE_SYNCWITH, pattr); if (pdep != NULL) { char tmpcoststr[64]; pdep->dp_released = 1; set_depend_hold(pjob, pattr); sprintf(tmpcoststr, "%ld", preq->rq_ind.rq_register.rq_cost); pjob->ji_wattr[(int)JOB_ATR_sched_hint].at_val.at_str = strdup(tmpcoststr); pjob->ji_wattr[(int)JOB_ATR_sched_hint].at_flags |= ATR_VFLAG_SET; } else { rc = PBSE_NOSYNCMSTR; } break; } break; case JOB_DEPEND_OP_READY: if ((pdep = find_depend(JOB_DEPEND_TYPE_SYNCCT, pattr))) { /* mark sender as running */ pdj = (struct depend_job *)GET_NEXT(pdep->dp_jobs); while (pdj) { if (strcmp(pdj->dc_child, preq->rq_ind.rq_register.rq_child) == 0) { pdj->dc_state = JOB_DEPEND_OP_READY; break; } pdj = (struct depend_job *)GET_NEXT(pdj->dc_link); } release_cheapest(pjob, pdep); /* release next one */ } else { rc = PBSE_NOSYNCMSTR; } break; case JOB_DEPEND_OP_DELETE: if (!strcmp(preq->rq_ind.rq_register.rq_parent, preq->rq_ind.rq_register.rq_child)) { rc = PBSE_IVALREQ; /* prevent an infinite loop */ break; } sprintf(log_buffer, msg_registerdel, preq->rq_ind.rq_register.rq_child); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); job_abt(&pjob, log_buffer); /* pjob freed and set to NULL */ break; case JOB_DEPEND_OP_UNREG: if (type == JOB_DEPEND_TYPE_SYNCWITH) { if (pjob->ji_qs.ji_state == JOB_STATE_RUNNING) { rc = PBSE_IVALREQ; } else { unregister_sync(pattr, preq); } } else { unregister_dep(pattr, preq); } set_depend_hold(pjob, pattr); break; default: sprintf(log_buffer, msg_illregister, preq->rq_ind.rq_register.rq_parent); log_event( PBSEVENT_DEBUG | PBSEVENT_SYSTEM | PBSEVENT_ERROR, PBS_EVENTCLASS_REQUEST, preq->rq_host, log_buffer); rc = PBSE_IVALREQ; break; } /* END switch (preq->rq_ind.rq_register.rq_op) */ if (rc) { if (pjob != NULL) pjob->ji_modified = 0; req_reject(rc, 0, preq, NULL, NULL); } else { if ((pjob != NULL) && (pjob->ji_modified != 0)) job_save(pjob, SAVEJOB_FULL); reply_ack(preq); } return; } /* END req_register() */ /* * post_doq (que not dog) - post request/reply processing for depend_on_que * i.e. the sending of register operations. */ static void post_doq( struct work_task *pwt) { struct batch_request *preq = (struct batch_request *)pwt->wt_parm1; char *jobid = preq->rq_ind.rq_register.rq_child; char *msg; job *pjob; attribute *pattr; struct depend *pdp; struct depend_job *pdjb; if (preq->rq_reply.brp_code) { /* request was rejected */ strcpy(log_buffer, msg_regrej); strcat(log_buffer, preq->rq_ind.rq_register.rq_parent); log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobid, log_buffer); pjob = find_job(jobid); if ((msg = pbse_to_txt(preq->rq_reply.brp_code)) != NULL) { strcat(log_buffer, "\n"); strcat(log_buffer, msg); } if (pjob != NULL) { strcat(log_buffer, "\n"); strcat(log_buffer, "Job held for unknown job dep, use 'qrls' to release"); if (preq->rq_reply.brp_code != PBSE_BADSTATE) { svr_mailowner(pjob, MAIL_ABORT, MAIL_FORCE, log_buffer); } pattr = &pjob->ji_wattr[(int)JOB_ATR_depend]; if (((pdp = find_depend(preq->rq_ind.rq_register.rq_dependtype, pattr)) != 0) && ((pdjb = find_dependjob(pdp, preq->rq_ind.rq_register.rq_parent)) != 0)) { del_depend_job(pdjb); if (preq->rq_reply.brp_code != PBSE_BADSTATE) { pjob->ji_wattr[(int)JOB_ATR_hold].at_val.at_long |= HOLD_u; pjob->ji_wattr[(int)JOB_ATR_hold].at_flags |= ATR_VFLAG_SET; pjob->ji_modified = 1; } set_depend_hold(pjob, pattr); } } } release_req(pwt); return; } /* END post_doq() */ /* * alter_unreg - if required, unregister dependencies on alter of attribute * This is called from depend_on_que() when is is acting as the at_action * routine for the dependency attribute. */ static void alter_unreg( job *pjob, attribute *old, /* current job dependency attribure */ attribute *new) /* job dependency attribute after alter */ { struct depend *poldd; struct depend *pnewd; struct depend_job *oldjd; int type; for (poldd = (struct depend *)GET_NEXT(old->at_val.at_list); poldd; poldd = (struct depend *)GET_NEXT(poldd->dp_link)) { type = poldd->dp_type; if ((type != JOB_DEPEND_TYPE_ON) && (type != JOB_DEPEND_TYPE_SYNCCT)) { pnewd = find_depend(type, new); oldjd = (struct depend_job *)GET_NEXT(poldd->dp_jobs); while (oldjd) { if ((pnewd == 0) || (find_dependjob(pnewd, oldjd->dc_child) == 0)) { send_depend_req( pjob, oldjd, type, JOB_DEPEND_OP_UNREG, SYNC_SCHED_HINT_NULL, release_req); } oldjd = (struct depend_job *)GET_NEXT(oldjd->dc_link); } } } return; } /* END alter_unreq() */ /* * depend_on_que - Perform a series of actions if job has a dependency * that needs action when the job is queued into an execution queue. * * Called from svr_enquejob() when a job enters an * execution queue. Also the at_action routine for the attribute. */ int depend_on_que( attribute *pattr, void *pjob, int mode) { long cost; struct depend *pdep; struct depend_job *pparent; int rc; int type; if (((mode != ATR_ACTION_ALTER) && (mode != ATR_ACTION_NOOP)) || (((job *)pjob)->ji_qhdr == 0) || (((job *)pjob)->ji_qhdr->qu_qs.qu_type != QTYPE_Execution)) { return(0); } if (mode == ATR_ACTION_ALTER) { /* if there are dependencies being removed, unregister them */ alter_unreg((job *)pjob, &((job *)pjob)->ji_wattr[(int)JOB_ATR_depend], pattr); } /* First set a System hold if required */ set_depend_hold((job *)pjob, pattr); /* Check if there are dependencies that require registering */ pdep = (struct depend *)GET_NEXT(pattr->at_val.at_list); while (pdep != NULL) { type = pdep->dp_type; if (type == JOB_DEPEND_TYPE_SYNCCT) { /* register myself - this calculates and records the cost */ cost = calc_job_cost((job *)pjob); register_sync(pdep, ((job *)pjob)->ji_qs.ji_jobid, server_name, cost); if (pdep->dp_numreg > pdep->dp_numexp) release_cheapest((job *)pjob, pdep); } else if (type != JOB_DEPEND_TYPE_ON) { pparent = (struct depend_job *)GET_NEXT(pdep->dp_jobs); while (pparent) { if ((rc = send_depend_req((job *)pjob, pparent, type, JOB_DEPEND_OP_REGISTER, SYNC_SCHED_HINT_NULL, post_doq))) return(rc); pparent = (struct depend_job *)GET_NEXT(pparent->dc_link); } } pdep = (struct depend *)GET_NEXT(pdep->dp_link); } return(0); } /* END depend_on_que() */ /* * post_doe - Post (reply) processing of requests processing for depend_on_exec */ static void post_doe( struct work_task *pwt) { struct batch_request *preq = pwt->wt_parm1; char *jobid = preq->rq_ind.rq_register.rq_child; attribute *pattr; struct depend *pdep; struct depend_job *pdj; job *pjob; pjob = find_job(jobid); if (pjob != NULL) { pattr = &pjob->ji_wattr[(int)JOB_ATR_depend]; pdep = find_depend(JOB_DEPEND_TYPE_BEFORESTART, pattr); pdj = find_dependjob(pdep, preq->rq_ind.rq_register.rq_parent); del_depend_job(pdj); if (GET_NEXT(pdep->dp_jobs) == 0) { /* no more dependencies of this type */ del_depend(pdep); } } release_req(pwt); return; } /* END post_doe() */ /* * depend_on_exec - Perform actions if job has * "beforestart" dependency - send "register-release" to child job; or * "syncct/syncwith" dependency - send "register-ready" to child job. * * This function is called from svr_startjob(). */ int depend_on_exec( job *pjob) { struct depend *pdep; struct depend_job *pdj; /* If any jobs come after my start, release them */ pdep = find_depend( JOB_DEPEND_TYPE_BEFORESTART, &pjob->ji_wattr[(int)JOB_ATR_depend]); if (pdep != NULL) { pdj = (struct depend_job *)GET_NEXT(pdep->dp_jobs); while (pdj != NULL) { send_depend_req( pjob, pdj, pdep->dp_type, JOB_DEPEND_OP_RELEASE, SYNC_SCHED_HINT_NULL, post_doe); pdj = (struct depend_job *)GET_NEXT(pdj->dc_link); } } /* If I am a member of a sync set, */ /* send ready to master to release next in set */ pdep = find_depend( JOB_DEPEND_TYPE_SYNCWITH, &pjob->ji_wattr[(int)JOB_ATR_depend]); if (pdep != NULL) { pdj = (struct depend_job *)GET_NEXT(pdep->dp_jobs); if (pdj != NULL) { send_depend_req( pjob, pdj, pdep->dp_type, JOB_DEPEND_OP_READY, SYNC_SCHED_HINT_NULL, release_req); } } /* If I am the master of a sync set, skip the sending (to myself) */ /* a ready, just cut direct to releasing the next cheapest */ pdep = find_depend(JOB_DEPEND_TYPE_SYNCCT, &pjob->ji_wattr[(int)JOB_ATR_depend]); if (pdep != NULL) { pdj = (struct depend_job *)GET_NEXT(pdep->dp_jobs); if (pdj != NULL) { /* first will be myself, mark as running */ pdj->dc_state = JOB_DEPEND_OP_READY; } release_cheapest(pjob, pdep); } return(0); } /* END depend_on_exec() */ /* depend_on_term - Perform actions if job has "afterany, afterok, afternotok" * dependencies, send "register-release" or register-delete" as * appropriate. * * This function is invoked from on_job_exit() in req_jobobit.c. * When there are no depends to deal with, free the attribute and * recall on_job_exit(). */ int depend_on_term( job *pjob) { int exitstat = pjob->ji_qs.ji_un.ji_exect.ji_exitstat; int op; attribute *pattr; struct depend *pdep; struct depend_job *pparent; int rc; int shouldkill = 0; int type; pattr = &pjob->ji_wattr[(int)JOB_ATR_depend]; pdep = (struct depend *)GET_NEXT(pattr->at_val.at_list); while (pdep != NULL) { op = -1; type = pdep->dp_type; /* for the first three, before... types, release or delete */ /* next job depending on exit status */ switch (type) { case JOB_DEPEND_TYPE_BEFOREOK: if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_ABORT) { op = JOB_DEPEND_OP_DELETE; } else { if (exitstat == 0) op = JOB_DEPEND_OP_RELEASE; else op = JOB_DEPEND_OP_DELETE; } break; case JOB_DEPEND_TYPE_BEFORENOTOK: if (exitstat != 0) op = JOB_DEPEND_OP_RELEASE; else op = JOB_DEPEND_OP_DELETE; break; case JOB_DEPEND_TYPE_BEFOREANY: op = JOB_DEPEND_OP_RELEASE; break; case JOB_DEPEND_TYPE_SYNCCT: /* Master of sync set has ended, if any members were */ /* never started, kill all the jobs in the set */ pparent = (struct depend_job *)GET_NEXT(pdep->dp_jobs); while (pparent != NULL) { if (pparent->dc_state != JOB_DEPEND_OP_READY) shouldkill = 1; pparent = (struct depend_job *)GET_NEXT(pparent->dc_link); } if (shouldkill) { pparent = (struct depend_job *)GET_NEXT(pdep->dp_jobs); /* skip first, its this job */ pparent = (struct depend_job *)GET_NEXT(pparent->dc_link); while (pparent) { send_depend_req(pjob, pparent, type, JOB_DEPEND_OP_DELETE, SYNC_SCHED_HINT_NULL, release_req); pparent = (struct depend_job *)GET_NEXT(pparent->dc_link); } } break; } /* END switch(type) */ if (op != -1) { pparent = (struct depend_job *)GET_NEXT(pdep->dp_jobs); while (pparent) { /* "release" the job to execute */ if ((rc = send_depend_req(pjob, pparent, type, op, SYNC_SCHED_HINT_NULL, release_req))) return (rc); pparent = (struct depend_job *)GET_NEXT(pparent->dc_link); } } pdep = (struct depend *)GET_NEXT(pdep->dp_link); } return(0); } /* END depend_on_term() */ /* * release_cheapest - release the cheapest of the unreleased jobs in the * sync set. */ static void release_cheapest( job *pjob, struct depend *pdep) { long lowestcost = 0; struct depend_job *cheapest = (struct depend_job *)0; int hint = SYNC_SCHED_HINT_OTHER; int nreleased = 0; struct depend_job *pdj; pdj = (struct depend_job *)GET_NEXT(pdep->dp_jobs); while (pdj != NULL) { if (pdj->dc_state == 0) { if ((cheapest == NULL) || (pdj->dc_cost < lowestcost)) { cheapest = pdj; lowestcost = pdj->dc_cost; } } else { ++nreleased; /* incr number already released */ } pdj = (struct depend_job *)GET_NEXT(pdj->dc_link); } if (cheapest) { if (nreleased == 0) hint = SYNC_SCHED_HINT_FIRST; if (send_depend_req( pjob, cheapest, JOB_DEPEND_TYPE_SYNCWITH, JOB_DEPEND_OP_RELEASE, hint, release_req) == 0) { cheapest->dc_state = JOB_DEPEND_OP_RELEASE; } } return; } /* END release_cheapest() */ /** * set_depend_hold - set a hold on the job required by the type of dependency * * NOTE: determine where dependency hold is cleared and comment */ static void set_depend_hold( job *pjob, attribute *pattr) { int loop = 1; int newstate; int newsubst; struct depend *pdp = NULL; struct depend_job *djob = NULL; struct job *djp = NULL; int substate = -1; if (pattr->at_flags & ATR_VFLAG_SET) pdp = (struct depend *)GET_NEXT(pattr->at_val.at_list); while ((pdp != NULL) && (loop != 0)) { switch (pdp->dp_type) { case JOB_DEPEND_TYPE_SYNCCT: if (pdp->dp_released == 0) substate = JOB_SUBSTATE_SYNCHOLD; break; case JOB_DEPEND_TYPE_SYNCWITH: if (((struct depend_job *)GET_NEXT(pdp->dp_jobs) != 0) && (pdp->dp_released == 0)) substate = JOB_SUBSTATE_SYNCHOLD; break; case JOB_DEPEND_TYPE_AFTERSTART: case JOB_DEPEND_TYPE_AFTEROK: case JOB_DEPEND_TYPE_AFTERNOTOK: case JOB_DEPEND_TYPE_AFTERANY: /* If the job we are depending on has already completed */ /* Then don't set this job on Dependant Hold, just leave it as Queued */ djob = (struct depend_job *)GET_NEXT(pdp->dp_jobs); if (djob) { djp = find_job(djob->dc_child); if (!djp || ((pdp->dp_type == JOB_DEPEND_TYPE_AFTERSTART) && (djp->ji_qs.ji_state < JOB_STATE_RUNNING))) { substate = JOB_SUBSTATE_DEPNHOLD; } else if ((pdp->dp_type != JOB_DEPEND_TYPE_AFTERSTART) && (djp->ji_qs.ji_state != JOB_STATE_COMPLETE)) { substate = JOB_SUBSTATE_DEPNHOLD; } else if (((pdp->dp_type == JOB_DEPEND_TYPE_AFTEROK) && (djp->ji_qs.ji_un.ji_exect.ji_exitstat != 0)) || ((pdp->dp_type == JOB_DEPEND_TYPE_AFTERNOTOK) && (djp->ji_qs.ji_un.ji_exect.ji_exitstat == 0))) { substate = JOB_SUBSTATE_DEPNHOLD; } } break; case JOB_DEPEND_TYPE_ON: if (pdp->dp_numexp) substate = JOB_SUBSTATE_DEPNHOLD; break; } /* END switch (pdp->dp_type) */ pdp = (struct depend *)GET_NEXT(pdp->dp_link); } /* END while ((pdp != NULL) && (loop != 0)) */ if (substate == -1) { /* No (more) dependencies, clear system hold and set state */ if ((pjob->ji_qs.ji_substate == JOB_SUBSTATE_SYNCHOLD) || (pjob->ji_qs.ji_substate == JOB_SUBSTATE_DEPNHOLD)) { pjob->ji_wattr[(int)JOB_ATR_hold].at_val.at_long &= ~HOLD_s; /* newstate is job's 'natural state - ie, what it would be if dependency did not exist */ if (LOGLEVEL >= 8) { log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "Clearing HOLD_s due to dependencies\n"); } svr_evaljobstate(pjob, &newstate, &newsubst, 0); svr_setjobstate(pjob, newstate, newsubst); } } else { /* there are dependencies, set system hold accordingly */ pjob->ji_wattr[(int)JOB_ATR_hold].at_val.at_long |= HOLD_s; pjob->ji_wattr[(int)JOB_ATR_hold].at_flags |= ATR_VFLAG_SET; if (LOGLEVEL >= 8) { log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "Setting HOLD_s due to dependencies\n"); } svr_setjobstate(pjob, JOB_STATE_HELD, substate); } return; } /* END set_depend_hold() */ /* * depend_clrrdy - clear state ready flags in job dependency attribute */ void depend_clrrdy( job *pjob) { struct depend *pdp; struct depend_job *pdjb; pdp = (struct depend *)GET_NEXT(pjob->ji_wattr[(int)JOB_ATR_depend].at_val.at_list); while ((pdp != NULL) && (pdp->dp_type == JOB_DEPEND_TYPE_SYNCCT)) { pdjb = (struct depend_job *)GET_NEXT(pdp->dp_jobs); while (pdjb != NULL) { pdjb->dc_state = 0; pdjb = (struct depend_job *)GET_NEXT(pdjb->dc_link); } pdp = (struct depend *)GET_NEXT(pdp->dp_link); } return; } /* END depend_clrrdy() */ /* * find_depend - find a dependency struct of a certain type for a job */ static struct depend *find_depend( int type, attribute *pattr) { struct depend *pdep = NULL; if (pattr->at_flags & ATR_VFLAG_SET) { pdep = (struct depend *)GET_NEXT(pattr->at_val.at_list); while (pdep != NULL) { if (pdep->dp_type == type) break; pdep = (struct depend *)GET_NEXT(pdep->dp_link); } } return(pdep); } /* END find_depend() */ /* * make_depend - allocate and attach a depend struct to the attribute */ static struct depend *make_depend( int type, attribute *pattr) { struct depend *pdep = (struct depend *)0; pdep = (struct depend *)malloc(sizeof(struct depend)); if (pdep != NULL) { clear_depend(pdep, type, 0); append_link(&pattr->at_val.at_list, &pdep->dp_link, pdep); pattr->at_flags |= ATR_VFLAG_SET; } return(pdep); } /* END make_depend() */ /* * register_sync - a "child job" is registering sync with its "parent" */ static int register_sync( struct depend *pdep, char *child, char *host, long cost) { struct depend_job *pdj; if ((pdj = find_dependjob(pdep, child))) { /* existing regist., just update the location of the child */ if(server_name != NULL) strcpy(pdj->dc_svr, server_name); else strcpy(pdj->dc_svr, host); return(0); } /* a new registration, create depend_job entry */ pdj = make_dependjob(pdep, child, host); if (pdj == NULL) { return(PBSE_SYSTEM); } pdj->dc_cost = cost; /* increment number registered */ if (++pdep->dp_numreg > pdep->dp_numexp + 1) { return(PBSE_IVALREQ); /* too many registered */ } return(0); } /* END register_sync() */ /* * register_dep - Some job wants to run before/after the local job, so set up * a dependency on the local job. * * @see req_register() - parent * */ static int register_dep( attribute *pattr, struct batch_request *preq, int type, int *made) /* RETURN */ { struct depend *pdep; struct depend_job *pdj; /* change into the mirror image type */ type ^= (JOB_DEPEND_TYPE_BEFORESTART - JOB_DEPEND_TYPE_AFTERSTART); if ((pdep = find_depend(type, pattr)) == NULL) { if ((pdep = make_depend(type, pattr)) == NULL) { return(PBSE_SYSTEM); } } if ((pdj = find_dependjob(pdep, preq->rq_ind.rq_register.rq_child))) { if(server_name != NULL) strcpy(pdj->dc_svr, server_name); else strcpy(pdj->dc_svr, preq->rq_ind.rq_register.rq_svr); *made = 0; return(0); } if ((pdj = make_dependjob( pdep, preq->rq_ind.rq_register.rq_child, preq->rq_ind.rq_register.rq_svr)) == NULL) { return(PBSE_SYSTEM); } /* SUCCESS */ *made = 1; return(0); } /* END register_dep() */ /** * unregister_dep - remove a registered dependency * Results from a qalter call to remove existing dependencies * * @see register_dep() */ static int unregister_dep( attribute *pattr, struct batch_request *preq) { int type; struct depend *pdp; struct depend_job *pdjb; /* get mirror image of dependency type */ type = preq->rq_ind.rq_register.rq_dependtype ^ (JOB_DEPEND_TYPE_BEFORESTART - JOB_DEPEND_TYPE_AFTERSTART); if (((pdp = find_depend(type, pattr)) == 0) || ((pdjb = find_dependjob(pdp, preq->rq_ind.rq_register.rq_child)) == 0)) { return(PBSE_IVALREQ); } del_depend_job(pdjb); return(0); } /* END unregister_dep() */ /* * unregister_sync - remove a registered sycn-dependency * Results from a qalter call to remove existing dependencies */ static int unregister_sync( attribute *pattr, struct batch_request *preq) { struct depend *pdp; struct depend_job *pdjb; if (((pdp = find_depend(JOB_DEPEND_TYPE_SYNCCT, pattr)) == 0) || ((pdjb = find_dependjob(pdp, preq->rq_ind.rq_register.rq_child)) == 0)) { return(PBSE_IVALREQ); } del_depend_job(pdjb); if (--pdp->dp_numreg <= pdp->dp_numexp) { if (pdp->dp_released == 1) { pdjb = (struct depend_job *)GET_NEXT(pdp->dp_jobs); pdjb->dc_state = 0; pdp->dp_released = 0; } } return(0); } /* END unregister_sync() */ /* * find_dependjob - find a child dependent job with a certain job id */ static struct depend_job *find_dependjob( struct depend *pdep, char *name) { struct depend_job *pdj; pdj = (struct depend_job *)GET_NEXT(pdep->dp_jobs); while (pdj) { if (!strcmp(name, pdj->dc_child)) break; pdj = (struct depend_job *)GET_NEXT(pdj->dc_link); } return(pdj); } /* END find_dependjob() */ /* * make_dependjob - add a depend_job structue */ static struct depend_job *make_dependjob( struct depend *pdep, char *jobid, char *host) { struct depend_job *pdj; pdj = (struct depend_job *)malloc(sizeof(struct depend_job)); if (pdj != NULL) { CLEAR_LINK(pdj->dc_link); pdj->dc_state = 0; pdj->dc_cost = 0; strcpy(pdj->dc_child, jobid); if(server_name != NULL) strcpy(pdj->dc_svr, server_name); else strcpy(pdj->dc_svr, host); append_link(&pdep->dp_jobs, &pdj->dc_link, pdj); } return(pdj); } /* END make_dependjob() */ /* * send_depend_req - build and send a Register Dependent request */ static int send_depend_req( job *pjob, struct depend_job *pparent, int type, int op, int schedhint, void (*postfunc) A_((struct work_task *))) { int i; char *myid = "send_depend_req"; struct batch_request *preq; preq = alloc_br(PBS_BATCH_RegistDep); if (preq == NULL) { log_err(errno, myid, msg_err_malloc); return(PBSE_SYSTEM); } for (i = 0;i < PBS_MAXUSER;++i) { preq->rq_ind.rq_register.rq_owner[i] = pjob->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str[i]; if (preq->rq_ind.rq_register.rq_owner[i] == '@') break; } preq->rq_ind.rq_register.rq_owner[i] = '\0'; strcpy(preq->rq_ind.rq_register.rq_parent, pparent->dc_child); strcpy(preq->rq_ind.rq_register.rq_child, pjob->ji_qs.ji_jobid); /* kludge for server:port follows */ if (strchr(server_name, (int)':')) { strcat(preq->rq_ind.rq_register.rq_child, "@"); strcat(preq->rq_ind.rq_register.rq_child, server_name); } preq->rq_ind.rq_register.rq_dependtype = type; preq->rq_ind.rq_register.rq_op = op; strcpy(preq->rq_host, pparent->dc_svr); /* for issue_to_svr() */ /* if registering sync, include job cost for scheduling */ if (type == JOB_DEPEND_TYPE_SYNCWITH) { if (op == JOB_DEPEND_OP_REGISTER) /* for sync-register, cost = job resource cost */ preq->rq_ind.rq_register.rq_cost = calc_job_cost(pjob); else /* for sync-release, cost = scheduling hint */ preq->rq_ind.rq_register.rq_cost = schedhint; } else { /* otherwise, cost = null */ preq->rq_ind.rq_register.rq_cost = 0; } if (issue_to_svr(pparent->dc_svr, preq, postfunc) == -1) { sprintf(log_buffer, "Unable to perform dependency with job %s\n", pparent->dc_child); return(PBSE_BADHOST); } return(0); } /* END send_depend_req() */ /* * This section contains general function for dependency attributes * * Each attribute has functions for: * Decoding the value string to the machine representation. * Encoding the internal representation of the attribute to external * Setting the value by =, + or - operators. * Comparing a (decoded) value with the attribute value. * Freeing the space malloc-ed to the attribute value. * * The prototypes are declared in "attribute.h" * * ---------------------------------------------------------------------------- * Attribute functions for attributes of type "dependency". * * The "encoded" or external form of the value is a string with sub-strings * separated by commas and terminated by a null. * * The "decoded" or internal form is a list of depend (and depend_child) * structures, which are defined in pbs_job.h. * ---------------------------------------------------------------------------- */ struct dependnames { int type; char *name; } dependnames[] = { {JOB_DEPEND_TYPE_AFTERSTART, "after" }, {JOB_DEPEND_TYPE_AFTEROK, "afterok" }, {JOB_DEPEND_TYPE_AFTERNOTOK, "afternotok" }, {JOB_DEPEND_TYPE_AFTERANY, "afterany" }, {JOB_DEPEND_TYPE_BEFORESTART, "before" }, {JOB_DEPEND_TYPE_BEFOREOK, "beforeok" }, {JOB_DEPEND_TYPE_BEFORENOTOK, "beforenotok" }, {JOB_DEPEND_TYPE_BEFOREANY, "beforeany" }, {JOB_DEPEND_TYPE_ON, "on" }, {JOB_DEPEND_TYPE_SYNCWITH, "syncwith" }, {JOB_DEPEND_TYPE_SYNCCT, "synccount" }, { -1, (char *)0 } }; /* * decode_depend - decode a string into an attr of type dependency * String is of form: depend_type:job_id[:job_id:...][,depend_type:job_id] * * Returns: 0 if ok, * >0 error number if error, * *patr members set */ int decode_depend( struct attribute *patr, char *name, /* attribute name */ char *rescn, /* resource name, unused here */ char *val) /* attribute value */ { int rc; char *valwd; if ((val == NULL) || (*val == '\0')) { free_depend(patr); patr->at_flags |= ATR_VFLAG_MODIFY; return(0); } /* * for each sub-string (terminated by comma or new-line), * add a depend or depend_child structure. */ valwd = parse_comma_string(val); while (valwd != NULL) { if ((rc = build_depend(patr, valwd)) != 0) { free_depend(patr); return(rc); } valwd = parse_comma_string(NULL); } patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return(0); } /* END decode_depend() */ /* * cpy_jobsvr() - a version of strcat() that watches for an embedded colon * and escapes it with a leading blackslash. This is needed because * the colon is overloaded, both as job_id separater within a set of * depend jobs, and as the server:port separater. Ugh! * * This code is horribly inefficient, because we have to walk the length of d, when called in a tight loop. We are * trying to replace this with cat_jobsvr. */ #if 0 static void cpy_jobsvr( char *d, char *s) { while (*d) d++; while (*s) { if (*s == ':') *d++ = '\\'; *d++ = *s++; } *d = '\0'; return; } /* END cpy_jobsvr() */ #endif /* 0 */ /* * cat_jobsvr() - a version of strcat() that watches for an embedded colon * and escapes it with a leading blackslash. This is needed because * the colon is overloaded, both as job_id separater within a set of * depend jobs, and as the server:port separater. Ugh! */ static void cat_jobsvr( char **Dest, char *Src) { char *d; if (Dest == NULL) return; d = *Dest; while (*Src) { if (*Src == ':') *d++ = '\\'; *d++ = *Src++; } *d = '\0'; *Dest = d; return; } /* * fast_strcat() - an improved version of strcat() that is more efficient in * a tight loop */ static void fast_strcat( char **Dest, char *Src) { char *d; if (Dest == NULL) return; d = *Dest; while (*Src) *d++ = *Src++; *d = '\0'; *Dest = d; return; } /* * dup_depend - duplicate a dependency (see set_depend()) */ static int dup_depend( attribute *pattr, struct depend *pd) { struct depend *pnwd; struct depend_job *poldj; struct depend_job *pnwdj; int type; type = pd->dp_type; if ((pnwd = make_depend(type, pattr)) == 0) { return(-1); } pnwd->dp_numexp = pd->dp_numexp; pnwd->dp_numreg = pd->dp_numreg; pnwd->dp_released = pd->dp_released; for (poldj = (struct depend_job *)GET_NEXT(pd->dp_jobs); poldj != NULL; poldj = (struct depend_job *)GET_NEXT(poldj->dc_link)) { if ((pnwdj = make_dependjob(pnwd, poldj->dc_child, poldj->dc_svr)) == 0) { return(-1); } pnwdj->dc_state = poldj->dc_state; pnwdj->dc_cost = poldj->dc_cost; } return(0); } /* END dup_depend() */ /* * encode_depend - encode dependency attr into attrlist entry * * Returns: >0 if ok, entry created and linked into list * =0 no value to encode, entry not created * -1 if error */ /*ARGSUSED*/ int encode_depend( attribute *attr, /* ptr to attribute to encode */ tlist_head *phead, /* ptr to head of attrlist list */ char *atname, /* attribute name */ char *rsname, /* resource name or null */ int mode) /* encode mode, unused here */ { int ct = 0; char cvtbuf[22]; int numdep = 0; struct depend *nxdp; struct svrattrl *pal; struct depend *pdp; struct depend_job *pdjb = NULL; struct dependnames *pn; char *BPtr = 0; int BSpace = -1; if (!attr) return (-1); if (!(attr->at_flags & ATR_VFLAG_SET)) return (0); /* no values */ pdp = (struct depend *)GET_NEXT(attr->at_val.at_list); if (pdp == (struct depend *)0) return (0); /* scan dependencies types to compute needed base size of svrattrl */ for (nxdp = pdp; nxdp; nxdp = (struct depend *)GET_NEXT(nxdp->dp_link)) { if ((nxdp->dp_type == JOB_DEPEND_TYPE_SYNCCT) || (nxdp->dp_type == JOB_DEPEND_TYPE_ON)) { ct += 30; /* a guess at a reasonable amt of space */ } else { ct += 12; /* for longest type */ pdjb = (struct depend_job *)GET_NEXT(nxdp->dp_jobs); while (pdjb) { ct += PBS_MAXSVRJOBID + PBS_MAXSERVERNAME + 3; pdjb = (struct depend_job *)GET_NEXT(pdjb->dc_link); } } } if ((pal = attrlist_create(atname, rsname, ct)) == (svrattrl *)0) { return (-1); } *pal->al_value = '\0'; BPtr = pal->al_value; BSpace = pal->al_tsize; /* this is actually a little larger than the actual buffer */ for (nxdp = pdp; nxdp; nxdp = (struct depend *)GET_NEXT(nxdp->dp_link)) { if ((nxdp->dp_type != JOB_DEPEND_TYPE_SYNCCT) && (nxdp->dp_type != JOB_DEPEND_TYPE_ON) && !(pdjb = (struct depend_job *)GET_NEXT(nxdp->dp_jobs))) { continue; /* no value, skip this one */ } if (nxdp != pdp) fast_strcat(&BPtr,","); /* comma between */ pn = &dependnames[nxdp->dp_type]; fast_strcat(&BPtr,pn->name); if ((pn->type == JOB_DEPEND_TYPE_SYNCCT) || (pn->type == JOB_DEPEND_TYPE_ON)) { sprintf(cvtbuf, ":%d", nxdp->dp_numexp); fast_strcat(&BPtr,cvtbuf); } else { while (pdjb) { fast_strcat(&BPtr,":"); cat_jobsvr(&BPtr,pdjb->dc_child); if (*pdjb->dc_svr != '\0') { /* WARNING: do we need to escape colons here (we used to) */ fast_strcat(&BPtr,"@"); cat_jobsvr(&BPtr,pdjb->dc_svr); } pdjb = (struct depend_job *)GET_NEXT(pdjb->dc_link); } } ++numdep; } if (numdep) { /* there are dependencies recorded, added to the list */ pal->al_flags = attr->at_flags; append_link(phead, &pal->al_link, pal); return (1); } else { /* there are no dependencies, just the base structure, */ /* so remove this svrattrl from ths list */ (void)free(pal); return (0); } } /* END encode_depend() */ /* * set_depend - set value of attribute of dependency type to another * * A=B --> set of dependencies in A replaced by set in B * A+B --> dependencies in B added to list in A * A-B --> not defined * * Returns: 0 if ok * >0 if error */ int set_depend( struct attribute *attr, struct attribute *new, enum batch_op op) { struct depend *pdnew; struct depend *pdold; int rc; assert(attr && new); switch (op) { case SET: /* * if the type of dependency entry already exists, we are * going to replace it, so get rid of the old and dup the new */ pdnew = (struct depend *)GET_NEXT(new->at_val.at_list); while (pdnew != NULL) { pdold = find_depend(pdnew->dp_type, attr); if (pdold != NULL) del_depend(pdold); if ((rc = dup_depend(attr, pdnew)) != 0) { return(rc); } pdnew = (struct depend *)GET_NEXT(pdnew->dp_link); } break; case INCR: /* not defined */ case DECR: /* not defined */ default: return(PBSE_IVALREQ); /*NOTREACHED*/ break; } attr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; return(0); } /* END set_depend() */ /* * comp_depend - compare two attributes of type dependency * This operation is undefined. * * Returns: 0 * +1 * -1 */ int comp_depend(struct attribute *attr, struct attribute *with) { return (-1); } void free_depend( struct attribute *attr) { struct depend *pdp; struct depend_job *pdjb; while ((pdp = (struct depend *)GET_NEXT(attr->at_val.at_list))) { while ((pdjb = (struct depend_job *)GET_NEXT(pdp->dp_jobs))) { delete_link(&pdjb->dc_link); free(pdjb); } delete_link(&pdp->dp_link); free(pdp); } attr->at_flags &= ~ATR_VFLAG_SET; return; } /* END comp_depend() */ /* * build_depend - build a dependency structure * parse the string and turn it into a list of depend structures * * Return 0 if ok, otherwise non-zero error number */ static int build_depend( attribute *pattr, char *value) { struct depend *have[JOB_DEPEND_NUMBER_TYPES]; int i; int numwds; struct depend *pd; struct depend_job *pdjb; struct dependnames *pname; char *pwhere; char *valwd; char *nxwrd; int type; /* * Map first subword into dependency type. If there is just the type * with no following job id or count, then leave an empty depend * struct; set_depend will "remove" any of that kind. */ if ((nxwrd = strchr(value, (int)':')) != NULL) * nxwrd++ = '\0'; for (pname = dependnames;pname->type != -1;pname++) { if (!strcmp(value, pname->name)) break; } if (pname->type == -1) { return(PBSE_BADATVAL); } type = pname->type; /* what types do we have already? */ for (i = 0;i < JOB_DEPEND_NUMBER_TYPES;i++) have[i] = NULL; for (pd = (struct depend *)GET_NEXT(pattr->at_val.at_list); pd; pd = (struct depend *)GET_NEXT(pd->dp_link)) { have[pd->dp_type] = pd; } /* certain combinations are not allowed */ switch (type) { case JOB_DEPEND_TYPE_SYNCWITH: if (have[JOB_DEPEND_TYPE_SYNCWITH] || have[JOB_DEPEND_TYPE_SYNCCT] || have[JOB_DEPEND_TYPE_AFTERSTART] || have[JOB_DEPEND_TYPE_AFTEROK] || have[JOB_DEPEND_TYPE_AFTERNOTOK] || have[JOB_DEPEND_TYPE_AFTERANY] || have[JOB_DEPEND_TYPE_ON]) { return(PBSE_BADATVAL); } break; case JOB_DEPEND_TYPE_SYNCCT: if (have[JOB_DEPEND_TYPE_SYNCWITH] || have[JOB_DEPEND_TYPE_SYNCCT]) { return(PBSE_BADATVAL); } break; case JOB_DEPEND_TYPE_AFTERSTART: case JOB_DEPEND_TYPE_AFTEROK: case JOB_DEPEND_TYPE_AFTERNOTOK: case JOB_DEPEND_TYPE_AFTERANY: case JOB_DEPEND_TYPE_ON: if (have[JOB_DEPEND_TYPE_SYNCWITH]) { return(PBSE_BADATVAL); } break; } if ((pd = have[type]) == NULL) { pd = make_depend(type, pattr); if (pd == NULL) { return(PBSE_SYSTEM); } } /* now process the value string */ numwds = 0; while (nxwrd && (*nxwrd != '\0')) { numwds++; /* number of arguments */ valwd = nxwrd; /* find end of next word delimited by a : but not a '\:' */ while (((*nxwrd != ':') || (*(nxwrd - 1) == '\\')) && *nxwrd) nxwrd++; if (*nxwrd) *nxwrd++ = '\0'; /* now process word (argument) depending on "depend type" */ if ((type == JOB_DEPEND_TYPE_ON) || (type == JOB_DEPEND_TYPE_SYNCCT)) { /* a single word argument, a count */ if (numwds == 1) { pd->dp_numexp = strtol(valwd, &pwhere, 10); if ((pd->dp_numexp < 1) || (pwhere && (*pwhere != '\0'))) { return (PBSE_BADATVAL); } } else { return (PBSE_BADATVAL); } } else /* all other dependency types */ { /* a set of job_id[\:port][@server[\:port]] */ pdjb = (struct depend_job *)malloc(sizeof(*pdjb)); if (pdjb) { CLEAR_LINK(pdjb->dc_link); pdjb->dc_state = 0; pdjb->dc_cost = 0; pdjb->dc_svr[0] = '\0'; pwhere = pdjb->dc_child; while (*valwd) { if (*valwd == '@') /* switch to @server */ { *pwhere = '\0'; pwhere = pdjb->dc_svr; } else if ((*valwd == '\\') && (*(valwd + 1) == ':')) { *pwhere++ = *++valwd; /* skip over '\' */ } else { *pwhere++ = *valwd; /* copy jobid */ } ++valwd; } *pwhere = '\0'; if (pdjb->dc_svr[0] == '\0') { pwhere = strchr(pdjb->dc_child, (int)'.'); if (pwhere) { if(server_name != NULL) (void)strcpy(pdjb->dc_svr, server_name); else (void)strcpy(pdjb->dc_svr, pwhere + 1); } else { (void)free(pdjb); return (PBSE_BADATVAL); } } append_link(&pd->dp_jobs, &pdjb->dc_link, pdjb); } else { return (PBSE_SYSTEM); } } } /* SUCCESS */ return(0); } /* END build_depend() */ /* * clear_depend - clear a single dependency set * If the "exist" flag is set, any depend_job sub-structures are freed. */ static void clear_depend( struct depend *pd, int type, int exist) { struct depend_job *pdj; if (exist) { while ((pdj = (struct depend_job *)GET_NEXT(pd->dp_jobs))) { del_depend_job(pdj); } } else { CLEAR_HEAD(pd->dp_jobs); CLEAR_LINK(pd->dp_link); } pd->dp_type = type; pd->dp_numexp = 0; pd->dp_numreg = 0; pd->dp_released = 0; return; } /* END clear_depend() */ /* * del_depend - delete a single dependency set, including any depend_jobs */ static void del_depend( struct depend *pd) { struct depend_job *pdj; while ((pdj = (struct depend_job *)GET_NEXT(pd->dp_jobs))) { del_depend_job(pdj); } delete_link(&pd->dp_link); free(pd); return; } /* END del_depend() */ /* * del_depend_job - delete a single depend_job structure */ static void del_depend_job( struct depend_job *pdj) { delete_link(&pdj->dc_link); free(pdj); return; } /* END del_depend_job() */ /* END req_register.c */ torque-2.4.16/src/server/job_qs_upgrade.c0000664000113300011330000002545211272401245015267 00000000000000/* job_qs_upgrade.c - * * The following public functions are provided: * job_qs_upgrade() - */ #include /* the master config generated by configure */ #include #include #include #include #include #include #include #include #include #include "pbs_ifl.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "pbs_job.h" #include "array.h" extern char *path_jobs; extern char *path_arrays; int upgrade_2_1_X(job *pj, int fds); int upgrade_2_2_X(job *pj, int fds); int upgrade_2_3_X(job *pj, int fds); typedef struct { int ji_state; /* internal copy of state */ int ji_substate; /* job sub-state */ int ji_svrflags; /* server flags */ int ji_numattr; /* number of attributes in list */ int ji_ordering; /* special scheduling ordering */ int ji_priority; /* internal priority */ time_t ji_stime; /* time job started execution */ char ji_jobid[80]; /* job identifier */ char ji_fileprefix[12]; /* job file prefix */ char ji_queue[16]; /* name of current queue */ char ji_destin[87]; /* dest from qmove/route */ int ji_un_type; /* type of ji_un union */ union /* depends on type of queue currently in */ { struct /* if in execution queue .. */ { pbs_net_t ji_momaddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ } ji_exect; struct { time_t ji_quetime; /* time entered queue */ time_t ji_rteretry; /* route retry time */ } ji_routet; struct { pbs_net_t ji_fromaddr; /* host job coming from */ int ji_fromsock; /* socket job coming over */ int ji_scriptsz; /* script size */ } ji_newt; struct { pbs_net_t ji_svraddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ uid_t ji_exuid; /* execution uid */ gid_t ji_exgid; /* execution gid */ } ji_momt; } ji_un; } ji_qs_2_1_X; typedef struct { int qs_version; int ji_state; /* internal copy of state */ int ji_substate; /* job sub-state */ int ji_svrflags; /* server flags */ int ji_numattr; /* number of attributes in list */ int ji_ordering; /* special scheduling ordering */ int ji_priority; /* internal priority */ time_t ji_stime; /* time job started execution */ char ji_jobid[86]; /* job identifier */ char ji_fileprefix[12]; /* job file prefix */ char ji_queue[16]; /* name of current queue */ char ji_destin[87]; /* dest from qmove/route */ int ji_un_type; /* type of ji_un union */ union /* depends on type of queue currently in */ { struct /* if in execution queue .. */ { pbs_net_t ji_momaddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ } ji_exect; struct { time_t ji_quetime; /* time entered queue */ time_t ji_rteretry; /* route retry time */ } ji_routet; struct { pbs_net_t ji_fromaddr; /* host job coming from */ int ji_fromsock; /* socket job coming over */ int ji_scriptsz; /* script size */ } ji_newt; struct { pbs_net_t ji_svraddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ uid_t ji_exuid; /* execution uid */ gid_t ji_exgid; /* execution gid */ } ji_momt; } ji_un; } ji_qs_2_2_X; typedef struct { int qs_version; int ji_state; /* internal copy of state */ int ji_substate; /* job sub-state */ int ji_svrflags; /* server flags */ int ji_numattr; /* number of attributes in list */ int ji_ordering; /* special scheduling ordering */ int ji_priority; /* internal priority */ time_t ji_stime; /* time job started execution */ char ji_jobid[86]; /* job identifier */ char ji_fileprefix[62]; /* job file prefix */ char ji_queue[16]; /* name of current queue */ char ji_destin[87]; /* dest from qmove/route */ int ji_un_type; /* type of ji_un union */ union /* depends on type of queue currently in */ { struct /* if in execution queue .. */ { pbs_net_t ji_momaddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ } ji_exect; struct { time_t ji_quetime; /* time entered queue */ time_t ji_rteretry; /* route retry time */ } ji_routet; struct { pbs_net_t ji_fromaddr; /* host job coming from */ int ji_fromsock; /* socket job coming over */ int ji_scriptsz; /* script size */ } ji_newt; struct { pbs_net_t ji_svraddr; /* host addr of Server */ int ji_exitstat; /* job exit status from MOM */ uid_t ji_exuid; /* execution uid */ gid_t ji_exgid; /* execution gid */ } ji_momt; } ji_un; } ji_qs_2_3_X; /* this function will upgrade a ji_qs struct to the newest version. this version upgrades from 2.1.x, 2.2.x, and 2.3.x to 2.4.0 */ int job_qs_upgrade( job *pj, /* I */ int fds, /* I */ char *path, /* I */ int version) /* I */ { char *id = "job_qs_upgrade"; char namebuf[MAXPATHLEN]; FILE *source; FILE *backup; int c; /* reset the file descriptor */ if (lseek(fds, 0, SEEK_SET) != 0) { sprintf(log_buffer, "unable to reset fds\n"); log_err(-1, id, log_buffer); return (-1); } strcpy(namebuf, path); /* .JB path */ namebuf[strlen(path) - strlen(JOB_FILE_SUFFIX)] = '\0'; /* cut off the .JB by replacing the '.' with a NULL */ if (strlen(namebuf) + strlen(JOB_FILE_BACKUP) > MAXPATHLEN - 1) { sprintf(log_buffer, "ERROR: path too long for buffer, unable to backup!\n"); log_err(-1, id, log_buffer); return (-1); } strcat(namebuf, JOB_FILE_BACKUP); source = fdopen(dup(fds), "r"); if((backup = fopen(namebuf, "wb")) == NULL) { sprintf(log_buffer, "Cannot open backup file.\n"); log_err(errno, id, log_buffer); return -1; } while ((c = fgetc(source)) != EOF) { fputc(c, backup); } fclose(backup); fclose(source); sprintf(log_buffer, "backed up to %s\n", namebuf); log_err(-1, id, log_buffer); /* reset the file descriptor */ if (lseek(fds, 0, SEEK_SET) != 0) { sprintf(log_buffer, "unable to reset fds\n"); log_err(-1, id, log_buffer); return (-1); } if (version >= PBS_QS_VERSION) { sprintf(log_buffer, "job struct appears to be from an unknown " "version of TORQUE and can not be converted"); log_err(-1, "job_qs_upgrade", log_buffer); return (-1); } else if (version == 0x00020300) { return upgrade_2_3_X(pj, fds); } else if (version == 0x00020200) { return upgrade_2_2_X(pj, fds); } else { return upgrade_2_1_X(pj, fds); } } /* upgrader functions - these upgrade from a specific version of the job ji_qs struct to the _current_ version of the struct. If the current version changes, these need to be updated to reflect those changes */ int upgrade_2_3_X( job *pj, /* I */ int fds) /* I */ { ji_qs_2_3_X qs_old; char basename[PBS_JOBBASE + 1]; basename[PBS_JOBBASE] = '\0'; if (read(fds, (char*)&qs_old, sizeof(qs_old)) != sizeof(qs_old)) { return (-1); } pj->ji_qs.qs_version = PBS_QS_VERSION; pj->ji_qs.ji_state = qs_old.ji_state; pj->ji_qs.ji_substate = qs_old.ji_substate; pj->ji_qs.ji_svrflags = qs_old.ji_svrflags; pj->ji_qs.ji_numattr = qs_old.ji_numattr; pj->ji_qs.ji_ordering = qs_old.ji_ordering; pj->ji_qs.ji_priority = qs_old.ji_priority; pj->ji_qs.ji_stime = qs_old.ji_stime; strcpy(pj->ji_qs.ji_jobid, qs_old.ji_jobid); strcpy(pj->ji_qs.ji_fileprefix, qs_old.ji_fileprefix); strcpy(pj->ji_qs.ji_queue, qs_old.ji_queue); strcpy(pj->ji_qs.ji_destin, qs_old.ji_destin); pj->ji_qs.ji_un_type = qs_old.ji_un_type; memcpy(&pj->ji_qs.ji_un, &qs_old.ji_un, sizeof(qs_old.ji_un)); return 0; } int upgrade_2_2_X( job *pj, /* I */ int fds) /* I */ { ji_qs_2_2_X qs_old; #ifndef PBS_MOM char range[PBS_MAXJOBARRAYLEN*2+2]; char parent_id[PBS_MAXSVRJOBID + 1]; attribute tempattr; job_array *pa; #endif if (read(fds, (char*)&qs_old, sizeof(qs_old)) != sizeof(qs_old)) { return (-1); } pj->ji_qs.qs_version = PBS_QS_VERSION; pj->ji_qs.ji_state = qs_old.ji_state; pj->ji_qs.ji_substate = qs_old.ji_substate; pj->ji_qs.ji_svrflags = qs_old.ji_svrflags; pj->ji_qs.ji_numattr = qs_old.ji_numattr; pj->ji_qs.ji_ordering = qs_old.ji_ordering; pj->ji_qs.ji_priority = qs_old.ji_priority; pj->ji_qs.ji_stime = qs_old.ji_stime; strcpy(pj->ji_qs.ji_jobid, qs_old.ji_jobid); strcpy(pj->ji_qs.ji_fileprefix, qs_old.ji_fileprefix); strcpy(pj->ji_qs.ji_queue, qs_old.ji_queue); strcpy(pj->ji_qs.ji_destin, qs_old.ji_destin); pj->ji_qs.ji_un_type = qs_old.ji_un_type; memcpy(&pj->ji_qs.ji_un, &qs_old.ji_un, sizeof(qs_old.ji_un)); #ifndef PBS_MOM array_get_parent_id(pj->ji_qs.ji_jobid, parent_id); if (is_array(parent_id)) { pa = get_array(parent_id); if (pa == NULL) { return(1); } sprintf(range, "0-%d", pa->ai_qs.array_size - 1); clear_attr(&tempattr, &job_attr_def[JOB_ATR_job_array_request]); job_attr_def[JOB_ATR_job_array_request].at_decode( &tempattr, NULL, NULL, range); job_attr_def[JOB_ATR_job_array_request].at_set( &(pj->ji_wattr[JOB_ATR_job_array_request]), &tempattr, SET); } #endif return (0); } int upgrade_2_1_X( job *pj, /* I */ int fds) /* I */ { ji_qs_2_1_X qs_old; if (read(fds, (char*)&qs_old, sizeof(qs_old)) != sizeof(qs_old)) { return (-1); } pj->ji_qs.qs_version = PBS_QS_VERSION; pj->ji_qs.ji_state = qs_old.ji_state; pj->ji_qs.ji_substate = qs_old.ji_substate; pj->ji_qs.ji_svrflags = qs_old.ji_svrflags; pj->ji_qs.ji_numattr = qs_old.ji_numattr; pj->ji_qs.ji_ordering = qs_old.ji_ordering; pj->ji_qs.ji_priority = qs_old.ji_priority; pj->ji_qs.ji_stime = qs_old.ji_stime; strcpy(pj->ji_qs.ji_jobid, qs_old.ji_jobid); strcpy(pj->ji_qs.ji_fileprefix, qs_old.ji_fileprefix); strcpy(pj->ji_qs.ji_queue, qs_old.ji_queue); strcpy(pj->ji_qs.ji_destin, qs_old.ji_destin); pj->ji_qs.ji_un_type = qs_old.ji_un_type; memcpy(&pj->ji_qs.ji_un, &qs_old.ji_un, sizeof(qs_old.ji_un)); return (0); } torque-2.4.16/src/server/run_sched.c0000664000113300011330000002674111605403054014257 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ #include /* the master config generated by configure */ #include #include #include "portability.h" #include #include #include "log.h" #include "pbs_ifl.h" #include "net_connect.h" #include "svrfunc.h" #include "sched_cmds.h" #include "pbs_error.h" /* Global Data */ extern pbs_net_t pbs_scheduler_addr; extern unsigned int pbs_scheduler_port; extern char server_name[]; extern struct connection svr_conn[]; extern int svr_do_schedule; extern char *msg_sched_called; extern char *msg_sched_nocall; extern char *msg_listnr_called; extern char *msg_listnr_nocall; extern struct listener_connection listener_conns[]; int scheduler_sock = -1; int scheduler_jobct = 0; int listener_command = SCH_SCHEDULE_NULL; /* Functions private to this file */ static int put_4byte A_((int sock, unsigned int val)); static void scheduler_close A_((int)); static void listener_close A_((int)); extern void bad_node_warning(pbs_net_t); extern ssize_t write_nonblocking_socket(int, const void *, ssize_t); /* sync w/sched_cmds.h */ const char *PSchedCmdType[] = { "NULL", "new", "term", "time", "recyc", "cmd", "N/A", "configure", "quit", "ruleset", "scheduler_first", NULL }; /* * contact_sched - open connection to the scheduler and send it a command */ static int contact_sched( int cmd) /* I */ { int sock; char tmpLine[1024]; char EMsg[1024]; char *id = "contact_sched"; /* connect to the Scheduler */ #if 0 /* don't check if scheduler runs on same node as server */ if (!addr_ok(pbs_scheduler_addr)) { pbs_errno = EHOSTDOWN; return -1; } #endif sock = client_to_svr(pbs_scheduler_addr, pbs_scheduler_port, 1, EMsg); if (sock < 0) { /* FAILURE */ bad_node_warning(pbs_scheduler_addr); #if 0 sprintf(tmpLine, "%s - port %d %s", msg_sched_nocall, pbs_scheduler_port, EMsg); log_ext(errno,id,tmpLine,LOG_ALERT); #endif return(-1); } add_conn( sock, FromClientDIS, pbs_scheduler_addr, pbs_scheduler_port, PBS_SOCK_INET, process_request); svr_conn[sock].cn_authen = PBS_NET_CONN_FROM_PRIVIL; net_add_close_func(sock, scheduler_close); /* send command to Scheduler */ if (put_4byte(sock, cmd) < 0) { sprintf(tmpLine, "%s - port %d", msg_sched_nocall, pbs_scheduler_port); log_ext(errno,id,tmpLine,LOG_ALERT); close_conn(sock); return(-1); } sprintf(log_buffer, msg_sched_called, (cmd != SCH_ERROR) ? PSchedCmdType[cmd] : "ERROR"); log_event( PBSEVENT_SCHED, PBS_EVENTCLASS_SERVER, server_name, log_buffer); return (sock); } /* END contact_sched() */ /* * schedule_jobs - contact scheduler and direct it to run a scheduling cycle * If a request is already outstanding, skip this one. * * Returns: -1 = error * 0 = scheduler notified * +1 = scheduler busy */ int schedule_jobs(void) { int cmd; static int first_time = 1; if (first_time) cmd = SCH_SCHEDULE_FIRST; else cmd = svr_do_schedule; /*listener_command = cmd;*/ svr_do_schedule = SCH_SCHEDULE_NULL; if (scheduler_sock == -1) { scheduler_jobct = 0; if ((scheduler_sock = contact_sched(cmd)) < 0) { return(-1); } first_time = 0; return(0); } return(1); } /* END schedule_jobs() */ /* * contact_listener - open connection to the listener and send it a command */ static int contact_listener( int l_idx) /* I */ { int sock; char tmpLine[1024]; char EMsg[1024]; char *id = "contact_listener"; /* If this is the first time contacting the scheduler for * this listener set the cmd */ if(listener_conns[l_idx].first_time) listener_command = SCH_SCHEDULE_FIRST; /* connect to the Listener */ sock = client_to_svr(listener_conns[l_idx].address, listener_conns[l_idx].port, 1, EMsg); if (sock < 0) { /* FAILURE */ bad_node_warning(listener_conns[l_idx].address); sprintf(tmpLine, "%s %d - port %d %s", msg_listnr_nocall, l_idx, listener_conns[l_idx].port, EMsg); /* we lost contact with the scheduler. reset*/ listener_conns[l_idx].first_time = 1; log_err(errno, id, tmpLine); return(-1); } listener_conns[l_idx].first_time = 0; add_conn( sock, FromClientDIS, listener_conns[l_idx].address, listener_conns[l_idx].port, PBS_SOCK_INET, process_request); svr_conn[sock].cn_authen = PBS_NET_CONN_FROM_PRIVIL; net_add_close_func(sock, listener_close); /* send command to Listener */ if (put_4byte(sock, listener_command) < 0) { sprintf(tmpLine, "%s %d - port %d", msg_listnr_nocall, l_idx + 1, listener_conns[l_idx].port); log_err(errno, id, tmpLine); close_conn(sock); return(-1); } sprintf(log_buffer, msg_listnr_called, l_idx + 1, (listener_command != SCH_ERROR) ? PSchedCmdType[listener_command] : "ERROR"); log_event( PBSEVENT_SCHED, PBS_EVENTCLASS_SERVER, server_name, log_buffer); return (sock); } /* END contact_listener() */ /* * notify_listeners - Send event message to any added listeners * */ void notify_listeners(void) { int i; int ret_sock; for (i = 0;i < MAXLISTENERS; i++) { /* do we have a listener in this slot? * if so then try to send data */ if ((listener_conns[i].address != 0) && (listener_conns[i].sock == -1)) { ret_sock = contact_listener(i); if (ret_sock != -1) { listener_conns[i].sock = ret_sock; } } } return; } /* END notify_listeners() */ /* * scheduler_close - connection to scheduler has closed, clear scheduler_called */ static void scheduler_close( int sock) { scheduler_sock = -1; /* * This bit of code is intended to support the scheduler - server - mom * sequence. A scheduler script may best written to run only one job per * cycle to ensure its newly taken resources are considered by the * scheduler before selecting another job. In that case, rather than * wait a full cycle before scheduling the next job, we check for * one (and only one) job was run by the scheduler. If true, then * recycle the scheduler. */ if (scheduler_jobct == 1) { /* recycle the scheduler */ svr_do_schedule = SCH_SCHEDULE_RECYC; listener_command = SCH_SCHEDULE_RECYC; } return; } /* END scheduler_close() */ /* * listener_close - connection to listener has closed, clear listeners */ static void listener_close( int sock) { int i; for (i = 0;i < MAXLISTENERS; i++) { /* Find matching listener for this socket * then clear out the socket */ if (listener_conns[i].sock == sock) { listener_conns[i].sock = -1; } } return; } /* END listener_close() */ /* * put_4byte() - write a 4 byte integer in network order * * Returns: 0 for sucess, -1 if error. */ static int put_4byte( int sock, /* socket to read from */ unsigned int val) /* 4 byte interger to write */ { int amt; union { int unl; char unc[sizeof(unsigned int)]; } un; un.unl = htonl(val); amt = write(sock, (char *)(un.unc + sizeof(unsigned int) - 4), 4); if (amt != 4) { /* FAILURE */ return(-1); } /* SUCCESS */ return(0); } torque-2.4.16/src/server/req_movejob.c0000664000113300011330000002170311272401245014606 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * req_movejob.c - function to move a job to another queue * * Included functions are: */ #include /* the master config generated by configure */ #include #include #include #include "libpbs.h" #include #include "server_limits.h" #include "list_link.h" #include "attribute.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "log.h" #include "pbs_error.h" #include "queue.h" /* Global Data Items: */ extern char *msg_unkjobid; extern char *msg_manager; extern char *msg_movejob; extern int pbs_errno; extern char *pbs_o_host; extern int svr_movejob A_((job *, char *, struct batch_request *)); extern int svr_chkque A_((job *, pbs_queue *, char *, int, char *)); /* * req_movejob = move a job to a new destination (local or remote) */ void req_movejob( struct batch_request *req) { #ifndef NDEBUG char *id = "req_movejob"; #endif job *jobp; jobp = chk_job_request(req->rq_ind.rq_move.rq_jid, req); if (jobp == NULL) { return; } if ((jobp->ji_qs.ji_state != JOB_STATE_QUEUED) && (jobp->ji_qs.ji_state != JOB_STATE_HELD) && (jobp->ji_qs.ji_state != JOB_STATE_WAITING)) { #ifndef NDEBUG sprintf(log_buffer, "%s %d", pbse_to_txt(PBSE_BADSTATE), jobp->ji_qs.ji_state); strcat(log_buffer, id); log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, log_buffer); #endif /* NDEBUG */ req_reject(PBSE_BADSTATE, 0, req, NULL, NULL); return; } /* * svr_movejob() does the real work, handles both local and * network moves */ switch (svr_movejob(jobp, req->rq_ind.rq_move.rq_destin, req)) { case 0: /* success */ strcpy(log_buffer, msg_movejob); sprintf(log_buffer + strlen(log_buffer), msg_manager, req->rq_ind.rq_move.rq_destin, req->rq_user, req->rq_host); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, jobp->ji_qs.ji_jobid, log_buffer); reply_ack(req); break; case - 1: case 1: /* fail */ /* NOTE: can pass detailed response to requestor (NYI) */ req_reject(pbs_errno, 0, req, NULL, NULL); break; case 2: /* deferred, will be handled by */ /* post_movejob() when the child completes */ /* NO-OP */ break; } /* END switch (svr_movejob(jobp,req->rq_ind.rq_move.rq_destin,req)) */ return; } /* END req_movejob() */ /* * req_orderjob = reorder the jobs in a queue */ void req_orderjob( struct batch_request *req) /* I */ { #ifndef NDEBUG char *id = "req_orderjob"; #endif job *pjob; job *pjob1; job *pjob2; int rank; int rc; char tmpqn[PBS_MAXQUEUENAME+1]; if ((pjob1 = chk_job_request(req->rq_ind.rq_move.rq_jid, req)) == NULL) { return; } if ((pjob2 = chk_job_request(req->rq_ind.rq_move.rq_destin, req)) == NULL) { return; } if (((pjob = pjob1)->ji_qs.ji_state == JOB_STATE_RUNNING) || ((pjob = pjob2)->ji_qs.ji_state == JOB_STATE_RUNNING)) { #ifndef NDEBUG sprintf(log_buffer, "%s %d", pbse_to_txt(PBSE_BADSTATE), pjob->ji_qs.ji_state); strcat(log_buffer, id); log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); #endif /* NDEBUG */ req_reject(PBSE_BADSTATE, 0, req, NULL, NULL); return; } else if (pjob1->ji_qhdr != pjob2->ji_qhdr) { /* jobs are in different queues */ if ((rc = svr_chkque( pjob1, pjob2->ji_qhdr, get_variable(pjob1, pbs_o_host), MOVE_TYPE_Order, NULL)) || (rc = svr_chkque( pjob2, pjob1->ji_qhdr, get_variable(pjob2, pbs_o_host), MOVE_TYPE_Order, NULL))) { req_reject(rc, 0, req, NULL, NULL); return; } } /* now swap the order of the two jobs in the queue lists */ rank = pjob1->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long; pjob1->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long = pjob2->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long; pjob2->ji_wattr[(int)JOB_ATR_qrank].at_val.at_long = rank; if (pjob1->ji_qhdr != pjob2->ji_qhdr) { (void)strcpy(tmpqn, pjob1->ji_qs.ji_queue); (void)strcpy(pjob1->ji_qs.ji_queue, pjob2->ji_qs.ji_queue); (void)strcpy(pjob2->ji_qs.ji_queue, tmpqn); svr_dequejob(pjob1); svr_dequejob(pjob2); (void)svr_enquejob(pjob1); (void)svr_enquejob(pjob2); } else { swap_link(&pjob1->ji_jobque, &pjob2->ji_jobque); swap_link(&pjob1->ji_alljobs, &pjob2->ji_alljobs); } /* need to update disk copy of both jobs to save new order */ job_save(pjob1, SAVEJOB_FULL); job_save(pjob2, SAVEJOB_FULL); reply_ack(req); /* SUCCESS */ return; } /* END req_orderjob() */ torque-2.4.16/src/server/req_delete.c0000664000113300011330000007754611477227465014450 00000000000000/* * OpenPBS (Portable Batch System) v2.3 Software License * * Copyright (c) 1999-2000 Veridian Information Solutions, Inc. * All rights reserved. * * --------------------------------------------------------------------------- * For a license to use or redistribute the OpenPBS software under conditions * other than those described below, or to purchase support for this software, * please contact Veridian Systems, PBS Products Department ("Licensor") at: * * www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org * 877 902-4PBS (US toll-free) * --------------------------------------------------------------------------- * * This license covers use of the OpenPBS v2.3 software (the "Software") at * your site or location, and, for certain users, redistribution of the * Software to other sites and locations. Use and redistribution of * OpenPBS v2.3 in source and binary forms, with or without modification, * are permitted provided that all of the following conditions are met. * After December 31, 2001, only conditions 3-6 must be met: * * 1. Commercial and/or non-commercial use of the Software is permitted * provided a current software registration is on file at www.OpenPBS.org. * If use of this software contributes to a publication, product, or * service, proper attribution must be given; see www.OpenPBS.org/credit.html * * 2. Redistribution in any form is only permitted for non-commercial, * non-profit purposes. There can be no charge for the Software or any * software incorporating the Software. Further, there can be no * expectation of revenue generated as a consequence of redistributing * the Software. * * 3. Any Redistribution of source code must retain the above copyright notice * and the acknowledgment contained in paragraph 6, this list of conditions * and the disclaimer contained in paragraph 7. * * 4. Any Redistribution in binary form must reproduce the above copyright * notice and the acknowledgment contained in paragraph 6, this list of * conditions and the disclaimer contained in paragraph 7 in the * documentation and/or other materials provided with the distribution. * * 5. Redistributions in any form must be accompanied by information on how to * obtain complete source code for the OpenPBS software and any * modifications and/or additions to the OpenPBS software. The source code * must either be included in the distribution or be available for no more * than the cost of distribution plus a nominal fee, and all modifications * and additions to the Software must be freely redistributable by any party * (including Licensor) without restriction. * * 6. All advertising materials mentioning features or use of the Software must * display the following acknowledgment: * * "This product includes software developed by NASA Ames Research Center, * Lawrence Livermore National Laboratory, and Veridian Information * Solutions, Inc. * Visit www.OpenPBS.org for OpenPBS software support, * products, and information." * * 7. DISCLAIMER OF WARRANTY * * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT * ARE EXPRESSLY DISCLAIMED. * * IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE * U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This license will be governed by the laws of the Commonwealth of Virginia, * without reference to its choice of law rules. */ /* * req_delete.c * * Functions relating to the Delete Job Batch Requests. * * Included funtions are: * * */ #include /* the master config generated by configure */ #include #include #include #include #include "libpbs.h" #include "server_limits.h" #include "list_link.h" #include "work_task.h" #include "attribute.h" #include "server.h" #include "credential.h" #include "batch_request.h" #include "pbs_job.h" #include "queue.h" #include "pbs_error.h" #include "acct.h" #include "log.h" #include "svrfunc.h" /* Global Data Items: */ extern char *msg_deletejob; extern char *msg_delrunjobsig; extern char *msg_manager; extern char *msg_permlog; extern char *msg_badstate; extern tlist_head svr_alljobs; /* list of all jobs in server */ extern struct server server; extern time_t time_now; extern int LOGLEVEL; /* Private Functions in this file */ static void post_delete_route A_((struct work_task *)); static void post_delete_mom1 A_((struct work_task *)); static void post_delete_mom2 A_((struct work_task *)); static int forced_jobpurge A_((struct batch_request *)); static void job_delete_nanny A_((struct work_task *)); static void post_job_delete_nanny A_((struct work_task *)); static void purge_completed_jobs A_((struct batch_request *)); /* Public Functions in this file */ struct work_task *apply_job_delete_nanny A_((struct job *, int)); int has_job_delete_nanny A_((struct job *)); void change_restart_comment_if_needed A_((struct job *)); /* Private Data Items */ static char *deldelaystr = DELDELAY; static char *delpurgestr = DELPURGE; /* Extern Functions */ extern void set_resc_assigned(job *, enum batch_op); /* * remove_stagein() - request that mom delete staged-in files for a job * used when the job is to be purged after files have been staged in */ void remove_stagein( job *pjob) /* I */ { struct batch_request *preq = 0; preq = cpy_stage(preq, pjob, JOB_ATR_stagein, 0); if (preq != NULL) { /* have files to delete */ /* change the request type from copy to delete */ preq->rq_type = PBS_BATCH_DelFiles; preq->rq_extra = NULL; if (relay_to_mom( pjob->ji_qs.ji_un.ji_exect.ji_momaddr, preq, release_req) == 0) { pjob->ji_qs.ji_svrflags &= ~JOB_SVFLG_StagedIn; } else { /* log that we were unable to remove the files */ log_event( PBSEVENT_JOB, PBS_EVENTCLASS_FILE, pjob->ji_qs.ji_jobid, "unable to remove staged in files for job"); free_br(preq); } } return; } /* END remove_stagein() */ void ensure_deleted( struct work_task *ptask) /* I */ { struct batch_request *preq; job *pjob; preq = ptask->wt_parm1; if ((pjob = find_job(preq->rq_ind.rq_delete.rq_objname)) == NULL) { /* job doesn't exist, we're done */ return; } sprintf(log_buffer, "purging job without checking MOM"); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); free_nodes(pjob); if (pjob->ji_qhdr->qu_qs.qu_type == QTYPE_Execution) { set_resc_assigned(pjob, DECR); } job_purge(pjob); } /* ensure_deleted */ /* * req_deletejob - service the Delete Job Request * * This request deletes a job. The request is * initiated from an external program, most commonly * qdel. Shown below is the normal messaging. * There are many exceptions to the normal case * such as missing job descriptions and failure * of messages to propagate. There are also * exceptions related to the state of the job. * * The code at this point does not seem particularly * robust. For example, some stages of the processing * check for existense of the job structure while * others do not. * * The fragileness of the code seems to be reflected * in practice as there are many reports in the * user's groups of trouble in deleting jobs. * There also seems to have been several attempts * to patch over the problems. The purge option * seems to have been an afterthought as does the * job deletion nanny code. * * The problems in this code stem from a lack of a * state processing model for job deletion. * * qdel-command pbs_server pbs_mom * ------------- ------------- ------------- * | | | * +-- DeleteJob -->| | * | | | * | +-- DeleteJob -->| * | | | * | |<-- Ack --------+ * | | | * |<-- Ack --------+ | * | | | * | | | */ void req_deletejob( struct batch_request *preq) /* I */ { job *pjob; struct work_task *pwtold; struct work_task *pwtnew; struct work_task *pwtcheck; int rc; char *sigt = "SIGTERM"; char *Msg = NULL; /* check if we are getting a purgecomplete from scheduler */ if ((preq->rq_extend != NULL) && !strncmp(preq->rq_extend,PURGECOMP,strlen(PURGECOMP))) { /* * purge_completed_jobs will respond with either an ack or reject */ purge_completed_jobs(preq); return; } /* The way this is implemented, if the user enters the command "qdel -p ", * they can then delete jobs other than their own since the authorization * checks are made below in chk_job_request. This should probably be fixed. */ if (forced_jobpurge(preq) != 0) { return; } /* NOTE: should support rq_objname={|ALL|} */ /* NYI */ pjob = chk_job_request(preq->rq_ind.rq_delete.rq_objname, preq); if (pjob == NULL) { /* NOTE: chk_job_request() will issue req_reject() */ return; } if (preq->rq_extend != NULL) { if (strncmp(preq->rq_extend, deldelaystr, strlen(deldelaystr)) && strncmp(preq->rq_extend, delpurgestr, strlen(delpurgestr))) { /* have text message in request extension, add it */ Msg = preq->rq_extend; /* * Message capability is only for operators and managers. * Check if request is authorized */ if ((preq->rq_perm & (ATR_DFLAG_OPRD | ATR_DFLAG_OPWR | ATR_DFLAG_MGRD | ATR_DFLAG_MGWR)) == 0) { req_reject(PBSE_PERM, 0, preq, NULL, "must have operator or manager privilege to use -m parameter"); return; } } } if (pjob->ji_qs.ji_state == JOB_STATE_TRANSIT) { /* * Find pid of router from existing work task entry, * then establish another work task on same child. * Next, signal the router and wait for its completion; */ pwtold = (struct work_task *)GET_NEXT(pjob->ji_svrtask); while (pwtold != NULL) { if ((pwtold->wt_type == WORK_Deferred_Child) || (pwtold->wt_type == WORK_Deferred_Cmp)) { pwtnew = set_task( pwtold->wt_type, pwtold->wt_event, post_delete_route, preq); if (pwtnew != NULL) { /* * reset type in case the SIGCHLD came * in during the set_task; it makes * sure that next_task() will find the * new entry. */ pwtnew->wt_type = pwtold->wt_type; pwtnew->wt_aux = pwtold->wt_aux; kill((pid_t)pwtold->wt_event, SIGTERM); pjob->ji_qs.ji_substate = JOB_SUBSTATE_ABORT; return; /* all done for now */ } else { req_reject(PBSE_SYSTEM, 0, preq, NULL, NULL); return; } } pwtold = (struct work_task *)GET_NEXT(pwtold->wt_linkobj); } /* should never get here ... */ log_err(-1, "req_delete", "Did not find work task for router"); req_reject(PBSE_INTERNAL, 0, preq, NULL, NULL); return; } if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) { /* being sent to MOM, wait till she gets it going */ /* retry in one second */ static time_t cycle_check_when = 0; static char cycle_check_jid[PBS_MAXSVRJOBID + 1]; if (cycle_check_when != 0) { if (!strcmp(pjob->ji_qs.ji_jobid, cycle_check_jid) && (time_now - cycle_check_when > 10)) { /* state not updated after 10 seconds */ /* did the mom ever get it? delete it anyways... */ cycle_check_jid[0] = '\0'; cycle_check_when = 0; goto jump; } if (time_now - cycle_check_when > 20) { /* give up after 20 seconds */ cycle_check_jid[0] = '\0'; cycle_check_when = 0; } } /* END if (cycle_check_when != 0) */ if (cycle_check_when == 0) { /* new PRERUN job located */ cycle_check_when = time_now; strcpy(cycle_check_jid, pjob->ji_qs.ji_jobid); } sprintf(log_buffer, "job cannot be deleted, state=PRERUN, requeuing delete request"); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); pwtnew = set_task( WORK_Timed, time_now + 1, post_delete_route, preq); if (pwtnew == 0) req_reject(PBSE_SYSTEM, 0, preq, NULL, NULL); return; } /* END if (pjob->ji_qs.ji_substate == JOB_SUBSTATE_PRERUN) */ jump: /* * Log delete and if requesting client is not job owner, send mail. */ sprintf(log_buffer, "requestor=%s@%s", preq->rq_user, preq->rq_host); /* NOTE: should annotate accounting record with extend message (NYI) */ account_record(PBS_ACCT_DEL, pjob, log_buffer); sprintf(log_buffer, msg_manager, msg_deletejob, preq->rq_user, preq->rq_host); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); /* NOTE: should incorporate job delete message */ if (Msg != NULL) { /* have text message in request extension, add it */ strcat(log_buffer, "\n"); strcat(log_buffer, Msg); } if ((svr_chk_owner(preq, pjob) != 0) && !has_job_delete_nanny(pjob)) { /* only send email if owner did not delete job and job deleted has not been previously attempted */ svr_mailowner(pjob, MAIL_DEL, MAIL_FORCE, log_buffer); /* * If we sent mail and already sent the extra message * then reset message so we don't trigger a redundant email * in job_abt() */ if (Msg != NULL) { Msg = NULL; } } if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) != 0) { /* job has restart file at mom, change restart comment if failed */ change_restart_comment_if_needed(pjob); } if (pjob->ji_qs.ji_state == JOB_STATE_RUNNING) { /* * setup a nanny task to make sure the job is actually deleted (see the * comments at job_delete_nanny()). */ /* make a cleanup task if set */ if ((server.sv_attr[SRV_ATR_JobForceCancelTime].at_flags & ATR_VFLAG_SET) && (server.sv_attr[SRV_ATR_JobForceCancelTime].at_val.at_long > 0)) { pwtcheck = set_task( WORK_Timed, time_now + server.sv_attr[SRV_ATR_JobForceCancelTime].at_val.at_long, ensure_deleted, preq); if (pwtcheck != NULL) append_link(&pjob->ji_svrtask, &pwtcheck->wt_linkobj, pwtcheck); } if (has_job_delete_nanny(pjob)) { req_reject(PBSE_IVALREQ, 0, preq, NULL, "job cancel in progress"); return; } apply_job_delete_nanny(pjob, time_now + 60); /* * Send signal request to MOM. The server will automagically * pick up and "finish" off the client request when MOM replies. */ if ((rc = issue_signal(pjob, sigt, post_delete_mom1, preq))) { /* cant send to MOM */ req_reject(rc, 0, preq, NULL, NULL); } /* normally will ack reply when mom responds */ sprintf(log_buffer, msg_delrunjobsig, sigt); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); return; } /* END if (pjob->ji_qs.ji_state == JOB_STATE_RUNNING) */ /* make a cleanup task if set */ if ((server.sv_attr[SRV_ATR_JobForceCancelTime].at_flags & ATR_VFLAG_SET) && (server.sv_attr[SRV_ATR_JobForceCancelTime].at_val.at_long > 0)) { pwtcheck = set_task( WORK_Timed, time_now + server.sv_attr[SRV_ATR_JobForceCancelTime].at_val.at_long, ensure_deleted, preq); if (pwtcheck != NULL) append_link(&pjob->ji_svrtask, &pwtcheck->wt_linkobj, pwtcheck); } if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) != 0) { /* job has restart file at mom, do end job processing */ svr_setjobstate(pjob, JOB_STATE_EXITING, JOB_SUBSTATE_EXITING); pjob->ji_momhandle = -1; /* force new connection */ pwtnew = set_task(WORK_Immed, 0, on_job_exit, (void *)pjob); if (pwtnew) { append_link(&pjob->ji_svrtask, &pwtnew->wt_linkobj, pwtnew); } } else if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_StagedIn) != 0) { /* job has staged-in file, should remove them */ remove_stagein(pjob); job_abt(&pjob, Msg); } else { /* * the job is not transitting (though it may have been) and * is not running, so put in into a complete state. */ struct work_task *ptask; struct pbs_queue *pque; int KeepSeconds = 0; svr_setjobstate(pjob, JOB_STATE_COMPLETE, JOB_SUBSTATE_COMPLETE); if ((pque = pjob->ji_qhdr) && (pque != NULL)) { pque->qu_numcompleted++; } KeepSeconds = attr_ifelse_long( &pque->qu_attr[(int)QE_ATR_KeepCompleted], &server.sv_attr[(int)SRV_ATR_KeepCompleted], 0); ptask = set_task(WORK_Timed, time_now + KeepSeconds, on_job_exit, pjob); if (ptask != NULL) { append_link(&pjob->ji_svrtask, &ptask->wt_linkobj, ptask); } } /* END else if ((pjob->ji_qs.ji_svrflags & JOB_SVFLG_CHECKPOINT_FILE) != 0) */ reply_ack(preq); return; } /* END req_deletejob() */ /* * change_restart_comment_if_needed - If job has restarted then the checkpoint * restart status attribute is used in on_job_exit() to reque/hold job on failure. * If we are deleting then we change the first charcter to lower case so * it does normal processing in on_job_exit(). */ void change_restart_comment_if_needed( struct job *pjob) { if ((pjob->ji_wattr[(int)JOB_ATR_start_count].at_val.at_long > 1) && (pjob->ji_wattr[(int)JOB_ATR_checkpoint_restart_status].at_flags & ATR_VFLAG_SET)) { char *token1 = NULL; char *token2 = NULL; char commentMsg[25]; char *ptr; strncpy(commentMsg, pjob->ji_wattr[(int)JOB_ATR_checkpoint_restart_status].at_val.at_str, 24); token1 = strtok(commentMsg," "); if (token1 != NULL) token2 = strtok(NULL," "); if ((token2 != NULL) && ((memcmp(token2,"failure",7) == 0) || (memcmp(token2,"restarted",9) == 0))) { ptr = pjob->ji_wattr[(int)JOB_ATR_checkpoint_restart_status].at_val.at_str; if (isupper(*ptr)) { *ptr = tolower(*ptr); pjob->ji_wattr[(int)JOB_ATR_checkpoint_restart_status].at_flags |= ATR_VFLAG_SET; pjob->ji_modified = 1; } } } return; } /* * post_delete_route - complete the task of deleting a job which was * being routed at the time the delete request was received. * * Just recycle the delete request, the job will either be here or not. */ static void post_delete_route( struct work_task *pwt) { req_deletejob( (struct batch_request *)pwt->wt_parm1); return; } /* * post_delete_mom1 - first of 2 work task trigger functions to finish the * deleting of a running job. This first part is invoked when MOM * responds to the SIGTERM signal request. */ static void post_delete_mom1( struct work_task *pwt) { int delay = 0; int dellen = strlen(deldelaystr); job *pjob; struct work_task *pwtnew; pbs_queue *pque; struct batch_request *preq_sig; /* signal request to MOM */ struct batch_request *preq_clt; /* original client request */ int rc; preq_sig = pwt->wt_parm1; rc = preq_sig->rq_reply.brp_code; preq_clt = preq_sig->rq_extra; release_req(pwt); pjob = find_job(preq_clt->rq_ind.rq_delete.rq_objname); if (pjob == NULL) { /* job has gone away */ req_reject(PBSE_UNKJOBID, 0, preq_clt, NULL, NULL); return; } if (rc) { /* mom rejected request */ if (rc == PBSE_UNKJOBID) { /* MOM claims no knowledge, so just purge it */ log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, "MOM rejected signal during delete"); /* removed the resources assigned to job */ free_nodes(pjob); set_resc_assigned(pjob, DECR); job_purge(pjob); reply_ack(preq_clt); } else { req_reject(rc, 0, preq_clt, NULL, NULL); } return; } if (preq_clt->rq_extend) { if (strncmp(preq_clt->rq_extend, deldelaystr, dellen) == 0) { delay = atoi(preq_clt->rq_extend + dellen); } } reply_ack(preq_clt); /* dont need it, reply now */ /* * if no delay specified in original request, see if kill_delay * queue attribute is set. */ if (delay == 0) { pque = pjob->ji_qhdr; delay = attr_ifelse_long(&pque->qu_attr[(int)QE_ATR_KillDelay], &server.sv_attr[(int)SRV_ATR_KillDelay], 2); } pwtnew = set_task(WORK_Timed, delay + time_now, post_delete_mom2, pjob); if (pwtnew) { /* insure that work task will be removed if job goes away */ append_link(&pjob->ji_svrtask, &pwtnew->wt_linkobj, pwtnew); } /* * Since the first signal has succeeded, let's reschedule the * nanny to be 1 minute after the second phase. */ apply_job_delete_nanny(pjob, time_now + delay + 60); return; } /* END post_delete_mom1() */ static void post_delete_mom2( struct work_task *pwt) { job *pjob; char *sigk = "SIGKILL"; pjob = (job *)pwt->wt_parm1; if (pjob->ji_qs.ji_state == JOB_STATE_RUNNING) { issue_signal(pjob, sigk, release_req, 0); sprintf(log_buffer, msg_delrunjobsig, sigk); LOG_EVENT( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } return; } /* END post_delete_mom2() */ /* * forced_jobpurge - possibly forcibly purge a job */ static int forced_jobpurge( struct batch_request *preq) { job *pjob; if ((pjob = find_job(preq->rq_ind.rq_delete.rq_objname)) == NULL) { log_event( PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, preq->rq_ind.rq_delete.rq_objname, pbse_to_txt(PBSE_UNKJOBID)); req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL); return(-1); } /* check about possibly purging the job */ if (preq->rq_extend != NULL) { if (!strncmp(preq->rq_extend, delpurgestr, strlen(delpurgestr))) { if (((preq->rq_perm & (ATR_DFLAG_OPRD | ATR_DFLAG_OPWR | ATR_DFLAG_MGRD | ATR_DFLAG_MGWR)) != 0) || ((svr_chk_owner(preq, pjob) == 0) && (server.sv_attr[(int)SRV_ATR_OwnerPurge].at_val.at_long))) { sprintf(log_buffer, "purging job without checking MOM"); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); reply_ack(preq); free_nodes(pjob); if (pjob->ji_qhdr->qu_qs.qu_type == QTYPE_Execution) { set_resc_assigned(pjob, DECR); } job_purge(pjob); return(1); } else { /* FAILURE */ req_reject(PBSE_PERM, 0, preq, NULL, NULL); return(-1); } } } return(0); } /* END forced_jobpurge() */ /* has_job_delete_nanny - return true if job has a job delete nanny * * This means someone has already tried to cancel this job, and * the nanny is taking care of things now. */ int has_job_delete_nanny( struct job *pjob) { struct work_task *pwtiter; pwtiter = (struct work_task *)GET_NEXT(pjob->ji_svrtask); while (pwtiter != NULL) { if (pwtiter->wt_func == job_delete_nanny) { return(1); } pwtiter = (struct work_task *)GET_NEXT(pwtiter->wt_linkobj); } return(0); } /* END has_job_delete_nanny() */ /* remove_job_delete_nanny - remove all nannies on a job */ void remove_job_delete_nanny( struct job *pjob) { struct work_task *pwtiter, *pwtdel; if (pjob->ji_svrtask.ll_next == NULL) { /* no nanny, nothing to delete */ return; } pwtiter = (struct work_task *)GET_NEXT(pjob->ji_svrtask); while (pwtiter != NULL) { if (pwtiter->wt_func == job_delete_nanny) { pwtdel = pwtiter; pwtiter = (struct work_task *)GET_NEXT(pwtiter->wt_linkobj); delete_task(pwtdel); } else { pwtiter = (struct work_task *)GET_NEXT(pwtiter->wt_linkobj); } } return; } /* END has_job_delete_nanny() */ /* apply_job_delete_nanny - setup the job delete nanny on a job * * Only 1 nanny will be allowed at a time. Before adding the new * nanny, we'll remove any existing nannies. */ struct work_task *apply_job_delete_nanny( struct job *pjob, int delay) /* I */ { struct work_task *pwtnew; enum work_type tasktype; /* short-circuit if nanny isn't enabled */ if (!server.sv_attr[(int)SRV_ATR_JobNanny].at_val.at_long) { remove_job_delete_nanny(pjob); /* in case it was recently disabled */ return(NULL); } if (delay == 0) { tasktype = WORK_Immed; } else if (delay > 0) { tasktype = WORK_Timed; } else { log_err(-1, "apply_job_delete_nanny", "negative delay requested for nanny"); return(NULL); } /* first, surgically remove any existing nanny tasks */ remove_job_delete_nanny(pjob); /* second, add a nanny task at the requested time */ pwtnew = set_task(tasktype, delay, job_delete_nanny, (void *)pjob); if (pwtnew) { /* insure that work task will be removed if job goes away */ append_link(&pjob->ji_svrtask, &pwtnew->wt_linkobj, pwtnew); } return(pwtnew); } /* END apply_job_delete_nanny() */ /* * job_delete_nanny - make sure jobs are actually deleted after a delete * request. Like any good nanny, we'll be persistent with killing the job. * * jobdelete requests will set a task in the future to call job_delete_nanny(). * Under normal conditions, we never actually get called and job deletes act * the same as before. If we do get called, it means MS is having problems. * Our purpose is to continually send KILL signals to MS. This is made * persisent by always setting ourselves as a future task. * * req_jobdelete sets us as a task 1 minute in the future and sends a SIGTERM * to MS. If that succeeds, post_delete_mom1 reschedules the task to be 1 * minute after the KILL delay. Either way, if the job doesn't exit we'll * start sending our own KILLs, forever, until MS wakes up. The purpose of * the rescheduling is to stay out of the way of the KILL delay and not * interfere with normal job deletes. * * We are also called from pbsd_init_job() after recovering EXITING jobs. */ static void job_delete_nanny( struct work_task *pwt) { job *pjob; char *sigk = "SIGKILL"; struct batch_request *newreq; /* short-circuit if nanny isn't enabled */ if (!server.sv_attr[(int)SRV_ATR_JobNanny].at_val.at_long) { release_req(pwt); return; } pjob = (job *)pwt->wt_parm1; sprintf(log_buffer, "exiting job '%s' still exists, sending a SIGKILL", pjob->ji_qs.ji_jobid); log_err(-1, "job nanny", log_buffer); /* build up a Signal Job batch request */ if ((newreq = alloc_br(PBS_BATCH_SignalJob)) != NULL) { strcpy(newreq->rq_ind.rq_signal.rq_jid, pjob->ji_qs.ji_jobid); strncpy(newreq->rq_ind.rq_signal.rq_signame, sigk, PBS_SIGNAMESZ); } issue_signal(pjob, sigk, post_job_delete_nanny, newreq); apply_job_delete_nanny(pjob, time_now + 60); return; } /* END job_delete_nanny() */ /* * post_job_delete_nanny - second part of async job deletes. * * This is only called if one of job_delete_nanny()'s KILLs actually * succeeds. The sole purpose is to purge jobs that are unknown * to MS (and to release the req.) */ static void post_job_delete_nanny( struct work_task *pwt) { struct batch_request *preq_sig; /* signal request to MOM */ int rc; job *pjob; preq_sig = pwt->wt_parm1; rc = preq_sig->rq_reply.brp_code; if (!server.sv_attr[(int)SRV_ATR_JobNanny].at_val.at_long) { /* the admin disabled nanny within the last minute or so */ release_req(pwt); return; } /* extract job id from task */ pjob = find_job(preq_sig->rq_ind.rq_signal.rq_jid); if (pjob == NULL) { sprintf(log_buffer, "job delete nanny: the job disappeared (this is a BUG!)"); LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, preq_sig->rq_ind.rq_signal.rq_jid, log_buffer); } else if (rc == PBSE_UNKJOBID) { sprintf(log_buffer, "job delete nanny returned, but does not exist on mom"); LOG_EVENT( PBSEVENT_ERROR, PBS_EVENTCLASS_JOB, preq_sig->rq_ind.rq_signal.rq_jid, log_buffer); free_nodes(pjob); set_resc_assigned(pjob, DECR); job_purge(pjob); } /* free task */ release_req(pwt); return; } /* END post_job_delete_nanny() */ /* * purge_completed_jobs - service the Delete Job Request * * This request deletes a job. */ void purge_completed_jobs( struct batch_request *preq) /* I */ { char *id = "purge_completed_jobs"; job *pjob; char *time_str; time_t purge_time = 0; /* get the time to purge the jobs that completed before */ time_str = preq->rq_extend; time_str += strlen(PURGECOMP); purge_time = strtol(time_str,NULL,10); /* * Clean unreported capability is only for operators and managers. * Check if request is authorized */ if ((preq->rq_perm & (ATR_DFLAG_OPRD|ATR_DFLAG_OPWR| ATR_DFLAG_MGRD|ATR_DFLAG_MGWR)) == 0) { req_reject(PBSE_PERM,0,preq,NULL, "must have operator or manager privilege to use -c parameter"); return; } if (LOGLEVEL >= 4) { sprintf(log_buffer,"Received purge completed jobs command, purge time is %ld (%s)", (long)purge_time, preq->rq_extend); LOG_EVENT( PBSEVENT_SYSTEM, PBS_EVENTCLASS_REQUEST, id, log_buffer); } for (pjob = (job *)GET_NEXT(svr_alljobs); pjob != NULL; pjob = (job *)GET_NEXT(pjob->ji_alljobs)) { if ((pjob->ji_qs.ji_substate == JOB_SUBSTATE_COMPLETE) && (pjob->ji_wattr[(int)JOB_ATR_comp_time].at_val.at_long <= purge_time) && ((pjob->ji_wattr[(int)JOB_ATR_reported].at_flags & ATR_VFLAG_SET) != 0) && (pjob->ji_wattr[(int)JOB_ATR_reported].at_val.at_long == 0)) { if (LOGLEVEL >= 4) { sprintf(log_buffer,"Reported job is COMPLETED (%ld), setting reported to TRUE", pjob->ji_wattr[(int)JOB_ATR_comp_time].at_val.at_long); log_event( PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); } pjob->ji_wattr[(int)JOB_ATR_reported].at_val.at_long = 1; pjob->ji_wattr[(int)JOB_ATR_reported].at_flags = ATR_VFLAG_SET | ATR_VFLAG_MODIFY; job_save(pjob,SAVEJOB_FULL); } } reply_ack(preq); return; } /* END purge_completed_jobs() */ /* END req_delete.c */ torque-2.4.16/acinclude.m40000664000113300011330000001737311272401253012235 00000000000000m4_include([buildutils/tcl.m4]) m4_include([buildutils/ac_create_generic_config.m4]) m4_include([buildutils/acx_pthread.m4]) m4_include([buildutils/ax_prog_dot.m4]) m4_include([buildutils/ac_c_bigendian_cross.m4]) m4_include([buildutils/t_add_rpath.m4]) m4_include([buildutils/tac_tcltk.m4]) m4_include([buildutils/ax_cflags_gcc_option.m4]) dnl dnl Test to see whether h_errno is visible when netdb.h is included. dnl At least under HP-UX 10.x this is not the case unless dnl XOPEN_SOURCE_EXTENDED is declared but then other nasty stuff happens. dnl The appropriate thing to do is to call this macro and then dnl if it is not available do a "extern int h_errno;" in the code. dnl dnl This test was taken from the original OpenPBS buildsystem dnl AC_DEFUN([AC_DECL_H_ERRNO], [AC_CACHE_CHECK([for h_errno declaration in netdb.h], ac_cv_decl_h_errno, [AC_TRY_COMPILE([#include #ifdef HAVE_UNISTD_H #include #endif #include ], [int _ZzQ = (int)(h_errno + 1);], ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)]) if test $ac_cv_decl_h_errno = yes; then AC_DEFINE(H_ERRNO_DECLARED, 1, [is the global int h_errno declared in netdb.h]) fi ])dnl dnl dnl On some systems one needs to include sys/select.h to get the dnl definition of FD_* macros for select bitmask handling. dnl dnl This test was taken from the original OpenPBS buildsystem dnl AC_DEFUN([AC_DECL_FD_SET_SYS_SELECT_H], [AC_CACHE_CHECK([for FD_SET declaration in sys/select.h], ac_cv_decl_fdset_sys_select_h, [AC_EGREP_CPP(oh_yeah, [#include #ifdef FD_SETSIZE oh_yeah #endif ], ac_cv_decl_fdset_sys_select_h=yes, ac_cv_decl_fdset_sys_select_h=no)]) if test $ac_cv_decl_fdset_sys_select_h = yes; then AC_DEFINE(FD_SET_IN_SYS_SELECT_H, 1, [are FD_SET and friends defined in sys/select.h]) fi ])dnl dnl dnl Old compilers do not support C9X style __func__ identifiers so dnl check if this one is able to. dnl dnl This test was first written by Christopher Currie. dnl AC_DEFUN([AC_C_VAR_FUNC], [AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func, AC_TRY_COMPILE(,[const char *s = __func__;], AC_DEFINE(HAVE_FUNC, 1, [Define if the C complier supports __func__]) ac_cv_c_var_func=yes, ac_cv_c_var_func=no) ) ])dnl dnl dnl Some compilers do not support GNU style __FUNCTION__ identifiers so dnl check if this one is able to. dnl dnl This test is just copy'n'paste of the above one. dnl AC_DEFUN([AC_C_VAR_FUNCTION], [AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK(whether $CC recognizes __FUNCTION__, ac_cv_c_var_function, AC_TRY_COMPILE(,[const char *s = __FUNCTION__;], AC_DEFINE(HAVE_FUNCTION, 1, [Define if the C complier supports __FUNCTION__]) ac_cv_c_var_function=yes, ac_cv_c_var_function=no) ) ])dnl dnl Check for socklen_t: historically on BSD it is an int, and in dnl POSIX 1g it is a type of its own, but some platforms use different dnl types for the argument to getsockopt, getpeername, etc. So we dnl have to test to find something that will work. dnl Remove the AC_CHECK_TYPE - on HP-UX it would find a socklen_t, but the dnl function prototypes for getsockopt et al will not actually use dnl socklen_t args unless _XOPEN_SOURCE_EXTENDED is defined. so, the dnl AC_CHECK_TYPE will find a socklen_t and think all is happiness and dnl joy when you will really get warnings about mismatch types - type dnl mismatches that would be possibly Bad (tm) in a 64-bit compile. dnl raj 2005-05-11 this change may be redistributed at will dnl also, added "extern" to the "int getpeername" in an attempt to resolve dnl an issue with this code under Solaris 2.9. this too may be dnl redistributed at will AC_DEFUN([TAC_SOCKLEN_EQUIV], [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([for socklen_t equivalent]) AC_CACHE_VAL([curl_cv_socklen_t_equiv], [ # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long" socklen_t; do AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif extern int getpeername (int, $arg2 *, $t *); ],[ $t len; getpeername(0,0,&len); ],[ curl_cv_socklen_t_equiv="$t" break ]) done done if test "x$curl_cv_socklen_t_equiv" = x; then # take a wild guess curl_cv_socklen_t_equiv="socklen_t" AC_MSG_WARN([Cannot find a type to use in place of socklen_t, guessing socklen_t]) fi ]) AC_MSG_RESULT($curl_cv_socklen_t_equiv) AC_DEFINE_UNQUOTED($1, $curl_cv_socklen_t_equiv, [type to use in place of socklen_t if not defined]) ]) dnl dnl largefile support dnl dnl We can't just use AC_SYS_LARGEFILE because that breaks kernel ABIs on Solaris. dnl Instead, we just figure out if we have stat64() and stat64.st_mode. AC_DEFUN([TAC_SYS_LARGEFILE],[ orig_CFLAGS="$CFLAGS" AC_CHECK_FUNC(stat64, AC_DEFINE(HAVE_STAT64,1,[Define if stat64() is available]), [CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" unset ac_cv_func_stat64 AC_CHECK_FUNC(stat64, AC_DEFINE(HAVE_STAT64,1,[Define if stat64() is available]), [CFLAGS="$orig_CFLAGS"])]) AC_CHECK_FUNC(open64, AC_DEFINE(HAVE_OPEN64,1,[Define if open64() is available])) AC_CHECK_FUNC(lseek64, AC_DEFINE(HAVE_LSEEK64,1,[Define if lseek64() is available])) AC_CHECK_MEMBER(struct stat64.st_mode, AC_DEFINE(HAVE_STRUCT_STAT64,1,[Define if struct stat64 is available]), CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" unset ac_cv_member_struct_stat64_st_mode AC_CHECK_MEMBER(struct stat64.st_mode, AC_DEFINE(HAVE_STRUCT_STAT64,1,[Define if struct stat64 is available]), [CFLAGS="$orig_CFLAGS"], [#include #include #include ]), [#include #include #include ]) ]) dnl dnl remove annoying "lib not installed" warning dnl AC_DEFUN([TAC_PROG_LIBTOOL_PATCH],[ # patch libtool to remove that annoying lib install warning test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool) sed -e '/.*has not been installed in.*/d' libtool.new (test -s libtool.new || rm libtool.new) 2>/dev/null test -f libtool.new && mv libtool.new libtool # not 2>/dev/null !! test -f libtool || mv libtool.old libtool test -f libtool.old && rm -f libtool.old ]) dnl dnl Test the 2nd arg to pam_get_user to be char or const char dnl AC_DEFUN([TAC_PAM_GET_USER_2ND_ARG], [AC_MSG_CHECKING([for pam_get_user() calling type]) tac_pam_get_user_2nd_arg=none for t in "char" "const char" ; do AC_TRY_COMPILE([ #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_SECURITY_PAM_MODULES_H #include #else #ifdef HAVE_PAM_PAM_MODULES_H #include #endif #endif extern int pam_get_user( pam_handle_t *pamh, /* PAM handle */ $t **user, /* User Name */ const char *prompt /* Prompt */ ); ],[ $t* username; pam_get_user((pam_handle_t*) 1,&username,0); ],[ tac_pam_get_user_2nd_arg="$t" break ]) done AC_MSG_RESULT([$tac_pam_get_user_2nd_arg]) AC_DEFINE_UNQUOTED(pam_get_user_2nd_arg_t, $tac_pam_get_user_2nd_arg, [type to use for 2nd arg of pam_get_user]) ]) torque-2.4.16/PBS_License.txt0000664000113300011330000001003311272401253012655 00000000000000 OpenPBS (Portable Batch System) v2.3 Software License Copyright (c) 1999-2000 Veridian Information Solutions, Inc. All rights reserved. --------------------------------------------------------------------------- For a license to use or redistribute the OpenPBS software under conditions other than those described below, or to purchase support for this software, please contact Veridian Systems, PBS Products Department ("Licensor") at: www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org 877 902-4PBS (US toll-free) --------------------------------------------------------------------------- This license covers use of the OpenPBS v2.3 software (the "Software") at your site or location, and, for certain users, redistribution of the Software to other sites and locations. Use and redistribution of OpenPBS v2.3 in source and binary forms, with or without modification, are permitted provided that all of the following conditions are met. After December 31, 2001, only conditions 3-6 must be met: 1. Commercial and/or non-commercial use of the Software is permitted provided a current software registration is on file at www.OpenPBS.org. If use of this software contributes to a publication, product, or service, proper attribution must be given; see www.OpenPBS.org/credit.html 2. Redistribution in any form is only permitted for non-commercial, non-profit purposes. There can be no charge for the Software or any software incorporating the Software. Further, there can be no expectation of revenue generated as a consequence of redistributing the Software. 3. Any Redistribution of source code must retain the above copyright notice and the acknowledgment contained in paragraph 6, this list of conditions and the disclaimer contained in paragraph 7. 4. Any Redistribution in binary form must reproduce the above copyright notice and the acknowledgment contained in paragraph 6, this list of conditions and the disclaimer contained in paragraph 7 in the documentation and/or other materials provided with the distribution. 5. Redistributions in any form must be accompanied by information on how to obtain complete source code for the OpenPBS software and any modifications and/or additions to the OpenPBS software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and all modifications and additions to the Software must be freely redistributable by any party (including Licensor) without restriction. 6. All advertising materials mentioning features or use of the Software must display the following acknowledgment: "This product includes software developed by NASA Ames Research Center, Lawrence Livermore National Laboratory, and Veridian Information Solutions, Inc. Visit www.OpenPBS.org for OpenPBS software support, products, and information." 7. DISCLAIMER OF WARRANTY THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED. IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This license will be governed by the laws of the Commonwealth of Virginia, without reference to its choice of law rules. Addendum To obtain complete source code for OpenPBS and modifications/additions provided in torque visit www.openpbs.org and/or www.supercluster.org/downloads. torque-2.4.16/INSTALL0000664000113300011330000001512611455153100011065 00000000000000How to Install using autoconf'ed TORQUE. ONLINE: http://www.clusterresources.com/products/torque/docs_20050804/torquequickstart.shtml - untar the tar file and cd to the top level directory - run "./configure" with the options set appropriately for your installation. (See 'CONFIGURE' note below) - run "make" (See 'BUILD' note below) - run "make install" or "make packages" (See 'INSTALL' note below) ------------------------------------------------------------------- CONFIGURE: It is advisable to create a simple shell script that calls configure with the appropriate options so that you can save typing on reconfigures. If you have already run configure you can remake all of the Makefiles by running "./config.status". Also, looking at the first few lines of config.status will tell you the options that were set when configure was run. To figure out which options one can set run "./configure --help" ------------------------------------------------------------------- BUILD: You need to use a POSIX (or nearly POSIX) make. GNU make works quite well in this regard; BSD make does not. If you are having any sort of build problems, your make should be a prime suspect. Tremendous effort has been expended to provide proper dependency generation and makefiles without relying on any non-POSIX features. The build should work fine with a simple call to make, however, complicating things by using various make flags is not guaranteed to work. Don't be surprised if the first thing that make does is call configure again. See the note in Makefile.in if this happens. ------------------------------------------------------------------- INSTALL: The standard "install" target will install all of the configured components. Individual components can be installed with the following targets: install_clients, install_mom, install_server, install_gui, and install_devel. If your TORQUE build directory is shared to your nodes, you can rsh/ssh to each node and run: "make install_mom install_clients". For more convienent installation on compute nodes and login machines, TORQUE can build customized, distributable, self-extracting packages with the "packages" target. The packages contain all required files to use a specific subcomponent on any host with the same Operating System. The generated packages can be copied to all other hosts and installed by running the script with --install. By default, packages will preserve config files (See buildutils/self-extract-head-sh.in for the current list of config files. Run the package with --help for other options. Environments that use multiple builds can add a useful package name by defining PKGNAME, ie: $ make PKGNAME=cluster1 packages ... Building torque-cluster1-clients-linux-i686.sh ... Building torque-cluster1-mom-linux-i686.sh ... ... Local changes, such as MOM config files and pro/epilog scripts, can be placed in a "package override" directory. Files in this directory will be added, possibly overwriting default files, to the generated packages. Override files are scanned from PKGOVERRIDE/$component where PKGOVERRIDE defaults to "./pkgoverride" and $component is one of: clients, mom, server, gui, and devel. Override files are copied with the full path, ie: ./pkgoverride/mom/usr/spool/PBS/mom_priv/config One might maintain MOM scripts in a permanent location like ~/pkgoverride/mom and build packages with: $ make PKGOVERRIDE=~/pkgoverride packages ... Building torque-package-mom-linux-i686.sh ... Using override dir ~/pkgoverride/mom ... ./usr/spool/PBS/mom_priv/config ./usr/spool/PBS/mom_priv/prologue Building torque-package-server-linux-i686.sh ... Building torque-package-gui-linux-i686.sh ... ... If an executable is found at PKGOVERRIDE/$component/post-install, it will be added to the package, executed after installation, and then removed if it exits successfully. ------------------------------------------------------------------- OS NOTES Apple OS X: If using 'bash' as the job execution shell, '.bashrc' may not be executed. Use '#!/bin/bash -l' at the start of the pbs command file to force this script to be run. Some versions of OSX have a buggy bind() preventing binding to privileged ports. In this case, --disable-privports should be used. gcc 4.0 on OS X will not compile TORQUE with -pendantic -Werror (installed with Developer Tools versions prior to 2.5) . run configure with the --disable-gcc-warnings to build TORQUE with gcc 4.0 on OS X. gcc installed by Apple Developer Tools 2.5 and newer will compile TORQUE without warning OS X 10.5 (Leopard) support: The Leopard release of OS X caused a few issues with TORQUE 1) TORQUE now has difficulty authenticating a user in certain circumstances, and it doesn't always seem to be repeatable. 2) The code encapsulated by the HAVE_WORDEXP macro in pbs_mom causes causes a child process of pbs_mom that copies the stderr and stdout files back to the user to crash and the job gets stuck in the "E" state. Until we have a better solution a work around for this issue is to edit src/include/pbs_config.h, and search for HAVE_WORDEXP. Comment out the #define HAVE_WORDEXP 1 Unfortunately it is likely that issue 1) will still arise. TRU64/DIGITALUNIX: If building for a TRU64/Digital Unix cluster, some users have reported problems building pbs_mom. To correct this add the path to librt.a (ie, '/usr/lib/librt.a') to the pbs_mom linker line in ~/src/resmom/Makefile Linux 32bit vs. 64bit: At least Suse 10.0 ppc64 wants to build 32bit by default. This is how you build 64bit TORQUE: ./configure CC="gcc -m64" Similarly, 32bit builds on an x86_64 platform: ./configure CC="gcc -m32" And also, make yourself rpms: ./configure --prefix=/usr --mandir=/usr/share/man \ --libdir=/usr/lib/torque/lib64 CC="gcc -m64" make RPMOPTS="--target ppc64" rpm ./configure --prefix=/usr --mandir=/usr/share/man \ CC="gcc -m32" make RPMOPTS="--target i386" rpm AIX 32bit vs. 64bit: AIX builds are 32bit by default. In order to build build 64bit TORQUE use: ./configure CC="xlc -q64" AR="ar -X 64" NM="nm -X 64 -B" Using CC="gcc -m64" requires the same AR and NM settings. ------------------------------------------------------------------- CONFIGURATION: Once built, see online docs for MOM, scheduler, and server configuration http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki http://www.clusterresources.com/products/documentation.shtml torque-2.4.16/aclocal.m40000664000113300011330000075127511605403202011706 00000000000000# generated automatically by aclocal 1.9.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 47 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDRT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $CC in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi4*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED ]) AC_MSG_RESULT([$SED]) ]) # -*- Autoconf -*- # Copyright (C) 2002, 2003 Free Software Foundation, Inc. # Generated from amversion.in; do not edit by hand. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.2])]) # AM_AUX_DIR_EXPAND # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 6 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # serial 7 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 7 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # This macro actually does too much some checks are only needed if # your package does certain things. But this isn't really a big deal. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 11 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # -*- Autoconf -*- # Copyright (C) 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 4 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # Copyright (C) 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # AM_PROG_INSTALL_STRIP # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) torque-2.4.16/configure0000775000113300011330000424475711611641727012000 00000000000000#! /bin/sh # From configure.ac Revision: 4828 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for torque 2.4.16. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='torque' PACKAGE_TARNAME='torque' PACKAGE_VERSION='2.4.16' PACKAGE_STRING='torque 2.4.16' PACKAGE_BUGREPORT='torqueusers@supercluster.org' ac_unique_file="src/cmds/qrun.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT program_prefix program_suffix PBS_MACH INCLUDE_SERVER_TRUE INCLUDE_SERVER_FALSE build_server INCLUDE_MOM_TRUE INCLUDE_MOM_FALSE build_mom INCLUDE_CLIENTS_TRUE INCLUDE_CLIENTS_FALSE build_clients INCLUDE_DRMAA_TRUE INCLUDE_DRMAA_FALSE build_drmaa CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP AR LN_S ECHO ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LEX LEXLIB LEX_OUTPUT_ROOT YACC TBL PIC ROFF PBSPOE PBSPOEO BUILD_L26_CPUSETS_TRUE BUILD_L26_CPUSETS_FALSE BUILDCPA_TRUE BUILDCPA_FALSE MOMLIBS SCHD_TYPE_SUBDIR SCHD_TYPE SCHD_BASL_TRUE SCHD_BASL_FALSE SCHD_LIBS SCHD_CODE USING_RPP_TRUE USING_RPP_FALSE USING_SYSLOG_TRUE USING_SYSLOG_FALSE PBS_SERVER_HOME PBS_DEFAULT_FILE PBS_DEFAULT_SERVER PBS_ENVIRON RCP_PATH RCP_ARGS RSH_PATH build_pbs_rcp INCLUDE_MOM_RCP_TRUE INCLUDE_MOM_RCP_FALSE SENDMAIL_CMD pammoddir INCLUDE_PAM_TRUE INCLUDE_PAM_FALSE xauth_path INSTALL_MODULEFILES_TRUE INSTALL_MODULEFILES_FALSE MODULEFILES_DIR READLINE_LIBS CYGPATH TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TCL_INCLUDES tclx_VERSION tclx_SRC_DIR tclx_LIB_FILE tclx_LIB_SPEC tclx_STUB_LIB_FILE tclx_STUB_LIB_SPEC tclx_STUB_LIB_PATH TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES TK_INCLUDES tkx_VERSION tkx_SRC_DIR tkx_LIB_FILE tkx_LIB_SPEC tkx_STUB_LIB_FILE tkx_STUB_LIB_SPEC tkx_STUB_LIB_PATH build_gui INCLUDE_GUI_TRUE INCLUDE_GUI_FALSE MY_TCL_LIBS MY_TCL_INCS MY_TCLTK_LIBS MY_TCLTK_INCS USING_TCL_TRUE USING_TCL_FALSE USING_TK_TRUE USING_TK_FALSE use_tcl use_tk TCLSH_PROG WISH_PROG EXTRA_QSTAT_LIBS USE_TCLQSTAT_TRUE USE_TCLQSTAT_FALSE GPERF HAVE_DOT DOXYGEN acx_pthread_config PTHREAD_LIBS PTHREAD_CFLAGS DRMAA_DOCS_TRUE DRMAA_DOCS_FALSE build_drmaa_docs drmaadocdir GENERIC_CONFIG SPEC_NAME SPEC_VERSION RPM_AC_OPTS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures torque 2.4.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of torque 2.4.16:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-autorun turn on the AUTORUN_JOBS flag --enable-maxdefault turn on the RESOURCEMAXDEFAULT flag --enable-quickcommit turn on the QUICKCOMMIT flag --disable-qsub-keep-override do not allow the qsub -k flag to override -o -e. --enable-nochildsignal turn on the NO_SIGCHLD flag --disable-server do not include server and scheduler --disable-mom do not include the mom daemon --disable-clients do not include the clients --enable-drmaa build the DRMAA 1.0 library (default is off) --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug turn on the compilation of DEBUG code --disable-gcc-warnings Disable gcc strictness and warnings. If using gcc, default is to error on any warning --enable-high-availability Enables advanced high availability mode (multi-threaded) --disable-xopen-networking With HPUX and GCC, don't force usage of XOPEN and libxnet --enable-nodemask enable nodemask-based scheduling on the Origin 2000 --enable-pemask enable pemask-based scheduling on the Cray T3e --enable-srfs enable support for SRFS on Cray --enable-sp2 build PBS for an IBM SP2 --enable-cpuset enable Linux 2.6 kernel cpusets (in development) --enable-geometry-requests Enables the user to request a specific geometry using a cpuset implementation --enable-array setting this under IRIX enables the SGI Origin 2000 parallel support. Normally autodetected from the /etc/config/array file. --enable-blcr enable BLCR support --enable-acct-x enable adding x attributes to accounting log --enable-cpa enable Cray's CPA support --enable-csa enable Cray's CSA support --disable-rpp use RPP/UDP for resource queries from PBS server to mom. This is enabled by default. If disabled, TCP is used. This does not effect general node/job status messages, job launch/exit messages, inter-mom messages, etc. --enable-filesync open files with sync on each write operation. Don't bother enabling this, all it does is slow down TORQUE. This is disabled by default. --enable-plock-daemons[=ARG] enable daemons to lock themselves into memory: logical-or of 1 for pbs_server, 2 for pbs_scheduler, 4 for pbs_mom (no argument means 7 for all three) --enable-syslog enable (default) the use of syslog for error reporting --disable-shell-pipe give the job script file as standard input to the shell instead of passing its name via a pipe --disable-spool if disabled, TORQUE will create output and error files directly in $HOME/.pbs_spool if it exists or in $HOME otherwise. By default, TORQUE will spool files in $TORQUEHOME/spool and copy them to the users home directory when the job completes. --enable-shell-use-argv enable this to put the job script name on the command line that invokes the shell. Not on by default. Ignores --enable-shell-pipe setting. --disable-posixmemlock disable the moms use of mlockall. Some versions of OSs seem to have buggy POSIX MEMLOCK. --disable-privports disable the use of privileged ports for authentication. Some versions of OSX have a buggy bind() and cannot bind to privileged ports. --disable-mom-checkspool Don't check free space on spool directory and set an error --enable-force-nodefile forces creation of nodefile regardless of job submission parameters. Not on by default. --enable-unixsockets enable the use of Unix Domain sockets for authentication. --disable-gui do not include the GUI-clients --enable-tcl-qstat setting this builds qstat with Tcl interpreter features. This is enabled if Tcl is enabled. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-debug compile with debugging symbols --with-cpa-include=DIR include path for cpalib.h --with-cpa-lib=DIR lib path for libcpalib --with-sched=TYPE sets the scheduler type. If TYPE is "c" the scheduler will be written in C "tcl" the server will use a Tcl based scheduler "basl" will use the rule based scheduler "no" then their will be no scheduling done (the "c" scheduler is the default) --with-sched-code=PATH sets the name of the scheduler to use. This only applies to BASL schedulers and those written in the C language. For C schedulers this should be a directory name and for BASL schedulers a filename ending in ".basl". It will be interpreted relative to srctree/src/schedulers.SCHD_TYPE/samples. As an example, an appropriate BASL scheduler realtive path would be "nas.basl". The default scheduler code for "C" schedulers is "fifo". --with-maildomain=MAILDOMAIN override the default domain for outgoing mail messages, i.e. "user@maildomain". The default maildomain is the hostname where the job was submitted from. --with-tmpdir=DIR set the tmp directory that pbs_mom will use defaults to "/tmp". This is a Cray-specific feature. --with-server-home=DIR set the server home/spool directory for PBS use defaults to /var/spool/torque --with-server-name-file=FILE set the file that will contain the name of the default server for clients to use. If this is not an absolute pathname, it will be evaluated relative to the server home directory that either defaults to /usr/spool/torque or is set using the --with-server-home option to configure. If this option is not specified, the default name for this file will be set to "server_name". --with-default-server=HOSTNAME set the name of the computer that clients will access when no machine name is specified as part of the queue name. It defaults to the hostname of the machine on which PBS is being compiled. --with-environ=PATH set the path containing the environment variables for the daemons. For SP2 and AIX systems, suggested setting is to /etc/environment. Defaults to the file "pbs_environment" in the server-home. Relative paths are interpreted within the context of the server-home. --with-qstatrc-file=FILE set the name of the file that qstat will use if there is no ".qstatrc" file in the directory where it is being invoked. Relative path names will be evaluated relative to the server home directory (see above). If this option is not specified, the default name for this file will be set to "qstatrc" (no dot) in the server home directory. --with-momlogdir use this directory for MOM logs. --with-momlogsuffix use this suffix for MOM logs. --with-scp use scp instead of mom_rcp (deprecated, use --with-rcp=scp). --with-rcp one of "scp", "rcp", "mom_rcp", or the fullpath of a remote file copy program. scp is the default if found, otherwise mom_rcp is used. Some rcp programs don't always exit with valid error codes in case of failure. mom_rcp is a copy of BSD rcp included with this source that has correct error codes, but it is also old, unmaintained, and doesn't have largefile support. --with-sendmail[=FILE] sendmail executable to use --with-pam=DIR Directory that holds the system PAM modules. Defaults to /lib(64)/security on Linux. --with-xauth=PATH Specify path to xauth program --without-readline do not include readline support (default: included if found) --with-modulefiles[=DIR] use modulefiles in specified directory [/etc/modulefiles] --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tclinclude directory containing the public Tcl header files --with-tclx directory containing tclx configuration (tclxConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-tkinclude directory containing the public Tk header files. --with-tkx directory containing tkx configuration (tkxConfig.sh) --with-tclatrsep=CHAR set the Tcl attribute separator character this will default to "." if unspecified Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF torque configure 2.4.16 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by torque $as_me 2.4.16, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in buildutils $srcdir/buildutils; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in buildutils $srcdir/buildutils" >&5 echo "$as_me: error: cannot find install-sh or install.sh in buildutils $srcdir/buildutils" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` for ac_prog in $MAKE make gmake do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE"; then ac_cv_prog_MAKE="$MAKE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAKE="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi MAKE=$ac_cv_prog_MAKE if test -n "$MAKE"; then echo "$as_me:$LINENO: result: $MAKE" >&5 echo "${ECHO_T}$MAKE" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$MAKE" && break done test -n "$MAKE" || MAKE="error" if test "x$MAKE" = "xerror" ;then { { echo "$as_me:$LINENO: error: cannot find a make command" >&5 echo "$as_me: error: cannot find a make command" >&2;} { (exit 1); exit 1; }; } fi am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='torque' VERSION='2.4.16' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE if test "$program_prefix" = "NONE";then program_prefix="" fi if test "$program_suffix" = "NONE";then program_suffix="" fi RPM_AC_OPTS="" ac_config_headers="$ac_config_headers src/include/pbs_config.h" echo "$as_me:$LINENO: checking PBS machine type" >&5 echo $ECHO_N "checking PBS machine type... $ECHO_C" >&6 if test "${pbs_cv_type_mach+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else pbs_cv_type_mach=`$ac_aux_dir/pbs_mach_type` fi echo "$as_me:$LINENO: result: $pbs_cv_type_mach" >&5 echo "${ECHO_T}$pbs_cv_type_mach" >&6 PBS_MACH=$pbs_cv_type_mach if test "x$PBS_MACH" = "xunknown"; then { echo "$as_me:$LINENO: WARNING: MOM Machine type \"$host_os\" is not supported." >&5 echo "$as_me: WARNING: MOM Machine type \"$host_os\" is not supported." >&2;} cat >>confdefs.h <<\_ACEOF #define UNSUPPORTED_MACH 1 _ACEOF fi cat >>confdefs.h <<_ACEOF #define PBS_MACH "${PBS_MACH}" _ACEOF # this defines the name of a .c file which is then included in # another resc_def_all.c cat >>confdefs.h <<_ACEOF #define MACH_RESC_DEFS "resc_def_${PBS_MACH}.c" _ACEOF echo "$as_me:$LINENO: checking whether to turn on the AUTORUN_JOBS flag" >&5 echo $ECHO_N "checking whether to turn on the AUTORUN_JOBS flag... $ECHO_C" >&6 # Check whether --enable-autorun or --disable-autorun was given. if test "${enable_autorun+set}" = set; then enableval="$enable_autorun" enable_autorun=$enableval else enable_autorun=no fi; echo "$as_me:$LINENO: result: $enable_autorun" >&5 echo "${ECHO_T}$enable_autorun" >&6 if test "x$enable_autorun" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define AUTORUN_JOBS 1 _ACEOF fi echo "$as_me:$LINENO: checking whether to turn on the RESOURCEMAXDEFAULT flag" >&5 echo $ECHO_N "checking whether to turn on the RESOURCEMAXDEFAULT flag... $ECHO_C" >&6 # Check whether --enable-maxdefault or --disable-maxdefault was given. if test "${enable_maxdefault+set}" = set; then enableval="$enable_maxdefault" enable_maxdefault=$enableval else enable_maxdefault=no fi; echo "$as_me:$LINENO: result: $enable_maxdefault" >&5 echo "${ECHO_T}$enable_maxdefault" >&6 if test "x$enable_maxdefault" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define RESOURCEMAXDEFAULT 1 _ACEOF fi echo "$as_me:$LINENO: checking whether to turn on the QUICKCOMMIT flag" >&5 echo $ECHO_N "checking whether to turn on the QUICKCOMMIT flag... $ECHO_C" >&6 # Check whether --enable-quickcommit or --disable-quickcommit was given. if test "${enable_quickcommit+set}" = set; then enableval="$enable_quickcommit" enable_quickcommit=$enableval else enable_quickcommit=no fi; echo "$as_me:$LINENO: result: $enable_quickcommit" >&5 echo "${ECHO_T}$enable_quickcommit" >&6 if test "x$enable_quickcommit" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define QUICKCOMMIT 1 _ACEOF fi # Check whether --enable-qsub-keep-override or --disable-qsub-keep-override was given. if test "${enable_qsub_keep_override+set}" = set; then enableval="$enable_qsub_keep_override" case "${enableval}" in yes) ;; no) QSUB_KEEP_NO_OVERRIDE=1; cat >>confdefs.h <<\_ACEOF #define QSUB_KEEP_NO_OVERRIDE 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: --enable-qsub-keep-override cannot take a value" >&5 echo "$as_me: error: --enable-qsub-keep-override cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac fi; echo "$as_me:$LINENO: checking whether to turn on the NO_SIGCHLD flag" >&5 echo $ECHO_N "checking whether to turn on the NO_SIGCHLD flag... $ECHO_C" >&6 # Check whether --enable-nochildsignal or --disable-nochildsignal was given. if test "${enable_nochildsignal+set}" = set; then enableval="$enable_nochildsignal" enable_nochildsignal=$enableval else enable_nochildsignal=no fi; echo "$as_me:$LINENO: result: $enable_nochildsignal" >&5 echo "${ECHO_T}$enable_nochildsignal" >&6 if test "x$enable_nochildsignal" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define NO_SIGCHLD 1 _ACEOF fi partdefault=yes if test "x$PBS_MACH" = "xunknown"; then partdefault=no fi echo "$as_me:$LINENO: checking whether to include server and scheduler" >&5 echo $ECHO_N "checking whether to include server and scheduler... $ECHO_C" >&6 # Check whether --enable-server or --disable-server was given. if test "${enable_server+set}" = set; then enableval="$enable_server" build_server=$enableval else build_server=$partdefault fi; echo "$as_me:$LINENO: result: $build_server" >&5 echo "${ECHO_T}$build_server" >&6 if test "x$build_server" = "xyes"; then INCLUDE_SERVER_TRUE= INCLUDE_SERVER_FALSE='#' else INCLUDE_SERVER_TRUE='#' INCLUDE_SERVER_FALSE= fi echo "$as_me:$LINENO: checking whether to include the mom daemon" >&5 echo $ECHO_N "checking whether to include the mom daemon... $ECHO_C" >&6 # Check whether --enable-mom or --disable-mom was given. if test "${enable_mom+set}" = set; then enableval="$enable_mom" build_mom=$enableval else build_mom=$partdefault fi; echo "$as_me:$LINENO: result: $build_mom" >&5 echo "${ECHO_T}$build_mom" >&6 if test "x$build_mom" = "xyes"; then INCLUDE_MOM_TRUE= INCLUDE_MOM_FALSE='#' else INCLUDE_MOM_TRUE='#' INCLUDE_MOM_FALSE= fi echo "$as_me:$LINENO: checking whether to include the clients" >&5 echo $ECHO_N "checking whether to include the clients... $ECHO_C" >&6 # Check whether --enable-clients or --disable-clients was given. if test "${enable_clients+set}" = set; then enableval="$enable_clients" build_clients=$enableval else build_clients=yes fi; echo "$as_me:$LINENO: result: $build_clients" >&5 echo "${ECHO_T}$build_clients" >&6 if test "x$build_clients" = "xyes"; then INCLUDE_CLIENTS_TRUE= INCLUDE_CLIENTS_FALSE='#' else INCLUDE_CLIENTS_TRUE='#' INCLUDE_CLIENTS_FALSE= fi echo "$as_me:$LINENO: checking whether to build DRMAA lib" >&5 echo $ECHO_N "checking whether to build DRMAA lib... $ECHO_C" >&6 # Check whether --enable-drmaa or --disable-drmaa was given. if test "${enable_drmaa+set}" = set; then enableval="$enable_drmaa" build_drmaa=$enableval else build_drmaa=no fi; echo "$as_me:$LINENO: result: $build_drmaa" >&5 echo "${ECHO_T}$build_drmaa" >&6 if test "x$build_drmaa" = "xyes"; then INCLUDE_DRMAA_TRUE= INCLUDE_DRMAA_FALSE='#' else INCLUDE_DRMAA_TRUE='#' INCLUDE_DRMAA_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AR" && break done test -n "$AR" || AR="exit" # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED fi echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4494 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to torqueusers@supercluster.org ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5831:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDRT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6865: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6869: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7098: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7102: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7158: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7162: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds="$tmp_archive_cmds" fi else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 8492 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var " || \ test "X$hardcode_automatic"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then archive_cmds_need_lc_CXX=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_CXX='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='-all_load $convenience' link_all_deplibs_CXX=yes else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd12*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes archive_cmds_need_lc_CXX=no archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.0-5 | solaris2.0-5.*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11640: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11644: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11700: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11704: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 12211 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var CXX" || \ test "X$hardcode_automatic_CXX"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14007: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14011: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14067: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14071: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_F77="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_F77="$tmp_archive_cmds" fi else ld_shlibs_F77=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi4*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_F77=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_F77='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='-all_load $convenience' link_all_deplibs_F77=yes else ld_shlibs_F77=no fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 15381 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var F77" || \ test "X$hardcode_automatic_F77"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16122: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16126: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16355: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16359: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16415: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16419: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_GCJ="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_GCJ="$tmp_archive_cmds" fi else ld_shlibs_GCJ=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi4*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_GCJ=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_GCJ='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='-all_load $convenience' link_all_deplibs_GCJ=yes else ld_shlibs_GCJ=no fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 17749 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var GCJ" || \ test "X$hardcode_automatic_GCJ"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion # patch libtool to remove that annoying lib install warning test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool) sed -e '/.*has not been installed in.*/d' libtool.new (test -s libtool.new || rm libtool.new) 2>/dev/null test -f libtool.new && mv libtool.new libtool # not 2>/dev/null !! test -f libtool || mv libtool.old libtool test -f libtool.old && rm -f libtool.old echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in gtbl tbl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_TBL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$TBL"; then ac_cv_prog_TBL="$TBL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TBL="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi TBL=$ac_cv_prog_TBL if test -n "$TBL"; then echo "$as_me:$LINENO: result: $TBL" >&5 echo "${ECHO_T}$TBL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$TBL" && break done test -n "$TBL" || TBL="exit" for ac_prog in gpic pic do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_PIC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$PIC"; then ac_cv_prog_PIC="$PIC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PIC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi PIC=$ac_cv_prog_PIC if test -n "$PIC"; then echo "$as_me:$LINENO: result: $PIC" >&5 echo "${ECHO_T}$PIC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$PIC" && break done test -n "$PIC" || PIC="exit" for ac_prog in groff troff do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ROFF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ROFF"; then ac_cv_prog_ROFF="$ROFF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ROFF="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ROFF=$ac_cv_prog_ROFF if test -n "$ROFF"; then echo "$as_me:$LINENO: result: $ROFF" >&5 echo "${ECHO_T}$ROFF" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ROFF" && break done test -n "$ROFF" || ROFF="exit" echo "$as_me:$LINENO: checking whether to turn on the compilation of DEBUG code" >&5 echo $ECHO_N "checking whether to turn on the compilation of DEBUG code... $ECHO_C" >&6 # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" enable_debug=$enableval else enable_debug=no fi; echo "$as_me:$LINENO: result: $enable_debug" >&5 echo "${ECHO_T}$enable_debug" >&6 if test "x$enable_debug" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define DEBUG 1 _ACEOF fi echo "$as_me:$LINENO: checking whether to compile with debugging symbols" >&5 echo $ECHO_N "checking whether to compile with debugging symbols... $ECHO_C" >&6 # Check whether --with-debug or --without-debug was given. if test "${with_debug+set}" = set; then withval="$with_debug" DEBUG_SYMBOLS=$withval else DEBUG_SYMBOLS="no" fi; echo "$as_me:$LINENO: result: DEBUG_SYMBOLS=$DEBUG_SYMBOLS" >&5 echo "${ECHO_T}DEBUG_SYMBOLS=$DEBUG_SYMBOLS" >&6 if test "$DEBUG_SYMBOLS" = 'yes'; then echo "$as_me:$LINENO: result: before tweak CFLAGS=$CFLAGS" >&5 echo "${ECHO_T}before tweak CFLAGS=$CFLAGS" >&6 CFLAGS=`echo $CFLAGS | sed 's/ \?-O[^ ]*//g'` echo "$as_me:$LINENO: result: mid tweak CFLAGS=$CFLAGS" >&5 echo "${ECHO_T}mid tweak CFLAGS=$CFLAGS" >&6 case $CFLAGS in *-g*) ;; *) if test "$CFLAGS" = ''; then CFLAGS="-g" else CFLAGS="-g $CFLAGS" fi ;; esac echo "$as_me:$LINENO: result: after tweak CFLAGS=$CFLAGS" >&5 echo "${ECHO_T}after tweak CFLAGS=$CFLAGS" >&6 fi orig_CFLAGS="$CFLAGS" echo "$as_me:$LINENO: checking for stat64" >&5 echo $ECHO_N "checking for stat64... $ECHO_C" >&6 if test "${ac_cv_func_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define stat64 to an innocuous variant, in case declares stat64. For example, HP-UX 11i declares gettimeofday. */ #define stat64 innocuous_stat64 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char stat64 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef stat64 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char stat64 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_stat64) || defined (__stub___stat64) choke me #else char (*f) () = stat64; #endif #ifdef __cplusplus } #endif int main () { return f != stat64; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_stat64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_stat64" >&5 echo "${ECHO_T}$ac_cv_func_stat64" >&6 if test $ac_cv_func_stat64 = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STAT64 1 _ACEOF else CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" unset ac_cv_func_stat64 echo "$as_me:$LINENO: checking for stat64" >&5 echo $ECHO_N "checking for stat64... $ECHO_C" >&6 if test "${ac_cv_func_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define stat64 to an innocuous variant, in case declares stat64. For example, HP-UX 11i declares gettimeofday. */ #define stat64 innocuous_stat64 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char stat64 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef stat64 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char stat64 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_stat64) || defined (__stub___stat64) choke me #else char (*f) () = stat64; #endif #ifdef __cplusplus } #endif int main () { return f != stat64; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_stat64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_stat64" >&5 echo "${ECHO_T}$ac_cv_func_stat64" >&6 if test $ac_cv_func_stat64 = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STAT64 1 _ACEOF else CFLAGS="$orig_CFLAGS" fi fi echo "$as_me:$LINENO: checking for open64" >&5 echo $ECHO_N "checking for open64... $ECHO_C" >&6 if test "${ac_cv_func_open64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define open64 to an innocuous variant, in case declares open64. For example, HP-UX 11i declares gettimeofday. */ #define open64 innocuous_open64 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char open64 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef open64 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char open64 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_open64) || defined (__stub___open64) choke me #else char (*f) () = open64; #endif #ifdef __cplusplus } #endif int main () { return f != open64; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_open64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_open64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_open64" >&5 echo "${ECHO_T}$ac_cv_func_open64" >&6 if test $ac_cv_func_open64 = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPEN64 1 _ACEOF fi echo "$as_me:$LINENO: checking for lseek64" >&5 echo $ECHO_N "checking for lseek64... $ECHO_C" >&6 if test "${ac_cv_func_lseek64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define lseek64 to an innocuous variant, in case declares lseek64. For example, HP-UX 11i declares gettimeofday. */ #define lseek64 innocuous_lseek64 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char lseek64 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef lseek64 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char lseek64 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_lseek64) || defined (__stub___lseek64) choke me #else char (*f) () = lseek64; #endif #ifdef __cplusplus } #endif int main () { return f != lseek64; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lseek64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_lseek64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_lseek64" >&5 echo "${ECHO_T}$ac_cv_func_lseek64" >&6 if test $ac_cv_func_lseek64 = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LSEEK64 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct stat64.st_mode" >&5 echo $ECHO_N "checking for struct stat64.st_mode... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat64_st_mode+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { static struct stat64 ac_aggr; if (ac_aggr.st_mode) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat64_st_mode=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { static struct stat64 ac_aggr; if (sizeof ac_aggr.st_mode) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat64_st_mode=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat64_st_mode=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat64_st_mode" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat64_st_mode" >&6 if test $ac_cv_member_struct_stat64_st_mode = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF else CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" unset ac_cv_member_struct_stat64_st_mode echo "$as_me:$LINENO: checking for struct stat64.st_mode" >&5 echo $ECHO_N "checking for struct stat64.st_mode... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat64_st_mode+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { static struct stat64 ac_aggr; if (ac_aggr.st_mode) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat64_st_mode=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { static struct stat64 ac_aggr; if (sizeof ac_aggr.st_mode) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat64_st_mode=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat64_st_mode=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat64_st_mode" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat64_st_mode" >&6 if test $ac_cv_member_struct_stat64_st_mode = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF else CFLAGS="$orig_CFLAGS" fi fi # Check whether --enable-gcc_warnings or --disable-gcc_warnings was given. if test "${enable_gcc_warnings+set}" = set; then enableval="$enable_gcc_warnings" fi; if test "x$GCC" = "xyes" ;then echo "$as_me:$LINENO: checking whether to use strict gcc warnings" >&5 echo $ECHO_N "checking whether to use strict gcc warnings... $ECHO_C" >&6 if test "${enable_gcc_warnings}" == "yes" ; then if test "x$build_drmaa" = "xyes" ;then echo "$as_me:$LINENO: result: no... because DRMAA is being built" >&5 echo "${ECHO_T}no... because DRMAA is being built" >&6 else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 echo "$as_me:$LINENO: checking CFLAGS for gcc -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror" >&5 echo $ECHO_N "checking CFLAGS for gcc -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror... $ECHO_C" >&6 if test "${ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror="no, unknown" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_save_CFLAGS="$CFLAGS" for ac_arg in "-pedantic -Werror % -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror" "-pedantic % -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror %% no, obsolete" # do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror=`echo $ac_arg | sed -e 's,.*% *,,'` ; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done CFLAGS="$ac_save_CFLAGS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror" >&5 echo "${ECHO_T}$ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror" >&6 case ".$ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror" in .ok|.ok,*) ;; .|.no|.no,*) ;; *) if echo " $CFLAGS " | grep " $ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror " 2>&1 >/dev/null then { (echo "$as_me:$LINENO: : CFLAGS does contain \$ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror") >&5 (: CFLAGS does contain $ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } else { (echo "$as_me:$LINENO: : CFLAGS=\"\$CFLAGS \$ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror\"") >&5 (: CFLAGS="$CFLAGS $ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } CFLAGS="$CFLAGS $ac_cv_cflags_gcc_option__W__Wall__Wno_unused_parameter__Wno_long_long__pedantic__Werror" fi ;; esac gccwarnings=yes fi else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi # Check whether --enable-high_availability or --disable-high_availability was given. if test "${enable_high_availability+set}" = set; then enableval="$enable_high_availability" fi; if test "x$GCC" = "xyes" ;then echo "$as_me:$LINENO: checking whether to use threaded high availability" >&5 echo $ECHO_N "checking whether to use threaded high availability... $ECHO_C" >&6 if test "${enable_high_availability}" == "yes" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 PTHREAD_LIBS=-lpthread LIBS="$LIBS $PTHREAD_LIBS" CFLAGS="$CFLAGS -DUSE_HA_THREADS" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 high_availability=yes fi fi echo "$as_me:$LINENO: checking whether to force XOPEN networking stack" >&5 echo $ECHO_N "checking whether to force XOPEN networking stack... $ECHO_C" >&6 # Check whether --enable-xopen_networking or --disable-xopen_networking was given. if test "${enable_xopen_networking+set}" = set; then enableval="$enable_xopen_networking" fi; if test "${enable_xopen_networking}" != "no" ; then case $GCC,$PBS_MACH in yes,hpux*) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 { echo "$as_me:$LINENO: WARNING: On HPUX and gcc, forcing XOPEN network stack." >&5 echo "$as_me: WARNING: On HPUX and gcc, forcing XOPEN network stack." >&2;} { echo "$as_me:$LINENO: WARNING: Use --disable-xopen-networking to prevent it" >&5 echo "$as_me: WARNING: Use --disable-xopen-networking to prevent it" >&2;} echo "$as_me:$LINENO: checking for getpeername in -lxnet" >&5 echo $ECHO_N "checking for getpeername in -lxnet... $ECHO_C" >&6 if test "${ac_cv_lib_xnet_getpeername+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getpeername (); int main () { getpeername (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_xnet_getpeername=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_xnet_getpeername=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_getpeername" >&5 echo "${ECHO_T}$ac_cv_lib_xnet_getpeername" >&6 if test $ac_cv_lib_xnet_getpeername = yes; then LIBS="-lxnet $LIBS" CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" else { echo "$as_me:$LINENO: WARNING: This build will likely fail in mysterious ways at run-time" >&5 echo "$as_me: WARNING: This build will likely fail in mysterious ways at run-time" >&2;} sleep 10 fi ;; *) echo "$as_me:$LINENO: result: no... phew!" >&5 echo "${ECHO_T}no... phew!" >&6 esac else echo "$as_me:$LINENO: result: disabled" >&5 echo "${ECHO_T}disabled" >&6 fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi for ac_header in arpa/inet.h fcntl.h float.h limits.h malloc.h netdb.h \ netinet/in.h stddef.h sys/file.h sys/param.h sys/tty.h \ sys/socket.h sys/time.h sys/ioctl.h sys/mount.h \ sys/vfs.h sys/statfs.h sys/statvfs.h sys/ucred.h sys/un.h sys/uio.h \ syslog.h readline/readline.h \ termios.h err.h sys/poll.h pam/pam_modules.h security/pam_appl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to torqueusers@supercluster.org ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # On Solaris, pam_modules.h requires pam_appl.h for ac_header in security/pam_modules.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_SECURITY_PAM_APPL_H # include # endif #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --enable-nodemask or --disable-nodemask was given. if test "${enable_nodemask+set}" = set; then enableval="$enable_nodemask" fi; if test "${enable_nodemask}" = "yes" ; then case "${PBS_MACH}" in irix6*) cat >>confdefs.h <<\_ACEOF #define NODEMASK 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: Cannot --enable-nodemask on a machine not running IRIX6" >&5 echo "$as_me: error: Cannot --enable-nodemask on a machine not running IRIX6" >&2;} { (exit 1); exit 1; }; };; esac fi # Check whether --enable-pemask or --disable-pemask was given. if test "${enable_pemask+set}" = set; then enableval="$enable_pemask" fi; if test "${enable_pemask}" = "yes" ; then case "${PBS_MACH}" in unicosmk*) cat >>confdefs.h <<\_ACEOF #define PE_MASK 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: Cannot --enable-pemask on a machine not running UNICOS/mk" >&5 echo "$as_me: error: Cannot --enable-pemask on a machine not running UNICOS/mk" >&2;} { (exit 1); exit 1; }; };; esac fi SRFS=0 # Check whether --enable-srfs or --disable-srfs was given. if test "${enable_srfs+set}" = set; then enableval="$enable_srfs" fi; if test "${enable_srfs}" = "yes" ; then case "${PBS_MACH}" in unicos*) SRFS=1 ;; *) { { echo "$as_me:$LINENO: error: Cannot --enable-srfs on a machine not running UNICOS" >&5 echo "$as_me: error: Cannot --enable-srfs on a machine not running UNICOS" >&2;} { (exit 1); exit 1; }; };; esac fi cat >>confdefs.h <<_ACEOF #define SRFS ${SRFS} _ACEOF MOMLIBS="" PBSPOE="" PBSPOEO="" # Check whether --enable-sp2 or --disable-sp2 was given. if test "${enable_sp2+set}" = set; then enableval="$enable_sp2" fi; IBM_SP2=0 if test "x$enable_sp2" = "xyes" ; then MOMLIBS="-ljm_client -lSDR" case "$PBS_MACH" in aix*) echo "$as_me:$LINENO: checking for swtbl_load_table in -lswitchtbl" >&5 echo $ECHO_N "checking for swtbl_load_table in -lswitchtbl... $ECHO_C" >&6 if test "${ac_cv_lib_switchtbl_swtbl_load_table+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lswitchtbl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char swtbl_load_table (); int main () { swtbl_load_table (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_switchtbl_swtbl_load_table=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_switchtbl_swtbl_load_table=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_switchtbl_swtbl_load_table" >&5 echo "${ECHO_T}$ac_cv_lib_switchtbl_swtbl_load_table" >&6 if test $ac_cv_lib_switchtbl_swtbl_load_table = yes; then IBM_SP2=2 LIBS="-lswitchtbl $LIBS" PBSPOE="pbspd pbspoe" PBSPOEO="pbspoe.o pbspd.o" else IBM_SP2=1 fi ;; *) { { echo "$as_me:$LINENO: error: Cannot --enable-sp2 on a machine not running AIX" >&5 echo "$as_me: error: Cannot --enable-sp2 on a machine not running AIX" >&2;} { (exit 1); exit 1; }; } ;; esac fi cat >>confdefs.h <<_ACEOF #define IBM_SP2 ${IBM_SP2} _ACEOF # Check whether --enable-cpuset or --disable-cpuset was given. if test "${enable_cpuset+set}" = set; then enableval="$enable_cpuset" fi; build_l26_cpuset=no if test "x$enable_cpuset" = "xyes" ;then build_l26_cpuset=yes cat >>confdefs.h <<\_ACEOF #define PENABLE_LINUX26_CPUSETS 1 _ACEOF cpuset=1 else cpuset=0 fi if test "$build_l26_cpuset" = yes; then BUILD_L26_CPUSETS_TRUE= BUILD_L26_CPUSETS_FALSE='#' else BUILD_L26_CPUSETS_TRUE='#' BUILD_L26_CPUSETS_FALSE= fi # Check whether --enable-geometry_requests or --disable-geometry_requests was given. if test "${enable_geometry_requests+set}" = set; then enableval="$enable_geometry_requests" fi; if test "x$GCC" = "xyes" ;then echo "$as_me:$LINENO: checking whether to allow geometry requests" >&5 echo $ECHO_N "checking whether to allow geometry requests... $ECHO_C" >&6 if test "${enable_geometry_requests}" = "yes" ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 build_l26_cpuset=yes cat >>confdefs.h <<\_ACEOF #define PENABLE_LINUX26_CPUSETS 1 _ACEOF if test "${cpuset}" = "1" ; then CFLAGS="$CFLAGS -DGEOMETRY_REQUESTS -DALWAYS_USE_CPUSETS" else CFLAGS="$CFLAGS -DGEOMETRY_REQUESTS" fi else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "$build_l26_cpuset" = yes; then BUILD_L26_CPUSETS_TRUE= BUILD_L26_CPUSETS_FALSE='#' else BUILD_L26_CPUSETS_TRUE='#' BUILD_L26_CPUSETS_FALSE= fi # Check whether --enable-array or --disable-array was given. if test "${enable_array+set}" = set; then enableval="$enable_array" if test "$PBS_MACH" = irix6; then if test "$enableval" = yes; then { echo "$as_me:$LINENO: WARNING: No array daemon detected but enable-array overrides." >&5 echo "$as_me: WARNING: No array daemon detected but enable-array overrides." >&2;} PBS_MACH=irix6array fi elif test "$PBS_MACH" = irix6array; then if test "$enableval" = no; then { echo "$as_me:$LINENO: WARNING: Array daemon detected but disable-array overrides." >&5 echo "$as_me: WARNING: Array daemon detected but disable-array overrides." >&2;} PBS_MACH=irix6 fi else { { echo "$as_me:$LINENO: error: Cannot use --en/disable-array unless configuring for IRIX 6.x or above" >&5 echo "$as_me: error: Cannot use --en/disable-array unless configuring for IRIX 6.x or above" >&2;} { (exit 1); exit 1; }; } fi fi; echo "$as_me:$LINENO: checking whether to build BLCR support" >&5 echo $ECHO_N "checking whether to build BLCR support... $ECHO_C" >&6 # Check whether --enable-blcr or --disable-blcr was given. if test "${enable_blcr+set}" = set; then enableval="$enable_blcr" BLCR=$enableval else BLCR=no fi; echo "$as_me:$LINENO: result: $BLCR" >&5 echo "${ECHO_T}$BLCR" >&6 case "$BLCR" in yes) cat >>confdefs.h <<\_ACEOF #define ENABLE_BLCR 1 _ACEOF ;; no) : ;; *) { { echo "$as_me:$LINENO: error: --enable-blcr should be yes or no" >&5 echo "$as_me: error: --enable-blcr should be yes or no" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$as_me:$LINENO: checking whether to add x attributes to accounting" >&5 echo $ECHO_N "checking whether to add x attributes to accounting... $ECHO_C" >&6 # Check whether --enable-acct-x or --disable-acct-x was given. if test "${enable_acct_x+set}" = set; then enableval="$enable_acct_x" ACCTX=$enableval else ACCTX=no fi; echo "$as_me:$LINENO: result: $ACCTX" >&5 echo "${ECHO_T}$ACCTX" >&6 case "$ACCTX" in yes) cat >>confdefs.h <<\_ACEOF #define ATTR_X_ACCT 1 _ACEOF ;; no) : ;; *) { { echo "$as_me:$LINENO: error: --enable-acct-x should be yes or no" >&5 echo "$as_me: error: --enable-acct-x should be yes or no" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$as_me:$LINENO: checking whether to build Cray's CPA support" >&5 echo $ECHO_N "checking whether to build Cray's CPA support... $ECHO_C" >&6 # Check whether --enable-cpa or --disable-cpa was given. if test "${enable_cpa+set}" = set; then enableval="$enable_cpa" CPA=$enableval else CPA=no fi; echo "$as_me:$LINENO: result: $CPA" >&5 echo "${ECHO_T}$CPA" >&6 # Check whether --with-cpa_include or --without-cpa_include was given. if test "${with_cpa_include+set}" = set; then withval="$with_cpa_include" cpainclude=$withval else cpainclude=none fi; # Check whether --with-cpa_lib or --without-cpa_lib was given. if test "${with_cpa_lib+set}" = set; then withval="$with_cpa_lib" cpalib=$withval else cpalib=none fi; if test "x$cpainclude" != "xnone" ;then CPPFLAGS="$CPPFLAGS -I$cpainclude" fi LDFLAGS_cpasave="$LDFLAGS" if test "x$cpalib" != "xnone" ;then LDFLAGS="$LDFLAGS -L$cpalib" fi buildcpa="no" case "$CPA" in yes) cat >>confdefs.h <<\_ACEOF #define ENABLE_CPA 1 _ACEOF for ac_header in cpalib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to torqueusers@supercluster.org ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF : else { { echo "$as_me:$LINENO: error: pass the path to cpalib.h to --with-cpa-include" >&5 echo "$as_me: error: pass the path to cpalib.h to --with-cpa-include" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for cpa_new_node_req in -lcpalib" >&5 echo $ECHO_N "checking for cpa_new_node_req in -lcpalib... $ECHO_C" >&6 if test "${ac_cv_lib_cpalib_cpa_new_node_req+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpalib $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char cpa_new_node_req (); int main () { cpa_new_node_req (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cpalib_cpa_new_node_req=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cpalib_cpa_new_node_req=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_cpalib_cpa_new_node_req" >&5 echo "${ECHO_T}$ac_cv_lib_cpalib_cpa_new_node_req" >&6 if test $ac_cv_lib_cpalib_cpa_new_node_req = yes; then : else { { echo "$as_me:$LINENO: error: pass the path to libcpalib to --with-cpa-lib" >&5 echo "$as_me: error: pass the path to libcpalib to --with-cpa-lib" >&2;} { (exit 1); exit 1; }; } fi if test "x$cpalib" != "xnone" ;then MOMLIBS="$MOMLIBS -L$cpalib -lcpalib" else MOMLIBS="$MOMLIBS -lcpalib" fi buildcpa="yes" ;; no) : ;; *) { { echo "$as_me:$LINENO: error: --enable-cpa should be yes or no" >&5 echo "$as_me: error: --enable-cpa should be yes or no" >&2;} { (exit 1); exit 1; }; } ;; esac if test "$buildcpa" = yes; then BUILDCPA_TRUE= BUILDCPA_FALSE='#' else BUILDCPA_TRUE='#' BUILDCPA_FALSE= fi LDFLAGS="$LDFLAGS_cpasave" echo "$as_me:$LINENO: checking whether to build Cray's CSA support" >&5 echo $ECHO_N "checking whether to build Cray's CSA support... $ECHO_C" >&6 # Check whether --enable-csa or --disable-csa was given. if test "${enable_csa+set}" = set; then enableval="$enable_csa" CSA=$enableval else CSA=no fi; echo "$as_me:$LINENO: result: $CSA" >&5 echo "${ECHO_T}$CSA" >&6 case "$CSA" in yes) cat >>confdefs.h <<\_ACEOF #define ENABLE_CSA 1 _ACEOF MOMLIBS="$MOMLIBS -L/opt/cray/job/default/lib64 -lcsa" echo "$as_me:$LINENO: checking for job_create in -ljob" >&5 echo $ECHO_N "checking for job_create in -ljob... $ECHO_C" >&6 if test "${ac_cv_lib_job_job_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljob $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char job_create (); int main () { job_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_job_job_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_job_job_create=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_job_job_create" >&5 echo "${ECHO_T}$ac_cv_lib_job_job_create" >&6 if test $ac_cv_lib_job_job_create = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBJOB 1 _ACEOF LIBS="-ljob $LIBS" else { { echo "$as_me:$LINENO: error: --enable-csa requires job library support" >&5 echo "$as_me: error: --enable-csa requires job library support" >&2;} { (exit 1); exit 1; }; } fi ;; no) : ;; *) { { echo "$as_me:$LINENO: error: --enable-csa should be yes or no" >&5 echo "$as_me: error: --enable-csa should be yes or no" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_create (); int main () { pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6 if test $ac_cv_lib_pthread_pthread_create = yes; then MOMLIBS="$MOMLIBS -lpthread" fi case $PBS_MACH in aix4|aix5) MOMLIBS="$MOMLIBS -lodm -lcfg" ;; irix6array) MOMLIBS="$MOMLIBS -larray" ;; linux) echo "$as_me:$LINENO: checking for openpty" >&5 echo $ECHO_N "checking for openpty... $ECHO_C" >&6 if test "${ac_cv_func_openpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define openpty to an innocuous variant, in case declares openpty. For example, HP-UX 11i declares gettimeofday. */ #define openpty innocuous_openpty /* System header to define __stub macros and hopefully few prototypes, which can conflict with char openpty (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef openpty /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char openpty (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_openpty) || defined (__stub___openpty) choke me #else char (*f) () = openpty; #endif #ifdef __cplusplus } #endif int main () { return f != openpty; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_openpty=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_openpty=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_openpty" >&5 echo "${ECHO_T}$ac_cv_func_openpty" >&6 if test $ac_cv_func_openpty = yes; then : else echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6 if test "${ac_cv_lib_util_openpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char openpty (); int main () { openpty (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_util_openpty=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_openpty=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6 if test $ac_cv_lib_util_openpty = yes; then MOMLIBS="$MOMLIBS -lutil" fi fi echo "$as_me:$LINENO: checking for job_create in -ljob" >&5 echo $ECHO_N "checking for job_create in -ljob... $ECHO_C" >&6 if test "${ac_cv_lib_job_job_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljob $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char job_create (); int main () { job_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_job_job_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_job_job_create=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_job_job_create" >&5 echo "${ECHO_T}$ac_cv_lib_job_job_create" >&6 if test $ac_cv_lib_job_job_create = yes; then MOMLIBS="-L/opt/cray/job/default/lib64 -ljob $MOMLIBS" CFLAGS="$CFLAGS -DUSEJOBCREATE -I/opt/cray/job/default/include" fi ;; darwin*) cat >>confdefs.h <<\_ACEOF #define SETCONTROLLINGTTY 1 _ACEOF ;; digitalunix*) cat >>confdefs.h <<\_ACEOF #define SETCONTROLLINGTTY 1 _ACEOF ;; unicosmk*) cat >>confdefs.h <<\_ACEOF #define SETCONTROLLINGTTY 1 _ACEOF ;; esac case $PBS_MACH in aix4|aix5|sunos4|solaris5|freebsd|freebsd5|darwin|fujitsu) echo "$as_me:$LINENO: checking for nlist" >&5 echo $ECHO_N "checking for nlist... $ECHO_C" >&6 if test "${ac_cv_func_nlist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define nlist to an innocuous variant, in case declares nlist. For example, HP-UX 11i declares gettimeofday. */ #define nlist innocuous_nlist /* System header to define __stub macros and hopefully few prototypes, which can conflict with char nlist (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef nlist /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char nlist (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_nlist) || defined (__stub___nlist) choke me #else char (*f) () = nlist; #endif #ifdef __cplusplus } #endif int main () { return f != nlist; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_nlist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_nlist=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_nlist" >&5 echo "${ECHO_T}$ac_cv_func_nlist" >&6 if test $ac_cv_func_nlist = yes; then : else echo "$as_me:$LINENO: checking for nlist in -lelf" >&5 echo $ECHO_N "checking for nlist in -lelf... $ECHO_C" >&6 if test "${ac_cv_lib_elf_nlist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lelf $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char nlist (); int main () { nlist (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_elf_nlist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_elf_nlist=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_elf_nlist" >&5 echo "${ECHO_T}$ac_cv_lib_elf_nlist" >&6 if test $ac_cv_lib_elf_nlist = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBELF 1 _ACEOF LIBS="-lelf $LIBS" fi fi ;; esac case $PBS_MACH in sunos4|solaris5|netbsd|freebsd|freebsd5) echo "$as_me:$LINENO: checking for kvm_open in -lkvm" >&5 echo $ECHO_N "checking for kvm_open in -lkvm... $ECHO_C" >&6 if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkvm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char kvm_open (); int main () { kvm_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_kvm_kvm_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_kvm_kvm_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_kvm_kvm_open" >&5 echo "${ECHO_T}$ac_cv_lib_kvm_kvm_open" >&6 if test $ac_cv_lib_kvm_kvm_open = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBKVM 1 _ACEOF LIBS="-lkvm $LIBS" fi ;; esac case $PBS_MACH in sunos4|solaris5|netbsd|freebsd|freebsd5) echo "$as_me:$LINENO: checking for htons in -lresolv" >&5 echo $ECHO_N "checking for htons in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_htons+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char htons (); int main () { htons (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_htons=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_htons=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_htons" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_htons" >&6 if test $ac_cv_lib_resolv_htons = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi ;; esac MOM_CHECKPOINT=0 case "$PBS_MACH" in unicos*) MOM_CHECKPOINT=1 ;; irix6*) echo "$as_me:$LINENO: checking for atcheckpoint in -lcpr" >&5 echo $ECHO_N "checking for atcheckpoint in -lcpr... $ECHO_C" >&6 if test "${ac_cv_lib_cpr_atcheckpoint+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcpr $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char atcheckpoint (); int main () { atcheckpoint (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cpr_atcheckpoint=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cpr_atcheckpoint=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_cpr_atcheckpoint" >&5 echo "${ECHO_T}$ac_cv_lib_cpr_atcheckpoint" >&6 if test $ac_cv_lib_cpr_atcheckpoint = yes; then MOM_CHECKPOINT=1 fi if test "$MOM_CHECKPOINT" = 1 ; then MOMLIBS="$MOMLIBS -lcpr" # # if we are using plain cc then under irix6array # make it cc -64 unless the user has explicitly asked for cc # if test "$CC" = cc -a "x$user_choosed_cc_set" != xset ; then { echo "$as_me:$LINENO: WARNING: Automatically setting CC='cc -64' under irix6." >&5 echo "$as_me: WARNING: Automatically setting CC='cc -64' under irix6." >&2;} CC='cc -64' fi fi ;; linux) if test "$BLCR" = "yes" ;then MOM_CHECKPOINT=1;fi ;; esac cat >>confdefs.h <<_ACEOF #define MOM_CHECKPOINT ${MOM_CHECKPOINT} _ACEOF case "$build" in *-*-solaris*) cat >>confdefs.h <<\_ACEOF #define PUSH_STREAM 1 _ACEOF ;; *) ;; esac # Check whether --with-sched or --without-sched was given. if test "${with_sched+set}" = set; then withval="$with_sched" case "${withval}" in c*|C*) SCHD_TYPE=cc ;; tcl|Tcl) SCHD_TYPE=tcl ;; basl|BASL) SCHD_TYPE=basl ;; *) SCHD_TYPE=none ;; esac else SCHD_TYPE=cc fi; if test "x$build_server" != "xyes" ;then SCHD_TYPE=none fi cat >>confdefs.h <<_ACEOF #define SCHD_TYPE "${SCHD_TYPE}" _ACEOF SCHD_TYPE_SUBDIR="" if test "$SCHD_TYPE" != none; then SCHD_TYPE_SUBDIR=scheduler.$SCHD_TYPE fi if test "x$SCHD_TYPE" = "xbasl"; then SCHD_BASL_TRUE= SCHD_BASL_FALSE='#' else SCHD_BASL_TRUE='#' SCHD_BASL_FALSE= fi if test "$SCHD_TYPE" = basl ;then echo "$as_me:$LINENO: checking for sqrt" >&5 echo $ECHO_N "checking for sqrt... $ECHO_C" >&6 if test "${ac_cv_func_sqrt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sqrt to an innocuous variant, in case declares sqrt. For example, HP-UX 11i declares gettimeofday. */ #define sqrt innocuous_sqrt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sqrt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sqrt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sqrt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sqrt) || defined (__stub___sqrt) choke me #else char (*f) () = sqrt; #endif #ifdef __cplusplus } #endif int main () { return f != sqrt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sqrt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sqrt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sqrt" >&5 echo "${ECHO_T}$ac_cv_func_sqrt" >&6 if test $ac_cv_func_sqrt = yes; then : else echo "$as_me:$LINENO: checking for sqrt in -lm" >&5 echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sqrt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sqrt (); int main () { sqrt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sqrt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_sqrt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5 echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6 if test $ac_cv_lib_m_sqrt = yes; then SCHD_LIBS="$SCHD_LIBS -lm" fi fi fi # Check whether --with-sched_code or --without-sched_code was given. if test "${with_sched_code+set}" = set; then withval="$with_sched_code" if test "${SCHD_TYPE}" = "cc" -o "${SCHD_TYPE}" = "basl"; then SCHD_CODE="${withval}" else { { echo "$as_me:$LINENO: error: --with-sched-code was used but sched-type was not \"c\" or \"basl\"." >&5 echo "$as_me: error: --with-sched-code was used but sched-type was not \"c\" or \"basl\"." >&2;} { (exit 1); exit 1; }; } fi else SCHD_CODE=none fi; if test "$SCHD_CODE" = none -a "$SCHD_TYPE" = cc; then SCHD_CODE=fifo fi if test "$SCHD_TYPE" = cc -o "$SCHD_TYPE" = basl; then if test "$SCHD_CODE" = none; then { { echo "$as_me:$LINENO: error: Must specify --with-sched-code for C and BASL schedulers." >&5 echo "$as_me: error: Must specify --with-sched-code for C and BASL schedulers." >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: Checking global settings..." >&5 echo "$as_me: Checking global settings..." >&6;} # Check whether --enable-rpp or --disable-rpp was given. if test "${enable_rpp+set}" = set; then enableval="$enable_rpp" case "${enableval}" in yes) RPP=1 ;; no) RPP=0 ;; *) { { echo "$as_me:$LINENO: error: --enable-rpp cannot take a value" >&5 echo "$as_me: error: --enable-rpp cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac else RPP=1 fi; cat >>confdefs.h <<_ACEOF #define RPP ${RPP} _ACEOF if test "$RPP" = "1"; then USING_RPP_TRUE= USING_RPP_FALSE='#' else USING_RPP_TRUE='#' USING_RPP_FALSE= fi # Check whether --enable-filesync or --disable-filesync was given. if test "${enable_filesync+set}" = set; then enableval="$enable_filesync" case "${enableval}" in yes) TDISABLEFILESYNC=0; { echo "$as_me:$LINENO: WARNING: --enable-filesync does not actually make for safer writes." >&5 echo "$as_me: WARNING: --enable-filesync does not actually make for safer writes." >&2;} ;; no) TDISABLEFILESYNC=1 ;; *) { { echo "$as_me:$LINENO: error: --enable-filesync cannot take a value" >&5 echo "$as_me: error: --enable-filesync cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac else TDISABLEFILESYNC=1 fi; cat >>confdefs.h <<_ACEOF #define TDISABLEFILESYNC ${TDISABLEFILESYNC} _ACEOF # Check whether --enable-plock_daemons or --disable-plock_daemons was given. if test "${enable_plock_daemons+set}" = set; then enableval="$enable_plock_daemons" case "${enableval}" in yes) PLOCK_DAEMONS=7 ;; no) PLOCK_DAEMONS=0 ;; *) PLOCK_DAEMONS="${enableval}" ;; esac else PLOCK_DAEMONS=0 fi; cat >>confdefs.h <<_ACEOF #define PLOCK_DAEMONS ${PLOCK_DAEMONS} _ACEOF # Check whether --enable-syslog or --disable-syslog was given. if test "${enable_syslog+set}" = set; then enableval="$enable_syslog" case "${enableval}" in yes) SYSLOG=1 ; RPM_AC_OPTS="$RPM_AC_OPTS --with syslog" ;; no) SYSLOG=0 ; RPM_AC_OPTS="$RPM_AC_OPTS --without syslog" ;; *) { { echo "$as_me:$LINENO: error: --enable-syslog cannot take a value." >&5 echo "$as_me: error: --enable-syslog cannot take a value." >&2;} { (exit 1); exit 1; }; } ;; esac else SYSLOG=1 ; RPM_AC_OPTS="$RPM_AC_OPTS --with syslog" fi; cat >>confdefs.h <<_ACEOF #define SYSLOG ${SYSLOG} _ACEOF if test "$SYSLOG" = "1"; then USING_SYSLOG_TRUE= USING_SYSLOG_FALSE='#' else USING_SYSLOG_TRUE='#' USING_SYSLOG_FALSE= fi # Check whether --enable-shell_pipe or --disable-shell_pipe was given. if test "${enable_shell_pipe+set}" = set; then enableval="$enable_shell_pipe" case "${enableval}" in yes) SHELL_INVOKE=1 ;; no) SHELL_INVOKE=0 ;; *) SHELL_INVOKE=0 ;; esac else SHELL_INVOKE=1 fi; cat >>confdefs.h <<_ACEOF #define SHELL_INVOKE ${SHELL_INVOKE} _ACEOF # Check whether --with-maildomain or --without-maildomain was given. if test "${with_maildomain+set}" = set; then withval="$with_maildomain" MAILDOMAIN="${withval}" { echo "$as_me:$LINENO: WARNING: --with-maildomain is depricated. Set mail_domain in qmgr." >&5 echo "$as_me: WARNING: --with-maildomain is depricated. Set mail_domain in qmgr." >&2;} cat >>confdefs.h <<_ACEOF #define TMAILDOMAIN "${MAILDOMAIN}" _ACEOF fi; # Check whether --enable-spool or --disable-spool was given. if test "${enable_spool+set}" = set; then enableval="$enable_spool" case "${enableval}" in yes) NO_SPOOL_OUTPUT=0 ;; no) NO_SPOOL_OUTPUT=1 ;; *) { { echo "$as_me:$LINENO: error: --enable-spool cannot take a value" >&5 echo "$as_me: error: --enable-spool cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac else NO_SPOOL_OUTPUT=0 fi; cat >>confdefs.h <<_ACEOF #define NO_SPOOL_OUTPUT ${NO_SPOOL_OUTPUT} _ACEOF # Check whether --enable-shell-use-argv or --disable-shell-use-argv was given. if test "${enable_shell_use_argv+set}" = set; then enableval="$enable_shell_use_argv" case "${enableval}" in yes) SHELL_USE_ARGV=1 ;; no) SHELL_USE_ARGV=0 ;; *) { { echo "$as_me:$LINENO: error: --enable-shell-use-argv cannot take a value" >&5 echo "$as_me: error: --enable-shell-use-argv cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac else SHELL_USE_ARGV=0 fi; cat >>confdefs.h <<_ACEOF #define SHELL_USE_ARGV ${SHELL_USE_ARGV} _ACEOF # Check whether --enable-posixmemlock or --disable-posixmemlock was given. if test "${enable_posixmemlock+set}" = set; then enableval="$enable_posixmemlock" case "${enableval}" in yes) ;; no) NOPOSIXMEMLOCK=1; cat >>confdefs.h <<\_ACEOF #define NOPOSIXMEMLOCK 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: --enable-posixmemlock cannot take a value" >&5 echo "$as_me: error: --enable-posixmemlock cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac fi; # Check whether --enable-privports or --disable-privports was given. if test "${enable_privports+set}" = set; then enableval="$enable_privports" case "${enableval}" in yes) ;; no) NOPRIVPORTS=1; cat >>confdefs.h <<\_ACEOF #define NOPRIVPORTS 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: --enable-privports cannot take a value" >&5 echo "$as_me: error: --enable-privports cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac fi; # Check whether --enable-mom-checkspool or --disable-mom-checkspool was given. if test "${enable_mom_checkspool+set}" = set; then enableval="$enable_mom_checkspool" case "${enableval}" in yes) MOMCHECKLOCALSPOOL=1 ;; no) MOMCHECKLOCALSPOOL=0;; *) { { echo "$as_me:$LINENO: error: --enable-mom-checkspool cannot take a value" >&5 echo "$as_me: error: --enable-mom-checkspool cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac else MOMCHECKLOCALSPOOL=1 fi; cat >>confdefs.h <<_ACEOF #define MOMCHECKLOCALSPOOL ${MOMCHECKLOCALSPOOL} _ACEOF # Check whether --with-tmpdir or --without-tmpdir was given. if test "${with_tmpdir+set}" = set; then withval="$with_tmpdir" TMP_DIR="${withval}" else TMP_DIR="/tmp" fi; test "$TMP_DIR" = yes && TMP_DIR="/tmp" cat >>confdefs.h <<_ACEOF #define TMP_DIR "${TMP_DIR}" _ACEOF # Check whether --enable-force-nodefile or --disable-force-nodefile was given. if test "${enable_force_nodefile+set}" = set; then enableval="$enable_force_nodefile" case "${enableval}" in yes) MOM_FORCENODEFILE=1 ;; no) MOM_FORCENODEFILE=0 ;; *) { { echo "$as_me:$LINENO: error: --enable-force-nodefile cannot take a value" >&5 echo "$as_me: error: --enable-force-nodefile cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac else MOM_FORCENODEFILE=0 fi; cat >>confdefs.h <<_ACEOF #define MOM_FORCENODEFILE ${MOM_FORCENODEFILE} _ACEOF echo "$as_me:$LINENO: checking for CMSG_SPACE" >&5 echo $ECHO_N "checking for CMSG_SPACE... $ECHO_C" >&6 torque_cv_have_cmsg="no" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SYS_UCRED_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UN_H #include #endif #include int main () { exit(CMSG_SPACE(sizeof(struct ucred))); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then torque_cv_have_cmsg="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $torque_cv_have_cmsg" >&5 echo "${ECHO_T}$torque_cv_have_cmsg" >&6 echo "$as_me:$LINENO: checking if enabling Unix Domain socket supprt" >&5 echo $ECHO_N "checking if enabling Unix Domain socket supprt... $ECHO_C" >&6 ENABLE_UNIX_SOCKETS=$torque_cv_have_cmsg # Check whether --enable-unixsockets or --disable-unixsockets was given. if test "${enable_unixsockets+set}" = set; then enableval="$enable_unixsockets" case "${enableval}" in yes) ENABLE_UNIX_SOCKETS=yes ;; no) ENABLE_UNIX_SOCKETS=no;; *) { { echo "$as_me:$LINENO: error: --enable-unixsockets cannot take a value" >&5 echo "$as_me: error: --enable-unixsockets cannot take a value" >&2;} { (exit 1); exit 1; }; } ;; esac fi; if test "x$ENABLE_UNIX_SOCKETS" = "xyes" ;then cat >>confdefs.h <<\_ACEOF #define ENABLE_UNIX_SOCKETS 1 _ACEOF fi echo "$as_me:$LINENO: result: $ENABLE_UNIX_SOCKETS" >&5 echo "${ECHO_T}$ENABLE_UNIX_SOCKETS" >&6 # Check whether --with-server_home or --without-server_home was given. if test "${with_server_home+set}" = set; then withval="$with_server_home" PBS_SERVER_HOME="${withval}" ; RPM_AC_OPTS="$RPM_AC_OPTS --define \"torque_home ${withval}\"" else PBS_SERVER_HOME="/var/spool/torque" fi; # Check whether --with-server_name_file or --without-server_name_file was given. if test "${with_server_name_file+set}" = set; then withval="$with_server_name_file" pbs_default_file="${withval}" else pbs_default_file="server_name" fi; case "${pbs_default_file}" in /*) PBS_DEFAULT_FILE="${pbs_default_file}" ;; *) PBS_DEFAULT_FILE="\${PBS_SERVER_HOME}/${pbs_default_file}" ;; esac # Check whether --with-default_server or --without-default_server was given. if test "${with_default_server+set}" = set; then withval="$with_default_server" PBS_DEFAULT_SERVER="${withval}" ; RPM_AC_OPTS="$RPM_AC_OPTS --define \"torque_server ${withval}\"" else PBS_DEFAULT_SERVER="`uname -n`" fi; cat >>confdefs.h <<_ACEOF #define PBS_DEFAULT_SERVER "${PBS_DEFAULT_SERVER}" _ACEOF # Check whether --with-environ or --without-environ was given. if test "${with_environ+set}" = set; then withval="$with_environ" pbs_environ="${withval}" else pbs_environ="no" fi; case "${pbs_environ}" in yes) { { echo "$as_me:$LINENO: error: --with-environ must be given a path" >&5 echo "$as_me: error: --with-environ must be given a path" >&2;} { (exit 1); exit 1; }; } ;; no) PBS_ENVIRON="\${PBS_SERVER_HOME}/pbs_environment" ;; /*) PBS_ENVIRON="${pbs_environ}" ;; *) PBS_ENVIRON="\${PBS_SERVER_HOME}/${pbs_environ}" ;; esac # Check whether --with-qstatrc-file or --without-qstatrc-file was given. if test "${with_qstatrc_file+set}" = set; then withval="$with_qstatrc_file" case "${withval}" in /*) QSTATRC_PATH="${withval}" ;; *) QSTATRC_PATH="${PBS_SERVER_HOME}/${withval}" ;; esac else QSTATRC_PATH="${PBS_SERVER_HOME}/qstatrc" fi; cat >>confdefs.h <<_ACEOF #define QSTATRC_PATH "${QSTATRC_PATH}" _ACEOF # Check whether --with-momlogdir or --without-momlogdir was given. if test "${with_momlogdir+set}" = set; then withval="$with_momlogdir" cat >>confdefs.h <<_ACEOF #define DEFAULT_MOMLOGDIR "$with_momlogdir" _ACEOF fi; # Check whether --with-momlogsuffix or --without-momlogsuffix was given. if test "${with_momlogsuffix+set}" = set; then withval="$with_momlogsuffix" cat >>confdefs.h <<_ACEOF #define DEFAULT_MOMLOGSUFFIX "$with_momlogsuffix" _ACEOF fi; # Check whether --with-scp or --without-scp was given. if test "${with_scp+set}" = set; then withval="$with_scp" { echo "$as_me:$LINENO: WARNING: --with-scp is deprecated, use --with-rcp=scp" >&5 echo "$as_me: WARNING: --with-scp is deprecated, use --with-rcp=scp" >&2;} # Extract the first word of ""scp"", so it can be a program name with args. set dummy "scp"; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RCP_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RCP_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_RCP_PATH="$RCP_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RCP_PATH="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_RCP_PATH" && ac_cv_path_RCP_PATH=""error"" ;; esac fi RCP_PATH=$ac_cv_path_RCP_PATH if test -n "$RCP_PATH"; then echo "$as_me:$LINENO: result: $RCP_PATH" >&5 echo "${ECHO_T}$RCP_PATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi case "${RCP_PATH}" in error) { { echo "$as_me:$LINENO: error: --with-scp scp not found in path" >&5 echo "$as_me: error: --with-scp scp not found in path" >&2;} { (exit 1); exit 1; }; } ;; *) RCP_PATH="${RCP_PATH}" ;; esac fi; # Check whether --with-rcp or --without-rcp was given. if test "${with_rcp+set}" = set; then withval="$with_rcp" case "$with_rcp" in yes|no) { { echo "$as_me:$LINENO: error: --with-rcp takes an argument" >&5 echo "$as_me: error: --with-rcp takes an argument" >&2;} { (exit 1); exit 1; }; } ;; *) RCP_PATH="$with_rcp" ;; esac fi; # if noone requested an rcp prog, use scp if found, or use mom_rcp if test "x$RCP_PATH" = "x" ;then # Extract the first word of "scp", so it can be a program name with args. set dummy scp; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RCP_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RCP_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_RCP_PATH="$RCP_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RCP_PATH="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_RCP_PATH" && ac_cv_path_RCP_PATH="error" ;; esac fi RCP_PATH=$ac_cv_path_RCP_PATH if test -n "$RCP_PATH"; then echo "$as_me:$LINENO: result: $RCP_PATH" >&5 echo "${ECHO_T}$RCP_PATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$RCP_PATH" = "xerror" ;then RCP_PATH=mom_rcp RPM_AC_OPTS="$RPM_AC_OPTS --without scp" else RPM_AC_OPTS="$RPM_AC_OPTS --with scp" fi fi # figure out what was requested and turn that into a full path if necessary build_pbs_rcp=no case "$RCP_PATH" in mom_rcp|pbs_rcp) RCP_PATH="${sbindir}/pbs_rcp"; build_pbs_rcp=yes ;; /*) ;; *) # Extract the first word of ""$RCP_PATH"", so it can be a program name with args. set dummy "$RCP_PATH"; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RCP_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RCP_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_RCP_PATH="$RCP_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RCP_PATH="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_RCP_PATH" && ac_cv_path_RCP_PATH="error" ;; esac fi RCP_PATH=$ac_cv_path_RCP_PATH if test -n "$RCP_PATH"; then echo "$as_me:$LINENO: result: $RCP_PATH" >&5 echo "${ECHO_T}$RCP_PATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$RCP_PATH" = "xerror" ;then { { echo "$as_me:$LINENO: error: requested copy program not found in path" >&5 echo "$as_me: error: requested copy program not found in path" >&2;} { (exit 1); exit 1; }; } fi ;; esac # figure out the required args if test "x$RCP_ARGS" = "x" ;then case "$RCP_PATH" in *rcp) RCP_ARGS="-rp"; RSH_PATH=rsh ;; *scp) RCP_ARGS="-rpB"; RSH_PATH=ssh ;; *) RCP_ARGS="-rp"; RSH_PATH=rsh; { echo "$as_me:$LINENO: WARNING: not using rcp or scp, assuming -r" >&5 echo "$as_me: WARNING: not using rcp or scp, assuming -r" >&2;} ;; esac fi { echo "$as_me:$LINENO: remote file copy program... $RCP_PATH $RCP_ARGS" >&5 echo "$as_me: remote file copy program... $RCP_PATH $RCP_ARGS" >&6;} if test "x$build_pbs_rcp" = "xyes"; then INCLUDE_MOM_RCP_TRUE= INCLUDE_MOM_RCP_FALSE='#' else INCLUDE_MOM_RCP_TRUE='#' INCLUDE_MOM_RCP_FALSE= fi # Check whether --with-sendmail or --without-sendmail was given. if test "${with_sendmail+set}" = set; then withval="$with_sendmail" SENDMAIL_CMD=$withval else sendmail_maybe_in="/usr/lib:/usr/sbin:/usr/bin:/etc:/usr/etc:$PATH" for ac_prog in sendmail do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SENDMAIL_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SENDMAIL_CMD in [\\/]* | ?:[\\/]*) ac_cv_path_SENDMAIL_CMD="$SENDMAIL_CMD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in ${sendmail_maybe_in} do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SENDMAIL_CMD="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi SENDMAIL_CMD=$ac_cv_path_SENDMAIL_CMD if test -n "$SENDMAIL_CMD"; then echo "$as_me:$LINENO: result: $SENDMAIL_CMD" >&5 echo "${ECHO_T}$SENDMAIL_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$SENDMAIL_CMD" && break done test -n "$SENDMAIL_CMD" || SENDMAIL_CMD="sendmail" fi; case "${SENDMAIL_CMD}" in /*) ;; *) { echo "$as_me:$LINENO: WARNING: emails might not be sent unless ${SENDMAIL_CMD} is found at run-time" >&5 echo "$as_me: WARNING: emails might not be sent unless ${SENDMAIL_CMD} is found at run-time" >&2;} ;; esac cat >>confdefs.h <<_ACEOF #define SENDMAIL_CMD "${SENDMAIL_CMD}" _ACEOF echo "$as_me:$LINENO: checking for PAM install directory" >&5 echo $ECHO_N "checking for PAM install directory... $ECHO_C" >&6 pammoddir=disabled # Check whether --with-pam or --without-pam was given. if test "${with_pam+set}" = set; then withval="$with_pam" pammoddir=$withval fi; case "$pammoddir" in disabled) ;; no) pammoddir=disabled ;; yes) case "${PBS_MACH}" in linux) pammoddir=/lib$libsuff/security;; *) { { echo "$as_me:$LINENO: error: --with-pam takes a full path to a directory" >&5 echo "$as_me: error: --with-pam takes a full path to a directory" >&2;} { (exit 1); exit 1; }; };; esac ;; /*) ;; *) { { echo "$as_me:$LINENO: error: --with-pam takes a full path to a directory $pammoddir" >&5 echo "$as_me: error: --with-pam takes a full path to a directory $pammoddir" >&2;} { (exit 1); exit 1; }; };; esac if test "x$pammoddir" = "xdisabled" ; then RPM_AC_OPTS="$RPM_AC_OPTS --without pam" else RPM_AC_OPTS="$RPM_AC_OPTS --with pam" fi echo "$as_me:$LINENO: result: $pammoddir" >&5 echo "${ECHO_T}$pammoddir" >&6 if test "x$pammoddir" != "xdisabled"; then INCLUDE_PAM_TRUE= INCLUDE_PAM_FALSE='#' else INCLUDE_PAM_TRUE='#' INCLUDE_PAM_FALSE= fi # Check whether --with-xauth or --without-xauth was given. if test "${with_xauth+set}" = set; then withval="$with_xauth" if test "x$withval" != "xno" ; then xauth_path=$withval fi else TestPath="$PATH" TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" # Extract the first word of "xauth", so it can be a program name with args. set dummy xauth; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_xauth_path+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $xauth_path in [\\/]* | ?:[\\/]*) ac_cv_path_xauth_path="$xauth_path" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $TestPath do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_xauth_path="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi xauth_path=$ac_cv_path_xauth_path if test -n "$xauth_path"; then echo "$as_me:$LINENO: result: $xauth_path" >&5 echo "${ECHO_T}$xauth_path" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then xauth_path="/usr/openwin/bin/xauth" fi fi; if test -z "$xauth_path" ; then xauth_path="/usr/X11R6/bin/xauth" fi cat >>confdefs.h <<_ACEOF #define XAUTH_PATH "${xauth_path}" _ACEOF # Check whether --with-readline or --without-readline was given. if test "${with_readline+set}" = set; then withval="$with_readline" HAVE_READLINE="${withval}" else HAVE_READLINE="default" fi; case "$HAVE_READLINE" in yes|no) ;; default) case $PBS_MACH in aix5|darwin) HAVE_READLINE="no";; *) HAVE_READLINE="yes";; esac ;; *) { { echo "$as_me:$LINENO: error: --with-readline only takes \"yes\" or \"no\" as arguments" >&5 echo "$as_me: error: --with-readline only takes \"yes\" or \"no\" as arguments" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$as_me:$LINENO: checking whether to install modulefiles" >&5 echo $ECHO_N "checking whether to install modulefiles... $ECHO_C" >&6 # Check whether --with-modulefiles or --without-modulefiles was given. if test "${with_modulefiles+set}" = set; then withval="$with_modulefiles" else with_modulefiles="no" fi; if test "$with_modulefiles" != 'no'; then if test "$with_modulefiles" = 'yes'; then MODULEFILES_DIR="/etc/modulefiles" else MODULEFILES_DIR="$with_modulefiles" fi else MODULEFILES_DIR=no fi if test "x$MODULEFILES_DIR" != "xno"; then INSTALL_MODULEFILES_TRUE= INSTALL_MODULEFILES_FALSE='#' else INSTALL_MODULEFILES_TRUE='#' INSTALL_MODULEFILES_FALSE= fi echo "$as_me:$LINENO: result: $MODULEFILES_DIR" >&5 echo "${ECHO_T}$MODULEFILES_DIR" >&6 echo "$as_me:$LINENO: checking for xdr_int" >&5 echo $ECHO_N "checking for xdr_int... $ECHO_C" >&6 if test "${ac_cv_func_xdr_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define xdr_int to an innocuous variant, in case declares xdr_int. For example, HP-UX 11i declares gettimeofday. */ #define xdr_int innocuous_xdr_int /* System header to define __stub macros and hopefully few prototypes, which can conflict with char xdr_int (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef xdr_int /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char xdr_int (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_xdr_int) || defined (__stub___xdr_int) choke me #else char (*f) () = xdr_int; #endif #ifdef __cplusplus } #endif int main () { return f != xdr_int; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_xdr_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_xdr_int=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_xdr_int" >&5 echo "${ECHO_T}$ac_cv_func_xdr_int" >&6 if test $ac_cv_func_xdr_int = yes; then : else echo "$as_me:$LINENO: checking for xdr_int in -lnsl" >&5 echo $ECHO_N "checking for xdr_int in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_xdr_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char xdr_int (); int main () { xdr_int (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_xdr_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_xdr_int=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_xdr_int" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_xdr_int" >&6 if test $ac_cv_lib_nsl_xdr_int = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi fi echo "$as_me:$LINENO: checking for ruserok" >&5 echo $ECHO_N "checking for ruserok... $ECHO_C" >&6 if test "${ac_cv_func_ruserok+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define ruserok to an innocuous variant, in case declares ruserok. For example, HP-UX 11i declares gettimeofday. */ #define ruserok innocuous_ruserok /* System header to define __stub macros and hopefully few prototypes, which can conflict with char ruserok (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef ruserok /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ruserok (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_ruserok) || defined (__stub___ruserok) choke me #else char (*f) () = ruserok; #endif #ifdef __cplusplus } #endif int main () { return f != ruserok; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_ruserok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_ruserok=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_ruserok" >&5 echo "${ECHO_T}$ac_cv_func_ruserok" >&6 if test $ac_cv_func_ruserok = yes; then : else echo "$as_me:$LINENO: checking for ruserok in -lsocket" >&5 echo $ECHO_N "checking for ruserok in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_ruserok+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ruserok (); int main () { ruserok (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_ruserok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_ruserok=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_ruserok" >&5 echo "${ECHO_T}$ac_cv_lib_socket_ruserok" >&6 if test $ac_cv_lib_socket_ruserok = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi fi echo "$as_me:$LINENO: checking for hstrerror" >&5 echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6 if test "${ac_cv_func_hstrerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define hstrerror to an innocuous variant, in case declares hstrerror. For example, HP-UX 11i declares gettimeofday. */ #define hstrerror innocuous_hstrerror /* System header to define __stub macros and hopefully few prototypes, which can conflict with char hstrerror (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef hstrerror /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char hstrerror (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_hstrerror) || defined (__stub___hstrerror) choke me #else char (*f) () = hstrerror; #endif #ifdef __cplusplus } #endif int main () { return f != hstrerror; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_hstrerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_hstrerror=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_hstrerror" >&5 echo "${ECHO_T}$ac_cv_func_hstrerror" >&6 if test $ac_cv_func_hstrerror = yes; then : else echo "$as_me:$LINENO: checking for hstrerror in -lresolv" >&5 echo $ECHO_N "checking for hstrerror in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_hstrerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char hstrerror (); int main () { hstrerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_hstrerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_hstrerror=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_hstrerror" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_hstrerror" >&6 if test $ac_cv_lib_resolv_hstrerror = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi fi if test "$HAVE_READLINE" = "yes" ; then echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6 if test "${ac_cv_lib_ncurses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ncurses_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses_initscr=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6 if test $ac_cv_lib_ncurses_initscr = yes; then READLINE_LIBS="-lncurses" fi echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6 if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rl_callback_handler_install (); int main () { rl_callback_handler_install (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_readline_rl_callback_handler_install=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_callback_handler_install=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6 if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then READLINE_LIBS="$READLINE_LIBS -lreadline" else HAVE_READLINE="no" fi fi if test "$ac_cv_header_readline_readline_h" = "no" ; then HAVE_READLINE="no" fi if test "$HAVE_READLINE" = "yes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_READLINE 1 _ACEOF else { echo "$as_me:$LINENO: WARNING: readline support is disabled" >&5 echo "$as_me: WARNING: readline support is disabled" >&2;} fi echo "$as_me:$LINENO: checking for h_errno declaration in netdb.h" >&5 echo $ECHO_N "checking for h_errno declaration in netdb.h... $ECHO_C" >&6 if test "${ac_cv_decl_h_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_UNISTD_H #include #endif #include int main () { int _ZzQ = (int)(h_errno + 1); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_h_errno=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_h_errno=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_decl_h_errno" >&5 echo "${ECHO_T}$ac_cv_decl_h_errno" >&6 if test $ac_cv_decl_h_errno = yes; then cat >>confdefs.h <<\_ACEOF #define H_ERRNO_DECLARED 1 _ACEOF fi echo "$as_me:$LINENO: checking for FD_SET declaration in sys/select.h" >&5 echo $ECHO_N "checking for FD_SET declaration in sys/select.h... $ECHO_C" >&6 if test "${ac_cv_decl_fdset_sys_select_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef FD_SETSIZE oh_yeah #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "oh_yeah" >/dev/null 2>&1; then ac_cv_decl_fdset_sys_select_h=yes else ac_cv_decl_fdset_sys_select_h=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_decl_fdset_sys_select_h" >&5 echo "${ECHO_T}$ac_cv_decl_fdset_sys_select_h" >&6 if test $ac_cv_decl_fdset_sys_select_h = yes; then cat >>confdefs.h <<\_ACEOF #define FD_SET_IN_SYS_SELECT_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6 if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((int *) 0) return 0; if (sizeof (int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6 echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6 if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (int)); } unsigned long ulongval () { return (long) (sizeof (int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (int))) < 0) { long i = longval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long *) 0) return 0; if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6 echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long))) < 0) { long i = longval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF echo "$as_me:$LINENO: checking for float" >&5 echo $ECHO_N "checking for float... $ECHO_C" >&6 if test "${ac_cv_type_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((float *) 0) return 0; if (sizeof (float)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_float=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_float=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 echo "${ECHO_T}$ac_cv_type_float" >&6 echo "$as_me:$LINENO: checking size of float" >&5 echo $ECHO_N "checking size of float... $ECHO_C" >&6 if test "${ac_cv_sizeof_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_float" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (float))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (float))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (float))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (float), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (float)); } unsigned long ulongval () { return (long) (sizeof (float)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (float))) < 0) { long i = longval (); if (i != ((long) (sizeof (float)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (float)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (float), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_float=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 echo "${ECHO_T}$ac_cv_sizeof_float" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_FLOAT $ac_cv_sizeof_float _ACEOF echo "$as_me:$LINENO: checking for double" >&5 echo $ECHO_N "checking for double... $ECHO_C" >&6 if test "${ac_cv_type_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((double *) 0) return 0; if (sizeof (double)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_double=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 echo "${ECHO_T}$ac_cv_type_double" >&6 echo "$as_me:$LINENO: checking size of double" >&5 echo $ECHO_N "checking size of double... $ECHO_C" >&6 if test "${ac_cv_sizeof_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_double" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (double))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (double))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (double))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (double), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (double)); } unsigned long ulongval () { return (long) (sizeof (double)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (double))) < 0) { long i = longval (); if (i != ((long) (sizeof (double)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (double)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (double), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_double=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 echo "${ECHO_T}$ac_cv_sizeof_double" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_DOUBLE $ac_cv_sizeof_double _ACEOF echo "$as_me:$LINENO: checking for long double" >&5 echo $ECHO_N "checking for long double... $ECHO_C" >&6 if test "${ac_cv_type_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long double *) 0) return 0; if (sizeof (long double)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_double=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 echo "${ECHO_T}$ac_cv_type_long_double" >&6 echo "$as_me:$LINENO: checking size of long double" >&5 echo $ECHO_N "checking size of long double... $ECHO_C" >&6 if test "${ac_cv_sizeof_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long_double" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long double))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long double))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long double))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long double), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long double)); } unsigned long ulongval () { return (long) (sizeof (long double)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long double))) < 0) { long i = longval (); if (i != ((long) (sizeof (long double)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long double)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long double), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long_double=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double _ACEOF echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6 if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((short *) 0) return 0; if (sizeof (short)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6 echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6 if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_short" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (short)); } unsigned long ulongval () { return (long) (sizeof (short)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (short))) < 0) { long i = longval (); if (i != ((long) (sizeof (short)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (short)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_short=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF echo "$as_me:$LINENO: checking for unsigned" >&5 echo $ECHO_N "checking for unsigned... $ECHO_C" >&6 if test "${ac_cv_type_unsigned+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned *) 0) return 0; if (sizeof (unsigned)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned" >&5 echo "${ECHO_T}$ac_cv_type_unsigned" >&6 echo "$as_me:$LINENO: checking size of unsigned" >&5 echo $ECHO_N "checking size of unsigned... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned)); } unsigned long ulongval () { return (long) (sizeof (unsigned)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED $ac_cv_sizeof_unsigned _ACEOF echo "$as_me:$LINENO: checking for unsigned int" >&5 echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned int *) 0) return 0; if (sizeof (unsigned int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6 echo "$as_me:$LINENO: checking size of unsigned int" >&5 echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned int)); } unsigned long ulongval () { return (long) (sizeof (unsigned int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned int))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int _ACEOF echo "$as_me:$LINENO: checking for unsigned short" >&5 echo $ECHO_N "checking for unsigned short... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned short *) 0) return 0; if (sizeof (unsigned short)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_short=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_short" >&6 echo "$as_me:$LINENO: checking size of unsigned short" >&5 echo $ECHO_N "checking size of unsigned short... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_short" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_short=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned short)); } unsigned long ulongval () { return (long) (sizeof (unsigned short)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned short))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned short)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned short)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_short=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_short" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short _ACEOF echo "$as_me:$LINENO: checking for unsigned char" >&5 echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned char *) 0) return 0; if (sizeof (unsigned char)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_char=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_char" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_char" >&6 echo "$as_me:$LINENO: checking size of unsigned char" >&5 echo $ECHO_N "checking size of unsigned char... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_char" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_char=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned char)); } unsigned long ulongval () { return (long) (sizeof (unsigned char)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned char))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned char)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned char)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_char=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_char=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_char" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char _ACEOF echo "$as_me:$LINENO: checking for unsigned long" >&5 echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned long *) 0) return 0; if (sizeof (unsigned long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6 echo "$as_me:$LINENO: checking size of unsigned long" >&5 echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned long)); } unsigned long ulongval () { return (long) (sizeof (unsigned long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned long))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF echo "$as_me:$LINENO: checking for signed char" >&5 echo $ECHO_N "checking for signed char... $ECHO_C" >&6 if test "${ac_cv_type_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((signed char *) 0) return 0; if (sizeof (signed char)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signed_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signed_char=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signed_char" >&5 echo "${ECHO_T}$ac_cv_type_signed_char" >&6 echo "$as_me:$LINENO: checking size of signed char" >&5 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6 if test "${ac_cv_sizeof_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_signed_char" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (signed char))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (signed char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (signed char))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (signed char))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (signed char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_signed_char=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (signed char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (signed char)); } unsigned long ulongval () { return (long) (sizeof (signed char)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (signed char))) < 0) { long i = longval (); if (i != ((long) (sizeof (signed char)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (signed char)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_signed_char=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (signed char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (signed char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_signed_char=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char _ACEOF echo "$as_me:$LINENO: checking whether char is unsigned" >&5 echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6 if test "${ac_cv_c_char_unsigned+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_char_unsigned=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 _ACEOF fi echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define torque_socklen_t socklen_t _ACEOF else echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6 if test "${curl_cv_socklen_t_equiv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long" socklen_t; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif extern int getpeername (int, $arg2 *, $t *); int main () { $t len; getpeername(0,0,&len); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then curl_cv_socklen_t_equiv="$t" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done done if test "x$curl_cv_socklen_t_equiv" = x; then # take a wild guess curl_cv_socklen_t_equiv="socklen_t" { echo "$as_me:$LINENO: WARNING: Cannot find a type to use in place of socklen_t, guessing socklen_t" >&5 echo "$as_me: WARNING: Cannot find a type to use in place of socklen_t, guessing socklen_t" >&2;} fi fi echo "$as_me:$LINENO: result: $curl_cv_socklen_t_equiv" >&5 echo "${ECHO_T}$curl_cv_socklen_t_equiv" >&6 cat >>confdefs.h <<_ACEOF #define torque_socklen_t $curl_cv_socklen_t_equiv _ACEOF fi echo "$as_me:$LINENO: checking for pam_get_user() calling type" >&5 echo $ECHO_N "checking for pam_get_user() calling type... $ECHO_C" >&6 tac_pam_get_user_2nd_arg=none for t in "char" "const char" ; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_SECURITY_PAM_MODULES_H #include #else #ifdef HAVE_PAM_PAM_MODULES_H #include #endif #endif extern int pam_get_user( pam_handle_t *pamh, /* PAM handle */ $t **user, /* User Name */ const char *prompt /* Prompt */ ); int main () { $t* username; pam_get_user((pam_handle_t*) 1,&username,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tac_pam_get_user_2nd_arg="$t" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done echo "$as_me:$LINENO: result: $tac_pam_get_user_2nd_arg" >&5 echo "${ECHO_T}$tac_pam_get_user_2nd_arg" >&6 cat >>confdefs.h <<_ACEOF #define pam_get_user_2nd_arg_t $tac_pam_get_user_2nd_arg _ACEOF if test "$tac_pam_get_user_2nd_arg" = "none" && test "$pammoddir" != "disabled" ;then { { echo "$as_me:$LINENO: error: Unable to compile PAM bits, missing pam-devel?" >&5 echo "$as_me: error: Unable to compile PAM bits, missing pam-devel?" >&2;} { (exit 1); exit 1; }; } fi for ac_func in seteuid setresuid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in setegid setresgid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in gettimeofday wordexp poll getaddrinfo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for bindresvport" >&5 echo $ECHO_N "checking for bindresvport... $ECHO_C" >&6 if test "${ac_cv_func_bindresvport+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define bindresvport to an innocuous variant, in case declares bindresvport. For example, HP-UX 11i declares gettimeofday. */ #define bindresvport innocuous_bindresvport /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bindresvport (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef bindresvport /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char bindresvport (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_bindresvport) || defined (__stub___bindresvport) choke me #else char (*f) () = bindresvport; #endif #ifdef __cplusplus } #endif int main () { return f != bindresvport; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_bindresvport=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_bindresvport=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_bindresvport" >&5 echo "${ECHO_T}$ac_cv_func_bindresvport" >&6 echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6 if test "${ac_cv_type_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_type_getgroups=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ #include #define NGID 256 #undef MAX #define MAX(x, y) ((x) > (y) ? (x) : (y)) int main () { gid_t gidset[NGID]; int i, n; union { gid_t gval; long lval; } val; val.lval = -1; for (i = 0; i < NGID; i++) gidset[i] = val.gval; n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, gidset); /* Exit non-zero if getgroups seems to require an array of ints. This happens when gid_t is short but getgroups modifies an array of ints. */ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_getgroups=gid_t else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_type_getgroups=int fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_type_getgroups = cross; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 echo "${ECHO_T}$ac_cv_type_getgroups" >&6 cat >>confdefs.h <<_ACEOF #define GETGROUPS_T $ac_cv_type_getgroups _ACEOF echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for getgroups" >&5 echo $ECHO_N "checking for getgroups... $ECHO_C" >&6 if test "${ac_cv_func_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define getgroups to an innocuous variant, in case declares getgroups. For example, HP-UX 11i declares gettimeofday. */ #define getgroups innocuous_getgroups /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getgroups (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef getgroups /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getgroups (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_getgroups) || defined (__stub___getgroups) choke me #else char (*f) () = getgroups; #endif #ifdef __cplusplus } #endif int main () { return f != getgroups; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getgroups=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getgroups=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_getgroups" >&5 echo "${ECHO_T}$ac_cv_func_getgroups" >&6 # If we don't yet have getgroups, see if it's in -lbsd. # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1. ac_save_LIBS=$LIBS if test $ac_cv_func_getgroups = no; then echo "$as_me:$LINENO: checking for getgroups in -lbsd" >&5 echo $ECHO_N "checking for getgroups in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getgroups (); int main () { getgroups (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_getgroups=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_getgroups=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_getgroups" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_getgroups" >&6 if test $ac_cv_lib_bsd_getgroups = yes; then GETGROUPS_LIB=-lbsd fi fi # Run the program to test the functionality of the system-supplied # getgroups function only if there is such a function. if test $ac_cv_func_getgroups = yes; then echo "$as_me:$LINENO: checking for working getgroups" >&5 echo $ECHO_N "checking for working getgroups... $ECHO_C" >&6 if test "${ac_cv_func_getgroups_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_getgroups_works=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* On Ultrix 4.3, getgroups (0, 0) always fails. */ exit (getgroups (0, 0) == -1 ? 1 : 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getgroups_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_getgroups_works=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_getgroups_works" >&5 echo "${ECHO_T}$ac_cv_func_getgroups_works" >&6 if test $ac_cv_func_getgroups_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETGROUPS 1 _ACEOF fi fi LIBS=$ac_save_LIBS for ac_func in atexit on_exit do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF { found_an_exit=yes; break; } fi done if test "$found_an_exit" != yes; then { { echo "$as_me:$LINENO: error: Must have atexit() or on_exit()" >&5 echo "$as_me: error: Must have atexit() or on_exit()" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for ntohl" >&5 echo $ECHO_N "checking for ntohl... $ECHO_C" >&6 if test "${ac_cv_func_ntohl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define ntohl to an innocuous variant, in case declares ntohl. For example, HP-UX 11i declares gettimeofday. */ #define ntohl innocuous_ntohl /* System header to define __stub macros and hopefully few prototypes, which can conflict with char ntohl (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef ntohl /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ntohl (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_ntohl) || defined (__stub___ntohl) choke me #else char (*f) () = ntohl; #endif #ifdef __cplusplus } #endif int main () { return f != ntohl; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_ntohl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_ntohl=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_ntohl" >&5 echo "${ECHO_T}$ac_cv_func_ntohl" >&6 if test $ac_cv_func_ntohl = yes; then : else echo "$as_me:$LINENO: checking for ntohl in arpa/inet.h" >&5 echo $ECHO_N "checking for ntohl in arpa/inet.h... $ECHO_C" >&6 torque_cv_ntohl_needs_arpa_inet_h="no" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif int main () { exit(ntohl(0)); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then torque_cv_ntohl_needs_arpa_inet_h="yes" cat >>confdefs.h <<_ACEOF #define NTOHL_NEEDS_ARPA_INET_H 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $torque_cv_ntohl_needs_arpa_inet_h" >&5 echo "${ECHO_T}$torque_cv_ntohl_needs_arpa_inet_h" >&6 fi echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 if test x"${PACKAGE}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix if test x$exec_prefix = xNONE ; then exec_prefix=$prefix ; fi { echo "$as_me:$LINENO: Starting Tcl/Tk configuration" >&5 echo "$as_me: Starting Tcl/Tk configuration" >&6;} TCL=0 TCLX=0 TK=0 TKX=0 if test "x${with_tcl}" != "xno" ; then if test "x${with_tcl}" = "xyes" ; then with_tcl="" user_requested_tcl=yes fi # find and load tclConfig.sh # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib$libsuff 2>/dev/null` \ $sys_lib_search_path_spec \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="none" if test x"${with_tclconfig}" != x ; then { { echo "$as_me:$LINENO: error: Cannot find TCL config" >&5 echo "$as_me: error: Cannot find TCL config" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6 fi fi if test "x$TCL_BIN_DIR" = "xnone" ; then TCL=0 else echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TCL_BIN_DIR/tclConfig.sh else echo "$as_me:$LINENO: result: file not found" >&5 echo "${ECHO_T}file not found" >&6 fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #AC_SUBST(TCL_DBGX) #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) echo "$as_me:$LINENO: checking for Tcl public headers" >&5 echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi; if test "${ac_cv_c_tclh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} { (exit 1); exit 1; }; } fi else # Check order: pkg --prefix location, Tcl's --prefix location, # directory of tclConfig.sh, and Tcl source directory. # Looking in the source dir is not ideal, but OK. eval "temp_includedir=${includedir}" list="`ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { echo "$as_me:$LINENO: WARNING: tcl.h not found. Please specify its location with --with-tclinclude" >&5 echo "$as_me: WARNING: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} else echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 echo "${ECHO_T}${ac_cv_c_tclh}" >&6 fi # Convert to a native path and substitute into the output files. if test x"${ac_cv_c_tclh}" = x ; then TCL_INCLUDES=none else INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` if test x"${INCLUDE_DIR_NATIVE}" != x/usr/include ;then TCL_INCLUDES=-I${INCLUDE_DIR_NATIVE} fi fi if test "x$TCL_INCLUDES" = "xnone" ;then TCL=0 else TCL=1 fi fi if test "x$user_requested_tcl" = "xyes" -a $TCL = 0 ;then { { echo "$as_me:$LINENO: error: Tcl was requested but not found" >&5 echo "$as_me: error: Tcl was requested but not found" >&2;} { (exit 1); exit 1; }; } fi fi if test "${TCL}" = "1" -a "x${with_tclx}" != "xno" ; then if test "x${with_tclx}" = "xyes" ; then with_tclx="" user_requested_tclx=yes fi # find and load tclxConfig.sh which only exists for older versions # # Ok, lets find the tclx configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tclx # if test x"${no_tclx}" = x ; then # we reset no_tclx in case something fails here no_tclx=true # Check whether --with-tclx or --without-tclx was given. if test "${with_tclx+set}" = set; then withval="$with_tclx" with_tclxconfig=${withval} fi; echo "$as_me:$LINENO: checking for tclx configuration" >&5 echo $ECHO_N "checking for tclx configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclxconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tclx was specified. if test x"${with_tclxconfig}" != x ; then if test -f "${with_tclxconfig}/tclxConfig.sh" ; then ac_cv_c_tclxconfig=`(cd ${with_tclxconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclxconfig} directory doesn't contain tclxConfig.sh" >&5 echo "$as_me: error: ${with_tclxconfig} directory doesn't contain tclxConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private tclx installation if test x"${ac_cv_c_tclxconfig}" = x ; then for i in \ ../tclx \ `ls -dr ../tclx[8-9].[0-9]* 2>/dev/null` \ ../../tclx \ `ls -dr ../../tclx[8-9].[0-9]* 2>/dev/null` \ ../../../tclx \ `ls -dr ../../../tclx[8-9].[0-9]* 2>/dev/null` \ ${srcdir}/../tclx \ `ls -dr ${srcdir}/../tclx[8-9].[0-9]* 2>/dev/null` \ ; do if test -f "$i/tclxConfig.sh" ; then ac_cv_c_tclxconfig=`(cd $i; pwd)` break fi if test -f "$i/unix/tclxConfig.sh" ; then ac_cv_c_tclxconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclxconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib$libsuff 2>/dev/null` \ `ls -d ${prefix}/lib$libsuff 2>/dev/null` \ `ls -d /usr/local/lib$libsuff 2>/dev/null` \ `ls -d /usr/contrib/lib$libsuff 2>/dev/null` \ `ls -d /usr/lib$libsuff 2>/dev/null` \ ; do if test -f "$i/tclxConfig.sh" ; then ac_cv_c_tclxconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_tclxconfig}" = x ; then tclx_BIN_DIR="none" if test x"${with_tclxconfig}" != x ; then { { echo "$as_me:$LINENO: error: Cannot find tclx config" >&5 echo "$as_me: error: Cannot find tclx config" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi else no_tclx= tclx_BIN_DIR=${ac_cv_c_tclxconfig} echo "$as_me:$LINENO: result: found $tclx_BIN_DIR/tclxConfig.sh" >&5 echo "${ECHO_T}found $tclx_BIN_DIR/tclxConfig.sh" >&6 fi fi if test "x$tclx_BIN_DIR" != "xnone" ; then echo "$as_me:$LINENO: checking for existence of ${tclx_BIN_DIR}/tclxConfig.sh" >&5 echo $ECHO_N "checking for existence of ${tclx_BIN_DIR}/tclxConfig.sh... $ECHO_C" >&6 if test -f "${tclx_BIN_DIR}/tclxConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . ${tclx_BIN_DIR}/tclxConfig.sh else echo "$as_me:$LINENO: result: file not found" >&5 echo "${ECHO_T}file not found" >&6 fi # # If the tclx_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable tclx_LIB_SPEC will be set to the value # of tclx_BUILD_LIB_SPEC. An extension should make use of tclx_LIB_SPEC # instead of tclx_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f ${tclx_BIN_DIR}/Makefile ; then { echo "$as_me:$LINENO: WARNING: Found Makefile - using build library specs for tclx" >&5 echo "$as_me: WARNING: Found Makefile - using build library specs for tclx" >&2;} tclx_LIB_SPEC=${tclx_BUILD_LIB_SPEC} tclx_STUB_LIB_SPEC=${tclx_BUILD_STUB_LIB_SPEC} tclx_STUB_LIB_PATH=${tclx_BUILD_STUB_LIB_PATH} fi orig_CFLAGS="$CFLAGS" CFLAGS="$TCL_INCLUDES" if test "${ac_cv_header_tclExtend_h+set}" = set; then echo "$as_me:$LINENO: checking for tclExtend.h" >&5 echo $ECHO_N "checking for tclExtend.h... $ECHO_C" >&6 if test "${ac_cv_header_tclExtend_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_tclExtend_h" >&5 echo "${ECHO_T}$ac_cv_header_tclExtend_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking tclExtend.h usability" >&5 echo $ECHO_N "checking tclExtend.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking tclExtend.h presence" >&5 echo $ECHO_N "checking tclExtend.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: tclExtend.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: tclExtend.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: tclExtend.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: tclExtend.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: tclExtend.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: tclExtend.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: tclExtend.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: tclExtend.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: tclExtend.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: tclExtend.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: tclExtend.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: tclExtend.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: tclExtend.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: tclExtend.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: tclExtend.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: tclExtend.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to torqueusers@supercluster.org ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for tclExtend.h" >&5 echo $ECHO_N "checking for tclExtend.h... $ECHO_C" >&6 if test "${ac_cv_header_tclExtend_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_tclExtend_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_tclExtend_h" >&5 echo "${ECHO_T}$ac_cv_header_tclExtend_h" >&6 fi if test $ac_cv_header_tclExtend_h = yes; then TCLX=1 else TCLX=0 fi CFLAGS="$orig_CFLAGS" else TCLX=0 fi if test "x$user_requested_tclx" = "xyes" -a $TCLX = 0 ;then { { echo "$as_me:$LINENO: error: TclX was requested but not found" >&5 echo "$as_me: error: TclX was requested but not found" >&2;} { (exit 1); exit 1; }; } fi fi if test "${TCL}" = "1" -a "x${with_tk}" != "xno" ; then if test "x${with_tk}" = "xyes" ; then with_tk="" user_requested_tk=yes fi # find and load tkConfig.sh # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true # Check whether --with-tk or --without-tk was given. if test "${with_tk+set}" = set; then withval="$with_tk" with_tkconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tk configuration" >&5 echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6 if test "${ac_cv_c_tkconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib$libsuff 2>/dev/null` \ $sys_lib_search_path_spec \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="none" if test x"${with_tkconfig}" != x ; then { { echo "$as_me:$LINENO: error: Cannot find Tk config" >&5 echo "$as_me: error: Cannot find Tk config" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} echo "$as_me:$LINENO: result: found $TK_BIN_DIR/tkConfig.sh" >&5 echo "${ECHO_T}found $TK_BIN_DIR/tkConfig.sh" >&6 fi fi if test "x$TK_BIN_DIR" = "xnone" ; then TK=0 else echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TK_BIN_DIR/tkConfig.sh else echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6 fi # # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TK_BIN_DIR/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TK_DBGX substitution # eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" echo "$as_me:$LINENO: checking for Tk public headers" >&5 echo $ECHO_N "checking for Tk public headers... $ECHO_C" >&6 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" with_tkinclude=${withval} fi; if test "${ac_cv_c_tkh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else { { echo "$as_me:$LINENO: error: ${with_tkinclude} directory does not contain tk.h" >&5 echo "$as_me: error: ${with_tkinclude} directory does not contain tk.h" >&2;} { (exit 1); exit 1; }; } fi else # Check order: pkg --prefix location, Tcl's --prefix location, # directory of tclConfig.sh, and Tcl source directory. # Looking in the source dir is not ideal, but OK. eval "temp_includedir=${includedir}" list="`ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then { echo "$as_me:$LINENO: WARNING: tk.h not found. Please specify its location with --with-tkinclude" >&5 echo "$as_me: WARNING: tk.h not found. Please specify its location with --with-tkinclude" >&2;} else echo "$as_me:$LINENO: result: ${ac_cv_c_tkh}" >&5 echo "${ECHO_T}${ac_cv_c_tkh}" >&6 fi # Convert to a native path and substitute into the output files. if test x"${ac_cv_c_tkh}" = x ; then TK_INCLUDES=none else INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` if test x"${INCLUDE_DIR_NATIVE}" != x/usr/include ;then TK_INCLUDES=-I${INCLUDE_DIR_NATIVE} fi fi if test "${TEA_PLATFORM}" = "windows" ; then # On Windows, we need the X compat headers echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" fi echo "$as_me:$LINENO: result: ${INCLUDE_DIR_NATIVE}" >&5 echo "${ECHO_T}${INCLUDE_DIR_NATIVE}" >&6 fi if test "x$TK_INCLUDES" = "xnone" ; then TK=0 else TK=1 fi fi if test "x$user_requested_tk" = "xyes" -a $TK = 0 ;then { { echo "$as_me:$LINENO: error: Tk was requested but not found" >&5 echo "$as_me: error: Tk was requested but not found" >&2;} { (exit 1); exit 1; }; } fi fi if test "${TK}" = "1" -a "${TCLX}" = "1" -a "x${with_tkx}" != "xno" ; then if test "x${with_tkx}" = "xyes" ; then with_tkx="" user_requested_tkx=yes fi # find and load tkxConfig.sh # # Ok, lets find the tkx configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tkx # if test x"${no_tkx}" = x ; then # we reset no_tkx in case something fails here no_tkx=true # Check whether --with-tkx or --without-tkx was given. if test "${with_tkx+set}" = set; then withval="$with_tkx" with_tkxconfig=${withval} fi; echo "$as_me:$LINENO: checking for tkx configuration" >&5 echo $ECHO_N "checking for tkx configuration... $ECHO_C" >&6 if test "${ac_cv_c_tkxconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tkx was specified. if test x"${with_tkxconfig}" != x ; then if test -f "${with_tkxconfig}/tkxConfig.sh" ; then ac_cv_c_tkxconfig=`(cd ${with_tkxconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tkxconfig} directory doesn't contain tkxConfig.sh" >&5 echo "$as_me: error: ${with_tkxconfig} directory doesn't contain tkxConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private tkx installation if test x"${ac_cv_c_tkxconfig}" = x ; then for i in \ ../tkx \ `ls -dr ../tkx[8-9].[0-9]* 2>/dev/null` \ ../../tkx \ `ls -dr ../../tkx[8-9].[0-9]* 2>/dev/null` \ ../../../tkx \ `ls -dr ../../../tkx[8-9].[0-9]* 2>/dev/null` \ ${srcdir}/../tkx \ `ls -dr ${srcdir}/../tkx[8-9].[0-9]* 2>/dev/null` \ ; do if test -f "$i/tkxConfig.sh" ; then ac_cv_c_tkxconfig=`(cd $i; pwd)` break fi if test -f "$i/unix/tkxConfig.sh" ; then ac_cv_c_tkxconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkxconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib$libsuff 2>/dev/null` \ `ls -d ${prefix}/lib$libsuff 2>/dev/null` \ `ls -d /usr/local/lib$libsuff 2>/dev/null` \ `ls -d /usr/contrib/lib$libsuff 2>/dev/null` \ `ls -d /usr/lib$libsuff 2>/dev/null` \ ; do if test -f "$i/tkxConfig.sh" ; then ac_cv_c_tkxconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_tkxconfig}" = x ; then tkx_BIN_DIR="none" if test x"${with_tkxconfig}" != x ; then { { echo "$as_me:$LINENO: error: Cannot find tkx config" >&5 echo "$as_me: error: Cannot find tkx config" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi else no_tkx= tkx_BIN_DIR=${ac_cv_c_tkxconfig} echo "$as_me:$LINENO: result: found $tkx_BIN_DIR/tkxConfig.sh" >&5 echo "${ECHO_T}found $tkx_BIN_DIR/tkxConfig.sh" >&6 fi fi if test "x$tkx_BIN_DIR" = "xnone" ; then TKX=0 else echo "$as_me:$LINENO: checking for existence of ${tkx_BIN_DIR}/tkxConfig.sh" >&5 echo $ECHO_N "checking for existence of ${tkx_BIN_DIR}/tkxConfig.sh... $ECHO_C" >&6 if test -f "${tkx_BIN_DIR}/tkxConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . ${tkx_BIN_DIR}/tkxConfig.sh else echo "$as_me:$LINENO: result: file not found" >&5 echo "${ECHO_T}file not found" >&6 fi # # If the tkx_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable tkx_LIB_SPEC will be set to the value # of tkx_BUILD_LIB_SPEC. An extension should make use of tkx_LIB_SPEC # instead of tkx_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f ${tkx_BIN_DIR}/Makefile ; then { echo "$as_me:$LINENO: WARNING: Found Makefile - using build library specs for tkx" >&5 echo "$as_me: WARNING: Found Makefile - using build library specs for tkx" >&2;} tkx_LIB_SPEC=${tkx_BUILD_LIB_SPEC} tkx_STUB_LIB_SPEC=${tkx_BUILD_STUB_LIB_SPEC} tkx_STUB_LIB_PATH=${tkx_BUILD_STUB_LIB_PATH} fi TKX=1 fi if test "x$user_requested_tkx" = "xyes" -a $TK = 0 ;then { { echo "$as_me:$LINENO: error: TkX was requested but not found" >&5 echo "$as_me: error: TkX was requested but not found" >&2;} { (exit 1); exit 1; }; } fi fi MY_TCL_LIBS="" MY_TCL_INCS="" if test "${TCL}" = "1"; then MY_TCL_LIBS="${MY_TCL_LIBS} ${TCL_LIB_SPEC} ${TCL_LIBS}" MY_TCL_INCS="${MY_TCL_INCS} ${TCL_INCLUDES}" else { echo "$as_me:$LINENO: Tcl support disabled" >&5 echo "$as_me: Tcl support disabled" >&6;} fi if test "${TCLX}" = "1"; then MY_TCL_LIBS="${TCLX_LIB_SPEC} ${TCLX_LIBS} ${MY_TCL_LIBS}" fi if test "${TK}" = "1"; then MY_TCLTK_LIBS="${TK_LIB_SPEC} ${TK_XLIBSW} ${MY_TCL_LIBS}" MY_TCLTK_INCS="${MY_TCL_INCS} ${TK_INCLUDES} ${TK_XINCLUDES}" else { echo "$as_me:$LINENO: Tk support disabled" >&5 echo "$as_me: Tk support disabled" >&6;} fi if test "${TKX}" = "1"; then MY_TCLTK_LIBS="${TKX_LIB_SPEC} ${TKX_LIBS} ${MY_TCLTK_LIBS}" fi if test "${TCL}" = "1"; then # try to hack in a run-time search path if needed orig_libdir="$libdir" t_add_rpath_libs="" for lib_part in $MY_TCL_LIBS ;do case $lib_part in -L/*) t_libdir=`echo $lib_part | sed s/-L//` t_dir_in_syslib_path=no for sysdir in $sys_lib_dlsearch_path_spec ;do if test "X$t_libdir" = "X$sysdir" ;then t_dir_in_syslib_path=yes break fi done t_add_rpath_libs="${t_add_rpath_libs} ${lib_part}" if test "X$t_dir_in_syslib_path" = "Xno" ;then libdir="$t_libdir" eval "new_lib_spec=\"$hardcode_libdir_flag_spec\"" t_add_rpath_libs="${t_add_rpath_libs} ${new_lib_spec}" fi ;; -L) ;; *) t_add_rpath_libs="${t_add_rpath_libs} ${lib_part}" ;; esac done libdir="$orig_libdir" MY_TCL_LIBS="$t_add_rpath_libs" orig_LIBS="$LIBS" orig_CFLAGS="$CFLAGS" LIBS="$LIBS $MY_TCL_LIBS" CFLAGS="$CFLAGS $MY_TCL_INCS" echo "$as_me:$LINENO: checking for Tcl_Init" >&5 echo $ECHO_N "checking for Tcl_Init... $ECHO_C" >&6 if test "${ac_cv_func_Tcl_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define Tcl_Init to an innocuous variant, in case declares Tcl_Init. For example, HP-UX 11i declares gettimeofday. */ #define Tcl_Init innocuous_Tcl_Init /* System header to define __stub macros and hopefully few prototypes, which can conflict with char Tcl_Init (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef Tcl_Init /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char Tcl_Init (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_Tcl_Init) || defined (__stub___Tcl_Init) choke me #else char (*f) () = Tcl_Init; #endif #ifdef __cplusplus } #endif int main () { return f != Tcl_Init; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_Tcl_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_Tcl_Init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_Tcl_Init" >&5 echo "${ECHO_T}$ac_cv_func_Tcl_Init" >&6 if test $ac_cv_func_Tcl_Init = yes; then : else if test "x$user_requested_tcl" = "xyes" ;then { { echo "$as_me:$LINENO: error: Your Tcl install is broken. Rerun configure with --without-tcl" >&5 echo "$as_me: error: Your Tcl install is broken. Rerun configure with --without-tcl" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: Your Tcl install is broken. Disabling Tcl support." >&5 echo "$as_me: Your Tcl install is broken. Disabling Tcl support." >&6;} TCL=0; TCLX=0; TK=0; TKX=0; fi fi LIBS="$orig_LIBS" CFLAGS="$orig_CFLAGS" fi if test "${TK}" = "1"; then # try to hack in a run-time search path if needed orig_libdir="$libdir" t_add_rpath_libs="" for lib_part in $MY_TCLTK_LIBS ;do case $lib_part in -L/*) t_libdir=`echo $lib_part | sed s/-L//` t_dir_in_syslib_path=no for sysdir in $sys_lib_dlsearch_path_spec ;do if test "X$t_libdir" = "X$sysdir" ;then t_dir_in_syslib_path=yes break fi done t_add_rpath_libs="${t_add_rpath_libs} ${lib_part}" if test "X$t_dir_in_syslib_path" = "Xno" ;then libdir="$t_libdir" eval "new_lib_spec=\"$hardcode_libdir_flag_spec\"" t_add_rpath_libs="${t_add_rpath_libs} ${new_lib_spec}" fi ;; -L) ;; *) t_add_rpath_libs="${t_add_rpath_libs} ${lib_part}" ;; esac done libdir="$orig_libdir" MY_TCLTK_LIBS="$t_add_rpath_libs" orig_LIBS="$LIBS" orig_CFLAGS="$CFLAGS" LIBS="$LIBS $MY_TCLTK_LIBS" CFLAGS="$CFLAGS $MY_TCLTK_INCS" echo "$as_me:$LINENO: checking for Tk_Init" >&5 echo $ECHO_N "checking for Tk_Init... $ECHO_C" >&6 if test "${ac_cv_func_Tk_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define Tk_Init to an innocuous variant, in case declares Tk_Init. For example, HP-UX 11i declares gettimeofday. */ #define Tk_Init innocuous_Tk_Init /* System header to define __stub macros and hopefully few prototypes, which can conflict with char Tk_Init (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef Tk_Init /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char Tk_Init (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_Tk_Init) || defined (__stub___Tk_Init) choke me #else char (*f) () = Tk_Init; #endif #ifdef __cplusplus } #endif int main () { return f != Tk_Init; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_Tk_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_Tk_Init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_Tk_Init" >&5 echo "${ECHO_T}$ac_cv_func_Tk_Init" >&6 if test $ac_cv_func_Tk_Init = yes; then : else if test "x$user_requested_tk" = "xyes" ;then { { echo "$as_me:$LINENO: error: Your Tk install is broken. Rerun configure with --without-tk" >&5 echo "$as_me: error: Your Tk install is broken. Rerun configure with --without-tk" >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: Your Tk install is broken. Disabling Tk support." >&5 echo "$as_me: Your Tk install is broken. Disabling Tk support." >&6;} TK=0; TKX=0; fi fi LIBS="$orig_LIBS" CFLAGS="$orig_CFLAGS" fi echo "$as_me:$LINENO: checking whether to include the GUI-clients" >&5 echo $ECHO_N "checking whether to include the GUI-clients... $ECHO_C" >&6 # Check whether --enable-gui or --disable-gui was given. if test "${enable_gui+set}" = set; then enableval="$enable_gui" build_gui=$enableval fi; if test "x${build_clients}" != "xyes" -a "x${build_gui}" = "xyes"; then { { echo "$as_me:$LINENO: error: the GUI can not be build independent of the clients" >&5 echo "$as_me: error: the GUI can not be build independent of the clients" >&2;} { (exit 1); exit 1; }; } fi if test "x${build_clients}" != "xyes" -a "x${build_gui}" = "x"; then build_gui=no fi if test "x${build_gui}" = "xyes" -a "${TK}" != "1"; then { { echo "$as_me:$LINENO: error: cannot build GUI without Tk library" >&5 echo "$as_me: error: cannot build GUI without Tk library" >&2;} { (exit 1); exit 1; }; } fi if test "x${build_gui}" = "x" -a "${TK}" = "1"; then build_gui=yes fi if test "x${build_gui}" = "x"; then build_gui=no fi echo "$as_me:$LINENO: result: $build_gui" >&5 echo "${ECHO_T}$build_gui" >&6 if test "x$build_gui" = "xyes"; then INCLUDE_GUI_TRUE= INCLUDE_GUI_FALSE='#' else INCLUDE_GUI_TRUE='#' INCLUDE_GUI_FALSE= fi cat >>confdefs.h <<_ACEOF #define TCL ${TCL} _ACEOF cat >>confdefs.h <<_ACEOF #define TCLX ${TCLX} _ACEOF cat >>confdefs.h <<_ACEOF #define TK ${TK} _ACEOF cat >>confdefs.h <<_ACEOF #define TKX ${TKX} _ACEOF if test "$TCL" = "1"; then USING_TCL_TRUE= USING_TCL_FALSE='#' else USING_TCL_TRUE='#' USING_TCL_FALSE= fi if test "$TK" = "1"; then USING_TK_TRUE= USING_TK_FALSE='#' else USING_TK_TRUE='#' USING_TK_FALSE= fi use_tcl=$TCL use_tk=$TK if test "${TCL}" = "1"; then echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 if test "${ac_cv_path_tclsh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target tclsh cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TCL_EXEC_PREFIX}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/tclsh[8-9]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG=$ac_cv_path_tclsh echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5 echo "${ECHO_T}$TCLSH_PROG" >&6 else { { echo "$as_me:$LINENO: error: No tclsh found in PATH: $search_path" >&5 echo "$as_me: error: No tclsh found in PATH: $search_path" >&2;} { (exit 1); exit 1; }; } fi fi if test "${TK}" = "1"; then echo "$as_me:$LINENO: checking for wish" >&5 echo $ECHO_N "checking for wish... $ECHO_C" >&6 if test "${ac_cv_path_wish+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target wish cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TK_EXEC_PREFIX}/bin:${TK_BIN_DIR}:${TK_BIN_DIR}/../bin:${TCL_EXEC_PREFIX}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/wish[8-9]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/wish*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_wish" = x ; then if test -f "$j" ; then ac_cv_path_wish=$j break fi fi done done fi if test -f "$ac_cv_path_wish" ; then WISH_PROG=$ac_cv_path_wish echo "$as_me:$LINENO: result: $WISH_PROG" >&5 echo "${ECHO_T}$WISH_PROG" >&6 else { { echo "$as_me:$LINENO: error: No wish found in PATH: $search_path" >&5 echo "$as_me: error: No wish found in PATH: $search_path" >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --with-tclatrsep or --without-tclatrsep was given. if test "${with_tclatrsep+set}" = set; then withval="$with_tclatrsep" tcl_atrsep="${withval}" else tcl_atrsep="." fi; if test "$TCL" = "1" ; then echo "$as_me:$LINENO: checking checking for Tcl attribute seperator" >&5 echo $ECHO_N "checking checking for Tcl attribute seperator... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $tcl_atrsep" >&5 echo "${ECHO_T}$tcl_atrsep" >&6 fi cat >>confdefs.h <<_ACEOF #define TCL_ATRSEP "${tcl_atrsep}" _ACEOF # Check whether --enable-tcl-qstat or --disable-tcl-qstat was given. if test "${enable_tcl_qstat+set}" = set; then enableval="$enable_tcl_qstat" fi; echo "$as_me:$LINENO: checking whether to enable tcl-qstat" >&5 echo $ECHO_N "checking whether to enable tcl-qstat... $ECHO_C" >&6 EXTRA_QSTAT_LIBS="" if test "x${enable_tcl_qstat}" = "x" -o "x${enable_tcl_qstat}" != "xno"; then if test "$TCL" = "1" ; then EXTRA_QSTAT_LIBS='$(EXTRA_QSTAT_LIBS)' cat >>confdefs.h <<\_ACEOF #define TCL_QSTAT 1 _ACEOF enable_tcl_qstat=yes else if test "${enable_tcl_qstat}" = "yes" ;then { { echo "$as_me:$LINENO: error: Cannot enable tcl-qstat without also using Tcl" >&5 echo "$as_me: error: Cannot enable tcl-qstat without also using Tcl" >&2;} { (exit 1); exit 1; }; } else enable_tcl_qstat=no fi fi fi echo "$as_me:$LINENO: result: $enable_tcl_qstat" >&5 echo "${ECHO_T}$enable_tcl_qstat" >&6 if test "x$EXTRA_QSTAT_LIBS" != "x"; then USE_TCLQSTAT_TRUE= USE_TCLQSTAT_FALSE='#' else USE_TCLQSTAT_TRUE='#' USE_TCLQSTAT_FALSE= fi if test "$SCHD_TYPE" = "tcl" -a "$TCL" = "0" ;then { { echo "$as_me:$LINENO: error: Tcl scheduler cannot be built without Tcl support" >&5 echo "$as_me: error: Tcl scheduler cannot be built without Tcl support" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: Finished Tcl/Tk configuration" >&5 echo "$as_me: Finished Tcl/Tk configuration" >&6;} if test "$build_drmaa" = "yes" ;then { echo "$as_me:$LINENO: Configuring DRMAA ..." >&5 echo "$as_me: Configuring DRMAA ..." >&6;} # Extract the first word of ""gperf"", so it can be a program name with args. set dummy "gperf"; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GPERF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GPERF in [\\/]* | ?:[\\/]*) ac_cv_path_GPERF="$GPERF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GPERF="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi GPERF=$ac_cv_path_GPERF if test -n "$GPERF"; then echo "$as_me:$LINENO: result: $GPERF" >&5 echo "${ECHO_T}$GPERF" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for dot" >&5 echo $ECHO_N "checking for dot... $ECHO_C" >&6 if dot -V >/dev/null 2>&1; then HAVE_DOT=yes else HAVE_DOT=no fi echo "$as_me:$LINENO: result: $HAVE_DOT" >&5 echo "${ECHO_T}$HAVE_DOT" >&6 # Extract the first word of ""doxygen"", so it can be a program name with args. set dummy "doxygen"; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_DOXYGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN=""none"" ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then echo "$as_me:$LINENO: result: $DOXYGEN" >&5 echo "${ECHO_T}$DOXYGEN" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then if test "$cross_compiling" = yes; then echo $ac_n "cross-compiling... " 2>&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 if test $ac_cv_c_bigendian = unknown; then echo "$as_me:$LINENO: checking to probe for byte ordering" >&5 echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6 cat >conftest.c <&6 ac_cv_c_bigendian=yes fi if test `grep -l LiTTleEnDian conftest.o` ; then echo $ac_n ' little endian probe OK, ' 1>&6 if test $ac_cv_c_bigendian = yes ; then ac_cv_c_bigendian=unknown; else ac_cv_c_bigendian=no fi fi echo $ac_n 'guessing bigendian ... ' >&6 fi fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 fi if test $ac_cv_c_bigendian = yes; then cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF BYTEORDER=4321 else BYTEORDER=1234 fi cat >>confdefs.h <<_ACEOF #define BYTEORDER $BYTEORDER _ACEOF if test $ac_cv_c_bigendian = unknown; then { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5 echo "$as_me: error: unknown endianess - sorry" >&2;} { (exit please pre-set ac_cv_c_bigendian); exit please pre-set ac_cv_c_bigendian; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_join (); int main () { pthread_join (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then acx_pthread_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 echo "${ECHO_T}$acx_pthread_ok" >&6 if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; *freebsd*) # freebsd 4 uses -pthread, freebsd 5 uses -lpthread acx_pthread_flags="pthread -pthread" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5 echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6 ;; -*) echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5 echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6 PTHREAD_CFLAGS="$flag" PTHREAD_LIBS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_acx_pthread_config+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$acx_pthread_config"; then ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_acx_pthread_config="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then echo "$as_me:$LINENO: result: $acx_pthread_config" >&5 echo "${ECHO_T}$acx_pthread_config" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5 echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6 PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then acx_pthread_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 echo "${ECHO_T}$acx_pthread_ok" >&6 if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5 echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6 attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int attr=$attr; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then attr_name=$attr; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done echo "$as_me:$LINENO: result: $attr_name" >&5 echo "${ECHO_T}$attr_name" >&6 if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6 flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac echo "$as_me:$LINENO: result: ${flag}" >&5 echo "${ECHO_T}${flag}" >&6 if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD 1 _ACEOF : else acx_pthread_ok=no { { echo "$as_me:$LINENO: error: POSIX threads library is required by DRMAA." >&5 echo "$as_me: error: POSIX threads library is required by DRMAA." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_header in stddef.h limits.h stdint.h inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to torqueusers@supercluster.org ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool # error bool is not defined #endif #ifndef false # error false is not defined #endif #if false # error false is not 0 #endif #ifndef true # error true is not defined #endif #if true != 1 # error true is not 1 #endif #ifndef __bool_true_false_are_defined # error __bool_true_false_are_defined is not defined #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) -0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) -0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; int main () { return !a + !b + !c + !d + !e + !f + !g + !h + !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((_Bool *) 0) return 0; if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6 if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi #AC_FUNC_MALLOC #AC_FUNC_REALLOC echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strerror_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strerror_r char *p = (char *) strerror_r; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strerror_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strerror_r=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6 if test $ac_cv_have_decl_strerror_r = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 0 _ACEOF fi for ac_func in strerror_r do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6 if test "${ac_cv_func_strerror_r_char_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); exit (!isalpha (x)); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6 if test $ac_cv_func_strerror_r_char_p = yes; then cat >>confdefs.h <<\_ACEOF #define STRERROR_R_CHAR_P 1 _ACEOF fi for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strftime (); int main () { strftime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_intl_strftime=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 if test $ac_cv_lib_intl_strftime = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF LIBS="-lintl $LIBS" fi fi done for ac_func in getcwd strchr strdup strerror mkstemp fstat strlcpy asprintf vasprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for va_copy" >&5 echo $ECHO_N "checking for va_copy... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { va_list a, b; va_copy(a, b); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_VA_COPY 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: checking for __va_copy" >&5 echo $ECHO_N "checking for __va_copy... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { va_list a, b; __va_copy(a, b); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE___VA_COPY 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext build_drmaa_docs=yes RPM_AC_OPTS="$RPM_AC_OPTS --with drmaa" else DOXYGEN=none build_drmaa_docs=no RPM_AC_OPTS="$RPM_AC_OPTS --without drmaa" fi if test "$DOXYGEN" != "none"; then DRMAA_DOCS_TRUE= DRMAA_DOCS_FALSE='#' else DRMAA_DOCS_TRUE='#' DRMAA_DOCS_FALSE= fi drmaadocdir=$datadir/doc/$PACKAGE-drmaa # create a generic PACKAGE-config file P=`echo pbs` L=`echo -ltorque` V=`echo $VERSION` F=`echo $P-config` echo "$as_me:$LINENO: result: creating $F - generic $V for $L" >&5 echo "${ECHO_T}creating $F - generic $V for $L" >&6 test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' echo '#! /bin/sh' >$F echo ' ' >>$F echo 'package="'$P'"' >>$F echo 'version="'$V'"' >>$F echo ' ' >>$F # in the order of occurence a standard automake Makefile echo 'prefix="'$prefix'"' >>$F echo 'exec_prefix="'$exec_prefix'"' >>$F echo 'bindir="'$bindir'"' >>$F echo 'sbindir="'$sbindir'"' >>$F echo 'libexecdir="'$libexecdir'"' >>$F echo 'datadir="'$datadir'"' >>$F echo 'sysconfdir="'$sysconfdir'"' >>$F echo 'sharedstatedir="'$sharedstatedir'"' >>$F echo 'localstatedir="'$localstatedir'"' >>$F echo 'libdir="'$libdir'"' >>$F echo 'infodir="'$infodir'"' >>$F echo 'mandir="'$mandir'"' >>$F echo 'includedir="'$includedir'"' >>$F echo 'target="'$target'"' >>$F echo 'host="'$host'"' >>$F echo 'build="'$build'"' >>$F echo 'hardcode_libdir_flag="'`eval echo $hardcode_libdir_flag_spec`'"' >>$F echo 'sys_lib_dlsearch_path="'`eval echo $sys_lib_dlsearch_path_spec`'"' >>$F echo 'case " $sys_lib_dlsearch_path " in' >>$F echo ' *" '$libdir' "*) libs="'$L'" ;;' >>$F echo ' *) libs="-L$libdir '$L' $hardcode_libdir_flag" ;;' >>$F echo 'esac' >>$F echo ' ' >>$F echo 'if test "'"\$""#"'" -eq 0; then' >>$F echo ' cat <>$F echo 'Usage: $package-config OPTIONS' >>$F echo 'Options:' >>$F echo ' --prefix=DIR) : \$prefix' >>$F echo ' --package) : \$package' >>$F echo ' --version) : \$version' >>$F echo ' --cflags) : -I\$includedir' >>$F echo ' --libs) : -L\$libdir -l\$package' >>$F echo ' --help) print all the options (not just these)' >>$F echo 'EOF' >>$F echo 'fi' >>$F echo ' ' >>$F echo 'o=""' >>$F echo 'h=""' >>$F echo 'for i in "$@"; do' >>$F echo ' case $i in' >>$F echo ' --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$F echo ' --prefix) o="$o $prefix" ;;' >>$F echo ' --package) o="$o $package" ;;' >>$F echo ' --version) o="$o $version" ;;' >>$F echo ' --cflags) if test "_$includedir" != "_/usr/include"' >>$F echo ' then o="$o -I$includedir" ; fi' >>$F echo ' ;;' >>$F echo ' --libs) o="$o $libs" ;;' >>$F echo ' --exec_prefix|--eprefix) o="$o $exec_prefix" ;;' >>$F echo ' --bindir) o="$o $bindir" ;;' >>$F echo ' --sbindir) o="$o $sbindir" ;;' >>$F echo ' --libexecdir) o="$o $libexecdir" ;;' >>$F echo ' --datadir) o="$o $datadir" ;;' >>$F echo ' --datainc) o="$o -I$datadir" ;;' >>$F echo ' --datalib) o="$o -L$datadir" ;;' >>$F echo ' --sysconfdir) o="$o $sysconfdir" ;;' >>$F echo ' --sharedstatedir) o="$o $sharedstatedir" ;;' >>$F echo ' --localstatedir) o="$o $localstatedir" ;;' >>$F echo ' --libdir) o="$o $libdir" ;;' >>$F echo ' --libadd) o="$o -L$libdir" ;;' >>$F echo ' --infodir) o="$o $infodir" ;;' >>$F echo ' --mandir) o="$o $mandir" ;;' >>$F echo ' --includedir) o="$o $includedir" ;;' >>$F echo ' --target) o="$o $target" ;;' >>$F echo ' --host) o="$o $host" ;;' >>$F echo ' --build) o="$o $build" ;;' >>$F echo ' --data) o="$o -I$datadir/$package" ;;' >>$F echo ' --pkgdatadir) o="$o $datadir/$package" ;;' >>$F echo ' --pkgdatainc) o="$o -I$datadir/$package" ;;' >>$F echo ' --pkgdatalib) o="$o -L$datadir/$package" ;;' >>$F echo ' --pkglibdir) o="$o $libdir/$package" ;;' >>$F echo ' --pkglibinc) o="$o -I$libinc/$package" ;;' >>$F echo ' --pkglibadd) o="$o -L$libadd/$package" ;;' >>$F echo ' --pkgincludedir) o="$o $includedir/$package" ;;' >>$F echo ' --help) h="1" ;;' >>$F echo ' -?//*|-?/*//*|-?./*//*|//*|/*//*|./*//*) ' >>$F echo ' v=`echo $i | sed -e s://:\$:g`' >>$F echo ' v=`eval "echo $v"` ' >>$F echo ' o="$o $v" ;; ' >>$F echo ' esac' >>$F echo 'done' >>$F echo ' ' >>$F echo 'o=`eval "echo $o"`' >>$F echo 'o=`eval "echo $o"`' >>$F echo 'eval "echo $o"' >>$F echo ' ' >>$F echo 'if test ! -z "$h" ; then ' >>$F echo 'cat <>$F echo ' --prefix=xxx) (what is that for anyway?)' >>$F echo ' --prefix) \$prefix $prefix' >>$F echo ' --package) \$package $package' >>$F echo ' --version) \$version $version' >>$F echo ' --cflags) -I\$includedir unless it is /usr/include' >>$F echo ' --libs) -L\$libdir -l\$PACKAGE \$LIBS' >>$F echo ' --exec_prefix) or... ' >>$F echo ' --eprefix) \$exec_prefix $exec_prefix' >>$F echo ' --bindir) \$bindir $bindir' >>$F echo ' --sbindir) \$sbindir $sbindir' >>$F echo ' --libexecdir) \$libexecdir $libexecdir' >>$F echo ' --datadir) \$datadir $datadir' >>$F echo ' --sysconfdir) \$sysconfdir $sysconfdir' >>$F echo ' --sharedstatedir) \$sharedstatedir$sharedstatedir' >>$F echo ' --localstatedir) \$localstatedir $localstatedir' >>$F echo ' --libdir) \$libdir $libdir' >>$F echo ' --infodir) \$infodir $infodir' >>$F echo ' --mandir) \$mandir $mandir' >>$F echo ' --target) \$target $target' >>$F echo ' --host) \$host $host' >>$F echo ' --build) \$build $build' >>$F echo ' --data) -I\$datadir/\$package' >>$F echo ' --pkgdatadir) \$datadir/\$package' >>$F echo ' --pkglibdir) \$libdir/\$package' >>$F echo ' --pkgincludedir) \$includedir/\$package' >>$F echo ' --help) generated by ac_create_generic_config.m4' >>$F echo ' -I//varname and other inc-targets like --pkgdatainc supported' >>$F echo ' -L//varname and other lib-targets, e.g. --pkgdatalib or --libadd' >>$F echo 'EOF' >>$F echo 'fi' >>$F GENERIC_CONFIG="$F" SPEC_NAME=$PACKAGE_TARNAME SPEC_VERSION=$PACKAGE_VERSION pbs_build_host=`uname -n` pbs_build_date=`date` pbs_build_dir=`pwd` pbs_source_dir=`cd $srcdir && pwd` pbs_config_args=$@ cat >>confdefs.h <<_ACEOF #define PBS_BUILD_HOST "${pbs_build_host}" _ACEOF cat >>confdefs.h <<_ACEOF #define PBS_BUILD_DATE "${pbs_build_date}" _ACEOF cat >>confdefs.h <<_ACEOF #define PBS_BUILD_DIR "${pbs_build_dir}" _ACEOF cat >>confdefs.h <<_ACEOF #define PBS_SOURCE_DIR "${pbs_source_dir}" _ACEOF cat >>confdefs.h <<_ACEOF #define PBS_BUILD_USER "${USER}" _ACEOF cat >>confdefs.h <<_ACEOF #define PBS_INSTALL_DIR "${prefix}" _ACEOF cat >>confdefs.h <<_ACEOF #define PBS_CONFIG_ARGS "${ac_configure_args}" _ACEOF cat >>confdefs.h <<_ACEOF #define PBS_CFLAGS "${CFLAGS}" _ACEOF ac_config_files="$ac_config_files torque.spec:buildutils/torque.spec.in" ac_config_files="$ac_config_files buildutils/pbs_mkdirs buildutils/self-extract-head-sh buildutils/modulefiles buildutils/modulefiles.vers Makefile doc/Makefile doc/man1/Makefile doc/man3/Makefile doc/man7/Makefile doc/man8/Makefile src/Makefile src/cmds/Makefile src/iff/Makefile src/gui/Makefile src/gui/Ccode/Makefile src/include/Makefile src/lib/Makefile src/lib/Libattr/Makefile src/lib/Libcmds/Makefile src/lib/Libcsv/Makefile src/lib/Libdis/Makefile src/lib/Libifl/Makefile src/lib/Liblog/Makefile src/lib/Libnet/Makefile src/lib/Libpbs/Makefile src/lib/Libsite/Makefile src/lib/Libutils/Makefile src/mom_rcp/Makefile src/momctl/Makefile src/resmom/Makefile src/resmom/aix4/Makefile src/resmom/aix5/Makefile src/resmom/darwin/Makefile src/resmom/digitalunix/Makefile src/resmom/freebsd/Makefile src/resmom/freebsd5/Makefile src/resmom/fujitsu/Makefile src/resmom/hpux10/Makefile src/resmom/hpux11/Makefile src/resmom/irix5/Makefile src/resmom/irix6/Makefile src/resmom/irix6array/Makefile src/resmom/linux/Makefile src/resmom/netbsd/Makefile src/resmom/solaris5/Makefile src/resmom/solaris7/Makefile src/resmom/sunos4/Makefile src/resmom/unicos8/Makefile src/resmom/unicosmk2/Makefile src/scheduler.basl/Makefile src/scheduler.cc/Makefile src/scheduler.cc/samples/Makefile src/scheduler.cc/samples/cray_t3e/Makefile src/scheduler.cc/samples/dec_cluster/Makefile src/scheduler.cc/samples/fifo/Makefile src/scheduler.cc/samples/msic_cluster/Makefile src/scheduler.cc/samples/sgi_origin/Makefile src/scheduler.cc/samples/umn_cluster/Makefile src/scheduler.tcl/Makefile src/server/Makefile src/tools/Makefile src/tools/xpbsmon/Makefile src/drmaa/Makefile src/drmaa/src/Makefile src/drmaa/test/Makefile src/drmaa/Doxyfile src/pam/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INCLUDE_SERVER_TRUE}" && test -z "${INCLUDE_SERVER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INCLUDE_SERVER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INCLUDE_SERVER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INCLUDE_MOM_TRUE}" && test -z "${INCLUDE_MOM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INCLUDE_MOM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INCLUDE_MOM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INCLUDE_CLIENTS_TRUE}" && test -z "${INCLUDE_CLIENTS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INCLUDE_CLIENTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INCLUDE_CLIENTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INCLUDE_DRMAA_TRUE}" && test -z "${INCLUDE_DRMAA_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INCLUDE_DRMAA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INCLUDE_DRMAA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_L26_CPUSETS_TRUE}" && test -z "${BUILD_L26_CPUSETS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_L26_CPUSETS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_L26_CPUSETS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_L26_CPUSETS_TRUE}" && test -z "${BUILD_L26_CPUSETS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_L26_CPUSETS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_L26_CPUSETS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILDCPA_TRUE}" && test -z "${BUILDCPA_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILDCPA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILDCPA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SCHD_BASL_TRUE}" && test -z "${SCHD_BASL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SCHD_BASL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SCHD_BASL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USING_RPP_TRUE}" && test -z "${USING_RPP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USING_RPP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USING_RPP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USING_SYSLOG_TRUE}" && test -z "${USING_SYSLOG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USING_SYSLOG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USING_SYSLOG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INCLUDE_MOM_RCP_TRUE}" && test -z "${INCLUDE_MOM_RCP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INCLUDE_MOM_RCP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INCLUDE_MOM_RCP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INCLUDE_PAM_TRUE}" && test -z "${INCLUDE_PAM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INCLUDE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INCLUDE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INSTALL_MODULEFILES_TRUE}" && test -z "${INSTALL_MODULEFILES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INSTALL_MODULEFILES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INSTALL_MODULEFILES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INCLUDE_GUI_TRUE}" && test -z "${INCLUDE_GUI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INCLUDE_GUI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INCLUDE_GUI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USING_TCL_TRUE}" && test -z "${USING_TCL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USING_TCL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USING_TCL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USING_TK_TRUE}" && test -z "${USING_TK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USING_TK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USING_TK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_TCLQSTAT_TRUE}" && test -z "${USE_TCLQSTAT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_TCLQSTAT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_TCLQSTAT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DRMAA_DOCS_TRUE}" && test -z "${DRMAA_DOCS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DRMAA_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DRMAA_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by torque $as_me 2.4.16, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ torque config.status 2.4.16 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "torque.spec" ) CONFIG_FILES="$CONFIG_FILES torque.spec:buildutils/torque.spec.in" ;; "buildutils/pbs_mkdirs" ) CONFIG_FILES="$CONFIG_FILES buildutils/pbs_mkdirs" ;; "buildutils/self-extract-head-sh" ) CONFIG_FILES="$CONFIG_FILES buildutils/self-extract-head-sh" ;; "buildutils/modulefiles" ) CONFIG_FILES="$CONFIG_FILES buildutils/modulefiles" ;; "buildutils/modulefiles.vers" ) CONFIG_FILES="$CONFIG_FILES buildutils/modulefiles.vers" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/man1/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/man1/Makefile" ;; "doc/man3/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/man3/Makefile" ;; "doc/man7/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/man7/Makefile" ;; "doc/man8/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/man8/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/cmds/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cmds/Makefile" ;; "src/iff/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/iff/Makefile" ;; "src/gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gui/Makefile" ;; "src/gui/Ccode/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gui/Ccode/Makefile" ;; "src/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; "src/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;; "src/lib/Libattr/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libattr/Makefile" ;; "src/lib/Libcmds/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libcmds/Makefile" ;; "src/lib/Libcsv/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libcsv/Makefile" ;; "src/lib/Libdis/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libdis/Makefile" ;; "src/lib/Libifl/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libifl/Makefile" ;; "src/lib/Liblog/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Liblog/Makefile" ;; "src/lib/Libnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libnet/Makefile" ;; "src/lib/Libpbs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libpbs/Makefile" ;; "src/lib/Libsite/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libsite/Makefile" ;; "src/lib/Libutils/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Libutils/Makefile" ;; "src/mom_rcp/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mom_rcp/Makefile" ;; "src/momctl/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/momctl/Makefile" ;; "src/resmom/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/Makefile" ;; "src/resmom/aix4/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/aix4/Makefile" ;; "src/resmom/aix5/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/aix5/Makefile" ;; "src/resmom/darwin/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/darwin/Makefile" ;; "src/resmom/digitalunix/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/digitalunix/Makefile" ;; "src/resmom/freebsd/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/freebsd/Makefile" ;; "src/resmom/freebsd5/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/freebsd5/Makefile" ;; "src/resmom/fujitsu/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/fujitsu/Makefile" ;; "src/resmom/hpux10/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/hpux10/Makefile" ;; "src/resmom/hpux11/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/hpux11/Makefile" ;; "src/resmom/irix5/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/irix5/Makefile" ;; "src/resmom/irix6/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/irix6/Makefile" ;; "src/resmom/irix6array/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/irix6array/Makefile" ;; "src/resmom/linux/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/linux/Makefile" ;; "src/resmom/netbsd/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/netbsd/Makefile" ;; "src/resmom/solaris5/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/solaris5/Makefile" ;; "src/resmom/solaris7/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/solaris7/Makefile" ;; "src/resmom/sunos4/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/sunos4/Makefile" ;; "src/resmom/unicos8/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/unicos8/Makefile" ;; "src/resmom/unicosmk2/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/resmom/unicosmk2/Makefile" ;; "src/scheduler.basl/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.basl/Makefile" ;; "src/scheduler.cc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/Makefile" ;; "src/scheduler.cc/samples/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/samples/Makefile" ;; "src/scheduler.cc/samples/cray_t3e/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/samples/cray_t3e/Makefile" ;; "src/scheduler.cc/samples/dec_cluster/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/samples/dec_cluster/Makefile" ;; "src/scheduler.cc/samples/fifo/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/samples/fifo/Makefile" ;; "src/scheduler.cc/samples/msic_cluster/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/samples/msic_cluster/Makefile" ;; "src/scheduler.cc/samples/sgi_origin/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/samples/sgi_origin/Makefile" ;; "src/scheduler.cc/samples/umn_cluster/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.cc/samples/umn_cluster/Makefile" ;; "src/scheduler.tcl/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scheduler.tcl/Makefile" ;; "src/server/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/server/Makefile" ;; "src/tools/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;; "src/tools/xpbsmon/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tools/xpbsmon/Makefile" ;; "src/drmaa/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/drmaa/Makefile" ;; "src/drmaa/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/drmaa/src/Makefile" ;; "src/drmaa/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/drmaa/test/Makefile" ;; "src/drmaa/Doxyfile" ) CONFIG_FILES="$CONFIG_FILES src/drmaa/Doxyfile" ;; "src/pam/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/pam/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "src/include/pbs_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/include/pbs_config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@MAKE@,$MAKE,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@program_prefix@,$program_prefix,;t t s,@program_suffix@,$program_suffix,;t t s,@PBS_MACH@,$PBS_MACH,;t t s,@INCLUDE_SERVER_TRUE@,$INCLUDE_SERVER_TRUE,;t t s,@INCLUDE_SERVER_FALSE@,$INCLUDE_SERVER_FALSE,;t t s,@build_server@,$build_server,;t t s,@INCLUDE_MOM_TRUE@,$INCLUDE_MOM_TRUE,;t t s,@INCLUDE_MOM_FALSE@,$INCLUDE_MOM_FALSE,;t t s,@build_mom@,$build_mom,;t t s,@INCLUDE_CLIENTS_TRUE@,$INCLUDE_CLIENTS_TRUE,;t t s,@INCLUDE_CLIENTS_FALSE@,$INCLUDE_CLIENTS_FALSE,;t t s,@build_clients@,$build_clients,;t t s,@INCLUDE_DRMAA_TRUE@,$INCLUDE_DRMAA_TRUE,;t t s,@INCLUDE_DRMAA_FALSE@,$INCLUDE_DRMAA_FALSE,;t t s,@build_drmaa@,$build_drmaa,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@AR@,$AR,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@TBL@,$TBL,;t t s,@PIC@,$PIC,;t t s,@ROFF@,$ROFF,;t t s,@PBSPOE@,$PBSPOE,;t t s,@PBSPOEO@,$PBSPOEO,;t t s,@BUILD_L26_CPUSETS_TRUE@,$BUILD_L26_CPUSETS_TRUE,;t t s,@BUILD_L26_CPUSETS_FALSE@,$BUILD_L26_CPUSETS_FALSE,;t t s,@BUILDCPA_TRUE@,$BUILDCPA_TRUE,;t t s,@BUILDCPA_FALSE@,$BUILDCPA_FALSE,;t t s,@MOMLIBS@,$MOMLIBS,;t t s,@SCHD_TYPE_SUBDIR@,$SCHD_TYPE_SUBDIR,;t t s,@SCHD_TYPE@,$SCHD_TYPE,;t t s,@SCHD_BASL_TRUE@,$SCHD_BASL_TRUE,;t t s,@SCHD_BASL_FALSE@,$SCHD_BASL_FALSE,;t t s,@SCHD_LIBS@,$SCHD_LIBS,;t t s,@SCHD_CODE@,$SCHD_CODE,;t t s,@USING_RPP_TRUE@,$USING_RPP_TRUE,;t t s,@USING_RPP_FALSE@,$USING_RPP_FALSE,;t t s,@USING_SYSLOG_TRUE@,$USING_SYSLOG_TRUE,;t t s,@USING_SYSLOG_FALSE@,$USING_SYSLOG_FALSE,;t t s,@PBS_SERVER_HOME@,$PBS_SERVER_HOME,;t t s,@PBS_DEFAULT_FILE@,$PBS_DEFAULT_FILE,;t t s,@PBS_DEFAULT_SERVER@,$PBS_DEFAULT_SERVER,;t t s,@PBS_ENVIRON@,$PBS_ENVIRON,;t t s,@RCP_PATH@,$RCP_PATH,;t t s,@RCP_ARGS@,$RCP_ARGS,;t t s,@RSH_PATH@,$RSH_PATH,;t t s,@build_pbs_rcp@,$build_pbs_rcp,;t t s,@INCLUDE_MOM_RCP_TRUE@,$INCLUDE_MOM_RCP_TRUE,;t t s,@INCLUDE_MOM_RCP_FALSE@,$INCLUDE_MOM_RCP_FALSE,;t t s,@SENDMAIL_CMD@,$SENDMAIL_CMD,;t t s,@pammoddir@,$pammoddir,;t t s,@INCLUDE_PAM_TRUE@,$INCLUDE_PAM_TRUE,;t t s,@INCLUDE_PAM_FALSE@,$INCLUDE_PAM_FALSE,;t t s,@xauth_path@,$xauth_path,;t t s,@INSTALL_MODULEFILES_TRUE@,$INSTALL_MODULEFILES_TRUE,;t t s,@INSTALL_MODULEFILES_FALSE@,$INSTALL_MODULEFILES_FALSE,;t t s,@MODULEFILES_DIR@,$MODULEFILES_DIR,;t t s,@READLINE_LIBS@,$READLINE_LIBS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t s,@TCL_DEFS@,$TCL_DEFS,;t t s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t s,@tclx_VERSION@,$tclx_VERSION,;t t s,@tclx_SRC_DIR@,$tclx_SRC_DIR,;t t s,@tclx_LIB_FILE@,$tclx_LIB_FILE,;t t s,@tclx_LIB_SPEC@,$tclx_LIB_SPEC,;t t s,@tclx_STUB_LIB_FILE@,$tclx_STUB_LIB_FILE,;t t s,@tclx_STUB_LIB_SPEC@,$tclx_STUB_LIB_SPEC,;t t s,@tclx_STUB_LIB_PATH@,$tclx_STUB_LIB_PATH,;t t s,@TK_VERSION@,$TK_VERSION,;t t s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t s,@TK_LIBS@,$TK_LIBS,;t t s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t s,@TK_INCLUDES@,$TK_INCLUDES,;t t s,@tkx_VERSION@,$tkx_VERSION,;t t s,@tkx_SRC_DIR@,$tkx_SRC_DIR,;t t s,@tkx_LIB_FILE@,$tkx_LIB_FILE,;t t s,@tkx_LIB_SPEC@,$tkx_LIB_SPEC,;t t s,@tkx_STUB_LIB_FILE@,$tkx_STUB_LIB_FILE,;t t s,@tkx_STUB_LIB_SPEC@,$tkx_STUB_LIB_SPEC,;t t s,@tkx_STUB_LIB_PATH@,$tkx_STUB_LIB_PATH,;t t s,@build_gui@,$build_gui,;t t s,@INCLUDE_GUI_TRUE@,$INCLUDE_GUI_TRUE,;t t s,@INCLUDE_GUI_FALSE@,$INCLUDE_GUI_FALSE,;t t s,@MY_TCL_LIBS@,$MY_TCL_LIBS,;t t s,@MY_TCL_INCS@,$MY_TCL_INCS,;t t s,@MY_TCLTK_LIBS@,$MY_TCLTK_LIBS,;t t s,@MY_TCLTK_INCS@,$MY_TCLTK_INCS,;t t s,@USING_TCL_TRUE@,$USING_TCL_TRUE,;t t s,@USING_TCL_FALSE@,$USING_TCL_FALSE,;t t s,@USING_TK_TRUE@,$USING_TK_TRUE,;t t s,@USING_TK_FALSE@,$USING_TK_FALSE,;t t s,@use_tcl@,$use_tcl,;t t s,@use_tk@,$use_tk,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@WISH_PROG@,$WISH_PROG,;t t s,@EXTRA_QSTAT_LIBS@,$EXTRA_QSTAT_LIBS,;t t s,@USE_TCLQSTAT_TRUE@,$USE_TCLQSTAT_TRUE,;t t s,@USE_TCLQSTAT_FALSE@,$USE_TCLQSTAT_FALSE,;t t s,@GPERF@,$GPERF,;t t s,@HAVE_DOT@,$HAVE_DOT,;t t s,@DOXYGEN@,$DOXYGEN,;t t s,@acx_pthread_config@,$acx_pthread_config,;t t s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t s,@DRMAA_DOCS_TRUE@,$DRMAA_DOCS_TRUE,;t t s,@DRMAA_DOCS_FALSE@,$DRMAA_DOCS_FALSE,;t t s,@build_drmaa_docs@,$build_drmaa_docs,;t t s,@drmaadocdir@,$drmaadocdir,;t t s,@GENERIC_CONFIG@,$GENERIC_CONFIG,;t t s,@SPEC_NAME@,$SPEC_NAME,;t t s,@SPEC_VERSION@,$SPEC_VERSION,;t t s,@RPM_AC_OPTS@,$RPM_AC_OPTS,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo echo "Building components: server=$build_server mom=$build_mom clients=$build_clients gui=$build_gui drmaa=$build_drmaa pam=`test "x$pammoddir" = "xdisabled" && echo no || echo yes`" echo "PBS Machine type: $PBS_MACH" echo "Remote copy: $RCP_PATH $RCP_ARGS" echo "PBS home: $PBS_SERVER_HOME" echo "Default server: $PBS_DEFAULT_SERVER" echo "Unix Domain sockets: $ENABLE_UNIX_SOCKETS" echo "Tcl: `test "$TCL" = "1" && echo $MY_TCL_INCS $MY_TCL_LIBS || echo disabled`" echo "Tk: `test "$TK" = "1" && echo $MY_TCLTK_INCS $MY_TCLTK_LIBS || echo disabled`" echo if test "x$gccwarnings" = "xyes" ;then { echo "$as_me:$LINENO: WARNING: This compilation has strict compiler options enabled that cause the build to fail if any compiler warnings are emitted. If this build fails because of a harmless warning, please report the problem to $PACKAGE_BUGREPORT and run configure again with --disable-gcc-warnings." >&5 echo "$as_me: WARNING: This compilation has strict compiler options enabled that cause the build to fail if any compiler warnings are emitted. If this build fails because of a harmless warning, please report the problem to $PACKAGE_BUGREPORT and run configure again with --disable-gcc-warnings." >&2;} echo fi echo "Ready for '${MAKE-make}'." torque-2.4.16/Makefile.in0000664000113300011330000007657411605403772012131 00000000000000# Makefile.in generated by automake 1.9.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/buildutils/config.mk \ $(top_srcdir)/buildutils/modulefiles.in \ $(top_srcdir)/buildutils/modulefiles.vers.in \ $(top_srcdir)/buildutils/pbs_mkdirs.in \ $(top_srcdir)/buildutils/self-extract-head-sh.in \ $(top_srcdir)/buildutils/torque.spec.in \ $(top_srcdir)/configure INSTALL buildutils/compile \ buildutils/config.guess buildutils/config.sub \ buildutils/depcomp buildutils/install-sh buildutils/ltmain.sh \ buildutils/missing buildutils/mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/buildutils/tcl.m4 \ $(top_srcdir)/buildutils/ac_create_generic_config.m4 \ $(top_srcdir)/buildutils/acx_pthread.m4 \ $(top_srcdir)/buildutils/ax_prog_dot.m4 \ $(top_srcdir)/buildutils/ac_c_bigendian_cross.m4 \ $(top_srcdir)/buildutils/t_add_rpath.m4 \ $(top_srcdir)/buildutils/tac_tcltk.m4 \ $(top_srcdir)/buildutils/ax_cflags_gcc_option.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/buildutils/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/pbs_config.h CONFIG_CLEAN_FILES = torque.spec buildutils/pbs_mkdirs \ buildutils/self-extract-head-sh buildutils/modulefiles \ buildutils/modulefiles.vers am__installdirs = "$(DESTDIR)$(bindir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCPA_FALSE = @BUILDCPA_FALSE@ BUILDCPA_TRUE = @BUILDCPA_TRUE@ BUILD_L26_CPUSETS_FALSE = @BUILD_L26_CPUSETS_FALSE@ BUILD_L26_CPUSETS_TRUE = @BUILD_L26_CPUSETS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DRMAA_DOCS_FALSE = @DRMAA_DOCS_FALSE@ DRMAA_DOCS_TRUE = @DRMAA_DOCS_TRUE@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_QSTAT_LIBS = @EXTRA_QSTAT_LIBS@ F77 = @F77@ FFLAGS = @FFLAGS@ GENERIC_CONFIG = @GENERIC_CONFIG@ GPERF = @GPERF@ HAVE_DOT = @HAVE_DOT@ INCLUDE_CLIENTS_FALSE = @INCLUDE_CLIENTS_FALSE@ INCLUDE_CLIENTS_TRUE = @INCLUDE_CLIENTS_TRUE@ INCLUDE_DRMAA_FALSE = @INCLUDE_DRMAA_FALSE@ INCLUDE_DRMAA_TRUE = @INCLUDE_DRMAA_TRUE@ INCLUDE_GUI_FALSE = @INCLUDE_GUI_FALSE@ INCLUDE_GUI_TRUE = @INCLUDE_GUI_TRUE@ INCLUDE_MOM_FALSE = @INCLUDE_MOM_FALSE@ INCLUDE_MOM_RCP_FALSE = @INCLUDE_MOM_RCP_FALSE@ INCLUDE_MOM_RCP_TRUE = @INCLUDE_MOM_RCP_TRUE@ INCLUDE_MOM_TRUE = @INCLUDE_MOM_TRUE@ INCLUDE_PAM_FALSE = @INCLUDE_PAM_FALSE@ INCLUDE_PAM_TRUE = @INCLUDE_PAM_TRUE@ INCLUDE_SERVER_FALSE = @INCLUDE_SERVER_FALSE@ INCLUDE_SERVER_TRUE = @INCLUDE_SERVER_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULEFILES_FALSE = @INSTALL_MODULEFILES_FALSE@ INSTALL_MODULEFILES_TRUE = @INSTALL_MODULEFILES_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MODULEFILES_DIR = @MODULEFILES_DIR@ MOMLIBS = @MOMLIBS@ MY_TCLTK_INCS = @MY_TCLTK_INCS@ MY_TCLTK_LIBS = @MY_TCLTK_LIBS@ MY_TCL_INCS = @MY_TCL_INCS@ MY_TCL_LIBS = @MY_TCL_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PBSPOE = @PBSPOE@ PBSPOEO = @PBSPOEO@ PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@ PBS_DEFAULT_SERVER = @PBS_DEFAULT_SERVER@ PBS_ENVIRON = @PBS_ENVIRON@ PBS_MACH = @PBS_MACH@ PBS_SERVER_HOME = @PBS_SERVER_HOME@ PIC = @PIC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RCP_ARGS = @RCP_ARGS@ RCP_PATH = @RCP_PATH@ READLINE_LIBS = @READLINE_LIBS@ ROFF = @ROFF@ RPM_AC_OPTS = @RPM_AC_OPTS@ RSH_PATH = @RSH_PATH@ SCHD_BASL_FALSE = @SCHD_BASL_FALSE@ SCHD_BASL_TRUE = @SCHD_BASL_TRUE@ SCHD_CODE = @SCHD_CODE@ SCHD_LIBS = @SCHD_LIBS@ SCHD_TYPE = @SCHD_TYPE@ SCHD_TYPE_SUBDIR = @SCHD_TYPE_SUBDIR@ SENDMAIL_CMD = @SENDMAIL_CMD@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_NAME = @SPEC_NAME@ SPEC_VERSION = @SPEC_VERSION@ STRIP = @STRIP@ TBL = @TBL@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TK_BIN_DIR = @TK_BIN_DIR@ TK_INCLUDES = @TK_INCLUDES@ TK_LIBS = @TK_LIBS@ TK_LIB_FILE = @TK_LIB_FILE@ TK_LIB_FLAG = @TK_LIB_FLAG@ TK_LIB_SPEC = @TK_LIB_SPEC@ TK_SRC_DIR = @TK_SRC_DIR@ TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@ TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@ TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@ TK_VERSION = @TK_VERSION@ TK_XINCLUDES = @TK_XINCLUDES@ USE_TCLQSTAT_FALSE = @USE_TCLQSTAT_FALSE@ USE_TCLQSTAT_TRUE = @USE_TCLQSTAT_TRUE@ USING_RPP_FALSE = @USING_RPP_FALSE@ USING_RPP_TRUE = @USING_RPP_TRUE@ USING_SYSLOG_FALSE = @USING_SYSLOG_FALSE@ USING_SYSLOG_TRUE = @USING_SYSLOG_TRUE@ USING_TCL_FALSE = @USING_TCL_FALSE@ USING_TCL_TRUE = @USING_TCL_TRUE@ USING_TK_FALSE = @USING_TK_FALSE@ USING_TK_TRUE = @USING_TK_TRUE@ VERSION = @VERSION@ WISH_PROG = @WISH_PROG@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ acx_pthread_config = @acx_pthread_config@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_clients = @build_clients@ build_cpu = @build_cpu@ build_drmaa = @build_drmaa@ build_drmaa_docs = @build_drmaa_docs@ build_gui = @build_gui@ build_mom = @build_mom@ build_os = @build_os@ build_pbs_rcp = @build_pbs_rcp@ build_server = @build_server@ build_vendor = @build_vendor@ datadir = @datadir@ drmaadocdir = @drmaadocdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pammoddir = @pammoddir@ prefix = @prefix@ program_prefix = @program_prefix@ program_suffix = @program_suffix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tclx_LIB_FILE = @tclx_LIB_FILE@ tclx_LIB_SPEC = @tclx_LIB_SPEC@ tclx_SRC_DIR = @tclx_SRC_DIR@ tclx_STUB_LIB_FILE = @tclx_STUB_LIB_FILE@ tclx_STUB_LIB_PATH = @tclx_STUB_LIB_PATH@ tclx_STUB_LIB_SPEC = @tclx_STUB_LIB_SPEC@ tclx_VERSION = @tclx_VERSION@ tkx_LIB_FILE = @tkx_LIB_FILE@ tkx_LIB_SPEC = @tkx_LIB_SPEC@ tkx_SRC_DIR = @tkx_SRC_DIR@ tkx_STUB_LIB_FILE = @tkx_STUB_LIB_FILE@ tkx_STUB_LIB_PATH = @tkx_STUB_LIB_PATH@ tkx_STUB_LIB_SPEC = @tkx_STUB_LIB_SPEC@ tkx_VERSION = @tkx_VERSION@ use_tcl = @use_tcl@ use_tk = @use_tk@ xauth_path = @xauth_path@ AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter SUBDIRS = src doc EXTRA_DIST = CHANGELOG \ INSTALL.GNU \ PBS_License.txt \ README.configure \ README.cygwin \ README.torque \ Release_Notes \ torque.setup \ torque.spec \ buildutils/config.mk \ buildutils/modulefiles.in \ buildutils/modulefiles.vers.in \ buildutils/pbs_mach_type \ buildutils/pbs_mkdirs.in \ buildutils/self-extract-head-sh.in \ buildutils/torque.spec.in \ contrib/blcr/checkpoint_script \ contrib/blcr/restart_script \ contrib/init.d/debian.pbs_mom \ contrib/init.d/debian.pbs_sched \ contrib/init.d/debian.pbs_server \ contrib/init.d/pbs_mom \ contrib/init.d/pbs_sched \ contrib/init.d/pbs_server \ contrib/init.d/suse.pbs_mom \ contrib/init.d/suse.pbs_sched \ contrib/init.d/suse.pbs_server \ contrib/pam_authuser.tar.gz \ contrib/pbstop \ contrib/pbsweb-lite-0.95.tar.gz \ contrib/pestat-1.0/Makefile \ contrib/pestat-1.0/pestat.c \ contrib/pestat-1.0/README \ contrib/qpeek \ contrib/qpool.gz \ contrib/README.pam_authuser \ contrib/README.pbs_ganglia_jobmonarch \ contrib/README.pbs_python \ contrib/README.pbstools \ contrib/README.pbstop \ contrib/README.pbs_weblite \ contrib/README.pestat \ contrib/README.qpeek bin_SCRIPTS = pbs-config DISTCLEANFILES = pbs-config DISTCHECK_CONFIGURE_FLAGS = --with-server-home=$$dc_install_base/spool # # Used by the 'packages' target below # # Additional package name, should be redefined to something meaningful to # the user. PKGNAME = package # Directory with files that override the packaged files. # Can be redefined on the make cmdline to a permanent location PKGOVERRIDE = $(PWD)/pkgoverride # temp dir for the packaged files and tarballs PKGROOT = $(PWD)/tpackages @INCLUDE_SERVER_TRUE@SERVER_PKG = server @INCLUDE_MOM_TRUE@MOM_PKG = mom @INCLUDE_CLIENTS_TRUE@CLIENTS_PKG = clients @INCLUDE_GUI_TRUE@GUI_PKG = gui @INCLUDE_PAM_TRUE@PAM_PKG = pam @INCLUDE_DRMAA_TRUE@DRMAA_PKG = drmaa ALL_PKGS = $(SERVER_PKG) $(MOM_PKG) $(CLIENTS_PKG) $(GUI_PKG) $(PAM_PKG) $(DRMAA_PKG) devel doc all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/buildutils/config.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) torque.spec: $(top_builddir)/config.status $(top_srcdir)/buildutils/torque.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ buildutils/pbs_mkdirs: $(top_builddir)/config.status $(top_srcdir)/buildutils/pbs_mkdirs.in cd $(top_builddir) && $(SHELL) ./config.status $@ buildutils/self-extract-head-sh: $(top_builddir)/config.status $(top_srcdir)/buildutils/self-extract-head-sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ buildutils/modulefiles: $(top_builddir)/config.status $(top_srcdir)/buildutils/modulefiles.in cd $(top_builddir) && $(SHELL) ./config.status $@ buildutils/modulefiles.vers: $(top_builddir)/config.status $(top_srcdir)/buildutils/modulefiles.vers.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/buildutils $(distdir)/contrib $(distdir)/contrib/blcr $(distdir)/contrib/init.d $(distdir)/contrib/pestat-1.0 $(distdir)/src/drmaa @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @INSTALL_MODULEFILES_FALSE@install-data-hook: @INSTALL_MODULEFILES_FALSE@uninstall-hook: clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-binSCRIPTS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-info-am @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am \ install-data-hook install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS uninstall-hook \ uninstall-info-am snap: $(MAKE) VERSION=$(VERSION)-snap.$${snapstamp:-`date +%Y%m%d%H%M`} dist dist-hook: case $(VERSION) in *-snap.*) \ for SPEC in torque.spec buildutils/torque.spec.in ; do \ chmod u+w $(distdir)/$$SPEC ; \ sed -e 's/^.define snap .*/%define snap 1/;' \ -e 's/^.define tarversion .*/%define tarversion $(VERSION)/' \ $(srcdir)/$$SPEC > $(distdir)/$$SPEC ; \ done ; \ chmod u+wx $(distdir)/configure ; \ sed -e 's/VERSION=.*/VERSION=$(VERSION)/' $(srcdir)/configure > $(distdir)/configure ;; \ esac chmod u+w $(distdir)/README.torque sed -e 's/TORQUE .* README .*/TORQUE $(VERSION) README (released '"`date '+%b, %d %Y'`"')/' $(srcdir)/README.torque > $(distdir)/README.torque srpm: dist rpmbuild -ts $(distdir).tar.gz rpm: dist rpmbuild $(RPM_AC_OPTS) $(RPMOPTS) -tb $(distdir).tar.gz install_server install_mom install_clients install_gui install_lib install_pam install_drmaa: (cd src && $(MAKE) $@) install_doc: (cd doc && $(MAKE) $@) install_devel: install-binSCRIPTS (cd src && $(MAKE) $@) packages: @if `echo $(PKGROOT) | grep ^/ >/dev/null`;then \ echo "Building packages from $(PKGROOT)"; \ else \ echo "Error: PKGROOT must be an absolute path"; \ exit 1; \ fi rm -rf $(PKGROOT) mkdir $(PKGROOT) @for d in $(ALL_PKGS);do \ proot=$(PKGROOT)/$$d; \ pname=$(PKGNAME); \ phost=$(PBS_MACH)-@host_cpu@; \ tarball=$(PKGROOT)/$(PACKAGE_NAME)-$$pname-$$d-$$phost.tar.gz; \ pkgfile=./$(PACKAGE_NAME)-$$pname-$$d-$$phost.sh; \ echo "Building $$pkgfile ..."; \ $(MAKE) DESTDIR=$$proot install_$$d >/dev/null || exit 1; \ case $$d in \ devel) :;; \ *) rm -f $$proot/$(libdir)/*a $$proot/$(libdir)/*.so;; \ esac; \ if test -d $(PKGOVERRIDE)/$$d ;then \ echo "Using override dir $(PKGOVERRIDE)/$$d"; \ ( cd $(PKGOVERRIDE)/$$d && tar cf - . | (cd $$proot; tar xvf - ) ); \ fi; \ test $$d = gui && echo dummy > $$proot/regen-tclIndex; \ ( cd $$proot; tar cf - * ) | gzip > $$tarball && \ ( cd $$proot; tar cf - \ `test -f ./post-install && echo ./post-install` \ `test -f ./regen-tclIndex && echo ./regen-tclIndex` \ `test -d .$(sbindir) && echo .$(sbindir)/*` \ `test -d .$(bindir) && echo .$(bindir)/*` \ `test -d .$(libdir) && echo .$(libdir)/*` \ `test -d .$(mandir) && echo .$(mandir)/*/*` \ `test -d .$(includedir) && echo .$(includedir)/*` \ `test -d .$(pammoddir) && echo .$(pammoddir)/*` \ `test -d .$(PBS_SERVER_HOME) && echo .$(PBS_SERVER_HOME)/*` ) \ | gzip > $$tarball && \ cat ./buildutils/self-extract-head-sh > $$pkgfile && \ cat $$tarball >> $$pkgfile && \ chmod 755 $$pkgfile; \ done @echo "Done." @echo "" @echo "The package files are self-extracting packages that can be copied"; \ echo "and executed on your production machines. Use --help for options."; @INSTALL_MODULEFILES_TRUE@install-data-hook: @INSTALL_MODULEFILES_TRUE@ $(INSTALL_DATA) -D ./buildutils/modulefiles $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/$(PACKAGE_VERSION) @INSTALL_MODULEFILES_TRUE@ $(INSTALL_DATA) ./buildutils/modulefiles.vers $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/.version @INSTALL_MODULEFILES_TRUE@uninstall-hook: @INSTALL_MODULEFILES_TRUE@ rm -f $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/$(PACKAGE_VERSION) @INSTALL_MODULEFILES_TRUE@ rm -f $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/.version @INSTALL_MODULEFILES_TRUE@ rmdir $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torque-2.4.16/torque.spec0000664000113300011330000003007411614035144012232 00000000000000# Conditional build stuff; from rpm 4.4 /usr/lib/rpm/macros. # bcond_without defaults to WITH, and vice versa. %if %{!?with:1}0 %define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} %endif %if %{!?without:1}0 %define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} %endif %if %{!?bcond_with:1}0 %define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} %endif %if %{!?bcond_without:1}0 %define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} %endif %define _missing_doc_files_terminate_build 0 ### Features disabled by default %bcond_with drmaa %bcond_with gui %bcond_with pam ### Features enabled by default %bcond_without scp %bcond_without syslog ### Autoconf macro expansions %define ac_with_drmaa --%{?with_drmaa:en}%{!?with_drmaa:dis}able-drmaa %define ac_with_gui --%{?with_gui:en}%{!?with_gui:dis}able-gui --with%{!?with_gui:out}-tcl %define ac_with_pam --with%{!?with_pam:out}-pam%{?with_pam:=/%{_lib}/security} %define ac_with_scp --with-rcp=%{?with_scp:scp}%{!?with_scp:pbs_rcp} %define ac_with_syslog --%{?with_syslog:en}%{!?with_syslog:dis}able-syslog ### Build Requirements %define breq_gui %{?with_gui:tcl-devel tk-devel tclx} %define breq_pam %{?with_pam:pam-devel} %define breq_scp %{?with_scp:/usr/bin/scp} ### Macro variables %{!?torque_user:%global torque_user torque} %{!?torque_home:%global torque_home %{_var}/spool/%{name}} %{!?torque_server:%global torque_server localhost} ### Do not strip executables #define __os_install_post /usr/lib/rpm/brp-compress ### Handle logic for snapshots %define tarversion 2.4.16 #define snap 0 %if %{?snap}0 %{expand:%%define version %(echo %{tarversion} | sed 's/-snap\..*$//')} %{expand:%%define release 0.cri.snap.%(echo %{tarversion} | sed 's/^.*-snap\.//')} %else %define version %{tarversion} %define release 1.cri %endif Summary: Tera-scale Open-source Resource and QUEue manager Name: torque Version: %{version} Release: %{release} License: OpenPBS License (ASF-like) Group: Applications/System URL: http://www.clusterresources.com/products/torque/ Source: http://www.clusterresources.com/downloads/torque/%{name}-%{tarversion}.tar.gz Packager: %{?_packager:%{_packager}}%{!?_packager:%{_vendor}} Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:%{_vendor}} Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} #BuildSuggests: openssh-clients tcl-devel tclx tk-devel BuildRequires: %{breq_gui} %{breq_pam} %{breq_scp} make Conflicts: pbspro, openpbs, openpbs-oscar Obsoletes: scatorque <= %{version}-%{release}, %{!?with_gui:%{name}-gui < %{version}-%{release}} Provides: pbs, pbs-docs, pbs-pam, %{!?with_gui:%{name}-gui = %{version}-%{release}} Provides: %{name}-docs = %{version}-%{release} Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description TORQUE is an open source resource manager providing control over batch jobs and distributed compute nodes. It is a community effort based on the original *PBS project and, with more than 1,200 patches, has incorporated significant advances in the areas of scalability, fault tolerance, and feature extensions contributed by NCSA, OSC, USC, the U.S. Dept of Energy, Sandia, PNNL, U of Buffalo, TeraGrid, and many other leading edge HPC organizations. %package server Summary: TORQUE Server Group: Applications/System Provides: pbs-server = %{version}-%{release} %description server Package for TORQUE server systems. %package devel Summary: TORQUE Development Files Group: Applications/System Requires: %{name} = %{version}-%{release} Provides: pbs-devel = %{version}-%{release} Provides: lib%{name}-devel = %{version}-%{release} %description devel Development headers and libraries for TORQUE %package scheduler Summary: TORQUE FIFO Scheduler Group: Applications/System Requires: %{name} = %{version}-%{release} Provides: pbs-scheduler = %{version}-%{release} %description scheduler A simple FIFO scheduler for TORQUE %package client Summary: TORQUE Client Group: Applications/System Requires: %{name} = %{version}-%{release} Provides: pbs-client pbs-mom %{?with_pam:pbs-pam} Provides: %{name}-mom = %{version}-%{release} Obsoletes: %{name}-mom < %{version}-%{release} %if %{with pam} Provides: %{name}-pam = %{version}-%{release} Obsoletes: %{name}-pam < %{version}-%{release} %endif %description client Package for TORQUE client systems. %if %{with gui} %package gui Summary: TORQUE GUI Group: Applications/System Requires: %{name}-client = %{version}-%{release} Provides: pbs-gui = %{version}-%{release}, xpbs, xpbsmon %description gui Graphical clients for TORQUE %endif %if %{with drmaa} %package drmaa Summary: DRMAA 1.0 Implementation for TORQUE Group: Applications/System Provides: pbs-drmaa = %{version}-%{release} %description drmaa This package contains a DRMAA 1.0 implementation for use with TORQUE. %endif %prep %setup -q -n %{name}-%{tarversion} %build CFLAGS="%{?cflags:%{cflags}}%{!?cflags:$RPM_OPT_FLAGS}" CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}" export CFLAGS CXXFLAGS %configure --includedir=%{_includedir}/%{name} --with-default-server=%{torque_server} \ %{ac_with_gui} %{ac_with_scp} %{ac_with_syslog} %{ac_with_pam} %{ac_with_drmaa} \ --disable-gcc-warnings --with-server-home=%{torque_home} --disable-qsub-keep-override \ --with-high-availability --with-sendmail=%{_sbindir}/sendmail %{?acflags} %{__make} %{?_smp_mflags} %{?mflags} %install %{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install} %{__rm} -rf $RPM_BUILD_ROOT/%{_lib}/security/*a $RPM_BUILD_ROOT%{_sysconfdir}/modulefiles # init.d scripts %{__mkdir_p} $RPM_BUILD_ROOT%{_initrddir} INIT_PREFIX="" test -f /etc/SuSE-release && INIT_PREFIX="suse." for PROG in pbs_mom pbs_sched pbs_server ; do %{__sed} -e 's|^PBS_HOME=.*|PBS_HOME=%{torque_home}|' \ -e 's|^PBS_DAEMON=.*|PBS_DAEMON=%{_sbindir}/'$PROG'|' contrib/init.d/$INIT_PREFIX$PROG \ > $RPM_BUILD_ROOT%{_initrddir}/$PROG %{__chmod} 0755 $RPM_BUILD_ROOT%{_initrddir}/$PROG done # Configuration echo %{torque_server} > $RPM_BUILD_ROOT%{torque_home}/server_priv/nodes echo '$pbsserver %{torque_server}' > $RPM_BUILD_ROOT%{torque_home}/mom_priv/config # Moab requires libtorque.so.0, but works with libtorque.so.2, so fudge it. %{__ln_s} libtorque.so.2 $RPM_BUILD_ROOT%{_libdir}/libtorque.so.0 %if %{with drmaa} # Move DRMAA docs back to the source tree so we can install them properly. mv $RPM_BUILD_ROOT%{_docdir}/*drmaa* drmaa-doc-dir %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post server if [ $1 -eq 1 ]; then grep '^%{torque_user}:' /etc/passwd >/dev/null 2>&1 || useradd -r %{torque_user} || : grep 'PBS services' /etc/services >/dev/null 2>&1 || cat <<-EOF >>/etc/services # Standard PBS services pbs 15001/tcp # pbs server (pbs_server) pbs 15001/udp # pbs server (pbs_server) pbs_mom 15002/tcp # mom to/from server pbs_mom 15002/udp # mom to/from server pbs_resmom 15003/tcp # mom resource management requests pbs_resmom 15003/udp # mom resource management requests pbs_sched 15004/tcp # scheduler pbs_sched 15004/udp # scheduler EOF pbs_server -t create || exit 0 if [ "%{torque_server}" = "localhost" ]; then TORQUE_SERVER=`hostname` perl -pi -e "s/localhost/$TORQUE_SERVER/g" %{torque_home}/server_name %{torque_home}/server_priv/nodes 2>/dev/null || : else TORQUE_SERVER="%{torque_server}" fi qmgr -c "set server scheduling = true" >/dev/null 2>&1 || : qmgr -c "set server operators += root@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "set server managers += root@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "set server operators += %{torque_user}@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "set server managers += %{torque_user}@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "create queue batch queue_type = execution" >/dev/null 2>&1 || : qmgr -c "set queue batch started = true" >/dev/null 2>&1 || : qmgr -c "set queue batch enabled = true" >/dev/null 2>&1 || : qmgr -c "set queue batch resources_default.walltime = 1:00:00" >/dev/null 2>&1 || : qmgr -c "set queue batch resources_default.nodes = 1" >/dev/null 2>&1 || : qmgr -c "set server default_queue = batch" >/dev/null 2>&1 || : qmgr -c "set node $TORQUE_SERVER state = free" >/dev/null 2>&1 || : chkconfig pbs_server on >/dev/null 2>&1 || : service pbs_server condrestart >/dev/null 2>&1 || : fi %preun server if [ $1 -eq 0 ]; then chkconfig pbs_server off service pbs_server stop >/dev/null 2>&1 || : fi %post client if [ $1 -eq 1 ]; then grep 'PBS services' /etc/services >/dev/null 2>&1 || cat <<-EOF >>/etc/services # Standard PBS services pbs 15001/tcp # pbs server (pbs_server) pbs 15001/udp # pbs server (pbs_server) pbs_mom 15002/tcp # mom to/from server pbs_mom 15002/udp # mom to/from server pbs_resmom 15003/tcp # mom resource management requests pbs_resmom 15003/udp # mom resource management requests pbs_sched 15004/tcp # scheduler pbs_sched 15004/udp # scheduler EOF if [ "%{torque_server}" = "localhost" ]; then TORQUE_SERVER=`hostname` perl -pi -e "s/localhost/$TORQUE_SERVER/g" %{torque_home}/mom_priv/config 2>/dev/null || : fi chkconfig pbs_mom on service pbs_mom condrestart >/dev/null 2>&1 || : fi %preun client if [ $1 -eq 0 ]; then chkconfig pbs_mom off service pbs_mom stop >/dev/null 2>&1 || : fi %post scheduler if [ $1 -eq 1 ]; then chkconfig pbs_sched on service pbs_sched condrestart >/dev/null 2>&1 || : fi %preun scheduler if [ $1 -eq 0 ]; then chkconfig pbs_sched off service pbs_sched stop >/dev/null 2>&1 || : fi %clean test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %doc INSTALL INSTALL.GNU CHANGELOG PBS_License.txt README.* Release_Notes src/pam/README.pam %doc doc/READ_ME doc/doc_fonts doc/soelim.c doc/ers %config(noreplace) %{torque_home}/pbs_environment %config(noreplace) %{torque_home}/server_name %{_bindir}/chk_tree %{_bindir}/hostn %{_bindir}/nqs2pbs %{_bindir}/pbs_track %{_bindir}/pbsdsh %{_bindir}/pbsnodes %{_bindir}/printjob %{_bindir}/printserverdb %{_bindir}/printtracking %{_bindir}/q* %{_bindir}/tracejob %attr(4755, root, root) %{_sbindir}/pbs_iff %if %{without scp} %attr(4755, root, root) %{_sbindir}/pbs_rcp %endif %{_libdir}/lib%{name}.so.* %{torque_home}/aux %{torque_home}/spool %{_mandir}/man*/* %files server %defattr(-, root, root) %doc torque.setup doc/admin_guide.ps %dir %{torque_home}/server_priv %config(noreplace) %{torque_home}/server_priv/nodes %{_initrddir}/pbs_server %{_sbindir}/momctl %{_sbindir}/pbs_server %{_sbindir}/qserverd %{torque_home}/server_logs %{torque_home}/server_priv/accounting %{torque_home}/server_priv/acl* %{torque_home}/server_priv/arrays %{torque_home}/server_priv/disallowed_types %{torque_home}/server_priv/hostlist %{torque_home}/server_priv/jobs %{torque_home}/server_priv/queues %files devel %defattr(-, root, root) %{_bindir}/pbs-config %{_includedir}/%{name} %{_libdir}/lib%{name}*a %{_libdir}/lib%{name}*so %files scheduler %defattr(-, root, root) %dir %{torque_home}/sched_priv %config(noreplace) %{torque_home}/sched_priv/* %{_sbindir}/pbs_sched %{_sbindir}/qschedd %{_initrddir}/pbs_sched %{torque_home}/sched_logs %files client %defattr(-, root, root) %dir %{torque_home}/mom_priv %config(noreplace) %{torque_home}/mom_priv/config %{_initrddir}/pbs_mom %{_sbindir}/pbs_demux %{_sbindir}/pbs_mom %{_sbindir}/qnoded %if %{with pam} /%{_lib}/security/pam_pbssimpleauth.so %endif %{torque_home}/checkpoint %{torque_home}/mom_logs %{torque_home}/mom_priv/jobs/ %{torque_home}/undelivered %if %{with gui} %files gui %defattr(-, root, root) %{_bindir}/pbs_tclsh %{_bindir}/pbs_wish %{_bindir}/xpbs* %{_libdir}/xpbs* %endif %if %{with drmaa} %files drmaa %defattr(-, root, root) %doc drmaa-doc-dir/* %{_includedir}/%{name}/drmaa.h %{_libdir}/libdrmaa.* %endif %changelog * Sat Apr 07 2007 Mezzanine - Specfile auto-generated by Mezzanine torque-2.4.16/buildutils/0000777000113300011330000000000011614035164012277 500000000000000torque-2.4.16/buildutils/pbs_mkdirs.in0000775000113300011330000003321111366342047014712 00000000000000#!/bin/sh # # # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # pbs_mkdirs: # # This will make the various directories that are needed for PBS # housekeeping. # # Usage: # pbs_mkdirs [-v] [-c] [-C chk_tree_location] what # -v be verbose # -c allow usage of chk_tree (do not use this within a make install) # -C Specify where the location of the chk_tree binary # what select from the following list # server -- dirs needed by pbs_server # mom -- dirs needed by pbs_mom # aux -- the aux directory # default -- the default file # common -- make common directory to all daemons # check -- run chk_tree (turns on -c automatically) # all -- do all of the above # # SVN INFO: # $Id: pbs_mkdirs.in 3590 2010-04-28 17:09:00Z ataufer $ # # # check tree should not be called until it is installed since # only relative paths are used by autoconf. # prefix=@prefix@ exec_prefix=@exec_prefix@ CHK_TREE=${DESTDIR}@bindir@/chk_tree PBS_DEFAULT_SERVER=@PBS_DEFAULT_SERVER@ # PBS_SERVER_HOME is defined without DESTDIR so that DEFAULT_FILE and EVIRON # can be based on SERVER_HOME. SERVER_HOME is defined a second time to pick # up DESTDIR test -n "$PBS_SERVER_HOME" || PBS_SERVER_HOME=@PBS_SERVER_HOME@ test -n "$PBS_DEFAULT_FILE" || PBS_DEFAULT_FILE=${DESTDIR}@PBS_DEFAULT_FILE@ test -n "$PBS_ENVIRON" || PBS_ENVIRON=${DESTDIR}@PBS_ENVIRON@ PBS_SERVER_HOME=${DESTDIR}$PBS_SERVER_HOME verbose="" display_flags() { cat << EOF Usage: pbs_mkdirs [-v] [-c] [-C chk_tree_location] what -v be verbose -c allow usage of chk_tree (do not use this within a make install) -C Specify where the location of the chk_tree binary what select from the following list server -- dirs needed by pbs_server mom -- dirs needed by pbs_mom aux -- the aux directory default -- the default file common -- make common directory to all daemons check -- run chk_tree (turns on -c automatically) all -- do all of the above EOF exit 0 } # # this will create a directory and any chain of parent directories # that might be needed # All of this is somewhat lame because install-sh is used # along with install_dir in various places. # install_dir() { # use the id_ for namespace disambiguation id_dname="$1" id_mode=`test -n "$2" && echo "$2" || echo 755` # dlist will contain a list of directory names to make id_dlist="" while [ ! \( -z "$id_dname" -o "$id_dname" = / -o \ "$id_dname" = "." \) ]; do test -f $id_dname && return 1 test -d $id_dname && break id_dlist="`basename $id_dname` $id_dlist" id_dname=`dirname "$id_dname"` done id_dir="$id_dname" for id_d in $id_dlist ""; do id_dir="$id_dir/$id_d" test -z "$id_d" && return 0 mkdir $id_dir && chmod $id_mode $id_dir || return 1 done return 0 } # # This will take the name of the variable (not value) and # make a directory. This is just to stick with the original # way things were done in the top-level make file in PBS # install_dir_by_varname() { idv_dvarname="$1" idv_dname=`eval 'echo $'$idv_dvarname` idv_mode=`test -n "$2" && echo "$2" || echo 755` if [ X$idv_dname = X ] ; then echo $idv_dvarname is not defined 1>&2 return 1 elif [ -f $idv_dname ] ; then echo $idv_dvarname exists and is not a directory 1>&2 return 1 elif [ -d $idv_dname ] ; then chmod $idv_mode $idv_dname || return 1 return 0 elif [ ! -d $idv_dname ] ; then test -n "$verbose" && echo Creating $idv_dname install_dir `dirname $idv_dname` 755 && \ mkdir $idv_dname && chmod $idv_mode $idv_dname || return 1 fi return 0 } check_env() { test -n "$verbose" && echo Making environment file if [ ! -f $PBS_ENVIRON ] ; then install_dir `dirname $PBS_ENVIRON` || return 1 echo "PATH=/bin:/usr/bin" > $PBS_ENVIRON || return 1 if [ X$TZ != X ] ; then echo "TZ=$TZ" >> $PBS_ENVIRON || return 1 fi if [ X$LANG != X ] ; then echo "LANG=$LANG" >> $PBS_ENVIRON || return 1 fi if [ X$LC_ALL != X ] ; then echo "LC_ALL=$LC_ALL" >> $PBS_ENVIRON || return 1 fi if [ X$LC_COLLATE != X ] ; then echo "LC_COLLATE=$LC_COLLATE" >> $PBS_ENVIRON || return 1 fi if [ X$LC_CTYPE != X ] ; then echo "LC_CTYPE=$LC_CTYPE" >> $PBS_ENVIRON || return 1 fi if [ X$LC_MONETARY != X ] ; then echo "LC_MONETARY=$LC_MONETARY" >> $PBS_ENVIRON || return 1 fi if [ X$LC_NUMERIC != X ] ; then echo "LC_NUMERIC=$LC_NUMERIC" >> $PBS_ENVIRON || return 1 fi if [ X$LC_TIME != X ] ; then echo "LC_TIME=$LC_TIME" >> $PBS_ENVIRON || return 1 fi chmod 644 $PBS_ENVIRON || return 1 fi } chk_tree_wrap() { if test -n "$chktree";then $CHK_TREE $* || return 1 fi } mk_server_dirs() { test -n "$verbose" && echo Creating Directories required for the Server install_dir_by_varname PBS_SERVER_HOME 755 || return 1 install_dir $PBS_SERVER_HOME/spool 1777 || return 1 install_dir $PBS_SERVER_HOME/server_priv 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/jobs 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/hostlist 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/queues 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/acl_svr 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/acl_hosts 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/acl_users 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/acl_groups 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/disallowed_types 750 || return 1 install_dir $PBS_SERVER_HOME/server_priv/accounting 755 || return 1 install_dir $PBS_SERVER_HOME/server_logs 755 || return 1 install_dir $PBS_SERVER_HOME/sched_priv 750 || return 1 install_dir $PBS_SERVER_HOME/sched_priv/accounting 755 || return 1 install_dir $PBS_SERVER_HOME/sched_logs 755 || return 1 install_dir $PBS_SERVER_HOME/server_priv/arrays 750 || return 1 test -f $PBS_ENVIRON || check_env || return 1 chk_tree_wrap -d -n $PBS_SERVER_HOME/server_priv/jobs \ $PBS_SERVER_HOME/server_priv/hostlist \ $PBS_SERVER_HOME/server_priv/queues \ $PBS_SERVER_HOME/server_priv/acl_svr \ $PBS_SERVER_HOME/server_priv/acl_hosts \ $PBS_SERVER_HOME/server_priv/acl_users \ $PBS_SERVER_HOME/server_priv/acl_groups \ $PBS_SERVER_HOME/server_priv/accounting \ $PBS_SERVER_HOME/server_logs \ $PBS_SERVER_HOME/server_priv/arrays || return 1 chk_tree_wrap -d -n -s $PBS_SERVER_HOME/spool || return 1 chk_tree_wrap -n $PBS_ENVIRON || return 1 } mk_mom_dirs() { test -n "$verbose" && echo Creating Directories required for MOM install_dir_by_varname PBS_SERVER_HOME 755 || return 1 test -d $PBS_SERVER_HOME/spool || \ install_dir $PBS_SERVER_HOME/spool 1777 || return 1 install_dir $PBS_SERVER_HOME/checkpoint 770 || return 1 install_dir $PBS_SERVER_HOME/undelivered 1777 || return 1 install_dir $PBS_SERVER_HOME/mom_priv 751 || return 1 install_dir $PBS_SERVER_HOME/mom_priv/jobs 751 || return 1 install_dir $PBS_SERVER_HOME/mom_logs 755 || return 1 mk_default_file || return 1 test -f $PBS_ENVIRON || check_env || return 1 chk_tree_wrap -d -n $PBS_SERVER_HOME/checkpoint \ $PBS_SERVER_HOME/mom_priv/jobs \ $PBS_SERVER_HOME/mom_logs || return 1 chk_tree_wrap -d -n -s $PBS_SERVER_HOME/spool \ $PBS_SERVER_HOME/undelivered || return 1 chk_tree_wrap -n $PBS_ENVIRON || return 1 } mk_default_file() { test -n "$verbose" && echo Making default server file install_dir `dirname $PBS_DEFAULT_FILE` || return 1 # I think I know better than pbs. --pw if [ ! -e $PBS_DEFAULT_FILE ]; then rm -f $PBS_DEFAULT_FILE > /dev/null 2>&1 echo $PBS_DEFAULT_SERVER > $PBS_DEFAULT_FILE && \ chmod 644 $PBS_DEFAULT_FILE || return 1 fi chk_tree_wrap -n $PBS_DEFAULT_FILE || return 1 } mk_common() { mk_default_file || return 1 mk_aux_dir || return 1 install_dir $PBS_SERVER_HOME/spool 1777 || return 1 check_env || return 1 } mk_aux_dir() { install_dir $PBS_SERVER_HOME/aux 755 || return 1 chk_tree_wrap -d -n $PBS_SERVER_HOME/aux || return 1 } do_check_tree() { chk_tree_wrap -d $PBS_SERVER_HOME/server_priv/jobs \ $PBS_SERVER_HOME/server_priv/queues \ $PBS_SERVER_HOME/server_priv/acl_svr \ $PBS_SERVER_HOME/server_priv/acl_hosts \ $PBS_SERVER_HOME/server_priv/acl_users \ $PBS_SERVER_HOME/server_priv/acl_groups \ $PBS_SERVER_HOME/server_priv/accounting \ $PBS_SERVER_HOME/server_logs || return 1 chk_tree_wrap -d $PBS_SERVER_HOME/checkpoint \ $PBS_SERVER_HOME/mom_priv/jobs \ $PBS_SERVER_HOME/mom_logs || return 1 chk_tree_wrap -d -s $PBS_SERVER_HOME/spool \ $PBS_SERVER_HOME/undelivered || return 1 chk_tree_wrap -d $PBS_SERVER_HOME/aux || return 1 chk_tree_wrap $PBS_DEFAULT_FILE || return 1 } # mk_dirs() will generate the set of directories needed # for server and mom execution. mk_dirs() { chktree=yes mk_server_dirs || return 1 mk_mom_dirs || return 1 mk_default_file || return 1 mk_aux_dir || return 1 } getopt vcd:C:h "$@" > /dev/null || display_flags set -- `getopt vcd:C:h "$@"` while true do case "$1" in -v) verbose=yes shift ;; -d) PBS_SERVER_HOME=$2 shift 2 ;; -h) display_flags ;; -c) chktree=yes shift ;; -C) CHK_TREE=$2 shift 2 ;; --) shift; break ;; esac done while [ $# -gt 0 ] do case "$1" in serv*) mk_server_dirs || exit 1 break ;; mom*) mk_mom_dirs || exit 1 break ;; aux*) mk_aux_dir || exit 1 break ;; default*) mk_default_file || exit 1 break ;; common*) mk_common || exit 1 break ;; check*) chktree=yes do_check_tree || exit 1 break ;; all*) mk_dirs || exit 1 break ;; *) echo "$1 is unknown flag" display_flags break ;; esac shift done torque-2.4.16/buildutils/t_add_rpath.m40000664000113300011330000000153411272401234014726 00000000000000AC_DEFUN([T_ADD_RPATH], [ orig_libdir="$libdir" t_add_rpath_libs="" for lib_part in $$1 ;do case $lib_part in -L/*) t_libdir=`echo $lib_part | sed s/-L//` t_dir_in_syslib_path=no for sysdir in $sys_lib_dlsearch_path_spec ;do if test "X$t_libdir" = "X$sysdir" ;then t_dir_in_syslib_path=yes break fi done t_add_rpath_libs="${t_add_rpath_libs} ${lib_part}" if test "X$t_dir_in_syslib_path" = "Xno" ;then libdir="$t_libdir" eval "new_lib_spec=\"$hardcode_libdir_flag_spec\"" t_add_rpath_libs="${t_add_rpath_libs} ${new_lib_spec}" fi ;; -L) ;; *) t_add_rpath_libs="${t_add_rpath_libs} ${lib_part}" ;; esac done libdir="$orig_libdir" $1="$t_add_rpath_libs" ]) torque-2.4.16/buildutils/ac_create_generic_config.m40000664000113300011330000001610711272401234017406 00000000000000dnl @synopsis AC_CREATE_GENERIC_CONFIG [(PACKAGEnlibs [, VERSION])] dnl dnl Creates a generic PACKAGE-config file that has all the things that dnl you want, hmm, well, atleast it has --cflags, --version, --libs. dnl Ahhm, did you see ac_path_generic in the autoconf-archive? ;-) dnl dnl this macros saves you all the typing for a pkg-config.in script, dnl you don't even need to distribute one along. Place this macro in dnl your configure.ac, et voila, you got one that you want to install. dnl dnl oh, btw, if the first arg looks like "mylib -lwhat' then it will go dnl to be added to the --libs, and mylib is extracted. dnl dnl the defaults: $1 = $PACKAGE $LIBS $2 = $VERSION there is also an dnl AC_SUBST(GENERIC_CONFIG) that will be set to the name of the file dnl that we did output in this macro. Use as: dnl dnl install-exec-local: install-generic-config dnl dnl install-generic-config: dnl $(mkinstalldirs) $(DESTDIR)$(bindir) dnl $(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir) dnl dnl @category Misc dnl @author Guido Draheim dnl @version 2003-01-25 dnl @license GPLWithACException AC_DEFUN([AC_CREATE_GENERIC_CONFIG],[# create a generic PACKAGE-config file P=`echo $1` L=`echo ifelse($2, , $LIBS, $2)` V=`echo ifelse($3, , $VERSION, $3)` F=`echo $P-config` AC_MSG_RESULT(creating $F - generic $V for $L) test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' echo '#! /bin/sh' >$F echo ' ' >>$F echo 'package="'$P'"' >>$F echo 'version="'$V'"' >>$F echo ' ' >>$F # in the order of occurence a standard automake Makefile echo 'prefix="'$prefix'"' >>$F echo 'exec_prefix="'$exec_prefix'"' >>$F echo 'bindir="'$bindir'"' >>$F echo 'sbindir="'$sbindir'"' >>$F echo 'libexecdir="'$libexecdir'"' >>$F echo 'datadir="'$datadir'"' >>$F echo 'sysconfdir="'$sysconfdir'"' >>$F echo 'sharedstatedir="'$sharedstatedir'"' >>$F echo 'localstatedir="'$localstatedir'"' >>$F echo 'libdir="'$libdir'"' >>$F echo 'infodir="'$infodir'"' >>$F echo 'mandir="'$mandir'"' >>$F echo 'includedir="'$includedir'"' >>$F echo 'target="'$target'"' >>$F echo 'host="'$host'"' >>$F echo 'build="'$build'"' >>$F echo 'hardcode_libdir_flag="'`eval echo $hardcode_libdir_flag_spec`'"' >>$F echo 'sys_lib_dlsearch_path="'`eval echo $sys_lib_dlsearch_path_spec`'"' >>$F echo 'case " $sys_lib_dlsearch_path " in' >>$F echo ' *" '$libdir' "*) libs="'$L'" ;;' >>$F echo ' *) libs="-L$libdir '$L' $hardcode_libdir_flag" ;;' >>$F echo 'esac' >>$F echo ' ' >>$F echo 'if test "'"\$""#"'" -eq 0; then' >>$F echo ' cat <>$F echo 'Usage: $package-config [OPTIONS]' >>$F echo 'Options:' >>$F echo ' --prefix[=DIR]) : \$prefix' >>$F echo ' --package) : \$package' >>$F echo ' --version) : \$version' >>$F echo ' --cflags) : -I\$includedir' >>$F echo ' --libs) : -L\$libdir -l\$package' >>$F echo ' --help) print all the options (not just these)' >>$F echo 'EOF' >>$F echo 'fi' >>$F echo ' ' >>$F echo 'o=""' >>$F echo 'h=""' >>$F echo 'for i in "[$]@"; do' >>$F echo ' case $i in' >>$F echo ' --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$F echo ' --prefix) o="$o $prefix" ;;' >>$F echo ' --package) o="$o $package" ;;' >>$F echo ' --version) o="$o $version" ;;' >>$F echo ' --cflags) if test "_$includedir" != "_/usr/include"' >>$F echo ' then o="$o -I$includedir" ; fi' >>$F echo ' ;;' >>$F echo ' --libs) o="$o $libs" ;;' >>$F echo ' --exec_prefix|--eprefix) o="$o $exec_prefix" ;;' >>$F echo ' --bindir) o="$o $bindir" ;;' >>$F echo ' --sbindir) o="$o $sbindir" ;;' >>$F echo ' --libexecdir) o="$o $libexecdir" ;;' >>$F echo ' --datadir) o="$o $datadir" ;;' >>$F echo ' --datainc) o="$o -I$datadir" ;;' >>$F echo ' --datalib) o="$o -L$datadir" ;;' >>$F echo ' --sysconfdir) o="$o $sysconfdir" ;;' >>$F echo ' --sharedstatedir) o="$o $sharedstatedir" ;;' >>$F echo ' --localstatedir) o="$o $localstatedir" ;;' >>$F echo ' --libdir) o="$o $libdir" ;;' >>$F echo ' --libadd) o="$o -L$libdir" ;;' >>$F echo ' --infodir) o="$o $infodir" ;;' >>$F echo ' --mandir) o="$o $mandir" ;;' >>$F echo ' --includedir) o="$o $includedir" ;;' >>$F echo ' --target) o="$o $target" ;;' >>$F echo ' --host) o="$o $host" ;;' >>$F echo ' --build) o="$o $build" ;;' >>$F echo ' --data) o="$o -I$datadir/$package" ;;' >>$F echo ' --pkgdatadir) o="$o $datadir/$package" ;;' >>$F echo ' --pkgdatainc) o="$o -I$datadir/$package" ;;' >>$F echo ' --pkgdatalib) o="$o -L$datadir/$package" ;;' >>$F echo ' --pkglibdir) o="$o $libdir/$package" ;;' >>$F echo ' --pkglibinc) o="$o -I$libinc/$package" ;;' >>$F echo ' --pkglibadd) o="$o -L$libadd/$package" ;;' >>$F echo ' --pkgincludedir) o="$o $includedir/$package" ;;' >>$F echo ' --help) h="1" ;;' >>$F echo ' -?//*|-?/*//*|-?./*//*|//*|/*//*|./*//*) ' >>$F echo ' v=`echo $i | sed -e s://:\$:g`' >>$F echo ' v=`eval "echo $v"` ' >>$F echo ' o="$o $v" ;; ' >>$F echo ' esac' >>$F echo 'done' >>$F echo ' ' >>$F echo 'o=`eval "echo $o"`' >>$F echo 'o=`eval "echo $o"`' >>$F echo 'eval "echo $o"' >>$F echo ' ' >>$F echo 'if test ! -z "$h" ; then ' >>$F echo 'cat <>$F echo ' --prefix=xxx) (what is that for anyway?)' >>$F echo ' --prefix) \$prefix $prefix' >>$F echo ' --package) \$package $package' >>$F echo ' --version) \$version $version' >>$F echo ' --cflags) -I\$includedir unless it is /usr/include' >>$F echo ' --libs) -L\$libdir -l\$PACKAGE \$LIBS' >>$F echo ' --exec_prefix) or... ' >>$F echo ' --eprefix) \$exec_prefix $exec_prefix' >>$F echo ' --bindir) \$bindir $bindir' >>$F echo ' --sbindir) \$sbindir $sbindir' >>$F echo ' --libexecdir) \$libexecdir $libexecdir' >>$F echo ' --datadir) \$datadir $datadir' >>$F echo ' --sysconfdir) \$sysconfdir $sysconfdir' >>$F echo ' --sharedstatedir) \$sharedstatedir$sharedstatedir' >>$F echo ' --localstatedir) \$localstatedir $localstatedir' >>$F echo ' --libdir) \$libdir $libdir' >>$F echo ' --infodir) \$infodir $infodir' >>$F echo ' --mandir) \$mandir $mandir' >>$F echo ' --target) \$target $target' >>$F echo ' --host) \$host $host' >>$F echo ' --build) \$build $build' >>$F echo ' --data) -I\$datadir/\$package' >>$F echo ' --pkgdatadir) \$datadir/\$package' >>$F echo ' --pkglibdir) \$libdir/\$package' >>$F echo ' --pkgincludedir) \$includedir/\$package' >>$F echo ' --help) generated by ac_create_generic_config.m4' >>$F echo ' -I//varname and other inc-targets like --pkgdatainc supported' >>$F echo ' -L//varname and other lib-targets, e.g. --pkgdatalib or --libadd' >>$F echo 'EOF' >>$F echo 'fi' >>$F GENERIC_CONFIG="$F" AC_SUBST(GENERIC_CONFIG) ]) torque-2.4.16/buildutils/self-extract-head-sh.in0000664000113300011330000000736311503711446016467 00000000000000#!/bin/sh # self-extracting distribution packages PBS_SERVER_HOME=@PBS_SERVER_HOME@ PBS_DEFAULT_FILE=@PBS_DEFAULT_FILE@ PBS_ENVIRON=@PBS_ENVIRON@ export PBS_SERVER_HOME PBS_DEFAULT_FILE PBS_ENVIRON prefix=@prefix@ exec_prefix=@exec_prefix@ XPBS_DIR=@libdir@/xpbs XPBSMON_DIR=@libdir@/xpbsmon libdir=@libdir@ export XPBS_DIR XPBSMON_DIR conffiles="$PBS_SERVER_HOME/sched_priv/sched_config $PBS_SERVER_HOME/sched_priv/resource_group $PBS_SERVER_HOME/sched_priv/holidays $PBS_SERVER_HOME/sched_priv/dedicated_time $PBS_ENVIRON $PBS_DEFAULT_FILE $PBS_SERVER_HOME/server_priv_nodes" saveext=save.$$ SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0` # set package defaults install=0 listfiles=0 extract=0 user=0 group=0 chownfiles=1 saveconfs=1 destdir=/ verbose=0 postscript=1 vopt="" usage() { cat <<__EOF__ $0: [--install] [--listfiles] [--extractfiles] [--destdir dir] [--nochown] [--overwriteconf] [--instuser user] [--instgroup group] [--verbose] [--nopostscript] Usually just use --install __EOF__ } # parse command line args while test $# -gt 0 ;do case $1 in --install|-i) install=1;; --listfiles|-l) listfiles=1;; --extractfiles|-e) extract=1;; --destdir|-d) shift; destdir=$1/;; --nochown) chownfiles=0;; --overwriteconf) saveconfs=0;; --instuser) shift; user=$1;; --instgroup) shift; group=$1;; --nopostscript) postscript=0;; --verbose) verbose=1; vopt="v";; *) usage; exit 1;; esac shift done # user didn't specify an action if test $extract -lt 1 -a $listfiles -lt 1 -a $install -lt 1;then usage exit 1 fi # make sure any leading directories are created with world-readable perms umask 022 # # start doing real work # # extract the files in the tarball if test $extract -gt 0;then # be sure to respect $destdir test $destdir = / && destdir=. if test -d $destdir;then echo "Extracting files into $destdir..." else echo "Unable to extract files: $destdir is not a directory" 1>&2 exit 1 fi sed -n $SKIP,\$p $0 | gzip -dc | (cd $destdir; tar x${vopt}f -) echo "Done." fi # just list the files in the tarball if test $listfiles -gt 0;then sed -n $SKIP,\$p $0 | gzip -dc | tar t${vopt}f - fi # install the tarball if test $install -gt 0;then if test -d $destdir;then echo "" echo "Installing TORQUE archive... " echo "" else echo "Unable to install archive: $destdir is not a directory" 1>&2 exit 1 fi # save any existing conf files if test $saveconfs -gt 0;then for a in $conffiles;do test -f $destdir$a && mv -f$vopt $destdir$a $destdir$a.$saveext done fi # take the archive portion of this file and pipe it to tar sed -n $SKIP,\$p $0 | gzip -dc | (cd $destdir; tar x${vopt}f - ) # finallized files should be owned by root, not the package-builder if test $chownfiles -gt 0;then test $verbose -gt 0 && echo "setting file user and group ownerships" sed -n $SKIP,\$p $0 | gzip -dc | tar tf - | \ while read line;do chown $user $destdir$line; chgrp $group $destdir$line done fi # restore the original conf files if test $saveconfs -gt 0;then for a in $conffiles;do test -f $destdir$a -a -f $destdir$a.$saveext && mv -f$vopt $destdir$a $destdir$a.new; test -f $destdir$a.$saveext && mv -f$vopt $destdir$a.$saveext $destdir$a done fi # run user-specified post-install script if test -f ${destdir}post-install;then if test $postscript -gt 0;then test $verbose -gt 0 && echo "Running ${destdir}post-install..." ( cd $destdir && ./post-install && rm -f ./post-install ) else echo "Skipping ${destdir}post-install" fi fi echo "Done." fi exit 0 __ARCHIVE_FOLLOWS__ torque-2.4.16/buildutils/config.guess0000755000113300011330000012450411605403772014545 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. timestamp='2004-09-07' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: torque-2.4.16/buildutils/pbs_mach_type0000775000113300011330000001607711413216777015003 00000000000000#!/bin/sh # # OpenPBS (Portable Batch System) v2.3 Software License # # Copyright (c) 1999-2000 Veridian Information Solutions, Inc. # All rights reserved. # # --------------------------------------------------------------------------- # For a license to use or redistribute the OpenPBS software under conditions # other than those described below, or to purchase support for this software, # please contact Veridian Systems, PBS Products Department ("Licensor") at: # # www.OpenPBS.org +1 650 967-4675 sales@OpenPBS.org # 877 902-4PBS (US toll-free) # --------------------------------------------------------------------------- # # This license covers use of the OpenPBS v2.3 software (the "Software") at # your site or location, and, for certain users, redistribution of the # Software to other sites and locations. Use and redistribution of # OpenPBS v2.3 in source and binary forms, with or without modification, # are permitted provided that all of the following conditions are met. # After December 31, 2001, only conditions 3-6 must be met: # # 1. Commercial and/or non-commercial use of the Software is permitted # provided a current software registration is on file at www.OpenPBS.org. # If use of this software contributes to a publication, product, or # service, proper attribution must be given; see www.OpenPBS.org/credit.html # # 2. Redistribution in any form is only permitted for non-commercial, # non-profit purposes. There can be no charge for the Software or any # software incorporating the Software. Further, there can be no # expectation of revenue generated as a consequence of redistributing # the Software. # # 3. Any Redistribution of source code must retain the above copyright notice # and the acknowledgment contained in paragraph 6, this list of conditions # and the disclaimer contained in paragraph 7. # # 4. Any Redistribution in binary form must reproduce the above copyright # notice and the acknowledgment contained in paragraph 6, this list of # conditions and the disclaimer contained in paragraph 7 in the # documentation and/or other materials provided with the distribution. # # 5. Redistributions in any form must be accompanied by information on how to # obtain complete source code for the OpenPBS software and any # modifications and/or additions to the OpenPBS software. The source code # must either be included in the distribution or be available for no more # than the cost of distribution plus a nominal fee, and all modifications # and additions to the Software must be freely redistributable by any party # (including Licensor) without restriction. # # 6. All advertising materials mentioning features or use of the Software must # display the following acknowledgment: # # "This product includes software developed by NASA Ames Research Center, # Lawrence Livermore National Laboratory, and Veridian Information # Solutions, Inc. # Visit www.OpenPBS.org for OpenPBS software support, # products, and information." # # 7. DISCLAIMER OF WARRANTY # # THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT # ARE EXPRESSLY DISCLAIMED. # # IN NO EVENT SHALL VERIDIAN CORPORATION, ITS AFFILIATED COMPANIES, OR THE # U.S. GOVERNMENT OR ANY OF ITS AGENCIES BE LIABLE FOR ANY DIRECT OR INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This license will be governed by the laws of the Commonwealth of Virginia, # without reference to its choice of law rules. # # # This is a simple script that generates a machine type name # based on the output of uname. The generated name is in the # style of old PBS machine names and thus a hand generated # mapping needs to take place. If you port PBS to new architectures # you should modify the lookup table. A better way would have been # to name the machines in a more "standard" way but it would require # a considerable amount of effort to find all the dependencies in # the code and documentation. # # The big kluge is when we are on an AIX box to figure out whether or # not we are running on an SP2. What we do is have the user set # --enable-sp2 when configuring. Since this script is needed by configure # we can't perform a substitution on it based on the output of configure. # Thus the case of the sp2 will be handled by configure. # All of this is rather cheesy as sp2, aix3, aix4, and aix5 # are logically overlapping. # OS=`uname -s | tr '[A-Z]' '[a-z]'` REL=`uname -r` VER=`uname -v 2> /dev/null` test "$VER" = unicosmk && OS="$VER" bad_rel=n verbose=""; export verbose test "$1" = "-v" && verbose=yes case "$OS" in sun*) case "$REL" in 4*) mach=sunos4 ;; 5.10) mach=solaris7 ;; 5.[0123456]*) mach=solaris5 ;; 5.*) mach=solaris7 ;; *) bad_rel=y ;; esac ;; cm*) mach=cm5 ;; # # as usual, AIX is different... # aix*) REL=`uname -v` case "$REL" in 3*) mach=aix3 ;; 4*) mach=aix4 ;; 5*) mach=aix5 ;; *) bad_rel=y ;; esac ;; hp*) case "$REL" in B.1[1-9].[1-9]*) mach=hpux11 ;; *) mach=hpux10 ;; esac ;; irix*) case "$REL" in 5*) mach=irix5 ;; 6*) mach=irix6 ;; *) bad_rel=y ;; esac ;; netbsd*) mach=netbsd ;; freebsd*) if [ `echo "$REL" | cut -f 1 -d .` -lt 5 ]; then mach=freebsd else mach=freebsd5 fi ;; darwin*) mach=darwin ;; linux*) mach=linux ;; unicosmk*) mach=unicosmk2 ;; gnu/kfreebsd) mach=freebsd5 ;; gnu) mach=linux ;; unicos*) mach=unicos8 ;; sn*) if echo $OS | egrep '^sn[0-9]+$' > /dev/null ; then mach=unicos8; else echo $0: the operating system \"$OS\" is unknown >&2 ; echo unknown ; exit 1 ; fi;; osf*) mach=digitalunix ;; unix_system_v ) mach=fujitsu ;; *) test -n "$verbose" && \ echo $0: the operating system \"$OS\" is unknown >&2 ; echo unknown ; exit 1 ;; esac if test "$bad_rel" = y; then test -n "$verbose" && \ echo $0: for operating system \"$OS\", release \"$REL\" is unknown >&2 echo unknown exit 2 fi # # an irix6array is a machine running irix6 with the array daemon # configured to start at boot time. The whole concept of embedding # the release number of the OS in the machine type is retarded. # IRIX_ARRAY_CONF=/etc/config/array if test "$mach" = irix6; then test -r "$IRIX_ARRAY_CONF" && \ test `cat "$IRIX_ARRAY_CONF"` = on && \ mach=irix6array fi echo $mach exit 0 torque-2.4.16/buildutils/config.mk0000664000113300011330000000056311272401234014012 00000000000000AUTOMAKE_OPTIONS = foreign PBS_MKDIRS = $(SHELL) $(top_builddir)/buildutils/pbs_mkdirs AM_CPPFLAGS = -I$(top_srcdir)/src/include IFF_PATH = $(sbindir)/$(program_prefix)pbs_iff$(program_suffix) DEMUX_PATH = $(sbindir)/$(program_prefix)pbs_demux$(program_suffix) XPBS_DIR = $(libdir)/xpbs XPBSMON_DIR = $(libdir)/xpbsmon SUBMIT_FILTER_PATH = $(libexecdir)/qsub_filter torque-2.4.16/buildutils/torque.spec.in0000664000113300011330000003011111613641364015015 00000000000000# Conditional build stuff; from rpm 4.4 /usr/lib/rpm/macros. # bcond_without defaults to WITH, and vice versa. %if %{!?with:1}0 %define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} %endif %if %{!?without:1}0 %define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} %endif %if %{!?bcond_with:1}0 %define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} %endif %if %{!?bcond_without:1}0 %define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} %endif %define _missing_doc_files_terminate_build 0 ### Features disabled by default %bcond_with drmaa %bcond_with gui %bcond_with pam ### Features enabled by default %bcond_without scp %bcond_without syslog ### Autoconf macro expansions %define ac_with_drmaa --%{?with_drmaa:en}%{!?with_drmaa:dis}able-drmaa %define ac_with_gui --%{?with_gui:en}%{!?with_gui:dis}able-gui --with%{!?with_gui:out}-tcl %define ac_with_pam --with%{!?with_pam:out}-pam%{?with_pam:=/%{_lib}/security} %define ac_with_scp --with-rcp=%{?with_scp:scp}%{!?with_scp:pbs_rcp} %define ac_with_syslog --%{?with_syslog:en}%{!?with_syslog:dis}able-syslog ### Build Requirements %define breq_gui %{?with_gui:tcl-devel tk-devel tclx} %define breq_pam %{?with_pam:pam-devel} %define breq_scp %{?with_scp:/usr/bin/scp} ### Macro variables %{!?torque_user:%global torque_user torque} %{!?torque_home:%global torque_home %{_var}/spool/%{name}} %{!?torque_server:%global torque_server localhost} ### Do not strip executables #define __os_install_post /usr/lib/rpm/brp-compress ### Handle logic for snapshots %define tarversion @SPEC_VERSION@ #define snap 0 %if %{?snap}0 %{expand:%%define version %(echo %{tarversion} | sed 's/-snap\..*$//')} %{expand:%%define release 0.cri.snap.%(echo %{tarversion} | sed 's/^.*-snap\.//')} %else %define version %{tarversion} %define release 1.cri %endif Summary: Tera-scale Open-source Resource and QUEue manager Name: @SPEC_NAME@ Version: %{version} Release: %{release} License: OpenPBS License (ASF-like) Group: Applications/System URL: http://www.clusterresources.com/products/torque/ Source: http://www.clusterresources.com/downloads/torque/%{name}-%{tarversion}.tar.gz Packager: %{?_packager:%{_packager}}%{!?_packager:%{_vendor}} Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:%{_vendor}} Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} #BuildSuggests: openssh-clients tcl-devel tclx tk-devel BuildRequires: %{breq_gui} %{breq_pam} %{breq_scp} make Conflicts: pbspro, openpbs, openpbs-oscar Obsoletes: scatorque <= %{version}-%{release}, %{!?with_gui:%{name}-gui < %{version}-%{release}} Provides: pbs, pbs-docs, pbs-pam, %{!?with_gui:%{name}-gui = %{version}-%{release}} Provides: %{name}-docs = %{version}-%{release} Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description TORQUE is an open source resource manager providing control over batch jobs and distributed compute nodes. It is a community effort based on the original *PBS project and, with more than 1,200 patches, has incorporated significant advances in the areas of scalability, fault tolerance, and feature extensions contributed by NCSA, OSC, USC, the U.S. Dept of Energy, Sandia, PNNL, U of Buffalo, TeraGrid, and many other leading edge HPC organizations. %package server Summary: TORQUE Server Group: Applications/System Provides: pbs-server = %{version}-%{release} %description server Package for TORQUE server systems. %package devel Summary: TORQUE Development Files Group: Applications/System Requires: %{name} = %{version}-%{release} Provides: pbs-devel = %{version}-%{release} Provides: lib%{name}-devel = %{version}-%{release} %description devel Development headers and libraries for TORQUE %package scheduler Summary: TORQUE FIFO Scheduler Group: Applications/System Requires: %{name} = %{version}-%{release} Provides: pbs-scheduler = %{version}-%{release} %description scheduler A simple FIFO scheduler for TORQUE %package client Summary: TORQUE Client Group: Applications/System Requires: %{name} = %{version}-%{release} Provides: pbs-client pbs-mom %{?with_pam:pbs-pam} Provides: %{name}-mom = %{version}-%{release} Obsoletes: %{name}-mom < %{version}-%{release} %if %{with pam} Provides: %{name}-pam = %{version}-%{release} Obsoletes: %{name}-pam < %{version}-%{release} %endif %description client Package for TORQUE client systems. %if %{with gui} %package gui Summary: TORQUE GUI Group: Applications/System Requires: %{name}-client = %{version}-%{release} Provides: pbs-gui = %{version}-%{release}, xpbs, xpbsmon %description gui Graphical clients for TORQUE %endif %if %{with drmaa} %package drmaa Summary: DRMAA 1.0 Implementation for TORQUE Group: Applications/System Provides: pbs-drmaa = %{version}-%{release} %description drmaa This package contains a DRMAA 1.0 implementation for use with TORQUE. %endif %prep %setup -q -n %{name}-%{tarversion} %build CFLAGS="%{?cflags:%{cflags}}%{!?cflags:$RPM_OPT_FLAGS}" CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}" export CFLAGS CXXFLAGS %configure --includedir=%{_includedir}/%{name} --with-default-server=%{torque_server} \ %{ac_with_gui} %{ac_with_scp} %{ac_with_syslog} %{ac_with_pam} %{ac_with_drmaa} \ --disable-gcc-warnings --with-server-home=%{torque_home} --disable-qsub-keep-override \ --with-high-availability --with-sendmail=%{_sbindir}/sendmail %{?acflags} %{__make} %{?_smp_mflags} %{?mflags} %install %{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install} %{__rm} -rf $RPM_BUILD_ROOT/%{_lib}/security/*a $RPM_BUILD_ROOT%{_sysconfdir}/modulefiles # init.d scripts %{__mkdir_p} $RPM_BUILD_ROOT%{_initrddir} INIT_PREFIX="" test -f /etc/SuSE-release && INIT_PREFIX="suse." for PROG in pbs_mom pbs_sched pbs_server ; do %{__sed} -e 's|^PBS_HOME=.*|PBS_HOME=%{torque_home}|' \ -e 's|^PBS_DAEMON=.*|PBS_DAEMON=%{_sbindir}/'$PROG'|' contrib/init.d/$INIT_PREFIX$PROG \ > $RPM_BUILD_ROOT%{_initrddir}/$PROG %{__chmod} 0755 $RPM_BUILD_ROOT%{_initrddir}/$PROG done # Configuration echo %{torque_server} > $RPM_BUILD_ROOT%{torque_home}/server_priv/nodes echo '$pbsserver %{torque_server}' > $RPM_BUILD_ROOT%{torque_home}/mom_priv/config # Moab requires libtorque.so.0, but works with libtorque.so.2, so fudge it. %{__ln_s} libtorque.so.2 $RPM_BUILD_ROOT%{_libdir}/libtorque.so.0 %if %{with drmaa} # Move DRMAA docs back to the source tree so we can install them properly. mv $RPM_BUILD_ROOT%{_docdir}/*drmaa* drmaa-doc-dir %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post server if [ $1 -eq 1 ]; then grep '^%{torque_user}:' /etc/passwd >/dev/null 2>&1 || useradd -r %{torque_user} || : grep 'PBS services' /etc/services >/dev/null 2>&1 || cat <<-EOF >>/etc/services # Standard PBS services pbs 15001/tcp # pbs server (pbs_server) pbs 15001/udp # pbs server (pbs_server) pbs_mom 15002/tcp # mom to/from server pbs_mom 15002/udp # mom to/from server pbs_resmom 15003/tcp # mom resource management requests pbs_resmom 15003/udp # mom resource management requests pbs_sched 15004/tcp # scheduler pbs_sched 15004/udp # scheduler EOF pbs_server -t create || exit 0 if [ "%{torque_server}" = "localhost" ]; then TORQUE_SERVER=`hostname` perl -pi -e "s/localhost/$TORQUE_SERVER/g" %{torque_home}/server_name %{torque_home}/server_priv/nodes 2>/dev/null || : else TORQUE_SERVER="%{torque_server}" fi qmgr -c "set server scheduling = true" >/dev/null 2>&1 || : qmgr -c "set server operators += root@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "set server managers += root@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "set server operators += %{torque_user}@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "set server managers += %{torque_user}@$TORQUE_SERVER" >/dev/null 2>&1 || : qmgr -c "create queue batch queue_type = execution" >/dev/null 2>&1 || : qmgr -c "set queue batch started = true" >/dev/null 2>&1 || : qmgr -c "set queue batch enabled = true" >/dev/null 2>&1 || : qmgr -c "set queue batch resources_default.walltime = 1:00:00" >/dev/null 2>&1 || : qmgr -c "set queue batch resources_default.nodes = 1" >/dev/null 2>&1 || : qmgr -c "set server default_queue = batch" >/dev/null 2>&1 || : qmgr -c "set node $TORQUE_SERVER state = free" >/dev/null 2>&1 || : chkconfig pbs_server on >/dev/null 2>&1 || : service pbs_server condrestart >/dev/null 2>&1 || : fi %preun server if [ $1 -eq 0 ]; then chkconfig pbs_server off service pbs_server stop >/dev/null 2>&1 || : fi %post client if [ $1 -eq 1 ]; then grep 'PBS services' /etc/services >/dev/null 2>&1 || cat <<-EOF >>/etc/services # Standard PBS services pbs 15001/tcp # pbs server (pbs_server) pbs 15001/udp # pbs server (pbs_server) pbs_mom 15002/tcp # mom to/from server pbs_mom 15002/udp # mom to/from server pbs_resmom 15003/tcp # mom resource management requests pbs_resmom 15003/udp # mom resource management requests pbs_sched 15004/tcp # scheduler pbs_sched 15004/udp # scheduler EOF if [ "%{torque_server}" = "localhost" ]; then TORQUE_SERVER=`hostname` perl -pi -e "s/localhost/$TORQUE_SERVER/g" %{torque_home}/mom_priv/config 2>/dev/null || : fi chkconfig pbs_mom on service pbs_mom condrestart >/dev/null 2>&1 || : fi %preun client if [ $1 -eq 0 ]; then chkconfig pbs_mom off service pbs_mom stop >/dev/null 2>&1 || : fi %post scheduler if [ $1 -eq 1 ]; then chkconfig pbs_sched on service pbs_sched condrestart >/dev/null 2>&1 || : fi %preun scheduler if [ $1 -eq 0 ]; then chkconfig pbs_sched off service pbs_sched stop >/dev/null 2>&1 || : fi %clean test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %doc INSTALL INSTALL.GNU CHANGELOG PBS_License.txt README.* Release_Notes src/pam/README.pam %doc doc/READ_ME doc/doc_fonts doc/soelim.c doc/ers %config(noreplace) %{torque_home}/pbs_environment %config(noreplace) %{torque_home}/server_name %{_bindir}/chk_tree %{_bindir}/hostn %{_bindir}/nqs2pbs %{_bindir}/pbs_track %{_bindir}/pbsdsh %{_bindir}/pbsnodes %{_bindir}/printjob %{_bindir}/printserverdb %{_bindir}/printtracking %{_bindir}/q* %{_bindir}/tracejob %attr(4755, root, root) %{_sbindir}/pbs_iff %if %{without scp} %attr(4755, root, root) %{_sbindir}/pbs_rcp %endif %{_libdir}/lib%{name}.so.* %{torque_home}/aux %{torque_home}/spool %{_mandir}/man*/* %files server %defattr(-, root, root) %doc torque.setup doc/admin_guide.ps %dir %{torque_home}/server_priv %config(noreplace) %{torque_home}/server_priv/nodes %{_initrddir}/pbs_server %{_sbindir}/momctl %{_sbindir}/pbs_server %{_sbindir}/qserverd %{torque_home}/server_logs %{torque_home}/server_priv/accounting %{torque_home}/server_priv/acl* %{torque_home}/server_priv/arrays %{torque_home}/server_priv/disallowed_types %{torque_home}/server_priv/hostlist %{torque_home}/server_priv/jobs %{torque_home}/server_priv/queues %files devel %defattr(-, root, root) %{_bindir}/pbs-config %{_includedir}/%{name} %{_libdir}/lib%{name}*a %{_libdir}/lib%{name}*so %files scheduler %defattr(-, root, root) %dir %{torque_home}/sched_priv %config(noreplace) %{torque_home}/sched_priv/* %{_sbindir}/pbs_sched %{_sbindir}/qschedd %{_initrddir}/pbs_sched %{torque_home}/sched_logs %files client %defattr(-, root, root) %dir %{torque_home}/mom_priv %config(noreplace) %{torque_home}/mom_priv/config %{_initrddir}/pbs_mom %{_sbindir}/pbs_demux %{_sbindir}/pbs_mom %{_sbindir}/qnoded %if %{with pam} /%{_lib}/security/pam_pbssimpleauth.so %endif %{torque_home}/checkpoint %{torque_home}/mom_logs %{torque_home}/mom_priv/jobs/ %{torque_home}/undelivered %if %{with gui} %files gui %defattr(-, root, root) %{_bindir}/pbs_tclsh %{_bindir}/pbs_wish %{_bindir}/xpbs* %{_libdir}/xpbs* %endif %if %{with drmaa} %files drmaa %defattr(-, root, root) %doc drmaa-doc-dir/* %{_includedir}/%{name}/drmaa.h %{_libdir}/libdrmaa.* %endif %changelog * Sat Apr 07 2007 Mezzanine - Specfile auto-generated by Mezzanine torque-2.4.16/buildutils/ax_prog_dot.m40000664000113300011330000000026211272401234014757 00000000000000 AC_DEFUN([AX_PROG_DOT], [ AC_MSG_CHECKING([for dot]) if dot -V >/dev/null 2>&1; then HAVE_DOT=yes else HAVE_DOT=no fi AC_SUBST(HAVE_DOT) AC_MSG_RESULT([$HAVE_DOT]) ]) torque-2.4.16/buildutils/install-sh0000755000113300011330000002176611605403716014235 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-09-10.20 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: torque-2.4.16/buildutils/ltmain.sh0000644000113300011330000054670211605403462014051 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # RH: define SED for historic ltconfig's generated by Libtool 1.3 [ -z "$SED" ] && SED=sed # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.6 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)" EGREP="grep -E" # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $EXIT_SUCCESS ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $EXIT_SUCCESS ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $EXIT_SUCCESS ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit $EXIT_FAILURE fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # gcc -m* arguments should be passed to the linker via $compiler_flags # in order to pass architecture information to the linker # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo # but this is not reliable with gcc because gcc may use -mfoo to # select a different linker, different libraries, etc, while # -Wl,-mfoo simply passes -mfoo to the linker. -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in [0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in [0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in [0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$save_output-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadale object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in # this piecewise linking case whenever conflicting object # names appear in distinct ar calls; check, warn and compensate. if (for obj in $save_oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 AR_FLAGS=cq fi # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $EXIT_SUCCESS # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: torque-2.4.16/buildutils/tcl.m40000664000113300011330000030573411272401234013250 00000000000000# tcl.m4 -- # # This file provides a set of autoconf macros to help TEA-enable # a Tcl extension. # # Copyright (c) 1999-2000 Ajuba Solutions. # Copyright (c) 2002-2003 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: tcl.m4 1654 2007-11-21 23:33:54Z garrick $ AC_PREREQ(2.50) #------------------------------------------------------------------------ # TEA_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TCLCONFIG], [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib$libsuff 2>/dev/null` \ $sys_lib_search_path_spec \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="none" if test x"${with_tclconfig}" != x ; then AC_MSG_ERROR([Cannot find TCL config]) else AC_MSG_RESULT([none]) fi else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, AC_HELP_STRING([--with-tk],[directory containing tk configuration (tkConfig.sh)]), with_tkconfig=${withval}) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib$libsuff 2>/dev/null` \ $sys_lib_search_path_spec \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="none" if test x"${with_tkconfig}" != x ; then AC_MSG_ERROR([Cannot find Tk config]) else AC_MSG_RESULT([none]) fi else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} AC_MSG_RESULT([found $TK_BIN_DIR/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . $TCL_BIN_DIR/tclConfig.sh else AC_MSG_RESULT([file not found]) fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) #AC_SUBST(TCL_DBGX) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_SHLIB_LD_LIBS) #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) ]) #------------------------------------------------------------------------ # TEA_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TKCONFIG], [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . $TK_BIN_DIR/tkConfig.sh else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi # # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TK_BIN_DIR/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TK_DBGX substitution # eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) AC_SUBST(TK_STUB_LIB_SPEC) AC_SUBST(TK_LIBS) AC_SUBST(TK_XINCLUDES) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, [ --enable-shared build and link with shared libraries [--enable-shared]], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD) fi AC_SUBST(SHARED_BUILD) ]) #------------------------------------------------------------------------ # TEA_ENABLE_THREADS -- # # Specify if thread support should be enabled. If "yes" is # specified as an arg (optional), threads are enabled by default. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_THREADS], [ AC_ARG_ENABLE(threads, [ --enable-threads build with threads], [tcl_ok=$enableval], [tcl_ok=$1]) if test "$tcl_ok" = "yes"; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants. AC_DEFINE(USE_THREAD_ALLOC) AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the # same library, as some systems hide it there until # pthread.h is defined. We could alternatively do an # AC_TRY_COMPILE with pthread.h, but that will work with # libpthread really doesn't exist, like AIX 4.2. # [Bug: 4359] AC_CHECK_LIB(pthread, __pthread_mutex_init, tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 AC_MSG_WARN("Don t know how to find pthread lib on your system - thread support disabled") fi fi fi fi # Does the pthread-implementation provide # 'pthread_attr_setstacksize' ? ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" AC_CHECK_FUNCS(pthread_attr_setstacksize) LIBS=$ac_saved_libs AC_CHECK_FUNCS(readdir_r) fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with threads]) if test "${TCL_THREADS}" = "1"; then AC_DEFINE(TCL_THREADS) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no (default)]) fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then AC_MSG_WARN([ Building ${PACKAGE} without threads enabled, but building against a Tcl that IS thread-enabled.]) fi ;; *) if test "${TCL_THREADS}" = "1"; then AC_MSG_WARN([ --enable-threads requested, but attempting building against a Tcl that is NOT thread-enabled.]) fi ;; esac AC_SUBST(TCL_THREADS) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used # Memory (TCL_MEM_DEBUG) debugging can also be enabled. # # Arguments: # none # # Requires the following vars to be set: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to CFLAGS_DEBUG if true # Sets to CFLAGS_OPTIMIZE if false # LDFLAGS_DEFAULT Sets to LDFLAGS_DEBUG if true # Sets to LDFLAGS_OPTIMIZE if false # DBGX Debug library extension # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SYMBOLS], [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) if test "${TEA_PLATFORM}" = "windows" ; then tcl_dbgx=d else tcl_dbgx=g fi AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" TCL_DBGX="" AC_MSG_RESULT([no]) else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' DBGX=${tcl_dbgx} TCL_DBGX=${tcl_dbgx} if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi AC_SUBST(TCL_DBGX) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # TEA_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, [ --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic], [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no]) if test "$langinfo_ok" = "no"; then langinfo_ok="no (could not compile with nl_langinfo)"; fi if test "$langinfo_ok" = "yes"; then AC_DEFINE(HAVE_LANGINFO) fi fi AC_MSG_RESULT([$langinfo_ok]) ]) #-------------------------------------------------------------------- # TEA_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol is # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # TCL_LIB_FILE - Name of the file that contains the Tcl library, such # as libtcl7.8.so or libtcl7.8.a. # TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl" # in the shared library name, using the $VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${VERSION}.a # on AIX, since the Tcl shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${VERSION}${SHLIB_SUFFIX}. # TCL_NEEDS_EXP_FILE - # 1 means that an export file is needed to link to a # shared library. # TCL_EXP_FILE - The name of the installed export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # TCL_BUILD_EXP_FILE - # The name of the built export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # EXTRA_CFLAGS - # Extra CFLAGS to pass to the compiler # # Subst's the following vars: # DL_LIBS # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # CFLAGS_WARNING # # STLIB_LD # SHLIB_LD # SHLIB_CFLAGS # SHLIB_LDFLAGS # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_CFLAGS], [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # Step 0: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is enabled]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support], [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then AC_MSG_CHECKING([if Windows/CE build is requested]) AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) AC_MSG_RESULT($doWince) fi # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. AC_MSG_CHECKING([system version (for dynamic loading)]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_RESULT([unknown (can't find uname command)]) system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi if test "${TEA_PLATFORM}" = "windows" ; then system=windows fi AC_MSG_RESULT([$system]) fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Step 3: set configuration options based on system name and version. do64bit_ok=no EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. dnl AC_CHECK_TOOL(AR, ar, :) AC_CHECK_PROG(AR, ar, ar) STLIB_LD='${AR} cr' case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. if test "$do64bit" = "yes" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft SDK" fi # In order to work in the tortured autoconf environment, # we need to ensure that this path has no spaces MSSDK=`cygpath -w -s "$MSSDK" | sed -e 's!\\\!/!g'` if test ! -d "${MSSDK}/bin/win64" ; then AC_MSG_WARN("could not find 64-bit SDK to enable 64bit mode") do64bit="no" else do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" = "yes" ; then AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) fi if test "$GCC" = "yes" ; then AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) fi TEA_PATH_CELIB # set defaults # Currently Tcl requires 300+ CEVERSION=300; # could be 211 300 301 ... TARGETCPU=ARM; # could be ARM MIPS SH3 X86 ... PLATFORM="Pocket PC 2002" if test "$doWince" = "yes"; then doWince="300,ARM,ARM,Pocket PC 2002" fi eval `echo $doWince | awk -F "," '{ \ if (length([$]1)) { printf "CEVERSION=%s\n", [$]1 }; \ if (length([$]2)) { printf "TARGETCPU=%s\n", toupper([$]2) }; \ if (length([$]3)) { printf "ARCH=%s\n", toupper([$]3) }; \ if (length([$]4)) { printf "PLATFORM=%s\n", [$]4 }; \ }'` OSVERSION=WCE$CEVERSION; if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; # could be ARM MIPS SH3 X86 X86EM ... fi if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Windows CE Tools" fi # In order to work in the tortured autoconf environment, # we need to ensure that this path has no spaces WCEROOT=`cygpath -w -s "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`cygpath -w -s "$SDKROOT" | sed -e 's!\\\!/!g'` CELIB_DIR=`cygpath -w -s "$CELIB_DIR" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) doWince="no" else CEINCLUDE=`cygpath -w -s "${SDKROOT}/${OSVERSION}/${PLATFORM}/include" | sed -e 's!\\\!/!g'` CELIBPATH=`cygpath -w -s "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" | sed -e 's!\\\!/!g'` fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" = "yes" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs export CC="${MSSDK}/Bin/Win64/cl.exe \ -I${MSSDK}/Include/prerelease \ -I${MSSDK}/Include/Win64/crt \ -I${MSSDK}/Include" export RC="${MSSDK}/bin/rc.exe" export lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \ -LIBPATH:${MSSDK}/Lib/Prerelease/IA64" export STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}" export LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -Gs -W2 ${runtime}" elif test "$doWince" != "no" ; then if test "${TARGETCPU}" = "X86"; then CC="${WCEROOT}/EVC/${OSVERSION}/bin/cl.exe -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" else CC="${WCEROOT}/EVC/${OSVERSION}/bin/cl${TARGETCPU}.exe -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" fi RC="${WCEROOT}/Common/EVC/bin/rc.exe" cpulower=`echo ${TARGETCPU} | awk '{print tolower([$]0)}'` defs="${TARGETCPU} _${TARGETCPU}_ ${cpulower} _${cpulower}_ POCKET_SIZE PALM_SIZE _MT _DLL _WINDOWS" for i in $defs ; do AC_DEFINE_UNQUOTED($i) done AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION) AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION) CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lflags="-MACHINE:${TARGETCPU} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,3.00" STLIB_LD="${WCEROOT}/EVC/${OSVERSION}/bin/lib.exe -nologo ${lflags}" LINKBIN="${WCEROOT}/EVC/${OSVERSION}/bin/link.exe ${lflags}" else RC="rc" STLIB_LD="lib -nologo" LINKBIN="link -link50compat" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2" SHLIB_LD="$CC -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll -nologo" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.lib' EXTRA_CFLAGS="-YX" PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used if test "${CC}" != "cc_r" ; then CC=${CC}_r fi AC_MSG_RESULT([Using $CC for compiling with threads]) fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadDl.o" LDFLAGS="" # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then #LIBOBJS="$LIBOBJS tclLoadAix.o" AC_LIBOBJ([tclLoadAix]) DL_LIBS="-lld" fi # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN("64bit mode not supported with GCC on $system") else do64bit_ok=yes EXTRA_CFLAGS="-q64" LDFLAGS="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LDFLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi else SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ) fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-export-dynamic" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE_EXTENDED) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="-Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #EXTRA_CFLAGS="+DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS="" LD_SEARCH_FLAGS='' ;; *) AC_MSG_WARN("64bit mode not supported with GCC on $system") ;; esac else do64bit_ok=yes if test "`uname -m`" = "ia64" ; then EXTRA_CFLAGS="+DD64" LDFLAGS="+DD64 $LDFLAGS" else EXTRA_CFLAGS="+DA2.0W" LDFLAGS="+DA2.0W $LDFLAGS" fi fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="-Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' EXTRA_CFLAGS="" LDFLAGS="" ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then EXTRA_CFLAGS="-mabi=n32" LDFLAGS="-mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS" ;; *) EXTRA_CFLAGS="-n32" ;; esac LDFLAGS="-n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported by gcc]) else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" EXTRA_CFLAGS="-64" LDFLAGS="-64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-rdynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LDFLAGS="" LD_SEARCH_FLAGS=""]) fi if test "`uname -m`" = "alpha" ; then EXTRA_CFLAGS="-mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="-rdynamic" LD_SEARCH_FLAGS="" else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" LDFLAGS="" LD_SEARCH_FLAGS=""]) fi if test "`uname -m`" = "alpha" ; then EXTRA_CFLAGS="-mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[[1-2]].*|OpenBSD-*) # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' AC_MSG_CHECKING([for ELF]) AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], AC_MSG_RESULT([yes]) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so', AC_MSG_RESULT([no]) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' ) ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' ]) # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="-export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` EXTRA_CFLAGS="-pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Rhapsody-*|Darwin-*) SHLIB_CFLAGS="-fno-common" SHLIB_LD="cc -dynamiclib \${LDFLAGS}" TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_MAJOR_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="-prebind" LD_SEARCH_FLAGS="" CFLAGS_OPTIMIZE="-O3" EXTRA_CFLAGS="-arch ppc -pipe" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export $@:' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then EXTRA_CFLAGS="-DHAVE_TZSET -std1" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread" LDFLAGS="-pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="-melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="-belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else SHLIB_LD="/usr/ccs/bin/ld -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) SHLIB_CFLAGS="-KPIC" LDFLAGS="" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN("64bit mode not supported with GCC on $system") else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then EXTRA_CFLAGS="-xarch=v9a" LDFLAGS="-xarch=v9a" else EXTRA_CFLAGS="-xarch=v9" LDFLAGS="-xarch=v9" fi fi else AC_MSG_WARN("64bit mode only supported sparcv9 system") fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else SHLIB_LD="/usr/ccs/bin/ld -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then EXTRA_CFLAGS="-DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS AC_MSG_CHECKING([for ld accepts -Bexport flag]) LDFLAGS="${LDFLAGS} -Wl,-Bexport" AC_TRY_LINK(, [int i;], found=yes, found=no) LDFLAGS=$hold_ldflags AC_MSG_RESULT([$found]) if test $found = yes; then LDFLAGS="-Wl,-Bexport" else LDFLAGS="" fi LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform") fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then AC_MSG_CHECKING([sys/exec.h]) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT([$tcl_ok]) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_H) else AC_MSG_CHECKING([a.out.h]) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT([$tcl_ok]) if test $tcl_ok = usable; then AC_DEFINE(USE_A_OUT_H) else AC_MSG_CHECKING([sys/exec_aout.h]) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT([$tcl_ok]) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_AOUT_H) else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command], [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Rhapsody-*|Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' fi AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(EXTRA_CFLAGS) SHLIB_LDFLAGS='$(LDFLAGS_DEFAULT)' AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_LDFLAGS) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) ]) #-------------------------------------------------------------------- # TEA_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- AC_DEFUN([TEA_SERIAL_PORT], [ AC_CHECK_HEADERS(sys/modem.h) AC_MSG_CHECKING([termios vs. termio vs. sgtty]) AC_CACHE_VAL(tcl_cv_api_serial, [ AC_TRY_RUN([ #include int main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include #include int main() { struct termios t; if (tcgetattr(0, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi]) case $tcl_cv_api_serial in termios) AC_DEFINE(USE_TERMIOS);; termio) AC_DEFINE(USE_TERMIO);; sgtty) AC_DEFINE(USE_SGTTY);; esac AC_MSG_RESULT([$tcl_cv_api_serial]) ]) #-------------------------------------------------------------------- # TEA_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol, strtoul, or # strtod insome versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_DIRENT_H # NO_ERRNO_H # NO_VALUES_H # NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_UNISTD_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # #-------------------------------------------------------------------- AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ AC_MSG_CHECKING([dirent.h]) AC_TRY_LINK([#include #include ], [ #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ], tcl_ok=yes, tcl_ok=no) if test $tcl_ok = no; then AC_DEFINE(NO_DIRENT_H) fi AC_MSG_RESULT([$tcl_ok]) AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)]) AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)]) AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)]) AC_CHECK_HEADER(limits.h, , [AC_DEFINE(NO_LIMITS_H)]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H) fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then AC_DEFINE(NO_STRING_H) fi AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(unistd.h sys/param.h) ]) #-------------------------------------------------------------------- # TEA_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # This should be called after TEA_CONFIG_CFLAGS as setting the # LIBS line can confuse some configure macro magic. # # Arguments: # none # # Results: # # Sets the following vars: # XINCLUDES # XLIBSW # LIBS (appends to) # #-------------------------------------------------------------------- AC_DEFUN([TEA_PATH_X], [ if test "${TEA_PLATFORM}" = "unix" ; then TEA_PATH_UNIX_X fi ]) AC_DEFUN([TEA_PATH_UNIX_X], [ AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_TRY_CPP([#include ], , not_really_there="yes") else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING([for X11 header files]) XINCLUDES="# no special path needed" AC_TRY_CPP([#include ], , XINCLUDES="nope") if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" break fi done fi else if test "$x_includes" != ""; then XINCLUDES=-I$x_includes else XINCLUDES="# no special path needed" fi fi if test "$XINCLUDES" = nope; then AC_MSG_RESULT([could not find any!]) XINCLUDES="# no include files found" fi if test "$no_x" = yes; then AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib$libsuff /usr/X386/lib /usr/X11R6/lib$libsuff /usr/X11R5/lib$libsuff /usr/lib$libsuff/X11R5 /usr/lib$libsuff/X11R4 /usr/openwin/lib /usr/X11/lib$libsuff /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then LIBS="${LIBS} ${XLIBSW}" fi ]) #-------------------------------------------------------------------- # TEA_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- AC_DEFUN([TEA_BLOCKING_STYLE], [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi fi fi case $system in # There used to be code here to use FIONBIO under AIX. However, it # was reported that FIONBIO doesn't work under AIX 3.2.5. Since # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO # code (JO, 5/31/97). OSF*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT([FIONBIO]) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT([FIONBIO]) ;; ULTRIX-4.*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT([FIONBIO]) ;; *) AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) #-------------------------------------------------------------------- # TEA_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN([TEA_TIME_HANDLER], [ AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(gmtime_r localtime_r) AC_MSG_CHECKING([tm_tzadj in struct tm]) AC_CACHE_VAL(tcl_cv_member_tm_tzadj, AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)) AC_MSG_RESULT([$tcl_cv_member_tm_tzadj]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ) fi AC_MSG_CHECKING([tm_gmtoff in struct tm]) AC_CACHE_VAL(tcl_cv_member_tm_gmtoff, AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)) AC_MSG_RESULT([$tcl_cv_member_tm_gmtoff]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_MSG_CHECKING([long timezone variable]) AC_CACHE_VAL(tcl_cv_var_timezone, AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)) AC_MSG_RESULT([$tcl_cv_timezone_long]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_MSG_CHECKING([time_t timezone variable]) AC_CACHE_VAL(tcl_cv_timezone_time, AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)) AC_MSG_RESULT([$tcl_cv_timezone_time]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR) fi fi ]) #-------------------------------------------------------------------- # TEA_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- AC_DEFUN([TEA_BUGGY_STRTOD], [ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs]) AC_TRY_RUN([ extern double strtod(); int main() { char *string = "NaN", *spaceString = " "; char *term; double value; value = strtod(string, &term); if ((term != string) && (term[-1] == 0)) { exit(1); } value = strtod(spaceString, &term); if (term == (spaceString+1)) { exit(1); } exit(0); }], tcl_ok=1, tcl_ok=0, tcl_ok=0) if test "$tcl_ok" = 1; then AC_MSG_RESULT([ok]) else AC_MSG_RESULT([buggy]) #LIBOBJS="$LIBOBJS fixstrtod.o" AC_LIBOBJ([fixstrtod]) USE_COMPAT=1 AC_DEFINE(strtod, fixstrtod) fi fi ]) #-------------------------------------------------------------------- # TEA_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H)) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #-------------------------------------------------------------------- # TEA_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, AC_TRY_COMPILE([[#define ]$1[ 1 ]$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # TEA_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], tcl_cv_type_64bit=__int64,tcl_cv_type_64bit=none AC_TRY_RUN([#include int main() {exit(!(sizeof(long long) > sizeof(long)));} ], tcl_cv_type_64bit="long long"))]) if test "${tcl_cv_type_64bit}" = none ; then AC_MSG_RESULT([using long]) elif test "${tcl_cv_type_64bit}" = "__int64" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* AC_MSG_RESULT([using Tcl header defaults]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}) AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations AC_MSG_CHECKING([for struct dirent64]) AC_CACHE_VAL(tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include #include ],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64) fi AC_MSG_RESULT([${tcl_cv_struct_dirent64}]) AC_MSG_CHECKING([for struct stat64]) AC_CACHE_VAL(tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include ],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64) fi AC_MSG_RESULT([${tcl_cv_struct_stat64}]) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_TRY_COMPILE([#include ],[off64_t offset; ], tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) if test "x${tcl_cv_type_off64_t}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T) fi AC_MSG_RESULT([${tcl_cv_type_off64_t}]) fi ]) ## ## Here ends the standard Tcl configuration bits and starts the ## TEA specific functions ## #------------------------------------------------------------------------ # TEA_INIT -- # # Init various Tcl Extension Architecture (TEA) variables. # This should be the first called TEA_* macro. # # Arguments: # none # # Results: # # Defines and substs the following vars: # CYGPATH # EXEEXT # Defines only: # TEA_INITED # TEA_PLATFORM (windows or unix) # # "cygpath" is used on windows to generate native path names for include # files. These variables should only be used with the compiler and linker # since they generate native path names. # # EXEEXT # Select the executable extension based on the host type. This # is a lightweight replacement for AC_EXEEXT that doesn't require # a compiler. #------------------------------------------------------------------------ AC_DEFUN([TEA_INIT], [ AC_REQUIRE([AC_PROG_LIBTOOL]) AC_MSG_CHECKING([for correct TEA configuration]) if test x"${PACKAGE}" = x ; then AC_MSG_ERROR([ The PACKAGE variable must be defined by your TEA configure.in]) fi AC_MSG_RESULT([ok]) case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix if test x$exec_prefix = xNONE ; then exec_prefix=$prefix ; fi AC_SUBST(EXEEXT) AC_SUBST(CYGPATH) ]) #------------------------------------------------------------------------ # TEA_PREFIX -- # # Handle the --prefix=... option by defaulting to what Tcl gave # # Arguments: # none # # Results: # # If --prefix or --exec-prefix was not specified, $prefix and # $exec_prefix will be set to the values given to Tcl when it was # configured. #------------------------------------------------------------------------ AC_DEFUN([TEA_PREFIX], [ # Should be AC_MSG_NOTICE, but that requires autoconf 2.50 if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then AC_MSG_WARN([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) prefix=${TCL_PREFIX} else prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then AC_MSG_WARN([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) exec_prefix=${TCL_EXEC_PREFIX} else exec_prefix=$prefix fi fi ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER -- # # Do compiler checks the way we want. This is just a replacement # for AC_PROG_CC in TEA configure.in files to make them cleaner. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER_CC], [ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER_FLAGS instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- AC_PROG_RANLIB #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- AC_OBJEXT AC_EXEEXT ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER -- # # Do compiler checks that use the compiler. This must go after # TEA_SETUP_COMPILER_CC, which does the actual compiler check. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER], [ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. AC_REQUIRE([TEA_SETUP_COMPILER_CC]) #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then AC_MSG_CHECKING([if the compiler understands -pipe]) OLDCC="$CC" CC="$CC -pipe" AC_TRY_COMPILE(,, AC_MSG_RESULT([yes]), CC="$OLDCC" AC_MSG_RESULT([no])) fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- TEA_TCL_EARLY_FLAGS TEA_TCL_64BIT_FLAGS AC_C_BIGENDIAN if test "${TEA_PLATFORM}" = "unix" ; then TEA_TCL_LINK_LIBS TEA_MISSING_POSIX_HEADERS TEA_BUGGY_STRTOD fi ]) #------------------------------------------------------------------------ # TEA_MAKE_LIB -- # # Generate a line that can be used to build a shared/unshared library # in a platform independent manner. # # Arguments: # none # # Requires: # # Results: # # Defines the following vars: # CFLAGS - Done late here to note disturb other AC macros # MAKE_LIB - Command to execute to build the Tcl library; # differs depending on whether or not Tcl is being # compiled as a shared library. # MAKE_SHARED_LIB Makefile rule for building a shared library # MAKE_STATIC_LIB Makefile rule for building a static library # MAKE_STUB_LIB Makefile rule for building a stub library #------------------------------------------------------------------------ AC_DEFUN([TEA_MAKE_LIB], [ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$](PACKAGE)_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@ \$(\[$](PACKAGE)_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$](PACKAGE)stub_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(\[$](PACKAGE)_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$](PACKAGE)_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(\[$](PACKAGE)stub_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure the ${DBGX} in the suffix is # substituted. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "${PACKAGE}stub_LIB_FILE=${PACKAGE}stub${UNSHARED_LIB_SUFFIX}" else if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "${PACKAGE}stub_LIB_FILE=lib${PACKAGE}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_SHARED_LIB) AC_SUBST(MAKE_STATIC_LIB) AC_SUBST(MAKE_STUB_LIB) ]) #------------------------------------------------------------------------ # TEA_LIB_SPEC -- # # Compute the name of an existing object library located in libdir # from the given base name and produce the appropriate linker flags. # # Arguments: # basename The base name of the library without version # numbers, extensions, or "lib" prefixes. # extra_dir Extra directory in which to search for the # library. This location is used first, then # $prefix/$exec-prefix, then some defaults. # # Requires: # TEA_INIT and TEA_PREFIX must be called first. # # Results: # # Defines the following vars: # ${basename}_LIB_NAME The computed library name. # ${basename}_LIB_SPEC The computed linker flags. #------------------------------------------------------------------------ AC_DEFUN([TEA_LIB_SPEC], [ AC_MSG_CHECKING([for $1 library]) # Look in exec-prefix for the library (defined by TEA_PREFIX). tea_lib_name_dir="${exec_prefix}/lib" # Or in a user-specified location. if test x"$2" != x ; then tea_extra_lib_dir=$2 else tea_extra_lib_dir=NONE fi for i in \ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib$libsuff/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib$libsuff/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/local/lib$libsuff/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/local/lib$libsuff/lib$1[[0-9]]* 2>/dev/null ` ; do if test -f "$i" ; then tea_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` $1_LIB_PATH_NAME=$i break fi done if test "${TEA_PLATFORM}" = "windows"; then $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" else # Strip off the leading "lib" and trailing ".a" or ".so" tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" fi if test "x${$1_LIB_NAME}" = x ; then AC_MSG_ERROR([not found]) else AC_MSG_RESULT([${$1_LIB_SPEC}]) fi ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TCL_HEADERS -- # # Locate the private Tcl include files # # Arguments: # # Requires: # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has # already been called. # # Results: # # Substs the following vars: # TCL_TOP_DIR_NATIVE # TCL_GENERIC_DIR_NATIVE # TCL_UNIX_DIR_NATIVE # TCL_WIN_DIR_NATIVE # TCL_BMAP_DIR_NATIVE # TCL_TOOL_DIR_NATIVE # TCL_PLATFORM_DIR_NATIVE # TCL_BIN_DIR_NATIVE # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl private include files]) if test "${TEA_PLATFORM}" = "windows"; then TCL_TOP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}`\" TCL_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/generic`\" TCL_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/unix`\" TCL_WIN_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/win`\" TCL_BMAP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/bitmaps`\" TCL_TOOL_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/tools`\" TCL_COMPAT_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/compat`\" TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} else TCL_TOP_DIR_NATIVE='$(TCL_SRC_DIR)' TCL_GENERIC_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/generic' TCL_UNIX_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/unix' TCL_WIN_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/win' TCL_BMAP_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/bitmaps' TCL_TOOL_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/tools' TCL_COMPAT_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/compat' TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} fi AC_SUBST(TCL_TOP_DIR_NATIVE) AC_SUBST(TCL_GENERIC_DIR_NATIVE) AC_SUBST(TCL_UNIX_DIR_NATIVE) AC_SUBST(TCL_WIN_DIR_NATIVE) AC_SUBST(TCL_BMAP_DIR_NATIVE) AC_SUBST(TCL_TOOL_DIR_NATIVE) AC_SUBST(TCL_PLATFORM_DIR_NATIVE) TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" AC_SUBST(TCL_INCLUDES) AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TCL_HEADERS -- # # Locate the installed public Tcl header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tclinclude switch to configure. # Result is cached. # # Substs the following vars: # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl public headers]) AC_ARG_WITH(tclinclude, AC_HELP_STRING([--with-tclinclude],[directory containing the public Tcl header files]), with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) fi else # Check order: pkg --prefix location, Tcl's --prefix location, # directory of tclConfig.sh, and Tcl source directory. # Looking in the source dir is not ideal, but OK. eval "temp_includedir=${includedir}" list="`ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_WARN([tcl.h not found. Please specify its location with --with-tclinclude]) else AC_MSG_RESULT([${ac_cv_c_tclh}]) fi # Convert to a native path and substitute into the output files. if test x"${ac_cv_c_tclh}" = x ; then TCL_INCLUDES=none else INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` if test x"${INCLUDE_DIR_NATIVE}" != x/usr/include ;then TCL_INCLUDES=-I${INCLUDE_DIR_NATIVE} fi fi AC_SUBST(TCL_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TK_HEADERS -- # # Locate the private Tk include files # # Arguments: # # Requires: # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has # already been called. # # Results: # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ AC_MSG_CHECKING([for Tk private include files]) if test "${TEA_PLATFORM}" = "windows"; then TK_TOP_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}`\" TK_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/unix`\" TK_WIN_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/win`\" TK_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/generic`\" TK_XLIB_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/xlib`\" TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE} -I${TK_XLIB_DIR_NATIVE}" else TK_TOP_DIR_NATIVE='$(TK_SRC_DIR)' TK_GENERIC_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/generic' TK_UNIX_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/unix' TK_WIN_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/win' TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" fi AC_SUBST(TK_TOP_DIR_NATIVE) AC_SUBST(TK_UNIX_DIR_NATIVE) AC_SUBST(TK_WIN_DIR_NATIVE) AC_SUBST(TK_GENERIC_DIR_NATIVE) AC_SUBST(TK_XLIB_DIR_NATIVE) AC_SUBST(TK_PLATFORM_DIR_NATIVE) AC_SUBST(TK_INCLUDES) AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TK_HEADERS -- # # Locate the installed public Tk header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tkinclude switch to configure. # Result is cached. # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ AC_MSG_CHECKING([for Tk public headers]) AC_ARG_WITH(tkinclude, AC_HELP_STRING([--with-tkinclude],[directory containing the public Tk header files.]), with_tkinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) fi else # Check order: pkg --prefix location, Tcl's --prefix location, # directory of tclConfig.sh, and Tcl source directory. # Looking in the source dir is not ideal, but OK. eval "temp_includedir=${includedir}" list="`ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then AC_MSG_WARN([tk.h not found. Please specify its location with --with-tkinclude]) else AC_MSG_RESULT([${ac_cv_c_tkh}]) fi # Convert to a native path and substitute into the output files. if test x"${ac_cv_c_tkh}" = x ; then TK_INCLUDES=none else INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` if test x"${INCLUDE_DIR_NATIVE}" != x/usr/include ;then TK_INCLUDES=-I${INCLUDE_DIR_NATIVE} fi fi AC_SUBST(TK_INCLUDES) if test "${TEA_PLATFORM}" = "windows" ; then # On Windows, we need the X compat headers AC_MSG_CHECKING([for X11 header files]) if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_XINCLUDES) fi AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) fi ]) #------------------------------------------------------------------------ # TEA_PROG_TCLSH # Locate a tclsh shell in the following directories: # ${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin # ${exec_prefix}/bin ${prefix}/bin # ${PATH} # # Arguments # none # # Results # Subst's the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) AC_CACHE_VAL(ac_cv_path_tclsh, [ if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target tclsh cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TCL_EXEC_PREFIX}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/tclsh[[8-9]]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ]) if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG=$ac_cv_path_tclsh AC_MSG_RESULT([$TCLSH_PROG]) else AC_MSG_ERROR([No tclsh found in PATH: $search_path]) fi AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # TEA_PROG_WISH # Locate a wish shell in the following directories: # ${TK_BIN_DIR} ${TK_BIN_DIR}/../bin # ${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin # ${exec_prefix}/bin ${prefix}/bin # ${PATH} # # Arguments # none # # Results # Subst's the following values: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_WISH], [ AC_MSG_CHECKING([for wish]) AC_CACHE_VAL(ac_cv_path_wish, [ if test "x${CELIB_DIR}" != "x" ; then # If CELIB_DIR is defined, assume Windows/CE target is requested # which means target wish cannot be run (cross-compile) search_path=`echo ${PATH} | sed -e 's/:/ /g'` else search_path=`echo ${TK_EXEC_PREFIX}/bin:${TK_BIN_DIR}:${TK_BIN_DIR}/../bin:${TCL_EXEC_PREFIX}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'` fi for dir in $search_path ; do for j in `ls -r $dir/wish[[8-9]]*${EXEEXT} 2> /dev/null` \ `ls -r $dir/wish*${EXEEXT} 2> /dev/null` ; do if test x"$ac_cv_path_wish" = x ; then if test -f "$j" ; then ac_cv_path_wish=$j break fi fi done done ]) if test -f "$ac_cv_path_wish" ; then WISH_PROG=$ac_cv_path_wish AC_MSG_RESULT([$WISH_PROG]) else AC_MSG_ERROR([No wish found in PATH: $search_path]) fi AC_SUBST(WISH_PROG) ]) #------------------------------------------------------------------------ # TEA_PATH_CONFIG -- # # Locate the ${1}Config.sh file and perform a sanity check on # the ${1} compile flags. These are used by packages like # [incr Tk] that load *Config.sh files from more than Tcl and Tk. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-$1=... # # Defines the following vars: # $1_BIN_DIR Full path to the directory containing # the $1Config.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CONFIG], [ # # Ok, lets find the $1 configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-$1 # if test x"${no_$1}" = x ; then # we reset no_$1 in case something fails here no_$1=true AC_ARG_WITH($1, AC_HELP_STRING([--with-$1],[directory containing $1 configuration ($1Config.sh)]), with_$1config=${withval}) AC_MSG_CHECKING([for $1 configuration]) AC_CACHE_VAL(ac_cv_c_$1config,[ # First check to see if --with-$1 was specified. if test x"${with_$1config}" != x ; then if test -f "${with_$1config}/$1Config.sh" ; then ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` else AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) fi fi # then check for a private $1 installation if test x"${ac_cv_c_$1config}" = x ; then for i in \ ../$1 \ `ls -dr ../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ../../$1 \ `ls -dr ../../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../$1 \ `ls -dr ../../../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ${srcdir}/../$1 \ `ls -dr ${srcdir}/../$1[[8-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi if test -f "$i/unix/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_$1config}" = x ; then for i in `ls -d ${exec_prefix}/lib$libsuff 2>/dev/null` \ `ls -d ${prefix}/lib$libsuff 2>/dev/null` \ `ls -d /usr/local/lib$libsuff 2>/dev/null` \ `ls -d /usr/contrib/lib$libsuff 2>/dev/null` \ `ls -d /usr/lib$libsuff 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_$1config}" = x ; then $1_BIN_DIR="none" if test x"${with_$1config}" != x ; then AC_MSG_ERROR([Cannot find $1 config]) else AC_MSG_RESULT([none]) fi else no_$1= $1_BIN_DIR=${ac_cv_c_$1config} AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_CONFIG -- # # Load the $1Config.sh file # # Arguments: # # Requires the following vars to be set: # $1_BIN_DIR # # Results: # # Subst the following vars: # $1_SRC_DIR # $1_LIB_FILE # $1_LIB_SPEC # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_CONFIG], [ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) if test -f "${$1_BIN_DIR}/$1Config.sh" ; then AC_MSG_RESULT([loading]) . ${$1_BIN_DIR}/$1Config.sh else AC_MSG_RESULT([file not found]) fi # # If the $1_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable $1_LIB_SPEC will be set to the value # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC # instead of $1_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f ${$1_BIN_DIR}/Makefile ; then AC_MSG_WARN([Found Makefile - using build library specs for $1]) $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} fi AC_SUBST($1_VERSION) AC_SUBST($1_SRC_DIR) AC_SUBST($1_LIB_FILE) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_STUB_LIB_FILE) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) ]) #------------------------------------------------------------------------ # TEA_PATH_CELIB -- # # Locate Keuchel's celib emulation layer for targeting Win/CE # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-celib=... # # Defines the following vars: # CELIB_DIR Full path to the directory containing # the include and platform lib files #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CELIB], [ # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) AC_MSG_CHECKING([for Windows/CE celib directory]) AC_CACHE_VAL(ac_cv_c_celibconfig,[ # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_celibconfig}" = x ; then CELIB_DIR="# no Celib configs found" AC_MSG_ERROR([Cannot find celib support library directory]) else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} AC_MSG_RESULT([found $CELIB_DIR]) fi fi ]) torque-2.4.16/buildutils/mkinstalldirs0000755000113300011330000000653511605403772015036 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2004-02-15.20 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit 0 ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: torque-2.4.16/buildutils/ac_c_bigendian_cross.m40000664000113300011330000000574311272401234016561 00000000000000dnl @synopsis AC_C_BIGENDIAN_CROSS dnl dnl Check endianess even when crosscompiling (partially based on the dnl original AC_C_BIGENDIAN). dnl dnl The implementation will create a binary, but instead of running the dnl binary it will be grep'ed for some symbols that differ for dnl different endianess of the binary. dnl dnl NOTE: The upcoming autoconf 2.53 does include the idea of this dnl macro, what makes it superfluous by then. dnl dnl @category CrossCompilation dnl @author Guido Draheim dnl @version 2002-03-18 dnl @license GPLWithACException AC_DEFUN([AC_C_BIGENDIAN_CROSS], [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, [ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. AC_TRY_COMPILE([#include #include ], [ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. AC_TRY_COMPILE([#include #include ], [ #if BYTE_ORDER != BIG_ENDIAN not big endian #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) if test $ac_cv_c_bigendian = unknown; then AC_TRY_RUN([main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); }], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, [ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) fi]) if test $ac_cv_c_bigendian = unknown; then AC_MSG_CHECKING(to probe for byte ordering) [ cat >conftest.c <&AC_FD_MSG ac_cv_c_bigendian=yes fi if test `grep -l LiTTleEnDian conftest.o` ; then echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG if test $ac_cv_c_bigendian = yes ; then ac_cv_c_bigendian=unknown; else ac_cv_c_bigendian=no fi fi echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG fi fi AC_MSG_RESULT($ac_cv_c_bigendian) fi if test $ac_cv_c_bigendian = yes; then AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) BYTEORDER=4321 else BYTEORDER=1234 fi AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) if test $ac_cv_c_bigendian = unknown; then AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) fi ]) torque-2.4.16/buildutils/compile0000755000113300011330000000706211605403770013600 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2004-09-10.20 # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit 0 ;; -v | --v*) echo "compile $scriptversion" exit 0 ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: torque-2.4.16/buildutils/modulefiles.in0000664000113300011330000000061711272401234015054 00000000000000#%Module###################################################################### ## ## Torque Module ## proc ModulesHelp { } { puts stderr " TORQUE modulefile" } set sys [uname sysname] set host [uname nodename] set os [uname release] set version @PACKAGE_VERSION@ set prefix @prefix@ set exec_prefix @exec_prefix@ prepend-path PATH @bindir@ prepend-path PATH @sbindir@ prepend-path MANPATH @mandir@ torque-2.4.16/buildutils/ax_cflags_gcc_option.m40000664000113300011330000002066511272401234016616 00000000000000##### http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html # # SYNOPSIS # # AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]]) # # DESCRIPTION # # AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like # "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the # optionflag to CFLAGS if it is understood. You can override the # shellvar-default of CFLAGS of course. The order of arguments stems # from the explicit macros like AX_CFLAGS_WARN_ALL. # # The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add # to CXXFLAGS - and it uses the autoconf setup for C++ instead of C # (since it is possible to use different compilers for C and C++). # # The macro is a lot simpler than any special AX_CFLAGS_* macro (or # ac_cxx_rtti.m4 macro) but allows to check for arbitrary options. # However, if you use this macro in a few places, it would be great # if you would make up a new function-macro and submit it to the # ac-archive. # # - $1 option-to-check-for : required ("-option" as non-value) # - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case) # - $3 action-if-found : add value to shellvariable # - $4 action-if-not-found : nothing # # Note: in earlier versions, $1-$2 were swapped. We try to detect the # situation and accept a $2=~/-/ as being the old # option-to-check-for. # # There are other variants that emerged from the original macro # variant which did just test an option to be possibly added. # However, some compilers accept an option silently, or possibly for # just another option that was not intended. Therefore, we have to do # a generic test for a compiler family. For gcc we check "-pedantic" # being accepted which is also understood by compilers who just want # to be compatible with gcc even when not being made from gcc # sources. # # See also: AX_CFLAGS_SUN_OPTION, AX_CFLAGS_HPUX_OPTION, # AX_CFLAGS_AIX_OPTION, and AX_CFLAGS_IRIX_OPTION. # # LAST MODIFICATION # # 2007-07-27 # # COPYLEFT # # Copyright (c) 2007 Guido U. Draheim # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the respective Autoconf Macro's copyright # owner gives unlimited permission to copy, distribute and modify the # configure scripts that are the output of Autoconf when processing # the Macro. You need not follow the terms of the GNU General Public # License when using or distributing such scripts, even though # portions of the text of the Macro appear in them. The GNU General # Public License (GPL) does govern all other use of the material that # constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the # Autoconf Macro released by the Autoconf Macro Archive. When you # make and distribute a modified version of the Autoconf Macro, you # may extend this special exception to the GPL to apply to your # modified version as well. AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], VAR,[VAR="no, unknown" AC_LANG_SAVE AC_LANG_C ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) case ".$VAR" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) dnl the only difference - the LANG selection... and the default FLAGS AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], VAR,[VAR="no, unknown" AC_LANG_SAVE AC_LANG_CPLUSPLUS ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) case ".$VAR" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) dnl ------------------------------------------------------------------------- AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], VAR,[VAR="no, unknown" AC_LANG_SAVE AC_LANG_C ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) case ".$VAR" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) dnl the only difference - the LANG selection... and the default FLAGS AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], VAR,[VAR="no, unknown" AC_LANG_SAVE AC_LANG_CPLUSPLUS ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_TRY_COMPILE([],[return 0;], [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) done FLAGS="$ac_save_[]FLAGS" AC_LANG_RESTORE ]) case ".$VAR" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_ifvaln($4,$4) ;; *) m4_ifvaln($3,$3,[ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" fi ]) ;; esac AS_VAR_POPDEF([VAR])dnl AS_VAR_POPDEF([FLAGS])dnl ]) AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, [AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])]) AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, [AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])]) torque-2.4.16/buildutils/depcomp0000755000113300011330000003554511605403770013606 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-05-31.23 # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # With libtool 1.5 they are output both in $dir.libs/$base.o.d # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the # latter, because the former will be cleaned when $dir.libs is # erased. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: torque-2.4.16/buildutils/tac_tcltk.m40000664000113300011330000001611411272401234014425 00000000000000dnl dnl ###################################################################### dnl Tcl/Tk settings dnl AC_DEFUN([TAC_TCLTK],[ AC_MSG_NOTICE([Starting Tcl/Tk configuration]) TCL=0 TCLX=0 TK=0 TKX=0 if test "x${with_tcl}" != "xno" ; then if test "x${with_tcl}" = "xyes" ; then with_tcl="" user_requested_tcl=yes fi # find and load tclConfig.sh TEA_PATH_TCLCONFIG if test "x$TCL_BIN_DIR" = "xnone" ; then TCL=0 else TEA_LOAD_TCLCONFIG TEA_PUBLIC_TCL_HEADERS if test "x$TCL_INCLUDES" = "xnone" ;then TCL=0 else TCL=1 fi fi if test "x$user_requested_tcl" = "xyes" -a $TCL = 0 ;then AC_MSG_ERROR([Tcl was requested but not found]) fi fi if test "${TCL}" = "1" -a "x${with_tclx}" != "xno" ; then if test "x${with_tclx}" = "xyes" ; then with_tclx="" user_requested_tclx=yes fi # find and load tclxConfig.sh which only exists for older versions TEA_PATH_CONFIG([tclx]) if test "x$tclx_BIN_DIR" != "xnone" ; then TEA_LOAD_CONFIG([tclx]) orig_CFLAGS="$CFLAGS" CFLAGS="$TCL_INCLUDES" AC_CHECK_HEADER([tclExtend.h], [TCLX=1], [TCLX=0]) CFLAGS="$orig_CFLAGS" else TCLX=0 fi if test "x$user_requested_tclx" = "xyes" -a $TCLX = 0 ;then AC_MSG_ERROR([TclX was requested but not found]) fi fi if test "${TCL}" = "1" -a "x${with_tk}" != "xno" ; then if test "x${with_tk}" = "xyes" ; then with_tk="" user_requested_tk=yes fi # find and load tkConfig.sh TEA_PATH_TKCONFIG if test "x$TK_BIN_DIR" = "xnone" ; then TK=0 else TEA_LOAD_TKCONFIG TEA_PUBLIC_TK_HEADERS if test "x$TK_INCLUDES" = "xnone" ; then TK=0 else TK=1 fi fi if test "x$user_requested_tk" = "xyes" -a $TK = 0 ;then AC_MSG_ERROR([Tk was requested but not found]) fi fi if test "${TK}" = "1" -a "${TCLX}" = "1" -a "x${with_tkx}" != "xno" ; then if test "x${with_tkx}" = "xyes" ; then with_tkx="" user_requested_tkx=yes fi # find and load tkxConfig.sh TEA_PATH_CONFIG([tkx]) if test "x$tkx_BIN_DIR" = "xnone" ; then TKX=0 else TEA_LOAD_CONFIG([tkx]) TKX=1 fi if test "x$user_requested_tkx" = "xyes" -a $TK = 0 ;then AC_MSG_ERROR([TkX was requested but not found]) fi fi dnl Now assemble appropriate compiler flags for includes and linking. MY_TCL_LIBS="" MY_TCL_INCS="" if test "${TCL}" = "1"; then MY_TCL_LIBS="${MY_TCL_LIBS} ${TCL_LIB_SPEC} ${TCL_LIBS}" MY_TCL_INCS="${MY_TCL_INCS} ${TCL_INCLUDES}" else AC_MSG_NOTICE([Tcl support disabled]) fi if test "${TCLX}" = "1"; then MY_TCL_LIBS="${TCLX_LIB_SPEC} ${TCLX_LIBS} ${MY_TCL_LIBS}" fi if test "${TK}" = "1"; then MY_TCLTK_LIBS="${TK_LIB_SPEC} ${TK_XLIBSW} ${MY_TCL_LIBS}" MY_TCLTK_INCS="${MY_TCL_INCS} ${TK_INCLUDES} ${TK_XINCLUDES}" else AC_MSG_NOTICE([Tk support disabled]) fi if test "${TKX}" = "1"; then MY_TCLTK_LIBS="${TKX_LIB_SPEC} ${TKX_LIBS} ${MY_TCLTK_LIBS}" fi if test "${TCL}" = "1"; then # try to hack in a run-time search path if needed T_ADD_RPATH([MY_TCL_LIBS]) orig_LIBS="$LIBS" orig_CFLAGS="$CFLAGS" LIBS="$LIBS $MY_TCL_LIBS" CFLAGS="$CFLAGS $MY_TCL_INCS" AC_CHECK_FUNC(Tcl_Init, ,[ if test "x$user_requested_tcl" = "xyes" ;then AC_MSG_ERROR([Your Tcl install is broken. Rerun configure with --without-tcl]) else AC_MSG_NOTICE([Your Tcl install is broken. Disabling Tcl support.]) TCL=0; TCLX=0; TK=0; TKX=0; fi]) LIBS="$orig_LIBS" CFLAGS="$orig_CFLAGS" fi if test "${TK}" = "1"; then # try to hack in a run-time search path if needed T_ADD_RPATH([MY_TCLTK_LIBS]) orig_LIBS="$LIBS" orig_CFLAGS="$CFLAGS" LIBS="$LIBS $MY_TCLTK_LIBS" CFLAGS="$CFLAGS $MY_TCLTK_INCS" AC_CHECK_FUNC(Tk_Init, ,[ if test "x$user_requested_tk" = "xyes" ;then AC_MSG_ERROR([Your Tk install is broken. Rerun configure with --without-tk]) else AC_MSG_NOTICE([Your Tk install is broken. Disabling Tk support.]) TK=0; TKX=0; fi]) LIBS="$orig_LIBS" CFLAGS="$orig_CFLAGS" fi dnl It is possible that the user has asked for a gui but no Tk dnl libraries were found. In this case we must disable the gui. AC_MSG_CHECKING([whether to include the GUI-clients]) AC_ARG_ENABLE(gui, [ --disable-gui do not include the GUI-clients], build_gui=$enableval) if test "x${build_clients}" != "xyes" -a "x${build_gui}" = "xyes"; then AC_MSG_ERROR([the GUI can not be build independent of the clients]) fi if test "x${build_clients}" != "xyes" -a "x${build_gui}" = "x"; then build_gui=no fi if test "x${build_gui}" = "xyes" -a "${TK}" != "1"; then AC_MSG_ERROR([cannot build GUI without Tk library]) fi if test "x${build_gui}" = "x" -a "${TK}" = "1"; then build_gui=yes fi if test "x${build_gui}" = "x"; then build_gui=no fi AC_MSG_RESULT($build_gui) AC_SUBST(build_gui) AM_CONDITIONAL(INCLUDE_GUI, [test "x$build_gui" = "xyes"]) AC_DEFINE_UNQUOTED(TCL, ${TCL}, [Define if PBS should use Tcl in its tools]) AC_DEFINE_UNQUOTED(TCLX, ${TCLX}, [Define if PBS should use TclX in its tools]) AC_DEFINE_UNQUOTED(TK, ${TK}, [Define if PBS should use Tk in its tools]) AC_DEFINE_UNQUOTED(TKX, ${TKX}, [Define if PBS should use Tkx in its tools]) AC_SUBST(MY_TCL_LIBS) AC_SUBST(MY_TCL_INCS) AC_SUBST(MY_TCLTK_LIBS) AC_SUBST(MY_TCLTK_INCS) AM_CONDITIONAL(USING_TCL, [test "$TCL" = "1"]) AM_CONDITIONAL(USING_TK, [test "$TK" = "1"]) use_tcl=$TCL use_tk=$TK AC_SUBST(use_tcl) AC_SUBST(use_tk) dnl Now look around for tclsh and wish if test "${TCL}" = "1"; then TEA_PROG_TCLSH dnl automatically subst TCLSH_PROG fi if test "${TK}" = "1"; then TEA_PROG_WISH dnl automatically subst WISH_PROG fi AC_ARG_WITH(tclatrsep, AC_HELP_STRING([--with-tclatrsep=CHAR],[set the Tcl attribute separator character this will default to "." if unspecified]), [tcl_atrsep="${withval}"], [tcl_atrsep="."]) if test "$TCL" = "1" ; then AC_MSG_CHECKING([checking for Tcl attribute seperator]) AC_MSG_RESULT([$tcl_atrsep]) fi AC_DEFINE_UNQUOTED(TCL_ATRSEP, "${tcl_atrsep}", [the seperator for Tcl attribute parsing]) AC_ARG_ENABLE(tcl-qstat, [ --enable-tcl-qstat setting this builds qstat with Tcl interpreter features. This is enabled if Tcl is enabled.]) AC_MSG_CHECKING([whether to enable tcl-qstat]) EXTRA_QSTAT_LIBS="" if test "x${enable_tcl_qstat}" = "x" -o "x${enable_tcl_qstat}" != "xno"; then if test "$TCL" = "1" ; then EXTRA_QSTAT_LIBS='$(EXTRA_QSTAT_LIBS)' AC_DEFINE(TCL_QSTAT, 1, [Define if PBS should build qstat with Tcl]) enable_tcl_qstat=yes else if test "${enable_tcl_qstat}" = "yes" ;then AC_MSG_ERROR([Cannot enable tcl-qstat without also using Tcl]) else enable_tcl_qstat=no fi fi fi AC_MSG_RESULT($enable_tcl_qstat) AC_SUBST(EXTRA_QSTAT_LIBS) AM_CONDITIONAL(USE_TCLQSTAT, [test "x$EXTRA_QSTAT_LIBS" != "x"]) if test "$SCHD_TYPE" = "tcl" -a "$TCL" = "0" ;then AC_MSG_ERROR([Tcl scheduler cannot be built without Tcl support]) fi AC_MSG_NOTICE([Finished Tcl/Tk configuration]) ]) torque-2.4.16/buildutils/config.sub0000755000113300011330000007511311605403772014211 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. timestamp='2004-08-29' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: torque-2.4.16/buildutils/missing0000755000113300011330000002453311605403716013623 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: torque-2.4.16/buildutils/modulefiles.vers.in0000664000113300011330000000005611272401234016027 00000000000000#%Module set ModulesVersion @PACKAGE_VERSION@ torque-2.4.16/buildutils/acx_pthread.m40000664000113300011330000002222211272401234014734 00000000000000dnl $Id: acx_pthread.m4,v 1.2 2006/08/24 19:27:13 ciesnik Exp $ dnl dnl Check for libs/cppflags needed for POSIX Threads dnl dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl Modified from the original version: dnl * Removed pthread-specific CC support dnl * Added FreeBSD specific -pthread/-lpthread flags dnl Notes: dnl * -D_THREAD_SAFE may not be necessary on FreeBSD dnl and elsewhere. dnl - landonf March 25th, 2005 dnl dnl This macro figures out how to build C programs using POSIX threads. dnl It sets the PTHREAD_LIBS output variable to the threads library and dnl linker flags, and the PTHREAD_CFLAGS output variable to any special dnl C compiler flags that are needed. (The user can also force certain dnl compiler flags/libs to be tested by setting these environment dnl variables.) dnl dnl NOTE: You are assumed to not only compile your program with these dnl flags, but also link it with them as well. e.g. you should link dnl with $CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS dnl $LIBS dnl dnl If you are only building threads programs, you may wish to use dnl these variables in your default LIBS, and CFLAGS: dnl dnl LIBS="$PTHREAD_LIBS $LIBS" dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" dnl dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). dnl dnl ACTION-IF-FOUND is a list of shell commands to run if a threads dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the dnl default action will define HAVE_PTHREAD. dnl dnl Please let the authors know if this macro fails on any platform, or dnl if you have any other suggestions or comments. This macro was based dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. dnl We are also grateful for the helpful feedback of numerous users. dnl dnl @category InstalledPackages dnl @author Steven G. Johnson dnl @version 2005-01-14 dnl @license GPLWithACException AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; *freebsd*) # freebsd 4 uses -pthread, freebsd 5 uses -lpthread acx_pthread_flags="pthread -pthread" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" PTHREAD_LIBS="$flag" ;; pthread-config) AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include ], [int attr=$attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD torque-2.4.16/torque.setup0000775000113300011330000000235111272401253012436 00000000000000#!/bin/sh # torque.setup # USAGE: torque.setup [] if [ "$1" = "" ] ; then echo "USAGE: torque.setup " exit 1 fi if [ "$2" = "" ] ; then # obtain name obtained from reverse lookup of ip address HOSTNAME=`perl -e "print +(gethostbyname(\"$(hostname)\"))[0]"` else HOSTNAME=$2 fi # enable operator privileges USER=$1@$HOSTNAME echo "initializing TORQUE (admin: $USER)" ps -ef | grep -v grep | grep pbs_server if [ "$?" -eq "0" ] ; then echo "ERROR: pbs_server already running... run 'qterm' to stop pbs_server and rerun" exit 1; fi pbs_server -t create echo set server operators += $USER | qmgr if [ "$?" -ne "0" ] ; then echo "ERROR: cannot set TORQUE admins" qterm exit 1; fi echo set server managers += $USER | qmgr qmgr -c 'set server scheduling = true' qmgr -c 'set server keep_completed = 300' qmgr -c 'set server mom_job_sync = true' # create default queue qmgr -c 'create queue batch' qmgr -c 'set queue batch queue_type = execution' qmgr -c 'set queue batch started = true' qmgr -c 'set queue batch enabled = true' qmgr -c 'set queue batch resources_default.walltime = 1:00:00' qmgr -c 'set queue batch resources_default.nodes = 1' qmgr -c 'set server default_queue = batch' torque-2.4.16/INSTALL.GNU0000664000113300011330000002200411272401253011510 00000000000000Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for variables by setting them in the environment. You can do that on the command line like this: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. torque-2.4.16/Release_Notes0000664000113300011330000000366611571534631012530 00000000000000This file contains a few notes on building and installing TORQUE and Release notes for each release. New in 2.4.13 ------------- 2.4.13 is a collection of bug fixes to the 2.4-fixes branch of TORQUE. To see a complete list of changes to 2.4.13 see the CHANGELOG in the distribution or you can view them at http://www.clusterresources.com/downloads/torque/CHANGELOGS/torque-2.4.13.CHANGELOG NEW in 2.4.12 -------------- The buildutils/torque.spec.in file has been modified to comply more closely with RPM standards. Users may experience some unexpected behavior from what they have experienced in past versions of TORQUE. Please post your questions, problems and concerns to the mailing list at torqueuers@supercluster.org While Adaptive Computing distributes the files need to build RPMs as part of the build it does not support those files. Not every Linux distribution uses RPM. Adaptive Computing provides a single solution using make and make install that works across all Linux distributions and most UNIX systems. We recognize the RPM format provides many advantages for deployment but it is up to the indiviual site to repackage the TORQUE installation to match their individual needs. If you have issues with the new spec files please post the issue or questions to the torque users (torqueusers@supercluster.org) mailing list REQUIREMENTS ------------ An ANSI C compiler is required. The native C compiler is recommended if it is ANSI, otherwise use gcc. A fully POSIX make is required. If you are unable to "make" PBS with your make, we suggest use of gmake from GNU. Tcl/Tk version 8 or higher is required if you plan to build the GUI portion of TORQUE or use a Tcl based scheduler. BUILD AND INSTALLATION DIRECTIONS --------------------------------- The directions to build and install are found the PBS Administrators Guide. A postscript and PDF copy are found in this directory. Please read and following the directions CAREFULLY. torque-2.4.16/Makefile.am0000664000113300011330000001332011536465653012105 00000000000000include $(top_srcdir)/buildutils/config.mk SUBDIRS = src doc EXTRA_DIST = CHANGELOG \ INSTALL.GNU \ PBS_License.txt \ README.configure \ README.cygwin \ README.torque \ Release_Notes \ torque.setup \ torque.spec \ buildutils/config.mk \ buildutils/modulefiles.in \ buildutils/modulefiles.vers.in \ buildutils/pbs_mach_type \ buildutils/pbs_mkdirs.in \ buildutils/self-extract-head-sh.in \ buildutils/torque.spec.in \ contrib/blcr/checkpoint_script \ contrib/blcr/restart_script \ contrib/init.d/debian.pbs_mom \ contrib/init.d/debian.pbs_sched \ contrib/init.d/debian.pbs_server \ contrib/init.d/pbs_mom \ contrib/init.d/pbs_sched \ contrib/init.d/pbs_server \ contrib/init.d/suse.pbs_mom \ contrib/init.d/suse.pbs_sched \ contrib/init.d/suse.pbs_server \ contrib/pam_authuser.tar.gz \ contrib/pbstop \ contrib/pbsweb-lite-0.95.tar.gz \ contrib/pestat-1.0/Makefile \ contrib/pestat-1.0/pestat.c \ contrib/pestat-1.0/README \ contrib/qpeek \ contrib/qpool.gz \ contrib/README.pam_authuser \ contrib/README.pbs_ganglia_jobmonarch \ contrib/README.pbs_python \ contrib/README.pbstools \ contrib/README.pbstop \ contrib/README.pbs_weblite \ contrib/README.pestat \ contrib/README.qpeek bin_SCRIPTS = pbs-config DISTCLEANFILES = pbs-config DISTCHECK_CONFIGURE_FLAGS=--with-server-home=$$dc_install_base/spool snap: $(MAKE) VERSION=$(VERSION)-snap.$${snapstamp:-`date +%Y%m%d%H%M`} dist dist-hook: case $(VERSION) in *-snap.*) \ for SPEC in torque.spec buildutils/torque.spec.in ; do \ chmod u+w $(distdir)/$$SPEC ; \ sed -e 's/^.define snap .*/%define snap 1/;' \ -e 's/^.define tarversion .*/%define tarversion $(VERSION)/' \ $(srcdir)/$$SPEC > $(distdir)/$$SPEC ; \ done ; \ chmod u+wx $(distdir)/configure ; \ sed -e 's/VERSION=.*/VERSION=$(VERSION)/' $(srcdir)/configure > $(distdir)/configure ;; \ esac chmod u+w $(distdir)/README.torque sed -e 's/TORQUE .* README .*/TORQUE $(VERSION) README (released '"`date '+%b, %d %Y'`"')/' $(srcdir)/README.torque > $(distdir)/README.torque srpm: dist rpmbuild -ts $(distdir).tar.gz rpm: dist rpmbuild $(RPM_AC_OPTS) $(RPMOPTS) -tb $(distdir).tar.gz # # Used by the 'packages' target below # # Additional package name, should be redefined to something meaningful to # the user. PKGNAME = package # Directory with files that override the packaged files. # Can be redefined on the make cmdline to a permanent location PKGOVERRIDE = $(PWD)/pkgoverride # temp dir for the packaged files and tarballs PKGROOT = $(PWD)/tpackages if INCLUDE_SERVER SERVER_PKG = server endif if INCLUDE_MOM MOM_PKG = mom endif if INCLUDE_CLIENTS CLIENTS_PKG = clients endif if INCLUDE_GUI GUI_PKG = gui endif if INCLUDE_PAM PAM_PKG = pam endif if INCLUDE_DRMAA DRMAA_PKG = drmaa endif ALL_PKGS = $(SERVER_PKG) $(MOM_PKG) $(CLIENTS_PKG) $(GUI_PKG) $(PAM_PKG) $(DRMAA_PKG) devel doc install_server install_mom install_clients install_gui install_lib install_pam install_drmaa: (cd src && $(MAKE) $@) install_doc: (cd doc && $(MAKE) $@) install_devel: install-binSCRIPTS (cd src && $(MAKE) $@) packages: @if `echo $(PKGROOT) | grep ^/ >/dev/null`;then \ echo "Building packages from $(PKGROOT)"; \ else \ echo "Error: PKGROOT must be an absolute path"; \ exit 1; \ fi rm -rf $(PKGROOT) mkdir $(PKGROOT) @for d in $(ALL_PKGS);do \ proot=$(PKGROOT)/$$d; \ pname=$(PKGNAME); \ phost=$(PBS_MACH)-@host_cpu@; \ tarball=$(PKGROOT)/$(PACKAGE_NAME)-$$pname-$$d-$$phost.tar.gz; \ pkgfile=./$(PACKAGE_NAME)-$$pname-$$d-$$phost.sh; \ echo "Building $$pkgfile ..."; \ $(MAKE) DESTDIR=$$proot install_$$d >/dev/null || exit 1; \ case $$d in \ devel) :;; \ *) rm -f $$proot/$(libdir)/*a $$proot/$(libdir)/*.so;; \ esac; \ if test -d $(PKGOVERRIDE)/$$d ;then \ echo "Using override dir $(PKGOVERRIDE)/$$d"; \ ( cd $(PKGOVERRIDE)/$$d && tar cf - . | (cd $$proot; tar xvf - ) ); \ fi; \ test $$d = gui && echo dummy > $$proot/regen-tclIndex; \ ( cd $$proot; tar cf - * ) | gzip > $$tarball && \ ( cd $$proot; tar cf - \ `test -f ./post-install && echo ./post-install` \ `test -f ./regen-tclIndex && echo ./regen-tclIndex` \ `test -d .$(sbindir) && echo .$(sbindir)/*` \ `test -d .$(bindir) && echo .$(bindir)/*` \ `test -d .$(libdir) && echo .$(libdir)/*` \ `test -d .$(mandir) && echo .$(mandir)/*/*` \ `test -d .$(includedir) && echo .$(includedir)/*` \ `test -d .$(pammoddir) && echo .$(pammoddir)/*` \ `test -d .$(PBS_SERVER_HOME) && echo .$(PBS_SERVER_HOME)/*` ) \ | gzip > $$tarball && \ cat ./buildutils/self-extract-head-sh > $$pkgfile && \ cat $$tarball >> $$pkgfile && \ chmod 755 $$pkgfile; \ done @echo "Done." @echo "" @echo "The package files are self-extracting packages that can be copied"; \ echo "and executed on your production machines. Use --help for options."; if INSTALL_MODULEFILES install-data-hook: $(INSTALL_DATA) -D ./buildutils/modulefiles $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/$(PACKAGE_VERSION) $(INSTALL_DATA) ./buildutils/modulefiles.vers $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/.version uninstall-hook: rm -f $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/$(PACKAGE_VERSION) rm -f $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME)/.version rmdir $(DESTDIR)$(MODULEFILES_DIR)/$(PACKAGE_NAME) endif torque-2.4.16/README.configure0000664000113300011330000000345511272401253012700 00000000000000Torque: New autoconf / automake realisation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OpenPBS - and hence Torque - was using a rather old autoconf setup together with several hand-made makefiles. Both had a lot of problems: missing DESTDIR support, included chowns and - last but not least - the configure.in was not compileable by a decent autoconf. This version now includes a partly rewritten autoconf script and was changed to use automake and libtool. You need at least automake-1.5, libtool-1.4 and autoconf-2.53 to regenerate the buildsystem. Please be aware, that the behaviour of configure has changed: - server, mom, clients, gui and Tcl/Tk are _enabled_ by default - "--set-..." is now "--with-..." - "--with-tcl=..." now needs path and filename of your tclConfig.sh file! (the same is true for Tclx, Tk, Tkx) Shared libs are now built by default if the build host supports it. Only a single libtorque, instead of libnet, liblog, libpbs, etc. are now built and installed. The Tcl-environment should be found automatically if it is located in the usual places - but this is not the case for (some?) Debian systems. If configure fails even though you have Tcl installed, then please `locate` the file "tclConfig.sh" and provide full path and filename to the "--with-tcl=" argument. Repeat for the other Tcl parts. Please read INSTALL.GNU for generic instructions about configure. The configure script and the makefiles can be recreated by this mini-script: --------- #! /bin/sh libtoolize --force --copy \ && aclocal \ && autoheader \ && automake --foreign --add-missing --force-missing --copy \ && autoconf --------- If you encounter problems, then please make sure you are using at least above mentioned versions of these tools. Karsten Petersen, Nov 2003 - Feb 2004 torque-2.4.16/CHANGELOG0000664000113300011330000022011111613641364011250 00000000000000c - crash b - bug fix e - enhancement f - new feature n - note 2.4.16 b - merged patch from Chris Samuel for bugzilla bug 149. A previous change to job_purge to make it mult-threaded and avoid hanging while deleting files caused a seg-fault in the MOM. This change fixes the seg-fault. b - Merged revision 4884 from 2.5-fixes. Fixed kill_job so it will only run epilogue.precancel when a job is canceled and not on normal job exit. b - A fix for the patch for bugzilla bug 149. job_purge routine rewritten so all files are deleted in child process. The child process also must terminate using the _exit() call to prevent rpp shutdown functions to be called with at_exit or on_exit. 2.4.15 b - fix bugzilla #134, qmgr -= was deleting all entries (backported from 3.0.2) b - do not prepend ${HOME} with the current dir for -o and -e in qsub (backported from 3.0.2) b - Fixed a potential buffer overflow problem in src/resmom/checkpoint.c function mom_checkpoint_recover. I modified the code to change strcpy and strcat to strncpy and strncpy. b - Fixed a bug for high availability. The -l listener option for pbs_server was not complete and did not allow pbs_server to properly communicate with the scheduler. Also fixed a bug with job dependencies where the second server or later in the $TORQUE_HOME/server_name directory was not added as part of the job dependecny so dependent jobs would get stuck on hold if the current server was not the first server in the server_name file. 2.4.14 b - fix a potential buffer overflow security issue in job names and host address names (backported from 3.0.2) 2.4.13 e - change so blcr checkpoint jobs can restart on different node. Use configure --enable-blcr to allow. (Bugzilla 68, backported from 2.5.5) e - Add code to verify the group list as well when VALIDATEGROUPS is set in torque.cfg (backported from 3.0.1) b - Fix a bug where if geometry requests are enabled and cpusets are enabled, the cpuset wasn't deleted unless a geometry request was made. (backported from 3.0.1) b - Fix a race condition for pbs_mom -q, exitstatus was getting overwritten and as a result pbs_server wasn't always re-queued, but were being deleted instead. (backported from 3.0.1) b - allow apostrophes in Mail_Users attributes, as apostrophes are rare but legal email characters (backported from 3.0.1) b - Fixed a problem in parse_node_token where the local static variable pt would be advanced past the end of the line input if there is no newline character at the end of the nodes file. b - Updated torque.spec.in to be able to handle the snapshot names of builds. b - Merged revisions 4555, 4556 and 4557 from 2.5-fixes branch. This revisions fix problems in High availability mode and also a problem where the MOM was not releasing the lock on mom.lock on exit. b - fix pbs_mom -q to work with parallel jobs (backported from 3.0.1) b - fixed a bug in set_resources that prevented the last resource in a list from being checked. As a result the last item in the list would always be added without regard to previous entries. e - allow more than 5 concurrent connections to TORQUE using pbsD_connect. Increase it to 10 (backported from 3.0.1) b - fix a segfault when receiving an obit for a job that no longer exists (backported from 3.0.1) b - Fixed a problem with minimum sizes in queues. Minimum sizes were not getting enforced because the logic checking the queue against the user request used and && when it need a || in the comparison. c - fix a segfault when queue has acl_group_enable and acl_group_sloppy set true and no acl_groups are defined. (backported from 3.0.1) e - To fix Bugzilla Bug 121 I created a thread in job_purge on the mom in the file src/resmom/job_func.c All job purging now happens on its own thread. If any of the system calls fail to return the thread will hang but the MOM will still be able to process work. e - Updated Makefile.in, configure, etc. to reflect change in configure.ac to add libpthread to the build. This was done for the fix for Bugzilla Bug 121. b - Added patch from Michael Jennings to buildutils/torque.spec.in. This patch allows an rpm configured with DRMAA to complete even if all of the support files are not present on the system. 2.4.12 b - Bugzilla bug 84. Security bug on the way checkpoint is being handled. (Robin R. - Miami Univ. of Ohio, back-ported from 2.5.3) b - make the tcp reading buffer able to grow dynamically to read larger values in order to avoid "invalid protocol" messages (backported from 2.5.3) b - could not set the server HA parameters lock_file_update_time and lock_file_check_time previously. Fixed. (backported from 2.5.3) e - qpeek now has the options --ssh, --rsh, --spool, --host, -o, and -e. Can now output both the STDOUT and STDERR files. Eliminated numlines, which didn't work. (backported from 2.5.3) b - Modified the pbs_server startup routine to skip unknown hosts in the nodes file instead of terminating the server startup. b - fix to prevent a possible segfault when using checkpointing (back-ported from 2.5.3). b - fix to cleanup job files on mom after a BLCR job is checkpointed and held (back-ported from 2.5.3) c - when using job_force_cancel_time, fix a crash in rare cases (backported from 2.5.4) b - fix a potential memory corruption for walltime remaining for jobs (Vikentsi Lapa, backported from 2.5.4) b - fix potential buffer overrun in pbs_sched (Bugzilla #98, patch from Stephen Usher @ University of Oxford, backported from 2.5.4) e - check if a process still exists before killing it and sleeping. This speeds up the time for killing a task exponentially, although this will show mostly for SMP/NUMA systems, but it will help everywhere. (backported from 2.5.4) (Dr. Bernd Kallies) e - Refactored torque spec file to comply with established RPM best practices, including the following: - Standard installation locations based on RPM macro configuration (e.g., %{_prefix}) - Latest upstream RPM conditional build semantics with fallbacks for older versions of RPM (e.g., RHEL4) - Initial set of optional features (GUI, PAM, syslog, SCP) with more planned - Basic working configuration automatically generated at install-time - Reduce the number of unnecessary subpackages by consolidating where it makes sense and using existing RPM features (e.g., --excludedocs). b - Merged revision 4325 from 2.5-fixes. Fixed a problem where the -m n (request no mail on qsub) was not always being recongnized. b - Fix for reque failures on mom. Forked pbs_mom would silently segfault and job was left in Exiting state. (backported from 2.5.4) b - prevent the nodes file from being overwritten when running make packages b - change so "mom_checkpoint_job_has_checkpoint" and "execing command" log messages do not always get logged (back-ported from 2.5.4) b - remove the use of a GNU specific function. (back-ported from 2.5.5) 2.4.11 b - changed type cast for calloc of ioenv from sizeof(char) to sizof(char *) in pbsdsh.c. This fixes bug 79. e - allow input of walltime in the format of [DD]:HH:MM:SS (backported from 2.5.2) b - only clear the mom state when actually running the health check script (backported from 2.5.3) b - don't try to set the user id multiple times - (backported from 2.5.3) c - fix segfault in tracejob. It wasn't malloc'ing space for the null terminator (back-ported from 2.5.3) e - add the variables PBS_NUM_NODES and PBS_NUM_PPN to the job environment (backported from 2.5.3, TRQ-6) e - be able to append to the job's variable_list through the API (backported from 2.5.3, TRQ-5) b - Added patch to fix bug 76, "blocking read does not time out using signal handler. 2.4.10 b - fix to get new pagg ID and add additional CSA records when restarting from checkpoint (backported from 2.5.2) e - added documentation for pbs_alterjob_async(), pbs_checkpointjob(), pbs_fbserver(), pbs_get_server_list() and pbs_sigjobasync(). (backported from 2.5.2) b - fix for bug 61. The fix takes care of a problem where pbs_mom under some situations will change the mode and permissions of /dev/null. 2.4.9 b - Backed out enhancement for preempted jobs. This was SVN revision 3784. This patch cased qrun to hang and not return when executing jobs. e - Commited changes that changed how preempted jobs are killed. This change uses a SIGTERM followed by a kill_delay SIGKILL to give preemted jobs time to checkpoint before terminating. e - Patch to correctly log attempts to create a cpuset as debug messages. The function im_request() in src/resmom/mom_comm.c logs the message: pbs_mom: LOG_ERROR::im_request, about to create cpuset for job 55100.blah. as an error rather than a debug message (as used in src/resmom/start_exec.c). The fix is to replace: log_err(-1, id, log_buffer); with: log_ext(-1, id, log_buffer, LOG_INFO); b - Modified fix in qmgr.c in is_attr to check for the '.' character on resource attributes such as resources_available.nodect. The attribute is striped of the '.' and the element and just the attribute name is used to compare for a valid attribute. b - Made a fix to qmgr.c in is_attr. When checking node names against attribute keywords is_attr used strncmp and limited the length of the compare to the length of the keyword. So node names like stateless were tagged as an error. I replaced strncmp with strcmp. This fix was added to trunk first. Version 2.5.0 b - Bugzilla bug 57. Check return value of malloc for tracejob for Linux (Chris Samuel - Univ. of Melbourne) b - fix so "gres" config gets displayed by pbsnodes b - use QSUBHOST as the default host for output files when no host is specified. (RT 7678) e - allow users to use cpusets and geometry requests at the same time by specifying both at configure time. b - Bugzilla bug 55. Check return value of malloc for pbs_mom for Linux (Chris Samuel - Univ. of Melbourne) e - added server parameter job_force_cancel_time. When configured to X seconds, a job that is still there X seconds after a qdel will be purged. Useful for freeing nodes from a job when one node goes down midjob. b - fixed gcc warnings reported by Skip Montanaro e - added RPT_BAVAIL define that allows pbs_mom to report f_bavail instead of f_bfree on Linux systems b - no longer consider -t and -T the same in qsub e - make PBS_O_WORKDIR accessible in the environment for prolog scripts e - Bugzilla 59. Applied patch to allow '=' for qdel -m. (Chris Samuel - Univ. of Melbourne) b - properly escape characters (&"'<>) in XML output) b - ignore port when checking host in svr_get_privilege() b - restore ability to parse -W x=geometry:{...,...} e - from Simon Toth: If no available amount is specified for a resource and the max limit is set, the requirement should be checked against the maximum only (for scheduler, bugzilla 23). b - check return values from fwrite in cpuset.c to avoid warnings e - expand acl host checking to allow * in the middle of hostnames, not just at the beginning. Also allow ranges like a[10-15] to mean a10, a11, ..., a15. 2.4.8 e - Bugzilla bug 22. HIGH_PRECISION_FAIRSHARE for fifo scheduling. c - no longer sigabrt with "running" jobs not in an execution queue. log an error. b - fixed kill_delay. In order to fix and not change behavior, added the parameter $kill_delay to mom's config. Activate by setting to true b - commented out a 'fi' left uncommented in contrib/init/pbs_server e - mapped 'qsub -P user:group' to qsub -P user -W group_list=group e - added -DQSUBHOSTNAME to allow qsub to determine PBS_O_HOST b - fixed segfault for when TORQUE thinks there's a nanny but there isn't b - reverted to old behavior where interactive scripts are checked for directives and not run without a parameter. e - setting a queue's resource_max.nodes now actually restricts things, although so far it only limits based on the number of nodes (i.e. not ppn) f - added QSUBSENDGROUPLIST to qsub. This allows the server to know the correct group name when disable_server_id_check is set to true and the user doesn't exist on the server. e - Bugzilla bug 54. Patch submitted by Bas van der Vlies to make pbs_mkdirs more robust, provide a help function and new option -C n - TORQUE 2.4.8 released on 29-04-10 2.4.7 b - fixed a bug for when a resource_list has been set, but isn't completely initialized, causing a segfault b - stop counting down walltime remaining after a job is completed b - correctly display the number for tasks as used in TORQUE in qstat -a output b - no longer ignoring fread return values in linux cpuset code (gcc 4.3.3) b - fixed a bug where job was added to obit retry list multiple times, causing a segfault b - Fix for Bugzilla bug 43. "configure ignores with-modulefiles=no" b - no longer try to decide when to start with -t create in init.d scripts, -t creates should be done manually by the user b - no longer let qsub determine the PBS_O_HOST. This work is done on the server and the server code accounts for the connection interface as well as aliasing. Code to set PBS_O_HOST on the server is already there, but now will be active. f - added -P to qsub. When submitting a job as root, the root user may add -P to submit the job as the proxy user specified by n - 2.4.7 released on 29-03-10 2.4.6 f - added an asynchronous option for qsig, specified with -a. b - fix to cleanup job that is left in running state after a mom restart e - qsub's -W can now parse attributes with quoted lists, for example: qsub script -W attr="foo,foo1,foo2,foo3" will set foo,foo1,foo2,foo3 as attr's value. e - qstat -f now includes an extra field "Walltime Remaining" that tells the remaining walltime in seconds. This field is does not account for weighted walltime. b - fixed erroneous display of walltime when start time hasn't been set b - fixed possible segfault when finding remaining walltime (if the job's resources haven't been defined) e - altered the display of walltime remaining so that the xml produced by qstat -f stays consistent. Also updated the man page. b - split Cray job library and CSA functionality since CSA is dependant on job library but job library is not dependant on CSA f - added two server parameters: display_job_server_suffix and job_suffix_alias. The first defaults to true and is whether or not jobs should be appended by .server_name. The second defaults to NULL, but if it is defined it will be appended at the end of the jobid, i.e. jobid.job_suffix_alias. f - added -l option to qstat so that it will display a server name and an alias if both are used. If these aren't used, -l has no effect. b - fixed an off by one error for a case in get_correct_jobname e - altered the display_job_server_suffix parameter and the job_suffix_alias parameter so that they don't interfere with FQDN. b - fixed open_std_file to setegid as well, this caused a problem with epilogue.user scripts. n - 2.4.6 officially released on 02/24/2010 2.4.5 b - epilogue.user scripts were being run with prologue argments. Fixed bug in run_pelog() to include PE_EPILOGUSER so epilogue arguments get passed to eplilogue.user script. b - Ticket 6665. pbs_mom and job recovery. Fixed a bug where the -q option would terminate running processes as well as requeue jobs. This made the -q option the same as the -r option for pbs_mom. -q will now only reque jobs and will not attempt to kill running processes. I also added a -P option to start pbs_mom. This is similar to the -p option except the -P option will only delete any left over jobs from the queue and will not attempt to adopt and running processes. e - Modified man page for pbs_mom. Added new -P option plus edited -p, -q and -r options to hopefully make them more understandable. n - 01/15/2010 created snapshot torque-2.4.5-snap201001151416.tar.gz. b - now checks secondary groups (as well as primary) for creating a file when spooling. Before it wouldn't create the spool file if a user had permission through a secondary group. b - fixed a file descriptor error with high availability. Before it was possible to try to regain a file descriptor which was never held, now this is fixed. e - Added the function prepare_child_tasks_for_delete() to src/resmom/solaris5 /mom_mach.c. This is required for new -P functionality. b - updated to a newer gcc and fixed warnings related to disregarded return values. Logging was added. b - Modified code specific to Solaris5 platform. Changes were made so TORQUE would successfully compile on sun system. Tcl still does not successfully compile. configure needs to be done with the --disable-gui option. 01/21/2010. e - Moved the function p e - change so blcr checkpoint jobs can restart on different node. Use configure --enable-blcr to allow. repare_child_tasks_for_delete() from the mom_mach.c files for Linux and Solaris5. This routine is not platform dependent. No other platform had the function yet. 01/22/2010 e - Commited changes that will allow TORQUE to compile on the Solaris5 platform with gcc-warnings enabled. b - No longer overwrites the user's environment when spoolasfinalname is set. Now the environment is handled correctly. b - No longer will segfault if pbs_mom restarts in a bad state (user environment not initialized) e - added qmgr server attribute job_start_timeout, specifies timeout to be used for sending job to mom. If not set, tcp_timeout is used. e - added -DUSESAVEDRESOURCES code that uses servers saved resources used for accounting end record instead of current resources used for jobs that stopped running while mom was not up. e - Changing MAXNOTDEFAULT behavior. Now, by default, max is not default and max can be configured as default with --enable-maxdefault. n - TORQUE 2.4.5 released on 02/02/10 (Groundhog day!) 2.4.4 b - fixed contrib/init.d/pbs_mom so that it doesn't overwrite $args defined in /etc/sysconfig/pbs_mom b - when spool_as_final_name is configured for the mom, no longer send email messages about not being able to copy the spool file b - when spool_as_final_name is configured for the mom, correctly substitue job environment variables f - added logging for email events, allows the admin to check if emails are being sent correctly b - Made a fix to svr_get_privilege(). On some architectures a non-root user name would be set to null after the line " host_no_port[num_host_chars] = 0;" because num_host_chars was = 1024 which was the size of hot_no_port. The null termination needed to happen at 1023. There were other problems with this function so code was added to validate the incoming variables before they were used. The symptom of this bug was that non-root managers and operators could not perform operations where they should have had rights. b - Missed a format statement in an sprintf statement for the bug fix above. b - Fixed a way that a file descriptor (for the server lockfile) could be used without initialization. RT 6756 2.4.3 b - fix PBSD_authenticate so it correctly splits PATH with : instead of ; (bugzilla #33) e - Refactored tcp_dis function calls. With the removal of the global variable dis_buffer the seperation of dis calls was no longer needed. the tcp_dis function calls have been removed and all calls go to the dis functions whether using tcp or rpp. b - pbs_mom now sets resource limits for tasks started with tm_spawn (Chris Samuel, VPAC) c - fix assumption about size of unsocname.sun_path in Libnet/net_server.c b - Fix for Bugzilla bug 34. "torque 2.4.X breaks OSC's mpiexec". fix in src/server src/server/stat_job.c revision 3268. b - Fix for Bugzilla bug 35 - printing the wrong pid (normal mode) and not printing any pid for high availability mode. f - added a diagnostic script (contrib/diag/tdiag.sh). This script grabs the log files for the server and the mom, records the output of qmgr -c 'p s' and the nodefile, and creates a tarfile containing these. b - Changed momctl -s to use exit(EXIT_FAILURE) instead of return(-1) if a mom is not running. b - Fix for Bugzilla bug 36. "qsub crashes with long dependency list". b - Fix for Bugzilla bug 41. "tracejob creates a file in the local directory". 2.4.2 b - Changed predicate in pbsd_main.c for the two locations where daemonize_server is called to check for the value of high_availability_mode to determine when to put the server process in the background. b - Added pbs_error_db.h to src/include/Makefile.am and src/include/Makefile.in. pbs_error_db.h now needed for install. e - Modified pbs_get_server_list so the $TORQUE_HOME/server_name file will work with a comma delimited string or a list of server names separated by a new line. b - fix tracejob so it handles multiple server and mom logs for the same day f - Added a new server parameter np_default. This allows the administrator to change the number of processors to a unified value dynamically for the entire cluster. e - high availability enhanced so that the server spawns a separate thread to update the "lock" on the lockfile. Thread update and check time are both setable parameters in qmgr. b - close empty ACL files 2.4.1 e - added a prologue and epilogue option to the list of resources for qsub -l which allows a per job prologue or epilogue script. The syntax for the new option is qsub -l prologue=, epilogue= f - added a "-w" option to qsub to override the working directory e - changes needed to allow relocatable checkpoint jobs. Job checkpoint files are now under the control of the server. c - check filename for NULL to prevent crash b - changed so we don't try to copy a local file when the destination is a directory and the file is already in that directory f - changes to allow TORQUE to operate without pbs_iff (merged from 2.3) e - made logging functions rentrant safe by using localtime_r instead of localtime() (merged from 2.3) e - Merged in more logging and NOSIGCHLDMOM capability from Yahoo branch e - merged in new log_ext() function to allow more fine grained syslog events, you can now specify severity level. Also added more logging statements b - fixed a bug where CPU time was not being added up properly in all cases (fix for Linux only) c - fixed a few memory errors due to some uninitialized memory being allocated (ported from 2.3 R2493) e - added code to allow compilers to override CLONE_BATCH_SIZE at configure time (allows for finer grained control on how arrays are created) (ported from Yahoo R2461) e - added code which prefixes the severity tag on all log_ext() and log_err() messages (ported from Yahoo R2358) f - added code from 2.3-extreme that allows TORQUE to handle more than 1024 sockets. Also, increased the size of TORQUE's internal socket handle table to avoid running out of handles under busy conditions. e - TORQUE can now handle server names larger than 64 bytes (now set to 1024, which should be larger than the max for hostnames) e - added qmgr option accounting_keep_days, specifies how long to keep accounting files. e - changed mom config varattr so invoked script returns the varattr name and value(s) e - improved the performance of pbs_server when submitting large numbers of jobs with dependencies defined e - added new parameter "log_keep_days" to both pbs_server and pbs_mom. Specifies how long to keep log files before they are automatically removed e - added qmgr server attribute lock_file, specifies where server lock file is located b - change so we use default file name for output / error file when just a directory is specified on qsub / qalter -e -o options e - modified to allow retention of completed jobs across server shutdown e - added job_must_report qmgr configuration which says the job must be reported to scheduler. Added job attribute "reported". Added PURGECOMP functionality which allows scheduler to confirm jobs are reported. Also added -c option to qdel. Used to clean up unreported jobs. b - Fix so interactive jobs run when using $job_output_file_umask userdefault f - Allow adding extra End accounting record for a running job that is rerun. Provides usage data. Enabled by CFLAGS=-DRERUNUSAGE. b - Fix to use queue/server resources_defaults to validate mppnodect against resources_max when mppwidth or mppnppn are not specified for job f - merged in new dynamic array struct and functions to implement a new (and more efficient) way of loading jobs at startup--should help by 2 orders of magnitude! f - changed TORQUE_MAXCONNECTTIMEOUT to be a global variable that is now changed by the MOM to be smaller than the pbs_server and is also configurable on the MOM ($max_conn_timeout_micro_sec) e - change so queued jobs that get deleted go to complete and get displayed in qstat based on keep_completed b - Changes to improve the qstat -x XML output and documentation b - Change so BATCH_PARTITION_ID does not pass through to child jobs c - fix to prevent segfault on pbs_server -t cold b - fix so find_resc_entry still works after setting server extra_resc c - keep pbs_server from trying to free empty attrlist after recieving bad request (Michael Meier, University of Erlangen-Nurnberg) (merged from 2.3.8) f - new fifo scheduler config option. ignore_queue: queue_name allows the scheduler to be instructed to ignore up to 16 queues on the server (Simon Toth, CESNET z.s.p.o.) e - add administrator customizable email notifications (see manpage for pbs_server_attributes) - (Roland Haas, Georgia Tech) e - moving jobs can now trigger a scheduling iteration (merged from 2.3.8) e - created a utility module that is shared between both server and mom but does NOT get placed in the libtorque library e - allow the user to request a specific processor geometry for their job using a bitmap, and then bind their jobs to those processors using cpusets. b - fix how qsub sets PBS_O_HOST and PBS_SERVER (Eirikur Hjartarson, deCODE genetics) (merged from 2.3.8) b - fix to prevent some jobs from getting deleted on startup. f - add qpool.gz to contrib directory e - improve how error constants and text messages are represented (Simon Toth, CESNET z.s.p.o) f - new boolean queue attribute "is_transit" that allows jobs to exceede server resource limits (queue limits are respected). This allows routing queues to route jobs that would be rejected for exceeding local resources even when the job won't be run locally. (Simon Toth, CESNET z.s.p.o) e - add support for "job_array" as a type for queue disallowed_types attribute e - added pbs_mom config option ignmem to ignore mem/pmem limit enforcement e - added pbs_mom config option igncput to ignore pcput limit enforcement 2.4.0 f - added a "-q" option to pbs_mom which does *not* perform the default -p behavior e - made "pbs_mom -p" the default option when starting pbs_mom e - added -q to qalter to allow quicker response to modify requests f - added basic qhold support for job arrays b - clear out ji_destin in obit_reply f - add qchkpt command e - renamed job.h to pbs_job.h b - fix logic error in checkpoint interval test f - add RERUNNABLEBYDEFAULT parameter to torque.cfg. allows admin to change the default value of the job rerunnable attribute from true to false e - added preliminary Comprehensive System Accounting (CSA) functionality for Linux. Configure option --enable-csa will cause workload management records to be written if CSA is installed and wkmg is turned on. b - changes to allow post_checkpoint() to run when checkpoint is completed, not when it has just started. Also corrected issue when checkpoint fails while trying to put job on hold. b - update server immediately with changed checkpoint name and time attributes after successful checkpoint. e - Changes so checkpoint jobs failing after restarted are put on hold or requeued e - Added checkpoint_restart_status job attribute used for restart status b - Updated manpages for qsub and qterm to reflect changed checkpointing options. b - reject a qchkpt request if checkpointing is not enabled for the job b - Mom should not send checkpoint name and time to server unless checkpoint was successful b - fix so that running jobs that have a hold type and that fail on checkpoint restart get deleted when qdel is used b - fix so we reset start_time, if needed, when restarting a checkpointed job f - added experimental fault_tolerant job attribute (set to true by passing -f to qsub) this attribute indicates that a job can survive the loss of a sister mom also added corresponding fault_tolerant and fault_intolerant types to the "disallowed_types" queue attribute b - fixes for pbs_moms updating of comment and checkpoint name and time e - change so we can reject hold requests on running jobs that do not have checkpoint enabled if system was configured with --enable-blcr e - change to qsub so only the host name can be specified on the -e/-o options e - added -w option to qsub that allows setting of PBS_O_WORKDIR 2.3.8 c - keep pbs_server from trying to free empty attrlist after recieving bad request (Michael Meier, University of Erlangen-Nurnberg) e - moving jobs can now trigger a scheduling iteration b - fix how qsub sets PBS_O_HOST and PBS_SERVER (Eirikur Hjartarson, deCODE genetics) f - add qpool.gz to contrib directory b - fix return value of cpuset_delete() for Linux (Chris Samuel - VPAC) e - Set PBS_MAXUSER to 32 from 16 in order to accomodate systems that use a 32 bit user name.(Ken Nielson Cluster Resources) c - modified acct_job in server/accounting.c to dynamically allocate memory to accomodate strings larger than PBS_ACCT_MAX_RCD. (Ken Nielson Cluster Resources) e - all the user to turn off credential lifetimes so they don't have to lose iterations while credentials are renewed. e - added OS independent resending of failed job obits (from D Beer), also removed OS specific CACHEOBITFAILURES code. b - fix so after* dependencies are handled correctly for exiting / completed jobs 2.3.7 b - fixed a bug where UNIX domain socket communication was failing when "--disable-privports" was used. e - add job exit status as 10th argument to the epilogue script b - fix truncated output in qmgr (peter h IPSec+jan n NANCO) b - change so set_jobexid() gets called if JOB_ATR_egroup is not set e - pbs_mom sisters can now tolerate an explicit group ID instead of only a valid group name. This helps TORQUE be more robust to group lookup failures. 2.3.6 b - change back to not sending status updates until we get cluster addr message from server, also only try to send hello when the server stream is down. b - change pbs_server so log_file_max_size of zero behavior matches documentation e - added periodic logging of version and loglevel to help in support e - added pbs_mom config option ignvmem to ignore vmem/pvmem limit enforcement b - change to correct strtoks that accidentally got changed in astyle formatting e - in Linux, a pbs_mom will now "kill" a job's task, even if that task can no longer be found in the OS processor table. This prevents jobs from getting "stuck" when the PID vanishes in some rare cases. 2.3.5 e - added new init.d scripts for Debian/Ubuntu systems b - fixed a bug where TORQUE's exponential backoff for sending messages to the MOM could overflow 2.3.4 c - fixed segfault when loading array files of an older/incompatible version b - fixed a bug where if attempt to send job to a pbs_mom failed due to timeout, the job would indefinitely remain the in 'R' state b - qsub now properly interprets -W umask=0XXX as octal umask e - allow $HOME to be specified for path e - added --disable-qsub-keep-override to allow the qsub -k flag to not override -o -e. e - updated with security patches for setuid, setgid, setgroups b - fixed correct_ct() in svr_jobfunc.c so we don't crash if we hit COMPLETED job b - fixed problem where momctl -d 0 showed ConfigVersion twice e - if a .JB file gets upgraded pbs_server will back up the original b - removed qhold / qrls -h n option since there is no code to support it b - set job state and substate correctly when job has a hold attribute and is being rerun b - fixed a bug preventing multiple TORQUE servers and TORQUE MOMs from operating properly all from the same host e - fixed several compiler error and warnings for AIX 5.2 systems b - fixed a bug with "max_report" where jobs not in the Q state were not always being reported to scheduler 2.3.3 b - fixed bug where pbs_mom would sometimes not connect properly with pbs_server after network failures b - changed so run_pelog opens correct stdout/stderr when join is used b - corrected pbs_server man page for SIGUSR1 and SIGUSR2 f - added new pbs_track command which may be used to launch an external process and a pbs_mom will then track the resource usage of that process and attach it to a specified job (experimental) (special thanks to David Singleton and David Houlder from APAC) e - added alternate method for sending cluster addresses to mom (ALT_CLSTR_ADDR) 2.3.2 e - added --disable-posixmemlock to force mom not to use POSIX MEMLOCK. b - fix potential buffer overrun in qsub b - keep pbs_mom, pbs_server, pbs_sched from closing sockets opened by nss_ldap (SGI) e - added PBS_VERSION environment variable e - added --enable-acct-x to allow adding of x attributes to accounting log b - fix net_server.h build error 2.3.1 b - fixed a bug where torque would fail to start if there was no LF in nodes file b - fixed a bug where TORQUE would ignore the "pbs_asyrunjob" API extension string when starting jobs in asynchronous mode b - fixed memory leak in free_br for PBS_BATCH_MvJobFile case e - torque can now compile on Linux and OS X with NDEBUG defined f - when using qsub it is now possible to specify both -k and -o/-e (before -o/-e did not behave as expected if -k was also used) e - changed pbs_server to have "-l" option. Specifies a host/port that event messages will be sent to. Event messages are the same as what the scheduler currently receives. e - added --enable-autorun to allow qsub jobs to automatically try to run if there are any nodes available. e - added --enable-quickcommit to allow qsub to combine the ready to commit and commit phases into 1 network transmission. e - added --enable-nochildsignal to allow pbs_server to use inline checking for SIGCHLD instead of using the signal handler. e - change qsub so '-v var=' will look in environment for value. If value is not found set it to "". b - fix qdel of entire job arrays for non operator/managers b - fix so we continue to process exiting jobs for other servers e - added source_login_batch and source_login_interactive to mom config. This allows us to bypass the sourcing of /etc/profile, etc. type files. b - fixed pbs_server segmentation fault when job_array submissions are rejected before ji_arraystruct was initialized e - add some casts to fix some compiler warnings with gcc-4.1 on i386 when -D_FILE_OFFSET_BITS=64 is set e - added --enable-maxnotdefault to allow not using resources_max as defaults. b - added new values to TJobAttr so we don't have mismatch with job.h values. b - reset ji_momhandle so we cannot have more than one pjob for obit_reply to find. e - change qdel to accept 'ALL' as well as 'all' b - changed order of searching so we find most recent jobs first. Prevents finding old leftover job when pids rollover. Also some CACHEOBITFAILURES updates. b - handle case where mom replies with an unknown job error to a stat request from the server b - allow qalter to modify HELD jobs if BLCR is not enabled b - change to update errpath/outpath attributes when -e -o are used with qsub e - added string output for errnos, etc. 2.3.0 b - fixed a bug where TORQUE would ignore the "pbs_asyrunjob" API extension string when starting jobs in asynchronous mode e - redesign how torque.spec is built e - added -a to qrun to allow asynchronous job start e - allow qrerun on completed jobs e - allow qdel to delete all jobs e - make qdel -m functionality match the documentation b - prevent runaway hellos being sent to server when mom's node is removed from the server's node list e - local client connections use a unix domain socket, bypassing inet and pbs_iff f - Linux 2.6 cpuset support (in development) e - new job array submission syntax b - fixed SIGUSR1 / SIGUSR2 to correctly change the log level f - health check script can now be run at job start and end e - tm tasks are now stored in a single .TK file rather than eat lots of inodes f - new "extra_resc" server attribute b - "pbs_version" attr is now correctly read-only e - increase max size of .JB and .SC file names e - new "sched_version" server attribute f - new printserverdb tool e - pbs_server/pbs_mom hostname arg is now -H, -h is help e - added $umask to pbs_mom config, used for generated output files. e - minor pbsnodes overhaul b - fixed memory leak in pbs_server 2.2.2 b - correctly parse /proc/pid/stat that contains parens (Meier) b - prevent runaway hellos being sent to server when mom's node is removed from the server's node list b - fix qdel of entire job arrays for non operator/managers b - fix problem where job array .AR files are not saved to disk b - fixed problem with tracking job memory usage on OS X b - fix memory leak in server and mom with MoveJobFile requests (backported from 2.3.1) b - pbs_server doesn't try to "upgrade" .JB files if they have a newer version of the job_qs struct 2.2.1 b - fix a bug where dependent jobs get put on hold when the previous job has completed but its state is still available for life of keep_completed b - fixed a bug where pbs_server never delete files from the "jobs" directory b - fixed a bug where compute nodes were being put in an indefinite "down" state e - added job_array_size attribute to pbs_submit documentation 2.2.0 e - improve RPP logging for corruption issues f - dynamic resources e - use mlockall() in pbs_mom if _POSIX_MEMLOCK f - consumable resource "tokens" support (Harte-Hanks) e - build process sets default submit filter path to ${libexecdir}/qsub_filter we fall back to /usr/local/sbin/torque_submitfilter to maintain compatibility e - allow long job names when not using -N f - new MOM $varattr config e - daemons are no longer installed 700 e - tighten directory path checks f - new mom configs: $auto_ideal_load and $auto_max_load e - pbs_mom on Darwin (OS X) no longer depends on libkvm (now works on all versions without need to re-enable /dev/kmem on newer PPC or all x86 versions) e - added PBS_SERVER env variable for job scripts e - add --about support to daemons and client commands f - added qsub -t (primitive job array) e - add PBS_RESOURCE_GRES to prolog/epilog environment e - add -h hostname to pbs_mom (NCIFCRF) e - filesec enhancements (StockholmU) e - added ERS and IDS documentation e - allow export of specific variables into prolog/epilog environment b - change fclose to pclose to close submit filter pipe (ABCC) e - add support for Cray XT size and larger qstat task reporting (ORNL) b - pbs_demux is now built with pbs_mom instead of with clients e - epilogue will only run if job is still valid on exec node e - add qnodes, qnoded, qserverd, and qschedd symlinks e - enable DEFAULTCKPT torque.cfg parameter e - allow compute host and submit host suffix with nodefile_suffix f - add --with-modulefiles=[DIR] support b - be more careful about broken tclx installs 2.1.11 b - nqs2pbs is now a generated script b - correct handling of priv job attr b - change font selectors in manpages to bold b - on pbs_server startup, don't skip job-exclusive nodes on initial MOM scan b - pbs_server should not connect to "down" MOMs for any job operation b - use alarm() around writing to job's stdio incase it happens to be a stopped tty 2.1.10 b - fix buffer overflow in rm_request, fix 2 printf that should be sprintf (Umea University) b - correct updating trusted client list (Yahoo) b - Catch newlines in log messages, split messages text (Eygene Ryabinkin) e - pbs_mom remote reconfig pbs_mom now disabled by default use $remote_reconfig to enable it b - fix pam configure (Adrian Knoth) b - handle /dev/null correctly when job rerun 2.1.9 f - new queue attribute disallowed_types, currently recognized types: interactive, batch, rerunable, and nonrerunable e - refine "node note" feature with pbsnodes -N e - bypass pbs_server's uid 0 check on cygwin e - update suse initscripts b - fix mom memory locking b - fix sum buffer length checks in pbs_mom b - fix memory leak in fifo scheduler b - fix nonstandard usage of 'tail' in tpackage b - fix aliasing error with brp_txtlen f - allow manager to set "next job number" via hidden qmgr attribute next_job_number 2.1.8 b - stop possible memory corruption with an invalid request type (StockholmU) b - add node name to pbsnodes XML output (NCIFCRF) b - correct Resource_list in qstat XML output (NCIFCRF) b - pam_authuser fixes from uam.es e - allow 'pbsnodes -l' to work with a node spec b - clear exec_host and session_id on job requeue b - fix mom child segfault when a user env var has a '%' b - correct buggy logging in chk_job_request() (StockholmU) e - pbs_mom shouldn't require server_name file unless it is actually going to be read (StockholmU) f - "node notes" with pbsnodes -n (sandia) 2.1.7 b - fix bison syntax error in Parser.y b - fix 2.1.4 regression with spool file group owner on freebsd b - don't exit if mlockall sets errno ENOSYS f - qalter -v variable_list f - MOMSLEEPTIME env delays pbs_mom initialization e - minor log message fixups e - enable node-reuse in qsub eval if server resources_available.nodect is set e - pbs_mom and pbs_server can now use PBS_MOM_SERVER_PORT, PBS_BATCH_SERVICE_PORT, and PBS_MANAGER_SERVICE_PORT env vars. e - pbs_server can also use PBS_SCHEDULER_SERVICE_PORT env var. e - add "other" resource to pelog's 5th argument 2.1.6 b - freebsd5 build fix b - fix 2.1.4 regression with TM on single-node jobs b - fix 2.1.4 regression with rerunning jobs b - additional spool handling security fixes 2.1.5 b - fix 2.1.4 regression with -o/dev/null 2.1.4 b - fix cput job status b - Fix "Spool Job Race condition" 2.1.3 b - correct run-time symbol in pam module on RHEL4 b - some minor hpux11 build fixes (PACCAR) b - fix bug with log roll and automatic log filenames b - compile error with size_fs() on digitalunix e - pbs_server will now print build details with --about e - new freebsd5 mom arch for Freebsd 5.x and 6.x (trasz) f - backported new queue attribute "max_user_queuable" e - optimize acl_group_sloppy e - fix "list_head" symbol clash on Solaris 10 e - allow pam_pbssimpleauth to be built on OSX and Solaris b - networking fixes for HPUX, fixes pbs_iff (PACCAR) e - allow long job names when not using -N c - using depend=syncwith crashed pbs_server c - races with down nodes and purging jobs crashed pbs_server b - staged out files will retain proper permission bits f - may now specify umask to use while creating stderr and stdout spools e.g. qsub -W umask=22 b - correct some fast startup behaviour e - queue attribute max_queuable accounts for C jobs 2.1.2 b - fix momctl queries with multiple hosts b - don't fail make install if --without-sched b - correct MOM compile error with atol() f - qsub will now retry connecting to pbs_server (see manpage) f - X11 forwarding for single-node, interactive jobs with qsub -X f - new pam_pbssimpleauth PAM module, requires --with-pam=DIR e - add logging for node state adjustment f - correctly track node state and allocation based for suspended jobs e - entries can always be deleted from manager ACL, even if ACL contains host(s) that no longer exist e - more informative error message when modifying manager ACL f - all queue create, set, and unset operations now set a queue mtime f - added support for log rolling to libtorque f - pbs_server and pbs_mom have two new attributes log_file_max_size, log_file_roll_depth e - support installing client libs and cmds on unsupported OSes (like cygwin) b - fix subnode allocation with pbs_sched b - fix node allocation with suspend-resume b - fix stale job-exclusive state when restarting pbs_server b - don't fall over when duplicate subnodes are assigned after suspend-resume b - handle suspended jobs correctly when restarting pbs_server b - allow long host lists in runjob request b - fix truncated XML output in qstat and pbsnodes b - typo broke compile on irix6array and unicos8 e - momctl now skips down nodes when selecting by property f - added submit_args job attribute 2.1.1 c - fix mom_sync_job code that crashes pbs_server (USC) b - checking disk space in $PBS_SERVER_HOME was mistakenly disabled (USC) e - node's np now accessible in qmgr (USC) f - add ":ALL" as a special node selection when stat'ing nodes (USC) f - momctl can now use :property node selection (USC) f - send cluster addrs to all nodes when a node is created in qmgr (USC) - new nodes are marked offline - all nodes get new cluster ipaddr list - new nodes are cleared of offline bit f - set a node's np from the status' ncpus (only if ncpus > np) (USC) - controlled by new server attribute "auto_node_np" c - fix possible pbs_server crash when nodes are deleted in qmgr (USC) e - avoid dup streams with nodes for quicker pbs_server startup (USC) b - configure program prefix/suffix will now work correctly (USC) b - handle shared libs in tpackages (USC) f - qstat's -1 option can now be used with -f for easier parsing (USC) b - fix broken TM on OSX (USC) f - add "version" and "configversion" RM requests (USC) b - in pbs-config --libs, don't print rpath if libdir is in the sys dlsearch path (USC) e - don't reject job submits if nodes are temporarily down (USC) e - if MOM can't resolve $pbsserver at startup, try again later (USC) - $pbsclient still suffers this problem c - fix nd_addrs usage in bad_node_warning() after deleting nodes (MSIC) b - enable build of xpbsmom on darwin systems (JAX) e - run-time config of MOM's rcp cmd (see pbs_mom(8)) (USC) e - momctl can now accept query strings with spaces, multiple -q opts (USC) b - fix linking order for single-pass linkers like IRIX (ncifcrf) b - fix mom compile on solaris with statfs (USC) b - memory corruption on job exit causing cpu0 to be allocated more than once (USC) e - add increased verbosity to tracejob and added '-q' commandline option e - support larger values in qstat output (might break scripts!) (USC) e - make 'qterm -t quick' shutdown pbs_server faster (USC) 2.1.0p0 fixed job tracking with SMP job suspend/resume (MSIC) modify pbs_mom to enforce memory limits for serial jobs (GaTech) - linux only enable 'never' qmgr maildomain value to disable user mail enable qsub reporting of job rejection reason add suspend/resume diagnostics and logging prevent stale job handler from destroying suspended jobs prevent rapid hello from MOM from doing DOS on pbs_server add diagnostics for why node not considered available add caching of local serverhost addr lookup enable job centric vs queue centric queue limit parameter brand new autoconf+automake+libtool build system (USC) automatic MOM restarts for easier upgrades (USC) new server attributes: acl_group_sloppy, acl_logic_or, keep_completed, kill_delay new server attributes: server_name, allow_node_submit, submit_hosts torque.cfg no longer used by pbs_server pbsdsh and TM enhancements (USC) - tm_spawn() returns an error if execution fails - capture TM stdout with -o - run on unique nodes with -u - run on a given hostname with -h largefile support in staging code and when removing $TMPDIR (USC) use bindresvport() instead of looping over calls to bind() (USC) fix qsub "out of memory" for large resource requests (SANDIA) pbsnodes default arg is now '-a' (USC) new ":property" node selection when node stat and manager set (pbsnodes) (USC) fix race with new jobs reporting wrong walltime (USC) sister moms weren't setting job state to "running" (USC) don't reject jobs if requested nodes is too large node_pack=T (USC) add epilogue.parallel and epilogue.user.parallel (SARA) add $PBS_NODENUM, $PBS_MSHOST, and $PBS_NODEFILE to pelogs (USC) add more flexible --with-rcp='scp|rcp|mom_rcp' instead of --with-scp (USC) build/install a single libtorque.so (USC) nodes are no longer checked against server host acl list (USC) Tcl's buildindex now supports a 3rd arg for "destdir" to aid fakeroot installs (USC) fixed dynamic node destroy qmgr option install rm.h (USC) printjob now prints saved TM info (USC) make MOM restarts with running jobs more reliable (USC) fix return check in pbs_rescquery fixing segfault in pbs_sched (USC) add README.pbstools to contrib directory workaround buggy recvfrom() in Tru64 (USC) attempt to handle socklen_t portably (USC) fix infinite loop in is_stat_get() triggered by network congestion (USC) job suspend/resume enhancements (see qsig manpage) (USC) support higher file descriptors in TM by using poll() instead of select() (USC) immediate job delete feedback to interactive queued jobs (USC) move qmgr manpage from section 8 to section 1 add SuSE initscripts to contrib/init.d/ fix ctrl-c race while starting interactive jobs (USC) fix memory corruption when tm_spawn() is interrupted (USC) 2.0.0p8 really fix torque.cfg parsing (USC) fix possible overlapping memcpy in ACL parsing (USC) fix rare self-inflicted sigkill in MOM (USC) 2.0.0p7 fixed pbs_mom SEGV in req_stat_job() fixed torque.cfg parameter handling fixed qmgr memory leak 2.0.0p6 fix segfault in new "acl_group_sloppy" code if a group doesn't exist (USC) configure defaults changed to enable syslog, enable docs, and disable filesync (USC) pelog now correctly restores previous alarm handler (Sandia) misc fixes with syscalls returns, sign-mismatches, and mem corruption (USC) prevent MOM from killing herself on new job race condition (USC) - so far, only linux is fixed remove job delete nanny earlier to not interrupt long stageouts (USC) display C state later when using keep_completed (USC) add 'printtracking' command in src/tools (USC) stop overriding the user with name resolution on qsub's -o/-e args (USC) xpbsmon now works with Tcl 8.4 (BCGSC) don't bother spooling/keeping job output intended for /dev/null (USC) correct missing hpux11 manpage (USC) fix compile for freebsd - missing symbols (yahoo) fix momctl exit code (yahoo) new "exit_status" job attribute (USC) new "mail_domain" server attribute (overrides --maildomain) (USC) configure fixes for linux x86_64 and tcl install weirdness (USC) extended mom parameter buffer space change pbs_mkdirs to use standard var names so that chroot installs work better (USC) torque.spec now has tcl/gui and wordexp enabled by default enable multiple dynamic+static generic resources per node (GATech) make sure attrs on job launch are sent to server (fixes session_id) (USC) add resmom job modify logging torque.cfg parsing fixes 2.0.0p5 reorganize ji_newt structure to eliminate 64 bit data packing issues enable '--disable-spool' configure directive enable stdout/stderr stageout to search through $HOME and $HOME/.pbs_spool fixes to qsub's env handling for newlines and commas (UMU) fixes to at_arst encoding and decoding for newlines and commas (USC) use -p with rcp/scp (USC) several fixes around .pbs_spool usage (USC) don't create "kept" stdout/err files ugo+rw (avoid insane umask) (USC) qsub -V shouldn't clobber qsub's environ (USC) don't prevent connects to "down" nodes that are still talking (USC) allow file globs to work correctly under --enable-wordexp (USC) enable secondary group checking when evaluating queue acl_group attribute - enable the new queue parameter "acl_group_sloppy" sol10 build system fixes (USC) fixed node manager buffer overflow (UMU) fix "pbs_version" server attribute (USC) torque.spec updates (USC) remove the leading space on the node session attribute on darwin (USC) prevent SEGV if config file is missing/corrupt "keep_completed" execution queue attribute several misc code fixes (UMU) 2.0.0p4 fix up socklen_t issues fixed epilog to report total job resource utilization improved RPM spec (USC) modified qterm to drop hung connections to bad nodes enhance HPUX operation 2.0.0p3 fixed dynamic gres loading in pbs_mom (CRI) added torque.spec (rpmbuild -tb should work) (USC) new 'packages' make target (see INSTALL) (USC) added '-1' qstat option to display node info (UMICH) various fixes in file staging and copying (USC) - reenable stageout of directories - fix confusing email messages on failed stageout - child processes can't use MOM's logging, must use syslog fix overflow in RM netload (USC) don't check walltime on sister nodes, only on MS (ANU) kill_task wasn't being declared properly for all mach types (USC) don't unnecessarily link with libelf and libdl (USC) fix compile warnings with qsort/bsearch on bsd/darwin (USC) fix --disable-filesync to actually work (USC) added prolog diagnostics to 'momctl -d' output (CRI) added logging for job file management (CRI) added mom parameter $ignwalltime (CRI) added $PBS_VNODENUM to job/TM env (USC) fix self-referencing job deps (USC) Use --enable-wordexp to enable variables in data staging (USC) $PBS_HOME/server_name is now used by MOM _iff $pbsserver isn't used_ (USC) Fix TRU64 compile issues (NCIFCRF) Expand job limits up to ULONG_MAX (NCIFCRF) user-supplied TMPDIR no longer treated specially (USC) remtree() now deals with symlinks correctly (USC) enable configurable mail domain (Sandia) configure now handles darwin8 (USC) configure now handles --with-scp=path and --without-scp correctly (USC) 2.0.0p2 fix check_pwd() memory leak (USC) 2.0.0p1 fix mpiexec stdout regression from 2.0.0p0 (USC) add 'qdel -m' support to enable annotating job cancellation (CRI) add mom diagnostics for prolog failures and timeouts (CRI) interactive jobs cannot be rerunable (USC) be sure nodefile is removed when job is purged (USC) don't run epilogue multiple times when multiple jobs exit at once (USC) fix clearjob MOM request (momctl -c) (USC) fix detection of local output files with localhost or /dev/null (USC) new qstat/qselect -e option to only select jobs in exec queues (USC) $clienthost and $headnode removed, $pbsclient and $pbsserver added (USC) $PBS_HOME/server_name is now added to MOM's server list (USC) resmom transient TMPDIR (USC) add joblist to MOM's status & add experimental server "mom_job_sync" (USC) export PBS_SCHED_HINT to pelogues if set in the job (USC) don't build or install pbs_rcp if --enable-scp (USC) set user hold on submitted jobs with invalid deps (USC) add initial multi-server support for HA (CRI) Altix cpuset enhancements (CSIRO) enhanced momctl to diagnose and report on connectivity issues (CRI) added hostname resolution diagnostics and logging (CRI) fixed 'first node down' rpp failure (USC) improved qsub response time 2.0.0p0 torque patches for RCP and resmom (UCHSC) enhanced DIS logging improved start-up to support quick startup with down nodes fixed corrupt job/node/queue API reporting fixed tracejob for large jobs (Sandia) changed qdel to only send one SIGTERM at mom level fixed doc build by adding AIX 5 resources docs added prerun timeout change (RENTEC) added code to handle select() EBADF - 9 disabled MOM quota feature by default, enabled with -DTENABLEQUOTA cleanup MOM child error messages (USC) fix makedepend-sh for gcc-3.4 and higher (DTU) don't fallback to mom_rcp if configured to use scp (USC) 1.2.0p6 enabled opsys mom config (USC) enabled arch mom config (CRI) fixed qrun based default scheduling to ignore down nodes (USC) disable unsetting of key/integer server parameters (USC) allow FC4 support - quota struct fix (USC) add fix for out of memory failure (USC) add file recovery failure messages (USC) add direct support for external scheduler extensions add passwd file corruption check add job cancel nanny patch (USC) recursively remove job dependencies if children can never be satisfied (USC) make poll_jobs the default behavior with a restat time of 45 seconds added 'shell-use-arg' patch (OSC) improved API timeout disconnect feature added improved rapid start up reworked mom-server state management (USC) - removed 'unknown' state - improved pbsnodes 'offline' management - fixed 'momctl -C' which actually _prevented_ an update - fixed incorrect math on 'tmpTime' - added 'polltime' to the math on 'tmpTime' - consolidated node state changes to new 'update_node_state()' - tightened up the "node state machine" - changed mom's state to follow the documented state guidelines - correctly handle "down" from mom - moved server stream handling out of 'is_update_stat()' to new 'init_server_stream()' - refactored the top of the main loop to tighten up state changes - fixed interval counting on the health check script - forced health check script if update state is forced - don't spam the server with updates on startup - required new addr list after connections are dropped - removed duplicate state updates because of broken multi-server support - send "down" if internal_state is down (aix's query_adp() can do this) - removed ferror() check on fread() because fread() randomly fails on initial mom startup. - send "down" if health check returns "ERROR" - send "down" if disk space check fails. 1.2.0p5 make '-t quick' default behavior for qterm added '-p' flag to qdel to enable forced job purge (USC) fixed server resources_available n-1 issue added further Altix CPUSet support (NCSA) added local checkpoint script support for linux fixed 'premature end of message warning' clarify job deleted mail message (SDSC) fixed AIX 5.3 support in configure (WestGrid) fixed crash when qrun issued on job with incomplete requeue added support for >= 4GB memory usage (GMX) log job execution limits failures added more detailed error messages for missing user shell on mom fixed qsub env overflow issue 1.2.0p4 extended job prolog to include jobname, resource, queue, and account info (MAINE) added support for Darwin 8/OS X 10.4 (MAINE) fixed suspend/resume for MPI jobs (NORWAY) added support for epilog.precancel to enable local job cancellation handling fixed build for case insensitive filesystems fixed relative path based Makefiles for xpbsmom added support for gcc 4.0 added PBSDEBUG support to client commands to allow more verbose diagnostics of client failures added ALLOWCOMPUTEHOSTSUBMIT option to torque.cfg fixed dynamic pbs_server loglevel support added mom-server rpp socket diagnostics added support for multi-homed hosts w/SERVERHOST parameter in torque.cfg added support for static linking w/PBSBINDIR added availmem/totmem support to Darwin systems (MAINE) added netload support to Darwin systems (MAINE) 1.2.0p3 enable multiple server to mom communication fixed node reject message overwrite issue enable pre-start node health check (BOEING) fixed pid scanning for RHEL3 (VPAC) added improved vmem/mem limit enforcement and reporting (UMU) added submit filter return code processing to qsub 1.2.0p2 enhance network failure messages fixed tracejob tool to only match correct jobs (WESTGRID) modified reporting of linux availmem and totmem to allow larger file sizes fixed pbs_demux for OSF/TRU64 systems to stop orphaned demux processes added dynamic pbs_server loglevel specification added intelligent mom job stat sync'ing for improved scalability (USC/CRI) added mom state sync patch for dup join (USC) added spool dir space check (MAINE) 1.2.0p1 add default DEFAULTMAILDOMAIN configure option improve configure options to use pbs environment (USC) use openpty() based tty management by default enable default resource manager extensions make mom config parameters case insensitive added jobstartblocktime mom parameter added bulk read in pbs_disconnect() (USC) added support for solaris 5 added support for program args in pbsdsh (USC) added improved task recovery (USC) 1.2.0p0 fixed MOM state update behavior (USC/Poland) fixed set_globid() crash added support for > 2GB file size job requirements updated config.guess to 2003 release general patch to initialize all function variables (USC) added patch for serial job TJE leakage (USC) add "hw.memsize" based physmem MOM query for darwin (Maine) add configure option (--disable-filesync) to speed up job submission set PBS mail precedence to bulk to avoid vactaion responses (VPAC) added multiple changes to address gcc warnings (USC) enabled auto-sizing of 'qstat -Q' columns purge DOS EOL characters from submit scripts 1.1.0p6 added failure logging for various MOM job launch failures (USC) allow qsub '-d' relative path qsub specification enabled $restricted parameter w/in FIFO to allow used of non-privileged ports (SAIC) checked job launch status code for retry decisions added nodect resource_available checking to FIFO disabled client port binding by default for darwin systems (use --enable-darwinbind to re-enable) - workaround for darwin bind and pclose OS bugs fixed interactive job terminal control for MAC (NCIFCRF) added support for MAC MOM-level cpu usage tracking (Maine) fixed __P warning (USC) added support for server level resources_avail override of job nodect limits (VPAC) modify MOM copy files and delete file requests to handle NFS root issues (USC/CRI) enhance port retry code to support mac socket behavior clean up file/socket descriptors before execing prolog/epilog enable dynamic cpu set management (ORNL) enable array services support for memory management (ORNL) add server command logging to diagnostics fix linux setrlimit persistance on failures 1.1.0p5 added loglevel as MOM config parameter distributed job start sequence into multiple routines force node state/subnode state offline stat synchronization (NCSA) fixed N-1 cpu allocation issue (no sanity checking in set_nodes) enhance job start failure logging added continued port checking if connect fails (rentec) added case insensitive host authentication checks added support for submitfilter command line args added support for relocatable submitfilter via torque.cfg fixed offline status cleared when server restarted (USC) updated PBSTop to 4.05 (USC) fixed PServiceType array to correctly report service messages fixed pbs_server crash from job dependencies prevent mom from truncating lock file when mom is already running tcp timeout added as config option 1.1.0p4 added 15004 error logging added use of openpty() call for locating pseudo terminals (SNL) add diagnostic reporting of config and executable version info add support for config push add support for MOM config version parameters log node offline/online and up/down state changes in pbs_server logs add mom fork logging and home directory check add timeout checking in rpp socket handling added buffer overflow prevention routines added lockfile logging supported protected env variables with qstat 1.1.0p3 added support for node specification w/pbsnodes -a added hstfile support to momctl added chroot (-D) support (SRCE) added mom chdir pjob check (SRCE) fixed MOM HELLO initialization procedure added momctl diagnostic/admin command (shutdown, reconfig, query, diagnose) added mom job abort bailout to prevent infinite loops added network reinitialization when socket failure detected added mom-to-scheduler reporting when existing job detected added mom state machine failure logging 1.1.0p2 add support for disk size reporting via pbs_mom fixed netload initialization fixed orphans on mom fork failure updated to pbstop v 3.9 (USC) fixed buffer overflow issue in net_server.c added pestat package to contrib (ANU) added parameter checking to cpy_stage() (NCSA) added -x (xml output) support for 'qstat -f' and 'pbsnodes -a' added SSS xml library (SSS) updated user-project mapping enforcement (ANL) fix bogus 'cannot find submitfilter' message for interactive jobs fix incorrect job allocation issue for interactive jobs (NCSA) prevent failure with invalid 'servername' specification (NCSA) provide more meaningful 'post processing error' messages (NCSA) check for corrupt jobs in server database and remove them immediately enable SIGUSR1/SIGUSR2 pbs_mom dynamic loglevel adjustment profiling enhancements use local directory variable in scan_non_child_tasks() to prevent race condition (VPAC) added AIX 5 odm support for realmem reporting (VPAC) 1.1.0p1 added pbstop to contrib (USC) added OSC mpiexec patch (OSC) confirmed OSC mom-restart patch (OSC) fix pbsd_init purge job tracking allow tracking of completed jobs (w/TORQUEKEEPCOMPLETED env) added support for MAC OS 10 added qsub wrapper support added '-d' qsub command line flag for specifying working directory fixed numerous spelling issues in pbs docs enable logical or'ing of user and group ACL's allow large memory sizes for physmem under solaris (USC) fixed qsub SEGV on bad '-o' specification add null checking on ap->value fixed physmem() routine for tru64 systems to load compute node physical memory added netload tracking 1.1.0p0 fixed linux swap space checking fixed AIX5 resmom ODM memory leak handle split var/etc directories for default server check (CHPC) add pbs_check utility added TERAGRID nospool log bounds checking add code to force host domains to lower case verified integration of OSC prologue-environment.patch (export Resource_List.nodes in an environment variable for prologue) verified integration of OSC no-munge-server-name.patch (do not install over existing server_name) verified integration of OSC docfix.patch (fix minor manpage type) 1.0.1p6 add messaging to report remote data staging failures to pbs_server added tcp_timeout server parameter add routine to mark hung nodes as down add torque.setup initialization script track okclient status fixed INDIANA ji_grpcache MOM crash fixed pbs_mom PBSLOGLEVEL/PBSDEBUG support fixed pbs_mom usage added rentec patch to mom 'sessions' output fixed pbs_server --help option added OSC patch to allow jobs to survive mom shutdown added patch to support server level node comments added support for reporting of node static resources via sss interface added support for tracking available physical memory for IRIX/Linux systems added support for per node probes to dynamically report local state of arbitrary value fixed qsub -c (checkpoint) usage 1.0.1p5 add SUSE 9.0 support add Linux 2.4 meminfo support add support for inline comments in mom_priv/conf allow support for upto 100 million unique jobs add pbs_resources_all documentation fix kill_task references add contrib/pam_authuser 1.0.1p4 fixed multi-line readline buffer overflow extended TORQUE documentation fixed node health check management 1.0.1p3 added support for pbs_server health check and routing to scheduler added support for specification of more than one clienthost parameter added PW unused-tcp-interrupt patch added PW mom-file-descriptor-leak patch added PW prologue-bounce patch added PW mlockall patch (release mlock for mom children) added support for job names up to 256 chars in length added PW errno-fix patch 1.0.1p2 added support for macintosh (darwin) fixed qsub 'usage' message to correctly represent '-j', '-k', '-m', and '-q' support add support for 'PBSAPITIMEOUT' env variable fixed mom dec/hp/linux physmem probes to support 64 bit fixed mom dec/hp/linux availmem probes to support 64 bit fixed mom dec/hp/linux totmem probes to support 64 bit fixed mom dec/hp/linux disk_fs probes to support 64 bit removed pbs server request to bogus probe added support for node 'message' attribute to report internal failures to server/scheduler corrected potential buffer overflow situations improved logging replacing 'unknown' error with real error message enlarged internal tcp message buffer to support 2000 proc systems fixed enc_attr return code checking Patches incorporated prior to patch 2: HPUX superdome support add proper tracking of HP resources - Oct 2003 (NOR) is_status memory leak patches - Oct 2003 (CRI) corrects various memory leaks Bash test - Sep 2003 (FHCRC) allows support for linked shells at configure time AIXv5 support -Sep 2003 (CRI) allows support for AIX 5.x systems OSC Meminfo -- Dec 2001 (P. Wycoff) corrects how pbs_mom figures out how much physical memory each node has under Linux Sandia CPlant Fault Tolerance I (w/OSC enhancements) -- Dec 2001 (L. Fisk/P. Wycoff) handles server-MOM hangs OSC Timeout I -- Dec 2001 (P. Wycoff) enables longer inter daemon timeouts OSC Prologue Env I -- Jan 2002 (P. Wycoff) add support for env variable PBS_RESOURCE_NODES in job prolog OSC Doc/Install I -- Dec 2001 (P. Wycoff) fix to the pbsnodes man page Configuration information for Linux on the IA64 architecture fix the build process to make it clean out the documentation directories during a "make distclean" fix the installation process to keep it from overwriting ${PBS_HOME}/server_name if it already exists correct code creating compile time warnings allow PBS to compile on Linux systems which do not have the Linux kernel source installed Maui RM Extension -- Dec 2002 (CRI) enable Maui resource manager extensions including QOS, reservations, etc NCSA Scaling I -- Mar 2001 (G. Arnold) increase number of nodes supported by PBS to 512 NCSA No Spool -- Apr 2001 (G. Arnold) support $HOME/.pbs_spool for large jobs NCSA MOM Pin pin PBS MOM into memory to keep it from getting swapped ANL RPP Tuning -- Sep 2000 (J Navarro) tuning RPP for large systems WGR Server Node Allocation -- Jul 2000 (B Webb) addresses issue where PBS server incorrectly claims insufficient nodes WGR MOM Soft Kill -- May 2002 (B Webb) processes are killed with SIGTERM followed by SIGKILL PNNL SSS Patch -- Jun 2002 (Skousen) improves server-mom communication and server-scheduler CRI Job Init Patch -- Jul 2003 (CRI) correctly initializes new jobs eliminating unpredictable behavior and crashes VPAC Crash Trap -- Jul 2003 (VPAC) supports PBSCOREDUMP env variable CRI Node Init Patch -- Aug 2003 (CRI) correctly initializes new nodes eliminating unpredictable behavior and crashes SDSC Log Buffer Patch -- Aug 2003 (SDSC) addresses log message overruns torque-2.4.16/README.torque0000664000113300011330000000311111614035207012225 00000000000000# # TORQUE 2.4.16 README (released Jul, 27 2011) # Homepage: http://clusterresources.com/torque Latest release available at: http://clusterresources.com/downloads/torque Documentation: http://clusterresources.com/torquedocs21 Mailing list: torqueusers@supercluster.org OVERVIEW -------------------- TORQUE (Terascale Open-source Resource and QUEue manger) is an open source project based on the original PBS* resource manager developed by NASA, LLNL, and MRJ. It possesses a large number of enhancements contributed by organizations such as OSC, NCSA, TeraGrid, the U.S Dept of Energy, USC, and many, many others. It continues to incorporate significant advancements in the areas of scalability, fault-tolerance, usability, functionality, and security development from the community and vendor supporters. It may be utilized, modified, and distributed subject to the constraints of the license located in the PBS_License.txt file. If you would like to contribute to this project or have patches, enhancements, or associated projects you would like to have included in this project, please send email to help@supercluster.org INSTALL ---------------------- Install directions are available at http://www.clusterresources.com/products/torque/docs/a.ltorquequickstart.shtml More detailed instructions are available in the PBS Administrator's Guide available in admin_guide.ps found in the 'doc' subdirectory or at http://www.clusterresources.com/products/torque/docs/ * TORQUE is not endorsed by nor affiliated with Altair.